Commit e307339ed3651e89407483b246a8759fff52e931

Authored by xp.Huang
2 parents 1eab6b97 5e0cf7dc

Merge branch 'f-dev' into 'main'

fix:修改teambition的问题

See merge request huang/yun-teng-iot-front!232
... ... @@ -110,6 +110,7 @@ export const usePermissionStore = defineStore({
110 110 * 否则不是超级管理员-获取对应角色的权限列表
111 111 */
112 112 const codeList = await getPermCode();
  113 + // console.log('codeList', codeList);
113 114 this.setPermCodeList(codeList);
114 115 /**
115 116 * 如果是超级管理员则获取对应权限列表
... ...
... ... @@ -16,7 +16,7 @@
16 16 type="primary"
17 17 color="error"
18 18 @click="handleDeleteOrBatchDelete(null)"
19   - :disabled="hasBatchDelete"
  19 + :disabled="singleStopDeleteStatus || hasBatchDelete"
20 20 >
21 21 批量删除
22 22 </a-button>
... ... @@ -117,6 +117,7 @@
117 117 convertIds: [],
118 118 status: 0,
119 119 });
  120 + const singleStopDeleteStatus = ref(false);
120 121 const disabledStatus1 = ref(true);
121 122 const disabledStatus2 = ref(true);
122 123 const disabledStatus3 = ref(true);
... ... @@ -314,6 +315,7 @@
314 315 setLoading(false);
315 316 reload();
316 317 disabledStatus1.value = true;
  318 + singleStopDeleteStatus.value = true;
317 319 } else {
318 320 createMessage.error('流转配置多项启用失败');
319 321 }
... ... @@ -342,6 +344,7 @@
342 344 handleDisable,
343 345 hasBatchDelete,
344 346 handleDeleteOrBatchDelete,
  347 + singleStopDeleteStatus,
345 348 };
346 349 },
347 350 });
... ...
... ... @@ -212,7 +212,7 @@
212 212 unref(skipUnwrap.triggerItemRefs)[index].isUpdate = true;
213 213 unref(skipUnwrap.triggerItemRefs)[index].alarmScheduleRef.scheduleData =
214 214 trigger.triggerCondition.schedule;
215   - const getAttrKeyOption = trigger?.triggerCondition?.condition?.condition.map(
  215 + const getAttrKeyOption = trigger?.triggerCondition?.condition?.condition?.map(
216 216 (m) => m.key.key
217 217 );
218 218 unref(skipUnwrap.triggerItemRefs)[index].setFieldsFormValueFun({
... ... @@ -287,7 +287,7 @@
287 287 unref(skipUnwrap.conditionItemRefs)[index].isUpdate = true;
288 288 unref(skipUnwrap.conditionItemRefs)[index].alarmScheduleRef.scheduleData =
289 289 condition.triggerCondition.schedule;
290   - const getAttrKeyOption = condition?.triggerCondition?.condition?.condition.map(
  290 + const getAttrKeyOption = condition?.triggerCondition?.condition?.condition?.map(
291 291 (m) => m.key.key
292 292 );
293 293 unref(skipUnwrap.conditionItemRefs)[index].setFieldsFormValueFun({
... ... @@ -521,7 +521,7 @@
521 521 unref(linkAge).map((item) => {
522 522 isOrganizationChange && item.resetFieldsValueFunc();
523 523 item.updateFieldDeviceId(deviceList);
524   - item.updateFieldAttr(watchAttrList);
  524 + // item.updateFieldAttr(watchAttrList);
525 525 });
526 526 }
527 527 function setAlarmConfig(linkAge, isOrganizationChange = false) {
... ...
... ... @@ -123,7 +123,7 @@ export const schemas: FormSchema[] = [
123 123 field: 'prov',
124 124 label: '所在城市',
125 125 required: true,
126   - component: 'Input',
  126 + component: 'Select',
127 127 colProps: {
128 128 span: 24,
129 129 },
... ... @@ -172,7 +172,7 @@ export const schemas: FormSchema[] = [
172 172 field: 'qrcode',
173 173 label: '联系我们',
174 174 required: true,
175   - component: 'Input',
  175 + component: 'Select',
176 176 colProps: {
177 177 span: 24,
178 178 },
... ...
... ... @@ -62,6 +62,7 @@
62 62 @preview="handlePreview"
63 63 :customRequest="customUploadHomeSwiper"
64 64 :before-upload="beforeUploadHomeSwiper"
  65 + @change="handleChange"
65 66 >
66 67 <div v-if="fileList.length < 5">
67 68 <div style="margin-top: 1.875rem">
... ... @@ -147,9 +148,6 @@
147 148 previewImage.value = file.url || file.preview;
148 149 previewVisible.value = true;
149 150 };
150   - const handleChange = ({ fileList: newFileList }: FileInfo) => {
151   - fileList.value = newFileList;
152   - };
153 151
154 152 // logo图片上传
155 153 const logoPic = ref();
... ... @@ -232,6 +230,11 @@
232 230 }
233 231 return isJpgOrPng && isLt2M;
234 232 };
  233 + const handleChange = (info: FileInfo) => {
  234 + if (info.file.status !== 'uploading') {
  235 + fileList.value = info.fileList.filter((f: any) => !f.size);
  236 + }
  237 + };
235 238
236 239 const handleUpdateInfo = async () => {
237 240 try {
... ...
... ... @@ -10,10 +10,10 @@
10 10 <BasicForm @register="registerForm">
11 11 <template #menu>
12 12 <BasicTree
  13 + v-if="treeData.length"
13 14 checkable
14 15 toolbar
15   - defaultExpandAll
16   - v-if="treeData.length"
  16 + autoExpandParent
17 17 ref="treeRef"
18 18 :treeData="treeData"
19 19 :replaceFields="{ title: 'menuName' }"
... ... @@ -69,8 +69,16 @@
69 69 }
70 70 });
71 71 }
  72 + // function lookForAllId(data = [], arr = []) {
  73 + // for (const item of data) {
  74 + // arr.push(item.parentId);
  75 + // if (item.children && item.children.length > 0) lookForAllId(item.children, arr);
  76 + // }
  77 + // return arr;
  78 + // }
72 79 const originMenus = ref();
73 80 const [registerDrawer, { setDrawerProps, closeDrawer }] = useDrawerInner(async (data) => {
  81 + allCheckedKeys.value = [];
74 82 resetFields();
75 83 roleId.value = '';
76 84 // 在打开弹窗时清除所有选择的菜单
... ... @@ -85,6 +93,7 @@
85 93 }
86 94 // 更新
87 95 if (unref(isUpdate)) {
  96 + allCheckedKeys.value = [];
88 97 checked.value = [];
89 98 //通过角色id去获取角色对应的菜单的ids
90 99 roleMenus.value = await getMenusIdsByRoleId(data.record.id);
... ... @@ -107,6 +116,8 @@
107 116 }
108 117 nextTick(() => {
109 118 treeRef.value.setCheckedKeys(checked.value);
  119 + // const expandTreeIds = lookForAllId(treeData.value);
  120 + // treeRef.value.setExpandedKeys(expandTreeIds);
110 121 });
111 122 roleId.value = data.record.id;
112 123 setFieldsValue(data.record);
... ... @@ -127,6 +138,9 @@
127 138 status: values.status,
128 139 menu: allCheckedKeys.value.length ? allCheckedKeys.value : originMenus.value,
129 140 };
  141 + console.log(allCheckedKeys.value);
  142 + if (allCheckedKeys.value.length == 0) return createMessage.error('请勾选权限菜单');
  143 + if (req.menu == undefined) return createMessage.error('请勾选权限菜单');
130 144 saveOrUpdateRoleInfoWithMenu(req).then(() => {
131 145 closeDrawer();
132 146 emit('success');
... ...
... ... @@ -12,6 +12,7 @@
12 12 <BasicTree
13 13 v-if="treeData.length > 0"
14 14 :treeData="treeData"
  15 + autoExpandParent
15 16 :replaceFields="{ title: 'menuName' }"
16 17 :checkedKeys="roleMenus"
17 18 @check="handleCheckClick"
... ... @@ -74,6 +75,7 @@
74 75 const originMenus = ref();
75 76 const [registerDrawer, { setDrawerProps, closeDrawer }] = useDrawerInner(async (data) => {
76 77 setDrawerProps({ confirmLoading: false });
  78 + allCheckedKeys.value = [];
77 79 resetFields();
78 80 roleId.value = '';
79 81 // 在打开弹窗时清除所有选择的菜单
... ... @@ -88,6 +90,7 @@
88 90 }
89 91 // 更新
90 92 if (unref(isUpdate)) {
  93 + allCheckedKeys.value = [];
91 94 checked.value = [];
92 95 //通过角色id去获取角色对应的菜单的ids
93 96 roleMenus.value = await getMenusIdsByRoleId(data.record.id);
... ... @@ -131,6 +134,8 @@
131 134 roleType: RoleEnum.TENANT_ADMIN,
132 135 menu: allCheckedKeys.value.length ? allCheckedKeys.value : originMenus.value,
133 136 };
  137 + if (allCheckedKeys.value.length == 0) return createMessage.error('请勾选权限菜单');
  138 + if (req.menu == undefined) return createMessage.error('请勾选权限菜单');
134 139 saveOrUpdateRoleInfoWithMenu(req).then(() => {
135 140 closeDrawer();
136 141 emit('success');
... ...