Commit 135ef43c075ae399c678dabe360b32f57cb4cf69

Authored by xp.Huang
2 parents 15b854ff e1f24fe9

Merge branch 'ft-dev' into 'main'

fix:修改设备配置编辑问题,修改场景联动点击编辑回显设备问题,修改了租户配置样式问题

See merge request huang/yun-teng-iot-front!146
... ... @@ -161,9 +161,7 @@
161 161 });
162 162 proxy.$refs.DeviceProfileStep3Ref.clearProfileDataFunc();
163 163 proxy.$refs.DeviceProfileStep3Ref.addAlarmRule();
164   - setTimeout(() => {
165   - emit('success');
166   - }, 10);
  164 + // emit('success');
167 165 } else if (isUpdate.value == 3) {
168 166 postEditId.value = data.record.id;
169 167 getBackendData = await deviceConfigGetDetail(postEditId.value);
... ... @@ -184,9 +182,7 @@
184 182 });
185 183 proxy.$refs.DeviceProfileStep3Ref.clearProfileDataFunc();
186 184 proxy.$refs.DeviceProfileStep3Ref.addAlarmRule();
187   - setTimeout(() => {
188   - emit('success');
189   - }, 10);
  185 + // emit('success');
190 186 }
191 187 });
192 188 function handleStepPrev() {
... ... @@ -211,57 +207,64 @@
211 207 current.value++;
212 208 getStepTwoData.value = v;
213 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 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 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 267 function handleStep3Next(v, v1) {
264   - console.log(v1);
265 268 isEditAndChange.value = v1;
266 269 current.value++;
267 270 getStepThreeData.value = v;
... ... @@ -308,7 +311,6 @@
308 311 isEditAndChange.value == true
309 312 ? editData.value.profileData.alarms
310 313 : getStepThreeData.value;
311   - // isGetStepThreeData.profileData.alarms = getStepThreeData.value;
312 314 postDeviceConfogData.value.id = postEditId.value;
313 315 getStepFourData = await proxy.$refs.DeviceProfileStep4Ref.getAllFields();
314 316 const getJoinAlarmContactIdData = getStepFourData.alarmContactId.join(',');
... ... @@ -342,7 +344,6 @@
342 344 }
343 345 };
344 346 return {
345   - // isEditFunc,
346 347 isShowRule,
347 348 isShowOkBtnFalse,
348 349 isStatus,
... ...
... ... @@ -48,6 +48,7 @@
48 48 const values = await validate();
49 49 emit('next', values);
50 50 } catch (error) {
  51 + console.log(error);
51 52 } finally {
52 53 }
53 54 }
... ...
1 1 <template>
2 2 <div>
3 3 <div class="step3" style="background-color: #f6f8f9">
  4 + <!-- 报警规则 -->
4 5 <template v-for="(item, index) in profileData" :key="item.id">
5 6 <CollapseContainer class="border mb-1" :canExpan="false">
6 7 <!-- 移除按钮 -->
... ... @@ -34,7 +35,7 @@
34 35 </div>
35 36 </div>
36 37 </div>
37   - <!-- 传递报警和报警类型 -->
  38 + <!-- 报警类型和传递报警 -->
38 39 <!-- 创建报警规则 -->
39 40 <div style="margin-top: -57px">
40 41 <p style="margin-left: 10px; font-size: medium">创建报警规则</p>
... ... @@ -297,7 +298,9 @@
297 298 <!-- 清除报警规则 -->
298 299 </CollapseContainer>
299 300 </template>
  301 + <!-- 报警规则 -->
300 302 </div>
  303 + <!-- 按钮 -->
301 304 <div class="flex justify-center" style="display: fixed; bottom: 100px">
302 305 <a-button class="mr-5" @click="prevStep">上一步</a-button>
303 306 <a-button @click="handleFormStep3toStep4Next">下一步</a-button>
... ... @@ -309,11 +312,12 @@
309 312 >添加报警规则</a-button
310 313 >
311 314 </div>
  315 + <!-- 按钮 -->
312 316 </div>
313 317 </template>
314 318
315 319 <script lang="ts">
316   - import { defineComponent, ref, getCurrentInstance, watch, reactive } from 'vue';
  320 + import { defineComponent, ref, getCurrentInstance, reactive } from 'vue';
