Commit ff201cbefebf6215921990daeab4feb2c9a5c85c

Authored by fengtao
1 parent b65d16e9

fix:设备配置编辑第三步的数据回显问题解决,待修改设备配置编辑如果什么都没编辑点击提交报400问题

src/views.zip deleted 100644 → 0
No preview for this file type
@@ -154,6 +154,9 @@ @@ -154,6 +154,9 @@
154 }); 154 });
155 proxy.$refs.DeviceProfileStep3Ref.clearProfileDataFunc(); 155 proxy.$refs.DeviceProfileStep3Ref.clearProfileDataFunc();
156 proxy.$refs.DeviceProfileStep3Ref.addAlarmRule(); 156 proxy.$refs.DeviceProfileStep3Ref.addAlarmRule();
  157 + setTimeout(() => {
  158 + emit('success');
  159 + }, 10);
157 } else if (isUpdate.value == 3) { 160 } else if (isUpdate.value == 3) {
158 postEditId.value = data.record.id; 161 postEditId.value = data.record.id;
159 getBackendData = await deviceConfigGetDetail(postEditId.value); 162 getBackendData = await deviceConfigGetDetail(postEditId.value);
@@ -174,6 +177,9 @@ @@ -174,6 +177,9 @@
174 }); 177 });
175 proxy.$refs.DeviceProfileStep3Ref.clearProfileDataFunc(); 178 proxy.$refs.DeviceProfileStep3Ref.clearProfileDataFunc();
176 proxy.$refs.DeviceProfileStep3Ref.addAlarmRule(); 179 proxy.$refs.DeviceProfileStep3Ref.addAlarmRule();
  180 + setTimeout(() => {
  181 + emit('success');
  182 + }, 10);
