Commit fa515ee3b12f35a13d262a795dc606e811014a69
1 parent
f6dece6c
fix:修复账号管理手机号编辑问题,fix:修改场景联动部分问题,主要是修改一下数据收集
Showing
19 changed files
with
209 additions
and
89 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
renamed from
src/assets/images/shanchu.png
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 | }); |
@@ -175,7 +175,6 @@ | @@ -175,7 +175,6 @@ | ||
175 | 175 | ||
176 | const [registerModal, { closeModal }] = useModalInner(async (data) => { | 176 | const [registerModal, { closeModal }] = useModalInner(async (data) => { |
177 | refreshCacheGetData(); | 177 | refreshCacheGetData(); |
178 | - console.log(updataPersonlData.value); | ||
179 | try { | 178 | try { |
180 | if (updataPersonlData.value != null) { | 179 | if (updataPersonlData.value != null) { |
181 | (peresonalPic.value = updataPersonlData.value.avatar), | 180 | (peresonalPic.value = updataPersonlData.value.avatar), |
@@ -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 | } |
@@ -254,13 +254,13 @@ | @@ -254,13 +254,13 @@ | ||
254 | .noticeTitle:hover { | 254 | .noticeTitle:hover { |
255 | border-bottom: 1px solid #ccc; | 255 | border-bottom: 1px solid #ccc; |
256 | } | 256 | } |
257 | - :deep().ant-anchor-link-active > .ant-anchor-link-title { | 257 | + :deep.ant-anchor-link-active > .ant-anchor-link-title { |
258 | color: #666; | 258 | color: #666; |
259 | } | 259 | } |
260 | - :deep().ant-pagination-prev { | 260 | + :deep.ant-pagination-prev { |
261 | display: none; | 261 | display: none; |
262 | } | 262 | } |
263 | - :deep().ant-pagination-next { | 263 | + :deep.ant-pagination-next { |
264 | display: none; | 264 | display: none; |
265 | } | 265 | } |
266 | </style> | 266 | </style> |
@@ -8,7 +8,7 @@ | @@ -8,7 +8,7 @@ | ||
8 | style="cursor: pointer" | 8 | style="cursor: pointer" |
9 | @click="deleteAlarmRule(index)" | 9 | @click="deleteAlarmRule(index)" |
10 | alt="移除" | 10 | alt="移除" |
11 | - src="../../../../assets/images/shanchu.png" | 11 | + src="../../../../assets/images/delete.png" |
12 | /> | 12 | /> |
13 | </div> | 13 | </div> |
14 | </template> | 14 | </template> |
@@ -286,7 +286,6 @@ | @@ -286,7 +286,6 @@ | ||
286 | id: Date.now() + Math.random() + '', | 286 | id: Date.now() + Math.random() + '', |
287 | alarmType: '', | 287 | alarmType: '', |
288 | createRules: {}, | 288 | createRules: {}, |
289 | - | ||
290 | propagate: false, | 289 | propagate: false, |
291 | propagateRelationTypes: [''], | 290 | propagateRelationTypes: [''], |
292 | }, | 291 | }, |
@@ -46,9 +46,10 @@ | @@ -46,9 +46,10 @@ | ||
46 | components: { CollapseContainer, BasicForm, [Input.name]: Input, Button }, | 46 | components: { CollapseContainer, BasicForm, [Input.name]: Input, Button }, |
47 | // eslint-disable-next-line vue/require-prop-types | 47 | // eslint-disable-next-line vue/require-prop-types |
48 | props: ['deviceInfo1'], | 48 | props: ['deviceInfo1'], |
49 | - setup(props) { | ||
50 | - const getValueData: any = ref({}); | 49 | + emits: ['eDoConditionGetAddPushValueData'], |
50 | + setup(props, { emit }) { | ||
51 | const addHideButton = ref(1); | 51 | const addHideButton = ref(1); |
52 | + const getAddPushValueData: any = ref([]); | ||
52 | 53 | ||
53 | const [ | 54 | const [ |
54 | registerCondition, | 55 | registerCondition, |
@@ -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,12 @@ | @@ -119,6 +121,12 @@ | ||
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 | + }); | ||
122 | addHideButton.value++; | 130 | addHideButton.value++; |
123 | if (addHideButton.value == 3) { | 131 | if (addHideButton.value == 3) { |
124 | setTimeout(() => { | 132 | setTimeout(() => { |
@@ -46,10 +46,11 @@ | @@ -46,10 +46,11 @@ | ||
46 | components: { CollapseContainer, BasicForm, [Input.name]: Input, Button }, | 46 | components: { CollapseContainer, BasicForm, [Input.name]: Input, Button }, |
47 | // eslint-disable-next-line vue/require-prop-types | 47 | // eslint-disable-next-line vue/require-prop-types |
48 | props: ['deviceInfo2'], | 48 | props: ['deviceInfo2'], |
49 | - setup(props) { | 49 | + emits: ['eDoactionGetAddPushValueData'], |
50 | + setup(props, { emit }) { | ||
50 | const addHideButton = ref(1); | 51 | const addHideButton = ref(1); |
52 | + const getAddPushValueData: any = ref([]); | ||
51 | 53 | ||
52 | - const getValueData: any = ref({}); | ||
53 | const [ | 54 | const [ |
54 | registerAction, | 55 | registerAction, |
55 | { | 56 | { |
@@ -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 | } |
@@ -118,6 +120,13 @@ | @@ -118,6 +120,13 @@ | ||
118 | }; | 120 | }; |
119 | const n = ref(1); | 121 | const n = ref(1); |
120 | 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 | + }); | ||
121 | addHideButton.value++; | 130 | addHideButton.value++; |
122 | if (addHideButton.value == 3) { | 131 | if (addHideButton.value == 3) { |
123 | setTimeout(() => { | 132 | setTimeout(() => { |
@@ -59,11 +59,12 @@ | @@ -59,11 +59,12 @@ | ||
59 | components: { CollapseContainer, BasicForm, [Input.name]: Input, Button }, | 59 | components: { CollapseContainer, BasicForm, [Input.name]: Input, Button }, |
60 | // eslint-disable-next-line vue/require-prop-types | 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 | { |
@@ -124,21 +125,33 @@ | @@ -124,21 +125,33 @@ | ||
124 | const clearGetPushValueDataEmpty = () => { | 125 | const clearGetPushValueDataEmpty = () => { |
125 | getPushValueData.value.length = 0; | 126 | getPushValueData.value.length = 0; |
126 | }; | 127 | }; |
127 | - function getAllFields(getV) { | ||
128 | - const values = getFieldsValue(); | ||
129 | - getValueData.value = values; | ||
130 | - getV = getValueData.value; | ||
131 | - getPushValueData.value.push(getV); | ||
132 | - console.log(getPushValueData.value); | 128 | + |
129 | + const getAllFields = (getV: any) => { | ||
130 | + getV = { | ||
131 | + data: getFieldsValue(), | ||
132 | + count: 1, | ||
133 | + }; | ||
133 | return getV; | 134 | return getV; |
134 | - } | 135 | + }; |
135 | async function funcResetFields() { | 136 | async function funcResetFields() { |
136 | await resetFields(); | 137 | await resetFields(); |
137 | } | 138 | } |
138 | const addString: any = ref('tiggerEvent1') || ref('tiggerEvent2') || ref('tiggerEvent3'); | 139 | const addString: any = ref('tiggerEvent1') || ref('tiggerEvent2') || ref('tiggerEvent3'); |
139 | 140 | ||
140 | const n = ref(1); | 141 | const n = ref(1); |
142 | + const clearAddTriggerStatusFunc = () => { | ||
143 | + // addHideButton.value = 1; | ||
144 | + }; | ||
145 | + const addClearGetAddPushValueDataArrayIsEmpty = () => { | ||
146 | + getAddPushValueData.value = []; | ||
147 | + }; | ||
141 | 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 | + }); | ||
142 | addHideButton.value++; | 155 | addHideButton.value++; |
143 | addHideButtonTemp.value = addHideButton.value; | 156 | addHideButtonTemp.value = addHideButton.value; |
144 | addHideButtonTemp.value -= 2; | 157 | addHideButtonTemp.value -= 2; |
@@ -530,6 +543,8 @@ | @@ -530,6 +543,8 @@ | ||
530 | n.value--; | 543 | n.value--; |
531 | } | 544 | } |
532 | return { | 545 | return { |
546 | + addClearGetAddPushValueDataArrayIsEmpty, | ||
547 | + clearAddTriggerStatusFunc, | ||
533 | addHideButtonTemp, | 548 | addHideButtonTemp, |
534 | addHideButton, | 549 | addHideButton, |
535 | editSelectDevice, | 550 | editSelectDevice, |
@@ -9,13 +9,25 @@ | @@ -9,13 +9,25 @@ | ||
9 | > | 9 | > |
10 | <BasicForm @register="registerForm" /> | 10 | <BasicForm @register="registerForm" /> |
11 | <div> | 11 | <div> |
12 | - <AddTriggerForm ref="getTriggerChildData" :deviceInfo="getDeviceInfo" /> | 12 | + <AddTriggerForm |
13 | + @eGetAddPushValueData="getAddPushValueDataValueFunc" | ||
14 | + ref="getTriggerChildData" | ||
15 | + :deviceInfo="getDeviceInfo" | ||
16 | + /> | ||
13 | </div> | 17 | </div> |
14 | <div> | 18 | <div> |
15 | - <AddConditiForm ref="getConditionChildData" :deviceInfo1="getDeviceInfo1" /> | 19 | + <AddConditiForm |
20 | + @eDoConditionGetAddPushValueData="getAddDoconditionPushValueDataValueFunc" | ||
21 | + ref="getConditionChildData" | ||
22 | + :deviceInfo1="getDeviceInfo1" | ||
23 | + /> | ||
16 | </div> | 24 | </div> |
17 | <div> | 25 | <div> |
18 | - <AddActionForm ref="getChildData" :deviceInfo2="getDeviceInfo2" /> | 26 | + <AddActionForm |
27 | + @eDoactionGetAddPushValueData="getAddDoActionPushValueDataValueFunc" | ||
28 | + ref="getChildData" | ||
29 | + :deviceInfo2="getDeviceInfo2" | ||
30 | + /> | ||
19 | </div> | 31 | </div> |
20 | </BasicDrawer> | 32 | </BasicDrawer> |
21 | </template> | 33 | </template> |
@@ -51,9 +63,16 @@ | @@ -51,9 +63,16 @@ | ||
51 | let getAllFormData: any = reactive({}); | 63 | let getAllFormData: any = reactive({}); |
52 | let getValuesFormData: any = reactive({}); | 64 | let getValuesFormData: any = reactive({}); |
53 | let getId = ref(''); | 65 | let getId = ref(''); |
66 | + let getTenantId = ref(''); | ||
54 | let getDeviceInfo = ref(null); | 67 | let getDeviceInfo = ref(null); |
55 | let getDeviceInfo1 = ref(null); | 68 | let getDeviceInfo1 = ref(null); |
56 | 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([]); | ||
57 | 76 | ||
58 | const [registerForm, { resetFields, setFieldsValue, validateFields, getFieldsValue }] = | 77 | const [registerForm, { resetFields, setFieldsValue, validateFields, getFieldsValue }] = |
59 | useForm({ | 78 | useForm({ |
@@ -74,6 +93,16 @@ | @@ -74,6 +93,16 @@ | ||
74 | isUpdate.value = !!data?.isUpdate; | 93 | isUpdate.value = !!data?.isUpdate; |
75 | 94 | ||
76 | 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(); | ||
77 | proxy.$refs.getTriggerChildData.clearGetPushValueDataEmpty(); | 106 | proxy.$refs.getTriggerChildData.clearGetPushValueDataEmpty(); |
78 | proxy.$refs.getTriggerChildData.clearSelectDevice(); | 107 | proxy.$refs.getTriggerChildData.clearSelectDevice(); |
79 | proxy.$refs.getChildData.clearSelectDevice(); | 108 | proxy.$refs.getChildData.clearSelectDevice(); |
@@ -84,7 +113,9 @@ | @@ -84,7 +113,9 @@ | ||
84 | } | 113 | } |
85 | //编辑 | 114 | //编辑 |
86 | if (unref(isUpdate)) { | 115 | if (unref(isUpdate)) { |
116 | + console.log(data); | ||
87 | getId.value = data.record.id; | 117 | getId.value = data.record.id; |
118 | + getTenantId.value = data.record.tenantId; | ||
88 | await setFieldsValue({ | 119 | await setFieldsValue({ |
89 | ...data.record, | 120 | ...data.record, |
90 | }); | 121 | }); |
@@ -96,21 +127,23 @@ | @@ -96,21 +127,23 @@ | ||
96 | organizationId: data.record.organizationId, | 127 | organizationId: data.record.organizationId, |
97 | }); | 128 | }); |
98 | newMap = options.items.map((m) => { | 129 | newMap = options.items.map((m) => { |
99 | - newTwoFilterMap = data.record?.triggers.map((m1) => { | ||
100 | - 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) { | ||
101 | return { | 141 | return { |
102 | value: m.id, | 142 | value: m.id, |
103 | label: m.name, | 143 | label: m.name, |
104 | }; | 144 | }; |
105 | } | 145 | } |
106 | - }); | ||
107 | - | ||
108 | - if (m.id == data.record?.triggers[0].deviceId) { | ||
109 | - return { | ||
110 | - value: m.id, | ||
111 | - label: m.name, | ||
112 | - }; | ||
113 | - } | 146 | + } catch (e) {} |
114 | }); | 147 | }); |
115 | newFilterMap = newMap.filter((f) => f !== undefined); | 148 | newFilterMap = newMap.filter((f) => f !== undefined); |
116 | newFilterTwoFilterMap = newTwoFilterMap.filter((f) => f !== undefined); | 149 | newFilterTwoFilterMap = newTwoFilterMap.filter((f) => f !== undefined); |
@@ -151,22 +184,55 @@ | @@ -151,22 +184,55 @@ | ||
151 | } | 184 | } |
152 | }); | 185 | }); |
153 | 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 | + }; | ||
154 | 205 | ||
155 | async function handleSubmit() { | 206 | async function handleSubmit() { |
156 | if (!unref(isUpdate)) { | 207 | if (!unref(isUpdate)) { |
208 | + triggersArray.length = 0; | ||
209 | + doConditionsArray.length = 0; | ||
210 | + doActionsArray.length = 0; | ||
157 | let res = validateFields(); | 211 | let res = validateFields(); |
158 | if (!res) return; | 212 | if (!res) return; |
159 | - let getChildValues = proxy.$refs.getChildData.getAllFields(); | ||
160 | let getTriggerChildValues = proxy.$refs.getTriggerChildData.getAllFields(); | 213 | let getTriggerChildValues = proxy.$refs.getTriggerChildData.getAllFields(); |
214 | + if (getTriggerChildValues.count === 1) { | ||
215 | + triggersArray.push(getTriggerChildValues.data); | ||
216 | + } | ||
161 | let getconditionChildValues = proxy.$refs.getConditionChildData.getAllFields(); | 217 | let getconditionChildValues = proxy.$refs.getConditionChildData.getAllFields(); |
162 | - doActionsArray.push(getChildValues); | ||
163 | - triggersArray.push(getTriggerChildValues); | ||
164 | - 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 | + | ||
165 | getValuesFormData = getFieldsValue(); | 226 | getValuesFormData = getFieldsValue(); |
166 | Object.assign(getAllFormData, getValuesFormData); | 227 | Object.assign(getAllFormData, getValuesFormData); |
167 | - getAllFormData.triggers = triggersArray; | ||
168 | - getAllFormData.doConditions = doConditionsArray; | ||
169 | - 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; | ||
170 | //所有的表单值 | 236 | //所有的表单值 |
171 | await screenLinkPageAddApi(getAllFormData); | 237 | await screenLinkPageAddApi(getAllFormData); |
172 | createMessage.success('场景联动新增成功'); | 238 | createMessage.success('场景联动新增成功'); |
@@ -174,18 +240,34 @@ | @@ -174,18 +240,34 @@ | ||
174 | emit('success'); | 240 | emit('success'); |
175 | } | 241 | } |
176 | if (unref(isUpdate)) { | 242 | if (unref(isUpdate)) { |
177 | - getValuesFormData = getFieldsValue(); | ||
178 | - let getChildValues = proxy.$refs.getChildData.getAllFields(); | 243 | + triggersArray = []; |
244 | + doConditionsArray = []; | ||
245 | + doActionsArray = []; | ||
179 | let getTriggerChildValues = proxy.$refs.getTriggerChildData.getAllFields(); | 246 | let getTriggerChildValues = proxy.$refs.getTriggerChildData.getAllFields(); |
247 | + if (getTriggerChildValues.count === 1) { | ||
248 | + triggersArray.push(getTriggerChildValues.data); | ||
249 | + } | ||
180 | let getconditionChildValues = proxy.$refs.getConditionChildData.getAllFields(); | 250 | let getconditionChildValues = proxy.$refs.getConditionChildData.getAllFields(); |
181 | - doActionsArray.push(getChildValues); | ||
182 | - triggersArray.push(getTriggerChildValues); | ||
183 | - 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 | + | ||
184 | getValuesFormData.id = getId.value; | 260 | getValuesFormData.id = getId.value; |
261 | + getValuesFormData.tenantId = getTenantId.value; | ||
185 | Object.assign(getAllFormData, getValuesFormData); | 262 | Object.assign(getAllFormData, getValuesFormData); |
186 | - getAllFormData.triggers = triggersArray; | ||
187 | - getAllFormData.doConditions = doConditionsArray; | ||
188 | - 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; | ||
189 | await screenLinkPageUpdateApi(getAllFormData); | 271 | await screenLinkPageUpdateApi(getAllFormData); |
190 | createMessage.success('场景联动编辑成功'); | 272 | createMessage.success('场景联动编辑成功'); |
191 | closeDrawer(); | 273 | closeDrawer(); |
@@ -193,6 +275,9 @@ | @@ -193,6 +275,9 @@ | ||
193 | } | 275 | } |
194 | } | 276 | } |
195 | return { | 277 | return { |
278 | + getAddDoconditionPushValueDataValueFunc, | ||
279 | + getAddDoActionPushValueDataValueFunc, | ||
280 | + getAddPushValueDataValueFunc, | ||
196 | getConditionChildData, | 281 | getConditionChildData, |
197 | getTriggerChildData, | 282 | getTriggerChildData, |
198 | 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) { |
@@ -10,13 +10,14 @@ | @@ -10,13 +10,14 @@ | ||
10 | <BasicForm @register="registerForm"> | 10 | <BasicForm @register="registerForm"> |
11 | <template #organizationId="{ model, field }"> | 11 | <template #organizationId="{ model, field }"> |
12 | <BasicTree | 12 | <BasicTree |
13 | + v-if="organizationTreeData.length" | ||
13 | v-model:value="model[field]" | 14 | v-model:value="model[field]" |
14 | :treeData="organizationTreeData" | 15 | :treeData="organizationTreeData" |
15 | :checked-keys="checkGroup" | 16 | :checked-keys="checkGroup" |
16 | - :defaultExpandAll="true" | 17 | + default-expand-all |
18 | + ref="basicTreeRef" | ||
17 | checkable | 19 | checkable |
18 | toolbar | 20 | toolbar |
19 | - title="所属组织" | ||
20 | /> | 21 | /> |
21 | </template> | 22 | </template> |
22 | </BasicForm> | 23 | </BasicForm> |
@@ -42,8 +43,13 @@ | @@ -42,8 +43,13 @@ | ||
42 | const isUpdate = ref(true); | 43 | const isUpdate = ref(true); |
43 | const rowId = ref(''); | 44 | const rowId = ref(''); |
44 | const organizationTreeData = ref<TreeItem[]>([]); | 45 | const organizationTreeData = ref<TreeItem[]>([]); |
46 | + const basicTreeRef = ref(); | ||
45 | const checkGroup = ref<string[]>([]); | 47 | const checkGroup = ref<string[]>([]); |
46 | - const [registerForm, { setFieldsValue, updateSchema, resetFields, validate }] = useForm({ | 48 | + const olderPhoneNumber = ref(); |
49 | + const [ | ||
50 | + registerForm, | ||
51 | + { setFieldsValue, updateSchema, resetFields, validate, getFieldsValue }, | ||
52 | + ] = useForm({ | ||
47 | labelWidth: 100, | 53 | labelWidth: 100, |
48 | schemas: accountFormSchema, | 54 | schemas: accountFormSchema, |
49 | showActionButtonGroup: false, | 55 | showActionButtonGroup: false, |
@@ -57,7 +63,7 @@ | @@ -57,7 +63,7 @@ | ||
57 | setModalProps({ confirmLoading: false }); | 63 | setModalProps({ confirmLoading: false }); |
58 | isUpdate.value = !!data?.isUpdate; | 64 | isUpdate.value = !!data?.isUpdate; |
59 | const groupListModel = await findCurrentUserGroups(); | 65 | const groupListModel = await findCurrentUserGroups(); |
60 | - if (unref(organizationTreeData).length === 0) { | 66 | + if (!unref(organizationTreeData).length) { |
61 | copyTransTreeFun(groupListModel); | 67 | copyTransTreeFun(groupListModel); |
62 | organizationTreeData.value = groupListModel; | 68 | organizationTreeData.value = groupListModel; |
63 | } | 69 | } |
@@ -65,6 +71,7 @@ | @@ -65,6 +71,7 @@ | ||
65 | if (unref(isUpdate)) { | 71 | if (unref(isUpdate)) { |
66 | rowId.value = data.record.id; | 72 | rowId.value = data.record.id; |
67 | const roleParams = new RoleOrOrganizationParam(rowId.value, true, false); | 73 | const roleParams = new RoleOrOrganizationParam(rowId.value, true, false); |
74 | + olderPhoneNumber.value = data.record.phoneNumber; | ||
68 | findCurrentUserRelation(roleParams).then((result) => { | 75 | findCurrentUserRelation(roleParams).then((result) => { |
69 | Reflect.set(data.record, 'roleIds', result); | 76 | Reflect.set(data.record, 'roleIds', result); |
70 | Reflect.set(data.record, 'password', '******'); | 77 | Reflect.set(data.record, 'password', '******'); |
@@ -85,7 +92,19 @@ | @@ -85,7 +92,19 @@ | ||
85 | async function handleSubmit() { | 92 | async function handleSubmit() { |
86 | try { | 93 | try { |
87 | const { createMessage } = useMessage(); | 94 | const { createMessage } = useMessage(); |
88 | - const values = await validate(); | 95 | + const values = await validate([ |
96 | + 'id', | ||
97 | + 'username', | ||
98 | + 'realName', | ||
99 | + 'password', | ||
100 | + 'roleIds', | ||
101 | + 'email', | ||
102 | + 'accountExpireTime', | ||
103 | + 'enabled', | ||
104 | + 'remark', | ||
105 | + 'organizationIds', | ||
106 | + olderPhoneNumber.value == getFieldsValue().phoneNumber ? '' : 'phoneNumber', | ||
107 | + ]); | ||
89 | values.accountExpireTime = | 108 | values.accountExpireTime = |
90 | typeof values.accountExpireTime != 'undefined' && values.accountExpireTime != null | 109 | typeof values.accountExpireTime != 'undefined' && values.accountExpireTime != null |
91 | ? values.accountExpireTime.format('YYYY-MM-DD HH:mm:ss') | 110 | ? values.accountExpireTime.format('YYYY-MM-DD HH:mm:ss') |
@@ -106,6 +125,7 @@ | @@ -106,6 +125,7 @@ | ||
106 | getTitle, | 125 | getTitle, |
107 | organizationTreeData, | 126 | organizationTreeData, |
108 | checkGroup, | 127 | checkGroup, |
128 | + basicTreeRef, | ||
109 | }; | 129 | }; |
110 | }, | 130 | }, |
111 | }); | 131 | }); |
@@ -66,23 +66,11 @@ export const searchFormSchema: FormSchema[] = [ | @@ -66,23 +66,11 @@ export const searchFormSchema: FormSchema[] = [ | ||
66 | label: '姓名', | 66 | label: '姓名', |
67 | component: 'Input', | 67 | component: 'Input', |
68 | colProps: { span: 8 }, | 68 | colProps: { span: 8 }, |
69 | + required: true, | ||
69 | componentProps: { | 70 | componentProps: { |
70 | maxLength: 255, | 71 | maxLength: 255, |
71 | placeholder: '请输入姓名', | 72 | placeholder: '请输入姓名', |
72 | }, | 73 | }, |
73 | - dynamicRules: () => { | ||
74 | - return [ | ||
75 | - { | ||
76 | - required: false, | ||
77 | - validator: (_, value) => { | ||
78 | - if (String(value).length > 255) { | ||
79 | - return Promise.reject('字数不超过255个字'); | ||
80 | - } | ||
81 | - return Promise.resolve(); | ||
82 | - }, | ||
83 | - }, | ||
84 | - ]; | ||
85 | - }, | ||
86 | }, | 74 | }, |
87 | ]; | 75 | ]; |
88 | 76 |
@@ -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(); |