317 321 import type { IProfileData } from './index.t';
318 322 import { CollapseContainer } from '/@/components/Container/index';
319 323 import { BasicForm, useForm } from '/@/components/Form';
... ... @@ -321,7 +325,6 @@
321 325 step3Schemas,
322 326 step3HighSetting,
323 327 dashboardFormScheme,
324   - isWhereType,
325 328 formChangeDetailSchema,
326 329 } from './data';
327 330 import { PlusCircleOutlined } from '@ant-design/icons-vue';
... ... @@ -330,7 +333,6 @@
330 333 import EnableRule from './cpns/enablerule/index.vue';
331 334 import AlarmRuleConditions from './cpns/alarmruleconditions/index.vue';
332 335 import { Button } from '/@/components/Button';
333   - export const isWhereTypeValueDisabled = ref(false);
334 336 import AlarmSeverity from './cpns/alarmseverity/index.vue';
335 337 import DetailTemplate from './cpns/detailtemplate/index.vue';
336 338 import { generateUUID } from '/@/hooks/web/useGenerateUUID';
... ... @@ -367,13 +369,6 @@
367 369 const ruleLastObj: any = ref<[]>([]);
368 370 const enableObj: any = ref({});
369 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 374 let profileData: any = ref<IProfileData[]>([]);
... ... @@ -413,10 +408,7 @@
413 408 propagate: false,
414 409 propagateRelationTypes: [''],
415 410 });
416   - //接收临时启用规则数据
417   - const receiveOpenRuleTempArr = ref<[]>([]);
418   - //接收临时规则条件数据
419   - const receiveRuleConditionTempArr = ref<[]>([]);
  411 +
