Showing
35 changed files
with
1311 additions
and
617 deletions
| @@ -8,10 +8,10 @@ VITE_PUBLIC_PATH = / | @@ -8,10 +8,10 @@ VITE_PUBLIC_PATH = / | ||
| 8 | # Please note that no line breaks | 8 | # Please note that no line breaks |
| 9 | 9 | ||
| 10 | # 本地 | 10 | # 本地 |
| 11 | -VITE_PROXY = [["/api","http://192.168.10.107:8080/api"]] | 11 | +# VITE_PROXY = [["/api","http://192.168.10.147:8080/api"]] |
| 12 | 12 | ||
| 13 | # 线上 | 13 | # 线上 |
| 14 | -# VITE_PROXY = [["/api","http://101.133.234.90:8080/api"]] | 14 | +VITE_PROXY = [["/api","http://101.133.234.90:8080/api"]] |
| 15 | 15 | ||
| 16 | # 实时数据的ws地址 | 16 | # 实时数据的ws地址 |
| 17 | VITE_WEB_SOCKET = ws://101.133.234.90:8080/api/ws/plugins/telemetry?token= | 17 | VITE_WEB_SOCKET = ws://101.133.234.90:8080/api/ws/plugins/telemetry?token= |
| @@ -17,10 +17,12 @@ enum Api { | @@ -17,10 +17,12 @@ enum Api { | ||
| 17 | export const getMenuList = () => { | 17 | export const getMenuList = () => { |
| 18 | const userStore = useUserStore(); | 18 | const userStore = useUserStore(); |
| 19 | let url = Api.GetMenuList; | 19 | let url = Api.GetMenuList; |
| 20 | - if (userStore.getRoleList.find((v) => v == RoleEnum.SYS_ADMIN)) { | ||
| 21 | - url = Api.SysAdminMenuList; | ||
| 22 | - } | ||
| 23 | - return defHttp.get<getMenuListResultModel>({ url }); | 20 | + try { |
| 21 | + if (userStore.getRoleList.find((v) => v == RoleEnum.SYS_ADMIN)) { | ||
| 22 | + url = Api.SysAdminMenuList; | ||
| 23 | + } | ||
| 24 | + return defHttp.get<getMenuListResultModel>({ url }); | ||
| 25 | + } catch (e) {} | ||
| 24 | }; | 26 | }; |
| 25 | 27 | ||
| 26 | export const delMenu = (menuIds: string[]) => { | 28 | export const delMenu = (menuIds: string[]) => { |
src/assets/images/delete.png
0 → 100644
688 Bytes
| @@ -63,7 +63,7 @@ | @@ -63,7 +63,7 @@ | ||
| 63 | document.createElement('link')) as HTMLLinkElement; | 63 | document.createElement('link')) as HTMLLinkElement; |
| 64 | link.type = 'image/x-icon'; | 64 | link.type = 'image/x-icon'; |
| 65 | link.rel = 'shortcut icon'; | 65 | link.rel = 'shortcut icon'; |
| 66 | - link.href = userStore.platInfo?.icon ?? '/public/favicon.ico'; | 66 | + link.href = userStore.platInfo?.icon ?? '/favicon.ico'; |
| 67 | document.getElementsByTagName('head')[0].appendChild(link); | 67 | document.getElementsByTagName('head')[0].appendChild(link); |
| 68 | return userStore.platInfo?.name ?? title; | 68 | return userStore.platInfo?.name ?? title; |
| 69 | }); | 69 | }); |
| @@ -33,7 +33,7 @@ | @@ -33,7 +33,7 @@ | ||
| 33 | :before-upload="beforeUploadqrcodePic" | 33 | :before-upload="beforeUploadqrcodePic" |
| 34 | > | 34 | > |
| 35 | <img | 35 | <img |
| 36 | - style="text-align: center; border-radius: 50%; width: 8vw; height: 15vh" | 36 | + style="text-align: center; border-radius: 50%; width: 8.5vw; height: 15.2vh" |
| 37 | v-if="peresonalPic" | 37 | v-if="peresonalPic" |
| 38 | :src="peresonalPic" | 38 | :src="peresonalPic" |
| 39 | alt="avatar" | 39 | alt="avatar" |
| @@ -92,7 +92,6 @@ | @@ -92,7 +92,6 @@ | ||
| 92 | import { Upload } from 'ant-design-vue'; | 92 | import { Upload } from 'ant-design-vue'; |
| 93 | import { PlusOutlined } from '@ant-design/icons-vue'; | 93 | import { PlusOutlined } from '@ant-design/icons-vue'; |
| 94 | import type { FileItem } from '/@/components/Upload/src/typing'; | 94 | import type { FileItem } from '/@/components/Upload/src/typing'; |
| 95 | - import { useUserStore } from '/@/store/modules/user'; | ||
| 96 | 95 | ||
| 97 | const schema: DescItem[] = [ | 96 | const schema: DescItem[] = [ |
| 98 | { | 97 | { |
| @@ -125,7 +124,6 @@ | @@ -125,7 +124,6 @@ | ||
| 125 | components: { BasicModal, BasicForm, Description, Upload, PlusOutlined }, | 124 | components: { BasicModal, BasicForm, Description, Upload, PlusOutlined }, |
| 126 | emits: ['refreshPersonl', 'register'], | 125 | emits: ['refreshPersonl', 'register'], |
| 127 | setup(_, { emit }) { | 126 | setup(_, { emit }) { |
| 128 | - // const userStore = useUserStore(); | ||
| 129 | const userInfo = getAuthCache(USER_INFO_KEY); | 127 | const userInfo = getAuthCache(USER_INFO_KEY); |
| 130 | const { createMessage } = useMessage(); | 128 | const { createMessage } = useMessage(); |
| 131 | const getPersonalValue: any = ref({}); | 129 | const getPersonalValue: any = ref({}); |
| @@ -177,7 +175,6 @@ | @@ -177,7 +175,6 @@ | ||
| 177 | 175 | ||
| 178 | const [registerModal, { closeModal }] = useModalInner(async (data) => { | 176 | const [registerModal, { closeModal }] = useModalInner(async (data) => { |
| 179 | refreshCacheGetData(); | 177 | refreshCacheGetData(); |
| 180 | - console.log(updataPersonlData.value); | ||
| 181 | try { | 178 | try { |
| 182 | if (updataPersonlData.value != null) { | 179 | if (updataPersonlData.value != null) { |
| 183 | (peresonalPic.value = updataPersonlData.value.avatar), | 180 | (peresonalPic.value = updataPersonlData.value.avatar), |
| @@ -246,7 +243,7 @@ | @@ -246,7 +243,7 @@ | ||
| 246 | </script> | 243 | </script> |
| 247 | <style scoped lang="less"> | 244 | <style scoped lang="less"> |
| 248 | .change-avatar { | 245 | .change-avatar { |
| 249 | - /deep/ .ant-upload-select-picture-card { | 246 | + :deep .ant-upload-select-picture-card { |
| 250 | display: inherit; | 247 | display: inherit; |
| 251 | float: none; | 248 | float: none; |
| 252 | width: 8.6vw; | 249 | width: 8.6vw; |
| @@ -30,6 +30,7 @@ export function createPermissionGuard(router: Router) { | @@ -30,6 +30,7 @@ export function createPermissionGuard(router: Router) { | ||
| 30 | userStore.getUserInfo.homePath && | 30 | userStore.getUserInfo.homePath && |
| 31 | userStore.getUserInfo.homePath !== PageEnum.BASE_HOME | 31 | userStore.getUserInfo.homePath !== PageEnum.BASE_HOME |
| 32 | ) { | 32 | ) { |
| 33 | + console.log(userStore.getUserInfo.homePath); | ||
| 33 | next(userStore.getUserInfo.homePath); | 34 | next(userStore.getUserInfo.homePath); |
| 34 | return; | 35 | return; |
| 35 | } | 36 | } |
| @@ -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(); |
| @@ -281,13 +281,13 @@ | @@ -281,13 +281,13 @@ | ||
| 281 | .noticeTitle:hover { | 281 | .noticeTitle:hover { |
| 282 | border-bottom: 1px solid #ccc; | 282 | border-bottom: 1px solid #ccc; |
| 283 | } | 283 | } |
| 284 | - :deep().ant-anchor-link-active > .ant-anchor-link-title { | 284 | + :deep.ant-anchor-link-active > .ant-anchor-link-title { |
| 285 | color: #666; | 285 | color: #666; |
| 286 | } | 286 | } |
| 287 | - :deep().ant-pagination-prev { | 287 | + :deep.ant-pagination-prev { |
| 288 | display: none; | 288 | display: none; |
| 289 | } | 289 | } |
| 290 | - :deep().ant-pagination-next { | 290 | + :deep.ant-pagination-next { |
| 291 | display: none; | 291 | display: none; |
| 292 | } | 292 | } |
| 293 | </style> | 293 | </style> |
| @@ -65,7 +65,14 @@ | @@ -65,7 +65,14 @@ | ||
| 65 | props: { | 65 | props: { |
| 66 | userData: { type: Object }, | 66 | userData: { type: Object }, |
| 67 | }, | 67 | }, |
| 68 | - emits: ['success', 'register'], | 68 | + emits: [ |
| 69 | + 'success', | ||
| 70 | + 'register', | ||
| 71 | + 'handleStepPrev', | ||
| 72 | + 'handleStep3Next', | ||
| 73 | + 'handleRedo', | ||
| 74 | + 'handleStep2Next', | ||
| 75 | + ], | ||
| 69 | setup(_, { emit }) { | 76 | setup(_, { emit }) { |
| 70 | const DeviceProfileStep1Ref = ref(null); | 77 | const DeviceProfileStep1Ref = ref(null); |
| 71 | const DeviceProfileStep2Ref = ref(null); | 78 | const DeviceProfileStep2Ref = ref(null); |
| @@ -133,11 +140,9 @@ | @@ -133,11 +140,9 @@ | ||
| 133 | current.value--; | 140 | current.value--; |
| 134 | } | 141 | } |
| 135 | function handleStepNext1(v, v1) { | 142 | function handleStepNext1(v, v1) { |
| 136 | - console.log(v, v1); | ||
| 137 | current.value++; | 143 | current.value++; |
| 138 | getStepOneData.value = v; | 144 | getStepOneData.value = v; |
| 139 | getStepOneData.value.icon = v1; | 145 | getStepOneData.value.icon = v1; |
| 140 | - console.log(getStepOneData.value); | ||
| 141 | if (unref(isUpdate)) { | 146 | if (unref(isUpdate)) { |
| 142 | proxy.$refs.DeviceProfileStep2Ref.resetFieldsFunc({ | 147 | proxy.$refs.DeviceProfileStep2Ref.resetFieldsFunc({ |
| 143 | transportType: editEchoData.value.profileData.transportConfiguration.type, | 148 | transportType: editEchoData.value.profileData.transportConfiguration.type, |
| @@ -148,7 +153,6 @@ | @@ -148,7 +153,6 @@ | ||
| 148 | } | 153 | } |
| 149 | function handleStep2Next(v) { | 154 | function handleStep2Next(v) { |
| 150 | current.value++; | 155 | current.value++; |
| 151 | - | ||
| 152 | getStepTwoData.value = v; | 156 | getStepTwoData.value = v; |
| 153 | if (unref(isUpdate)) { | 157 | if (unref(isUpdate)) { |
| 154 | proxy.$refs.DeviceProfileStep3Ref.retryRegisterFormFunc({ | 158 | proxy.$refs.DeviceProfileStep3Ref.retryRegisterFormFunc({ |
| @@ -157,7 +161,7 @@ | @@ -157,7 +161,7 @@ | ||
| 157 | proxy.$refs.DeviceProfileStep3Ref.retryRegisterFormHighSettingmFunc({ | 161 | proxy.$refs.DeviceProfileStep3Ref.retryRegisterFormHighSettingmFunc({ |
| 158 | propagate: editEchoData.value.profileData.alarms[0].propagate, | 162 | propagate: editEchoData.value.profileData.alarms[0].propagate, |
| 159 | propagateRelationTypes: | 163 | propagateRelationTypes: |
| 160 | - editEchoData.value.profileData?.alarms[0].propagateRelationTypes, | 164 | + editEchoData.value.profileData?.alarms[0].propagateRelationTypes[0], |
| 161 | }); | 165 | }); |
| 162 | const getKey = Object.keys(editEchoData.value.profileData?.alarms[0].createRules); | 166 | const getKey = Object.keys(editEchoData.value.profileData?.alarms[0].createRules); |
| 163 | proxy.$refs.DeviceProfileStep3Ref.retryRegisterFormCreateAlarmFunc({ | 167 | proxy.$refs.DeviceProfileStep3Ref.retryRegisterFormCreateAlarmFunc({ |
| @@ -207,13 +211,11 @@ | @@ -207,13 +211,11 @@ | ||
| 207 | ` | 211 | ` |
| 208 | ); | 212 | ); |
| 209 | proxy.$refs.DeviceProfileStep3Ref.retryEnableFormDataFunc(`始终启用`); | 213 | proxy.$refs.DeviceProfileStep3Ref.retryEnableFormDataFunc(`始终启用`); |
| 210 | - proxy.$refs.DeviceProfileStep3Ref.retryTemplateFormDataFunc( | ||
| 211 | - ` | ||
| 212 | - 报警详细信息:${ | ||
| 213 | - editEchoData.value.profileData?.alarms[0].createRules[getKey[0]].alarmDetails | ||
| 214 | - } | ||
| 215 | - ` | ||
| 216 | - ); | 214 | + proxy.$refs.DeviceProfileStep3Ref.setRegisterFormChangeDetailFunc({ |
| 215 | + alarmDetails: | ||
| 216 | + editEchoData.value.profileData?.alarms[0].createRules[getKey[0]].alarmDetails, | ||
| 217 | + }); | ||
| 218 | + | ||
| 217 | //清除报警 | 219 | //清除报警 |
| 218 | proxy.$refs.DeviceProfileStep3Ref.retryRulesClearFormDataFunc( | 220 | proxy.$refs.DeviceProfileStep3Ref.retryRulesClearFormDataFunc( |
| 219 | ` | 221 | ` |
| @@ -221,21 +223,23 @@ | @@ -221,21 +223,23 @@ | ||
| 221 | ` | 223 | ` |
| 222 | ); | 224 | ); |
| 223 | proxy.$refs.DeviceProfileStep3Ref.retryEnableClearFormDataFunc(`始终启用`); | 225 | proxy.$refs.DeviceProfileStep3Ref.retryEnableClearFormDataFunc(`始终启用`); |
| 224 | - proxy.$refs.DeviceProfileStep3Ref.retryTemplateClearFormDataFunc( | ||
| 225 | - ` | ||
| 226 | - 报警详细信息:${editEchoData.value.profileData?.alarms[0].clearRule.alarmDetails} | ||
| 227 | - ` | ||
| 228 | - ); | 226 | + proxy.$refs.DeviceProfileStep3Ref.setRegisterFormClearChangeDetailFunc({ |
| 227 | + alarmDetails: editEchoData.value.profileData?.alarms[0].clearRule.alarmDetails, | ||
| 228 | + }); | ||
| 229 | } else { | 229 | } else { |
| 230 | - proxy.$refs.DeviceProfileStep3Ref.resetRegisterFormFunc(); | ||
| 231 | - proxy.$refs.DeviceProfileStep3Ref.resetRegisterFormHighSettingmFunc(); | ||
| 232 | - proxy.$refs.DeviceProfileStep3Ref.resetRegisterFormCreateAlarmFunc(); | ||
| 233 | - proxy.$refs.DeviceProfileStep3Ref.resetRulesFormDataFunc(); | ||
| 234 | - proxy.$refs.DeviceProfileStep3Ref.resetEnableFormDataFunc(); | ||
| 235 | - proxy.$refs.DeviceProfileStep3Ref.resetTemplateFormDataFunc(); | ||
| 236 | - proxy.$refs.DeviceProfileStep3Ref.resetRulesClearFormDataFunc(); | ||
| 237 | - proxy.$refs.DeviceProfileStep3Ref.resetEnableClearFormDataFunc(); | ||
| 238 | - 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) {} | ||
| 239 | } | 243 | } |
| 240 | } | 244 | } |
| 241 | function handleStep3Next(v) { | 245 | function handleStep3Next(v) { |
| @@ -243,18 +247,24 @@ | @@ -243,18 +247,24 @@ | ||
| 243 | getStepThreeData.value = v; | 247 | getStepThreeData.value = v; |
| 244 | try { | 248 | try { |
| 245 | if (unref(isUpdate)) { | 249 | if (unref(isUpdate)) { |
| 246 | - setTimeout(() => { | 250 | + try { |
| 247 | proxy.$refs.DeviceProfileStep4Ref.resetFieldsFunc({ | 251 | proxy.$refs.DeviceProfileStep4Ref.resetFieldsFunc({ |
| 248 | alarmContactId: editEchoData.value.alarmProfile.alarmContactId, | 252 | alarmContactId: editEchoData.value.alarmProfile.alarmContactId, |
| 249 | messageMode: editEchoData.value.alarmProfile.messageMode, | 253 | messageMode: editEchoData.value.alarmProfile.messageMode, |
| 250 | }); | 254 | }); |
| 251 | - }, 1000); | 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 | + } | ||
| 252 | } | 267 | } |
| 253 | - // if (!unref(isUpdate)) { | ||
| 254 | - // setTimeout(() => { | ||
| 255 | - // proxy.$refs.DeviceProfileStep4Ref.customResetAndFunc(); | ||
| 256 | - // }, 1000); | ||
| 257 | - // } | ||
| 258 | } catch (e) { | 268 | } catch (e) { |
| 259 | return e; | 269 | return e; |
| 260 | } | 270 | } |
| @@ -298,7 +308,7 @@ | @@ -298,7 +308,7 @@ | ||
| 298 | } | 308 | } |
| 299 | }; | 309 | }; |
| 300 | const handleCancel = () => { | 310 | const handleCancel = () => { |
| 301 | - return; | 311 | + closeModal(); |
| 302 | }; | 312 | }; |
| 303 | return { | 313 | return { |
| 304 | 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" |
| @@ -140,72 +140,111 @@ | @@ -140,72 +140,111 @@ | ||
| 140 | span: 24, | 140 | span: 24, |
| 141 | }, | 141 | }, |
| 142 | }); | 142 | }); |
| 143 | - const [registerStep3Schemas, { setFieldsValue: setRegisterStep3Schemas }] = useForm({ | 143 | + const [ |
| 144 | + registerStep3Schemas, | ||
| 145 | + { setFieldsValue: setRegisterStep3Schemas, resetFields: resetFieldsStep3Schemas }, | ||
| 146 | + ] = useForm({ | ||
| 144 | schemas: step3Schemas, | 147 | schemas: step3Schemas, |
| 145 | actionColOptions: { | 148 | actionColOptions: { |
| 146 | span: 24, | 149 | span: 24, |
| 147 | }, | 150 | }, |
| 148 | }); | 151 | }); |
| 149 | - const [registerStep3HighSetting, { setFieldsValue: setRegisterStep3HighSetting }] = useForm({ | 152 | + const [ |
| 153 | + registerStep3HighSetting, | ||
| 154 | + { setFieldsValue: setRegisterStep3HighSetting, resetFields: resetFieldsStep3HighSetting }, | ||
| 155 | + ] = useForm({ | ||
| 150 | schemas: step3ViewHighSetting, | 156 | schemas: step3ViewHighSetting, |
| 151 | actionColOptions: { | 157 | actionColOptions: { |
| 152 | span: 24, | 158 | span: 24, |
| 153 | }, | 159 | }, |
| 154 | }); | 160 | }); |
| 155 | - const [registerStep3CreateAlarm, { setFieldsValue: setRegisterStep3CreateAlarm }] = useForm({ | 161 | + const [ |
| 162 | + registerStep3CreateAlarm, | ||
| 163 | + { setFieldsValue: setRegisterStep3CreateAlarm, resetFields: resetFieldsStep3CreateAlarm }, | ||
| 164 | + ] = useForm({ | ||
| 156 | schemas: step3CreateAlarm, | 165 | schemas: step3CreateAlarm, |
| 157 | actionColOptions: { | 166 | actionColOptions: { |
| 158 | span: 24, | 167 | span: 24, |
| 159 | }, | 168 | }, |
| 160 | }); | 169 | }); |
| 161 | - const [registerContact, { setFieldsValue: setRegisterContact }] = useForm({ | 170 | + const [ |
| 171 | + registerContact, | ||
| 172 | + { setFieldsValue: setRegisterContact, resetFields: resetFieldsContact }, | ||
| 173 | + ] = useForm({ | ||
| 162 | schemas: alertContactsSchemas, | 174 | schemas: alertContactsSchemas, |
| 163 | actionColOptions: { | 175 | actionColOptions: { |
| 164 | span: 24, | 176 | span: 24, |
| 165 | }, | 177 | }, |
| 166 | }); | 178 | }); |
| 167 | - const [registerStep3RuleAlarm, { setFieldsValue: setRegisterStep3RuleAlarm }] = useForm({ | 179 | + const [ |
| 180 | + registerStep3RuleAlarm, | ||
| 181 | + { setFieldsValue: setRegisterStep3RuleAlarm, resetFields: resetFieldsStep3RuleAlarm }, | ||
| 182 | + ] = useForm({ | ||
| 168 | schemas: echoFormSchema, | 183 | schemas: echoFormSchema, |
| 169 | actionColOptions: { | 184 | actionColOptions: { |
| 170 | span: 24, | 185 | span: 24, |
| 171 | }, | 186 | }, |
| 172 | }); | 187 | }); |
| 173 | - const [registerStep3Condition, { setFieldsValue: setRegisterStep3Condition }] = useForm({ | 188 | + const [ |
| 189 | + registerStep3Condition, | ||
| 190 | + { setFieldsValue: setRegisterStep3Condition, resetFields: resetFieldsrStep3Condition }, | ||
| 191 | + ] = useForm({ | ||
| 174 | schemas: conditionFormSchema, | 192 | schemas: conditionFormSchema, |
| 175 | actionColOptions: { | 193 | actionColOptions: { |
| 176 | span: 24, | 194 | span: 24, |
| 177 | }, | 195 | }, |
| 178 | }); | 196 | }); |
| 179 | - const [registerStep3Enable, { setFieldsValue: setRegisterStep3Enable }] = useForm({ | 197 | + const [ |
| 198 | + registerStep3Enable, | ||
| 199 | + { setFieldsValue: setRegisterStep3Enable, resetFields: resetFieldsStep3Enable }, | ||
| 200 | + ] = useForm({ | ||
| 180 | schemas: enableSchema, | 201 | schemas: enableSchema, |
| 181 | actionColOptions: { | 202 | actionColOptions: { |
| 182 | span: 24, | 203 | span: 24, |
| 183 | }, | 204 | }, |
| 184 | }); | 205 | }); |
| 185 | - const [registerStep3TemplateDetail, { setFieldsValue: setRegisterStep3TemplateDetail }] = | ||
| 186 | - useForm({ | ||
| 187 | - schemas: detailSchema, | ||
| 188 | - actionColOptions: { | ||
| 189 | - span: 24, | ||
| 190 | - }, | ||
| 191 | - }); | 206 | + const [ |
| 207 | + registerStep3TemplateDetail, | ||
| 208 | + { | ||
| 209 | + setFieldsValue: setRegisterStep3TemplateDetail, | ||
| 210 | + resetFields: resetFieldsStep3TemplateDetail, | ||
| 211 | + }, | ||
| 212 | + ] = useForm({ | ||
| 213 | + schemas: detailSchema, | ||
| 214 | + actionColOptions: { | ||
| 215 | + span: 24, | ||
| 216 | + }, | ||
| 217 | + }); | ||
| 192 | 218 | ||
| 193 | //清除报警 | 219 | //清除报警 |
| 194 | - const [registerStep3ClearRuleAlarm, { setFieldsValue: setRegisterStep3ClearRuleAlarm }] = | ||
| 195 | - useForm({ | ||
| 196 | - schemas: echoFormClearSchema, | ||
| 197 | - actionColOptions: { | ||
| 198 | - span: 24, | ||
| 199 | - }, | ||
| 200 | - }); | ||
| 201 | - const [registerStep3ClearCondition, { setFieldsValue: setRegisterStep3ClearCondition }] = | ||
| 202 | - useForm({ | ||
| 203 | - schemas: conditionFormClearschema, | ||
| 204 | - actionColOptions: { | ||
| 205 | - span: 24, | ||
| 206 | - }, | ||
| 207 | - }); | ||
| 208 | - const [registerStep3ClearEnable, { setFieldsValue: setRegisterStep3ClearEnable }] = useForm({ | 220 | + const [ |
| 221 | + registerStep3ClearRuleAlarm, | ||
| 222 | + { | ||
| 223 | + setFieldsValue: setRegisterStep3ClearRuleAlarm, | ||
| 224 | + resetFields: resetFieldsStep3ClearRuleAlarm, | ||
| 225 | + }, | ||
| 226 | + ] = useForm({ | ||
| 227 | + schemas: echoFormClearSchema, | ||
| 228 | + actionColOptions: { | ||
| 229 | + span: 24, | ||
| 230 | + }, | ||
| 231 | + }); | ||
| 232 | + const [ | ||
| 233 | + registerStep3ClearCondition, | ||
| 234 | + { | ||
| 235 | + setFieldsValue: setRegisterStep3ClearCondition, | ||
| 236 | + resetFields: resetFieldsStep3ClearCondition, | ||
| 237 | + }, | ||
| 238 | + ] = useForm({ | ||
| 239 | + schemas: conditionFormClearschema, | ||
| 240 | + actionColOptions: { | ||
| 241 | + span: 24, | ||
| 242 | + }, | ||
| 243 | + }); | ||
| 244 | + const [ | ||
| 245 | + registerStep3ClearEnable, | ||
| 246 | + { setFieldsValue: setRegisterStep3ClearEnable, resetFields: resetFieldStep3ClearEnablel }, | ||
| 247 | + ] = useForm({ | ||
| 209 | schemas: enableClearSchema, | 248 | schemas: enableClearSchema, |
| 210 | actionColOptions: { | 249 | actionColOptions: { |
| 211 | span: 24, | 250 | span: 24, |
| @@ -213,7 +252,10 @@ | @@ -213,7 +252,10 @@ | ||
| 213 | }); | 252 | }); |
| 214 | const [ | 253 | const [ |
| 215 | registerStep3ClearTemplateDetail, | 254 | registerStep3ClearTemplateDetail, |
| 216 | - { setFieldsValue: setRegisterStep3ClearTemplateDetail }, | 255 | + { |
| 256 | + setFieldsValue: setRegisterStep3ClearTemplateDetail, | ||
| 257 | + resetFields: resetFieldStep3ClearTemplateDetail, | ||
| 258 | + }, | ||
| 217 | ] = useForm({ | 259 | ] = useForm({ |
| 218 | schemas: detailClearSchema, | 260 | schemas: detailClearSchema, |
| 219 | actionColOptions: { | 261 | actionColOptions: { |
| @@ -246,80 +288,113 @@ | @@ -246,80 +288,113 @@ | ||
| 246 | break; | 288 | break; |
| 247 | case '3': | 289 | case '3': |
| 248 | setTimeout(() => { | 290 | setTimeout(() => { |
| 249 | - setRegisterStep3Schemas({ | ||
| 250 | - alarmType: descInfo.value.profileData?.alarms[0]?.alarmType, | ||
| 251 | - }); | ||
| 252 | - setRegisterStep3HighSetting({ | ||
| 253 | - propagate: descInfo.value.profileData?.alarms[0]?.propagate, | ||
| 254 | - propagateRelationTypes: | ||
| 255 | - descInfo.value.profileData?.alarms[0]?.propagateRelationTypes, | ||
| 256 | - }); | ||
| 257 | - const getKey = Object.keys(descInfo.value.profileData?.alarms[0]?.createRules); | ||
| 258 | - setRegisterStep3CreateAlarm({ | ||
| 259 | - default: getKey[0], | ||
| 260 | - }); | ||
| 261 | - setRegisterStep3RuleAlarm({ | ||
| 262 | - type: descInfo.value.profileData?.alarms[0].createRules[getKey[0]].condition | ||
| 263 | - .condition[0].key.type, | ||
| 264 | - key1: descInfo.value.profileData?.alarms[0].createRules[getKey[0]].condition | ||
| 265 | - .condition[0].key.key, | ||
| 266 | - type1: | ||
| 267 | - descInfo.value.profileData?.alarms[0].createRules[getKey[0]].condition | ||
| 268 | - .condition[0].valueType, | ||
| 269 | - value1: | ||
| 270 | - descInfo.value.profileData?.alarms[0].createRules[getKey[0]].condition | ||
| 271 | - .condition[0].predicate.value.defaultValue, | ||
| 272 | - operation: | ||
| 273 | - descInfo.value.profileData?.alarms[0].createRules[getKey[0]].condition | ||
| 274 | - .condition[0].predicate.operation, | ||
| 275 | - }); | ||
| 276 | - setRegisterStep3Condition({ | ||
| 277 | - conditionType: | ||
| 278 | - descInfo.value.profileData?.alarms[0].createRules[getKey[0]].condition.spec | 291 | + resetFieldsStep3SchemasFunc(); |
| 292 | + resetFieldsStep3HighSettingFunc(); | ||
| 293 | + resetFieldsStep3CreateAlarmFunc(); | ||
| 294 | + resetFieldsStep3RuleAlarmFunc(); | ||
| 295 | + resetFieldsStep3RuleAlarmFunc1(); | ||
| 296 | + resetFieldsrStep3ConditionFunc(); | ||
| 297 | + resetFieldsStep3EnableFunc(); | ||
| 298 | + resetFieldsStep3TemplateDetailFunc(); | ||
| 299 | + resetFieldsStep3ClearRuleAlarmFunc(); | ||
| 300 | + resetFieldsStep3ClearRuleAlarmlFunc(); | ||
| 301 | + resetFieldsStep3ClearConditionFunc(); | ||
| 302 | + resetFieldStep3ClearEnablelFunc(); | ||
| 303 | + resetFieldStep3ClearTemplateDetailFunc(); | ||
| 304 | + }, 100); | ||
| 305 | + setTimeout(() => { | ||
| 306 | + try { | ||
| 307 | + setRegisterStep3Schemas({ | ||
| 308 | + alarmType: descInfo.value.profileData?.alarms[0]?.alarmType, | ||
| 309 | + }); | ||
| 310 | + } catch (e) { | ||
| 311 | + return e; | ||
| 312 | + } | ||
| 313 | + | ||
| 314 | + try { | ||
| 315 | + setRegisterStep3HighSetting({ | ||
| 316 | + propagate: descInfo.value.profileData?.alarms[0]?.propagate, | ||
| 317 | + propagateRelationTypes: | ||
| 318 | + descInfo.value.profileData?.alarms[0]?.propagateRelationTypes[0], | ||
| 319 | + }); | ||
| 320 | + const getKey = Object.keys(descInfo.value.profileData?.alarms[0]?.createRules); | ||
| 321 | + setRegisterStep3CreateAlarm({ | ||
| 322 | + default: getKey[0], | ||
| 323 | + }); | ||
| 324 | + setRegisterStep3RuleAlarm({ | ||
| 325 | + type: descInfo.value.profileData?.alarms[0].createRules[getKey[0]].condition | ||
| 326 | + .condition[0].key.type, | ||
| 327 | + key1: descInfo.value.profileData?.alarms[0].createRules[getKey[0]].condition | ||
| 328 | + .condition[0].key.key, | ||
| 329 | + type1: | ||
| 330 | + descInfo.value.profileData?.alarms[0].createRules[getKey[0]].condition | ||
| 331 | + .condition[0].valueType, | ||
| 332 | + value1: | ||
| 333 | + descInfo.value.profileData?.alarms[0].createRules[getKey[0]].condition | ||
| 334 | + .condition[0].predicate.value.defaultValue, | ||
| 335 | + operation: | ||
| 336 | + descInfo.value.profileData?.alarms[0].createRules[getKey[0]].condition | ||
| 337 | + .condition[0].predicate.operation, | ||
| 338 | + }); | ||
| 339 | + setRegisterStep3Condition({ | ||
| 340 | + conditionType: | ||
| 341 | + descInfo.value.profileData?.alarms[0].createRules[getKey[0]].condition.spec | ||
| 342 | + .type, | ||
| 343 | + }); | ||
| 344 | + setRegisterStep3Enable({ | ||
| 345 | + schedule: | ||
| 346 | + descInfo.value.profileData?.alarms[0].createRules[getKey[0]].schedule.type, | ||
| 347 | + }); | ||
| 348 | + setRegisterStep3TemplateDetail({ | ||
| 349 | + alarmDetails: | ||
| 350 | + descInfo.value.profileData?.alarms[0].createRules[getKey[0]].alarmDetails, | ||
| 351 | + }); | ||
| 352 | + //清除报警 | ||
| 353 | + setRegisterStep3ClearRuleAlarm({ | ||
| 354 | + type: descInfo.value.profileData?.alarms[0].clearRule.condition.condition[0].key | ||
| 279 | .type, | 355 | .type, |
| 280 | - }); | ||
| 281 | - setRegisterStep3Enable({ | ||
| 282 | - schedule: | ||
| 283 | - descInfo.value.profileData?.alarms[0].createRules[getKey[0]].schedule.type, | ||
| 284 | - }); | ||
| 285 | - setRegisterStep3TemplateDetail({ | ||
| 286 | - alarmDetails: | ||
| 287 | - descInfo.value.profileData?.alarms[0].createRules[getKey[0]].alarmDetails, | ||
| 288 | - }); | ||
| 289 | - //清除报警 | ||
| 290 | - setRegisterStep3ClearRuleAlarm({ | ||
| 291 | - type: descInfo.value.profileData?.alarms[0].clearRule.condition.condition[0].key | ||
| 292 | - .type, | ||
| 293 | - key1: descInfo.value.profileData?.alarms[0].clearRule.condition.condition[0].key | ||
| 294 | - .key, | ||
| 295 | - type1: | ||
| 296 | - descInfo.value.profileData?.alarms[0].clearRule.condition.condition[0] | ||
| 297 | - .valueType, | ||
| 298 | - value1: | ||
| 299 | - descInfo.value.profileData?.alarms[0].clearRule.condition.condition[0].predicate | ||
| 300 | - .value.defaultValue, | ||
| 301 | - operation: | ||
| 302 | - descInfo.value.profileData?.alarms[0].clearRule.condition.condition[0].predicate | ||
| 303 | - .operation, | ||
| 304 | - }); | ||
| 305 | - setRegisterStep3ClearCondition({ | ||
| 306 | - conditionType: | ||
| 307 | - descInfo.value.profileData?.alarms[0].clearRule.condition.spec.type, | ||
| 308 | - }); | ||
| 309 | - setRegisterStep3ClearEnable({ | ||
| 310 | - schedule: descInfo.value.profileData?.alarms[0].clearRule.schedule.type, | ||
| 311 | - }); | ||
| 312 | - setRegisterStep3ClearTemplateDetail({ | ||
| 313 | - alarmDetails: descInfo.value.profileData?.alarms[0].clearRule.alarmDetails, | ||
| 314 | - }); | 356 | + key1: descInfo.value.profileData?.alarms[0].clearRule.condition.condition[0].key |
| 357 | + .key, | ||
| 358 | + type1: | ||
| 359 | + descInfo.value.profileData?.alarms[0].clearRule.condition.condition[0] | ||
| 360 | + .valueType, | ||
| 361 | + value1: | ||
| 362 | + descInfo.value.profileData?.alarms[0].clearRule.condition.condition[0] | ||
| 363 | + .predicate.value.defaultValue, | ||
| 364 | + operation: | ||
| 365 | + descInfo.value.profileData?.alarms[0].clearRule.condition.condition[0] | ||
| 366 | + .predicate.operation, | ||
| 367 | + }); | ||
| 368 | + setRegisterStep3ClearCondition({ | ||
| 369 | + conditionType: | ||
| 370 | + descInfo.value.profileData?.alarms[0].clearRule.condition.spec.type, | ||
| 371 | + }); | ||
| 372 | + setRegisterStep3ClearEnable({ | ||
| 373 | + schedule: descInfo.value.profileData?.alarms[0].clearRule.schedule.type, | ||
| 374 | + }); | ||
| 375 | + setRegisterStep3ClearTemplateDetail({ | ||
| 376 | + alarmDetails: descInfo.value.profileData?.alarms[0].clearRule.alarmDetails, | ||
| 377 | + }); | ||
| 378 | + } catch (e) { | ||
| 379 | + return e; | ||
| 380 | + } | ||
| 315 | }, 1000); | 381 | }, 1000); |
| 382 | + break; | ||
| 316 | case '4': | 383 | case '4': |
| 317 | setTimeout(() => { | 384 | setTimeout(() => { |
| 318 | - setRegisterContact({ | ||
| 319 | - alarmContactId: descInfo.value?.alarmProfile?.alarmContactId, | ||
| 320 | - messageMode: descInfo.value?.alarmProfile?.messageMode, | ||
| 321 | - }); | ||
| 322 | - }, 1000); | 385 | + resetFieldsContactFunc(); |
| 386 | + }, 100); | ||
| 387 | + setTimeout(() => { | ||
| 388 | + try { | ||
| 389 | + setRegisterContact({ | ||
| 390 | + alarmContactId: descInfo.value.alarmProfile.alarmContactId, | ||
| 391 | + messageMode: descInfo.value.alarmProfile.messageMode, | ||
| 392 | + }); | ||
| 393 | + } catch (e) { | ||
| 394 | + return e; | ||
| 395 | + } | ||
| 396 | + }, 500); | ||
| 397 | + | ||
| 323 | break; | 398 | break; |
| 324 | } | 399 | } |
| 325 | } catch (e) { | 400 | } catch (e) { |
| @@ -327,6 +402,53 @@ | @@ -327,6 +402,53 @@ | ||
| 327 | } | 402 | } |
| 328 | }; | 403 | }; |
| 329 | 404 | ||
| 405 | + const resetFieldsContactFunc = () => { | ||
| 406 | + resetFieldsContact(); | ||
| 407 | + }; | ||
| 408 | + const resetFieldsStep3SchemasFunc = () => { | ||
| 409 | + resetFieldsStep3Schemas(); | ||
| 410 | + }; | ||
| 411 | + | ||
| 412 | + const resetFieldsStep3HighSettingFunc = () => { | ||
| 413 | + resetFieldsStep3HighSetting(); | ||
| 414 | + }; | ||
| 415 | + const resetFieldsStep3CreateAlarmFunc = () => { | ||
| 416 | + resetFieldsStep3CreateAlarm(); | ||
| 417 | + }; | ||
| 418 | + const resetFieldsStep3RuleAlarmFunc = () => { | ||
| 419 | + resetFieldsStep3RuleAlarm(); | ||
| 420 | + }; | ||
| 421 | + | ||
| 422 | + const resetFieldsrStep3ConditionFunc = () => { | ||
| 423 | + resetFieldsrStep3Condition(); | ||
| 424 | + }; | ||
| 425 | + | ||
| 426 | + const resetFieldsStep3RuleAlarmFunc1 = () => { | ||
| 427 | + resetFieldsStep3RuleAlarm(); | ||
| 428 | + }; | ||
| 429 | + | ||
| 430 | + const resetFieldsStep3EnableFunc = () => { | ||
| 431 | + resetFieldsStep3Enable(); | ||
| 432 | + }; | ||
| 433 | + const resetFieldsStep3TemplateDetailFunc = () => { | ||
| 434 | + resetFieldsStep3TemplateDetail(); | ||
| 435 | + }; | ||
| 436 | + //清除报警 | ||
| 437 | + const resetFieldsStep3ClearRuleAlarmFunc = () => { | ||
| 438 | + resetFieldsStep3ClearRuleAlarm(); | ||
| 439 | + }; | ||
| 440 | + const resetFieldsStep3ClearRuleAlarmlFunc = () => { | ||
| 441 | + resetFieldsStep3ClearRuleAlarm(); | ||
| 442 | + }; | ||
| 443 | + const resetFieldsStep3ClearConditionFunc = () => { | ||
| 444 | + resetFieldsStep3ClearCondition(); | ||
| 445 | + }; | ||
| 446 | + const resetFieldStep3ClearEnablelFunc = () => { | ||
| 447 | + resetFieldStep3ClearEnablel(); | ||
| 448 | + }; | ||
| 449 | + const resetFieldStep3ClearTemplateDetailFunc = () => { | ||
| 450 | + resetFieldStep3ClearTemplateDetail(); | ||
| 451 | + }; | ||
| 330 | watch( | 452 | watch( |
| 331 | () => activeKey.value, | 453 | () => activeKey.value, |
| 332 | (v) => { | 454 | (v) => { |
| @@ -338,6 +460,7 @@ | @@ -338,6 +460,7 @@ | ||
| 338 | }); | 460 | }); |
| 339 | 461 | ||
| 340 | return { | 462 | return { |
| 463 | + resetFieldsContactFunc, | ||
| 341 | registerStep3ClearTemplateDetail, | 464 | registerStep3ClearTemplateDetail, |
| 342 | registerStep3ClearEnable, | 465 | registerStep3ClearEnable, |
| 343 | registerStep3ClearCondition, | 466 | registerStep3ClearCondition, |
| @@ -363,13 +486,13 @@ | @@ -363,13 +486,13 @@ | ||
| 363 | 486 | ||
| 364 | <style scoped lang="less"> | 487 | <style scoped lang="less"> |
| 365 | .input-style { | 488 | .input-style { |
| 366 | - /deep/ .ant-form-item-control-input { | 489 | + :deep .ant-form-item-control-input { |
| 367 | position: relative; | 490 | position: relative; |
| 368 | display: flex; | 491 | display: flex; |
| 369 | align-items: center; | 492 | align-items: center; |
| 370 | min-height: 02px; | 493 | min-height: 02px; |
| 371 | } | 494 | } |
| 372 | - /deep/.ant-col-24 { | 495 | + :deep.ant-col-24 { |
| 373 | display: block; | 496 | display: block; |
| 374 | flex: 0 0 100%; | 497 | flex: 0 0 100%; |
| 375 | max-width: 100%; | 498 | max-width: 100%; |
| @@ -378,13 +501,13 @@ | @@ -378,13 +501,13 @@ | ||
| 378 | } | 501 | } |
| 379 | 502 | ||
| 380 | .clear-input-style { | 503 | .clear-input-style { |
| 381 | - /deep/ .ant-form-item-control-input { | 504 | + :deep .ant-form-item-control-input { |
| 382 | position: relative; | 505 | position: relative; |
| 383 | display: flex; | 506 | display: flex; |
| 384 | align-items: center; | 507 | align-items: center; |
| 385 | min-height: 02px; | 508 | min-height: 02px; |
| 386 | } | 509 | } |
| 387 | - /deep/.ant-col-24 { | 510 | + :deep.ant-col-24 { |
| 388 | display: block; | 511 | display: block; |
| 389 | flex: 0 0 100%; | 512 | flex: 0 0 100%; |
| 390 | 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 | { |
| @@ -46,12 +46,16 @@ | @@ -46,12 +46,16 @@ | ||
| 46 | </template> | 46 | </template> |
| 47 | </BasicTable> | 47 | </BasicTable> |
| 48 | <DeviceProfileModal v-if="isJudgeStatus" @register="registerModal" @success="handleSuccess" /> | 48 | <DeviceProfileModal v-if="isJudgeStatus" @register="registerModal" @success="handleSuccess" /> |
| 49 | - <DeviceConfigDetail @register="registerModalDetail" @success="handleSuccess" /> | 49 | + <DeviceConfigDetail |
| 50 | + ref="deviceDetailRef" | ||
| 51 | + @register="registerModalDetail" | ||
| 52 | + @success="handleSuccess" | ||
| 53 | + /> | ||
| 50 | <!-- <ExpExcelModal @register="register1" @success="defaultHeader" /> --> | 54 | <!-- <ExpExcelModal @register="register1" @success="defaultHeader" /> --> |
| 51 | </div> | 55 | </div> |
| 52 | </template> | 56 | </template> |
| 53 | <script lang="ts"> | 57 | <script lang="ts"> |
| 54 | - import { defineComponent, ref, reactive } from 'vue'; | 58 | + import { defineComponent, ref, reactive, getCurrentInstance } from 'vue'; |
| 55 | import { BasicTable, useTable, TableAction, BasicColumn } from '/@/components/Table'; | 59 | import { BasicTable, useTable, TableAction, BasicColumn } from '/@/components/Table'; |
| 56 | import { columns, searchFormSchema } from './device.profile.data'; | 60 | import { columns, searchFormSchema } from './device.profile.data'; |
| 57 | import { useMessage } from '/@/hooks/web/useMessage'; | 61 | import { useMessage } from '/@/hooks/web/useMessage'; |
| @@ -66,6 +70,8 @@ | @@ -66,6 +70,8 @@ | ||
| 66 | name: 'DeviceProfileManagement', | 70 | name: 'DeviceProfileManagement', |
| 67 | components: { BasicTable, DeviceProfileModal, TableAction, ImpExcel, DeviceConfigDetail }, | 71 | components: { BasicTable, DeviceProfileModal, TableAction, ImpExcel, DeviceConfigDetail }, |
| 68 | setup() { | 72 | setup() { |
| 73 | + const { proxy } = getCurrentInstance(); | ||
| 74 | + const deviceDetailRef = ref(null); | ||
| 69 | let selectedRowKeys: string[] = reactive([]); | 75 | let selectedRowKeys: string[] = reactive([]); |
| 70 | let isJudgeStatus = ref(true); | 76 | let isJudgeStatus = ref(true); |
| 71 | const getPathUrl = ref(''); | 77 | const getPathUrl = ref(''); |
| @@ -148,17 +154,21 @@ | @@ -148,17 +154,21 @@ | ||
| 148 | } | 154 | } |
| 149 | 155 | ||
| 150 | function handleCreate() { | 156 | function handleCreate() { |
| 151 | - openModal(true, { | ||
| 152 | - isUpdate: false, | ||
| 153 | - }); | 157 | + setTimeout(() => { |
| 158 | + openModal(true, { | ||
| 159 | + isUpdate: false, | ||
| 160 | + }); | ||
| 161 | + }, 100); | ||
| 154 | isJudgeStatus.value = true; | 162 | isJudgeStatus.value = true; |
| 155 | } | 163 | } |
| 156 | 164 | ||
| 157 | function handleEdit(record: Recordable) { | 165 | function handleEdit(record: Recordable) { |
| 158 | - openModal(true, { | ||
| 159 | - record, | ||
| 160 | - isUpdate: true, | ||
| 161 | - }); | 166 | + setTimeout(() => { |
| 167 | + openModal(true, { | ||
| 168 | + record, | ||
| 169 | + isUpdate: true, | ||
| 170 | + }); | ||
| 171 | + }, 100); | ||
| 162 | isJudgeStatus.value = true; | 172 | isJudgeStatus.value = true; |
| 163 | } | 173 | } |
| 164 | const useSelectionChange = () => { | 174 | const useSelectionChange = () => { |
| @@ -183,6 +193,9 @@ | @@ -183,6 +193,9 @@ | ||
| 183 | record, | 193 | record, |
| 184 | isUpdate: false, | 194 | isUpdate: false, |
| 185 | }); | 195 | }); |
| 196 | + setTimeout(() => { | ||
| 197 | + // proxy.$refs.deviceDetailRef.resetFieldsContactFunc(); | ||
| 198 | + }, 2000); | ||
| 186 | isJudgeStatus.value = false; | 199 | isJudgeStatus.value = false; |
| 187 | } | 200 | } |
| 188 | 201 | ||
| @@ -211,6 +224,7 @@ | @@ -211,6 +224,7 @@ | ||
| 211 | reload(); | 224 | reload(); |
| 212 | } | 225 | } |
| 213 | return { | 226 | return { |
| 227 | + deviceDetailRef, | ||
| 214 | setRowClassName, | 228 | setRowClassName, |
| 215 | registerModalDetail, | 229 | registerModalDetail, |
| 216 | // register1, | 230 | // register1, |
| @@ -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> |
| @@ -67,7 +69,7 @@ | @@ -67,7 +69,7 @@ | ||
| 67 | Upload, | 69 | Upload, |
| 68 | PlusOutlined, | 70 | PlusOutlined, |
| 69 | }, | 71 | }, |
| 70 | - emits: ['next', 'resetFunc'], | 72 | + emits: ['next', 'resetFunc', 'register'], |
| 71 | setup(_, { emit }) { | 73 | setup(_, { emit }) { |
| 72 | const { createMessage } = useMessage(); | 74 | const { createMessage } = useMessage(); |
| 73 | 75 | ||
| @@ -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; |
| @@ -17,7 +17,7 @@ | @@ -17,7 +17,7 @@ | ||
| 17 | [Descriptions.name]: Descriptions, | 17 | [Descriptions.name]: Descriptions, |
| 18 | [Descriptions.Item.name]: Descriptions.Item, | 18 | [Descriptions.Item.name]: Descriptions.Item, |
| 19 | }, | 19 | }, |
| 20 | - emits: ['next', 'prev'], | 20 | + emits: ['next', 'prev', 'register'], |
| 21 | setup(_, { emit }) { | 21 | setup(_, { emit }) { |
| 22 | const [register, { validate, setFieldsValue, resetFields }] = useForm({ | 22 | const [register, { validate, setFieldsValue, resetFields }] = useForm({ |
| 23 | labelWidth: 80, | 23 | labelWidth: 80, |
| @@ -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/delete.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> |
| @@ -120,48 +135,52 @@ | @@ -120,48 +135,52 @@ | ||
| 120 | <a-button @click="handleFormStep3toStep4Next">下一步</a-button> | 135 | <a-button @click="handleFormStep3toStep4Next">下一步</a-button> |
| 121 | <a-button style="margin-left: 20px" type="primary" @click="addAlarmRule">添加报警规则</a-button> | 136 | <a-button style="margin-left: 20px" type="primary" @click="addAlarmRule">添加报警规则</a-button> |
| 122 | </div> | 137 | </div> |
| 123 | - <!-- 详情模板 --> | ||
| 124 | - <DetailTemplate | ||
| 125 | - v-if="isRuleAlarmRuleConditions == 1" | ||
| 126 | - @getAllFields="getAllFieldsFunc" | ||
| 127 | - @register="registerModal1" | ||
| 128 | - /> | ||
| 129 | - <!-- 启用规则 --> | ||
| 130 | - <EnableRule | ||
| 131 | - v-if="isRuleAlarmRuleConditions == 2" | ||
| 132 | - ref="getChildData2" | ||
| 133 | - @getAllFieldsEnab="getAllFieldsEnabFunc" | ||
| 134 | - @register="registerModal2" | ||
| 135 | - /> | ||
| 136 | - <!-- 报警规则条件 --> | ||
| 137 | - <AlarmRuleConditions | ||
| 138 | - v-if="isRuleAlarmRuleConditions == 3" | ||
| 139 | - ref="getChildData3" | ||
| 140 | - @getAllFieldsRule="getAllFieldsRuleFunc" | ||
| 141 | - @register="registerModal3" | ||
| 142 | - /> | 138 | + <div> |
| 139 | + <!-- 详情模板 --> | ||
| 140 | + <DetailTemplate | ||
| 141 | + v-if="isRuleAlarmRuleConditions == 1" | ||
| 142 | + @getAllFields="getAllFieldsFunc" | ||
| 143 | + @register="registerModal1" | ||
| 144 | + /> | ||
| 145 | + <!-- 启用规则 --> | ||
| 146 | + <EnableRule | ||
| 147 | + v-if="isRuleAlarmRuleConditions == 2" | ||
| 148 | + ref="getChildData2" | ||
| 149 | + @getAllFieldsEnab="getAllFieldsEnabFunc" | ||
| 150 | + @register="registerModal2" | ||
| 151 | + /> | ||
| 152 | + <!-- 报警规则条件 --> | ||
| 153 | + <AlarmRuleConditions | ||
| 154 | + v-if="isRuleAlarmRuleConditions == 3" | ||
| 155 | + ref="getChildData3" | ||
| 156 | + @getAllFieldsRule="getAllFieldsRuleFunc" | ||
| 157 | + @register="registerModal3" | ||
| 158 | + /> | ||
| 159 | + </div> | ||
| 143 | 160 | ||
| 144 | - <!-- 清除条件 --> | ||
| 145 | - <!-- 详情模板 --> | ||
| 146 | - <DetailTemplate | ||
| 147 | - v-if="isRuleAlarmRuleConditions == 4" | ||
| 148 | - @getAllFields="getAllClearFieldsFunc" | ||
| 149 | - @register="registerModal4" | ||
| 150 | - /> | ||
| 151 | - <!-- 启用规则 --> | ||
| 152 | - <EnableRule | ||
| 153 | - v-if="isRuleAlarmRuleConditions == 5" | ||
| 154 | - ref="getChildData2" | ||
| 155 | - @getAllFieldsEnab="getAllClearFieldsEnabFunc" | ||
| 156 | - @register="registerModal5" | ||
| 157 | - /> | ||
| 158 | - <!-- 报警规则条件 --> | ||
| 159 | - <AlarmRuleConditions | ||
| 160 | - v-if="isRuleAlarmRuleConditions == 6" | ||
| 161 | - ref="getChildData3" | ||
| 162 | - @getAllFieldsRule="getAllClearFieldsRuleFunc" | ||
| 163 | - @register="registerModal6" | ||
| 164 | - /> | 161 | + <div> |
| 162 | + <!-- 清除条件 --> | ||
| 163 | + <!-- 详情模板 --> | ||
| 164 | + <DetailTemplate | ||
| 165 | + v-if="isRuleAlarmRuleConditions == 4" | ||
| 166 | + @getAllFields="getAllClearFieldsFunc" | ||
| 167 | + @register="registerModal4" | ||
| 168 | + /> | ||
| 169 | + <!-- 启用规则 --> | ||
| 170 | + <EnableRule | ||
| 171 | + v-if="isRuleAlarmRuleConditions == 5" | ||
| 172 | + ref="getChildData2" | ||
| 173 | + @getAllFieldsEnab="getAllClearFieldsEnabFunc" | ||
| 174 | + @register="registerModal5" | ||
| 175 | + /> | ||
| 176 | + <!-- 报警规则条件 --> | ||
| 177 | + <AlarmRuleConditions | ||
| 178 | + v-if="isRuleAlarmRuleConditions == 6" | ||
| 179 | + ref="getChildData3" | ||
| 180 | + @getAllFieldsRule="getAllClearFieldsRuleFunc" | ||
| 181 | + @register="registerModal6" | ||
| 182 | + /> | ||
| 183 | + </div> | ||
| 165 | </template> | 184 | </template> |
| 166 | 185 | ||
| 167 | <script lang="ts"> | 186 | <script lang="ts"> |
| @@ -175,6 +194,7 @@ | @@ -175,6 +194,7 @@ | ||
| 175 | step3CreateAlarm, | 194 | step3CreateAlarm, |
| 176 | dashboardFormScheme, | 195 | dashboardFormScheme, |
| 177 | isWhereType, | 196 | isWhereType, |
| 197 | + formChangeDetailSchema, | ||
| 178 | } from './data'; | 198 | } from './data'; |
| 179 | import { PlusCircleOutlined } from '@ant-design/icons-vue'; | 199 | import { PlusCircleOutlined } from '@ant-design/icons-vue'; |
| 180 | import { Checkbox } from 'ant-design-vue'; | 200 | import { Checkbox } from 'ant-design-vue'; |
| @@ -185,7 +205,6 @@ | @@ -185,7 +205,6 @@ | ||
| 185 | import { Button } from '/@/components/Button'; | 205 | import { Button } from '/@/components/Button'; |
| 186 | 206 | ||
| 187 | export const isWhereTypeValueDisabled = ref(false); | 207 | export const isWhereTypeValueDisabled = ref(false); |
| 188 | - | ||
| 189 | export default defineComponent({ | 208 | export default defineComponent({ |
| 190 | components: { | 209 | components: { |
| 191 | BasicForm, | 210 | BasicForm, |
| @@ -197,8 +216,11 @@ | @@ -197,8 +216,11 @@ | ||
| 197 | AlarmRuleConditions, | 216 | AlarmRuleConditions, |
| 198 | Button, | 217 | Button, |
| 199 | }, | 218 | }, |
| 200 | - emits: ['prev', 'next'], | 219 | + emits: ['prev', 'next', 'redo', 'handleFormStep3toStep4Next'], |
| 201 | setup(_, { emit }) { | 220 | setup(_, { emit }) { |
| 221 | + const changeGetDetailValue: any = ref(null); | ||
| 222 | + const changeGetClearDetailValue: any = ref(null); | ||
| 223 | + const ruleNumber = ref(0); | ||
| 202 | const { proxy } = getCurrentInstance(); | 224 | const { proxy } = getCurrentInstance(); |
| 203 | const getChildData1 = ref(null); | 225 | const getChildData1 = ref(null); |
| 204 | const getChildData2 = ref(null); | 226 | const getChildData2 = ref(null); |
| @@ -238,6 +260,7 @@ | @@ -238,6 +260,7 @@ | ||
| 238 | }; | 260 | }; |
| 239 | //删除告警配置 | 261 | //删除告警配置 |
| 240 | const deleteAlarmRule = (index: number) => { | 262 | const deleteAlarmRule = (index: number) => { |
| 263 | + ruleNumber.value--; | ||
| 241 | unref(profileData).splice(index, 1); | 264 | unref(profileData).splice(index, 1); |
| 242 | }; | 265 | }; |
| 243 | // 上一步 | 266 | // 上一步 |
| @@ -246,6 +269,7 @@ | @@ -246,6 +269,7 @@ | ||
| 246 | }; | 269 | }; |
| 247 | //添加报警规则 | 270 | //添加报警规则 |
| 248 | const addAlarmRule = () => { | 271 | const addAlarmRule = () => { |
| 272 | + ruleNumber.value++; | ||
| 249 | clearIndex.value++; | 273 | clearIndex.value++; |
| 250 | unref(profileData).push({ | 274 | unref(profileData).push({ |
| 251 | configuration: { | 275 | configuration: { |
| @@ -262,7 +286,6 @@ | @@ -262,7 +286,6 @@ | ||
| 262 | id: Date.now() + Math.random() + '', | 286 | id: Date.now() + Math.random() + '', |
| 263 | alarmType: '', | 287 | alarmType: '', |
| 264 | createRules: {}, | 288 | createRules: {}, |
| 265 | - | ||
| 266 | propagate: false, | 289 | propagate: false, |
| 267 | propagateRelationTypes: [''], | 290 | propagateRelationTypes: [''], |
| 268 | }, | 291 | }, |
| @@ -323,6 +346,40 @@ | @@ -323,6 +346,40 @@ | ||
| 323 | span: 24, | 346 | span: 24, |
| 324 | }, | 347 | }, |
| 325 | }); | 348 | }); |
| 349 | + //详情模板 | ||
| 350 | + const [ | ||
| 351 | + registerFormChangeDetail, | ||
| 352 | + { | ||
| 353 | + getFieldsValue: getRegisterFormChangeDetail, | ||
| 354 | + setFieldsValue: setRegisterFormChangeDetail, | ||
| 355 | + resetFields: resetRegisterFormChangeDetail, | ||
| 356 | + }, | ||
| 357 | + ] = useForm({ | ||
| 358 | + labelWidth: 120, | ||
| 359 | + schemas: formChangeDetailSchema, | ||
| 360 | + showResetButton: false, | ||
| 361 | + showSubmitButton: false, | ||
| 362 | + actionColOptions: { | ||
| 363 | + span: 24, | ||
| 364 | + }, | ||
| 365 | + }); | ||
| 366 | + //清除详情模板 | ||
| 367 | + const [ | ||
| 368 | + registerFormChangeClearDetail, | ||
| 369 | + { | ||
| 370 | + getFieldsValue: getRegisterFormClearChangeDetail, | ||
| 371 | + setFieldsValue: setRegisterFormClearChangeDetail, | ||
| 372 | + resetFields: resetRegisterFormClearChangeDetail, | ||
| 373 | + }, | ||
| 374 | + ] = useForm({ | ||
| 375 | + labelWidth: 120, | ||
| 376 | + schemas: formChangeDetailSchema, | ||
| 377 | + showResetButton: false, | ||
| 378 | + showSubmitButton: false, | ||
| 379 | + actionColOptions: { | ||
| 380 | + span: 24, | ||
| 381 | + }, | ||
| 382 | + }); | ||
| 326 | // 添加创建条件表单 | 383 | // 添加创建条件表单 |
| 327 | const [ | 384 | const [ |
| 328 | registerFormCreateAlarm, | 385 | registerFormCreateAlarm, |
| @@ -369,6 +426,14 @@ | @@ -369,6 +426,14 @@ | ||
| 369 | const resetTemplateClearFormDataFunc = () => { | 426 | const resetTemplateClearFormDataFunc = () => { |
| 370 | detailClearTemplateData.value = ``; | 427 | detailClearTemplateData.value = ``; |
| 371 | }; | 428 | }; |
| 429 | + //修改详情模板 | ||
| 430 | + const resetRegisterFormChangeDetailFunc = () => { | ||
| 431 | + resetRegisterFormChangeDetail(); | ||
| 432 | + }; | ||
| 433 | + //清除修改详情模板 | ||
| 434 | + const resetRegisterFormClearChangeDetailFunc = () => { | ||
| 435 | + resetRegisterFormClearChangeDetail(); | ||
| 436 | + }; | ||
| 372 | 437 | ||
| 373 | //回显表单数据 | 438 | //回显表单数据 |
| 374 | const retryRegisterFormFunc = (v) => { | 439 | const retryRegisterFormFunc = (v) => { |
| @@ -398,6 +463,14 @@ | @@ -398,6 +463,14 @@ | ||
| 398 | const retryTemplateClearFormDataFunc = (v) => { | 463 | const retryTemplateClearFormDataFunc = (v) => { |
| 399 | detailClearTemplateData.value = v; | 464 | detailClearTemplateData.value = v; |
| 400 | }; | 465 | }; |
| 466 | + //修改详情模板 | ||
| 467 | + const setRegisterFormChangeDetailFunc = (v) => { | ||
| 468 | + setRegisterFormChangeDetail(v); | ||
| 469 | + }; | ||
| 470 | + //清除修改详情模板 | ||
| 471 | + const setRegisterFormClearChangeDetailFunc = (v) => { | ||
| 472 | + setRegisterFormClearChangeDetail(v); | ||
| 473 | + }; | ||
| 401 | 474 | ||
| 402 | const tempValue1: string = ref<string>(''); | 475 | const tempValue1: string = ref<string>(''); |
| 403 | // 添加‘创建条件’ | 476 | // 添加‘创建条件’ |
| @@ -483,6 +556,7 @@ | @@ -483,6 +556,7 @@ | ||
| 483 | // isWhereTypeValueDisabled.value = false; | 556 | // isWhereTypeValueDisabled.value = false; |
| 484 | } | 557 | } |
| 485 | }); | 558 | }); |
| 559 | + | ||
| 486 | //详情模板 | 560 | //详情模板 |
| 487 | const getAllFieldsFunc = (v) => { | 561 | const getAllFieldsFunc = (v) => { |
| 488 | detailObj.value = v; | 562 | detailObj.value = v; |
| @@ -760,19 +834,18 @@ | @@ -760,19 +834,18 @@ | ||
| 760 | return uuid; | 834 | return uuid; |
| 761 | } | 835 | } |
| 762 | const handleFormStep3toStep4Next = async () => { | 836 | const handleFormStep3toStep4Next = async () => { |
| 763 | - console.log(enableObj.value); | ||
| 764 | try { | 837 | try { |
| 838 | + changeGetDetailValue.value = getRegisterFormChangeDetail(); | ||
| 839 | + changeGetClearDetailValue.value = getRegisterFormClearChangeDetail(); | ||
| 765 | if (enableObj.value.schedule == 'CUSTOM') { | 840 | if (enableObj.value.schedule == 'CUSTOM') { |
| 766 | - for (let i in enableObj.value) { | ||
| 767 | - console.log(enableObj.value[i]); | ||
| 768 | - console.log(i); | ||
| 769 | - // let o = {}; | ||
| 770 | - // if(enableObj.value[i]=='1') | ||
| 771 | - // o[i] = enableObj.value[i]; | ||
| 772 | - // getSchduleCustomValue.value.push(o); | ||
| 773 | - // getSchduleCustomValue.value.push(enableObj.value[i]); | ||
| 774 | - } | ||
| 775 | - console.log(getSchduleCustomValue.value); | 841 | + // for (let i in enableObj.value) { |
| 842 | + // console.log(i); | ||
| 843 | + // // let o = {}; | ||
| 844 | + // // if(enableObj.value[i]=='1') | ||
| 845 | + // // o[i] = enableObj.value[i]; | ||
| 846 | + // // getSchduleCustomValue.value.push(o); | ||
| 847 | + // // getSchduleCustomValue.value.push(enableObj.value[i]); | ||
| 848 | + // } | ||
| 776 | // switch (enableObj.value.daysOfWeek1[0]) { | 849 | // switch (enableObj.value.daysOfWeek1[0]) { |
| 777 | // case '1': | 850 | // case '1': |
| 778 | // getSchduleCustomValue.value.push({ | 851 | // getSchduleCustomValue.value.push({ |
| @@ -852,7 +925,11 @@ | @@ -852,7 +925,11 @@ | ||
| 852 | ? scheduleCustomClearValue.value | 925 | ? scheduleCustomClearValue.value |
| 853 | : scheduleClearValue, | 926 | : scheduleClearValue, |
| 854 | }; | 927 | }; |
| 855 | - const getClearAdditionalProp = Object.assign({}, detailClearObj.value, getClearSchedule); | 928 | + const getClearAdditionalProp = Object.assign( |
| 929 | + {}, | ||
| 930 | + changeGetClearDetailValue.value, | ||
| 931 | + getClearSchedule | ||
| 932 | + ); | ||
| 856 | const scheduleValue = { | 933 | const scheduleValue = { |
| 857 | type: enableObj.value.schedule, | 934 | type: enableObj.value.schedule, |
| 858 | daysOfWeek: enableObj.value.daysOfWeek, | 935 | daysOfWeek: enableObj.value.daysOfWeek, |
| @@ -865,7 +942,7 @@ | @@ -865,7 +942,7 @@ | ||
| 865 | enableObj.value.schedule == 'CUSTOM' ? scheduleCustomValue.value : scheduleValue, | 942 | enableObj.value.schedule == 'CUSTOM' ? scheduleCustomValue.value : scheduleValue, |
| 866 | }; | 943 | }; |
| 867 | 944 | ||
| 868 | - const getAdditionalProp = Object.assign({}, detailObj.value, getSchedule); | 945 | + const getAdditionalProp = Object.assign({}, changeGetDetailValue.value, getSchedule); |
| 869 | const getScheduleAndAlarmDetails = Object.assign( | 946 | const getScheduleAndAlarmDetails = Object.assign( |
| 870 | {}, | 947 | {}, |
| 871 | getAdditionalProp, | 948 | getAdditionalProp, |
| @@ -928,50 +1005,73 @@ | @@ -928,50 +1005,73 @@ | ||
| 928 | isRuleAlarmRuleConditions.value = 1; | 1005 | isRuleAlarmRuleConditions.value = 1; |
| 929 | setTimeout(() => { | 1006 | setTimeout(() => { |
| 930 | openModal1(true); | 1007 | openModal1(true); |
| 931 | - proxy.$refs.getChildData1.resetDataFunc(); | 1008 | + setTimeout(() => { |
| 1009 | + proxy.$refs.getChildData1.resetDataFunc(); | ||
| 1010 | + }, 1000); | ||
| 932 | }, 50); | 1011 | }, 50); |
| 933 | }; | 1012 | }; |
| 934 | const handleOpenEnableRule = () => { | 1013 | const handleOpenEnableRule = () => { |
| 935 | isRuleAlarmRuleConditions.value = 2; | 1014 | isRuleAlarmRuleConditions.value = 2; |
| 936 | setTimeout(() => { | 1015 | setTimeout(() => { |
| 937 | openModal2(true); | 1016 | openModal2(true); |
| 938 | - proxy.$refs.getChildData2.resetDataFunc(); | 1017 | + setTimeout(() => { |
| 1018 | + proxy.$refs.getChildData2.resetDataFunc(); | ||
| 1019 | + }, 1000); | ||
| 939 | }, 50); | 1020 | }, 50); |
| 940 | }; | 1021 | }; |
| 941 | const handleOpenAlaramRuleConditions = () => { | 1022 | const handleOpenAlaramRuleConditions = () => { |
| 942 | isRuleAlarmRuleConditions.value = 3; | 1023 | isRuleAlarmRuleConditions.value = 3; |
| 943 | setTimeout(() => { | 1024 | setTimeout(() => { |
| 944 | openModal3(true); | 1025 | openModal3(true); |
| 945 | - proxy.$refs.getChildData3.resetDataFunc(); | ||
| 946 | - }, 50); | 1026 | + try { |
| 1027 | + setTimeout(() => { | ||
| 1028 | + proxy.$refs.getChildData3.resetDataFunc(); | ||
| 1029 | + }, 1000); | ||
| 1030 | + } catch (e) { | ||
| 1031 | + return e; | ||
| 1032 | + } | ||
| 1033 | + }, 500); | ||
| 947 | }; | 1034 | }; |
| 948 | const handleOpenClearDetailTemplate = () => { | 1035 | const handleOpenClearDetailTemplate = () => { |
| 949 | isRuleAlarmRuleConditions.value = 4; | 1036 | isRuleAlarmRuleConditions.value = 4; |
| 950 | setTimeout(() => { | 1037 | setTimeout(() => { |
| 951 | openModal4(true); | 1038 | openModal4(true); |
| 952 | try { | 1039 | try { |
| 953 | - proxy.$refs.getChildData1.resetDataFunc(); | 1040 | + setTimeout(() => { |
| 1041 | + proxy.$refs.getChildData1.resetDataFunc(); | ||
| 1042 | + }, 1000); | ||
| 954 | } catch (e) { | 1043 | } catch (e) { |
| 955 | return e; | 1044 | return e; |
| 956 | } | 1045 | } |
| 957 | - }, 50); | 1046 | + }, 500); |
| 958 | }; | 1047 | }; |
| 959 | const handleOpenClearEnableRule = () => { | 1048 | const handleOpenClearEnableRule = () => { |
| 960 | isRuleAlarmRuleConditions.value = 5; | 1049 | isRuleAlarmRuleConditions.value = 5; |
| 961 | setTimeout(() => { | 1050 | setTimeout(() => { |
| 962 | openModal5(true); | 1051 | openModal5(true); |
| 963 | - proxy.$refs.getChildData2.resetDataFunc(); | 1052 | + setTimeout(() => { |
| 1053 | + proxy.$refs.getChildData2.resetDataFunc(); | ||
| 1054 | + }, 1000); | ||
| 964 | }, 50); | 1055 | }, 50); |
| 965 | }; | 1056 | }; |
| 966 | const handleOpenClearAlaramRuleConditions = () => { | 1057 | const handleOpenClearAlaramRuleConditions = () => { |
| 967 | isRuleAlarmRuleConditions.value = 6; | 1058 | isRuleAlarmRuleConditions.value = 6; |
| 968 | setTimeout(() => { | 1059 | setTimeout(() => { |
| 969 | openModal6(true); | 1060 | openModal6(true); |
| 970 | - proxy.$refs.getChildData3.resetDataFunc(); | 1061 | + setTimeout(() => { |
| 1062 | + proxy.$refs.getChildData3.resetDataFunc(); | ||
| 1063 | + }, 1000); | ||
| 971 | }, 50); | 1064 | }, 50); |
| 972 | }; | 1065 | }; |
| 973 | 1066 | ||
| 974 | return { | 1067 | return { |
| 1068 | + resetRegisterFormChangeDetailFunc, | ||
| 1069 | + resetRegisterFormClearChangeDetailFunc, | ||
| 1070 | + setRegisterFormClearChangeDetailFunc, | ||
| 1071 | + setRegisterFormChangeDetailFunc, | ||
| 1072 | + registerFormChangeClearDetail, | ||
| 1073 | + registerFormChangeDetail, | ||
| 1074 | + ruleNumber, | ||
| 975 | resetEnableClearFormDataFunc, | 1075 | resetEnableClearFormDataFunc, |
| 976 | resetTemplateClearFormDataFunc, | 1076 | resetTemplateClearFormDataFunc, |
| 977 | resetRulesClearFormDataFunc, | 1077 | resetRulesClearFormDataFunc, |
| @@ -1040,6 +1140,8 @@ | @@ -1040,6 +1140,8 @@ | ||
| 1040 | <style lang="less" scoped> | 1140 | <style lang="less" scoped> |
| 1041 | .step3 { | 1141 | .step3 { |
| 1042 | width: 100%; | 1142 | width: 100%; |
| 1143 | + background-color: #f6f8f9; | ||
| 1144 | + z-index: 1; | ||
| 1043 | } | 1145 | } |
| 1044 | .border { | 1146 | .border { |
| 1045 | border: 1px solid #bfbfbf; | 1147 | border: 1px solid #bfbfbf; |
| @@ -1055,7 +1157,4 @@ | @@ -1055,7 +1157,4 @@ | ||
| 1055 | :deep(.vben-collapse-container__header) { | 1157 | :deep(.vben-collapse-container__header) { |
| 1056 | border: none; | 1158 | border: none; |
| 1057 | } | 1159 | } |
| 1058 | - // :deep(.anticon svg) { | ||
| 1059 | - // display: none !important; | ||
| 1060 | - // } | ||
| 1061 | </style> | 1160 | </style> |
| 1 | <template> | 1 | <template> |
| 2 | - <div> | 2 | + <div class="step-4"> |
| 3 | <!-- <span>请选择告警通知联系人:</span> --> | 3 | <!-- <span>请选择告警通知联系人:</span> --> |
| 4 | <!-- <Tag v-for="(item, index) in 15" closable :key="index"> 冯涛+{{ item }}</Tag> --> | 4 | <!-- <Tag v-for="(item, index) in 15" closable :key="index"> 冯涛+{{ item }}</Tag> --> |
| 5 | <BasicForm :showSubmitButton="false" @register="register" /> | 5 | <BasicForm :showSubmitButton="false" @register="register" /> |
| @@ -15,7 +15,7 @@ | @@ -15,7 +15,7 @@ | ||
| 15 | components: { | 15 | components: { |
| 16 | BasicForm, | 16 | BasicForm, |
| 17 | }, | 17 | }, |
| 18 | - emits: ['prev'], | 18 | + emits: ['prev', 'register'], |
| 19 | setup(_, { emit }) { | 19 | setup(_, { emit }) { |
| 20 | const getValueData: any = ref({}); | 20 | const getValueData: any = ref({}); |
| 21 | const [register, { setProps, validate, setFieldsValue, resetFields }] = useForm({ | 21 | const [register, { setProps, validate, setFieldsValue, resetFields }] = useForm({ |
| @@ -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'); |
| @@ -54,3 +54,12 @@ | @@ -54,3 +54,12 @@ | ||
| 54 | }, | 54 | }, |
| 55 | }); | 55 | }); |
| 56 | </script> | 56 | </script> |
| 57 | +<style lang="less" scoped> | ||
| 58 | + .step-4 { | ||
| 59 | + :deep .ant-btn { | ||
| 60 | + position: relative; | ||
| 61 | + right: 375px; | ||
| 62 | + top: 18px; | ||
| 63 | + } | ||
| 64 | + } | ||
| 65 | +</style> |
| 1 | <template> | 1 | <template> |
| 2 | - <BasicModal | ||
| 3 | - v-bind="$attrs" | ||
| 4 | - width="55rem" | ||
| 5 | - @register="register" | ||
| 6 | - :title="getTitle" | ||
| 7 | - @ok="handleSubmit" | ||
| 8 | - > | ||
| 9 | - <CollapseContainer title="键名筛选器" class="border mb-8"> | ||
| 10 | - <BasicTable | ||
| 11 | - :showIndexColumn="false" | ||
| 12 | - :resizeHeightOffset="200" | ||
| 13 | - :dataSource="getTableApiData" | ||
| 14 | - @register="registerTable" | ||
| 15 | - > | ||
| 16 | - <template #toolbar> | ||
| 17 | - <a-button type="primary" @click="handleAddKey">新增键名筛选器</a-button> | ||
| 18 | - </template> | ||
| 19 | - <template #action="{ record }"> | ||
| 20 | - <TableAction | ||
| 21 | - :actions="[ | ||
| 22 | - { | ||
| 23 | - label: '编辑', | ||
| 24 | - icon: 'clarity:note-edit-line', | ||
| 25 | - onClick: handleEdit.bind(null, record), | ||
| 26 | - }, | ||
| 27 | - { | ||
| 28 | - label: '删除', | ||
| 29 | - icon: 'ant-design:delete-outlined', | ||
| 30 | - color: 'error', | ||
| 31 | - popConfirm: { | ||
| 32 | - title: '是否确认删除', | ||
| 33 | - confirm: handleDelete.bind(null, record), | 2 | + <div class="key-style"> |
| 3 | + <BasicModal | ||
| 4 | + v-bind="$attrs" | ||
| 5 | + width="55rem" | ||
| 6 | + @register="register" | ||
| 7 | + :title="getTitle" | ||
| 8 | + @ok="handleSubmit" | ||
| 9 | + > | ||
| 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), | ||
| 34 | }, | 27 | }, |
| 35 | - }, | ||
| 36 | - ]" | ||
| 37 | - /> | ||
| 38 | - </template> | ||
| 39 | - </BasicTable> | ||
| 40 | - </CollapseContainer> | ||
| 41 | - <CollapseContainer title="筛选器预览" class="border mb-8"> | ||
| 42 | - <!-- <p v-for="(item, index) in detailData" :key="index">{{ item }}</p> --> | ||
| 43 | - <Description | ||
| 44 | - v-for="(item, index) in detailData" | ||
| 45 | - :key="index" | ||
| 46 | - :column="3" | ||
| 47 | - :data="item" | ||
| 48 | - :schema="schema" | ||
| 49 | - /> | ||
| 50 | - </CollapseContainer> | ||
| 51 | - <BasicForm :showResetButton="false" :showSubmitButton="false" @register="registerForm" /> | ||
| 52 | - </BasicModal> | ||
| 53 | - <KeyValueModal @register="registerModal" @success="handleSuccess" /> | 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 | + </CollapseContainer> | ||
| 42 | + <CollapseContainer title="筛选器预览" class="border mb-8"> | ||
| 43 | + <!-- <p v-for="(item, index) in detailData" :key="index">{{ item }}</p> --> | ||
| 44 | + <Description | ||
| 45 | + v-for="(item, index) in detailData" | ||
| 46 | + :key="index" | ||
| 47 | + :column="3" | ||
| 48 | + :data="item" | ||
| 49 | + :schema="schema" | ||
| 50 | + /> | ||
| 51 | + </CollapseContainer> | ||
| 52 | + <BasicForm :showResetButton="false" :showSubmitButton="false" @register="registerForm" /> | ||
| 53 | + </BasicModal> | ||
| 54 | + <KeyValueModal @register="registerModal" @success="handleSuccess" /> | ||
| 55 | + </div> | ||
| 54 | </template> | 56 | </template> |
| 55 | <script lang="ts"> | 57 | <script lang="ts"> |
| 56 | import { defineComponent, ref, computed, unref } from 'vue'; | 58 | import { defineComponent, ref, computed, unref } from 'vue'; |
| @@ -218,3 +220,10 @@ | @@ -218,3 +220,10 @@ | ||
| 218 | }, | 220 | }, |
| 219 | }); | 221 | }); |
| 220 | </script> | 222 | </script> |
| 223 | +<style lang="less" scoped> | ||
| 224 | + :deep.ant-table-body { | ||
| 225 | + overflow-y: auto !important; | ||
| 226 | + min-height: 173px !important; | ||
| 227 | + height: 100px !important; | ||
| 228 | + } | ||
| 229 | +</style> |
| @@ -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', |
| @@ -140,19 +127,6 @@ export const step3ViewHighSetting: FormSchema[] = [ | @@ -140,19 +127,6 @@ export const step3ViewHighSetting: FormSchema[] = [ | ||
| 140 | maxLength: 255, | 127 | maxLength: 255, |
| 141 | placeholder: '请输入关联类型', | 128 | placeholder: '请输入关联类型', |
| 142 | }, | 129 | }, |
| 143 | - dynamicRules: () => { | ||
| 144 | - return [ | ||
| 145 | - { | ||
| 146 | - required: false, | ||
| 147 | - validator: (_, value) => { | ||
| 148 | - if (String(value).length > 255) { | ||
| 149 | - return Promise.reject('字数不超过255个字'); | ||
| 150 | - } | ||
| 151 | - return Promise.resolve(); | ||
| 152 | - }, | ||
| 153 | - }, | ||
| 154 | - ]; | ||
| 155 | - }, | ||
| 156 | }, | 130 | }, |
| 157 | ]; | 131 | ]; |
| 158 | 132 | ||
| @@ -174,19 +148,6 @@ export const step3HighSetting: FormSchema[] = [ | @@ -174,19 +148,6 @@ export const step3HighSetting: FormSchema[] = [ | ||
| 174 | maxLength: 255, | 148 | maxLength: 255, |
| 175 | placeholder: '请输入关联类型', | 149 | placeholder: '请输入关联类型', |
| 176 | }, | 150 | }, |
| 177 | - dynamicRules: () => { | ||
| 178 | - return [ | ||
| 179 | - { | ||
| 180 | - required: false, | ||
| 181 | - validator: (_, value) => { | ||
| 182 | - if (String(value).length > 255) { | ||
| 183 | - return Promise.reject('字数不超过255个字'); | ||
| 184 | - } | ||
| 185 | - return Promise.resolve(); | ||
| 186 | - }, | ||
| 187 | - }, | ||
| 188 | - ]; | ||
| 189 | - }, | ||
| 190 | ifShow: ({ values }) => !!values.propagate, | 151 | ifShow: ({ values }) => !!values.propagate, |
| 191 | }, | 152 | }, |
| 192 | ]; | 153 | ]; |
| @@ -265,7 +226,6 @@ export const alertContactsSchemas: FormSchema[] = [ | @@ -265,7 +226,6 @@ export const alertContactsSchemas: FormSchema[] = [ | ||
| 265 | field: 'alarmContactId', | 226 | field: 'alarmContactId', |
| 266 | label: '告警通知联系人', | 227 | label: '告警通知联系人', |
| 267 | component: 'ApiSelect', | 228 | component: 'ApiSelect', |
| 268 | - required: true, | ||
| 269 | componentProps: { | 229 | componentProps: { |
| 270 | placeholder: '请选择告警通知联系人', | 230 | placeholder: '请选择告警通知联系人', |
| 271 | api: alarmContactGetPage, | 231 | api: alarmContactGetPage, |
| @@ -277,7 +237,6 @@ export const alertContactsSchemas: FormSchema[] = [ | @@ -277,7 +237,6 @@ export const alertContactsSchemas: FormSchema[] = [ | ||
| 277 | { | 237 | { |
| 278 | field: 'messageMode', | 238 | field: 'messageMode', |
| 279 | label: '告警通知方式', | 239 | label: '告警通知方式', |
| 280 | - required: true, | ||
| 281 | component: 'ApiSelect', | 240 | component: 'ApiSelect', |
| 282 | componentProps: { | 241 | componentProps: { |
| 283 | placeholder: '请选择告警通知方式', | 242 | placeholder: '请选择告警通知方式', |
| @@ -290,3 +249,17 @@ export const alertContactsSchemas: FormSchema[] = [ | @@ -290,3 +249,17 @@ export const alertContactsSchemas: FormSchema[] = [ | ||
| 290 | }, | 249 | }, |
| 291 | }, | 250 | }, |
| 292 | ]; | 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 | }, |
| @@ -12,17 +12,12 @@ | @@ -12,17 +12,12 @@ | ||
| 12 | <Button | 12 | <Button |
| 13 | style="margin-left: -99px; margin-top: 0px; display: inline-block" | 13 | style="margin-left: -99px; margin-top: 0px; display: inline-block" |
| 14 | v-if="Number(field) === 0" | 14 | v-if="Number(field) === 0" |
| 15 | + :style="addHideButton > 1 ? 'display:none' : 'display:inline-block'" | ||
| 15 | @click="add" | 16 | @click="add" |
| 16 | type="primary" | 17 | type="primary" |
| 17 | >+新增执行条件</Button | 18 | >+新增执行条件</Button |
| 18 | > | 19 | > |
| 19 | - <!-- <Button | ||
| 20 | - @click="del(field)" | ||
| 21 | - style="margin-left: 10px" | ||
| 22 | - v-if="Number(field) === 0" | ||
| 23 | - type="primary" | ||
| 24 | - >删除</Button | ||
| 25 | - > --> | 20 | + |
| 26 | <Button | 21 | <Button |
| 27 | style="margin-left: -95px; margin-top: 20px" | 22 | style="margin-left: -95px; margin-top: 20px" |
| 28 | v-if="field > 0" | 23 | v-if="field > 0" |
| @@ -49,9 +44,13 @@ | @@ -49,9 +44,13 @@ | ||
| 49 | 44 | ||
| 50 | export default defineComponent({ | 45 | export default defineComponent({ |
| 51 | components: { CollapseContainer, BasicForm, [Input.name]: Input, Button }, | 46 | components: { CollapseContainer, BasicForm, [Input.name]: Input, Button }, |
| 47 | + // eslint-disable-next-line vue/require-prop-types | ||
| 52 | props: ['deviceInfo1'], | 48 | props: ['deviceInfo1'], |
| 53 | - setup(props) { | ||
| 54 | - const getValueData: any = ref({}); | 49 | + emits: ['eDoConditionGetAddPushValueData'], |
| 50 | + setup(props, { emit }) { | ||
| 51 | + const addHideButton = ref(1); | ||
| 52 | + const getAddPushValueData: any = ref([]); | ||
| 53 | + | ||
| 55 | const [ | 54 | const [ |
| 56 | registerCondition, | 55 | registerCondition, |
| 57 | { | 56 | { |
| @@ -69,7 +68,9 @@ | @@ -69,7 +68,9 @@ | ||
| 69 | }); | 68 | }); |
| 70 | let isJudge = ref(1); | 69 | let isJudge = ref(1); |
| 71 | if (isJudge.value == 1) { | 70 | if (isJudge.value == 1) { |
| 72 | - resetFields(); | 71 | + setTimeout(() => { |
| 72 | + resetFields(); | ||
| 73 | + }, 1000); | ||
| 73 | } | 74 | } |
| 74 | watch( | 75 | watch( |
| 75 | () => props.deviceInfo1, | 76 | () => props.deviceInfo1, |
| @@ -90,12 +91,13 @@ | @@ -90,12 +91,13 @@ | ||
| 90 | const setFieldsFormValue = (v) => { | 91 | const setFieldsFormValue = (v) => { |
| 91 | setFieldsValue(v); | 92 | setFieldsValue(v); |
| 92 | }; | 93 | }; |
| 93 | - function getAllFields(getV) { | ||
| 94 | - const values = getFieldsValue(); | ||
| 95 | - getValueData.value = values; | ||
| 96 | - getV = getValueData.value; | 94 | + const getAllFields = (getV: any) => { |
| 95 | + getV = { | ||
| 96 | + data: getFieldsValue(), | ||
| 97 | + count: 1, | ||
| 98 | + }; | ||
| 97 | return getV; | 99 | return getV; |
| 98 | - } | 100 | + }; |
| 99 | function funcResetFields() { | 101 | function funcResetFields() { |
| 100 | resetFields(); | 102 | resetFields(); |
| 101 | } | 103 | } |
| @@ -119,6 +121,64 @@ | @@ -119,6 +121,64 @@ | ||
| 119 | 121 | ||
| 120 | const n = ref(1); | 122 | const n = ref(1); |
| 121 | function add() { | 123 | function add() { |
| 124 | + const pushValue = getFieldsValue(); | ||
| 125 | + getAddPushValueData.value.push(pushValue); | ||
| 126 | + emit('eDoConditionGetAddPushValueData', { | ||
| 127 | + data: getAddPushValueData.value, | ||
| 128 | + count: 2, | ||
| 129 | + }); | ||
| 130 | + addHideButton.value++; | ||
| 131 | + if (addHideButton.value == 3) { | ||
| 132 | + setTimeout(() => { | ||
| 133 | + let getDom1 = document.getElementById('1') as HTMLElement; | ||
| 134 | + getDom1.style.display = 'none'; | ||
| 135 | + }, 500); | ||
| 136 | + } | ||
| 137 | + if (addHideButton.value == 4) { | ||
| 138 | + setTimeout(() => { | ||
| 139 | + let getDom2 = document.getElementById('2') as HTMLElement; | ||
| 140 | + getDom2.style.display = 'none'; | ||
| 141 | + let getDom41 = document.getElementById('1') as HTMLElement; | ||
| 142 | + getDom41.style.display = 'none'; | ||
| 143 | + }, 500); | ||
| 144 | + } | ||
| 145 | + if (addHideButton.value == 5) { | ||
| 146 | + setTimeout(() => { | ||
| 147 | + let getDom3 = document.getElementById('3') as HTMLElement; | ||
| 148 | + getDom3.style.display = 'none'; | ||
| 149 | + let getDom51 = document.getElementById('1') as HTMLElement; | ||
| 150 | + getDom51.style.display = 'none'; | ||
| 151 | + let getDom52 = document.getElementById('2') as HTMLElement; | ||
| 152 | + getDom52.style.display = 'none'; | ||
| 153 | + }, 500); | ||
| 154 | + } | ||
| 155 | + if (addHideButton.value == 6) { | ||
| 156 | + setTimeout(() => { | ||
| 157 | + let getDom4 = document.getElementById('4') as HTMLElement; | ||
| 158 | + getDom4.style.display = 'none'; | ||
| 159 | + let getDom61 = document.getElementById('1') as HTMLElement; | ||
| 160 | + getDom61.style.display = 'none'; | ||
| 161 | + let getDom62 = document.getElementById('2') as HTMLElement; | ||
| 162 | + getDom62.style.display = 'none'; | ||
| 163 | + let getDom63 = document.getElementById('3') as HTMLElement; | ||
| 164 | + getDom63.style.display = 'none'; | ||
| 165 | + }, 500); | ||
| 166 | + } | ||
| 167 | + if (addHideButton.value == 7) { | ||
| 168 | + setTimeout(() => { | ||
| 169 | + let getDom7 = document.getElementById('5') as HTMLElement; | ||
| 170 | + getDom7.style.display = 'none'; | ||
| 171 | + let getDom71 = document.getElementById('1') as HTMLElement; | ||
| 172 | + getDom71.style.display = 'none'; | ||
| 173 | + let getDom72 = document.getElementById('2') as HTMLElement; | ||
| 174 | + getDom72.style.display = 'none'; | ||
| 175 | + let getDom73 = document.getElementById('3') as HTMLElement; | ||
| 176 | + getDom73.style.display = 'none'; | ||
| 177 | + let getDom74 = document.getElementById('4') as HTMLElement; | ||
| 178 | + getDom74.style.display = 'none'; | ||
| 179 | + }, 500); | ||
| 180 | + } | ||
| 181 | + | ||
| 122 | appendSchemaByField( | 182 | appendSchemaByField( |
| 123 | { | 183 | { |
| 124 | field: `kong${n.value}`, | 184 | field: `kong${n.value}`, |
| @@ -312,6 +372,73 @@ | @@ -312,6 +372,73 @@ | ||
| 312 | n.value++; | 372 | n.value++; |
| 313 | } | 373 | } |
| 314 | function del(field) { | 374 | function del(field) { |
| 375 | + addHideButton.value--; | ||
| 376 | + if (addHideButton.value == 2) { | ||
| 377 | + setTimeout(() => { | ||
| 378 | + let getDom1 = document.getElementById('1') as HTMLElement; | ||
| 379 | + getDom1.style.display = 'flex'; | ||
| 380 | + }, 500); | ||
| 381 | + } | ||
| 382 | + if (addHideButton.value == 3) { | ||
| 383 | + setTimeout(() => { | ||
| 384 | + let getDom2 = document.getElementById('2') as HTMLElement; | ||
| 385 | + getDom2.style.display = 'flex'; | ||
| 386 | + let getDom21 = document.getElementById('1') as HTMLElement; | ||
| 387 | + getDom21.style.display = 'none'; | ||
| 388 | + }, 500); | ||
| 389 | + } | ||
| 390 | + if (addHideButton.value == 4) { | ||
| 391 | + setTimeout(() => { | ||
| 392 | + let getDom3 = document.getElementById('3') as HTMLElement; | ||
| 393 | + getDom3.style.display = 'flex'; | ||
| 394 | + let getDom31 = document.getElementById('1') as HTMLElement; | ||
| 395 | + getDom31.style.display = 'none'; | ||
| 396 | + let getDom32 = document.getElementById('2') as HTMLElement; | ||
| 397 | + getDom32.style.display = 'none'; | ||
| 398 | + }, 500); | ||
| 399 | + } | ||
| 400 | + if (addHideButton.value == 5) { | ||
| 401 | + setTimeout(() => { | ||
| 402 | + let getDom4 = document.getElementById('4') as HTMLElement; | ||
| 403 | + getDom4.style.display = 'flex'; | ||
| 404 | + let getDom41 = document.getElementById('1') as HTMLElement; | ||
| 405 | + getDom41.style.display = 'none'; | ||
| 406 | + let getDom42 = document.getElementById('2') as HTMLElement; | ||
| 407 | + getDom42.style.display = 'none'; | ||
| 408 | + let getDom43 = document.getElementById('3') as HTMLElement; | ||
| 409 | + getDom43.style.display = 'none'; | ||
| 410 | + }, 500); | ||
| 411 | + } | ||
| 412 | + if (addHideButton.value == 6) { | ||
| 413 | + setTimeout(() => { | ||
| 414 | + let getDom5 = document.getElementById('5') as HTMLElement; | ||
| 415 | + getDom5.style.display = 'flex'; | ||
| 416 | + let getDom51 = document.getElementById('1') as HTMLElement; | ||
| 417 | + getDom51.style.display = 'none'; | ||
| 418 | + let getDom52 = document.getElementById('2') as HTMLElement; | ||
| 419 | + getDom52.style.display = 'none'; | ||
| 420 | + let getDom53 = document.getElementById('3') as HTMLElement; | ||
| 421 | + getDom53.style.display = 'none'; | ||
| 422 | + let getDom54 = document.getElementById('4') as HTMLElement; | ||
| 423 | + getDom54.style.display = 'none'; | ||
| 424 | + }, 500); | ||
| 425 | + } | ||
| 426 | + if (addHideButton.value == 7) { | ||
| 427 | + setTimeout(() => { | ||
| 428 | + let getDom7 = document.getElementById('6') as HTMLElement; | ||
| 429 | + getDom7.style.display = 'flex'; | ||
| 430 | + let getDom71 = document.getElementById('1') as HTMLElement; | ||
| 431 | + getDom71.style.display = 'none'; | ||
| 432 | + let getDom72 = document.getElementById('2') as HTMLElement; | ||
| 433 | + getDom72.style.display = 'none'; | ||
| 434 | + let getDom73 = document.getElementById('3') as HTMLElement; | ||
| 435 | + getDom73.style.display = 'none'; | ||
| 436 | + let getDom74 = document.getElementById('4') as HTMLElement; | ||
| 437 | + getDom74.style.display = 'none'; | ||
| 438 | + let getDom75 = document.getElementById('5') as HTMLElement; | ||
| 439 | + getDom75.style.display = 'none'; | ||
| 440 | + }, 500); | ||
| 441 | + } | ||
| 315 | removeSchemaByFiled([ | 442 | removeSchemaByFiled([ |
| 316 | `kong${field}`, | 443 | `kong${field}`, |
| 317 | `status${field}`, | 444 | `status${field}`, |
| @@ -329,6 +456,7 @@ | @@ -329,6 +456,7 @@ | ||
| 329 | n.value--; | 456 | n.value--; |
| 330 | } | 457 | } |
| 331 | return { | 458 | return { |
| 459 | + addHideButton, | ||
| 332 | editSelectDevice, | 460 | editSelectDevice, |
| 333 | clearSelectDevice, | 461 | clearSelectDevice, |
| 334 | setFieldsFormValue, | 462 | setFieldsFormValue, |
| @@ -12,6 +12,7 @@ | @@ -12,6 +12,7 @@ | ||
| 12 | <Button | 12 | <Button |
| 13 | style="margin-left: -99px; margin-top: 5px; display: inline-block" | 13 | style="margin-left: -99px; margin-top: 5px; display: inline-block" |
| 14 | v-if="Number(field) === 0" | 14 | v-if="Number(field) === 0" |
| 15 | + :style="addHideButton > 1 ? 'display:none' : 'display:inline-block'" | ||
| 15 | @click="add" | 16 | @click="add" |
| 16 | type="primary" | 17 | type="primary" |
| 17 | >+新增执行动作</Button | 18 | >+新增执行动作</Button |
| @@ -43,9 +44,13 @@ | @@ -43,9 +44,13 @@ | ||
| 43 | 44 | ||
| 44 | export default defineComponent({ | 45 | export default defineComponent({ |
| 45 | components: { CollapseContainer, BasicForm, [Input.name]: Input, Button }, | 46 | components: { CollapseContainer, BasicForm, [Input.name]: Input, Button }, |
| 47 | + // eslint-disable-next-line vue/require-prop-types | ||
| 46 | props: ['deviceInfo2'], | 48 | props: ['deviceInfo2'], |
| 47 | - setup(props) { | ||
| 48 | - const getValueData: any = ref({}); | 49 | + emits: ['eDoactionGetAddPushValueData'], |
| 50 | + setup(props, { emit }) { | ||
| 51 | + const addHideButton = ref(1); | ||
| 52 | + const getAddPushValueData: any = ref([]); | ||
| 53 | + | ||
| 49 | const [ | 54 | const [ |
| 50 | registerAction, | 55 | registerAction, |
| 51 | { | 56 | { |
| @@ -63,7 +68,9 @@ | @@ -63,7 +68,9 @@ | ||
| 63 | }); | 68 | }); |
| 64 | let isJudge = ref(1); | 69 | let isJudge = ref(1); |
| 65 | if (isJudge.value == 1) { | 70 | if (isJudge.value == 1) { |
| 66 | - resetFields(); | 71 | + setTimeout(() => { |
| 72 | + resetFields(); | ||
| 73 | + }, 1000); | ||
| 67 | } | 74 | } |
| 68 | watch( | 75 | watch( |
| 69 | () => props.deviceInfo2, | 76 | () => props.deviceInfo2, |
| @@ -84,12 +91,13 @@ | @@ -84,12 +91,13 @@ | ||
| 84 | const setFieldsFormValue = (v) => { | 91 | const setFieldsFormValue = (v) => { |
| 85 | setFieldsValue(v); | 92 | setFieldsValue(v); |
| 86 | }; | 93 | }; |
| 87 | - function getAllFields(getV) { | ||
| 88 | - const values = getFieldsValue(); | ||
| 89 | - getValueData.value = values; | ||
| 90 | - getV = getValueData.value; | 94 | + const getAllFields = (getV: any) => { |
| 95 | + getV = { | ||
| 96 | + data: getFieldsValue(), | ||
| 97 | + count: 1, | ||
| 98 | + }; | ||
| 91 | return getV; | 99 | return getV; |
| 92 | - } | 100 | + }; |
| 93 | function funcResetFields() { | 101 | function funcResetFields() { |
| 94 | resetFields(); | 102 | resetFields(); |
| 95 | } | 103 | } |
| @@ -112,6 +120,65 @@ | @@ -112,6 +120,65 @@ | ||
| 112 | }; | 120 | }; |
| 113 | const n = ref(1); | 121 | const n = ref(1); |
| 114 | function add() { | 122 | function add() { |
| 123 | + const pushValue = getFieldsValue(); | ||
| 124 | + | ||
| 125 | + getAddPushValueData.value.push(pushValue); | ||
| 126 | + emit('eDoactionGetAddPushValueData', { | ||
| 127 | + data: getAddPushValueData.value, | ||
| 128 | + count: 2, | ||
| 129 | + }); | ||
| 130 | + addHideButton.value++; | ||
| 131 | + if (addHideButton.value == 3) { | ||
| 132 | + setTimeout(() => { | ||
| 133 | + let getDom1 = document.getElementById('1') as HTMLElement; | ||
| 134 | + getDom1.style.display = 'none'; | ||
| 135 | + }, 500); | ||
| 136 | + } | ||
| 137 | + if (addHideButton.value == 4) { | ||
| 138 | + setTimeout(() => { | ||
| 139 | + let getDom2 = document.getElementById('2') as HTMLElement; | ||
| 140 | + getDom2.style.display = 'none'; | ||
| 141 | + let getDom41 = document.getElementById('1') as HTMLElement; | ||
| 142 | + getDom41.style.display = 'none'; | ||
| 143 | + }, 500); | ||
| 144 | + } | ||
| 145 | + if (addHideButton.value == 5) { | ||
| 146 | + setTimeout(() => { | ||
| 147 | + let getDom3 = document.getElementById('3') as HTMLElement; | ||
| 148 | + getDom3.style.display = 'none'; | ||
| 149 | + let getDom51 = document.getElementById('1') as HTMLElement; | ||
| 150 | + getDom51.style.display = 'none'; | ||
| 151 | + let getDom52 = document.getElementById('2') as HTMLElement; | ||
| 152 | + getDom52.style.display = 'none'; | ||
| 153 | + }, 500); | ||
| 154 | + } | ||
| 155 | + if (addHideButton.value == 6) { | ||
| 156 | + setTimeout(() => { | ||
| 157 | + let getDom4 = document.getElementById('4') as HTMLElement; | ||
| 158 | + getDom4.style.display = 'none'; | ||
| 159 | + let getDom61 = document.getElementById('1') as HTMLElement; | ||
| 160 | + getDom61.style.display = 'none'; | ||
| 161 | + let getDom62 = document.getElementById('2') as HTMLElement; | ||
| 162 | + getDom62.style.display = 'none'; | ||
| 163 | + let getDom63 = document.getElementById('3') as HTMLElement; | ||
| 164 | + getDom63.style.display = 'none'; | ||
| 165 | + }, 500); | ||
| 166 | + } | ||
| 167 | + if (addHideButton.value == 7) { | ||
| 168 | + setTimeout(() => { | ||
| 169 | + let getDom7 = document.getElementById('5') as HTMLElement; | ||
| 170 | + getDom7.style.display = 'none'; | ||
| 171 | + let getDom71 = document.getElementById('1') as HTMLElement; | ||
| 172 | + getDom71.style.display = 'none'; | ||
| 173 | + let getDom72 = document.getElementById('2') as HTMLElement; | ||
| 174 | + getDom72.style.display = 'none'; | ||
| 175 | + let getDom73 = document.getElementById('3') as HTMLElement; | ||
| 176 | + getDom73.style.display = 'none'; | ||
| 177 | + let getDom74 = document.getElementById('4') as HTMLElement; | ||
| 178 | + getDom74.style.display = 'none'; | ||
| 179 | + }, 500); | ||
| 180 | + } | ||
| 181 | + | ||
| 115 | appendSchemaByField( | 182 | appendSchemaByField( |
| 116 | { | 183 | { |
| 117 | field: `kong${n.value}`, | 184 | field: `kong${n.value}`, |
| @@ -272,6 +339,73 @@ | @@ -272,6 +339,73 @@ | ||
| 272 | } | 339 | } |
| 273 | 340 | ||
| 274 | function del(field) { | 341 | function del(field) { |
| 342 | + addHideButton.value--; | ||
| 343 | + if (addHideButton.value == 2) { | ||
| 344 | + setTimeout(() => { | ||
| 345 | + let getDom1 = document.getElementById('1') as HTMLElement; | ||
| 346 | + getDom1.style.display = 'flex'; | ||
| 347 | + }, 500); | ||
| 348 | + } | ||
| 349 | + if (addHideButton.value == 3) { | ||
| 350 | + setTimeout(() => { | ||
| 351 | + let getDom2 = document.getElementById('2') as HTMLElement; | ||
| 352 | + getDom2.style.display = 'flex'; | ||
| 353 | + let getDom21 = document.getElementById('1') as HTMLElement; | ||
| 354 | + getDom21.style.display = 'none'; | ||
| 355 | + }, 500); | ||
| 356 | + } | ||
| 357 | + if (addHideButton.value == 4) { | ||
| 358 | + setTimeout(() => { | ||
| 359 | + let getDom3 = document.getElementById('3') as HTMLElement; | ||
| 360 | + getDom3.style.display = 'flex'; | ||
| 361 | + let getDom31 = document.getElementById('1') as HTMLElement; | ||
| 362 | + getDom31.style.display = 'none'; | ||
| 363 | + let getDom32 = document.getElementById('2') as HTMLElement; | ||
| 364 | + getDom32.style.display = 'none'; | ||
| 365 | + }, 500); | ||
| 366 | + } | ||
| 367 | + if (addHideButton.value == 5) { | ||
| 368 | + setTimeout(() => { | ||
| 369 | + let getDom4 = document.getElementById('4') as HTMLElement; | ||
| 370 | + getDom4.style.display = 'flex'; | ||
| 371 | + let getDom41 = document.getElementById('1') as HTMLElement; | ||
| 372 | + getDom41.style.display = 'none'; | ||
| 373 | + let getDom42 = document.getElementById('2') as HTMLElement; | ||
| 374 | + getDom42.style.display = 'none'; | ||
| 375 | + let getDom43 = document.getElementById('3') as HTMLElement; | ||
| 376 | + getDom43.style.display = 'none'; | ||
| 377 | + }, 500); | ||
| 378 | + } | ||
| 379 | + if (addHideButton.value == 6) { | ||
| 380 | + setTimeout(() => { | ||
| 381 | + let getDom5 = document.getElementById('5') as HTMLElement; | ||
| 382 | + getDom5.style.display = 'flex'; | ||
| 383 | + let getDom51 = document.getElementById('1') as HTMLElement; | ||
| 384 | + getDom51.style.display = 'none'; | ||
| 385 | + let getDom52 = document.getElementById('2') as HTMLElement; | ||
| 386 | + getDom52.style.display = 'none'; | ||
| 387 | + let getDom53 = document.getElementById('3') as HTMLElement; | ||
| 388 | + getDom53.style.display = 'none'; | ||
| 389 | + let getDom54 = document.getElementById('4') as HTMLElement; | ||
| 390 | + getDom54.style.display = 'none'; | ||
| 391 | + }, 500); | ||
| 392 | + } | ||
| 393 | + if (addHideButton.value == 7) { | ||
| 394 | + setTimeout(() => { | ||
| 395 | + let getDom7 = document.getElementById('6') as HTMLElement; | ||
| 396 | + getDom7.style.display = 'flex'; | ||
| 397 | + let getDom71 = document.getElementById('1') as HTMLElement; | ||
| 398 | + getDom71.style.display = 'none'; | ||
| 399 | + let getDom72 = document.getElementById('2') as HTMLElement; | ||
| 400 | + getDom72.style.display = 'none'; | ||
| 401 | + let getDom73 = document.getElementById('3') as HTMLElement; | ||
| 402 | + getDom73.style.display = 'none'; | ||
| 403 | + let getDom74 = document.getElementById('4') as HTMLElement; | ||
| 404 | + getDom74.style.display = 'none'; | ||
| 405 | + let getDom75 = document.getElementById('5') as HTMLElement; | ||
| 406 | + getDom75.style.display = 'none'; | ||
| 407 | + }, 500); | ||
| 408 | + } | ||
| 275 | removeSchemaByFiled([ | 409 | removeSchemaByFiled([ |
| 276 | `kong${field}`, | 410 | `kong${field}`, |
| 277 | `outTarget${field}`, | 411 | `outTarget${field}`, |
| @@ -288,6 +422,7 @@ | @@ -288,6 +422,7 @@ | ||
| 288 | } | 422 | } |
| 289 | 423 | ||
| 290 | return { | 424 | return { |
| 425 | + addHideButton, | ||
| 291 | editSelectDevice, | 426 | editSelectDevice, |
| 292 | clearSelectDevice, | 427 | clearSelectDevice, |
| 293 | setFieldsFormValue, | 428 | setFieldsFormValue, |
| @@ -309,5 +444,6 @@ | @@ -309,5 +444,6 @@ | ||
| 309 | display: inline-block; | 444 | display: inline-block; |
| 310 | position: relative; | 445 | position: relative; |
| 311 | top: 33px; | 446 | top: 33px; |
| 447 | + left: 5px; | ||
| 312 | } | 448 | } |
| 313 | </style> | 449 | </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"> |
| @@ -19,17 +20,15 @@ | @@ -19,17 +20,15 @@ | ||
| 19 | >+新增触发器</Button | 20 | >+新增触发器</Button |
| 20 | > | 21 | > |
| 21 | <Button | 22 | <Button |
| 22 | - style="margin-left: 5px; margin-top: 35px" | ||
| 23 | - :style="addHideButton >= 2 ? 'display:inline-block' : 'display:none'" | ||
| 24 | v-if="Number(field) > 0" | 23 | v-if="Number(field) > 0" |
| 24 | + style="margin-left: 5px; margin-top: 35px" | ||
| 25 | @click="add" | 25 | @click="add" |
| 26 | type="primary" | 26 | type="primary" |
| 27 | >+新增触发器</Button | 27 | >+新增触发器</Button |
| 28 | > | 28 | > |
| 29 | <Button | 29 | <Button |
| 30 | - style="margin-left: 10px" | ||
| 31 | - :style="addHideButton >= 2 ? 'display:inline-block' : 'display:none'" | ||
| 32 | v-if="Number(field) > 0" | 30 | v-if="Number(field) > 0" |
| 31 | + style="margin-left: 10px" | ||
| 33 | @click="del(field)" | 32 | @click="del(field)" |
| 34 | type="primary" | 33 | type="primary" |
| 35 | >删除</Button | 34 | >删除</Button |
| @@ -58,12 +57,14 @@ | @@ -58,12 +57,14 @@ | ||
| 58 | 57 | ||
| 59 | export default defineComponent({ | 58 | export default defineComponent({ |
| 60 | components: { CollapseContainer, BasicForm, [Input.name]: Input, Button }, | 59 | components: { CollapseContainer, BasicForm, [Input.name]: Input, Button }, |
| 60 | + // eslint-disable-next-line vue/require-prop-types | ||
| 61 | props: ['deviceInfo'], | 61 | props: ['deviceInfo'], |
| 62 | - setup(props) { | ||
| 63 | - const getValueData: any = ref({}); | 62 | + emits: ['eGetAddPushValueData'], |
| 63 | + setup(props, { emit }) { | ||
| 64 | const getPushValueData: any = ref([]); | 64 | const getPushValueData: any = ref([]); |
| 65 | const addHideButton = ref(1); | 65 | const addHideButton = ref(1); |
| 66 | const addHideButtonTemp: any = ref(null); | 66 | const addHideButtonTemp: any = ref(null); |
| 67 | + const getAddPushValueData: any = ref([]); | ||
| 67 | const [ | 68 | const [ |
| 68 | registerTrigger, | 69 | registerTrigger, |
| 69 | { | 70 | { |
| @@ -81,7 +82,9 @@ | @@ -81,7 +82,9 @@ | ||
| 81 | }); | 82 | }); |
| 82 | let isJudge = ref(1); | 83 | let isJudge = ref(1); |
| 83 | if (isJudge.value == 1) { | 84 | if (isJudge.value == 1) { |
| 84 | - resetFields(); | 85 | + setTimeout(() => { |
| 86 | + resetFields(); | ||
| 87 | + }, 1000); | ||
| 85 | } | 88 | } |
| 86 | watch( | 89 | watch( |
| 87 | () => props.deviceInfo, | 90 | () => props.deviceInfo, |
| @@ -122,28 +125,102 @@ | @@ -122,28 +125,102 @@ | ||
| 122 | const clearGetPushValueDataEmpty = () => { | 125 | const clearGetPushValueDataEmpty = () => { |
| 123 | getPushValueData.value.length = 0; | 126 | getPushValueData.value.length = 0; |
| 124 | }; | 127 | }; |
| 125 | - function getAllFields(getV) { | ||
| 126 | - const values = getFieldsValue(); | ||
| 127 | - getValueData.value = values; | ||
| 128 | - getV = getValueData.value; | ||
| 129 | - getPushValueData.value.push(getV); | ||
| 130 | - console.log(getPushValueData.value); | 128 | + |
| 129 | + const getAllFields = (getV: any) => { | ||
| 130 | + getV = { | ||
| 131 | + data: getFieldsValue(), | ||
| 132 | + count: 1, | ||
| 133 | + }; | ||
| 131 | return getV; | 134 | return getV; |
| 132 | - } | 135 | + }; |
| 133 | async function funcResetFields() { | 136 | async function funcResetFields() { |
| 134 | await resetFields(); | 137 | await resetFields(); |
| 135 | } | 138 | } |
| 136 | const addString: any = ref('tiggerEvent1') || ref('tiggerEvent2') || ref('tiggerEvent3'); | 139 | const addString: any = ref('tiggerEvent1') || ref('tiggerEvent2') || ref('tiggerEvent3'); |
| 137 | 140 | ||
| 138 | const n = ref(1); | 141 | const n = ref(1); |
| 142 | + const clearAddTriggerStatusFunc = () => { | ||
| 143 | + // addHideButton.value = 1; | ||
| 144 | + }; | ||
| 145 | + const addClearGetAddPushValueDataArrayIsEmpty = () => { | ||
| 146 | + getAddPushValueData.value = []; | ||
| 147 | + }; | ||
| 139 | function add() { | 148 | function add() { |
| 149 | + const pushValue = getFieldsValue(); | ||
| 150 | + getAddPushValueData.value.push(pushValue); | ||
| 151 | + emit('eGetAddPushValueData', { | ||
| 152 | + data: getAddPushValueData.value, | ||
| 153 | + count: 2, | ||
| 154 | + }); | ||
| 140 | addHideButton.value++; | 155 | addHideButton.value++; |
| 141 | addHideButtonTemp.value = addHideButton.value; | 156 | addHideButtonTemp.value = addHideButton.value; |
| 142 | - addHideButtonTemp.value--; | ||
| 143 | - const getS = document.getElementById('1') as HTMLElement; | ||
| 144 | - // getS.setAttribute('style', 'display:none'); | ||
| 145 | - console.log(getS); | ||
| 146 | - getS.hidden = true; | 157 | + addHideButtonTemp.value -= 2; |
| 158 | + if (addHideButton.value == 3) { | ||
| 159 | + setTimeout(() => { | ||
| 160 | + let getDom1 = document.getElementById('1') as HTMLElement; | ||
| 161 | + getDom1.style.display = 'none'; | ||
| 162 | + }, 500); | ||
| 163 | + } | ||
| 164 | + if (addHideButton.value == 4) { | ||
| 165 | + setTimeout(() => { | ||
| 166 | + let getDom2 = document.getElementById('2') as HTMLElement; | ||
| 167 | + getDom2.style.display = 'none'; | ||
| 168 | + let getDom41 = document.getElementById('1') as HTMLElement; | ||
| 169 | + getDom41.style.display = 'none'; | ||
| 170 | + }, 500); | ||
| 171 | + } | ||
| 172 | + if (addHideButton.value == 5) { | ||
| 173 | + setTimeout(() => { | ||
| 174 | + let getDom3 = document.getElementById('3') as HTMLElement; | ||
| 175 | + getDom3.style.display = 'none'; | ||
| 176 | + let getDom51 = document.getElementById('1') as HTMLElement; | ||
| 177 | + getDom51.style.display = 'none'; | ||
| 178 | + let getDom52 = document.getElementById('2') as HTMLElement; | ||
| 179 | + getDom52.style.display = 'none'; | ||
| 180 | + }, 500); | ||
| 181 | + } | ||
| 182 | + if (addHideButton.value == 6) { | ||
| 183 | + setTimeout(() => { | ||
| 184 | + let getDom4 = document.getElementById('4') as HTMLElement; | ||
| 185 | + getDom4.style.display = 'none'; | ||
| 186 | + let getDom61 = document.getElementById('1') as HTMLElement; | ||
| 187 | + getDom61.style.display = 'none'; | ||
| 188 | + let getDom62 = document.getElementById('2') as HTMLElement; | ||
| 189 | + getDom62.style.display = 'none'; | ||
| 190 | + let getDom63 = document.getElementById('3') as HTMLElement; | ||
| 191 | + getDom63.style.display = 'none'; | ||
| 192 | + }, 500); | ||
| 193 | + } | ||
| 194 | + if (addHideButton.value == 7) { | ||
| 195 | + setTimeout(() => { | ||
| 196 | + let getDom7 = document.getElementById('5') as HTMLElement; | ||
| 197 | + getDom7.style.display = 'none'; | ||
| 198 | + let getDom71 = document.getElementById('1') as HTMLElement; | ||
| 199 | + getDom71.style.display = 'none'; | ||
| 200 | + let getDom72 = document.getElementById('2') as HTMLElement; | ||
| 201 | + getDom72.style.display = 'none'; | ||
| 202 | + let getDom73 = document.getElementById('3') as HTMLElement; | ||
| 203 | + getDom73.style.display = 'none'; | ||
| 204 | + let getDom74 = document.getElementById('4') as HTMLElement; | ||
| 205 | + getDom74.style.display = 'none'; | ||
| 206 | + }, 500); | ||
| 207 | + } | ||
| 208 | + if (addHideButton.value == 8) { | ||
| 209 | + setTimeout(() => { | ||
| 210 | + let getDom8 = document.getElementById('6') as HTMLElement; | ||
| 211 | + getDom8.style.display = 'none'; | ||
| 212 | + let getDom81 = document.getElementById('1') as HTMLElement; | ||
| 213 | + getDom81.style.display = 'none'; | ||
| 214 | + let getDom82 = document.getElementById('2') as HTMLElement; | ||
| 215 | + getDom82.style.display = 'none'; | ||
| 216 | + let getDom83 = document.getElementById('3') as HTMLElement; | ||
| 217 | + getDom83.style.display = 'none'; | ||
| 218 | + let getDom84 = document.getElementById('4') as HTMLElement; | ||
| 219 | + getDom84.style.display = 'none'; | ||
| 220 | + let getDom85 = document.getElementById('5') as HTMLElement; | ||
| 221 | + getDom85.style.display = 'none'; | ||
| 222 | + }, 500); | ||
| 223 | + } | ||
| 147 | 224 | ||
| 148 | appendSchemaByField( | 225 | appendSchemaByField( |
| 149 | { | 226 | { |
| @@ -365,6 +442,90 @@ | @@ -365,6 +442,90 @@ | ||
| 365 | 442 | ||
| 366 | function del(field) { | 443 | function del(field) { |
| 367 | addHideButton.value--; | 444 | addHideButton.value--; |
| 445 | + if (addHideButton.value == 2) { | ||
| 446 | + setTimeout(() => { | ||
| 447 | + let getDom1 = document.getElementById('1') as HTMLElement; | ||
| 448 | + getDom1.style.display = 'flex'; | ||
| 449 | + }, 500); | ||
| 450 | + } | ||
| 451 | + if (addHideButton.value == 3) { | ||
| 452 | + setTimeout(() => { | ||
| 453 | + let getDom2 = document.getElementById('2') as HTMLElement; | ||
| 454 | + getDom2.style.display = 'flex'; | ||
| 455 | + let getDom21 = document.getElementById('1') as HTMLElement; | ||
| 456 | + getDom21.style.display = 'none'; | ||
| 457 | + }, 500); | ||
| 458 | + } | ||
| 459 | + if (addHideButton.value == 4) { | ||
| 460 | + setTimeout(() => { | ||
| 461 | + let getDom3 = document.getElementById('3') as HTMLElement; | ||
| 462 | + getDom3.style.display = 'flex'; | ||
| 463 | + let getDom31 = document.getElementById('1') as HTMLElement; | ||
| 464 | + getDom31.style.display = 'none'; | ||
| 465 | + let getDom32 = document.getElementById('2') as HTMLElement; | ||
| 466 | + getDom32.style.display = 'none'; | ||
| 467 | + }, 500); | ||
| 468 | + } | ||
| 469 | + if (addHideButton.value == 5) { | ||
| 470 | + setTimeout(() => { | ||
| 471 | + let getDom4 = document.getElementById('4') as HTMLElement; | ||
| 472 | + getDom4.style.display = 'flex'; | ||
| 473 | + let getDom41 = document.getElementById('1') as HTMLElement; | ||
| 474 | + getDom41.style.display = 'none'; | ||
| 475 | + let getDom42 = document.getElementById('2') as HTMLElement; | ||
| 476 | + getDom42.style.display = 'none'; | ||
| 477 | + let getDom43 = document.getElementById('3') as HTMLElement; | ||
| 478 | + getDom43.style.display = 'none'; | ||
| 479 | + }, 500); | ||
| 480 | + } | ||
| 481 | + if (addHideButton.value == 6) { | ||
| 482 | + setTimeout(() => { | ||
| 483 | + let getDom5 = document.getElementById('5') as HTMLElement; | ||
| 484 | + getDom5.style.display = 'flex'; | ||
| 485 | + let getDom51 = document.getElementById('1') as HTMLElement; | ||
| 486 | + getDom51.style.display = 'none'; | ||
| 487 | + let getDom52 = document.getElementById('2') as HTMLElement; | ||
| 488 | + getDom52.style.display = 'none'; | ||
| 489 | + let getDom53 = document.getElementById('3') as HTMLElement; | ||
| 490 | + getDom53.style.display = 'none'; | ||
| 491 | + let getDom54 = document.getElementById('4') as HTMLElement; | ||
| 492 | + getDom54.style.display = 'none'; | ||
| 493 | + }, 500); | ||
| 494 | + } | ||
| 495 | + if (addHideButton.value == 7) { | ||
| 496 | + setTimeout(() => { | ||
| 497 | + let getDom7 = document.getElementById('6') as HTMLElement; | ||
| 498 | + getDom7.style.display = 'flex'; | ||
| 499 | + let getDom71 = document.getElementById('1') as HTMLElement; | ||
| 500 | + getDom71.style.display = 'none'; | ||
| 501 | + let getDom72 = document.getElementById('2') as HTMLElement; | ||
| 502 | + getDom72.style.display = 'none'; | ||
| 503 | + let getDom73 = document.getElementById('3') as HTMLElement; | ||
| 504 | + getDom73.style.display = 'none'; | ||
| 505 | + let getDom74 = document.getElementById('4') as HTMLElement; | ||
| 506 | + getDom74.style.display = 'none'; | ||
| 507 | + let getDom75 = document.getElementById('5') as HTMLElement; | ||
| 508 | + getDom75.style.display = 'none'; | ||
| 509 | + }, 500); | ||
| 510 | + } | ||
| 511 | + if (addHideButton.value == 8) { | ||
| 512 | + setTimeout(() => { | ||
| 513 | + let getDom8 = document.getElementById('7') as HTMLElement; | ||
| 514 | + getDom8.style.display = 'flex'; | ||
| 515 | + let getDom81 = document.getElementById('1') as HTMLElement; | ||
| 516 | + getDom81.style.display = 'none'; | ||
| 517 | + let getDom82 = document.getElementById('2') as HTMLElement; | ||
| 518 | + getDom82.style.display = 'none'; | ||
| 519 | + let getDom83 = document.getElementById('3') as HTMLElement; | ||
| 520 | + getDom83.style.display = 'none'; | ||
| 521 | + let getDom84 = document.getElementById('4') as HTMLElement; | ||
| 522 | + getDom84.style.display = 'none'; | ||
| 523 | + let getDom85 = document.getElementById('5') as HTMLElement; | ||
| 524 | + getDom85.style.display = 'none'; | ||
| 525 | + let getDom86 = document.getElementById('6') as HTMLElement; | ||
| 526 | + getDom86.style.display = 'none'; | ||
| 527 | + }, 500); | ||
| 528 | + } | ||
| 368 | removeSchemaByFiled([ | 529 | removeSchemaByFiled([ |
| 369 | `kong${field}`, | 530 | `kong${field}`, |
| 370 | `tiggerEvent${field}`, | 531 | `tiggerEvent${field}`, |
| @@ -382,6 +543,8 @@ | @@ -382,6 +543,8 @@ | ||
| 382 | n.value--; | 543 | n.value--; |
| 383 | } | 544 | } |
| 384 | return { | 545 | return { |
| 546 | + addClearGetAddPushValueDataArrayIsEmpty, | ||
| 547 | + clearAddTriggerStatusFunc, | ||
| 385 | addHideButtonTemp, | 548 | addHideButtonTemp, |
| 386 | addHideButton, | 549 | addHideButton, |
| 387 | editSelectDevice, | 550 | editSelectDevice, |
| 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,27 @@ | @@ -8,9 +8,27 @@ | ||
| 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 | ||
| 13 | + @eGetAddPushValueData="getAddPushValueDataValueFunc" | ||
| 14 | + ref="getTriggerChildData" | ||
| 15 | + :deviceInfo="getDeviceInfo" | ||
| 16 | + /> | ||
| 17 | + </div> | ||
| 18 | + <div> | ||
| 19 | + <AddConditiForm | ||
| 20 | + @eDoConditionGetAddPushValueData="getAddDoconditionPushValueDataValueFunc" | ||
| 21 | + ref="getConditionChildData" | ||
| 22 | + :deviceInfo1="getDeviceInfo1" | ||
| 23 | + /> | ||
| 24 | + </div> | ||
| 25 | + <div> | ||
| 26 | + <AddActionForm | ||
| 27 | + @eDoactionGetAddPushValueData="getAddDoActionPushValueDataValueFunc" | ||
| 28 | + ref="getChildData" | ||
| 29 | + :deviceInfo2="getDeviceInfo2" | ||
| 30 | + /> | ||
| 31 | + </div> | ||
| 14 | </BasicDrawer> | 32 | </BasicDrawer> |
| 15 | </template> | 33 | </template> |
| 16 | <script lang="ts"> | 34 | <script lang="ts"> |
| @@ -31,7 +49,7 @@ | @@ -31,7 +49,7 @@ | ||
| 31 | export default defineComponent({ | 49 | export default defineComponent({ |
| 32 | name: 'ConfigDrawer', | 50 | name: 'ConfigDrawer', |
| 33 | components: { BasicDrawer, BasicForm, AddTriggerForm, AddActionForm, AddConditiForm }, | 51 | components: { BasicDrawer, BasicForm, AddTriggerForm, AddActionForm, AddConditiForm }, |
| 34 | - emits: ['success', 'register'], | 52 | + emits: ['success', 'register', 'registerForm'], |
| 35 | setup(_, { emit }) { | 53 | setup(_, { emit }) { |
| 36 | const { proxy } = getCurrentInstance(); | 54 | const { proxy } = getCurrentInstance(); |
| 37 | const getChildData = ref(null); | 55 | const getChildData = ref(null); |
| @@ -45,18 +63,23 @@ | @@ -45,18 +63,23 @@ | ||
| 45 | let getAllFormData: any = reactive({}); | 63 | let getAllFormData: any = reactive({}); |
| 46 | let getValuesFormData: any = reactive({}); | 64 | let getValuesFormData: any = reactive({}); |
| 47 | let getId = ref(''); | 65 | let getId = ref(''); |
| 66 | + let getTenantId = ref(''); | ||
| 48 | let getDeviceInfo = ref(null); | 67 | let getDeviceInfo = ref(null); |
| 49 | let getDeviceInfo1 = ref(null); | 68 | let getDeviceInfo1 = ref(null); |
| 50 | let getDeviceInfo2 = ref(null); | 69 | let getDeviceInfo2 = ref(null); |
| 70 | + const isCountT = ref(null); | ||
| 71 | + const isAddTriggerT: any = ref([]); | ||
| 72 | + const isCountD = ref(null); | ||
| 73 | + const isAddActionD: any = ref([]); | ||
| 74 | + const isCountC = ref(null); | ||
| 75 | + const isAddConditionD: any = ref([]); | ||
| 51 | 76 | ||
| 52 | - const [ | ||
| 53 | - registerForm, | ||
| 54 | - { resetFields, setFieldsValue, validateFields, getFieldsValue, updateSchema }, | ||
| 55 | - ] = useForm({ | ||
| 56 | - labelWidth: 120, | ||
| 57 | - schemas: formSchema, | ||
| 58 | - showActionButtonGroup: false, | ||
| 59 | - }); | 77 | + const [registerForm, { resetFields, setFieldsValue, validateFields, getFieldsValue }] = |
| 78 | + useForm({ | ||
| 79 | + labelWidth: 120, | ||
| 80 | + schemas: formSchema, | ||
| 81 | + showActionButtonGroup: false, | ||
| 82 | + }); | ||
| 60 | 83 | ||
| 61 | watch(getData, (newV) => { | 84 | watch(getData, (newV) => { |
| 62 | getDeviceInfo.value = newV; | 85 | getDeviceInfo.value = newV; |
| @@ -65,12 +88,21 @@ | @@ -65,12 +88,21 @@ | ||
| 65 | }); | 88 | }); |
| 66 | 89 | ||
| 67 | const [registerDrawer, { setDrawerProps, closeDrawer }] = useDrawerInner(async (data) => { | 90 | const [registerDrawer, { setDrawerProps, closeDrawer }] = useDrawerInner(async (data) => { |
| 68 | - console.log(data); | ||
| 69 | await resetFields(); | 91 | await resetFields(); |
| 70 | setDrawerProps({ confirmLoading: false }); | 92 | setDrawerProps({ confirmLoading: false }); |
| 71 | isUpdate.value = !!data?.isUpdate; | 93 | isUpdate.value = !!data?.isUpdate; |
| 72 | 94 | ||
| 73 | if (!unref(isUpdate)) { | 95 | if (!unref(isUpdate)) { |
| 96 | + triggersArray.length = 0; | ||
| 97 | + doConditionsArray.length = 0; | ||
| 98 | + doActionsArray.length = 0; | ||
| 99 | + isAddTriggerT.value.length = 0; | ||
| 100 | + | ||
| 101 | + isAddActionD.value.length = 0; | ||
| 102 | + | ||
| 103 | + isAddConditionD.value.length = 0; | ||
| 104 | + proxy.$refs.getTriggerChildData.addClearGetAddPushValueDataArrayIsEmpty(); | ||
| 105 | + proxy.$refs.getTriggerChildData.clearAddTriggerStatusFunc(); | ||
| 74 | proxy.$refs.getTriggerChildData.clearGetPushValueDataEmpty(); | 106 | proxy.$refs.getTriggerChildData.clearGetPushValueDataEmpty(); |
| 75 | proxy.$refs.getTriggerChildData.clearSelectDevice(); | 107 | proxy.$refs.getTriggerChildData.clearSelectDevice(); |
| 76 | proxy.$refs.getChildData.clearSelectDevice(); | 108 | proxy.$refs.getChildData.clearSelectDevice(); |
| @@ -81,7 +113,9 @@ | @@ -81,7 +113,9 @@ | ||
| 81 | } | 113 | } |
| 82 | //编辑 | 114 | //编辑 |
| 83 | if (unref(isUpdate)) { | 115 | if (unref(isUpdate)) { |
| 116 | + console.log(data); | ||
| 84 | getId.value = data.record.id; | 117 | getId.value = data.record.id; |
| 118 | + getTenantId.value = data.record.tenantId; | ||
| 85 | await setFieldsValue({ | 119 | await setFieldsValue({ |
| 86 | ...data.record, | 120 | ...data.record, |
| 87 | }); | 121 | }); |
| @@ -93,21 +127,23 @@ | @@ -93,21 +127,23 @@ | ||
| 93 | organizationId: data.record.organizationId, | 127 | organizationId: data.record.organizationId, |
| 94 | }); | 128 | }); |
| 95 | newMap = options.items.map((m) => { | 129 | newMap = options.items.map((m) => { |
| 96 | - newTwoFilterMap = data.record?.triggers.map((m1) => { | ||
| 97 | - if (m.id == m1.deviceId) { | 130 | + try { |
| 131 | + newTwoFilterMap = data.record?.triggers.map((m1) => { | ||
| 132 | + if (m.id == m1.deviceId) { | ||
| 133 | + return { | ||
| 134 | + value: m.id, | ||
| 135 | + label: m.name, | ||
| 136 | + }; | ||
| 137 | + } | ||
| 138 | + }); | ||
| 139 | + | ||
| 140 | + if (m.id == data.record?.triggers[0].deviceId) { | ||
| 98 | return { | 141 | return { |
| 99 | value: m.id, | 142 | value: m.id, |
| 100 | label: m.name, | 143 | label: m.name, |
| 101 | }; | 144 | }; |
| 102 | } | 145 | } |
| 103 | - }); | ||
| 104 | - | ||
| 105 | - if (m.id == data.record?.triggers[0].deviceId) { | ||
| 106 | - return { | ||
| 107 | - value: m.id, | ||
| 108 | - label: m.name, | ||
| 109 | - }; | ||
| 110 | - } | 146 | + } catch (e) {} |
| 111 | }); | 147 | }); |
| 112 | newFilterMap = newMap.filter((f) => f !== undefined); | 148 | newFilterMap = newMap.filter((f) => f !== undefined); |
| 113 | newFilterTwoFilterMap = newTwoFilterMap.filter((f) => f !== undefined); | 149 | newFilterTwoFilterMap = newTwoFilterMap.filter((f) => f !== undefined); |
| @@ -148,22 +184,55 @@ | @@ -148,22 +184,55 @@ | ||
| 148 | } | 184 | } |
| 149 | }); | 185 | }); |
| 150 | const getTitle = computed(() => (!unref(isUpdate) ? '新增场景联动' : '编辑场景联动')); | 186 | const getTitle = computed(() => (!unref(isUpdate) ? '新增场景联动' : '编辑场景联动')); |
| 187 | + const getAddPushValueDataValueFunc = (v) => { | ||
| 188 | + if (v.count == 2) { | ||
| 189 | + isCountT.value = v.count; | ||
| 190 | + isAddTriggerT.value = v.data; | ||
| 191 | + } | ||
| 192 | + }; | ||
| 193 | + const getAddDoActionPushValueDataValueFunc = (v) => { | ||
| 194 | + if (v.count == 2) { | ||
| 195 | + isCountD.value = v.count; | ||
| 196 | + isAddActionD.value = v.data; | ||
| 197 | + } | ||
| 198 | + }; | ||
| 199 | + const getAddDoconditionPushValueDataValueFunc = (v) => { | ||
| 200 | + if (v.count == 2) { | ||
| 201 | + isCountC.value = v.count; | ||
| 202 | + isAddConditionD.value = v.data; | ||
| 203 | + } | ||
| 204 | + }; | ||
| 151 | 205 | ||
| 152 | async function handleSubmit() { | 206 | async function handleSubmit() { |
| 153 | if (!unref(isUpdate)) { | 207 | if (!unref(isUpdate)) { |
| 208 | + triggersArray.length = 0; | ||
| 209 | + doConditionsArray.length = 0; | ||
| 210 | + doActionsArray.length = 0; | ||
| 154 | let res = validateFields(); | 211 | let res = validateFields(); |
| 155 | if (!res) return; | 212 | if (!res) return; |
| 156 | - let getChildValues = proxy.$refs.getChildData.getAllFields(); | ||
| 157 | let getTriggerChildValues = proxy.$refs.getTriggerChildData.getAllFields(); | 213 | let getTriggerChildValues = proxy.$refs.getTriggerChildData.getAllFields(); |
| 214 | + if (getTriggerChildValues.count === 1) { | ||
| 215 | + triggersArray.push(getTriggerChildValues.data); | ||
| 216 | + } | ||
| 158 | let getconditionChildValues = proxy.$refs.getConditionChildData.getAllFields(); | 217 | let getconditionChildValues = proxy.$refs.getConditionChildData.getAllFields(); |
| 159 | - doActionsArray.push(getChildValues); | ||
| 160 | - triggersArray.push(getTriggerChildValues); | ||
| 161 | - doConditionsArray.push(getconditionChildValues); | 218 | + if (getconditionChildValues.count === 1) { |
| 219 | + doConditionsArray.push(getconditionChildValues.data); | ||
| 220 | + } | ||
| 221 | + let getChildValues = proxy.$refs.getChildData.getAllFields(); | ||
| 222 | + if (getChildValues.count === 1) { | ||
| 223 | + doActionsArray.push(getChildValues.data); | ||
| 224 | + } | ||
| 225 | + | ||
| 162 | getValuesFormData = getFieldsValue(); | 226 | getValuesFormData = getFieldsValue(); |
| 163 | Object.assign(getAllFormData, getValuesFormData); | 227 | Object.assign(getAllFormData, getValuesFormData); |
| 164 | - getAllFormData.triggers = triggersArray; | ||
| 165 | - getAllFormData.doConditions = doConditionsArray; | ||
| 166 | - getAllFormData.doActions = doActionsArray; | 228 | + getAllFormData.triggers = |
| 229 | + isCountT.value == 2 ? isAddTriggerT.value.concat(triggersArray) : triggersArray; | ||
| 230 | + getAllFormData.doConditions = | ||
| 231 | + isCountC.value == 2 | ||
| 232 | + ? isAddConditionD.value.concat(doConditionsArray) | ||
| 233 | + : doConditionsArray; | ||
| 234 | + getAllFormData.doActions = | ||
| 235 | + isCountD.value == 2 ? isAddActionD.value.concat(doActionsArray) : doActionsArray; | ||
| 167 | //所有的表单值 | 236 | //所有的表单值 |
| 168 | await screenLinkPageAddApi(getAllFormData); | 237 | await screenLinkPageAddApi(getAllFormData); |
| 169 | createMessage.success('场景联动新增成功'); | 238 | createMessage.success('场景联动新增成功'); |
| @@ -171,18 +240,34 @@ | @@ -171,18 +240,34 @@ | ||
| 171 | emit('success'); | 240 | emit('success'); |
| 172 | } | 241 | } |
| 173 | if (unref(isUpdate)) { | 242 | if (unref(isUpdate)) { |
| 174 | - getValuesFormData = getFieldsValue(); | ||
| 175 | - let getChildValues = proxy.$refs.getChildData.getAllFields(); | 243 | + triggersArray = []; |
| 244 | + doConditionsArray = []; | ||
| 245 | + doActionsArray = []; | ||
| 176 | let getTriggerChildValues = proxy.$refs.getTriggerChildData.getAllFields(); | 246 | let getTriggerChildValues = proxy.$refs.getTriggerChildData.getAllFields(); |
| 247 | + if (getTriggerChildValues.count === 1) { | ||
| 248 | + triggersArray.push(getTriggerChildValues.data); | ||
| 249 | + } | ||
| 177 | let getconditionChildValues = proxy.$refs.getConditionChildData.getAllFields(); | 250 | let getconditionChildValues = proxy.$refs.getConditionChildData.getAllFields(); |
| 178 | - doActionsArray.push(getChildValues); | ||
| 179 | - triggersArray.push(getTriggerChildValues); | ||
| 180 | - doConditionsArray.push(getconditionChildValues); | 251 | + if (getconditionChildValues.count === 1) { |
| 252 | + doConditionsArray.push(getconditionChildValues.data); | ||
| 253 | + } | ||
| 254 | + let getChildValues = proxy.$refs.getChildData.getAllFields(); | ||
| 255 | + if (getChildValues.count === 1) { | ||
| 256 | + doActionsArray.push(getChildValues.data); | ||
| 257 | + } | ||
| 258 | + getValuesFormData = getFieldsValue(); | ||
| 259 | + | ||
| 181 | getValuesFormData.id = getId.value; | 260 | getValuesFormData.id = getId.value; |
| 261 | + getValuesFormData.tenantId = getTenantId.value; | ||
| 182 | Object.assign(getAllFormData, getValuesFormData); | 262 | Object.assign(getAllFormData, getValuesFormData); |
| 183 | - getAllFormData.triggers = triggersArray; | ||
| 184 | - getAllFormData.doConditions = doConditionsArray; | ||
| 185 | - getAllFormData.doActions = doActionsArray; | 263 | + getAllFormData.triggers = |
| 264 | + isCountT.value == 2 ? isAddTriggerT.value.concat(triggersArray) : triggersArray; | ||
| 265 | + getAllFormData.doConditions = | ||
| 266 | + isCountC.value == 2 | ||
| 267 | + ? isAddConditionD.value.concat(doConditionsArray) | ||
| 268 | + : doConditionsArray; | ||
| 269 | + getAllFormData.doActions = | ||
| 270 | + isCountD.value == 2 ? isAddActionD.value.concat(doActionsArray) : doActionsArray; | ||
| 186 | await screenLinkPageUpdateApi(getAllFormData); | 271 | await screenLinkPageUpdateApi(getAllFormData); |
| 187 | createMessage.success('场景联动编辑成功'); | 272 | createMessage.success('场景联动编辑成功'); |
| 188 | closeDrawer(); | 273 | closeDrawer(); |
| @@ -190,6 +275,9 @@ | @@ -190,6 +275,9 @@ | ||
| 190 | } | 275 | } |
| 191 | } | 276 | } |
| 192 | return { | 277 | return { |
| 278 | + getAddDoconditionPushValueDataValueFunc, | ||
| 279 | + getAddDoActionPushValueDataValueFunc, | ||
| 280 | + getAddPushValueDataValueFunc, | ||
| 193 | getConditionChildData, | 281 | getConditionChildData, |
| 194 | getTriggerChildData, | 282 | getTriggerChildData, |
| 195 | getChildData, | 283 | getChildData, |
| @@ -142,7 +142,7 @@ | @@ -142,7 +142,7 @@ | ||
| 142 | document.createElement('link')) as HTMLLinkElement; | 142 | document.createElement('link')) as HTMLLinkElement; |
| 143 | link.type = 'image/x-icon'; | 143 | link.type = 'image/x-icon'; |
| 144 | link.rel = 'shortcut icon'; | 144 | link.rel = 'shortcut icon'; |
| 145 | - link.href = res.icon ?? '/public/favicon.ico'; | 145 | + link.href = res.icon ?? '/favicon.ico'; |
| 146 | document.getElementsByTagName('head')[0].appendChild(link); | 146 | document.getElementsByTagName('head')[0].appendChild(link); |
| 147 | } | 147 | } |
| 148 | } catch (error: any) { | 148 | } catch (error: any) { |
| @@ -68,23 +68,11 @@ export const searchFormSchema: FormSchema[] = [ | @@ -68,23 +68,11 @@ export const searchFormSchema: FormSchema[] = [ | ||
| 68 | label: '姓名', | 68 | label: '姓名', |
| 69 | component: 'Input', | 69 | component: 'Input', |
| 70 | colProps: { span: 8 }, | 70 | colProps: { span: 8 }, |
| 71 | + required: true, | ||
| 71 | componentProps: { | 72 | componentProps: { |
| 72 | maxLength: 255, | 73 | maxLength: 255, |
| 73 | placeholder: '请输入姓名', | 74 | placeholder: '请输入姓名', |
| 74 | }, | 75 | }, |
| 75 | - dynamicRules: () => { | ||
| 76 | - return [ | ||
| 77 | - { | ||
| 78 | - required: false, | ||
| 79 | - validator: (_, value) => { | ||
| 80 | - if (String(value).length > 255) { | ||
| 81 | - return Promise.reject('字数不超过255个字'); | ||
| 82 | - } | ||
| 83 | - return Promise.resolve(); | ||
| 84 | - }, | ||
| 85 | - }, | ||
| 86 | - ]; | ||
| 87 | - }, | ||
| 88 | }, | 76 | }, |
| 89 | ]; | 77 | ]; |
| 90 | 78 |
| @@ -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 | { |
| @@ -94,7 +94,6 @@ | @@ -94,7 +94,6 @@ | ||
| 94 | await updateSchema({ field: 'title', componentProps: { disabled: false } }); | 94 | await updateSchema({ field: 'title', componentProps: { disabled: false } }); |
| 95 | //如果是编辑操作,设置页面数据 | 95 | //如果是编辑操作,设置页面数据 |
| 96 | if (unref(isUpdate)) { | 96 | if (unref(isUpdate)) { |
| 97 | - // console.log(data.record); | ||
| 98 | getTenantRoles(data.record.tenantId).then((result) => { | 97 | getTenantRoles(data.record.tenantId).then((result) => { |
| 99 | Reflect.set(data.record, 'roleIds', result); | 98 | Reflect.set(data.record, 'roleIds', result); |
| 100 | //为表单赋值 | 99 | //为表单赋值 |
| @@ -136,7 +136,6 @@ | @@ -136,7 +136,6 @@ | ||
| 136 | previewVisible.value = false; | 136 | previewVisible.value = false; |
| 137 | }; | 137 | }; |
| 138 | const handlePreview = async (file: FileItem) => { | 138 | const handlePreview = async (file: FileItem) => { |
| 139 | - console.log(file); | ||
| 140 | if (!file.url && !file.preview) { | 139 | if (!file.url && !file.preview) { |
| 141 | file.preview = (await getBase64(file.originFileObj)) as string; | 140 | file.preview = (await getBase64(file.originFileObj)) as string; |
| 142 | } | 141 | } |
| @@ -209,7 +208,6 @@ | @@ -209,7 +208,6 @@ | ||
| 209 | status: 'done', | 208 | status: 'done', |
| 210 | url: response.fileStaticUri, | 209 | url: response.fileStaticUri, |
| 211 | }); | 210 | }); |
| 212 | - console.log('改变前', fileList.value); | ||
| 213 | const fileArr = fileList.value.filter((item) => { | 211 | const fileArr = fileList.value.filter((item) => { |
| 214 | return item.percent !== 0; | 212 | return item.percent !== 0; |
| 215 | }); | 213 | }); |
| @@ -232,7 +230,6 @@ | @@ -232,7 +230,6 @@ | ||
| 232 | 230 | ||
| 233 | const handleUpdateInfo = async () => { | 231 | const handleUpdateInfo = async () => { |
| 234 | try { | 232 | try { |
| 235 | - console.log(fileList.value); | ||
| 236 | const fieldValue = getFieldsValue(); | 233 | const fieldValue = getFieldsValue(); |
| 237 | // 做换字段 | 234 | // 做换字段 |
| 238 | const homeSwiper = fileList.value.map((item) => item.url); | 235 | const homeSwiper = fileList.value.map((item) => item.url); |
| @@ -148,7 +148,6 @@ | @@ -148,7 +148,6 @@ | ||
| 148 | roleType: RoleEnum.TENANT_ADMIN, | 148 | roleType: RoleEnum.TENANT_ADMIN, |
| 149 | menu: allCheckedKeys.value as string[], | 149 | menu: allCheckedKeys.value as string[], |
| 150 | }; | 150 | }; |
| 151 | - console.log(req, '请求参数'); | ||
| 152 | await saveOrUpdateRoleInfoWithMenu(req); | 151 | await saveOrUpdateRoleInfoWithMenu(req); |
| 153 | closeDrawer(); | 152 | closeDrawer(); |
| 154 | emit('success'); | 153 | emit('success'); |
| @@ -85,7 +85,6 @@ | @@ -85,7 +85,6 @@ | ||
| 85 | } | 85 | } |
| 86 | async function handleDelete(record: Recordable) { | 86 | async function handleDelete(record: Recordable) { |
| 87 | let ids = record.id.id; | 87 | let ids = record.id.id; |
| 88 | - console.log(record); | ||
| 89 | await deleteTenantProfileApi(ids); | 88 | await deleteTenantProfileApi(ids); |
| 90 | createMessage.success('删除成功'); | 89 | createMessage.success('删除成功'); |
| 91 | reload(); | 90 | reload(); |