Commit 135ef43c075ae399c678dabe360b32f57cb4cf69
Merge branch 'ft-dev' into 'main'
fix:修改设备配置编辑问题,修改场景联动点击编辑回显设备问题,修改了租户配置样式问题 See merge request huang/yun-teng-iot-front!146
Showing
23 changed files
with
313 additions
and
289 deletions
@@ -161,9 +161,7 @@ | @@ -161,9 +161,7 @@ | ||
161 | }); | 161 | }); |
162 | proxy.$refs.DeviceProfileStep3Ref.clearProfileDataFunc(); | 162 | proxy.$refs.DeviceProfileStep3Ref.clearProfileDataFunc(); |
163 | proxy.$refs.DeviceProfileStep3Ref.addAlarmRule(); | 163 | proxy.$refs.DeviceProfileStep3Ref.addAlarmRule(); |
164 | - setTimeout(() => { | ||
165 | - emit('success'); | ||
166 | - }, 10); | 164 | + // emit('success'); |
167 | } else if (isUpdate.value == 3) { | 165 | } else if (isUpdate.value == 3) { |
168 | postEditId.value = data.record.id; | 166 | postEditId.value = data.record.id; |
169 | getBackendData = await deviceConfigGetDetail(postEditId.value); | 167 | getBackendData = await deviceConfigGetDetail(postEditId.value); |
@@ -184,9 +182,7 @@ | @@ -184,9 +182,7 @@ | ||
184 | }); | 182 | }); |
185 | proxy.$refs.DeviceProfileStep3Ref.clearProfileDataFunc(); | 183 | proxy.$refs.DeviceProfileStep3Ref.clearProfileDataFunc(); |
186 | proxy.$refs.DeviceProfileStep3Ref.addAlarmRule(); | 184 | proxy.$refs.DeviceProfileStep3Ref.addAlarmRule(); |
187 | - setTimeout(() => { | ||
188 | - emit('success'); | ||
189 | - }, 10); | 185 | + // emit('success'); |
190 | } | 186 | } |
191 | }); | 187 | }); |
192 | function handleStepPrev() { | 188 | function handleStepPrev() { |
@@ -211,57 +207,64 @@ | @@ -211,57 +207,64 @@ | ||
211 | current.value++; | 207 | current.value++; |
212 | getStepTwoData.value = v; | 208 | getStepTwoData.value = v; |
213 | if (isUpdate.value == 1) { | 209 | if (isUpdate.value == 1) { |
214 | - proxy.$refs.DeviceProfileStep3Ref.initAddAlarmRuleFunc(); | ||
215 | - proxy.$refs.DeviceProfileStep3Ref.resetRegisterFormCreateAlarmFunc(); | 210 | + try { |
211 | + proxy.$refs.DeviceProfileStep3Ref.initAddAlarmRuleFunc(); | ||
212 | + proxy.$refs.DeviceProfileStep3Ref.resetRegisterFormCreateAlarmFunc(); | ||
213 | + } catch {} | ||
216 | } else if (isUpdate.value == 2) { | 214 | } else if (isUpdate.value == 2) { |
217 | - proxy.$refs.DeviceProfileStep3Ref.setAlaramTypeFormFunc({ | ||
218 | - alarmType: editData.value?.profileData.alarms[0].alarmType, | ||
219 | - }); | ||
220 | - proxy.$refs.DeviceProfileStep3Ref.setTransmitAlarmFormFunc({ | ||
221 | - propagate: editData.value?.profileData.alarms[0].propagate, | ||
222 | - propagateRelationTypes: editData.value?.profileData.alarms[0].propagateRelationTypes[0], | ||
223 | - }); | ||
224 | - //回显报警详细信息 | ||
225 | - proxy.$refs.DeviceProfileStep3Ref.setRegisterFormChangeDetailFunc({ | ||
226 | - isEditStatus: true, | ||
227 | - stepThreeData: editData.value?.profileData.alarms[0].createRules, | ||
228 | - stepThreeClearData: editData.value?.profileData.alarms[0].clearRule, | ||
229 | - }); | ||
230 | - proxy.$refs.DeviceProfileStep3Ref.setCreateRegisterFormChangeDetailFunc( | ||
231 | - editData.value?.profileData.alarms[0].createRules | ||
232 | - ); | ||
233 | - proxy.$refs.DeviceProfileStep3Ref.setRegisterFormClearChangeDetailFunc({ | ||
234 | - alarmDetails: editData.value?.profileData.alarms[0].clearRule.alarmDetails, | ||
235 | - }); | ||
236 | - proxy.$refs.DeviceProfileStep3Ref.setRegisterFormCreateAlarmFunc({ | ||
237 | - default: editData.value?.profileData.alarms[0].createRules, | ||
238 | - }); | ||
239 | - //回显创建报警规则和清除报警规则 | 215 | + try { |
216 | + proxy.$refs.DeviceProfileStep3Ref.setAlaramTypeFormFunc({ | ||
217 | + alarmType: editData.value?.profileData.alarms[0].alarmType, | ||
218 | + }); | ||
219 | + proxy.$refs.DeviceProfileStep3Ref.setTransmitAlarmFormFunc({ | ||
220 | + propagate: editData.value?.profileData.alarms[0].propagate, | ||
221 | + propagateRelationTypes: | ||
222 | + editData.value?.profileData.alarms[0].propagateRelationTypes[0], | ||
223 | + }); | ||
224 | + //回显报警详细信息 | ||
225 | + proxy.$refs.DeviceProfileStep3Ref.setRegisterFormChangeDetailFunc({ | ||
226 | + isEditStatus: true, | ||
227 | + stepThreeData: editData.value?.profileData.alarms[0].createRules, | ||
228 | + stepThreeClearData: editData.value?.profileData.alarms[0].clearRule, | ||
229 | + }); | ||
230 | + proxy.$refs.DeviceProfileStep3Ref.setCreateRegisterFormChangeDetailFunc( | ||
231 | + editData.value?.profileData.alarms[0].createRules | ||
232 | + ); | ||
233 | + proxy.$refs.DeviceProfileStep3Ref.setRegisterFormClearChangeDetailFunc({ | ||
234 | + alarmDetails: editData.value?.profileData.alarms[0].clearRule.alarmDetails, | ||
235 | + }); | ||
236 | + proxy.$refs.DeviceProfileStep3Ref.setRegisterFormCreateAlarmFunc({ | ||
237 | + default: editData.value?.profileData.alarms[0].createRules, | ||
238 | + }); | ||
239 | + //回显创建报警规则和清除报警规则 | ||
240 | + } catch {} | ||
240 | } else if (isUpdate.value == 3) { | 241 | } else if (isUpdate.value == 3) { |
241 | - proxy.$refs.DeviceProfileStep3Ref.setAlaramTypeFormFunc({ | ||
242 | - alarmType: editData.value?.profileData.alarms[0].alarmType, | ||
243 | - }); | ||
244 | - proxy.$refs.DeviceProfileStep3Ref.setTransmitAlarmFormFunc({ | ||
245 | - propagate: editData.value?.profileData.alarms[0].propagate, | ||
246 | - propagateRelationTypes: editData.value?.profileData.alarms[0].propagateRelationTypes[0], | ||
247 | - }); | ||
248 | - //回显报警详细信息 | ||
249 | - proxy.$refs.DeviceProfileStep3Ref.setRegisterFormChangeDetailFunc({ | ||
250 | - isEditStatus: true, | ||
251 | - stepThreeData: editData.value?.profileData.alarms[0].createRules, | ||
252 | - stepThreeClearData: editData.value?.profileData.alarms[0].clearRule, | ||
253 | - }); | ||
254 | - proxy.$refs.DeviceProfileStep3Ref.setCreateRegisterFormChangeDetailFunc( | ||
255 | - editData.value?.profileData.alarms[0].createRules | ||
256 | - ); | ||
257 | - proxy.$refs.DeviceProfileStep3Ref.setRegisterFormClearChangeDetailFunc({ | ||
258 | - alarmDetails: editData.value?.profileData.alarms[0].clearRule.alarmDetails, | ||
259 | - }); | ||
260 | - //回显创建报警规则和清除报警规则 | 242 | + try { |
243 | + proxy.$refs.DeviceProfileStep3Ref.setAlaramTypeFormFunc({ | ||
244 | + alarmType: editData.value?.profileData.alarms[0].alarmType, | ||
245 | + }); | ||
246 | + proxy.$refs.DeviceProfileStep3Ref.setTransmitAlarmFormFunc({ | ||
247 | + propagate: editData.value?.profileData.alarms[0].propagate, | ||
248 | + propagateRelationTypes: | ||
249 | + editData.value?.profileData.alarms[0].propagateRelationTypes[0], | ||
250 | + }); | ||
251 | + //回显报警详细信息 | ||
252 | + proxy.$refs.DeviceProfileStep3Ref.setRegisterFormChangeDetailFunc({ | ||
253 | + isEditStatus: true, | ||
254 | + stepThreeData: editData.value?.profileData.alarms[0].createRules, | ||
255 | + stepThreeClearData: editData.value?.profileData.alarms[0].clearRule, | ||
256 | + }); | ||
257 | + proxy.$refs.DeviceProfileStep3Ref.setCreateRegisterFormChangeDetailFunc( | ||
258 | + editData.value?.profileData.alarms[0].createRules | ||
259 | + ); | ||
260 | + proxy.$refs.DeviceProfileStep3Ref.setRegisterFormClearChangeDetailFunc({ | ||
261 | + alarmDetails: editData.value?.profileData.alarms[0].clearRule.alarmDetails, | ||
262 | + }); | ||
263 | + //回显创建报警规则和清除报警规则 | ||
264 | + } catch {} | ||
261 | } | 265 | } |
262 | } | 266 | } |
263 | function handleStep3Next(v, v1) { | 267 | function handleStep3Next(v, v1) { |
264 | - console.log(v1); | ||
265 | isEditAndChange.value = v1; | 268 | isEditAndChange.value = v1; |
266 | current.value++; | 269 | current.value++; |
267 | getStepThreeData.value = v; | 270 | getStepThreeData.value = v; |
@@ -308,7 +311,6 @@ | @@ -308,7 +311,6 @@ | ||
308 | isEditAndChange.value == true | 311 | isEditAndChange.value == true |
309 | ? editData.value.profileData.alarms | 312 | ? editData.value.profileData.alarms |
310 | : getStepThreeData.value; | 313 | : getStepThreeData.value; |
311 | - // isGetStepThreeData.profileData.alarms = getStepThreeData.value; | ||
312 | postDeviceConfogData.value.id = postEditId.value; | 314 | postDeviceConfogData.value.id = postEditId.value; |
313 | getStepFourData = await proxy.$refs.DeviceProfileStep4Ref.getAllFields(); | 315 | getStepFourData = await proxy.$refs.DeviceProfileStep4Ref.getAllFields(); |
314 | const getJoinAlarmContactIdData = getStepFourData.alarmContactId.join(','); | 316 | const getJoinAlarmContactIdData = getStepFourData.alarmContactId.join(','); |
@@ -342,7 +344,6 @@ | @@ -342,7 +344,6 @@ | ||
342 | } | 344 | } |
343 | }; | 345 | }; |
344 | return { | 346 | return { |
345 | - // isEditFunc, | ||
346 | isShowRule, | 347 | isShowRule, |
347 | isShowOkBtnFalse, | 348 | isShowOkBtnFalse, |
348 | isStatus, | 349 | isStatus, |
1 | <template> | 1 | <template> |
2 | <div> | 2 | <div> |
3 | <div class="step3" style="background-color: #f6f8f9"> | 3 | <div class="step3" style="background-color: #f6f8f9"> |
4 | + <!-- 报警规则 --> | ||
4 | <template v-for="(item, index) in profileData" :key="item.id"> | 5 | <template v-for="(item, index) in profileData" :key="item.id"> |
5 | <CollapseContainer class="border mb-1" :canExpan="false"> | 6 | <CollapseContainer class="border mb-1" :canExpan="false"> |
6 | <!-- 移除按钮 --> | 7 | <!-- 移除按钮 --> |
@@ -34,7 +35,7 @@ | @@ -34,7 +35,7 @@ | ||
34 | </div> | 35 | </div> |
35 | </div> | 36 | </div> |
36 | </div> | 37 | </div> |
37 | - <!-- 传递报警和报警类型 --> | 38 | + <!-- 报警类型和传递报警 --> |
38 | <!-- 创建报警规则 --> | 39 | <!-- 创建报警规则 --> |
39 | <div style="margin-top: -57px"> | 40 | <div style="margin-top: -57px"> |
40 | <p style="margin-left: 10px; font-size: medium">创建报警规则</p> | 41 | <p style="margin-left: 10px; font-size: medium">创建报警规则</p> |
@@ -297,7 +298,9 @@ | @@ -297,7 +298,9 @@ | ||
297 | <!-- 清除报警规则 --> | 298 | <!-- 清除报警规则 --> |
298 | </CollapseContainer> | 299 | </CollapseContainer> |
299 | </template> | 300 | </template> |
301 | + <!-- 报警规则 --> | ||
300 | </div> | 302 | </div> |
303 | + <!-- 按钮 --> | ||
301 | <div class="flex justify-center" style="display: fixed; bottom: 100px"> | 304 | <div class="flex justify-center" style="display: fixed; bottom: 100px"> |
302 | <a-button class="mr-5" @click="prevStep">上一步</a-button> | 305 | <a-button class="mr-5" @click="prevStep">上一步</a-button> |
303 | <a-button @click="handleFormStep3toStep4Next">下一步</a-button> | 306 | <a-button @click="handleFormStep3toStep4Next">下一步</a-button> |
@@ -309,11 +312,12 @@ | @@ -309,11 +312,12 @@ | ||
309 | >添加报警规则</a-button | 312 | >添加报警规则</a-button |
310 | > | 313 | > |
311 | </div> | 314 | </div> |
315 | + <!-- 按钮 --> | ||
312 | </div> | 316 | </div> |
313 | </template> | 317 | </template> |
314 | 318 | ||
315 | <script lang="ts"> | 319 | <script lang="ts"> |
316 | - import { defineComponent, ref, getCurrentInstance, watch, reactive } from 'vue'; | 320 | + import { defineComponent, ref, getCurrentInstance, reactive } from 'vue'; |
317 | import type { IProfileData } from './index.t'; | 321 | import type { IProfileData } from './index.t'; |
318 | import { CollapseContainer } from '/@/components/Container/index'; | 322 | import { CollapseContainer } from '/@/components/Container/index'; |
319 | import { BasicForm, useForm } from '/@/components/Form'; | 323 | import { BasicForm, useForm } from '/@/components/Form'; |
@@ -321,7 +325,6 @@ | @@ -321,7 +325,6 @@ | ||
321 | step3Schemas, | 325 | step3Schemas, |
322 | step3HighSetting, | 326 | step3HighSetting, |
323 | dashboardFormScheme, | 327 | dashboardFormScheme, |
324 | - isWhereType, | ||
325 | formChangeDetailSchema, | 328 | formChangeDetailSchema, |
326 | } from './data'; | 329 | } from './data'; |
327 | import { PlusCircleOutlined } from '@ant-design/icons-vue'; | 330 | import { PlusCircleOutlined } from '@ant-design/icons-vue'; |
@@ -330,7 +333,6 @@ | @@ -330,7 +333,6 @@ | ||
330 | import EnableRule from './cpns/enablerule/index.vue'; | 333 | import EnableRule from './cpns/enablerule/index.vue'; |
331 | import AlarmRuleConditions from './cpns/alarmruleconditions/index.vue'; | 334 | import AlarmRuleConditions from './cpns/alarmruleconditions/index.vue'; |
332 | import { Button } from '/@/components/Button'; | 335 | import { Button } from '/@/components/Button'; |
333 | - export const isWhereTypeValueDisabled = ref(false); | ||
334 | import AlarmSeverity from './cpns/alarmseverity/index.vue'; | 336 | import AlarmSeverity from './cpns/alarmseverity/index.vue'; |
335 | import DetailTemplate from './cpns/detailtemplate/index.vue'; | 337 | import DetailTemplate from './cpns/detailtemplate/index.vue'; |
336 | import { generateUUID } from '/@/hooks/web/useGenerateUUID'; | 338 | import { generateUUID } from '/@/hooks/web/useGenerateUUID'; |
@@ -367,13 +369,6 @@ | @@ -367,13 +369,6 @@ | ||
367 | const ruleLastObj: any = ref<[]>([]); | 369 | const ruleLastObj: any = ref<[]>([]); |
368 | const enableObj: any = ref({}); | 370 | const enableObj: any = ref({}); |
369 | const enableClearObj: any = ref({}); | 371 | const enableClearObj: any = ref({}); |
370 | - const isWhereTypeValue = ref(null); | ||
371 | - const ruleTemplateData: any = ref(null); | ||
372 | - const enableTemplateData: any = ref(null); | ||
373 | - const detailTemplateData: any = ref(null); | ||
374 | - const ruleClearTemplateData: any = ref(null); | ||
375 | - const enableClearTemplateData: any = ref(null); | ||
376 | - const detailClearTemplateData: any = ref(null); | ||
377 | //重构 | 372 | //重构 |
378 | //告警列表接口 | 373 | //告警列表接口 |
379 | let profileData: any = ref<IProfileData[]>([]); | 374 | let profileData: any = ref<IProfileData[]>([]); |
@@ -413,10 +408,7 @@ | @@ -413,10 +408,7 @@ | ||
413 | propagate: false, | 408 | propagate: false, |
414 | propagateRelationTypes: [''], | 409 | propagateRelationTypes: [''], |
415 | }); | 410 | }); |
416 | - //接收临时启用规则数据 | ||
417 | - const receiveOpenRuleTempArr = ref<[]>([]); | ||
418 | - //接收临时规则条件数据 | ||
419 | - const receiveRuleConditionTempArr = ref<[]>([]); | 411 | + |
420 | //创建条件总对象 | 412 | //创建条件总对象 |
421 | const createRulesObj: any = ref({}); | 413 | const createRulesObj: any = ref({}); |
422 | let addCreateRulesObj = reactive({ | 414 | let addCreateRulesObj = reactive({ |
@@ -469,7 +461,6 @@ | @@ -469,7 +461,6 @@ | ||
469 | let fliterClearTempRuleConditionTempArr = ref<[]>([]); | 461 | let fliterClearTempRuleConditionTempArr = ref<[]>([]); |
470 | let fliterClearTempOpenRuleTempArr: any = ref<[]>([]); | 462 | let fliterClearTempOpenRuleTempArr: any = ref<[]>([]); |
471 | const getStepThreeEditStatus: any = ref(false); | 463 | const getStepThreeEditStatus: any = ref(false); |
472 | - // const isEditDataAndValue = ref(false); | ||
473 | const getStepThreeEditArr = ref<[]>([]); | 464 | const getStepThreeEditArr = ref<[]>([]); |
474 | const getFilterStepThreeEditArr: any = ref<[]>([]); | 465 | const getFilterStepThreeEditArr: any = ref<[]>([]); |
475 | const getFilterStepThreeEditClearArr: any = ref<[]>([]); | 466 | const getFilterStepThreeEditClearArr: any = ref<[]>([]); |
@@ -478,16 +469,13 @@ | @@ -478,16 +469,13 @@ | ||
478 | const detailDetailModelArray = ref<[]>([]); | 469 | const detailDetailModelArray = ref<[]>([]); |
479 | const createAlarmArray = ref<[]>([]); | 470 | const createAlarmArray = ref<[]>([]); |
480 | const isLostFocuxStatus = ref(true); | 471 | const isLostFocuxStatus = ref(true); |
481 | - // const getEditDataAndValue = ref<[]>([]); | ||
482 | const editIndex = ref(-1); | 472 | const editIndex = ref(-1); |
473 | + const allAlarmsData = ref<[]>([]); | ||
474 | + let allAlarmsSingleObj = reactive({}); | ||
483 | 475 | ||
484 | setTimeout(() => { | 476 | setTimeout(() => { |
485 | getIsShowAddRule = props.isShowAddRule; | 477 | getIsShowAddRule = props.isShowAddRule; |
486 | }, 10); | 478 | }, 10); |
487 | - | ||
488 | - const log = (e) => { | ||
489 | - console.log(e); | ||
490 | - }; | ||
491 | const isAddRuleStatusFunc = (v) => { | 479 | const isAddRuleStatusFunc = (v) => { |
492 | isAddRuleStatus.value = v; | 480 | isAddRuleStatus.value = v; |
493 | }; | 481 | }; |
@@ -503,16 +491,7 @@ | @@ -503,16 +491,7 @@ | ||
503 | const prevStep = () => { | 491 | const prevStep = () => { |
504 | emit('prev'); | 492 | emit('prev'); |
505 | }; | 493 | }; |
506 | - //添加报警规则 | ||
507 | - const addAlarmRule = () => { | ||
508 | - profileData.value.push(initProfileData); | ||
509 | - }; | ||
510 | - //初始化添加一个报警规则 | ||
511 | - const initAddAlarmRuleFunc = () => { | ||
512 | - if (profileData.value.length === 0) { | ||
513 | - profileData.value.push(initProfileData); | ||
514 | - } | ||
515 | - }; | 494 | + |
516 | //TODO Mobile dashboard: | 495 | //TODO Mobile dashboard: |
517 | const [dashboardForm] = useForm({ | 496 | const [dashboardForm] = useForm({ |
518 | labelWidth: 120, | 497 | labelWidth: 120, |
@@ -573,16 +552,21 @@ | @@ -573,16 +552,21 @@ | ||
573 | const clearEditAllRegisterFormFunc = () => { | 552 | const clearEditAllRegisterFormFunc = () => { |
574 | getFilterStepThreeEditArr.value.length = 0; | 553 | getFilterStepThreeEditArr.value.length = 0; |
575 | getFilterStepThreeEditArr.value = []; | 554 | getFilterStepThreeEditArr.value = []; |
555 | + try { | ||
556 | + proxy.$refs.alarmSeverityRef.resetFieldsFunc(); | ||
557 | + } catch {} | ||
576 | }; | 558 | }; |
577 | 559 | ||
578 | //重置表单数据 | 560 | //重置表单数据 |
579 | const clearAllRegisterFormFunc = () => { | 561 | const clearAllRegisterFormFunc = () => { |
580 | - setTimeout(() => { | ||
581 | - clearAlaramTypeValueFunc(); | ||
582 | - clearTransmitAlarmFunc(); | ||
583 | - resetRegisterFormClearChangeDetailFunc(); | ||
584 | - resetAllTemplateFunc(); | ||
585 | - }, 10); | 562 | + try { |
563 | + setTimeout(() => { | ||
564 | + clearAlaramTypeValueFunc(); | ||
565 | + clearTransmitAlarmFunc(); | ||
566 | + resetRegisterFormClearChangeDetailFunc(); | ||
567 | + resetAllTemplateFunc(); | ||
568 | + }, 5000); | ||
569 | + } catch {} | ||
586 | }; | 570 | }; |
587 | //重置报警启用规则-报警规则条件 | 571 | //重置报警启用规则-报警规则条件 |
588 | const resetAllTemplateFunc = () => { | 572 | const resetAllTemplateFunc = () => { |
@@ -639,9 +623,9 @@ | @@ -639,9 +623,9 @@ | ||
639 | } | 623 | } |
640 | } | 624 | } |
641 | let formatSchemeMap = | 625 | let formatSchemeMap = |
642 | - openSchemObj?.schedule.type == 'ANY_TIME' | 626 | + openSchemObj?.schedule?.type == 'ANY_TIME' |
643 | ? '始终启用' | 627 | ? '始终启用' |
644 | - : openSchemObj?.schedule.type == 'SPECIFIC_TIME' | 628 | + : openSchemObj?.schedule?.type == 'SPECIFIC_TIME' |
645 | ? '定时启用' | 629 | ? '定时启用' |
646 | : '自定义启用'; | 630 | : '自定义启用'; |
647 | return formatSchemeMap; | 631 | return formatSchemeMap; |
@@ -721,7 +705,6 @@ | @@ -721,7 +705,6 @@ | ||
721 | getFilterStepThreeEditArr.value = []; | 705 | getFilterStepThreeEditArr.value = []; |
722 | getFilterStepThreeEditClearArr.value = []; | 706 | getFilterStepThreeEditClearArr.value = []; |
723 | getStepThreeEditStatus.value = v.isEditStatus; | 707 | getStepThreeEditStatus.value = v.isEditStatus; |
724 | - // isEditDataAndValue.value = v.isEditStatus; | ||
725 | getStepThreeEditArr.value = v.stepThreeData; | 708 | getStepThreeEditArr.value = v.stepThreeData; |
726 | if (getFilterStepThreeEditClearArr.value.length == 0) { | 709 | if (getFilterStepThreeEditClearArr.value.length == 0) { |
727 | getFilterStepThreeEditClearArr.value.push(v.stepThreeClearData as never); | 710 | getFilterStepThreeEditClearArr.value.push(v.stepThreeClearData as never); |
@@ -764,8 +747,6 @@ | @@ -764,8 +747,6 @@ | ||
764 | }; | 747 | }; |
765 | 748 | ||
766 | const emptyCreateRoleFunc = () => { | 749 | const emptyCreateRoleFunc = () => { |
767 | - receiveOpenRuleTempArr.value = []; | ||
768 | - receiveRuleConditionTempArr.value = []; | ||
769 | addNewOpenRule.schedule = {}; | 750 | addNewOpenRule.schedule = {}; |
770 | addNewRuleTem.condition.condition = {}; | 751 | addNewRuleTem.condition.condition = {}; |
771 | }; | 752 | }; |
@@ -797,7 +778,56 @@ | @@ -797,7 +778,56 @@ | ||
797 | const val1 = validateAlaramTypeValueFunc(); | 778 | const val1 = validateAlaramTypeValueFunc(); |
798 | alarmTypeGet.value = val1; | 779 | alarmTypeGet.value = val1; |
799 | }; | 780 | }; |
781 | + //添加报警规则 | ||
782 | + const addAlarmRule = () => { | ||
783 | + profileData.value.push(initProfileData); | ||
784 | + addAlarmRuleFunc(); | ||
785 | + }; | ||
786 | + //添加报警规则方法 | ||
787 | + const addAlarmRuleFunc = () => { | ||
788 | + validateRegisterFormFunc(); | ||
789 | + validateRegisterFormHighSettingFunc(); | ||
790 | + addCreateRuleFunc(); | ||
791 | + tempDetailTempArr.value.push(changeGetDetailValue.value as never); | ||
792 | + tempDetailTempArr.value.forEach((f1) => { | ||
793 | + kongDetail.value = f1; | ||
794 | + }); | ||
795 | + addChangeSeverity.value = proxy.$refs.alarmSeverityRef.getFieldsValueFunc(); | ||
796 | + emptyCreateRoleFunc(); | ||
797 | + getOpenRuleAndRuleCondition(); | ||
798 | + tempOpenRuleTempArr.value.forEach((f2) => { | ||
799 | + kongOpenRuleObj.schedule = f2; | ||
800 | + }); | ||
801 | + tempRuleConditionTempArr.value.forEach((f3) => { | ||
802 | + kongRuleConditionObj.condition = f3; | ||
803 | + }); | ||
804 | + createRulesObj.value[addChangeSeverity.value?.default] = { | ||
805 | + ...kongDetail.value, | ||
806 | + ...addNewOpenRule, | ||
807 | + ...addNewRuleTem, | ||
808 | + ...kongOpenRuleObj, | ||
809 | + ...kongRuleConditionObj, | ||
810 | + }; | ||
811 | + console.log(createRulesObj); | ||
812 | + // const sigleAlarmTypeGetVal = []; | ||
813 | + // let sigleAlarmTypeGetObj = {}; | ||
814 | + // sigleAlarmTypeGetVal.push(alarmTypeGet.value as never); | ||
815 | + // sigleAlarmTypeGetVal.forEach((f) => { | ||
816 | + // sigleAlarmTypeGetObj = f; | ||
817 | + // }); | ||
818 | + // allAlarmsSingleObj = { | ||
819 | + // ...sigleAlarmTypeGetObj, | ||
820 | + // }; | ||
821 | + // allAlarmsData.value.push(allAlarmsSingleObj as never); | ||
822 | + // console.log(allAlarmsData.value); | ||
823 | + }; | ||
800 | 824 | ||
825 | + //初始化添加一个报警规则 | ||
826 | + const initAddAlarmRuleFunc = () => { | ||
827 | + if (profileData.value.length === 0) { | ||
828 | + profileData.value.push(initProfileData); | ||
829 | + } | ||
830 | + }; | ||
801 | // 添加创建条件方法 | 831 | // 添加创建条件方法 |
802 | const addCreateRuleFunc = async () => { | 832 | const addCreateRuleFunc = async () => { |
803 | try { | 833 | try { |
@@ -849,6 +879,7 @@ | @@ -849,6 +879,7 @@ | ||
849 | const addCreateRole = async (index: number) => { | 879 | const addCreateRole = async (index: number) => { |
850 | profileData.value[index]?.alarms.push(initCreateRules); | 880 | profileData.value[index]?.alarms.push(initCreateRules); |
851 | addCreateRuleFunc(); | 881 | addCreateRuleFunc(); |
882 | + proxy.$refs.alarmSeverityRef.updateSchemaSelectDisableFunc(); | ||
852 | }; | 883 | }; |
853 | // 删除创建条件 | 884 | // 删除创建条件 |
854 | const deleteCondition = (index: number, createIndex: number) => { | 885 | const deleteCondition = (index: number, createIndex: number) => { |
@@ -857,13 +888,6 @@ | @@ -857,13 +888,6 @@ | ||
857 | getFilterStepThreeEditArr.value.pop(); | 888 | getFilterStepThreeEditArr.value.pop(); |
858 | } | 889 | } |
859 | }; | 890 | }; |
860 | - | ||
861 | - watch(isWhereType, (nV) => { | ||
862 | - isWhereTypeValue.value = nV; | ||
863 | - if (isWhereTypeValue.value == nV) { | ||
864 | - isWhereTypeValueDisabled.value = true; | ||
865 | - } | ||
866 | - }); | ||
867 | //报警规则 | 891 | //报警规则 |
868 | //启用规则 | 892 | //启用规则 |
869 | const getAllFieldsEnabFunc = (v) => { | 893 | const getAllFieldsEnabFunc = (v) => { |
@@ -877,33 +901,7 @@ | @@ -877,33 +901,7 @@ | ||
877 | fliterTempRuleConditionTempArr.value.push({ | 901 | fliterTempRuleConditionTempArr.value.push({ |
878 | condition: addNewRuleTem.condition.condition, | 902 | condition: addNewRuleTem.condition.condition, |
879 | } as never); | 903 | } as never); |
880 | - // getEditDataAndValue.value.push({ | ||
881 | - // condition: addNewRuleTem.condition.condition, | ||
882 | - // } as never); | ||
883 | }; | 904 | }; |
884 | - //格式化编辑 | ||
885 | - // const isEditDataAndValueFunc = (v) => { | ||
886 | - // let formatMap = v.condition.map((f) => { | ||
887 | - // return f.predicate.operation == 'EQUAL' | ||
888 | - // ? f.key.key + '等于' + f.predicate.value.defaultValue | ||
889 | - // : f.predicate.operation == 'STARTS_WITH' | ||
890 | - // ? f.key.key + '开始于' + f.predicate.value.defaultValue | ||
891 | - // : f.predicate.operation == 'ENDS_WITH' | ||
892 | - // ? f.key.key + '结束于' + f.predicate.value.defaultValue | ||
893 | - // : f.predicate.operation == 'NOT_CONTAINS' | ||
894 | - // ? f.key.key + '不包含' + f.predicate.value.defaultValue | ||
895 | - // : f.predicate.operation == 'NOT_EQUAL' | ||
896 | - // ? f.key.key + '不等于' + f.predicate.value.defaultValue | ||
897 | - // : f.predicate.operation == 'GREATER' | ||
898 | - // ? f.key.key + '大于' + f.predicate.value.defaultValue | ||
899 | - // : f.predicate.operation == 'LESS' | ||
900 | - // ? f.key.key + '小于' + f.predicate.value.defaultValue | ||
901 | - // : f.predicate.operation == 'GREATER_OR_EQUAL' | ||
902 | - // ? f.key.key + '大于或等于' + f.predicate.value.defaultValue | ||
903 | - // : f.key.key + '小于或等于' + f.predicate.value.defaultValue; | ||
904 | - // }); | ||
905 | - // return formatMap; | ||
906 | - // }; | ||
907 | //格式化新增 | 905 | //格式化新增 |
908 | const formatAddRuleFunc = (v) => { | 906 | const formatAddRuleFunc = (v) => { |
909 | let formatMap = v.condition.map((f) => { | 907 | let formatMap = v.condition.map((f) => { |
@@ -974,6 +972,7 @@ | @@ -974,6 +972,7 @@ | ||
974 | }; | 972 | }; |
975 | getRegisterFormChangeDetailFunc(); | 973 | getRegisterFormChangeDetailFunc(); |
976 | addCreateRuleFunc(); | 974 | addCreateRuleFunc(); |
975 | + addAlarmRuleFunc(); | ||
977 | addClearAlaramRule(); | 976 | addClearAlaramRule(); |
978 | getAllObjTemp = { | 977 | getAllObjTemp = { |
979 | ...alarmTypeGet.value, | 978 | ...alarmTypeGet.value, |
@@ -1019,12 +1018,12 @@ | @@ -1019,12 +1018,12 @@ | ||
1019 | getStepThreeEditStatus.value = false; | 1018 | getStepThreeEditStatus.value = false; |
1020 | setTimeout(() => { | 1019 | setTimeout(() => { |
1021 | openModal3(true); | 1020 | openModal3(true); |
1022 | - try { | ||
1023 | - setTimeout(() => { | ||
1024 | - proxy.$refs.getChildData3.resetDataFunc(); | ||
1025 | - }, 10); | ||
1026 | - } catch (e) { | ||
1027 | - return e; | 1021 | + if (true) { |
1022 | + try { | ||
1023 | + setTimeout(() => { | ||
1024 | + proxy.$refs.getChildData3.resetDataFunc(); | ||
1025 | + }, 100); | ||
1026 | + } catch {} | ||
1028 | } | 1027 | } |
1029 | }, 10); | 1028 | }, 10); |
1030 | }; | 1029 | }; |
@@ -1112,15 +1111,9 @@ | @@ -1112,15 +1111,9 @@ | ||
1112 | setAlaramTypeFormFunc, | 1111 | setAlaramTypeFormFunc, |
1113 | setTransmitAlarmFormFunc, | 1112 | setTransmitAlarmFormFunc, |
1114 | clearAllRegisterFormFunc, | 1113 | clearAllRegisterFormFunc, |
1115 | - ruleClearTemplateData, | ||
1116 | - enableClearTemplateData, | ||
1117 | - detailClearTemplateData, | ||
1118 | handleOpenClearDetailTemplate, | 1114 | handleOpenClearDetailTemplate, |
1119 | handleOpenClearEnableRule, | 1115 | handleOpenClearEnableRule, |
1120 | handleOpenClearAlaramRuleConditions, | 1116 | handleOpenClearAlaramRuleConditions, |
1121 | - detailTemplateData, | ||
1122 | - enableTemplateData, | ||
1123 | - ruleTemplateData, | ||
1124 | dashboardForm, | 1117 | dashboardForm, |
1125 | getAllClearFieldsRuleFunc, | 1118 | getAllClearFieldsRuleFunc, |
1126 | getAllClearFieldsEnabFunc, | 1119 | getAllClearFieldsEnabFunc, |
@@ -1140,7 +1133,6 @@ | @@ -1140,7 +1133,6 @@ | ||
1140 | handleOpenAlaramRuleConditions, | 1133 | handleOpenAlaramRuleConditions, |
1141 | handleOpenDetailTemplate, | 1134 | handleOpenDetailTemplate, |
1142 | handleFormStep3toStep4Next, | 1135 | handleFormStep3toStep4Next, |
1143 | - log, | ||
1144 | profileData, | 1136 | profileData, |
1145 | deleteAlarmRule, | 1137 | deleteAlarmRule, |
1146 | prevStep, | 1138 | prevStep, |
@@ -1152,9 +1144,6 @@ | @@ -1152,9 +1144,6 @@ | ||
1152 | setCreateRegisterFormChangeDetailFunc, | 1144 | setCreateRegisterFormChangeDetailFunc, |
1153 | detailDetailModelArray, | 1145 | detailDetailModelArray, |
1154 | isLostFocuxStatus, | 1146 | isLostFocuxStatus, |
1155 | - // isEditDataAndValue, | ||
1156 | - // getEditDataAndValue, | ||
1157 | - // isEditDataAndValueFunc, | ||
1158 | handleClickHidenEdit, | 1147 | handleClickHidenEdit, |
1159 | alarmSeverityRef, | 1148 | alarmSeverityRef, |
1160 | detailTemplateRef, | 1149 | detailTemplateRef, |
@@ -179,6 +179,7 @@ export const formSchema: FormSchema[] = [ | @@ -179,6 +179,7 @@ export const formSchema: FormSchema[] = [ | ||
179 | label: '持续时间值', | 179 | label: '持续时间值', |
180 | colProps: { span: 13 }, | 180 | colProps: { span: 13 }, |
181 | component: 'Input', | 181 | component: 'Input', |
182 | + defaultValue: 0, | ||
182 | componentProps: { | 183 | componentProps: { |
183 | maxLength: 16, | 184 | maxLength: 16, |
184 | placeholder: '请输入持续时间值(请输入数字)', | 185 | placeholder: '请输入持续时间值(请输入数字)', |
@@ -132,7 +132,7 @@ export const formSchema: FormSchema[] = [ | @@ -132,7 +132,7 @@ export const formSchema: FormSchema[] = [ | ||
132 | ifShow: ({ values }) => isString(Reflect.get(values, 'type1')), | 132 | ifShow: ({ values }) => isString(Reflect.get(values, 'type1')), |
133 | }, | 133 | }, |
134 | { | 134 | { |
135 | - field: '', | 135 | + field: 'no', |
136 | label: '大小写', | 136 | label: '大小写', |
137 | component: 'Checkbox', | 137 | component: 'Checkbox', |
138 | colProps: { span: 13 }, | 138 | colProps: { span: 13 }, |
@@ -388,7 +388,7 @@ export const formSchema: FormSchema[] = [ | @@ -388,7 +388,7 @@ export const formSchema: FormSchema[] = [ | ||
388 | ifShow: ({ values }) => isComplex(Reflect.get(values, 'type1')), | 388 | ifShow: ({ values }) => isComplex(Reflect.get(values, 'type1')), |
389 | }, | 389 | }, |
390 | { | 390 | { |
391 | - field: '', | 391 | + field: 'no', |
392 | component: 'DatePicker', | 392 | component: 'DatePicker', |
393 | label: '请选择日期', | 393 | label: '请选择日期', |
394 | colProps: { | 394 | colProps: { |
@@ -400,7 +400,7 @@ export const formSchema: FormSchema[] = [ | @@ -400,7 +400,7 @@ export const formSchema: FormSchema[] = [ | ||
400 | }, | 400 | }, |
401 | }, | 401 | }, |
402 | { | 402 | { |
403 | - field: '', | 403 | + field: 'no', |
404 | component: 'TimePicker', | 404 | component: 'TimePicker', |
405 | label: '请选择时间', | 405 | label: '请选择时间', |
406 | colProps: { | 406 | colProps: { |
@@ -6,6 +6,7 @@ | @@ -6,6 +6,7 @@ | ||
6 | @register="register" | 6 | @register="register" |
7 | :title="getTitle" | 7 | :title="getTitle" |
8 | @ok="handleSubmit" | 8 | @ok="handleSubmit" |
9 | + @cancel="handleCancel" | ||
9 | > | 10 | > |
10 | <CollapseContainer title="键名筛选器" class="border mb-8"> | 11 | <CollapseContainer title="键名筛选器" class="border mb-8"> |
11 | <div class="table-style"> | 12 | <div class="table-style"> |
@@ -166,10 +167,16 @@ | @@ -166,10 +167,16 @@ | ||
166 | detailData.value.length = 0; | 167 | detailData.value.length = 0; |
167 | resetFields(); | 168 | resetFields(); |
168 | }; | 169 | }; |
170 | + | ||
171 | + const handleCancel = () => { | ||
172 | + resetDataFunc(); | ||
173 | + }; | ||
169 | const handleAddKey = () => { | 174 | const handleAddKey = () => { |
170 | - openModal(true, { | ||
171 | - isUpdate: false, | ||
172 | - }); | 175 | + setTimeout(() => { |
176 | + openModal(true, { | ||
177 | + isUpdate: false, | ||
178 | + }); | ||
179 | + }, 30); | ||
173 | }; | 180 | }; |
174 | const handleEdit = (record: Recordable) => { | 181 | const handleEdit = (record: Recordable) => { |
175 | openModal(true, { | 182 | openModal(true, { |
@@ -198,6 +205,7 @@ | @@ -198,6 +205,7 @@ | ||
198 | reload(); | 205 | reload(); |
199 | }; | 206 | }; |
200 | return { | 207 | return { |
208 | + handleCancel, | ||
201 | schema, | 209 | schema, |
202 | detailData, | 210 | detailData, |
203 | getTableApiData, | 211 | getTableApiData, |
1 | -import { FormSchema } from '/@/components/Table'; | ||
2 | -import { ref } from 'vue'; | ||
3 | -export const isWhereType = ref(null); | 1 | +import { FormSchema } from '/@/components/Form'; |
4 | 2 | ||
5 | export const formSchema: FormSchema[] = [ | 3 | export const formSchema: FormSchema[] = [ |
6 | { | 4 | { |
@@ -12,6 +10,7 @@ export const formSchema: FormSchema[] = [ | @@ -12,6 +10,7 @@ export const formSchema: FormSchema[] = [ | ||
12 | }, | 10 | }, |
13 | componentProps() { | 11 | componentProps() { |
14 | return { | 12 | return { |
13 | + placeholder: '请选择报警严重程度', | ||
15 | options: [ | 14 | options: [ |
16 | { | 15 | { |
17 | value: 'CRITICAL', | 16 | value: 'CRITICAL', |
@@ -34,9 +33,6 @@ export const formSchema: FormSchema[] = [ | @@ -34,9 +33,6 @@ export const formSchema: FormSchema[] = [ | ||
34 | label: '不确定', | 33 | label: '不确定', |
35 | }, | 34 | }, |
36 | ], | 35 | ], |
37 | - onChange: (v) => { | ||
38 | - isWhereType.value = v ? v : 'CRITICAL'; | ||
39 | - }, | ||
40 | }; | 36 | }; |
41 | }, | 37 | }, |
42 | }, | 38 | }, |
@@ -17,15 +17,62 @@ | @@ -17,15 +17,62 @@ | ||
17 | emits: ['success', 'register', 'getAllFields'], | 17 | emits: ['success', 'register', 'getAllFields'], |
18 | setup(props) { | 18 | setup(props) { |
19 | const fieldValue: any = ref({}); | 19 | const fieldValue: any = ref({}); |
20 | - const [registerForm, { getFieldsValue, setFieldsValue }] = useForm({ | ||
21 | - labelWidth: 120, | ||
22 | - schemas: formSchema, | ||
23 | - }); | 20 | + const [registerForm, { resetFields, getFieldsValue, setFieldsValue, updateSchema }] = useForm( |
21 | + { | ||
22 | + labelWidth: 120, | ||
23 | + schemas: formSchema, | ||
24 | + } | ||
25 | + ); | ||
26 | + const resetFieldsFunc = () => { | ||
27 | + resetFields(); | ||
28 | + }; | ||
24 | 29 | ||
25 | const getFieldsValueFunc = () => { | 30 | const getFieldsValueFunc = () => { |
26 | fieldValue.value = getFieldsValue(); | 31 | fieldValue.value = getFieldsValue(); |
27 | return fieldValue.value; | 32 | return fieldValue.value; |
28 | }; | 33 | }; |
34 | + const item = [ | ||
35 | + { | ||
36 | + value: 'CRITICAL', | ||
37 | + label: '危险', | ||
38 | + disabled: false, | ||
39 | + }, | ||
40 | + { | ||
41 | + value: 'MAJOR', | ||
42 | + label: '重要', | ||
43 | + disabled: false, | ||
44 | + }, | ||
45 | + { | ||
46 | + value: 'MINOR', | ||
47 | + label: '次要', | ||
48 | + disabled: false, | ||
49 | + }, | ||
50 | + { | ||
51 | + value: 'WARNING', | ||
52 | + label: '警告', | ||
53 | + disabled: false, | ||
54 | + }, | ||
55 | + { | ||
56 | + value: 'INDETERMINATE', | ||
57 | + label: '不确定', | ||
58 | + disabled: false, | ||
59 | + }, | ||
60 | + ]; | ||
61 | + const updateSchemaSelectDisableFunc = () => { | ||
62 | + updateSchema({ | ||
63 | + field: 'default', | ||
64 | + componentProps: ({ formModel }) => { | ||
65 | + item.forEach((f) => { | ||
66 | + if (f.value == formModel.default) { | ||
67 | + f.disabled = true; | ||
68 | + } | ||
69 | + }); | ||
70 | + return { | ||
71 | + options: item, | ||
72 | + }; | ||
73 | + }, | ||
74 | + }); | ||
75 | + }; | ||
29 | 76 | ||
30 | const setFieldsValueFunc = () => { | 77 | const setFieldsValueFunc = () => { |
31 | if (props.alarmSeverityInfo != 1) { | 78 | if (props.alarmSeverityInfo != 1) { |
@@ -39,6 +86,8 @@ | @@ -39,6 +86,8 @@ | ||
39 | }; | 86 | }; |
40 | setFieldsValueFunc(); | 87 | setFieldsValueFunc(); |
41 | return { | 88 | return { |
89 | + resetFieldsFunc, | ||
90 | + updateSchemaSelectDisableFunc, | ||
42 | getFieldsValueFunc, | 91 | getFieldsValueFunc, |
43 | registerForm, | 92 | registerForm, |
44 | }; | 93 | }; |
1 | import { FormSchema } from '/@/components/Form'; | 1 | import { FormSchema } from '/@/components/Form'; |
2 | import { deviceConfigGetRuleChain } from '/@/api/device/deviceConfigApi'; | 2 | import { deviceConfigGetRuleChain } from '/@/api/device/deviceConfigApi'; |
3 | -import { ref } from 'vue'; | ||
4 | import { findDictItemByCode } from '/@/api/system/dict'; | 3 | import { findDictItemByCode } from '/@/api/system/dict'; |
5 | import { alarmContactGetPage } from '/@/api/device/deviceConfigApi'; | 4 | import { alarmContactGetPage } from '/@/api/device/deviceConfigApi'; |
6 | 5 | ||
@@ -145,59 +144,6 @@ export const step3HighSetting: FormSchema[] = [ | @@ -145,59 +144,6 @@ export const step3HighSetting: FormSchema[] = [ | ||
145 | }, | 144 | }, |
146 | ]; | 145 | ]; |
147 | 146 | ||
148 | -export const isWhereType = ref(null); | ||
149 | - | ||
150 | -export const step3CreateAlarm: FormSchema[] = [ | ||
151 | - { | ||
152 | - field: 'default', | ||
153 | - component: 'Select', | ||
154 | - label: '报警严重程度:', | ||
155 | - colProps: { | ||
156 | - span: 17, | ||
157 | - }, | ||
158 | - componentProps() { | ||
159 | - return { | ||
160 | - options: [ | ||
161 | - { | ||
162 | - value: 'CRITICAL', | ||
163 | - label: '危险', | ||
164 | - }, | ||
165 | - { | ||
166 | - value: 'MAJOR', | ||
167 | - label: '重要', | ||
168 | - }, | ||
169 | - { | ||
170 | - value: 'MINOR', | ||
171 | - label: '次要', | ||
172 | - }, | ||
173 | - { | ||
174 | - value: 'WARNING', | ||
175 | - label: '警告', | ||
176 | - }, | ||
177 | - { | ||
178 | - value: 'INDETERMINATE', | ||
179 | - label: '不确定', | ||
180 | - }, | ||
181 | - ], | ||
182 | - onChange: (v) => { | ||
183 | - isWhereType.value = v ? v : 'INDETERMINATE'; | ||
184 | - }, | ||
185 | - }; | ||
186 | - }, | ||
187 | - }, | ||
188 | -]; | ||
189 | - | ||
190 | -export const step3ClearAlarm: FormSchema[] = [ | ||
191 | - // { | ||
192 | - // field: 'associationType', | ||
193 | - // component: 'Input', | ||
194 | - // label: '关联类型', | ||
195 | - // componentProps: { | ||
196 | - // placeholder: '要传递的关联类型', | ||
197 | - // }, | ||
198 | - // }, | ||
199 | -]; | ||
200 | - | ||
201 | export const dashboardFormScheme: FormSchema[] = [ | 147 | export const dashboardFormScheme: FormSchema[] = [ |
202 | { | 148 | { |
203 | field: 'dashboardId', | 149 | field: 'dashboardId', |
@@ -50,7 +50,7 @@ | @@ -50,7 +50,7 @@ | ||
50 | emits: ['success', 'register'], | 50 | emits: ['success', 'register'], |
51 | setup(_, { emit }) { | 51 | setup(_, { emit }) { |
52 | const { createMessage } = useMessage(); | 52 | const { createMessage } = useMessage(); |
53 | - const { proxy } = getCurrentInstance(); | 53 | + const { proxy } = getCurrentInstance() as any; |
54 | const allPostForm = reactive({}); | 54 | const allPostForm = reactive({}); |
55 | const getNameObj = reactive({ | 55 | const getNameObj = reactive({ |
56 | name: '', | 56 | name: '', |
@@ -157,7 +157,7 @@ | @@ -157,7 +157,7 @@ | ||
157 | key: '', | 157 | key: '', |
158 | value: '', | 158 | value: '', |
159 | }); | 159 | }); |
160 | - const sonValues = reactive({ | 160 | + const sonValues: any = reactive({ |
161 | configuration: {}, | 161 | configuration: {}, |
162 | }); | 162 | }); |
163 | const [register, { validate, setFieldsValue, resetFields: defineClearFunc }] = useForm({ | 163 | const [register, { validate, setFieldsValue, resetFields: defineClearFunc }] = useForm({ |
@@ -239,7 +239,7 @@ | @@ -239,7 +239,7 @@ | ||
239 | credentialsV.credentials.type = sonValues.configuration.type; | 239 | credentialsV.credentials.type = sonValues.configuration.type; |
240 | const kong = {}; | 240 | const kong = {}; |
241 | let kongTemp = {}; | 241 | let kongTemp = {}; |
242 | - keyAndValueArrTemp.value.map((item) => { | 242 | + keyAndValueArrTemp.value.map((item: any) => { |
243 | kong[item.key] = item.value; | 243 | kong[item.key] = item.value; |
244 | }); | 244 | }); |
245 | kongTemp = JSON.parse(JSON.stringify(kong)); | 245 | kongTemp = JSON.parse(JSON.stringify(kong)); |
@@ -192,7 +192,7 @@ | @@ -192,7 +192,7 @@ | ||
192 | } | 192 | } |
193 | const kong = {}; | 193 | const kong = {}; |
194 | let kongTemp = {}; | 194 | let kongTemp = {}; |
195 | - keyAndValueArrTemp.value.map((item) => { | 195 | + keyAndValueArrTemp.value.map((item: any) => { |
196 | kong[item.key] = item.value; | 196 | kong[item.key] = item.value; |
197 | }); | 197 | }); |
198 | kongTemp = JSON.parse(JSON.stringify(kong)); | 198 | kongTemp = JSON.parse(JSON.stringify(kong)); |
@@ -88,7 +88,7 @@ | @@ -88,7 +88,7 @@ | ||
88 | type: '', | 88 | type: '', |
89 | }, | 89 | }, |
90 | }); | 90 | }); |
91 | - const sonValues = reactive({ | 91 | + const sonValues: any = reactive({ |
92 | configuration: {}, | 92 | configuration: {}, |
93 | }); | 93 | }); |
94 | const [register, { validate, setFieldsValue, resetFields: defineClearFunc }] = useForm({ | 94 | const [register, { validate, setFieldsValue, resetFields: defineClearFunc }] = useForm({ |
@@ -142,12 +142,6 @@ | @@ -142,12 +142,6 @@ | ||
142 | const tempGetKeyAndVal = async () => { | 142 | const tempGetKeyAndVal = async () => { |
143 | temp.value = await validateKeyAndValue(); | 143 | temp.value = await validateKeyAndValue(); |
144 | }; | 144 | }; |
145 | - // const defaultAddKeyAndValueFunc = () => { | ||
146 | - // if (keyAndValueArr.value.length == 0) { | ||
147 | - // keyAndValueArr.value.push(keyAndValueObj as never); | ||
148 | - // } | ||
149 | - // }; | ||
150 | - // defaultAddKeyAndValueFunc(); | ||
151 | 145 | ||
152 | const getDefaultValue = async () => { | 146 | const getDefaultValue = async () => { |
153 | await tempGetKeyAndVal(); | 147 | await tempGetKeyAndVal(); |
@@ -170,7 +164,7 @@ | @@ -170,7 +164,7 @@ | ||
170 | } | 164 | } |
171 | const kong = {}; | 165 | const kong = {}; |
172 | let kongTemp = {}; | 166 | let kongTemp = {}; |
173 | - keyAndValueArrTemp.value.map((item) => { | 167 | + keyAndValueArrTemp.value.map((item: any) => { |
174 | kong[item.key] = item.value; | 168 | kong[item.key] = item.value; |
175 | }); | 169 | }); |
176 | kongTemp = JSON.parse(JSON.stringify(kong)); | 170 | kongTemp = JSON.parse(JSON.stringify(kong)); |
@@ -39,7 +39,7 @@ | @@ -39,7 +39,7 @@ | ||
39 | props: ['getModeSelect', 'defineClearFuncProp'], | 39 | props: ['getModeSelect', 'defineClearFuncProp'], |
40 | emits: ['prevSon'], | 40 | emits: ['prevSon'], |
41 | setup(props, { emit }) { | 41 | setup(props, { emit }) { |
42 | - const { proxy } = getCurrentInstance(); | 42 | + const { proxy } = getCurrentInstance() as any; |
43 | const getTransferConfigKafkaValue = ref({}); | 43 | const getTransferConfigKafkaValue = ref({}); |
44 | const refTransferConfigKafka = ref(null); | 44 | const refTransferConfigKafka = ref(null); |
45 | const refTransferConfigMqtt = ref(null); | 45 | const refTransferConfigMqtt = ref(null); |
@@ -53,7 +53,7 @@ | @@ -53,7 +53,7 @@ | ||
53 | if (props.editActionFather !== 1) { | 53 | if (props.editActionFather !== 1) { |
54 | setTimeout(() => { | 54 | setTimeout(() => { |
55 | setFieldsValue(props.editActionFather); | 55 | setFieldsValue(props.editActionFather); |
56 | - }, 100); | 56 | + }, 10); |
57 | } | 57 | } |
58 | }; | 58 | }; |
59 | setFieldsFormValueFun(); | 59 | setFieldsFormValueFun(); |
@@ -66,7 +66,7 @@ | @@ -66,7 +66,7 @@ | ||
66 | options: props.newActionMapFather, | 66 | options: props.newActionMapFather, |
67 | }, | 67 | }, |
68 | }); | 68 | }); |
69 | - }, 100); | 69 | + }, 10); |
70 | } | 70 | } |
71 | }; | 71 | }; |
72 | editSelectDevice(); | 72 | editSelectDevice(); |
@@ -6,7 +6,11 @@ | @@ -6,7 +6,11 @@ | ||
6 | :rowSelection="{ type: 'checkbox' }" | 6 | :rowSelection="{ type: 'checkbox' }" |
7 | > | 7 | > |
8 | <template #toolbar> | 8 | <template #toolbar> |
9 | - <a-button v-if="isSysadmin || isCustomer || isPlatform" type="primary" @click="handleAdd"> | 9 | + <a-button |
10 | + v-if="isTenant || isSysadmin || isCustomer || isPlatform" | ||
11 | + type="primary" | ||
12 | + @click="handleAdd" | ||
13 | + > | ||
10 | 新增场景联动 | 14 | 新增场景联动 |
11 | </a-button> | 15 | </a-button> |
12 | <a-button color="error" @click="handleDeleteOrBatchDelete(null)" :disabled="hasBatchDelete"> | 16 | <a-button color="error" @click="handleDeleteOrBatchDelete(null)" :disabled="hasBatchDelete"> |
@@ -292,12 +292,12 @@ | @@ -292,12 +292,12 @@ | ||
292 | optionsItemArray.value.length = 0; | 292 | optionsItemArray.value.length = 0; |
293 | try { | 293 | try { |
294 | setTimeout(() => { | 294 | setTimeout(() => { |
295 | - proxy.$refs.refTriggerChild.resetFieldsValueFunc(); | ||
296 | - proxy.$refs.refTriggerChild.clearSelectDevice(); | ||
297 | - proxy.$refs.refConditionChild.resetFieldsValueFunc(); | ||
298 | - proxy.$refs.refConditionChild.clearSelectDevice(); | ||
299 | - proxy.$refs.refActionChild.resetFieldsValueFunc(); | ||
300 | - proxy.$refs.refActionChild.clearSelectDevice(); | 295 | + proxy.$refs.refTriggerChild?.resetFieldsValueFunc(); |
296 | + proxy.$refs.refTriggerChild?.clearSelectDevice(); | ||
297 | + proxy.$refs.refConditionChild?.resetFieldsValueFunc(); | ||
298 | + proxy.$refs.refConditionChild?.clearSelectDevice(); | ||
299 | + proxy.$refs.refActionChild?.resetFieldsValueFunc(); | ||
300 | + proxy.$refs.refActionChild?.clearSelectDevice(); | ||
301 | clearActionsAllDevice(); | 301 | clearActionsAllDevice(); |
302 | resetActionsAllArrayFunc(); | 302 | resetActionsAllArrayFunc(); |
303 | }, 10); | 303 | }, 10); |
@@ -309,6 +309,7 @@ | @@ -309,6 +309,7 @@ | ||
309 | } | 309 | } |
310 | } else { | 310 | } else { |
311 | try { | 311 | try { |
312 | + emit('success'); | ||
312 | kongTriggerObj = {}; | 313 | kongTriggerObj = {}; |
313 | kongConditionObj = {}; | 314 | kongConditionObj = {}; |
314 | kongActionObj = {}; | 315 | kongActionObj = {}; |
@@ -371,7 +372,18 @@ | @@ -371,7 +372,18 @@ | ||
371 | } | 372 | } |
372 | }); | 373 | }); |
373 | }); | 374 | }); |
374 | - emit('success'); | 375 | + |
376 | + options.items.forEach((v) => { | ||
377 | + return (v.value = v.tbDeviceId), (v.label = v.name); | ||
378 | + }); | ||
379 | + optionsItemArray.value = options.items; | ||
380 | + try { | ||
381 | + proxy.$refs.refTriggerChild.updateFieldDeviceId(optionsItemArray.value); | ||
382 | + proxy.$refs.refConditionChild.updateFieldDeviceId(optionsItemArray.value); | ||
383 | + proxy.$refs.refActionChild.updateFieldDeviceId(optionsItemArray.value); | ||
384 | + } catch (e) { | ||
385 | + return e; | ||
386 | + } | ||
375 | } catch (e) { | 387 | } catch (e) { |
376 | return e; | 388 | return e; |
377 | } | 389 | } |
@@ -619,6 +631,8 @@ | @@ -619,6 +631,8 @@ | ||
619 | getAllFormData.id = getId.value; | 631 | getAllFormData.id = getId.value; |
620 | getAllFormData.tenantId = getTenantId.value; | 632 | getAllFormData.tenantId = getTenantId.value; |
621 | refTriggerChildData = {}; | 633 | refTriggerChildData = {}; |
634 | + refConditionChildData = {}; | ||
635 | + refActionChildData = {}; | ||
622 | pushEditArray.value.length = 0; | 636 | pushEditArray.value.length = 0; |
623 | pushEditConditionArray.value.length = 0; | 637 | pushEditConditionArray.value.length = 0; |
624 | pushEditActionArray.value.length = 0; | 638 | pushEditActionArray.value.length = 0; |
@@ -35,7 +35,7 @@ export const searchFormSchema: FormSchema[] = [ | @@ -35,7 +35,7 @@ export const searchFormSchema: FormSchema[] = [ | ||
35 | { | 35 | { |
36 | field: 'textSearch', | 36 | field: 'textSearch', |
37 | label: '租户配置名称', | 37 | label: '租户配置名称', |
38 | - colProps: { span: 8 }, | 38 | + colProps: { span: 6 }, |
39 | component: 'Input', | 39 | component: 'Input', |
40 | componentProps: { | 40 | componentProps: { |
41 | maxLength: 255, | 41 | maxLength: 255, |
@@ -72,7 +72,7 @@ export const formSchema: FormSchema[] = [ | @@ -72,7 +72,7 @@ export const formSchema: FormSchema[] = [ | ||
72 | component: 'Checkbox', | 72 | component: 'Checkbox', |
73 | renderComponentContent: () => { | 73 | renderComponentContent: () => { |
74 | return h('span', {}, [ | 74 | return h('span', {}, [ |
75 | - h('span', {}, '在独立的ThinngsBoard规则引擎中处理'), | 75 | + h('span', {}, '在独立的ThingsBoard规则引擎中处理'), |
76 | h('span', { style: { color: 'grey' } }, '(每个独立租户需要单独的微服务)'), | 76 | h('span', { style: { color: 'grey' } }, '(每个独立租户需要单独的微服务)'), |
77 | ]); | 77 | ]); |
78 | }, | 78 | }, |
1 | import { FormSchema } from '/@/components/Table'; | 1 | import { FormSchema } from '/@/components/Table'; |
2 | -// import { numberRule } from '/@/utils/rules'; | ||
3 | 2 | ||
4 | export const formSchema: FormSchema[] = [ | 3 | export const formSchema: FormSchema[] = [ |
5 | { | 4 | { |
@@ -19,240 +18,240 @@ export const formSchema: FormSchema[] = [ | @@ -19,240 +18,240 @@ export const formSchema: FormSchema[] = [ | ||
19 | required: true, | 18 | required: true, |
20 | 19 | ||
21 | label: '最大设备数(0-无限制)', | 20 | label: '最大设备数(0-无限制)', |
22 | - component: 'Input', | 21 | + component: 'InputNumber', |
22 | + defaultValue: '0', | ||
23 | colProps: { span: 24 }, | 23 | colProps: { span: 24 }, |
24 | componentProps: { | 24 | componentProps: { |
25 | placeholder: '请输入最大设备数(请输入数字)', | 25 | placeholder: '请输入最大设备数(请输入数字)', |
26 | }, | 26 | }, |
27 | - // rules: numberRule, | ||
28 | }, | 27 | }, |
29 | { | 28 | { |
30 | field: 'maxAssets', | 29 | field: 'maxAssets', |
31 | required: true, | 30 | required: true, |
31 | + defaultValue: '0', | ||
32 | 32 | ||
33 | label: '最大资产数(0-无限制)', | 33 | label: '最大资产数(0-无限制)', |
34 | colProps: { span: 24 }, | 34 | colProps: { span: 24 }, |
35 | - component: 'Input', | 35 | + component: 'InputNumber', |
36 | componentProps: { | 36 | componentProps: { |
37 | placeholder: '请输入最大资产(请输入数字)', | 37 | placeholder: '请输入最大资产(请输入数字)', |
38 | }, | 38 | }, |
39 | - // rules: numberRule, | ||
40 | }, | 39 | }, |
41 | { | 40 | { |
42 | field: 'maxCustomers', | 41 | field: 'maxCustomers', |
43 | required: true, | 42 | required: true, |
43 | + defaultValue: '0', | ||
44 | 44 | ||
45 | label: '最大客户数(0-无限制)', | 45 | label: '最大客户数(0-无限制)', |
46 | colProps: { span: 24 }, | 46 | colProps: { span: 24 }, |
47 | - component: 'Input', | 47 | + component: 'InputNumber', |
48 | componentProps: { | 48 | componentProps: { |
49 | placeholder: '请输入最大客户数(请输入数字)', | 49 | placeholder: '请输入最大客户数(请输入数字)', |
50 | }, | 50 | }, |
51 | - // rules: numberRule, | ||
52 | }, | 51 | }, |
53 | { | 52 | { |
54 | field: 'maxUsers', | 53 | field: 'maxUsers', |
55 | required: true, | 54 | required: true, |
55 | + defaultValue: '0', | ||
56 | 56 | ||
57 | label: '最大用户数(0-无限制)', | 57 | label: '最大用户数(0-无限制)', |
58 | colProps: { span: 24 }, | 58 | colProps: { span: 24 }, |
59 | - component: 'Input', | 59 | + component: 'InputNumber', |
60 | componentProps: { | 60 | componentProps: { |
61 | placeholder: '请输入最大用户数(请输入数字)', | 61 | placeholder: '请输入最大用户数(请输入数字)', |
62 | }, | 62 | }, |
63 | - // rules: numberRule, | ||
64 | }, | 63 | }, |
65 | { | 64 | { |
66 | field: 'maxDashboards', | 65 | field: 'maxDashboards', |
67 | required: true, | 66 | required: true, |
67 | + defaultValue: '0', | ||
68 | 68 | ||
69 | label: '仪表板的最大数量(0-无限制)', | 69 | label: '仪表板的最大数量(0-无限制)', |
70 | colProps: { span: 24 }, | 70 | colProps: { span: 24 }, |
71 | - component: 'Input', | 71 | + component: 'InputNumber', |
72 | componentProps: { | 72 | componentProps: { |
73 | placeholder: '请输入仪表板的最大数量(请输入数字)', | 73 | placeholder: '请输入仪表板的最大数量(请输入数字)', |
74 | }, | 74 | }, |
75 | - // rules: numberRule, | ||
76 | }, | 75 | }, |
77 | { | 76 | { |
78 | field: 'maxRuleChains', | 77 | field: 'maxRuleChains', |
79 | required: true, | 78 | required: true, |
79 | + defaultValue: '0', | ||
80 | 80 | ||
81 | label: '最大规则链数(0-无限制)', | 81 | label: '最大规则链数(0-无限制)', |
82 | colProps: { span: 24 }, | 82 | colProps: { span: 24 }, |
83 | - component: 'Input', | 83 | + component: 'InputNumber', |
84 | componentProps: { | 84 | componentProps: { |
85 | placeholder: '请输入最大规则链数(请输入数字)', | 85 | placeholder: '请输入最大规则链数(请输入数字)', |
86 | }, | 86 | }, |
87 | - // rules: numberRule, | ||
88 | }, | 87 | }, |
89 | { | 88 | { |
90 | field: 'maxResourcesInBytes', | 89 | field: 'maxResourcesInBytes', |
91 | required: true, | 90 | required: true, |
91 | + defaultValue: '0', | ||
92 | 92 | ||
93 | label: '以字节为单位的资源文件的最大总和(0-无限制)', | 93 | label: '以字节为单位的资源文件的最大总和(0-无限制)', |
94 | colProps: { span: 24 }, | 94 | colProps: { span: 24 }, |
95 | - component: 'Input', | 95 | + component: 'InputNumber', |
96 | componentProps: { | 96 | componentProps: { |
97 | placeholder: '请输入(请输入数字)', | 97 | placeholder: '请输入(请输入数字)', |
98 | }, | 98 | }, |
99 | - // rules: numberRule, | ||
100 | }, | 99 | }, |
101 | { | 100 | { |
102 | field: 'maxOtaPackagesInBytes', | 101 | field: 'maxOtaPackagesInBytes', |
103 | required: true, | 102 | required: true, |
103 | + defaultValue: '0', | ||
104 | 104 | ||
105 | label: 'Ota包文件大小的最大总和(字节)(0-无限制)', | 105 | label: 'Ota包文件大小的最大总和(字节)(0-无限制)', |
106 | colProps: { span: 24 }, | 106 | colProps: { span: 24 }, |
107 | - component: 'Input', | 107 | + component: 'InputNumber', |
108 | componentProps: { | 108 | componentProps: { |
109 | placeholder: '请输入(请输入数字)', | 109 | placeholder: '请输入(请输入数字)', |
110 | }, | 110 | }, |
111 | - // rules: numberRule, | ||
112 | }, | 111 | }, |
113 | { | 112 | { |
114 | field: 'maxTransportMessages', | 113 | field: 'maxTransportMessages', |
115 | required: true, | 114 | required: true, |
115 | + defaultValue: '0', | ||
116 | 116 | ||
117 | label: '最大传输消息数(0-无限制)', | 117 | label: '最大传输消息数(0-无限制)', |
118 | colProps: { span: 24 }, | 118 | colProps: { span: 24 }, |
119 | - component: 'Input', | 119 | + component: 'InputNumber', |
120 | componentProps: { | 120 | componentProps: { |
121 | placeholder: '请输入最大传输消息数(请输入数字)', | 121 | placeholder: '请输入最大传输消息数(请输入数字)', |
122 | }, | 122 | }, |
123 | - // rules: numberRule, | ||
124 | }, | 123 | }, |
125 | { | 124 | { |
126 | field: 'maxTransportDataPoints', | 125 | field: 'maxTransportDataPoints', |
127 | required: true, | 126 | required: true, |
127 | + defaultValue: '0', | ||
128 | 128 | ||
129 | label: '传输数据点的最大数量(0-无限制)', | 129 | label: '传输数据点的最大数量(0-无限制)', |
130 | colProps: { span: 24 }, | 130 | colProps: { span: 24 }, |
131 | - component: 'Input', | 131 | + component: 'InputNumber', |
132 | componentProps: { | 132 | componentProps: { |
133 | placeholder: '请输入传输数据点的最大数量(请输入数字)', | 133 | placeholder: '请输入传输数据点的最大数量(请输入数字)', |
134 | }, | 134 | }, |
135 | - // rules: numberRule, | ||
136 | }, | 135 | }, |
137 | { | 136 | { |
138 | field: 'maxREExecutions', | 137 | field: 'maxREExecutions', |
139 | required: true, | 138 | required: true, |
139 | + defaultValue: '0', | ||
140 | 140 | ||
141 | label: '最大规则引擎数(0-无限制)', | 141 | label: '最大规则引擎数(0-无限制)', |
142 | colProps: { span: 24 }, | 142 | colProps: { span: 24 }, |
143 | - component: 'Input', | 143 | + component: 'InputNumber', |
144 | componentProps: { | 144 | componentProps: { |
145 | placeholder: '请输入最大规则引擎数(请输入数字)', | 145 | placeholder: '请输入最大规则引擎数(请输入数字)', |
146 | }, | 146 | }, |
147 | - // rules: numberRule, | ||
148 | }, | 147 | }, |
149 | 148 | ||
150 | { | 149 | { |
151 | field: 'maxJSExecutions', | 150 | field: 'maxJSExecutions', |
152 | required: true, | 151 | required: true, |
152 | + defaultValue: '0', | ||
153 | 153 | ||
154 | label: '最大JavaScript执行数(0-不受限制)', | 154 | label: '最大JavaScript执行数(0-不受限制)', |
155 | colProps: { span: 24 }, | 155 | colProps: { span: 24 }, |
156 | - component: 'Input', | 156 | + component: 'InputNumber', |
157 | componentProps: { | 157 | componentProps: { |
158 | placeholder: '请输入最大JavaScript执行数(请输入数字)', | 158 | placeholder: '请输入最大JavaScript执行数(请输入数字)', |
159 | }, | 159 | }, |
160 | - // rules: numberRule, | ||
161 | }, | 160 | }, |
162 | { | 161 | { |
163 | field: 'maxDPStorageDays', | 162 | field: 'maxDPStorageDays', |
164 | required: true, | 163 | required: true, |
164 | + defaultValue: '0', | ||
165 | 165 | ||
166 | label: '最大日存储数据点数(0-无限制)', | 166 | label: '最大日存储数据点数(0-无限制)', |
167 | colProps: { span: 24 }, | 167 | colProps: { span: 24 }, |
168 | - component: 'Input', | 168 | + component: 'InputNumber', |
169 | componentProps: { | 169 | componentProps: { |
170 | placeholder: '请输入最大日存储数据点数(请输入数字)', | 170 | placeholder: '请输入最大日存储数据点数(请输入数字)', |
171 | }, | 171 | }, |
172 | - // rules: numberRule, | ||
173 | }, | 172 | }, |
174 | { | 173 | { |
175 | field: 'defaultStorageTtlDays', | 174 | field: 'defaultStorageTtlDays', |
176 | required: true, | 175 | required: true, |
176 | + defaultValue: '0', | ||
177 | 177 | ||
178 | label: '默认存储 TTL 天数(0-无限制)', | 178 | label: '默认存储 TTL 天数(0-无限制)', |
179 | colProps: { span: 24 }, | 179 | colProps: { span: 24 }, |
180 | - component: 'Input', | 180 | + component: 'InputNumber', |
181 | componentProps: { | 181 | componentProps: { |
182 | placeholder: '请输入默认存储 TTL 天数(请输入数字)', | 182 | placeholder: '请输入默认存储 TTL 天数(请输入数字)', |
183 | }, | 183 | }, |
184 | - // rules: numberRule, | ||
185 | }, | 184 | }, |
186 | { | 185 | { |
187 | field: 'alarmsTtlDays', | 186 | field: 'alarmsTtlDays', |
188 | required: true, | 187 | required: true, |
188 | + defaultValue: '0', | ||
189 | 189 | ||
190 | label: 'Alams TTL days(0-无限制)', | 190 | label: 'Alams TTL days(0-无限制)', |
191 | colProps: { span: 24 }, | 191 | colProps: { span: 24 }, |
192 | - component: 'Input', | 192 | + component: 'InputNumber', |
193 | componentProps: { | 193 | componentProps: { |
194 | - placeholder: '请输入Alams TTL days(请输入数字)', | 194 | + placeholder: '请输入Alarms TTL days(请输入数字)', |
195 | }, | 195 | }, |
196 | - // rules: numberRule, | ||
197 | }, | 196 | }, |
198 | { | 197 | { |
199 | field: 'rpcTtlDays', | 198 | field: 'rpcTtlDays', |
200 | required: true, | 199 | required: true, |
200 | + defaultValue: '0', | ||
201 | 201 | ||
202 | label: 'RPC TTL days(0-无限制)', | 202 | label: 'RPC TTL days(0-无限制)', |
203 | colProps: { span: 24 }, | 203 | colProps: { span: 24 }, |
204 | - component: 'Input', | 204 | + component: 'InputNumber', |
205 | componentProps: { | 205 | componentProps: { |
206 | placeholder: '请输入RPC TTL days(请输入数字)', | 206 | placeholder: '请输入RPC TTL days(请输入数字)', |
207 | }, | 207 | }, |
208 | - // rules: numberRule, | ||
209 | }, | 208 | }, |
210 | { | 209 | { |
211 | field: 'maxRuleNodeExecutionsPerMessage', | 210 | field: 'maxRuleNodeExecutionsPerMessage', |
212 | required: true, | 211 | required: true, |
213 | - | 212 | + defaultValue: '1', |
214 | label: '每条消息的最大规则节点执行数(0-无限制)', | 213 | label: '每条消息的最大规则节点执行数(0-无限制)', |
215 | colProps: { span: 24 }, | 214 | colProps: { span: 24 }, |
216 | - component: 'Input', | 215 | + component: 'InputNumber', |
217 | componentProps: { | 216 | componentProps: { |
218 | placeholder: '请输入每条消息的最大规则节点执行数(请输入数字)', | 217 | placeholder: '请输入每条消息的最大规则节点执行数(请输入数字)', |
219 | }, | 218 | }, |
220 | - // rules: numberRule, | ||
221 | }, | 219 | }, |
222 | { | 220 | { |
223 | field: 'maxEmails', | 221 | field: 'maxEmails', |
224 | required: true, | 222 | required: true, |
225 | label: '发送的最大电子邮件数(0-无限制)', | 223 | label: '发送的最大电子邮件数(0-无限制)', |
226 | colProps: { span: 24 }, | 224 | colProps: { span: 24 }, |
227 | - component: 'Input', | 225 | + defaultValue: '0', |
226 | + | ||
227 | + component: 'InputNumber', | ||
228 | componentProps: { | 228 | componentProps: { |
229 | placeholder: '请输入发送的最大电子邮件数(请输入数字)', | 229 | placeholder: '请输入发送的最大电子邮件数(请输入数字)', |
230 | }, | 230 | }, |
231 | - // rules: numberRule, | ||
232 | }, | 231 | }, |
233 | { | 232 | { |
234 | field: 'maxSms', | 233 | field: 'maxSms', |
235 | required: true, | 234 | required: true, |
235 | + defaultValue: '0', | ||
236 | 236 | ||
237 | label: '发送的最大短信数(0-无限制)', | 237 | label: '发送的最大短信数(0-无限制)', |
238 | colProps: { span: 24 }, | 238 | colProps: { span: 24 }, |
239 | - component: 'Input', | 239 | + component: 'InputNumber', |
240 | componentProps: { | 240 | componentProps: { |
241 | placeholder: '请输入发送的最大短信数(请输入数字)', | 241 | placeholder: '请输入发送的最大短信数(请输入数字)', |
242 | }, | 242 | }, |
243 | - // rules: numberRule, | ||
244 | }, | 243 | }, |
245 | { | 244 | { |
246 | field: 'maxCreatedAlarms', | 245 | field: 'maxCreatedAlarms', |
247 | required: true, | 246 | required: true, |
247 | + defaultValue: '0', | ||
248 | 248 | ||
249 | label: '创建的最大报警数 (0 - 无限制)', | 249 | label: '创建的最大报警数 (0 - 无限制)', |
250 | colProps: { span: 24 }, | 250 | colProps: { span: 24 }, |
251 | - component: 'Input', | 251 | + component: 'InputNumber', |
252 | componentProps: { | 252 | componentProps: { |
253 | placeholder: '请输入maxCreatedAlarms(请输入数字)', | 253 | placeholder: '请输入maxCreatedAlarms(请输入数字)', |
254 | }, | 254 | }, |
255 | - // rules: numberRule, | ||
256 | }, | 255 | }, |
257 | { | 256 | { |
258 | field: 'transportTenantMsgRateLimit', | 257 | field: 'transportTenantMsgRateLimit', |
1 | <template> | 1 | <template> |
2 | - <CollapseContainer title="租户配置设置"> | ||
3 | - <BasicForm @register="registerForm" /> | ||
4 | - </CollapseContainer> | 2 | + <div class="tenant-class"> |
3 | + <CollapseContainer title="租户配置设置"> | ||
4 | + <BasicForm @register="registerForm" /> | ||
5 | + </CollapseContainer> | ||
6 | + </div> | ||
5 | </template> | 7 | </template> |
6 | <script lang="ts"> | 8 | <script lang="ts"> |
7 | import { defineComponent, ref } from 'vue'; | 9 | import { defineComponent, ref } from 'vue'; |
@@ -40,3 +42,10 @@ | @@ -40,3 +42,10 @@ | ||
40 | }, | 42 | }, |
41 | }); | 43 | }); |
42 | </script> | 44 | </script> |
45 | +<style lang="less" scoped> | ||
46 | + .tenant-class { | ||
47 | + :deep .ant-input-number { | ||
48 | + width: 34vw !important; | ||
49 | + } | ||
50 | + } | ||
51 | +</style> |
1 | <template> | 1 | <template> |
2 | - <div> | 2 | + <div class="drawer-class"> |
3 | <BasicDrawer | 3 | <BasicDrawer |
4 | v-bind="$attrs" | 4 | v-bind="$attrs" |
5 | @register="registerDrawer" | 5 | @register="registerDrawer" |
@@ -32,7 +32,7 @@ | @@ -32,7 +32,7 @@ | ||
32 | let postAllData: any = reactive({}); | 32 | let postAllData: any = reactive({}); |
33 | const parentSetData: any = ref(null); | 33 | const parentSetData: any = ref(null); |
34 | let getValuesFormData: any = reactive({}); | 34 | let getValuesFormData: any = reactive({}); |
35 | - const { proxy } = getCurrentInstance(); | 35 | + const { proxy } = getCurrentInstance() as any; |
36 | const getChildData = ref(null); | 36 | const getChildData = ref(null); |
37 | const editGetId: any = ref(''); | 37 | const editGetId: any = ref(''); |
38 | const [registerForm, { getFieldsValue, resetFields, setFieldsValue }] = useForm({ | 38 | const [registerForm, { getFieldsValue, resetFields, setFieldsValue }] = useForm({ |
@@ -115,3 +115,15 @@ | @@ -115,3 +115,15 @@ | ||
115 | }, | 115 | }, |
116 | }); | 116 | }); |
117 | </script> | 117 | </script> |
118 | + | ||
119 | +<style lang="less"> | ||
120 | + .drawer-class { | ||
121 | + .ant-row { | ||
122 | + .ant-col { | ||
123 | + :deep .ant-input-number { | ||
124 | + width: 34vw !important; | ||
125 | + } | ||
126 | + } | ||
127 | + } | ||
128 | + } | ||
129 | +</style> |
@@ -58,6 +58,7 @@ | @@ -58,6 +58,7 @@ | ||
58 | }); | 58 | }); |
59 | return [ | 59 | return [ |
60 | { | 60 | { |
61 | + required: true, | ||
61 | validator(_, value) { | 62 | validator(_, value) { |
62 | return new Promise((resolve, reject) => { | 63 | return new Promise((resolve, reject) => { |
63 | if (value == '') { | 64 | if (value == '') { |
@@ -76,7 +77,7 @@ | @@ -76,7 +77,7 @@ | ||
76 | }, | 77 | }, |
77 | }, | 78 | }, |
78 | ]; | 79 | ]; |
79 | - } catch (e) {} | 80 | + } catch {} |
80 | }, | 81 | }, |
81 | }, | 82 | }, |
82 | { | 83 | { |