420 412 //创建条件总对象
421 413 const createRulesObj: any = ref({});
422 414 let addCreateRulesObj = reactive({
... ... @@ -469,7 +461,6 @@
469 461 let fliterClearTempRuleConditionTempArr = ref<[]>([]);
470 462 let fliterClearTempOpenRuleTempArr: any = ref<[]>([]);
471 463 const getStepThreeEditStatus: any = ref(false);
472   - // const isEditDataAndValue = ref(false);
473 464 const getStepThreeEditArr = ref<[]>([]);
474 465 const getFilterStepThreeEditArr: any = ref<[]>([]);
475 466 const getFilterStepThreeEditClearArr: any = ref<[]>([]);
... ... @@ -478,16 +469,13 @@
478 469 const detailDetailModelArray = ref<[]>([]);
479 470 const createAlarmArray = ref<[]>([]);
480 471 const isLostFocuxStatus = ref(true);
481   - // const getEditDataAndValue = ref<[]>([]);
482 472 const editIndex = ref(-1);
  473 + const allAlarmsData = ref<[]>([]);
  474 + let allAlarmsSingleObj = reactive({});
483 475
484 476 setTimeout(() => {
485 477 getIsShowAddRule = props.isShowAddRule;
486 478 }, 10);
487   -
488   - const log = (e) => {
489   - console.log(e);
490   - };
491 479 const isAddRuleStatusFunc = (v) => {
492 480 isAddRuleStatus.value = v;
493 481 };
... ... @@ -503,16 +491,7 @@
503 491 const prevStep = () => {
504 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 495 //TODO Mobile dashboard:
517 496 const [dashboardForm] = useForm({
518 497 labelWidth: 120,
... ... @@ -573,16 +552,21 @@
573 552 const clearEditAllRegisterFormFunc = () => {
574 553 getFilterStepThreeEditArr.value.length = 0;
575 554 getFilterStepThreeEditArr.value = [];
  555 + try {
  556 + proxy.$refs.alarmSeverityRef.resetFieldsFunc();
  557 + } catch {}
576 558 };
577 559
578 560 //重置表单数据
579 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 572 const resetAllTemplateFunc = () => {
... ... @@ -639,9 +623,9 @@
639 623 }
640 624 }
641 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 631 return formatSchemeMap;
... ... @@ -721,7 +705,6 @@
721 705 getFilterStepThreeEditArr.value = [];
722 706 getFilterStepThreeEditClearArr.value = [];
723 707 getStepThreeEditStatus.value = v.isEditStatus;
724   - // isEditDataAndValue.value = v.isEditStatus;
725 708 getStepThreeEditArr.value = v.stepThreeData;
726 709 if (getFilterStepThreeEditClearArr.value.length == 0) {
727 710 getFilterStepThreeEditClearArr.value.push(v.stepThreeClearData as never);
... ... @@ -764,8 +747,6 @@
764 747 };
765 748
766 749 const emptyCreateRoleFunc = () => {
767   - receiveOpenRuleTempArr.value = [];
768   - receiveRuleConditionTempArr.value = [];
769 750 addNewOpenRule.schedule = {};
770 751 addNewRuleTem.condition.condition = {};
771 752 };
... ... @@ -797,7 +778,56 @@
797 778 const val1 = validateAlaramTypeValueFunc();
798 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 832 const addCreateRuleFunc = async () => {
803 833 try {
... ... @@ -849,6 +879,7 @@
849 879 const addCreateRole = async (index: number) => {
850 880 profileData.value[index]?.alarms.push(initCreateRules);
851 881 addCreateRuleFunc();
  882 + proxy.$refs.alarmSeverityRef.updateSchemaSelectDisableFunc();
852 883 };
853 884 // 删除创建条件
854 885 const deleteCondition = (index: number, createIndex: number) => {
... ... @@ -857,13 +888,6 @@
857 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 893 const getAllFieldsEnabFunc = (v) => {
... ... @@ -877,33 +901,7 @@
877 901 fliterTempRuleConditionTempArr.value.push({
878 902 condition: addNewRuleTem.condition.condition,
879 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 906 const formatAddRuleFunc = (v) => {
909 907 let formatMap = v.condition.map((f) => {
... ... @@ -974,6 +972,7 @@
974 972 };
975 973 getRegisterFormChangeDetailFunc();
976 974 addCreateRuleFunc();
  975 + addAlarmRuleFunc();
977 976 addClearAlaramRule();
978 977 getAllObjTemp = {
979 978 ...alarmTypeGet.value,
... ... @@ -1019,12 +1018,12 @@
1019 1018 getStepThreeEditStatus.value = false;
1020 1019 setTimeout(() => {
1021 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 1028 }, 10);
1030 1029 };
... ... @@ -1112,15 +1111,9 @@
1112 1111 setAlaramTypeFormFunc,
1113 1112 setTransmitAlarmFormFunc,
1114 1113 clearAllRegisterFormFunc,
1115   - ruleClearTemplateData,
1116   - enableClearTemplateData,
1117   - detailClearTemplateData,
1118 1114 handleOpenClearDetailTemplate,
1119 1115 handleOpenClearEnableRule,
1120 1116 handleOpenClearAlaramRuleConditions,
1121   - detailTemplateData,
1122   - enableTemplateData,
1123   - ruleTemplateData,
1124 1117 dashboardForm,
1125 1118 getAllClearFieldsRuleFunc,
1126 1119 getAllClearFieldsEnabFunc,
... ... @@ -1140,7 +1133,6 @@
1140 1133 handleOpenAlaramRuleConditions,
1141 1134 handleOpenDetailTemplate,
1142 1135 handleFormStep3toStep4Next,
1143   - log,
1144 1136 profileData,
1145 1137 deleteAlarmRule,
1146 1138 prevStep,
... ... @@ -1152,9 +1144,6 @@
1152 1144 setCreateRegisterFormChangeDetailFunc,
1153 1145 detailDetailModelArray,
1154 1146 isLostFocuxStatus,
1155   - // isEditDataAndValue,
1156   - // getEditDataAndValue,
1157   - // isEditDataAndValueFunc,
1158 1147 handleClickHidenEdit,
1159 1148 alarmSeverityRef,
1160 1149 detailTemplateRef,
... ...
... ... @@ -179,6 +179,7 @@ export const formSchema: FormSchema[] = [
179 179 label: '持续时间值',
180 180 colProps: { span: 13 },
181 181 component: 'Input',
  182 + defaultValue: 0,
182 183 componentProps: {
183 184 maxLength: 16,
184 185 placeholder: '请输入持续时间值(请输入数字)',
... ...
... ... @@ -132,7 +132,7 @@ export const formSchema: FormSchema[] = [
132 132 ifShow: ({ values }) => isString(Reflect.get(values, 'type1')),
133 133 },
134 134 {
135   - field: '',
  135 + field: 'no',
136 136 label: '大小写',
137 137 component: 'Checkbox',
138 138 colProps: { span: 13 },
... ... @@ -388,7 +388,7 @@ export const formSchema: FormSchema[] = [
388 388 ifShow: ({ values }) => isComplex(Reflect.get(values, 'type1')),
389 389 },
390 390 {
391   - field: '',
  391 + field: 'no',
392 392 component: 'DatePicker',
393 393 label: '请选择日期',
394 394 colProps: {
... ... @@ -400,7 +400,7 @@ export const formSchema: FormSchema[] = [
400 400 },
401 401 },
402 402 {
403   - field: '',
  403 + field: 'no',
404 404 component: 'TimePicker',
405 405 label: '请选择时间',
406 406 colProps: {
... ...
... ... @@ -6,6 +6,7 @@
6 6 @register="register"
7 7 :title="getTitle"
8 8 @ok="handleSubmit"
  9 + @cancel="handleCancel"
9 10 >
10 11 <CollapseContainer title="键名筛选器" class="border mb-8">
11 12 <div class="table-style">
... ... @@ -166,10 +167,16 @@
166 167 detailData.value.length = 0;
167 168 resetFields();
168 169 };
  170 +
  171 + const handleCancel = () => {
  172 + resetDataFunc();
  173 + };
169 174 const handleAddKey = () => {
170   - openModal(true, {
171   - isUpdate: false,
172   - });
  175 + setTimeout(() => {
  176 + openModal(true, {
  177 + isUpdate: false,
  178 + });
  179 + }, 30);
173 180 };
174 181 const handleEdit = (record: Recordable) => {
175 182 openModal(true, {
... ... @@ -198,6 +205,7 @@
198 205 reload();
199 206 };
200 207 return {
  208 + handleCancel,
201 209 schema,
202 210 detailData,
203 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 3 export const formSchema: FormSchema[] = [
6 4 {
... ... @@ -12,6 +10,7 @@ export const formSchema: FormSchema[] = [
12 10 },
13 11 componentProps() {
14 12 return {
  13 + placeholder: '请选择报警严重程度',
15 14 options: [
16 15 {
17 16 value: 'CRITICAL',
... ... @@ -34,9 +33,6 @@ export const formSchema: FormSchema[] = [
34 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 17 emits: ['success', 'register', 'getAllFields'],
18 18 setup(props) {
19 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 30 const getFieldsValueFunc = () => {
26 31 fieldValue.value = getFieldsValue();
27 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 77 const setFieldsValueFunc = () => {
31 78 if (props.alarmSeverityInfo != 1) {
... ... @@ -39,6 +86,8 @@
39 86 };
40 87 setFieldsValueFunc();
41 88 return {
  89 + resetFieldsFunc,
  90 + updateSchemaSelectDisableFunc,
42 91 getFieldsValueFunc,
43 92 registerForm,
44 93 };
... ...
1 1 import { FormSchema } from '/@/components/Form';
2 2 import { deviceConfigGetRuleChain } from '/@/api/device/deviceConfigApi';
3   -import { ref } from 'vue';
4 3 import { findDictItemByCode } from '/@/api/system/dict';
5 4 import { alarmContactGetPage } from '/@/api/device/deviceConfigApi';
6 5
... ... @@ -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 147 export const dashboardFormScheme: FormSchema[] = [
202 148 {
203 149 field: 'dashboardId',
... ...
... ... @@ -50,7 +50,7 @@
50 50 emits: ['success', 'register'],
51 51 setup(_, { emit }) {
52 52 const { createMessage } = useMessage();
53   - const { proxy } = getCurrentInstance();
  53 + const { proxy } = getCurrentInstance() as any;
54 54 const allPostForm = reactive({});
55 55 const getNameObj = reactive({
56 56 name: '',
... ...
... ... @@ -157,7 +157,7 @@
157 157 key: '',
158 158 value: '',
159 159 });
160   - const sonValues = reactive({
  160 + const sonValues: any = reactive({
161 161 configuration: {},
162 162 });
163 163 const [register, { validate, setFieldsValue, resetFields: defineClearFunc }] = useForm({
... ... @@ -239,7 +239,7 @@
239 239 credentialsV.credentials.type = sonValues.configuration.type;
240 240 const kong = {};
241 241 let kongTemp = {};
242   - keyAndValueArrTemp.value.map((item) => {
  242 + keyAndValueArrTemp.value.map((item: any) => {
243 243 kong[item.key] = item.value;
244 244 });
245 245 kongTemp = JSON.parse(JSON.stringify(kong));
... ...
... ... @@ -192,7 +192,7 @@
192 192 }
193 193 const kong = {};
194 194 let kongTemp = {};
195   - keyAndValueArrTemp.value.map((item) => {
  195 + keyAndValueArrTemp.value.map((item: any) => {
196 196 kong[item.key] = item.value;
197 197 });
198 198 kongTemp = JSON.parse(JSON.stringify(kong));
... ...
... ... @@ -88,7 +88,7 @@
88 88 type: '',
89 89 },
90 90 });
91   - const sonValues = reactive({
  91 + const sonValues: any = reactive({
92 92 configuration: {},
93 93 });
94 94 const [register, { validate, setFieldsValue, resetFields: defineClearFunc }] = useForm({
... ...
... ... @@ -142,12 +142,6 @@
142 142 const tempGetKeyAndVal = async () => {
143 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 146 const getDefaultValue = async () => {
153 147 await tempGetKeyAndVal();
... ... @@ -170,7 +164,7 @@
170 164 }
171 165 const kong = {};
172 166 let kongTemp = {};
173   - keyAndValueArrTemp.value.map((item) => {
  167 + keyAndValueArrTemp.value.map((item: any) => {
174 168 kong[item.key] = item.value;
175 169 });
176 170 kongTemp = JSON.parse(JSON.stringify(kong));
... ...
... ... @@ -39,7 +39,7 @@
39 39 props: ['getModeSelect', 'defineClearFuncProp'],
40 40 emits: ['prevSon'],
41 41 setup(props, { emit }) {
42   - const { proxy } = getCurrentInstance();
  42 + const { proxy } = getCurrentInstance() as any;
43 43 const getTransferConfigKafkaValue = ref({});
44 44 const refTransferConfigKafka = ref(null);
45 45 const refTransferConfigMqtt = ref(null);
... ...
... ... @@ -53,7 +53,7 @@
53 53 if (props.editActionFather !== 1) {
54 54 setTimeout(() => {
55 55 setFieldsValue(props.editActionFather);
56   - }, 100);
  56 + }, 10);
57 57 }
58 58 };
59 59 setFieldsFormValueFun();
... ... @@ -66,7 +66,7 @@
66 66 options: props.newActionMapFather,
67 67 },
68 68 });
69   - }, 100);
  69 + }, 10);
70 70 }
71 71 };
72 72 editSelectDevice();
... ...
... ... @@ -6,7 +6,11 @@
6 6 :rowSelection="{ type: 'checkbox' }"
7 7 >
8 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 15 </a-button>
12 16 <a-button color="error" @click="handleDeleteOrBatchDelete(null)" :disabled="hasBatchDelete">
... ...
... ... @@ -292,12 +292,12 @@
292 292 optionsItemArray.value.length = 0;
293 293 try {
294 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 301 clearActionsAllDevice();
302 302 resetActionsAllArrayFunc();
303 303 }, 10);
... ... @@ -309,6 +309,7 @@
309 309 }
310 310 } else {
311 311 try {
  312 + emit('success');
312 313 kongTriggerObj = {};
313 314 kongConditionObj = {};
314 315 kongActionObj = {};
... ... @@ -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 387 } catch (e) {
376 388 return e;
377 389 }
... ... @@ -619,6 +631,8 @@
619 631 getAllFormData.id = getId.value;
620 632 getAllFormData.tenantId = getTenantId.value;
621 633 refTriggerChildData = {};
  634 + refConditionChildData = {};
  635 + refActionChildData = {};
622 636 pushEditArray.value.length = 0;
623 637 pushEditConditionArray.value.length = 0;
624 638 pushEditActionArray.value.length = 0;
... ...
... ... @@ -35,7 +35,7 @@ export const searchFormSchema: FormSchema[] = [
35 35 {
36 36 field: 'textSearch',
37 37 label: '租户配置名称',
38   - colProps: { span: 8 },
  38 + colProps: { span: 6 },
39 39 component: 'Input',
40 40 componentProps: {
41 41 maxLength: 255,
... ... @@ -72,7 +72,7 @@ export const formSchema: FormSchema[] = [
72 72 component: 'Checkbox',
73 73 renderComponentContent: () => {
74 74 return h('span', {}, [
75   - h('span', {}, '在独立的ThinngsBoard规则引擎中处理'),
  75 + h('span', {}, '在独立的ThingsBoard规则引擎中处理'),
76 76 h('span', { style: { color: 'grey' } }, '(每个独立租户需要单独的微服务)'),
77 77 ]);
78 78 },
... ...
1 1 import { FormSchema } from '/@/components/Table';
2   -// import { numberRule } from '/@/utils/rules';
3 2
4 3 export const formSchema: FormSchema[] = [
5 4 {
... ... @@ -19,240 +18,240 @@ export const formSchema: FormSchema[] = [
19 18 required: true,
20 19
21 20 label: '最大设备数(0-无限制)',
22   - component: 'Input',
  21 + component: 'InputNumber',
  22 + defaultValue: '0',
23 23 colProps: { span: 24 },
24 24 componentProps: {
25 25 placeholder: '请输入最大设备数(请输入数字)',
26 26 },
27   - // rules: numberRule,
28 27 },
29 28 {
30 29 field: 'maxAssets',
31 30 required: true,
  31 + defaultValue: '0',
32 32
33 33 label: '最大资产数(0-无限制)',
34 34 colProps: { span: 24 },
35   - component: 'Input',
  35 + component: 'InputNumber',
36 36 componentProps: {
37 37 placeholder: '请输入最大资产(请输入数字)',
38 38 },
39   - // rules: numberRule,
40 39 },
41 40 {
42 41 field: 'maxCustomers',
43 42 required: true,
  43 + defaultValue: '0',
44 44
45 45 label: '最大客户数(0-无限制)',
46 46 colProps: { span: 24 },
47   - component: 'Input',
  47 + component: 'InputNumber',
48 48 componentProps: {
49 49 placeholder: '请输入最大客户数(请输入数字)',
50 50 },
51   - // rules: numberRule,
52 51 },
53 52 {
54 53 field: 'maxUsers',
55 54 required: true,
  55 + defaultValue: '0',
56 56
57 57 label: '最大用户数(0-无限制)',
58 58 colProps: { span: 24 },
59   - component: 'Input',
  59 + component: 'InputNumber',
60 60 componentProps: {
61 61 placeholder: '请输入最大用户数(请输入数字)',
62 62 },
63   - // rules: numberRule,
64 63 },
65 64 {
66 65 field: 'maxDashboards',
67 66 required: true,
  67 + defaultValue: '0',
68 68
69 69 label: '仪表板的最大数量(0-无限制)',
70 70 colProps: { span: 24 },
71   - component: 'Input',
  71 + component: 'InputNumber',
72 72 componentProps: {
73 73 placeholder: '请输入仪表板的最大数量(请输入数字)',
74 74 },
75   - // rules: numberRule,
76 75 },
77 76 {
78 77 field: 'maxRuleChains',
79 78 required: true,
  79 + defaultValue: '0',
80 80
81 81 label: '最大规则链数(0-无限制)',
82 82 colProps: { span: 24 },
83   - component: 'Input',
  83 + component: 'InputNumber',
84 84 componentProps: {
85 85 placeholder: '请输入最大规则链数(请输入数字)',
86 86 },
87   - // rules: numberRule,
88 87 },
89 88 {
90 89 field: 'maxResourcesInBytes',
91 90 required: true,
  91 + defaultValue: '0',
92 92
93 93 label: '以字节为单位的资源文件的最大总和(0-无限制)',
94 94 colProps: { span: 24 },
95   - component: 'Input',
  95 + component: 'InputNumber',
96 96 componentProps: {
97 97 placeholder: '请输入(请输入数字)',
98 98 },
99   - // rules: numberRule,
100 99 },
101 100 {
102 101 field: 'maxOtaPackagesInBytes',
103 102 required: true,
  103 + defaultValue: '0',
104 104
105 105 label: 'Ota包文件大小的最大总和(字节)(0-无限制)',
106 106 colProps: { span: 24 },
107   - component: 'Input',
  107 + component: 'InputNumber',
108 108 componentProps: {
109 109 placeholder: '请输入(请输入数字)',
110 110 },
111   - // rules: numberRule,
112 111 },
113 112 {
114 113 field: 'maxTransportMessages',
115 114 required: true,
  115 + defaultValue: '0',
116 116
117 117 label: '最大传输消息数(0-无限制)',
118 118 colProps: { span: 24 },
119   - component: 'Input',
  119 + component: 'InputNumber',
120 120 componentProps: {
121 121 placeholder: '请输入最大传输消息数(请输入数字)',
122 122 },
123   - // rules: numberRule,
124 123 },
125 124 {
126 125 field: 'maxTransportDataPoints',
127 126 required: true,
  127 + defaultValue: '0',
128 128
129 129 label: '传输数据点的最大数量(0-无限制)',
130 130 colProps: { span: 24 },
131   - component: 'Input',
  131 + component: 'InputNumber',
132 132 componentProps: {
133 133 placeholder: '请输入传输数据点的最大数量(请输入数字)',
134 134 },
135   - // rules: numberRule,
136 135 },
137 136 {
138 137 field: 'maxREExecutions',
139 138 required: true,
  139 + defaultValue: '0',
140 140
141 141 label: '最大规则引擎数(0-无限制)',
142 142 colProps: { span: 24 },
143   - component: 'Input',
  143 + component: 'InputNumber',
144 144 componentProps: {
145 145 placeholder: '请输入最大规则引擎数(请输入数字)',
146 146 },
147   - // rules: numberRule,
148 147 },
149 148
150 149 {
151 150 field: 'maxJSExecutions',
152 151 required: true,
  152 + defaultValue: '0',
153 153
154 154 label: '最大JavaScript执行数(0-不受限制)',
155 155 colProps: { span: 24 },
156   - component: 'Input',
  156 + component: 'InputNumber',
157 157 componentProps: {
158 158 placeholder: '请输入最大JavaScript执行数(请输入数字)',
159 159 },
160   - // rules: numberRule,
161 160 },
162 161 {
163 162 field: 'maxDPStorageDays',
164 163 required: true,
  164 + defaultValue: '0',
165 165
166 166 label: '最大日存储数据点数(0-无限制)',
167 167 colProps: { span: 24 },
168   - component: 'Input',
  168 + component: 'InputNumber',
169 169 componentProps: {
170 170 placeholder: '请输入最大日存储数据点数(请输入数字)',
171 171 },
172   - // rules: numberRule,
173 172 },
174 173 {
175 174 field: 'defaultStorageTtlDays',
176 175 required: true,
  176 + defaultValue: '0',
177 177
178 178 label: '默认存储 TTL 天数(0-无限制)',
179 179 colProps: { span: 24 },
180   - component: 'Input',
  180 + component: 'InputNumber',
181 181 componentProps: {
182 182 placeholder: '请输入默认存储 TTL 天数(请输入数字)',
183 183 },
184   - // rules: numberRule,
185 184 },
186 185 {
187 186 field: 'alarmsTtlDays',
188 187 required: true,
  188 + defaultValue: '0',
189 189
190 190 label: 'Alams TTL days(0-无限制)',
191 191 colProps: { span: 24 },
192   - component: 'Input',
  192 + component: 'InputNumber',
193 193 componentProps: {
194   - placeholder: '请输入Alams TTL days(请输入数字)',
  194 + placeholder: '请输入Alarms TTL days(请输入数字)',
195 195 },
196   - // rules: numberRule,
197 196 },
198 197 {
199 198 field: 'rpcTtlDays',
200 199 required: true,
  200 + defaultValue: '0',
201 201
202 202 label: 'RPC TTL days(0-无限制)',
203 203 colProps: { span: 24 },
204   - component: 'Input',
  204 + component: 'InputNumber',
205 205 componentProps: {
206 206 placeholder: '请输入RPC TTL days(请输入数字)',
207 207 },
208   - // rules: numberRule,
209 208 },
210 209 {
211 210 field: 'maxRuleNodeExecutionsPerMessage',
212 211 required: true,
213   -
  212 + defaultValue: '1',
214 213 label: '每条消息的最大规则节点执行数(0-无限制)',
215 214 colProps: { span: 24 },
216   - component: 'Input',
  215 + component: 'InputNumber',
217 216 componentProps: {
218 217 placeholder: '请输入每条消息的最大规则节点执行数(请输入数字)',
219 218 },
220   - // rules: numberRule,
221 219 },
222 220 {
223 221 field: 'maxEmails',
224 222 required: true,
225 223 label: '发送的最大电子邮件数(0-无限制)',
226 224 colProps: { span: 24 },
227   - component: 'Input',
  225 + defaultValue: '0',
  226 +
  227 + component: 'InputNumber',
228 228 componentProps: {
229 229 placeholder: '请输入发送的最大电子邮件数(请输入数字)',
230 230 },
231   - // rules: numberRule,
232 231 },
233 232 {
234 233 field: 'maxSms',
235 234 required: true,
  235 + defaultValue: '0',
236 236
237 237 label: '发送的最大短信数(0-无限制)',
238 238 colProps: { span: 24 },
239   - component: 'Input',
  239 + component: 'InputNumber',
240 240 componentProps: {
241 241 placeholder: '请输入发送的最大短信数(请输入数字)',
242 242 },
243   - // rules: numberRule,
244 243 },
245 244 {
246 245 field: 'maxCreatedAlarms',
247 246 required: true,
  247 + defaultValue: '0',
248 248
249 249 label: '创建的最大报警数 (0 - 无限制)',
250 250 colProps: { span: 24 },
251   - component: 'Input',
  251 + component: 'InputNumber',
252 252 componentProps: {
253 253 placeholder: '请输入maxCreatedAlarms(请输入数字)',
254 254 },
255   - // rules: numberRule,
256 255 },
257 256 {
258 257 field: 'transportTenantMsgRateLimit',
... ...
1 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 7 </template>
6 8 <script lang="ts">
7 9 import { defineComponent, ref } from 'vue';
... ... @@ -40,3 +42,10 @@
40 42 },
41 43 });
42 44 </script>
  45 +<style lang="less" scoped>
  46 + .tenant-class {
  47 + :deep .ant-input-number {
  48 + width: 34vw !important;
  49 + }
  50 + }
  51 +</style>
... ...
1 1 <template>
2   - <div>
  2 + <div class="drawer-class">
3 3 <BasicDrawer
4 4 v-bind="$attrs"
5 5 @register="registerDrawer"
... ... @@ -32,7 +32,7 @@
32 32 let postAllData: any = reactive({});
33 33 const parentSetData: any = ref(null);
34 34 let getValuesFormData: any = reactive({});
35   - const { proxy } = getCurrentInstance();
  35 + const { proxy } = getCurrentInstance() as any;
36 36 const getChildData = ref(null);
37 37 const editGetId: any = ref('');
38 38 const [registerForm, { getFieldsValue, resetFields, setFieldsValue }] = useForm({
... ... @@ -115,3 +115,15 @@
115 115 },
116 116 });
117 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 58 });
59 59 return [
60 60 {
  61 + required: true,
61 62 validator(_, value) {
62 63 return new Promise((resolve, reject) => {
63 64 if (value == '') {
... ... @@ -76,7 +77,7 @@
76 77 },
77 78 },
78 79 ];
79   - } catch (e) {}
  80 + } catch {}
80 81 },
81 82 },
82 83 {
... ...