177 } 183 }
178 }); 184 });
179 function handleStepPrev() { 185 function handleStepPrev() {
@@ -184,9 +190,6 @@ @@ -184,9 +190,6 @@
184 getStepOneData.value = v; 190 getStepOneData.value = v;
185 getStepOneData.value.icon = v1; 191 getStepOneData.value.icon = v1;
186 if (isUpdate.value == 1) { 192 if (isUpdate.value == 1) {
187 - // return setTimeout(() => {  
188 - // proxy.$refs.DeviceProfileStep2Ref.customClearStepTwoValueFunc();  
189 - // }, 10);  
190 } else if (isUpdate.value == 2) { 193 } else if (isUpdate.value == 2) {
191 return proxy.$refs.DeviceProfileStep2Ref.setStepTwoFieldsValueFunc({ 194 return proxy.$refs.DeviceProfileStep2Ref.setStepTwoFieldsValueFunc({
192 transportType: editData.value?.profileData.transportConfiguration.type, 195 transportType: editData.value?.profileData.transportConfiguration.type,
@@ -200,7 +203,6 @@ @@ -200,7 +203,6 @@
200 function handleStep2Next(v) { 203 function handleStep2Next(v) {
201 current.value++; 204 current.value++;
202 getStepTwoData.value = v; 205 getStepTwoData.value = v;
203 -  
204 if (isUpdate.value == 1) { 206 if (isUpdate.value == 1) {
205 proxy.$refs.DeviceProfileStep3Ref.initAddAlarmRuleFunc(); 207 proxy.$refs.DeviceProfileStep3Ref.initAddAlarmRuleFunc();
206 proxy.$refs.DeviceProfileStep3Ref.resetRegisterFormCreateAlarmFunc(); 208 proxy.$refs.DeviceProfileStep3Ref.resetRegisterFormCreateAlarmFunc();
@@ -224,6 +226,9 @@ @@ -224,6 +226,9 @@
224 proxy.$refs.DeviceProfileStep3Ref.setRegisterFormClearChangeDetailFunc({ 226 proxy.$refs.DeviceProfileStep3Ref.setRegisterFormClearChangeDetailFunc({
225 alarmDetails: editData.value?.profileData.alarms[0].clearRule.alarmDetails, 227 alarmDetails: editData.value?.profileData.alarms[0].clearRule.alarmDetails,
226 }); 228 });
  229 + proxy.$refs.DeviceProfileStep3Ref.setRegisterFormCreateAlarmFunc({
  230 + default: editData.value?.profileData.alarms[0].createRules,
  231 + });
227 //回显创建报警规则和清除报警规则 232 //回显创建报警规则和清除报警规则
228 } else if (isUpdate.value == 3) { 233 } else if (isUpdate.value == 3) {
229 proxy.$refs.DeviceProfileStep3Ref.setAlaramTypeFormFunc({ 234 proxy.$refs.DeviceProfileStep3Ref.setAlaramTypeFormFunc({
@@ -252,13 +257,6 @@ @@ -252,13 +257,6 @@
252 current.value++; 257 current.value++;
253 getStepThreeData.value = v; 258 getStepThreeData.value = v;
254 if (isUpdate.value == 1) { 259 if (isUpdate.value == 1) {
255 - // try {  
256 - // setTimeout(() => {  
257 - // proxy.$refs.DeviceProfileStep4Ref.clearAlaramContactAndNoticeMethodFunc();  
258 - // }, 500);  
259 - // } catch (e) {  
260 - // return e;  
261 - // }  
262 } else if (isUpdate.value == 2) { 260 } else if (isUpdate.value == 2) {
263 proxy.$refs.DeviceProfileStep4Ref.setAlaramContactAndNoticeMethodFunc({ 261 proxy.$refs.DeviceProfileStep4Ref.setAlaramContactAndNoticeMethodFunc({
264 alarmContactId: editData.value?.alarmProfile.alarmContactId.split(','), 262 alarmContactId: editData.value?.alarmProfile.alarmContactId.split(','),
@@ -7,6 +7,7 @@ export const alertContactsSchemas: FormSchema[] = [ @@ -7,6 +7,7 @@ export const alertContactsSchemas: FormSchema[] = [
7 field: 'alarmContactId', 7 field: 'alarmContactId',
8 label: '告警通知联系人', 8 label: '告警通知联系人',
9 component: 'ApiSelect', 9 component: 'ApiSelect',
  10 + required: true,
10 componentProps: { 11 componentProps: {
11 mode: 'multiple', 12 mode: 'multiple',
12 api: alarmContactGetPage, 13 api: alarmContactGetPage,
@@ -161,7 +161,7 @@ @@ -161,7 +161,7 @@
161 openModal(true, { 161 openModal(true, {
162 isUpdate: 1, 162 isUpdate: 1,
163 }); 163 });
164 - }, 100); 164 + }, 10);
165 } 165 }
166 166
167 function handleEdit(record: Recordable) { 167 function handleEdit(record: Recordable) {
@@ -169,16 +169,18 @@ @@ -169,16 +169,18 @@
169 openModal(true, { 169 openModal(true, {
170 record, 170 record,
171 isUpdate: 2, 171 isUpdate: 2,
  172 + isLostFocuxStatus: true,
172 }); 173 });
173 - }, 100); 174 + }, 10);
174 } 175 }
175 async function handleDetailView(record: Recordable) { 176 async function handleDetailView(record: Recordable) {
176 setTimeout(() => { 177 setTimeout(() => {
177 openModal(true, { 178 openModal(true, {
178 record, 179 record,
179 isUpdate: 3, 180 isUpdate: 3,
  181 + isLostFocuxStatus: true,
180 }); 182 });
181 - }, 100); 183 + }, 10);
182 } 184 }
183 const useSelectionChange = () => { 185 const useSelectionChange = () => {
184 selectedRowKeys = getSelectRowKeys(); 186 selectedRowKeys = getSelectRowKeys();
@@ -68,17 +68,19 @@ @@ -68,17 +68,19 @@
68 <div class="w-3/4" style="margin-left: 40px"> 68 <div class="w-3/4" style="margin-left: 40px">
69 <!-- 报警严重程度 --> 69 <!-- 报警严重程度 -->
70 <div style="margin-left: 10px; margin-top: 20px" 70 <div style="margin-left: 10px; margin-top: 20px"
71 - ><BasicForm @register="registerFormCreateAlarm" />  
72 - <div  
73 - v-for="(i8, index8) in getStepThreeEditStatus ? createAlarmArray : []"  
74 - :key="index8"  
75 - style="position: relative"  
76 - >  
77 - <p  
78 - style="position: absolute; top: -6vh; left: 6.5vw"  
79 - v-if="index8 == createIndex"  
80 - >{{ formatAlarmFunc(i8) }}</p 71 + ><BasicForm v-if="childItem" @register="registerFormCreateAlarm" />
  72 + <div>
  73 + <div
  74 + v-for="(i8, index8) in getStepThreeEditStatus ? createAlarmArray : []"
  75 + :key="index8"
  76 + style="position: relative"
81 > 77 >
  78 + <p
  79 + style="position: absolute; top: -10.2vh; left: 6.5vw; z-index: 1"
  80 + v-if="index8 == createIndex"
  81 + >{{ formatAlarmFunc(i8) }}</p
  82 + >
  83 + </div>
82 </div> 84 </div>
83 </div> 85 </div>
84 <!-- 报警严重程度 --> 86 <!-- 报警严重程度 -->
@@ -92,7 +94,6 @@ @@ -92,7 +94,6 @@
92 @click="handleOpenAlaramRuleConditions" 94 @click="handleOpenAlaramRuleConditions"
93 >添加</Button 95 >添加</Button
94 > 96 >
95 -  
96 <template 97 <template
97 v-for="(v2, index2) in getStepThreeEditStatus 98 v-for="(v2, index2) in getStepThreeEditStatus
98 ? getFilterStepThreeEditArr 99 ? getFilterStepThreeEditArr
@@ -106,6 +107,14 @@ @@ -106,6 +107,14 @@
106 >报警规则条件:{{ openRuleConditionComp(v2) }}</p 107 >报警规则条件:{{ openRuleConditionComp(v2) }}</p
107 > 108 >
108 </template> 109 </template>
  110 + <template
  111 + v-for="(vi, indexi) in isEditDataAndValue ? getEditDataAndValue : []"
  112 + :key="indexi"
  113 + >
  114 + <p v-if="indexi == createIndex && isEditDataAndValue"
  115 + >报警规则条件:{{ isEditDataAndValueFunc(vi) }}</p
  116 + >
  117 + </template>
109 </div> 118 </div>
110 <div style="white-space: wrap; margin-top: 25px" class="mt-4 ml-4" 119 <div style="white-space: wrap; margin-top: 25px" class="mt-4 ml-4"
111 >报警启用规则: 120 >报警启用规则:
@@ -143,13 +152,14 @@ @@ -143,13 +152,14 @@
143 <BasicForm @register="registerFormChangeDetail" /> 152 <BasicForm @register="registerFormChangeDetail" />
144 </div> 153 </div>
145 <div 154 <div
  155 + style="position: relative"
146 v-for="(i7, index7) in getStepThreeEditStatus 156 v-for="(i7, index7) in getStepThreeEditStatus
147 ? detailDetailModelArray 157 ? detailDetailModelArray
148 : []" 158 : []"
149 :key="index7" 159 :key="index7"
150 > 160 >
151 <p 161 <p
152 - style="margin-top: 1.5vh; margin-left: 5.6vw" 162 + style="position: absolute; top: -2.3vh; left: 5.68vw"
153 v-if="index7 == createIndex" 163 v-if="index7 == createIndex"
154 >{{ i7 }}</p 164 >{{ i7 }}</p
155 > 165 >
@@ -164,7 +174,7 @@ @@ -164,7 +174,7 @@
164 </div> 174 </div>
165 <div 175 <div
166 class="remove-type" 176 class="remove-type"
167 - style="display: inline-block; position: relative; top: -257px; left: 757px" 177 + style="display: inline-block; position: relative; top: -33vh; left: 39.4vw"
168 > 178 >
169 <img 179 <img
170 v-if="isAddRuleStatus" 180 v-if="isAddRuleStatus"
@@ -216,7 +226,7 @@ @@ -216,7 +226,7 @@
216 /> 226 />
217 </div> 227 </div>
218 <div class="aic mb-1" style="border: 1px solid #bfbfbf"> 228 <div class="aic mb-1" style="border: 1px solid #bfbfbf">
219 - <div class="w-3/4" style="margin-left: 40px"> 229 + <div class="w-3/4 aic-class" style="margin-left: 40px">
220 <div style="margin-left: 5px"> 230 <div style="margin-left: 5px">
221 <div style="color: #f5594e" class="mt-4 ml-4" 231 <div style="color: #f5594e" class="mt-4 ml-4"
222 >报警规则条件: 232 >报警规则条件:
@@ -327,6 +337,7 @@ @@ -327,6 +337,7 @@
327 step3CreateAlarm, 337 step3CreateAlarm,
328 dashboardFormScheme, 338 dashboardFormScheme,
329 isWhereType, 339 isWhereType,
  340 + isLostFocux,
330 formChangeDetailSchema, 341 formChangeDetailSchema,
331 } from './data'; 342 } from './data';
332 import { PlusCircleOutlined } from '@ant-design/icons-vue'; 343 import { PlusCircleOutlined } from '@ant-design/icons-vue';
@@ -335,8 +346,8 @@ @@ -335,8 +346,8 @@
335 import EnableRule from './cpns/enablerule/index.vue'; 346 import EnableRule from './cpns/enablerule/index.vue';
336 import AlarmRuleConditions from './cpns/alarmruleconditions/index.vue'; 347 import AlarmRuleConditions from './cpns/alarmruleconditions/index.vue';
337 import { Button } from '/@/components/Button'; 348 import { Button } from '/@/components/Button';
338 -  
339 export const isWhereTypeValueDisabled = ref(false); 349 export const isWhereTypeValueDisabled = ref(false);
  350 +
340 export default defineComponent({ 351 export default defineComponent({
341 components: { 352 components: {
342 BasicForm, 353 BasicForm,
@@ -466,20 +477,20 @@ @@ -466,20 +477,20 @@
466 let fliterClearTempRuleConditionTempArr = ref<[]>([]); 477 let fliterClearTempRuleConditionTempArr = ref<[]>([]);
467 let fliterClearTempOpenRuleTempArr = ref<[]>([]); 478 let fliterClearTempOpenRuleTempArr = ref<[]>([]);
468 const getStepThreeEditStatus: any = ref(false); 479 const getStepThreeEditStatus: any = ref(false);
  480 + const isEditDataAndValue = ref(false);
469 const getStepThreeEditArr = ref<[]>([]); 481 const getStepThreeEditArr = ref<[]>([]);
470 const getFilterStepThreeEditArr = ref<[]>([]); 482 const getFilterStepThreeEditArr = ref<[]>([]);
471 const getFilterStepThreeEditClearArr = ref<[]>([]); 483 const getFilterStepThreeEditClearArr = ref<[]>([]);
472 const getFilterStepThreeClearDetailEditArr = ref<[]>([]); 484 const getFilterStepThreeClearDetailEditArr = ref<[]>([]);
473 let getIsShowAddRule = true; 485 let getIsShowAddRule = true;
474 -  
475 const detailDetailModelArray = ref<[]>([]); 486 const detailDetailModelArray = ref<[]>([]);
476 const createAlarmArray = ref<[]>([]); 487 const createAlarmArray = ref<[]>([]);
  488 + const isLostFocuxStatus = ref(true);
  489 + const getEditDataAndValue = ref<[]>([]);
477 490
478 - // getIsShowAddRule.value = props.isShowAddRule;  
479 - // console.log(getIsShowAddRule.value);  
480 setTimeout(() => { 491 setTimeout(() => {
481 getIsShowAddRule = props.isShowAddRule; 492 getIsShowAddRule = props.isShowAddRule;
482 - }, 100); 493 + }, 10);
483 494
484 const log = (e) => { 495 const log = (e) => {
485 console.log(e); 496 console.log(e);
@@ -550,11 +561,7 @@ @@ -550,11 +561,7 @@
550 //详情模板 561 //详情模板
551 const [ 562 const [
552 registerFormChangeDetail, 563 registerFormChangeDetail,
553 - {  
554 - getFieldsValue: getRegisterFormChangeDetail,  
555 - resetFields: resetRegisterFormChangeDetail,  
556 - // setFieldsValue: setCreateRegisterFormChangeDetail,  
557 - }, 564 + { getFieldsValue: getRegisterFormChangeDetail, resetFields: resetRegisterFormChangeDetail },
558 ] = useForm({ 565 ] = useForm({
559 labelWidth: 120, 566 labelWidth: 120,
560 schemas: formChangeDetailSchema, 567 schemas: formChangeDetailSchema,
@@ -611,7 +618,7 @@ @@ -611,7 +618,7 @@
611 resetRegisterFormClearChangeDetailFunc(); 618 resetRegisterFormClearChangeDetailFunc();
612 resetAllTemplateFunc(); 619 resetAllTemplateFunc();
613 resetRegisterFormCreateAlarmFunc(); 620 resetRegisterFormCreateAlarmFunc();
614 - }, 100); 621 + }, 10);
615 }; 622 };
616 //重置报警启用规则-报警规则条件 623 //重置报警启用规则-报警规则条件
617 const resetAllTemplateFunc = () => { 624 const resetAllTemplateFunc = () => {
@@ -656,55 +663,33 @@ @@ -656,55 +663,33 @@
656 const setTransmitAlarmFormFunc = (v) => { 663 const setTransmitAlarmFormFunc = (v) => {
657 setTransmitAlarmFunc(v); 664 setTransmitAlarmFunc(v);
658 }; 665 };
659 - const setRegisterFormCreateAlarmFunc = (v) => {  
660 - setRegisterFormCreateAlarm(v); 666 + const setRegisterFormCreateAlarmFunc = async () => {
  667 + setRegisterFormCreateAlarm({
  668 + default: '',
  669 + });
661 }; 670 };
662 -  
663 - const optionsAlaram = [  
664 - {  
665 - value: 'CRITICAL',  
666 - label: '危险',  
667 - },  
668 - {  
669 - value: 'MAJOR',  
670 - label: '重要',  
671 - },  
672 - {  
673 - value: 'MINOR',  
674 - label: '次要',  
675 - },  
676 - {  
677 - value: 'WARNING',  
678 - label: '警告',  
679 - },  
680 - {  
681 - value: 'INDETERMINATE',  
682 - label: '不确定',  
683 - },  
684 - ];  
685 const openRuleComp = (v1) => { 671 const openRuleComp = (v1) => {
686 - let newOpenRuleComp = null;  
687 - optionsAlaram.forEach((f) => {  
688 - if (  
689 - f.value === v1?.MAJOR ||  
690 - v1?.MINOR ||  
691 - v1?.INDETERMINATE ||  
692 - v1?.CRITICAL ||  
693 - v1?.WARNING  
694 - ) {  
695 - newOpenRuleComp =  
696 - v1?.MAJOR ||  
697 - v1?.MINOR ||  
698 - v1?.INDETERMINATE ||  
699 - v1?.CRITICAL ||  
700 - v1?.WARNING?.schedule?.type; 672 + let openSchemObj = {};
  673 + for (let i in v1) {
  674 + if (i == 'CRITICAL') {
  675 + openSchemObj = v1[i];
  676 + } else if (i == 'MAJOR') {
  677 + openSchemObj = v1[i];
  678 + } else if (i == 'MINOR') {
  679 + openSchemObj = v1[i];
  680 + } else if (i == 'WARNING') {
  681 + openSchemObj = v1[i];
  682 + } else if (i == 'INDETERMINATE') {
  683 + openSchemObj = v1[i];
701 } 684 }
702 - });  
703 - return newOpenRuleComp?.schedule?.type == 'ANY_TIME'  
704 - ? '始终启用'  
705 - : newOpenRuleComp?.schedule?.type == 'SPECIFIC_TIME'  
706 - ? '定时启用'  
707 - : '自定义启用'; 685 + }
  686 + let formatSchemeMap =
  687 + openSchemObj?.schedule.type == 'ANY_TIME'
  688 + ? '始终启用'
  689 + : openSchemObj?.schedule.type == 'SPECIFIC_TIME'
  690 + ? '定时启用'
  691 + : '自定义启用';
  692 + return formatSchemeMap;
708 }; 693 };
709 //清除报警规则 694 //清除报警规则
710 const openClearRuleConditionComp = (v4) => { 695 const openClearRuleConditionComp = (v4) => {
@@ -781,6 +766,7 @@ @@ -781,6 +766,7 @@
781 getFilterStepThreeEditArr.value = []; 766 getFilterStepThreeEditArr.value = [];
782 getFilterStepThreeEditClearArr.value = []; 767 getFilterStepThreeEditClearArr.value = [];
783 getStepThreeEditStatus.value = v.isEditStatus; 768 getStepThreeEditStatus.value = v.isEditStatus;
  769 + isEditDataAndValue.value = v.isEditStatus;
784 getStepThreeEditArr.value = v.stepThreeData; 770 getStepThreeEditArr.value = v.stepThreeData;
785 if (getFilterStepThreeEditClearArr.value.length == 0) { 771 if (getFilterStepThreeEditClearArr.value.length == 0) {
786 getFilterStepThreeEditClearArr.value.push(v.stepThreeClearData as never); 772 getFilterStepThreeEditClearArr.value.push(v.stepThreeClearData as never);
@@ -916,7 +902,9 @@ @@ -916,7 +902,9 @@
916 isWhereTypeValueDisabled.value = true; 902 isWhereTypeValueDisabled.value = true;
917 } 903 }
918 }); 904 });
919 - 905 + watch(isLostFocux, (nV) => {
  906 + isLostFocuxStatus.value = nV;
  907 + });
920 //报警规则 908 //报警规则
921 //启用规则 909 //启用规则
922 const getAllFieldsEnabFunc = (v) => { 910 const getAllFieldsEnabFunc = (v) => {
@@ -930,6 +918,34 @@ @@ -930,6 +918,34 @@
930 fliterTempRuleConditionTempArr.value.push({ 918 fliterTempRuleConditionTempArr.value.push({
931 condition: addNewRuleTem.condition.condition, 919 condition: addNewRuleTem.condition.condition,
932 }); 920 });
  921 + if (isEditDataAndValue.value == true) {
  922 + getEditDataAndValue.value.push({
  923 + condition: addNewRuleTem.condition.condition,
  924 + });
  925 + }
  926 + };
  927 + //格式化编辑
  928 + const isEditDataAndValueFunc = (v) => {
  929 + let formatMap = v.condition.map((f) => {
  930 + return f.predicate.operation == 'EQUAL'
  931 + ? f.key.key + '等于' + f.predicate.value.defaultValue
  932 + : f.predicate.operation == 'STARTS_WITH'
  933 + ? f.key.key + '开始于' + f.predicate.value.defaultValue
  934 + : f.predicate.operation == 'ENDS_WITH'
  935 + ? f.key.key + '结束于' + f.predicate.value.defaultValue
  936 + : f.predicate.operation == 'NOT_CONTAINS'
  937 + ? f.key.key + '不包含' + f.predicate.value.defaultValue
  938 + : f.predicate.operation == 'NOT_EQUAL'
  939 + ? f.key.key + '不等于' + f.predicate.value.defaultValue
  940 + : f.predicate.operation == 'GREATER'
  941 + ? f.key.key + '大于' + f.predicate.value.defaultValue
  942 + : f.predicate.operation == 'LESS'
  943 + ? f.key.key + '小于' + f.predicate.value.defaultValue
  944 + : f.predicate.operation == 'GREATER_OR_EQUAL'
  945 + ? f.key.key + '大于或等于' + f.predicate.value.defaultValue
  946 + : f.key.key + '小于或等于' + f.predicate.value.defaultValue;
  947 + });
  948 + return formatMap;
933 }; 949 };
934 //格式化新增 950 //格式化新增
935 const formatAddRuleFunc = (v) => { 951 const formatAddRuleFunc = (v) => {
@@ -996,7 +1012,7 @@ @@ -996,7 +1012,7 @@
996 function generateUUID() { 1012 function generateUUID() {
997 let d = new Date().getTime(); 1013 let d = new Date().getTime();
998 if (window.performance && typeof window.performance.now === 'function') { 1014 if (window.performance && typeof window.performance.now === 'function') {
999 - d += performance.now(); //use high-precision timer if available 1015 + d += performance.now();
1000 } 1016 }
1001 let uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) { 1017 let uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
1002 let r = (d + Math.random() * 16) % 16 | 0; 1018 let r = (d + Math.random() * 16) % 16 | 0;
@@ -1043,20 +1059,17 @@ @@ -1043,20 +1059,17 @@
1043 openModal1(true); 1059 openModal1(true);
1044 setTimeout(() => { 1060 setTimeout(() => {
1045 proxy.$refs.getChildData1.resetDataFunc(); 1061 proxy.$refs.getChildData1.resetDataFunc();
1046 - }, 1000);  
1047 - }, 50); 1062 + }, 10);
  1063 + }, 10);
1048 }; 1064 };
1049 const handleOpenEnableRule = () => { 1065 const handleOpenEnableRule = () => {
1050 - // if (getStepThreeEditStatus.value == true) {  
1051 - // getStepThreeEditStatus.value = !getStepThreeEditStatus.value;  
1052 - // }  
1053 isRuleAlarmRuleConditions.value = 2; 1066 isRuleAlarmRuleConditions.value = 2;
1054 setTimeout(() => { 1067 setTimeout(() => {
1055 openModal2(true); 1068 openModal2(true);
1056 setTimeout(() => { 1069 setTimeout(() => {
1057 proxy.$refs.getChildData2.resetDataFunc(); 1070 proxy.$refs.getChildData2.resetDataFunc();
1058 - }, 1000);  
1059 - }, 50); 1071 + }, 10);
  1072 + }, 10);
1060 }; 1073 };
1061 const handleOpenAlaramRuleConditions = () => { 1074 const handleOpenAlaramRuleConditions = () => {
1062 isRuleAlarmRuleConditions.value = 3; 1075 isRuleAlarmRuleConditions.value = 3;
@@ -1065,11 +1078,11 @@ @@ -1065,11 +1078,11 @@
1065 try { 1078 try {
1066 setTimeout(() => { 1079 setTimeout(() => {
1067 proxy.$refs.getChildData3.resetDataFunc(); 1080 proxy.$refs.getChildData3.resetDataFunc();
1068 - }, 1000); 1081 + }, 10);
1069 } catch (e) { 1082 } catch (e) {
1070 return e; 1083 return e;
1071 } 1084 }
1072 - }, 500); 1085 + }, 10);
1073 }; 1086 };
1074 const handleOpenClearDetailTemplate = () => { 1087 const handleOpenClearDetailTemplate = () => {
1075 isRuleAlarmRuleConditions.value = 4; 1088 isRuleAlarmRuleConditions.value = 4;
@@ -1078,29 +1091,23 @@ @@ -1078,29 +1091,23 @@
1078 try { 1091 try {
1079 setTimeout(() => { 1092 setTimeout(() => {
1080 proxy.$refs.getChildData1.resetDataFunc(); 1093 proxy.$refs.getChildData1.resetDataFunc();
1081 - }, 1000); 1094 + }, 10);
1082 } catch (e) { 1095 } catch (e) {
1083 return e; 1096 return e;
1084 } 1097 }
1085 - }, 500); 1098 + }, 10);
1086 }; 1099 };
1087 const handleOpenClearEnableRule = () => { 1100 const handleOpenClearEnableRule = () => {
1088 isRuleAlarmRuleConditions.value = 5; 1101 isRuleAlarmRuleConditions.value = 5;
1089 setTimeout(() => { 1102 setTimeout(() => {
1090 openModal5(true); 1103 openModal5(true);
1091 - setTimeout(() => {  
1092 - // proxy.$refs.getChildData2.resetDataFunc();  
1093 - }, 1000);  
1094 - }, 50); 1104 + }, 10);
1095 }; 1105 };
1096 const handleOpenClearAlaramRuleConditions = () => { 1106 const handleOpenClearAlaramRuleConditions = () => {
1097 isRuleAlarmRuleConditions.value = 6; 1107 isRuleAlarmRuleConditions.value = 6;
1098 setTimeout(() => { 1108 setTimeout(() => {
1099 openModal6(true); 1109 openModal6(true);
1100 - setTimeout(() => {  
1101 - // proxy.$refs.getChildData3.resetDataFunc();  
1102 - }, 1000);  
1103 - }, 50); 1110 + }, 10);
1104 }; 1111 };
1105 1112
1106 return { 1113 return {
@@ -1182,6 +1189,10 @@ @@ -1182,6 +1189,10 @@
1182 deleteCondition, 1189 deleteCondition,
1183 setCreateRegisterFormChangeDetailFunc, 1190 setCreateRegisterFormChangeDetailFunc,
1184 detailDetailModelArray, 1191 detailDetailModelArray,
  1192 + isLostFocuxStatus,
  1193 + isEditDataAndValue,
  1194 + getEditDataAndValue,
  1195 + isEditDataAndValueFunc,
1185 }; 1196 };
1186 }, 1197 },
1187 }); 1198 });
@@ -1203,9 +1214,15 @@ @@ -1203,9 +1214,15 @@
1203 align-items: center; 1214 align-items: center;
1204 border-radius: 10px; 1215 border-radius: 10px;
1205 margin-top: 15px; 1216 margin-top: 15px;
  1217 + .aic-class {
  1218 + position: relative;
  1219 + }
1206 } 1220 }
1207 1221
1208 :deep(.vben-collapse-container__header) { 1222 :deep(.vben-collapse-container__header) {
1209 border: none; 1223 border: none;
1210 } 1224 }
  1225 + :deep .ant-select-selection-placeholder {
  1226 + display: none;
  1227 + }
1211 </style> 1228 </style>
@@ -8,36 +8,37 @@ @@ -8,36 +8,37 @@
8 @ok="handleSubmit" 8 @ok="handleSubmit"
9 > 9 >
10 <CollapseContainer title="键名筛选器" class="border mb-8"> 10 <CollapseContainer title="键名筛选器" class="border mb-8">
11 - <BasicTable  
12 - :showIndexColumn="false"  
13 - :resizeHeightOffset="200"  
14 - :dataSource="getTableApiData"  
15 - @register="registerTable"  
16 - >  
17 - <template #toolbar>  
18 - <a-button type="primary" @click="handleAddKey">新增键名筛选器</a-button>  
19 - </template>  
20 - <template #action="{ record }">  
21 - <TableAction  
22 - :actions="[  
23 - {  
24 - label: '编辑',  
25 - icon: 'clarity:note-edit-line',  
26 - onClick: handleEdit.bind(null, record),  
27 - },  
28 - {  
29 - label: '删除',  
30 - icon: 'ant-design:delete-outlined',  
31 - color: 'error',  
32 - popConfirm: {  
33 - title: '是否确认删除',  
34 - confirm: handleDelete.bind(null, record), 11 + <div class="table-style">
  12 + <BasicTable
  13 + :showIndexColumn="false"
  14 + :dataSource="getTableApiData"
  15 + @register="registerTable"
  16 + >
  17 + <template #toolbar>
  18 + <a-button type="primary" @click="handleAddKey">新增键名筛选器</a-button>
  19 + </template>
  20 + <template #action="{ record }">
  21 + <TableAction
  22 + :actions="[
  23 + {
  24 + label: '编辑',
  25 + icon: 'clarity:note-edit-line',
  26 + onClick: handleEdit.bind(null, record),
35 }, 27 },
36 - },  
37 - ]"  
38 - />  
39 - </template>  
40 - </BasicTable> 28 + {
  29 + label: '删除',
  30 + icon: 'ant-design:delete-outlined',
  31 + color: 'error',
  32 + popConfirm: {
  33 + title: '是否确认删除',
  34 + confirm: handleDelete.bind(null, record),
  35 + },
  36 + },
  37 + ]"
  38 + />
  39 + </template>
  40 + </BasicTable>
  41 + </div>
41 </CollapseContainer> 42 </CollapseContainer>
42 <CollapseContainer title="筛选器预览" class="border mb-8"> 43 <CollapseContainer title="筛选器预览" class="border mb-8">
43 <!-- <p v-for="(item, index) in detailData" :key="index">{{ item }}</p> --> 44 <!-- <p v-for="(item, index) in detailData" :key="index">{{ item }}</p> -->
@@ -138,7 +139,6 @@ @@ -138,7 +139,6 @@
138 title: '键名筛选器', 139 title: '键名筛选器',
139 columns: keyColumns, 140 columns: keyColumns,
140 bordered: true, 141 bordered: true,
141 - // api: useWaitFunc,  
142 showIndexColumn: false, 142 showIndexColumn: false,
143 pagination: false, 143 pagination: false,
144 autoCreateKey: true, 144 autoCreateKey: true,
@@ -195,13 +195,8 @@ @@ -195,13 +195,8 @@
195 getTableApiData.value.push(receiveData.value); 195 getTableApiData.value.push(receiveData.value);
196 detailData.value.push(receiveData.value); 196 detailData.value.push(receiveData.value);
197 setFunc(getTableApiData.value); 197 setFunc(getTableApiData.value);
198 - // setFunc1(detailData.value);  
199 reload(); 198 reload();
200 }; 199 };
201 - // const useWaitFunc = async (v) => {  
202 - // // detailData.value.push(v);  
203 - // return getTableApiData.value.push(v), detailData.value.push(v);  
204 - // };  
205 return { 200 return {
206 schema, 201 schema,
207 detailData, 202 detailData,
@@ -223,9 +218,9 @@ @@ -223,9 +218,9 @@
223 }); 218 });
224 </script> 219 </script>
225 <style lang="less" scoped> 220 <style lang="less" scoped>
226 - :deep.ant-table-body { 221 + :deep .ant-table-body {
227 overflow-y: auto !important; 222 overflow-y: auto !important;
228 - min-height: 173px !important;  
229 - height: 100px !important; 223 + min-height: 90px !important;
  224 + height: 0px !important;
230 } 225 }
231 </style> 226 </style>
@@ -48,21 +48,6 @@ export const step1Schemas: FormSchema[] = [ @@ -48,21 +48,6 @@ export const step1Schemas: FormSchema[] = [
48 field: 'defaultQueueName', 48 field: 'defaultQueueName',
49 label: '处理队列', 49 label: '处理队列',
50 component: 'ApiSelect', 50 component: 'ApiSelect',
51 - // componentProps: {  
52 - // api: async () => {  
53 - // const data = await findDictItemByCode({ dictCode: 'queen_execute_sequence' });  
54 - // const returnData = data.map((m) => {  
55 - // return {  
56 - // getLabelField: m.itemText,  
57 - // getValueField: m.itemValue,  
58 - // };  
59 - // });  
60 - // return returnData;  
61 - // },  
62 - // labelField: 'getLabelField',  
63 - // valueField: 'getValueField',  
64 - // immediate: true,  
65 - // },  
66 componentProps: { 51 componentProps: {
67 api: findDictItemByCode, 52 api: findDictItemByCode,
68 params: { 53 params: {
@@ -163,19 +148,18 @@ export const step3HighSetting: FormSchema[] = [ @@ -163,19 +148,18 @@ export const step3HighSetting: FormSchema[] = [
163 ]; 148 ];
164 149
165 export const isWhereType = ref(null); 150 export const isWhereType = ref(null);
  151 +export const isLostFocux = ref(true);
166 152
167 export const step3CreateAlarm: FormSchema[] = [ 153 export const step3CreateAlarm: FormSchema[] = [
168 { 154 {
169 field: 'default', 155 field: 'default',
170 component: 'Select', 156 component: 'Select',
171 - required: true,  
172 label: '报警严重程度:', 157 label: '报警严重程度:',
173 colProps: { 158 colProps: {
174 span: 17, 159 span: 17,
175 }, 160 },
176 componentProps() { 161 componentProps() {
177 return { 162 return {
178 - placeholder: '请选择严重程度',  
179 options: [ 163 options: [
180 { 164 {
181 value: 'CRITICAL', 165 value: 'CRITICAL',
@@ -201,6 +185,9 @@ export const step3CreateAlarm: FormSchema[] = [ @@ -201,6 +185,9 @@ export const step3CreateAlarm: FormSchema[] = [
201 onChange: (v) => { 185 onChange: (v) => {
202 isWhereType.value = v ? v : 'INDETERMINATE'; 186 isWhereType.value = v ? v : 'INDETERMINATE';
203 }, 187 },
  188 + onFocus: () => {
  189 + isLostFocux.value = false;
  190 + },
204 }; 191 };
205 }, 192 },
206 }, 193 },
@@ -266,11 +253,11 @@ export const formChangeDetailSchema: FormSchema[] = [ @@ -266,11 +253,11 @@ export const formChangeDetailSchema: FormSchema[] = [
266 field: 'alarmDetails', 253 field: 'alarmDetails',
267 label: '', 254 label: '',
268 colProps: { span: 13 }, 255 colProps: { span: 13 },
269 - required: true,  
270 component: 'Input', 256 component: 'Input',
  257 + defaultValue: '',
271 componentProps: { 258 componentProps: {
  259 + placeholder: '.',
272 maxLength: 255, 260 maxLength: 255,
273 - placeholder: '请输入报警详细信息',  
274 }, 261 },
275 }, 262 },
276 ]; 263 ];