hookehuyr

fix 更多属性里面判断按钮文字是否显示修改,按成员选择后,右边区域不应该刷新成初始展示的页面

...@@ -235,7 +235,7 @@ ...@@ -235,7 +235,7 @@
235 <div><el-switch v-model="state.more_attr_data.show" /></div> 235 <div><el-switch v-model="state.more_attr_data.show" /></div>
236 </div> 236 </div>
237 <p class="more-attr-tip">{{ state.more_attr_data.desc }}</p> 237 <p class="more-attr-tip">{{ state.more_attr_data.desc }}</p>
238 - <div v-if="state.more_attr_data.btnText"> 238 + <div v-if="state.more_attr_data.showBtn">
239 <p style="font-size: 14px; font-weight: bold;">按钮文字</p> 239 <p style="font-size: 14px; font-weight: bold;">按钮文字</p>
240 <el-input v-model="state.more_attr_data.btnText" /> 240 <el-input v-model="state.more_attr_data.btnText" />
241 </div> 241 </div>
...@@ -496,6 +496,7 @@ export default { ...@@ -496,6 +496,7 @@ export default {
496 more_attr_data: { 496 more_attr_data: {
497 label: '', 497 label: '',
498 show: false, 498 show: false,
499 + showBtn: true,
499 desc: '', 500 desc: '',
500 btnText: '', 501 btnText: '',
501 }, 502 },
...@@ -828,6 +829,7 @@ export default { ...@@ -828,6 +829,7 @@ export default {
828 state.select_attr_set = true; 829 state.select_attr_set = true;
829 } 830 }
830 state.statusLoading = true; 831 state.statusLoading = true;
832 + state.main_attr_set = true; // 重置更多属性的显示
831 // 833 //
832 axios.get('/admin/?a=flow_node_property&node_code=' + model.id + '&flow_id=' + flow_id) 834 axios.get('/admin/?a=flow_node_property&node_code=' + model.id + '&flow_id=' + flow_id)
833 .then((res: any) => { 835 .then((res: any) => {
...@@ -998,6 +1000,11 @@ export default { ...@@ -998,6 +1000,11 @@ export default {
998 const setMoreAttr = (attr: any, index: any) => { // 打开更多属性细节回调 1000 const setMoreAttr = (attr: any, index: any) => { // 打开更多属性细节回调
999 state.main_attr_set = false; 1001 state.main_attr_set = false;
1000 state.more_attr_data = attr['data'][index]; // 同步数据 1002 state.more_attr_data = attr['data'][index]; // 同步数据
1003 + if (attr.id === 'no-1') { // 如果是审批意见,按钮文字不可以修改
1004 + state.more_attr_data.showBtn = false;
1005 + } else {
1006 + state.more_attr_data.showBtn = true;
1007 + }
1001 } 1008 }
1002 const onConfirmMoreAttr = (item: any) => { // 保存更多属性细节回调 1009 const onConfirmMoreAttr = (item: any) => { // 保存更多属性细节回调
1003 state.main_attr_set = true; 1010 state.main_attr_set = true;
......
1 <!-- 1 <!--
2 * @Date: 2023-11-01 10:18:53 2 * @Date: 2023-11-01 10:18:53
3 * @LastEditors: hookehuyr hookehuyr@gmail.com 3 * @LastEditors: hookehuyr hookehuyr@gmail.com
4 - * @LastEditTime: 2023-11-24 15:12:43 4 + * @LastEditTime: 2023-11-24 16:23:41
5 * @FilePath: /vue-flow-editor/doc/selectUserView.vue 5 * @FilePath: /vue-flow-editor/doc/selectUserView.vue
6 * @Description: 成员列表选择控件 6 * @Description: 成员列表选择控件
7 --> 7 -->
...@@ -53,7 +53,10 @@ ...@@ -53,7 +53,10 @@
53 :id="item.id" 53 :id="item.id"
54 @click="handleTabClick(item, $event, index)" 54 @click="handleTabClick(item, $event, index)"
55 > 55 >
56 - {{ item.name }} 56 + <el-icon v-if="item.type === 'corp-tree'" style="margin-bottom: 2px;"><House /></el-icon>
57 + <el-icon v-if="item.type === 'role-list'" style="margin-bottom: 2px;"><Female /></el-icon>
58 + <el-icon v-if="item.type === 'user-tree'" style="margin-bottom: 2px;"><User /></el-icon>
59 + <span style="margin-left: 5px;">{{ item.name }}</span>
57 </div> 60 </div>
58 </div> 61 </div>
59 </div> 62 </div>
...@@ -106,6 +109,25 @@ ...@@ -106,6 +109,25 @@
106 </el-col> 109 </el-col>
107 </el-row> 110 </el-row>
108 </div> 111 </div>
112 + <div v-if="item.id === activeTabId && item.type === 'role-list'">
113 + <el-row>
114 + <el-col :span="24" style="max-height: 300px; overflow: scroll;">
115 + <el-checkbox-group
116 + class="flow-checkbox-group"
117 + v-model="checkedUserList"
118 + >
119 + <el-checkbox
120 + v-for="(user, idx) in userList"
121 + :key="idx"
122 + :label="user.id"
123 + :disabled="user.disabled"
124 + @change="handleCheckedUserListChange(user, $event)"
125 + >{{ user.name }}</el-checkbox
126 + >
127 + </el-checkbox-group>
128 + </el-col>
129 + </el-row>
130 + </div>
109 <!-- 成员选择树 --> 131 <!-- 成员选择树 -->
110 <div v-if="item.id === activeTabId && item.type === 'user-tree'"> 132 <div v-if="item.id === activeTabId && item.type === 'user-tree'">
111 <el-row> 133 <el-row>
...@@ -142,25 +164,6 @@ ...@@ -142,25 +164,6 @@
142 </el-col> 164 </el-col>
143 </el-row> 165 </el-row>
144 </div> 166 </div>
145 - <div v-if="item.id === activeTabId && item.type === 'role-list'">
146 - <el-row>
147 - <el-col :span="24" style="max-height: 300px; overflow: scroll;">
148 - <el-checkbox-group
149 - class="flow-checkbox-group"
150 - v-model="checkedUserList"
151 - >
152 - <el-checkbox
153 - v-for="(user, idx) in userList"
154 - :key="idx"
155 - :label="user.id"
156 - :disabled="user.disabled"
157 - @change="handleCheckedUserListChange(user, $event)"
158 - >{{ user.name }}</el-checkbox
159 - >
160 - </el-checkbox-group>
161 - </el-col>
162 - </el-row>
163 - </div>
164 <!-- TAG: 暂时不使用左右选择结构 --> 167 <!-- TAG: 暂时不使用左右选择结构 -->
165 <!-- <div v-if="item.id === activeTabId && item.type === ''"> 168 <!-- <div v-if="item.id === activeTabId && item.type === ''">
166 <el-tabs 169 <el-tabs
...@@ -302,17 +305,17 @@ const userTabs = ref([ ...@@ -302,17 +305,17 @@ const userTabs = ref([
302 data: [] 305 data: []
303 }, 306 },
304 { 307 {
308 + id: "tab-role",
309 + name: "角色",
310 + type: "role-list",
311 + data: []
312 + },
313 + {
305 id: "tab-uer", 314 id: "tab-uer",
306 name: "成员", 315 name: "成员",
307 type: "user-tree", 316 type: "user-tree",
308 data: [] 317 data: []
309 }, 318 },
310 - {
311 - id: "tab-role",
312 - name: "角色",
313 - type: "role-list",
314 - data: []
315 - }
316 ]); 319 ]);
317 const tabSelectData = ref([]); 320 const tabSelectData = ref([]);
318 const tabCheckedData = ref({}); // 保存选中Tab的数据 321 const tabCheckedData = ref({}); // 保存选中Tab的数据
...@@ -382,7 +385,13 @@ watch(() => { ...@@ -382,7 +385,13 @@ watch(() => {
382 if (props.visible) { 385 if (props.visible) {
383 dialogUserFormVisible.value = true; 386 dialogUserFormVisible.value = true;
384 // 同步显示tag框选中的用户 387 // 同步显示tag框选中的用户
385 - checkTab(tabCheckedData.value); 388 + // checkTab(tabCheckedData.value);
389 + if (!tabCheckedData.value.type) { // 未点击过tab栏,默认设置组织结构项
390 + nextTick(() => {
391 + // 把用户选中的节点注入树结构显示选中状态
392 + corpTreeRef.value.setCheckedKeys(userTags.value.map(ele => ele.id), false)
393 + });
394 + }
386 } else { 395 } else {
387 dialogUserFormVisible.value = false; 396 dialogUserFormVisible.value = false;
388 // 用户选择弹框关闭时,清空数据 397 // 用户选择弹框关闭时,清空数据
...@@ -603,10 +612,12 @@ const handleCheckedUserListChange = (user, checked) => { ...@@ -603,10 +612,12 @@ const handleCheckedUserListChange = (user, checked) => {
603 } 612 }
604 // 适配搜索栏结果的勾选显示 613 // 适配搜索栏结果的勾选显示
605 const element = searchUserList.value[user.type]; 614 const element = searchUserList.value[user.type];
606 - for (let index = 0; index < element.length; index++) { 615 + if (element) {
607 - const ele = element[index]; 616 + for (let index = 0; index < element.length; index++) {
608 - if (user.id === ele.id) { 617 + const ele = element[index];
609 - ele.checked = checked; 618 + if (user.id === ele.id) {
619 + ele.checked = checked;
620 + }
610 } 621 }
611 } 622 }
612 }; 623 };
......