Commit 3a077970aa3aeafcb6846a6a5c487a86691506a5
1 parent
db7d22cf
style:修改设备配置样式,fix:修改报警详细信息为输入框,fix:清除设备配置部分控制台警告,fix:完全清除场景联动控制台警告,fix:修复角色管理菜单…
…回显问题,feat:新增消息发送里的手机号验证规则
Showing
27 changed files
with
367 additions
and
299 deletions
src/assets/images/shanchu.png
0 → 100644
688 Bytes
@@ -244,7 +244,7 @@ | @@ -244,7 +244,7 @@ | ||
244 | </script> | 244 | </script> |
245 | <style scoped lang="less"> | 245 | <style scoped lang="less"> |
246 | .change-avatar { | 246 | .change-avatar { |
247 | - /deep/ .ant-upload-select-picture-card { | 247 | + :deep .ant-upload-select-picture-card { |
248 | display: inherit; | 248 | display: inherit; |
249 | float: none; | 249 | float: none; |
250 | width: 8.6vw; | 250 | width: 8.6vw; |
@@ -4,8 +4,6 @@ import { mainOutRoutes } from './mainOut'; | @@ -4,8 +4,6 @@ import { mainOutRoutes } from './mainOut'; | ||
4 | import { PageEnum } from '/@/enums/pageEnum'; | 4 | import { PageEnum } from '/@/enums/pageEnum'; |
5 | import { t } from '/@/hooks/web/useI18n'; | 5 | import { t } from '/@/hooks/web/useI18n'; |
6 | import { LAYOUT } from '../constant'; | 6 | import { LAYOUT } from '../constant'; |
7 | -import { getMenuList } from '/@/api/sys/menu'; | ||
8 | -import { router } from '/@/router'; | ||
9 | 7 | ||
10 | const modules = import.meta.globEager('./modules/**/*.ts'); | 8 | const modules = import.meta.globEager('./modules/**/*.ts'); |
11 | const routeModuleList: AppRouteModule[] = []; | 9 | const routeModuleList: AppRouteModule[] = []; |
@@ -14,40 +12,6 @@ Object.keys(modules).forEach((key) => { | @@ -14,40 +12,6 @@ Object.keys(modules).forEach((key) => { | ||
14 | const modList = Array.isArray(mod) ? [...mod] : [mod]; | 12 | const modList = Array.isArray(mod) ? [...mod] : [mod]; |
15 | routeModuleList.push(...modList); | 13 | routeModuleList.push(...modList); |
16 | }); | 14 | }); |
17 | -let pushPath = ''; | ||
18 | -let pushSubPath = ''; | ||
19 | - | ||
20 | -async function hashChangeFunc() { | ||
21 | - const getMenuListData1 = window.localStorage.getItem('menuListStorage') || (await getMenuList()); | ||
22 | - const getMenuListData = JSON.parse(getMenuListData1); | ||
23 | - const getHomePage = getMenuListData.find((f) => { | ||
24 | - return f.path == '/dashboard/workbench'; | ||
25 | - }); | ||
26 | - if (getHomePage?.path == '/dashboard/workbench') { | ||
27 | - setTimeout(() => { | ||
28 | - router.push('/dashboard/workbench'); | ||
29 | - }, 200); | ||
30 | - } else { | ||
31 | - const routeF = getMenuListData[0]?.children[0]?.path || getMenuListData[0].path; | ||
32 | - pushPath = routeF; | ||
33 | - pushSubPath = pushPath.substring(1); | ||
34 | - } | ||
35 | -} | ||
36 | -hashChangeFunc(); | ||
37 | - | ||
38 | -window.onhashchange = (e) => { | ||
39 | - console.log(e); | ||
40 | - setTimeout(() => { | ||
41 | - if ( | ||
42 | - e.newURL == 'http://localhost:8083/#/' || | ||
43 | - e.newURL == 'http://localhost:8083/#' || | ||
44 | - e.newURL == 'http://localhost:8083/' || | ||
45 | - e.newURL == 'http://localhost:8083' | ||
46 | - ) { | ||
47 | - window.location.href = e.newURL + pushSubPath; | ||
48 | - } | ||
49 | - }, 1000); | ||
50 | -}; | ||
51 | 15 | ||
52 | export const asyncRoutes = [PAGE_NOT_FOUND_ROUTE, ...routeModuleList]; | 16 | export const asyncRoutes = [PAGE_NOT_FOUND_ROUTE, ...routeModuleList]; |
53 | export const RootRoute: AppRouteRecordRaw = { | 17 | export const RootRoute: AppRouteRecordRaw = { |
@@ -122,7 +122,6 @@ const transform: AxiosTransform = { | @@ -122,7 +122,6 @@ const transform: AxiosTransform = { | ||
122 | const err: string = error?.toString?.() ?? ''; | 122 | const err: string = error?.toString?.() ?? ''; |
123 | let errMessage = ''; | 123 | let errMessage = ''; |
124 | try { | 124 | try { |
125 | - console.log(response.data); | ||
126 | if (response.data.status == '401' || response.data.message == '"Authentication failed"') { | 125 | if (response.data.status == '401' || response.data.message == '"Authentication failed"') { |
127 | window.localStorage.clear(); | 126 | window.localStorage.clear(); |
128 | window.sessionStorage.clear(); | 127 | window.sessionStorage.clear(); |
@@ -18,11 +18,11 @@ | @@ -18,11 +18,11 @@ | ||
18 | <DatePicker @change="onDateChange" v-model:value="dateValue" /> | 18 | <DatePicker @change="onDateChange" v-model:value="dateValue" /> |
19 | </div> | 19 | </div> |
20 | </template> | 20 | </template> |
21 | - <div v-show="activeKey === '1'"> | 21 | + <div v-if="activeKey === '1'"> |
22 | <!-- 折线图 --> | 22 | <!-- 折线图 --> |
23 | <VisitAnalysis :alarmList="state.alarmList" /> | 23 | <VisitAnalysis :alarmList="state.alarmList" /> |
24 | </div> | 24 | </div> |
25 | - <div v-show="activeKey === '2'"> | 25 | + <div v-if="activeKey === '2'"> |
26 | <!-- 柱形图 --> | 26 | <!-- 柱形图 --> |
27 | <VisitAnalysisBar :dataPointList="state.dataPointList" :messageList="state.messageList" /> | 27 | <VisitAnalysisBar :dataPointList="state.dataPointList" :messageList="state.messageList" /> |
28 | </div> | 28 | </div> |
1 | <template> | 1 | <template> |
2 | - <div> | 2 | + <div style="min-width: 100%"> |
3 | <p class="center">告警数</p> | 3 | <p class="center">告警数</p> |
4 | <div ref="chartRef" :style="{ height, width }" v-show="alarmList.length"></div> | 4 | <div ref="chartRef" :style="{ height, width }" v-show="alarmList.length"></div> |
5 | <div v-show="!alarmList.length"><Empty /></div> | 5 | <div v-show="!alarmList.length"><Empty /></div> |
@@ -58,6 +58,9 @@ | @@ -58,6 +58,9 @@ | ||
58 | setOptions({ | 58 | setOptions({ |
59 | tooltip: { | 59 | tooltip: { |
60 | trigger: 'axis', | 60 | trigger: 'axis', |
61 | + axisPointer: { | ||
62 | + type: 'cross', | ||
63 | + }, | ||
61 | }, | 64 | }, |
62 | grid: { | 65 | grid: { |
63 | left: '3%', | 66 | left: '3%', |
1 | <template> | 1 | <template> |
2 | - <div> | 2 | + <div style="min-width: 100%"> |
3 | <p class="center">消息量</p> | 3 | <p class="center">消息量</p> |
4 | <div ref="chartRef" :style="{ height, width }" v-show="dataPointList.length"></div> | 4 | <div ref="chartRef" :style="{ height, width }" v-show="dataPointList.length"></div> |
5 | <div v-show="!dataPointList.length"><Empty /></div> | 5 | <div v-show="!dataPointList.length"><Empty /></div> |
@@ -153,7 +153,6 @@ | @@ -153,7 +153,6 @@ | ||
153 | } | 153 | } |
154 | function handleStep2Next(v) { | 154 | function handleStep2Next(v) { |
155 | current.value++; | 155 | current.value++; |
156 | - | ||
157 | getStepTwoData.value = v; | 156 | getStepTwoData.value = v; |
158 | if (unref(isUpdate)) { | 157 | if (unref(isUpdate)) { |
159 | proxy.$refs.DeviceProfileStep3Ref.retryRegisterFormFunc({ | 158 | proxy.$refs.DeviceProfileStep3Ref.retryRegisterFormFunc({ |
@@ -162,7 +161,7 @@ | @@ -162,7 +161,7 @@ | ||
162 | proxy.$refs.DeviceProfileStep3Ref.retryRegisterFormHighSettingmFunc({ | 161 | proxy.$refs.DeviceProfileStep3Ref.retryRegisterFormHighSettingmFunc({ |
163 | propagate: editEchoData.value.profileData.alarms[0].propagate, | 162 | propagate: editEchoData.value.profileData.alarms[0].propagate, |
164 | propagateRelationTypes: | 163 | propagateRelationTypes: |
165 | - editEchoData.value.profileData?.alarms[0].propagateRelationTypes, | 164 | + editEchoData.value.profileData?.alarms[0].propagateRelationTypes[0], |
166 | }); | 165 | }); |
167 | const getKey = Object.keys(editEchoData.value.profileData?.alarms[0].createRules); | 166 | const getKey = Object.keys(editEchoData.value.profileData?.alarms[0].createRules); |
168 | proxy.$refs.DeviceProfileStep3Ref.retryRegisterFormCreateAlarmFunc({ | 167 | proxy.$refs.DeviceProfileStep3Ref.retryRegisterFormCreateAlarmFunc({ |
@@ -212,13 +211,11 @@ | @@ -212,13 +211,11 @@ | ||
212 | ` | 211 | ` |
213 | ); | 212 | ); |
214 | proxy.$refs.DeviceProfileStep3Ref.retryEnableFormDataFunc(`始终启用`); | 213 | proxy.$refs.DeviceProfileStep3Ref.retryEnableFormDataFunc(`始终启用`); |
215 | - proxy.$refs.DeviceProfileStep3Ref.retryTemplateFormDataFunc( | ||
216 | - ` | ||
217 | - 报警详细信息:${ | ||
218 | - editEchoData.value.profileData?.alarms[0].createRules[getKey[0]].alarmDetails | ||
219 | - } | ||
220 | - ` | ||
221 | - ); | 214 | + proxy.$refs.DeviceProfileStep3Ref.setRegisterFormChangeDetailFunc({ |
215 | + alarmDetails: | ||
216 | + editEchoData.value.profileData?.alarms[0].createRules[getKey[0]].alarmDetails, | ||
217 | + }); | ||
218 | + | ||
222 | //清除报警 | 219 | //清除报警 |
223 | proxy.$refs.DeviceProfileStep3Ref.retryRulesClearFormDataFunc( | 220 | proxy.$refs.DeviceProfileStep3Ref.retryRulesClearFormDataFunc( |
224 | ` | 221 | ` |
@@ -226,21 +223,23 @@ | @@ -226,21 +223,23 @@ | ||
226 | ` | 223 | ` |
227 | ); | 224 | ); |
228 | proxy.$refs.DeviceProfileStep3Ref.retryEnableClearFormDataFunc(`始终启用`); | 225 | proxy.$refs.DeviceProfileStep3Ref.retryEnableClearFormDataFunc(`始终启用`); |
229 | - proxy.$refs.DeviceProfileStep3Ref.retryTemplateClearFormDataFunc( | ||
230 | - ` | ||
231 | - 报警详细信息:${editEchoData.value.profileData?.alarms[0].clearRule.alarmDetails} | ||
232 | - ` | ||
233 | - ); | 226 | + proxy.$refs.DeviceProfileStep3Ref.setRegisterFormClearChangeDetailFunc({ |
227 | + alarmDetails: editEchoData.value.profileData?.alarms[0].clearRule.alarmDetails, | ||
228 | + }); | ||
234 | } else { | 229 | } else { |
235 | - proxy.$refs.DeviceProfileStep3Ref.resetRegisterFormFunc(); | ||
236 | - proxy.$refs.DeviceProfileStep3Ref.resetRegisterFormHighSettingmFunc(); | ||
237 | - proxy.$refs.DeviceProfileStep3Ref.resetRegisterFormCreateAlarmFunc(); | ||
238 | - proxy.$refs.DeviceProfileStep3Ref.resetRulesFormDataFunc(); | ||
239 | - proxy.$refs.DeviceProfileStep3Ref.resetEnableFormDataFunc(); | ||
240 | - proxy.$refs.DeviceProfileStep3Ref.resetTemplateFormDataFunc(); | ||
241 | - proxy.$refs.DeviceProfileStep3Ref.resetRulesClearFormDataFunc(); | ||
242 | - proxy.$refs.DeviceProfileStep3Ref.resetEnableClearFormDataFunc(); | ||
243 | - proxy.$refs.DeviceProfileStep3Ref.resetTemplateClearFormDataFunc(); | 230 | + try { |
231 | + proxy.$refs.DeviceProfileStep3Ref.resetRegisterFormFunc(); | ||
232 | + proxy.$refs.DeviceProfileStep3Ref.resetRegisterFormHighSettingmFunc(); | ||
233 | + proxy.$refs.DeviceProfileStep3Ref.resetRegisterFormCreateAlarmFunc(); | ||
234 | + proxy.$refs.DeviceProfileStep3Ref.resetRulesFormDataFunc(); | ||
235 | + proxy.$refs.DeviceProfileStep3Ref.resetEnableFormDataFunc(); | ||
236 | + proxy.$refs.DeviceProfileStep3Ref.resetTemplateFormDataFunc(); | ||
237 | + proxy.$refs.DeviceProfileStep3Ref.resetRulesClearFormDataFunc(); | ||
238 | + proxy.$refs.DeviceProfileStep3Ref.resetEnableClearFormDataFunc(); | ||
239 | + proxy.$refs.DeviceProfileStep3Ref.resetTemplateClearFormDataFunc(); | ||
240 | + proxy.$refs.DeviceProfileStep3Ref.resetRegisterFormChangeDetailFunc(); | ||
241 | + proxy.$refs.DeviceProfileStep3Ref.resetRegisterFormClearChangeDetailFunc(); | ||
242 | + } catch (e) {} | ||
244 | } | 243 | } |
245 | } | 244 | } |
246 | function handleStep3Next(v) { | 245 | function handleStep3Next(v) { |
@@ -248,16 +247,23 @@ | @@ -248,16 +247,23 @@ | ||
248 | getStepThreeData.value = v; | 247 | getStepThreeData.value = v; |
249 | try { | 248 | try { |
250 | if (unref(isUpdate)) { | 249 | if (unref(isUpdate)) { |
251 | - setTimeout(() => { | ||
252 | - try { | ||
253 | - proxy.$refs.DeviceProfileStep4Ref.resetFieldsFunc({ | ||
254 | - alarmContactId: editEchoData.value.alarmProfile.alarmContactId, | ||
255 | - messageMode: editEchoData.value.alarmProfile.messageMode, | ||
256 | - }); | ||
257 | - } catch (e) { | ||
258 | - return e; | ||
259 | - } | ||
260 | - }, 1000); | 250 | + try { |
251 | + proxy.$refs.DeviceProfileStep4Ref.resetFieldsFunc({ | ||
252 | + alarmContactId: editEchoData.value.alarmProfile.alarmContactId, | ||
253 | + messageMode: editEchoData.value.alarmProfile.messageMode, | ||
254 | + }); | ||
255 | + } catch (e) { | ||
256 | + return e; | ||
257 | + } | ||
258 | + } else { | ||
259 | + try { | ||
260 | + proxy.$refs.DeviceProfileStep4Ref.resetFieldsFunc({ | ||
261 | + alarmContactId: '', | ||
262 | + messageMode: '', | ||
263 | + }); | ||
264 | + } catch (e) { | ||
265 | + return e; | ||
266 | + } | ||
261 | } | 267 | } |
262 | } catch (e) { | 268 | } catch (e) { |
263 | return e; | 269 | return e; |
@@ -302,7 +308,7 @@ | @@ -302,7 +308,7 @@ | ||
302 | } | 308 | } |
303 | }; | 309 | }; |
304 | const handleCancel = () => { | 310 | const handleCancel = () => { |
305 | - return; | 311 | + closeModal(); |
306 | }; | 312 | }; |
307 | return { | 313 | return { |
308 | handleChange, | 314 | handleChange, |
@@ -10,7 +10,7 @@ | @@ -10,7 +10,7 @@ | ||
10 | components: { BasicForm }, | 10 | components: { BasicForm }, |
11 | setup() { | 11 | setup() { |
12 | const getValueData: any = ref({}); | 12 | const getValueData: any = ref({}); |
13 | - const [register, { setProps, getFieldsValue }] = useForm({ | 13 | + const [register, { getFieldsValue, resetFields }] = useForm({ |
14 | schemas: alertContactsSchemas, | 14 | schemas: alertContactsSchemas, |
15 | actionColOptions: { | 15 | actionColOptions: { |
16 | span: 24, | 16 | span: 24, |
@@ -22,10 +22,13 @@ | @@ -22,10 +22,13 @@ | ||
22 | getV = getValueData.value; | 22 | getV = getValueData.value; |
23 | return getV; | 23 | return getV; |
24 | } | 24 | } |
25 | + const customResetStep4AndFunc = () => { | ||
26 | + resetFields(); | ||
27 | + }; | ||
25 | return { | 28 | return { |
29 | + customResetStep4AndFunc, | ||
26 | getAllFields, | 30 | getAllFields, |
27 | register, | 31 | register, |
28 | - setProps, | ||
29 | }; | 32 | }; |
30 | }, | 33 | }, |
31 | }); | 34 | }); |
1 | <template> | 1 | <template> |
2 | <div> | 2 | <div> |
3 | <BasicModal | 3 | <BasicModal |
4 | - :showCancelBtn="true" | 4 | + :showCancelBtn="false" |
5 | :showOkBtn="false" | 5 | :showOkBtn="false" |
6 | v-bind="$attrs" | 6 | v-bind="$attrs" |
7 | width="55rem" | 7 | width="55rem" |
@@ -315,7 +315,7 @@ | @@ -315,7 +315,7 @@ | ||
315 | setRegisterStep3HighSetting({ | 315 | setRegisterStep3HighSetting({ |
316 | propagate: descInfo.value.profileData?.alarms[0]?.propagate, | 316 | propagate: descInfo.value.profileData?.alarms[0]?.propagate, |
317 | propagateRelationTypes: | 317 | propagateRelationTypes: |
318 | - descInfo.value.profileData?.alarms[0]?.propagateRelationTypes, | 318 | + descInfo.value.profileData?.alarms[0]?.propagateRelationTypes[0], |
319 | }); | 319 | }); |
320 | const getKey = Object.keys(descInfo.value.profileData?.alarms[0]?.createRules); | 320 | const getKey = Object.keys(descInfo.value.profileData?.alarms[0]?.createRules); |
321 | setRegisterStep3CreateAlarm({ | 321 | setRegisterStep3CreateAlarm({ |
@@ -486,13 +486,13 @@ | @@ -486,13 +486,13 @@ | ||
486 | 486 | ||
487 | <style scoped lang="less"> | 487 | <style scoped lang="less"> |
488 | .input-style { | 488 | .input-style { |
489 | - /deep/ .ant-form-item-control-input { | 489 | + :deep .ant-form-item-control-input { |
490 | position: relative; | 490 | position: relative; |
491 | display: flex; | 491 | display: flex; |
492 | align-items: center; | 492 | align-items: center; |
493 | min-height: 02px; | 493 | min-height: 02px; |
494 | } | 494 | } |
495 | - /deep/.ant-col-24 { | 495 | + :deep.ant-col-24 { |
496 | display: block; | 496 | display: block; |
497 | flex: 0 0 100%; | 497 | flex: 0 0 100%; |
498 | max-width: 100%; | 498 | max-width: 100%; |
@@ -501,13 +501,13 @@ | @@ -501,13 +501,13 @@ | ||
501 | } | 501 | } |
502 | 502 | ||
503 | .clear-input-style { | 503 | .clear-input-style { |
504 | - /deep/ .ant-form-item-control-input { | 504 | + :deep .ant-form-item-control-input { |
505 | position: relative; | 505 | position: relative; |
506 | display: flex; | 506 | display: flex; |
507 | align-items: center; | 507 | align-items: center; |
508 | min-height: 02px; | 508 | min-height: 02px; |
509 | } | 509 | } |
510 | - /deep/.ant-col-24 { | 510 | + :deep.ant-col-24 { |
511 | display: block; | 511 | display: block; |
512 | flex: 0 0 100%; | 512 | flex: 0 0 100%; |
513 | max-width: 100%; | 513 | max-width: 100%; |
@@ -19,7 +19,7 @@ | @@ -19,7 +19,7 @@ | ||
19 | :actions="[ | 19 | :actions="[ |
20 | { | 20 | { |
21 | label: '详情', | 21 | label: '详情', |
22 | - icon: 'clarity:note-edit-line', | 22 | + icon: 'ant-design:eye-outlined', |
23 | onClick: handleDetailView.bind(null, record), | 23 | onClick: handleDetailView.bind(null, record), |
24 | }, | 24 | }, |
25 | { | 25 | { |
@@ -29,7 +29,7 @@ | @@ -29,7 +29,7 @@ | ||
29 | }, | 29 | }, |
30 | { | 30 | { |
31 | label: '导出', | 31 | label: '导出', |
32 | - icon: 'clarity:note-edit-line', | 32 | + icon: 'ant-design:login-outlined', |
33 | onClick: handleExport.bind(null, record), | 33 | onClick: handleExport.bind(null, record), |
34 | }, | 34 | }, |
35 | { | 35 | { |
@@ -42,7 +42,9 @@ | @@ -42,7 +42,9 @@ | ||
42 | </Upload> | 42 | </Upload> |
43 | </div> | 43 | </div> |
44 | </div> | 44 | </div> |
45 | - <BasicForm @register="register" /> | 45 | + <div style="margin-top: -50px"> |
46 | + <BasicForm @register="register" /> | ||
47 | + </div> | ||
46 | </div> | 48 | </div> |
47 | </div> | 49 | </div> |
48 | </template> | 50 | </template> |
@@ -167,7 +169,7 @@ | @@ -167,7 +169,7 @@ | ||
167 | color: @text-color; | 169 | color: @text-color; |
168 | } | 170 | } |
169 | .device-icon-style { | 171 | .device-icon-style { |
170 | - /deep/ .ant-upload-select-picture-card { | 172 | + :deep .ant-upload-select-picture-card { |
171 | display: inherit; | 173 | display: inherit; |
172 | float: none; | 174 | float: none; |
173 | width: 8.6vw; | 175 | width: 8.6vw; |
@@ -47,7 +47,9 @@ | @@ -47,7 +47,9 @@ | ||
47 | try { | 47 | try { |
48 | const values = await validate(); | 48 | const values = await validate(); |
49 | emit('next', values); | 49 | emit('next', values); |
50 | - } catch (error) {} | 50 | + } catch (error) { |
51 | + } finally { | ||
52 | + } | ||
51 | } | 53 | } |
52 | return { register, resetFieldsFunc, customResetAndFunc }; | 54 | return { register, resetFieldsFunc, customResetAndFunc }; |
53 | }, | 55 | }, |
1 | <template> | 1 | <template> |
2 | - <div class="step3"> | 2 | + <div class="step3" style="background-color: #f6f8f9"> |
3 | <template v-for="(item, index) in profileData" :key="item.id"> | 3 | <template v-for="(item, index) in profileData" :key="item.id"> |
4 | <CollapseContainer class="border mb-1" :canExpan="false"> | 4 | <CollapseContainer class="border mb-1" :canExpan="false"> |
5 | <template #action> | 5 | <template #action> |
@@ -8,110 +8,125 @@ | @@ -8,110 +8,125 @@ | ||
8 | style="cursor: pointer" | 8 | style="cursor: pointer" |
9 | @click="deleteAlarmRule(index)" | 9 | @click="deleteAlarmRule(index)" |
10 | alt="移除" | 10 | alt="移除" |
11 | - src="../../../../assets/images/close.png" | 11 | + src="../../../../assets/images/shanchu.png" |
12 | /> | 12 | /> |
13 | </div> | 13 | </div> |
14 | </template> | 14 | </template> |
15 | - <div class="alert-type" style="margin-left: -26px; margin-top: -10px"> | ||
16 | - <BasicForm @register="registerForm" | ||
17 | - /></div> | ||
18 | - <div style="margin-top: -20px"> | ||
19 | - <div style="margin-left: 20px; margin-top: -10px"> | ||
20 | - <BasicForm | ||
21 | - @register="registerFormHighSetting" | ||
22 | - style="margin-left: 12px; margin-top: -10px" | ||
23 | - > | ||
24 | - <template #checkBox="{ model, field }"> | ||
25 | - <Checkbox v-model:checked="model[field]">传递报警</Checkbox> | ||
26 | - </template> | ||
27 | - </BasicForm> | 15 | + <div style="margin-top: -15px; margin-left: 10px"> |
16 | + <div class="alert-type" style="margin-left: -50px; margin-top: -10px"> | ||
17 | + <BasicForm @register="registerForm" | ||
18 | + /></div> | ||
19 | + <div style="margin-top: -15px"> | ||
20 | + <div style="margin-left: -8px; margin-top: -10px"> | ||
21 | + <BasicForm | ||
22 | + @register="registerFormHighSetting" | ||
23 | + style="margin-left: 12px; margin-top: -10px" | ||
24 | + > | ||
25 | + <template #checkBox="{ model, field }"> | ||
26 | + <Checkbox v-model:checked="model[field]">传递报警</Checkbox> | ||
27 | + </template> | ||
28 | + </BasicForm> | ||
29 | + </div> | ||
28 | </div> | 30 | </div> |
29 | </div> | 31 | </div> |
30 | - <p>创建报警规则</p> | ||
31 | - <template v-for="(childItem, createIndex) in item.alarms" :key="childItem.id"> | ||
32 | - <div class="aic" style="border: 1px solid #bfbfbf"> | ||
33 | - <div class="w-3/4"> | ||
34 | - <div style="margin-left: -33px; margin-top: 20px" | ||
35 | - ><BasicForm @register="registerFormCreateAlarm" /> | ||
36 | - </div> | ||
37 | - <div style="margin-left: 5px; margin-top: -50px"> | ||
38 | - <div style="color: #f5594e" class="ml-4" | ||
39 | - >报警规则条件: | ||
40 | - <Button size="small" type="primary" @click="handleOpenAlaramRuleConditions" | ||
41 | - >添加</Button | ||
42 | - > | ||
43 | - <p>{{ ruleTemplateData }}</p> | 32 | + <div style="margin-top: -57px"> |
33 | + <p style="margin-left: 10px">创建报警规则</p> | ||
34 | + <template v-for="(childItem, createIndex) in item.alarms" :key="childItem.id"> | ||
35 | + <div class="aic" style="border: 1px solid #bfbfbf"> | ||
36 | + <div class="w-3/4" style="margin-left: 40px"> | ||
37 | + <div style="margin-left: -33px; margin-top: 20px" | ||
38 | + ><BasicForm @register="registerFormCreateAlarm" /> | ||
44 | </div> | 39 | </div> |
45 | - <div style="white-space: wrap" class="mt-4 ml-4" | ||
46 | - >启用规则: | ||
47 | - <Button size="small" type="primary" @click="handleOpenEnableRule">添加</Button> | ||
48 | - <p>{{ enableTemplateData }}</p> | ||
49 | - <div class="mt-4 ml-4" style="margin-left: 0px" | ||
50 | - >详情模板: | ||
51 | - <Button size="small" type="primary" @click="handleOpenDetailTemplate" | 40 | + <div style="margin-left: 5px; margin-top: -50px"> |
41 | + <div style="color: #f5594e" class="ml-4" | ||
42 | + >报警规则条件: | ||
43 | + <Button size="small" type="primary" @click="handleOpenAlaramRuleConditions" | ||
52 | >添加</Button | 44 | >添加</Button |
53 | > | 45 | > |
54 | - <p>{{ detailTemplateData }}</p> | 46 | + <p>{{ ruleTemplateData }}</p> |
55 | </div> | 47 | </div> |
56 | - <div style="margin-left: 0px; position: relative"> | ||
57 | - <BasicForm @register="dashboardForm" /> | 48 | + <div style="white-space: wrap; margin-top: 25px" class="mt-4 ml-4" |
49 | + >启用规则: | ||
50 | + <Button size="small" type="primary" @click="handleOpenEnableRule">添加</Button> | ||
51 | + <p>{{ enableTemplateData }}</p> | ||
52 | + <div | ||
53 | + class="mt-4 ml-4" | ||
54 | + style="margin-left: 0px; position: relative; margin-top: 25px" | ||
55 | + >详情模板: | ||
56 | + <div style="position: absolute; top: -5px; left: 80px; width: 571px"> | ||
57 | + <BasicForm @register="registerFormChangeDetail" /> | ||
58 | + </div> | ||
59 | + <!-- <Button size="small" type="primary" @click="handleOpenDetailTemplate" | ||
60 | + >添加</Button | ||
61 | + > --> | ||
62 | + </div> | ||
63 | + <div style="margin-left: 0px; margin-top: 25px; position: relative"> | ||
64 | + <BasicForm @register="dashboardForm" /> | ||
65 | + </div> | ||
58 | </div> | 66 | </div> |
59 | </div> | 67 | </div> |
60 | - </div> | ||
61 | - <div | ||
62 | - class="remove-type" | ||
63 | - style="display: inline-block; position: relative; top: -237px; left: 800px" | ||
64 | - > | ||
65 | - <img | ||
66 | - style="cursor: pointer" | ||
67 | - @click="deleteCondition(index, createIndex)" | ||
68 | - alt="移除" | ||
69 | - src="../../../../assets/images/close.png" | ||
70 | - /> | 68 | + <div |
69 | + class="remove-type" | ||
70 | + style="display: inline-block; position: relative; top: -257px; left: 757px" | ||
71 | + > | ||
72 | + <img | ||
73 | + style="cursor: pointer" | ||
74 | + @click="deleteCondition(index, createIndex)" | ||
75 | + alt="移除" | ||
76 | + src="../../../../assets/images/close.png" | ||
77 | + /> | ||
78 | + </div> | ||
71 | </div> | 79 | </div> |
72 | </div> | 80 | </div> |
73 | - </div> | ||
74 | - </template> | ||
75 | - <a-button style="border-radius: 10px" class="mt-5" @click="addCreateRole(index)" | ||
76 | - ><PlusCircleOutlined />添加创建条件</a-button | ||
77 | - > | 81 | + </template> |
82 | + <a-button style="border-radius: 10px" class="mt-5" @click="addCreateRole(index)" | ||
83 | + ><PlusCircleOutlined />添加创建条件</a-button | ||
84 | + > | ||
85 | + </div> | ||
78 | <div style="height: 20px"></div> | 86 | <div style="height: 20px"></div> |
79 | - <p>清除报警规则</p> | ||
80 | - <template | ||
81 | - v-for="(childClearItem, clearIndexItem) in item.clearRule" | ||
82 | - :key="childClearItem.id" | ||
83 | - > | ||
84 | - <div class="aic mb-1" style="border: 1px solid #bfbfbf"> | ||
85 | - <div class="w-3/4"> | ||
86 | - <div style="margin-left: 5px"> | ||
87 | - <div style="color: #f5594e" class="mt-4 ml-4" | ||
88 | - >报警规则条件: | ||
89 | - <Button size="small" type="primary" @click="handleOpenClearAlaramRuleConditions" | ||
90 | - >添加</Button | ||
91 | - > | ||
92 | - <p>{{ ruleClearTemplateData }}</p> | ||
93 | - </div> | ||
94 | - <div style="white-space: wrap" class="mt-4 ml-4" | ||
95 | - >启用规则: | ||
96 | - <Button size="small" type="primary" @click="handleOpenClearEnableRule" | ||
97 | - >添加</Button | ||
98 | - > | ||
99 | - <p>{{ enableClearTemplateData }}</p> | ||
100 | - <div class="mt-4 ml-4" style="margin-left: 0px" | ||
101 | - >详情模板: | ||
102 | - <Button size="small" type="primary" @click="handleOpenClearDetailTemplate" | 87 | + <div> |
88 | + <p style="margin-left: 10px">清除报警规则</p> | ||
89 | + <template | ||
90 | + v-for="(childClearItem, clearIndexItem) in item.clearRule" | ||
91 | + :key="childClearItem.id" | ||
92 | + > | ||
93 | + <div class="aic mb-1" style="border: 1px solid #bfbfbf"> | ||
94 | + <div class="w-3/4" style="margin-left: 40px"> | ||
95 | + <div style="margin-left: 5px"> | ||
96 | + <div style="color: #f5594e" class="mt-4 ml-4" | ||
97 | + >报警规则条件: | ||
98 | + <Button size="small" type="primary" @click="handleOpenClearAlaramRuleConditions" | ||
103 | >添加</Button | 99 | >添加</Button |
104 | > | 100 | > |
105 | - <p>{{ detailClearTemplateData }}</p> | 101 | + <p>{{ ruleClearTemplateData }}</p> |
106 | </div> | 102 | </div> |
107 | - <div style="margin-left: 0px"> | ||
108 | - <BasicForm @register="dashboardForm" /> | 103 | + <div style="white-space: wrap; margin-top: 25px" class="mt-4 ml-4" |
104 | + >启用规则: | ||
105 | + <Button size="small" type="primary" @click="handleOpenClearEnableRule" | ||
106 | + >添加</Button | ||
107 | + > | ||
108 | + <p>{{ enableClearTemplateData }}</p> | ||
109 | + <div | ||
110 | + class="mt-4 ml-4" | ||
111 | + style="margin-left: 0px; position: relative; margin-top: 25px" | ||
112 | + >详情模板: | ||
113 | + <div style="position: absolute; top: -5px; left: 80px; width: 571px"> | ||
114 | + <BasicForm @register="registerFormChangeClearDetail" /> | ||
115 | + </div> | ||
116 | + <!-- <Button size="small" type="primary" @click="handleOpenClearDetailTemplate" | ||
117 | + >添加</Button | ||
118 | + > | ||
119 | + <p>{{ detailClearTemplateData }}</p> --> | ||
120 | + </div> | ||
121 | + <div style="margin-left: 0px; margin-top: 25px"> | ||
122 | + <BasicForm @register="dashboardForm" /> | ||
123 | + </div> | ||
109 | </div> | 124 | </div> |
110 | </div> | 125 | </div> |
111 | </div> | 126 | </div> |
112 | </div> | 127 | </div> |
113 | - </div> | ||
114 | - </template> | 128 | + </template> |
129 | + </div> | ||
115 | </CollapseContainer> | 130 | </CollapseContainer> |
116 | </template> | 131 | </template> |
117 | </div> | 132 | </div> |
@@ -179,6 +194,7 @@ | @@ -179,6 +194,7 @@ | ||
179 | step3CreateAlarm, | 194 | step3CreateAlarm, |
180 | dashboardFormScheme, | 195 | dashboardFormScheme, |
181 | isWhereType, | 196 | isWhereType, |
197 | + formChangeDetailSchema, | ||
182 | } from './data'; | 198 | } from './data'; |
183 | import { PlusCircleOutlined } from '@ant-design/icons-vue'; | 199 | import { PlusCircleOutlined } from '@ant-design/icons-vue'; |
184 | import { Checkbox } from 'ant-design-vue'; | 200 | import { Checkbox } from 'ant-design-vue'; |
@@ -202,6 +218,9 @@ | @@ -202,6 +218,9 @@ | ||
202 | }, | 218 | }, |
203 | emits: ['prev', 'next', 'redo', 'handleFormStep3toStep4Next'], | 219 | emits: ['prev', 'next', 'redo', 'handleFormStep3toStep4Next'], |
204 | setup(_, { emit }) { | 220 | setup(_, { emit }) { |
221 | + const changeGetDetailValue: any = ref(null); | ||
222 | + const changeGetClearDetailValue: any = ref(null); | ||
223 | + const ruleNumber = ref(0); | ||
205 | const { proxy } = getCurrentInstance(); | 224 | const { proxy } = getCurrentInstance(); |
206 | const getChildData1 = ref(null); | 225 | const getChildData1 = ref(null); |
207 | const getChildData2 = ref(null); | 226 | const getChildData2 = ref(null); |
@@ -241,6 +260,7 @@ | @@ -241,6 +260,7 @@ | ||
241 | }; | 260 | }; |
242 | //删除告警配置 | 261 | //删除告警配置 |
243 | const deleteAlarmRule = (index: number) => { | 262 | const deleteAlarmRule = (index: number) => { |
263 | + ruleNumber.value--; | ||
244 | unref(profileData).splice(index, 1); | 264 | unref(profileData).splice(index, 1); |
245 | }; | 265 | }; |
246 | // 上一步 | 266 | // 上一步 |
@@ -249,6 +269,7 @@ | @@ -249,6 +269,7 @@ | ||
249 | }; | 269 | }; |
250 | //添加报警规则 | 270 | //添加报警规则 |
251 | const addAlarmRule = () => { | 271 | const addAlarmRule = () => { |
272 | + ruleNumber.value++; | ||
252 | clearIndex.value++; | 273 | clearIndex.value++; |
253 | unref(profileData).push({ | 274 | unref(profileData).push({ |
254 | configuration: { | 275 | configuration: { |
@@ -326,6 +347,40 @@ | @@ -326,6 +347,40 @@ | ||
326 | span: 24, | 347 | span: 24, |
327 | }, | 348 | }, |
328 | }); | 349 | }); |
350 | + //详情模板 | ||
351 | + const [ | ||
352 | + registerFormChangeDetail, | ||
353 | + { | ||
354 | + getFieldsValue: getRegisterFormChangeDetail, | ||
355 | + setFieldsValue: setRegisterFormChangeDetail, | ||
356 | + resetFields: resetRegisterFormChangeDetail, | ||
357 | + }, | ||
358 | + ] = useForm({ | ||
359 | + labelWidth: 120, | ||
360 | + schemas: formChangeDetailSchema, | ||
361 | + showResetButton: false, | ||
362 | + showSubmitButton: false, | ||
363 | + actionColOptions: { | ||
364 | + span: 24, | ||
365 | + }, | ||
366 | + }); | ||
367 | + //清除详情模板 | ||
368 | + const [ | ||
369 | + registerFormChangeClearDetail, | ||
370 | + { | ||
371 | + getFieldsValue: getRegisterFormClearChangeDetail, | ||
372 | + setFieldsValue: setRegisterFormClearChangeDetail, | ||
373 | + resetFields: resetRegisterFormClearChangeDetail, | ||
374 | + }, | ||
375 | + ] = useForm({ | ||
376 | + labelWidth: 120, | ||
377 | + schemas: formChangeDetailSchema, | ||
378 | + showResetButton: false, | ||
379 | + showSubmitButton: false, | ||
380 | + actionColOptions: { | ||
381 | + span: 24, | ||
382 | + }, | ||
383 | + }); | ||
329 | // 添加创建条件表单 | 384 | // 添加创建条件表单 |
330 | const [ | 385 | const [ |
331 | registerFormCreateAlarm, | 386 | registerFormCreateAlarm, |
@@ -372,6 +427,14 @@ | @@ -372,6 +427,14 @@ | ||
372 | const resetTemplateClearFormDataFunc = () => { | 427 | const resetTemplateClearFormDataFunc = () => { |
373 | detailClearTemplateData.value = ``; | 428 | detailClearTemplateData.value = ``; |
374 | }; | 429 | }; |
430 | + //修改详情模板 | ||
431 | + const resetRegisterFormChangeDetailFunc = () => { | ||
432 | + resetRegisterFormChangeDetail(); | ||
433 | + }; | ||
434 | + //清除修改详情模板 | ||
435 | + const resetRegisterFormClearChangeDetailFunc = () => { | ||
436 | + resetRegisterFormClearChangeDetail(); | ||
437 | + }; | ||
375 | 438 | ||
376 | //回显表单数据 | 439 | //回显表单数据 |
377 | const retryRegisterFormFunc = (v) => { | 440 | const retryRegisterFormFunc = (v) => { |
@@ -401,6 +464,14 @@ | @@ -401,6 +464,14 @@ | ||
401 | const retryTemplateClearFormDataFunc = (v) => { | 464 | const retryTemplateClearFormDataFunc = (v) => { |
402 | detailClearTemplateData.value = v; | 465 | detailClearTemplateData.value = v; |
403 | }; | 466 | }; |
467 | + //修改详情模板 | ||
468 | + const setRegisterFormChangeDetailFunc = (v) => { | ||
469 | + setRegisterFormChangeDetail(v); | ||
470 | + }; | ||
471 | + //清除修改详情模板 | ||
472 | + const setRegisterFormClearChangeDetailFunc = (v) => { | ||
473 | + setRegisterFormClearChangeDetail(v); | ||
474 | + }; | ||
404 | 475 | ||
405 | const tempValue1: string = ref<string>(''); | 476 | const tempValue1: string = ref<string>(''); |
406 | // 添加‘创建条件’ | 477 | // 添加‘创建条件’ |
@@ -486,6 +557,7 @@ | @@ -486,6 +557,7 @@ | ||
486 | // isWhereTypeValueDisabled.value = false; | 557 | // isWhereTypeValueDisabled.value = false; |
487 | } | 558 | } |
488 | }); | 559 | }); |
560 | + | ||
489 | //详情模板 | 561 | //详情模板 |
490 | const getAllFieldsFunc = (v) => { | 562 | const getAllFieldsFunc = (v) => { |
491 | detailObj.value = v; | 563 | detailObj.value = v; |
@@ -764,17 +836,17 @@ | @@ -764,17 +836,17 @@ | ||
764 | } | 836 | } |
765 | const handleFormStep3toStep4Next = async () => { | 837 | const handleFormStep3toStep4Next = async () => { |
766 | try { | 838 | try { |
839 | + changeGetDetailValue.value = getRegisterFormChangeDetail(); | ||
840 | + changeGetClearDetailValue.value = getRegisterFormClearChangeDetail(); | ||
767 | if (enableObj.value.schedule == 'CUSTOM') { | 841 | if (enableObj.value.schedule == 'CUSTOM') { |
768 | - for (let i in enableObj.value) { | ||
769 | - console.log(enableObj.value[i]); | ||
770 | - console.log(i); | ||
771 | - // let o = {}; | ||
772 | - // if(enableObj.value[i]=='1') | ||
773 | - // o[i] = enableObj.value[i]; | ||
774 | - // getSchduleCustomValue.value.push(o); | ||
775 | - // getSchduleCustomValue.value.push(enableObj.value[i]); | ||
776 | - } | ||
777 | - console.log(getSchduleCustomValue.value); | 842 | + // for (let i in enableObj.value) { |
843 | + // console.log(i); | ||
844 | + // // let o = {}; | ||
845 | + // // if(enableObj.value[i]=='1') | ||
846 | + // // o[i] = enableObj.value[i]; | ||
847 | + // // getSchduleCustomValue.value.push(o); | ||
848 | + // // getSchduleCustomValue.value.push(enableObj.value[i]); | ||
849 | + // } | ||
778 | // switch (enableObj.value.daysOfWeek1[0]) { | 850 | // switch (enableObj.value.daysOfWeek1[0]) { |
779 | // case '1': | 851 | // case '1': |
780 | // getSchduleCustomValue.value.push({ | 852 | // getSchduleCustomValue.value.push({ |
@@ -854,7 +926,11 @@ | @@ -854,7 +926,11 @@ | ||
854 | ? scheduleCustomClearValue.value | 926 | ? scheduleCustomClearValue.value |
855 | : scheduleClearValue, | 927 | : scheduleClearValue, |
856 | }; | 928 | }; |
857 | - const getClearAdditionalProp = Object.assign({}, detailClearObj.value, getClearSchedule); | 929 | + const getClearAdditionalProp = Object.assign( |
930 | + {}, | ||
931 | + changeGetClearDetailValue.value, | ||
932 | + getClearSchedule | ||
933 | + ); | ||
858 | const scheduleValue = { | 934 | const scheduleValue = { |
859 | type: enableObj.value.schedule, | 935 | type: enableObj.value.schedule, |
860 | daysOfWeek: enableObj.value.daysOfWeek, | 936 | daysOfWeek: enableObj.value.daysOfWeek, |
@@ -867,7 +943,7 @@ | @@ -867,7 +943,7 @@ | ||
867 | enableObj.value.schedule == 'CUSTOM' ? scheduleCustomValue.value : scheduleValue, | 943 | enableObj.value.schedule == 'CUSTOM' ? scheduleCustomValue.value : scheduleValue, |
868 | }; | 944 | }; |
869 | 945 | ||
870 | - const getAdditionalProp = Object.assign({}, detailObj.value, getSchedule); | 946 | + const getAdditionalProp = Object.assign({}, changeGetDetailValue.value, getSchedule); |
871 | const getScheduleAndAlarmDetails = Object.assign( | 947 | const getScheduleAndAlarmDetails = Object.assign( |
872 | {}, | 948 | {}, |
873 | getAdditionalProp, | 949 | getAdditionalProp, |
@@ -930,14 +1006,18 @@ | @@ -930,14 +1006,18 @@ | ||
930 | isRuleAlarmRuleConditions.value = 1; | 1006 | isRuleAlarmRuleConditions.value = 1; |
931 | setTimeout(() => { | 1007 | setTimeout(() => { |
932 | openModal1(true); | 1008 | openModal1(true); |
933 | - proxy.$refs.getChildData1.resetDataFunc(); | 1009 | + setTimeout(() => { |
1010 | + proxy.$refs.getChildData1.resetDataFunc(); | ||
1011 | + }, 1000); | ||
934 | }, 50); | 1012 | }, 50); |
935 | }; | 1013 | }; |
936 | const handleOpenEnableRule = () => { | 1014 | const handleOpenEnableRule = () => { |
937 | isRuleAlarmRuleConditions.value = 2; | 1015 | isRuleAlarmRuleConditions.value = 2; |
938 | setTimeout(() => { | 1016 | setTimeout(() => { |
939 | openModal2(true); | 1017 | openModal2(true); |
940 | - proxy.$refs.getChildData2.resetDataFunc(); | 1018 | + setTimeout(() => { |
1019 | + proxy.$refs.getChildData2.resetDataFunc(); | ||
1020 | + }, 1000); | ||
941 | }, 50); | 1021 | }, 50); |
942 | }; | 1022 | }; |
943 | const handleOpenAlaramRuleConditions = () => { | 1023 | const handleOpenAlaramRuleConditions = () => { |
@@ -945,39 +1025,54 @@ | @@ -945,39 +1025,54 @@ | ||
945 | setTimeout(() => { | 1025 | setTimeout(() => { |
946 | openModal3(true); | 1026 | openModal3(true); |
947 | try { | 1027 | try { |
948 | - proxy.$refs.getChildData3.resetDataFunc(); | 1028 | + setTimeout(() => { |
1029 | + proxy.$refs.getChildData3.resetDataFunc(); | ||
1030 | + }, 1000); | ||
949 | } catch (e) { | 1031 | } catch (e) { |
950 | return e; | 1032 | return e; |
951 | } | 1033 | } |
952 | - }, 100); | 1034 | + }, 500); |
953 | }; | 1035 | }; |
954 | const handleOpenClearDetailTemplate = () => { | 1036 | const handleOpenClearDetailTemplate = () => { |
955 | isRuleAlarmRuleConditions.value = 4; | 1037 | isRuleAlarmRuleConditions.value = 4; |
956 | setTimeout(() => { | 1038 | setTimeout(() => { |
957 | openModal4(true); | 1039 | openModal4(true); |
958 | try { | 1040 | try { |
959 | - proxy.$refs.getChildData1.resetDataFunc(); | 1041 | + setTimeout(() => { |
1042 | + proxy.$refs.getChildData1.resetDataFunc(); | ||
1043 | + }, 1000); | ||
960 | } catch (e) { | 1044 | } catch (e) { |
961 | return e; | 1045 | return e; |
962 | } | 1046 | } |
963 | - }, 50); | 1047 | + }, 500); |
964 | }; | 1048 | }; |
965 | const handleOpenClearEnableRule = () => { | 1049 | const handleOpenClearEnableRule = () => { |
966 | isRuleAlarmRuleConditions.value = 5; | 1050 | isRuleAlarmRuleConditions.value = 5; |
967 | setTimeout(() => { | 1051 | setTimeout(() => { |
968 | openModal5(true); | 1052 | openModal5(true); |
969 | - proxy.$refs.getChildData2.resetDataFunc(); | 1053 | + setTimeout(() => { |
1054 | + proxy.$refs.getChildData2.resetDataFunc(); | ||
1055 | + }, 1000); | ||
970 | }, 50); | 1056 | }, 50); |
971 | }; | 1057 | }; |
972 | const handleOpenClearAlaramRuleConditions = () => { | 1058 | const handleOpenClearAlaramRuleConditions = () => { |
973 | isRuleAlarmRuleConditions.value = 6; | 1059 | isRuleAlarmRuleConditions.value = 6; |
974 | setTimeout(() => { | 1060 | setTimeout(() => { |
975 | openModal6(true); | 1061 | openModal6(true); |
976 | - proxy.$refs.getChildData3.resetDataFunc(); | 1062 | + setTimeout(() => { |
1063 | + proxy.$refs.getChildData3.resetDataFunc(); | ||
1064 | + }, 1000); | ||
977 | }, 50); | 1065 | }, 50); |
978 | }; | 1066 | }; |
979 | 1067 | ||
980 | return { | 1068 | return { |
1069 | + resetRegisterFormChangeDetailFunc, | ||
1070 | + resetRegisterFormClearChangeDetailFunc, | ||
1071 | + setRegisterFormClearChangeDetailFunc, | ||
1072 | + setRegisterFormChangeDetailFunc, | ||
1073 | + registerFormChangeClearDetail, | ||
1074 | + registerFormChangeDetail, | ||
1075 | + ruleNumber, | ||
981 | resetEnableClearFormDataFunc, | 1076 | resetEnableClearFormDataFunc, |
982 | resetTemplateClearFormDataFunc, | 1077 | resetTemplateClearFormDataFunc, |
983 | resetRulesClearFormDataFunc, | 1078 | resetRulesClearFormDataFunc, |
@@ -1046,6 +1141,8 @@ | @@ -1046,6 +1141,8 @@ | ||
1046 | <style lang="less" scoped> | 1141 | <style lang="less" scoped> |
1047 | .step3 { | 1142 | .step3 { |
1048 | width: 100%; | 1143 | width: 100%; |
1144 | + background-color: #f6f8f9; | ||
1145 | + z-index: 1; | ||
1049 | } | 1146 | } |
1050 | .border { | 1147 | .border { |
1051 | border: 1px solid #bfbfbf; | 1148 | border: 1px solid #bfbfbf; |
@@ -31,8 +31,8 @@ | @@ -31,8 +31,8 @@ | ||
31 | const resetFieldsFunc = (v) => { | 31 | const resetFieldsFunc = (v) => { |
32 | setFieldsValue(v); | 32 | setFieldsValue(v); |
33 | }; | 33 | }; |
34 | - const customResetAndFunc = async () => { | ||
35 | - await resetFields(); | 34 | + const customResetAndFunc = () => { |
35 | + resetFields(); | ||
36 | }; | 36 | }; |
37 | async function customResetFunc() { | 37 | async function customResetFunc() { |
38 | emit('prev'); | 38 | emit('prev'); |
@@ -56,7 +56,7 @@ | @@ -56,7 +56,7 @@ | ||
56 | </script> | 56 | </script> |
57 | <style lang="less" scoped> | 57 | <style lang="less" scoped> |
58 | .step-4 { | 58 | .step-4 { |
59 | - /deep/ .ant-btn { | 59 | + :deep .ant-btn { |
60 | position: relative; | 60 | position: relative; |
61 | right: 375px; | 61 | right: 375px; |
62 | top: 18px; | 62 | top: 18px; |
@@ -221,7 +221,7 @@ | @@ -221,7 +221,7 @@ | ||
221 | }); | 221 | }); |
222 | </script> | 222 | </script> |
223 | <style lang="less" scoped> | 223 | <style lang="less" scoped> |
224 | - /deep/ .ant-table-body { | 224 | + :deep.ant-table-body { |
225 | overflow-y: auto !important; | 225 | overflow-y: auto !important; |
226 | min-height: 173px !important; | 226 | min-height: 173px !important; |
227 | height: 100px !important; | 227 | height: 100px !important; |
@@ -98,6 +98,7 @@ export const step3Schemas: FormSchema[] = [ | @@ -98,6 +98,7 @@ export const step3Schemas: FormSchema[] = [ | ||
98 | { | 98 | { |
99 | field: 'alarmType', | 99 | field: 'alarmType', |
100 | component: 'Input', | 100 | component: 'Input', |
101 | + required: true, | ||
101 | label: '报警类型', | 102 | label: '报警类型', |
102 | colProps: { | 103 | colProps: { |
103 | span: 12, | 104 | span: 12, |
@@ -106,19 +107,6 @@ export const step3Schemas: FormSchema[] = [ | @@ -106,19 +107,6 @@ export const step3Schemas: FormSchema[] = [ | ||
106 | maxLength: 255, | 107 | maxLength: 255, |
107 | placeholder: '请输入报警类型', | 108 | placeholder: '请输入报警类型', |
108 | }, | 109 | }, |
109 | - dynamicRules: () => { | ||
110 | - return [ | ||
111 | - { | ||
112 | - required: false, | ||
113 | - validator: (_, value) => { | ||
114 | - if (String(value).length > 255) { | ||
115 | - return Promise.reject('字数不超过255个字'); | ||
116 | - } | ||
117 | - return Promise.resolve(); | ||
118 | - }, | ||
119 | - }, | ||
120 | - ]; | ||
121 | - }, | ||
122 | }, | 110 | }, |
123 | ]; | 111 | ]; |
124 | 112 | ||
@@ -127,7 +115,6 @@ export const step3ViewHighSetting: FormSchema[] = [ | @@ -127,7 +115,6 @@ export const step3ViewHighSetting: FormSchema[] = [ | ||
127 | field: 'propagate', | 115 | field: 'propagate', |
128 | component: 'Checkbox', | 116 | component: 'Checkbox', |
129 | label: '传递报警', | 117 | label: '传递报警', |
130 | - // renderComponentContent: '忽略大小写', | ||
131 | }, | 118 | }, |
132 | { | 119 | { |
133 | field: 'propagateRelationTypes', | 120 | field: 'propagateRelationTypes', |
@@ -161,19 +148,6 @@ export const step3HighSetting: FormSchema[] = [ | @@ -161,19 +148,6 @@ export const step3HighSetting: FormSchema[] = [ | ||
161 | maxLength: 255, | 148 | maxLength: 255, |
162 | placeholder: '请输入关联类型', | 149 | placeholder: '请输入关联类型', |
163 | }, | 150 | }, |
164 | - dynamicRules: () => { | ||
165 | - return [ | ||
166 | - { | ||
167 | - required: false, | ||
168 | - validator: (_, value) => { | ||
169 | - if (String(value).length > 255) { | ||
170 | - return Promise.reject('字数不超过255个字'); | ||
171 | - } | ||
172 | - return Promise.resolve(); | ||
173 | - }, | ||
174 | - }, | ||
175 | - ]; | ||
176 | - }, | ||
177 | ifShow: ({ values }) => !!values.propagate, | 151 | ifShow: ({ values }) => !!values.propagate, |
178 | }, | 152 | }, |
179 | ]; | 153 | ]; |
@@ -275,3 +249,17 @@ export const alertContactsSchemas: FormSchema[] = [ | @@ -275,3 +249,17 @@ export const alertContactsSchemas: FormSchema[] = [ | ||
275 | }, | 249 | }, |
276 | }, | 250 | }, |
277 | ]; | 251 | ]; |
252 | + | ||
253 | +export const formChangeDetailSchema: FormSchema[] = [ | ||
254 | + { | ||
255 | + field: 'alarmDetails', | ||
256 | + label: '', | ||
257 | + colProps: { span: 13 }, | ||
258 | + required: true, | ||
259 | + component: 'Input', | ||
260 | + componentProps: { | ||
261 | + maxLength: 255, | ||
262 | + placeholder: '请输入报警详细信息', | ||
263 | + }, | ||
264 | + }, | ||
265 | +]; |
@@ -227,19 +227,6 @@ export const formSchema: FormSchema[] = [ | @@ -227,19 +227,6 @@ export const formSchema: FormSchema[] = [ | ||
227 | maxLength: 255, | 227 | maxLength: 255, |
228 | placeholder: '请输入消息配置', | 228 | placeholder: '请输入消息配置', |
229 | }, | 229 | }, |
230 | - dynamicRules: () => { | ||
231 | - return [ | ||
232 | - { | ||
233 | - required: false, | ||
234 | - validator: (_, value) => { | ||
235 | - if (String(value).length > 255) { | ||
236 | - return Promise.reject('字数不超过255个字'); | ||
237 | - } | ||
238 | - return Promise.resolve(); | ||
239 | - }, | ||
240 | - }, | ||
241 | - ]; | ||
242 | - }, | ||
243 | }, | 230 | }, |
244 | { | 231 | { |
245 | field: 'id', | 232 | field: 'id', |
@@ -270,19 +257,6 @@ export const formSchema: FormSchema[] = [ | @@ -270,19 +257,6 @@ export const formSchema: FormSchema[] = [ | ||
270 | maxLength: 255, | 257 | maxLength: 255, |
271 | placeholder: '请输入备注', | 258 | placeholder: '请输入备注', |
272 | }, | 259 | }, |
273 | - dynamicRules: () => { | ||
274 | - return [ | ||
275 | - { | ||
276 | - required: false, | ||
277 | - validator: (_, value) => { | ||
278 | - if (String(value).length > 255) { | ||
279 | - return Promise.reject('字数不超过255个字'); | ||
280 | - } | ||
281 | - return Promise.resolve(); | ||
282 | - }, | ||
283 | - }, | ||
284 | - ]; | ||
285 | - }, | ||
286 | 260 | ||
287 | component: 'InputTextArea', | 261 | component: 'InputTextArea', |
288 | }, | 262 | }, |
@@ -3,6 +3,8 @@ import { FormSchema } from '/@/components/Table'; | @@ -3,6 +3,8 @@ import { FormSchema } from '/@/components/Table'; | ||
3 | import { h } from 'vue'; | 3 | import { h } from 'vue'; |
4 | import { Tag } from 'ant-design-vue'; | 4 | import { Tag } from 'ant-design-vue'; |
5 | import { useI18n } from '/@/hooks/web/useI18n'; | 5 | import { useI18n } from '/@/hooks/web/useI18n'; |
6 | +import { phoneRule } from '/@/utils/rules'; | ||
7 | + | ||
6 | const { t } = useI18n(); | 8 | const { t } = useI18n(); |
7 | export const columns: BasicColumn[] = [ | 9 | export const columns: BasicColumn[] = [ |
8 | { | 10 | { |
@@ -52,6 +54,7 @@ export const searchFormSchema: FormSchema[] = [ | @@ -52,6 +54,7 @@ export const searchFormSchema: FormSchema[] = [ | ||
52 | label: '发送手机', | 54 | label: '发送手机', |
53 | component: 'Input', | 55 | component: 'Input', |
54 | colProps: { span: 6 }, | 56 | colProps: { span: 6 }, |
57 | + rules: phoneRule, | ||
55 | componentProps: { | 58 | componentProps: { |
56 | maxLength: 36, | 59 | maxLength: 36, |
57 | }, | 60 | }, |
@@ -44,6 +44,7 @@ | @@ -44,6 +44,7 @@ | ||
44 | 44 | ||
45 | export default defineComponent({ | 45 | export default defineComponent({ |
46 | components: { CollapseContainer, BasicForm, [Input.name]: Input, Button }, | 46 | components: { CollapseContainer, BasicForm, [Input.name]: Input, Button }, |
47 | + // eslint-disable-next-line vue/require-prop-types | ||
47 | props: ['deviceInfo1'], | 48 | props: ['deviceInfo1'], |
48 | setup(props) { | 49 | setup(props) { |
49 | const getValueData: any = ref({}); | 50 | const getValueData: any = ref({}); |
@@ -66,7 +67,9 @@ | @@ -66,7 +67,9 @@ | ||
66 | }); | 67 | }); |
67 | let isJudge = ref(1); | 68 | let isJudge = ref(1); |
68 | if (isJudge.value == 1) { | 69 | if (isJudge.value == 1) { |
69 | - resetFields(); | 70 | + setTimeout(() => { |
71 | + resetFields(); | ||
72 | + }, 1000); | ||
70 | } | 73 | } |
71 | watch( | 74 | watch( |
72 | () => props.deviceInfo1, | 75 | () => props.deviceInfo1, |
@@ -44,6 +44,7 @@ | @@ -44,6 +44,7 @@ | ||
44 | 44 | ||
45 | export default defineComponent({ | 45 | export default defineComponent({ |
46 | components: { CollapseContainer, BasicForm, [Input.name]: Input, Button }, | 46 | components: { CollapseContainer, BasicForm, [Input.name]: Input, Button }, |
47 | + // eslint-disable-next-line vue/require-prop-types | ||
47 | props: ['deviceInfo2'], | 48 | props: ['deviceInfo2'], |
48 | setup(props) { | 49 | setup(props) { |
49 | const addHideButton = ref(1); | 50 | const addHideButton = ref(1); |
@@ -66,7 +67,9 @@ | @@ -66,7 +67,9 @@ | ||
66 | }); | 67 | }); |
67 | let isJudge = ref(1); | 68 | let isJudge = ref(1); |
68 | if (isJudge.value == 1) { | 69 | if (isJudge.value == 1) { |
69 | - resetFields(); | 70 | + setTimeout(() => { |
71 | + resetFields(); | ||
72 | + }, 1000); | ||
70 | } | 73 | } |
71 | watch( | 74 | watch( |
72 | () => props.deviceInfo2, | 75 | () => props.deviceInfo2, |
@@ -432,5 +435,6 @@ | @@ -432,5 +435,6 @@ | ||
432 | display: inline-block; | 435 | display: inline-block; |
433 | position: relative; | 436 | position: relative; |
434 | top: 33px; | 437 | top: 33px; |
438 | + left: 5px; | ||
435 | } | 439 | } |
436 | </style> | 440 | </style> |
1 | +/* eslint-disable vue/require-prop-types */ | ||
1 | <template> | 2 | <template> |
2 | <div> | 3 | <div> |
3 | <CollapseContainer title="触发器" style="background-color: #eeeeee"> | 4 | <CollapseContainer title="触发器" style="background-color: #eeeeee"> |
@@ -56,6 +57,7 @@ | @@ -56,6 +57,7 @@ | ||
56 | 57 | ||
57 | export default defineComponent({ | 58 | export default defineComponent({ |
58 | components: { CollapseContainer, BasicForm, [Input.name]: Input, Button }, | 59 | components: { CollapseContainer, BasicForm, [Input.name]: Input, Button }, |
60 | + // eslint-disable-next-line vue/require-prop-types | ||
59 | props: ['deviceInfo'], | 61 | props: ['deviceInfo'], |
60 | setup(props) { | 62 | setup(props) { |
61 | const getValueData: any = ref({}); | 63 | const getValueData: any = ref({}); |
@@ -79,7 +81,9 @@ | @@ -79,7 +81,9 @@ | ||
79 | }); | 81 | }); |
80 | let isJudge = ref(1); | 82 | let isJudge = ref(1); |
81 | if (isJudge.value == 1) { | 83 | if (isJudge.value == 1) { |
82 | - resetFields(); | 84 | + setTimeout(() => { |
85 | + resetFields(); | ||
86 | + }, 1000); | ||
83 | } | 87 | } |
84 | watch( | 88 | watch( |
85 | () => props.deviceInfo, | 89 | () => props.deviceInfo, |
1 | <template> | 1 | <template> |
2 | <div> | 2 | <div> |
3 | <BasicTable | 3 | <BasicTable |
4 | - :rowSelection="{ type: 'checkbox' }" | ||
5 | - @selection-change="useSelectionChange" | ||
6 | @register="registerTable" | 4 | @register="registerTable" |
5 | + @selection-change="useSelectionChange" | ||
6 | + :rowSelection="{ type: 'checkbox' }" | ||
7 | > | 7 | > |
8 | <template #toolbar> | 8 | <template #toolbar> |
9 | <a-button type="primary" @click="handleAdd"> 新增场景联动 </a-button> | 9 | <a-button type="primary" @click="handleAdd"> 新增场景联动 </a-button> |
10 | - <a-button type="error" @click="handleToolbarDel"> 删除 </a-button> | 10 | + <a-button |
11 | + style="background-color: rgba(237, 111, 111, 1)" | ||
12 | + type="default" | ||
13 | + @click="handleToolbarDel" | ||
14 | + > | ||
15 | + <span style="color: white">删除</span> | ||
16 | + </a-button> | ||
11 | </template> | 17 | </template> |
12 | <template #action="{ record }"> | 18 | <template #action="{ record }"> |
13 | <TableAction | 19 | <TableAction |
@@ -49,13 +55,14 @@ | @@ -49,13 +55,14 @@ | ||
49 | export default defineComponent({ | 55 | export default defineComponent({ |
50 | name: 'Index', | 56 | name: 'Index', |
51 | components: { BasicTable, SceneLinkAgeDrawer, TableAction }, | 57 | components: { BasicTable, SceneLinkAgeDrawer, TableAction }, |
58 | + emits: ['default', 'registerTable', 'registerDrawer', 'register'], | ||
52 | setup() { | 59 | setup() { |
53 | let selectedRowKeys: Array<string> = []; | 60 | let selectedRowKeys: Array<string> = []; |
54 | let echoEditData = reactive({}); | 61 | let echoEditData = reactive({}); |
55 | const [registerDrawer, { openDrawer }] = useDrawer(); | 62 | const [registerDrawer, { openDrawer }] = useDrawer(); |
56 | const { createMessage } = useMessage(); | 63 | const { createMessage } = useMessage(); |
57 | const [registerTable, { reload, getSelectRowKeys }] = useTable({ | 64 | const [registerTable, { reload, getSelectRowKeys }] = useTable({ |
58 | - title: '', | 65 | + title: '场景联动列表', |
59 | clickToRowSelect: false, | 66 | clickToRowSelect: false, |
60 | api: screenLinkPageGetApi, | 67 | api: screenLinkPageGetApi, |
61 | columns, | 68 | columns, |
@@ -63,9 +70,6 @@ | @@ -63,9 +70,6 @@ | ||
63 | labelWidth: 120, | 70 | labelWidth: 120, |
64 | schemas: searchFormSchema, | 71 | schemas: searchFormSchema, |
65 | }, | 72 | }, |
66 | - filterFn: (registerTable) => { | ||
67 | - return registerTable; | ||
68 | - }, | ||
69 | rowKey: 'id', | 73 | rowKey: 'id', |
70 | useSearchForm: true, | 74 | useSearchForm: true, |
71 | showTableSetting: true, | 75 | showTableSetting: true, |
@@ -126,3 +130,5 @@ | @@ -126,3 +130,5 @@ | ||
126 | }, | 130 | }, |
127 | }); | 131 | }); |
128 | </script> | 132 | </script> |
133 | + | ||
134 | +<style lang="less" scoped></style> |
@@ -8,9 +8,15 @@ | @@ -8,9 +8,15 @@ | ||
8 | @ok="handleSubmit" | 8 | @ok="handleSubmit" |
9 | > | 9 | > |
10 | <BasicForm @register="registerForm" /> | 10 | <BasicForm @register="registerForm" /> |
11 | - <AddTriggerForm ref="getTriggerChildData" :deviceInfo="getDeviceInfo" /> | ||
12 | - <AddConditiForm ref="getConditionChildData" :deviceInfo1="getDeviceInfo1" /> | ||
13 | - <AddActionForm ref="getChildData" :deviceInfo2="getDeviceInfo2" /> | 11 | + <div> |
12 | + <AddTriggerForm ref="getTriggerChildData" :deviceInfo="getDeviceInfo" /> | ||
13 | + </div> | ||
14 | + <div> | ||
15 | + <AddConditiForm ref="getConditionChildData" :deviceInfo1="getDeviceInfo1" /> | ||
16 | + </div> | ||
17 | + <div> | ||
18 | + <AddActionForm ref="getChildData" :deviceInfo2="getDeviceInfo2" /> | ||
19 | + </div> | ||
14 | </BasicDrawer> | 20 | </BasicDrawer> |
15 | </template> | 21 | </template> |
16 | <script lang="ts"> | 22 | <script lang="ts"> |
@@ -31,7 +37,7 @@ | @@ -31,7 +37,7 @@ | ||
31 | export default defineComponent({ | 37 | export default defineComponent({ |
32 | name: 'ConfigDrawer', | 38 | name: 'ConfigDrawer', |
33 | components: { BasicDrawer, BasicForm, AddTriggerForm, AddActionForm, AddConditiForm }, | 39 | components: { BasicDrawer, BasicForm, AddTriggerForm, AddActionForm, AddConditiForm }, |
34 | - emits: ['success', 'register'], | 40 | + emits: ['success', 'register', 'registerForm'], |
35 | setup(_, { emit }) { | 41 | setup(_, { emit }) { |
36 | const { proxy } = getCurrentInstance(); | 42 | const { proxy } = getCurrentInstance(); |
37 | const getChildData = ref(null); | 43 | const getChildData = ref(null); |
@@ -49,14 +55,12 @@ | @@ -49,14 +55,12 @@ | ||
49 | let getDeviceInfo1 = ref(null); | 55 | let getDeviceInfo1 = ref(null); |
50 | let getDeviceInfo2 = ref(null); | 56 | let getDeviceInfo2 = ref(null); |
51 | 57 | ||
52 | - const [ | ||
53 | - registerForm, | ||
54 | - { resetFields, setFieldsValue, validateFields, getFieldsValue, updateSchema }, | ||
55 | - ] = useForm({ | ||
56 | - labelWidth: 120, | ||
57 | - schemas: formSchema, | ||
58 | - showActionButtonGroup: false, | ||
59 | - }); | 58 | + const [registerForm, { resetFields, setFieldsValue, validateFields, getFieldsValue }] = |
59 | + useForm({ | ||
60 | + labelWidth: 120, | ||
61 | + schemas: formSchema, | ||
62 | + showActionButtonGroup: false, | ||
63 | + }); | ||
60 | 64 | ||
61 | watch(getData, (newV) => { | 65 | watch(getData, (newV) => { |
62 | getDeviceInfo.value = newV; | 66 | getDeviceInfo.value = newV; |
@@ -65,7 +69,6 @@ | @@ -65,7 +69,6 @@ | ||
65 | }); | 69 | }); |
66 | 70 | ||
67 | const [registerDrawer, { setDrawerProps, closeDrawer }] = useDrawerInner(async (data) => { | 71 | const [registerDrawer, { setDrawerProps, closeDrawer }] = useDrawerInner(async (data) => { |
68 | - console.log(data); | ||
69 | await resetFields(); | 72 | await resetFields(); |
70 | setDrawerProps({ confirmLoading: false }); | 73 | setDrawerProps({ confirmLoading: false }); |
71 | isUpdate.value = !!data?.isUpdate; | 74 | isUpdate.value = !!data?.isUpdate; |
@@ -107,7 +107,7 @@ | @@ -107,7 +107,7 @@ | ||
107 | roleMenus.value = await getMenusIdsByRoleId(data.record.id); | 107 | roleMenus.value = await getMenusIdsByRoleId(data.record.id); |
108 | treeData.value.map((m) => { | 108 | treeData.value.map((m) => { |
109 | roleMenus.value.map((m1) => { | 109 | roleMenus.value.map((m1) => { |
110 | - if (m.key === m1) { | 110 | + if (m.key === m1 && m.children.length !== 0) { |
111 | proxy.useChildrenIdsRemoveParentId(m1, roleMenus.value); | 111 | proxy.useChildrenIdsRemoveParentId(m1, roleMenus.value); |
112 | } | 112 | } |
113 | }); | 113 | }); |
@@ -4,6 +4,7 @@ import { h } from 'vue'; | @@ -4,6 +4,7 @@ import { h } from 'vue'; | ||
4 | import { Switch } from 'ant-design-vue'; | 4 | import { Switch } from 'ant-design-vue'; |
5 | import { setRoleStatus } from '/@/api/system/system'; | 5 | import { setRoleStatus } from '/@/api/system/system'; |
6 | import { useMessage } from '/@/hooks/web/useMessage'; | 6 | import { useMessage } from '/@/hooks/web/useMessage'; |
7 | +import { getAllRoleList } from '/@/api/system/system'; | ||
7 | 8 | ||
8 | export const columns: BasicColumn[] = [ | 9 | export const columns: BasicColumn[] = [ |
9 | { | 10 | { |
@@ -29,10 +30,14 @@ export const columns: BasicColumn[] = [ | @@ -29,10 +30,14 @@ export const columns: BasicColumn[] = [ | ||
29 | checkedChildren: '已启用', | 30 | checkedChildren: '已启用', |
30 | unCheckedChildren: '已禁用', | 31 | unCheckedChildren: '已禁用', |
31 | loading: record.pendingStatus, | 32 | loading: record.pendingStatus, |
32 | - onChange(checked: boolean) { | 33 | + async onChange(checked: boolean) { |
33 | record.pendingStatus = true; | 34 | record.pendingStatus = true; |
34 | const newStatus = checked ? 1 : 0; | 35 | const newStatus = checked ? 1 : 0; |
35 | const { createMessage } = useMessage(); | 36 | const { createMessage } = useMessage(); |
37 | + const data = await getAllRoleList(); | ||
38 | + const findById = data.find((f) => f.id == record.id); | ||
39 | + if (findById?.id) return createMessage.error(`该租户下面有此用户,无法禁用`); | ||
40 | + record.pendingStatus = true; | ||
36 | setRoleStatus(record.id, newStatus) | 41 | setRoleStatus(record.id, newStatus) |
37 | .then(() => { | 42 | .then(() => { |
38 | record.status = newStatus; | 43 | record.status = newStatus; |
@@ -50,31 +50,33 @@ | @@ -50,31 +50,33 @@ | ||
50 | placeholder: '请输入账号', | 50 | placeholder: '请输入账号', |
51 | }, | 51 | }, |
52 | dynamicRules: ({ values }) => { | 52 | dynamicRules: ({ values }) => { |
53 | - const findUserName = isJudgeUserNameExist.value.find((f) => { | ||
54 | - if (f) { | ||
55 | - return f.username == values.username; | ||
56 | - } | ||
57 | - }); | ||
58 | - return [ | ||
59 | - { | ||
60 | - validator(_, value) { | ||
61 | - return new Promise((resolve, reject) => { | ||
62 | - if (value == '') { | ||
63 | - reject('请输入账号'); | ||
64 | - } else if (ChineseRegexp.test(value)) { | ||
65 | - reject('账号不能含有中文'); | ||
66 | - } else if (EmailRegexp.test(value)) { | ||
67 | - reject('账号不能为电子邮箱格式'); | ||
68 | - } else if (value == findUserName?.username) { | ||
69 | - reject('账号已存在'); | ||
70 | - return; | ||
71 | - } else { | ||
72 | - resolve(); | ||
73 | - } | ||
74 | - }); | 53 | + try { |
54 | + const findUserName = isJudgeUserNameExist.value.find((f) => { | ||
55 | + if (f) { | ||
56 | + return f.username == values.username; | ||
57 | + } | ||
58 | + }); | ||
59 | + return [ | ||
60 | + { | ||
61 | + validator(_, value) { | ||
62 | + return new Promise((resolve, reject) => { | ||
63 | + if (value == '') { | ||
64 | + reject('请输入账号'); | ||
65 | + } else if (ChineseRegexp.test(value)) { | ||
66 | + reject('账号不能含有中文'); | ||
67 | + } else if (EmailRegexp.test(value)) { | ||
68 | + reject('账号不能为电子邮箱格式'); | ||
69 | + } else if (value == findUserName?.username) { | ||
70 | + reject('账号已存在'); | ||
71 | + return; | ||
72 | + } else { | ||
73 | + resolve(); | ||
74 | + } | ||
75 | + }); | ||
76 | + }, | ||
75 | }, | 77 | }, |
76 | - }, | ||
77 | - ]; | 78 | + ]; |
79 | + } catch (e) {} | ||
78 | }, | 80 | }, |
79 | }, | 81 | }, |
80 | { | 82 | { |