hookehuyr

成员列表搜索功能调整

...@@ -96,7 +96,7 @@ ...@@ -96,7 +96,7 @@
96 <div style="font-size: 14px; margin-bottom: 10px;"> 96 <div style="font-size: 14px; margin-bottom: 10px;">
97 节点负责人 <span style="color: red;">*</span> 97 节点负责人 <span style="color: red;">*</span>
98 </div> 98 </div>
99 - <div class="flow-tag__wrapper" @click="openUserForm"> 99 + <div class="flow-tag__wrapper" style="max-height: 100px; overflow: auto;" @click="openUserForm">
100 <el-tag 100 <el-tag
101 v-if="state.userTags.length" 101 v-if="state.userTags.length"
102 v-for="tag in state.userTags" 102 v-for="tag in state.userTags"
...@@ -521,20 +521,20 @@ export default { ...@@ -521,20 +521,20 @@ export default {
521 521
522 onMounted(() => { 522 onMounted(() => {
523 document.title = '可视化流程设计器' 523 document.title = '可视化流程设计器'
524 - // // 显示提示框的标志位 524 + // 显示提示框的标志位
525 - // var showConfirmation = true; 525 + var showConfirmation = true;
526 - // // 监听 beforeunload 事件 526 + // 监听 beforeunload 事件
527 - // window.addEventListener('beforeunload', function (event) { 527 + window.addEventListener('beforeunload', function (event) {
528 - // if (showConfirmation) { 528 + if (showConfirmation) {
529 - // // 取消事件的默认行为(弹出确认对话框) 529 + // 取消事件的默认行为(弹出确认对话框)
530 - // event.preventDefault(); 530 + event.preventDefault();
531 - // } 531 + }
532 - // }); 532 + });
533 - // // 监听 unload 事件 533 + // 监听 unload 事件
534 - // window.addEventListener('unload', function () { 534 + window.addEventListener('unload', function () {
535 - // // 设置标志位为 false,避免在刷新页面时再次显示提示框 535 + // 设置标志位为 false,避免在刷新页面时再次显示提示框
536 - // showConfirmation = false; 536 + showConfirmation = false;
537 - // }); 537 + });
538 // 监听 resize 事件 538 // 监听 resize 事件
539 window.addEventListener('resize', function () { 539 window.addEventListener('resize', function () {
540 state.detailModel = null; 540 state.detailModel = null;
...@@ -868,15 +868,15 @@ export default { ...@@ -868,15 +868,15 @@ export default {
868 // return false 868 // return false
869 // } 869 // }
870 // }) 870 // })
871 - state.detailModel.text = state.node_name 871 + state.detailModel.text = state.node_name;
872 // state.detailModel.label = state.node_name 872 // state.detailModel.label = state.node_name
873 // 更新流程图信息 873 // 更新流程图信息
874 - editor.updateModel(state.detailModel) 874 + editor.updateModel(state.detailModel);
875 - // editor.closeModel() 875 + editor.closeModel();
876 - console.log('节点名称', state.node_name) 876 + console.log('节点名称', state.node_name);
877 - console.log('节点负责人', state.userTags) 877 + console.log('节点负责人', state.userTags);
878 - console.log('字段权限', state.field_auths) 878 + console.log('字段权限', state.field_auths);
879 - console.log('更多属性', state.more_attr) 879 + console.log('更多属性', state.more_attr);
880 } 880 }
881 881
882 /** 882 /**
......
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-22 13:49:46 4 + * @LastEditTime: 2023-11-22 15:46:03
5 * @FilePath: /vue-flow-editor/doc/selectUserView.vue 5 * @FilePath: /vue-flow-editor/doc/selectUserView.vue
6 * @Description: 成员列表选择控件 6 * @Description: 成员列表选择控件
7 --> 7 -->
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
11 title="成员列表" 11 title="成员列表"
12 @close="closeUserForm" 12 @close="closeUserForm"
13 > 13 >
14 - <div class="flow-tag__wrapper"> 14 + <div class="flow-tag__wrapper" style="max-height: 150px; overflow: auto;">
15 <el-tag 15 <el-tag
16 v-if="userTags.length" 16 v-if="userTags.length"
17 v-for="tag in userTags" 17 v-for="tag in userTags"
...@@ -55,14 +55,14 @@ ...@@ -55,14 +55,14 @@
55 </div> 55 </div>
56 </div> 56 </div>
57 </div> 57 </div>
58 - <!-- TAG: 暂时不做搜索功能 --> 58 + <div class="flow-tab-search" @click="activeSearchBtn">
59 - <!-- <div class="flow-tab-search" @click="activeSearchBtn">
60 <el-icon :size="15"><Search /></el-icon> &nbsp;搜索框 59 <el-icon :size="15"><Search /></el-icon> &nbsp;搜索框
61 - </div> --> 60 + </div>
62 </div> 61 </div>
63 <div v-else> 62 <div v-else>
64 <el-input 63 <el-input
65 v-model="search_input" 64 v-model="search_input"
65 + @input="onSearchInput"
66 class="search-btn-wrapper" 66 class="search-btn-wrapper"
67 placeholder="请输入关键字" 67 placeholder="请输入关键字"
68 > 68 >
...@@ -71,8 +71,8 @@ ...@@ -71,8 +71,8 @@
71 </template> 71 </template>
72 <template #append> 72 <template #append>
73 <div class="search-group"> 73 <div class="search-group">
74 - <div class="confirm-btn" @click="onSearch">搜索</div> 74 + <!-- <div class="confirm-btn" @click="onSearch">搜索</div> -->
75 - <div class="cancel-btn" @click="onClearSearch">取消</div> 75 + <div class="cancel-btn" @click="onClearSearch">关闭</div>
76 </div> 76 </div>
77 </template> 77 </template>
78 </el-input> 78 </el-input>
...@@ -192,20 +192,25 @@ ...@@ -192,20 +192,25 @@
192 </div> --> 192 </div> -->
193 </div> 193 </div>
194 </div> 194 </div>
195 - <div v-else> 195 + <div v-else style="height: 300px; overflow: scroll;">
196 <el-checkbox-group 196 <el-checkbox-group
197 class="flow-checkbox-group" 197 class="flow-checkbox-group"
198 style="padding-left: 10px;" 198 style="padding-left: 10px;"
199 v-model="checkedSearchUserList" 199 v-model="checkedSearchUserList"
200 > 200 >
201 - <el-checkbox 201 + <template
202 v-for="(user, idx) in searchUserList" 202 v-for="(user, idx) in searchUserList"
203 :key="idx" 203 :key="idx"
204 + >
205 + <el-checkbox
206 + v-if="user.show"
204 :label="user.id" 207 :label="user.id"
205 :disabled="user.disabled" 208 :disabled="user.disabled"
206 @change="handleCheckedUserListChange(user, $event)" 209 @change="handleCheckedUserListChange(user, $event)"
207 - >{{ user.name }}</el-checkbox 210 + >
208 - > 211 + {{ user.name }}
212 + </el-checkbox>
213 + </template>
209 </el-checkbox-group> 214 </el-checkbox-group>
210 </div> 215 </div>
211 </div> 216 </div>
...@@ -344,6 +349,7 @@ watch(() => { ...@@ -344,6 +349,7 @@ watch(() => {
344 dialogUserFormVisible.value = true; 349 dialogUserFormVisible.value = true;
345 } else { 350 } else {
346 dialogUserFormVisible.value = false; 351 dialogUserFormVisible.value = false;
352 + is_active_search.value = false;
347 } 353 }
348 }); 354 });
349 355
...@@ -638,7 +644,15 @@ const confirmUserForm = () => { ...@@ -638,7 +644,15 @@ const confirmUserForm = () => {
638 */ 644 */
639 const activeSearchBtn = () => { 645 const activeSearchBtn = () => {
640 is_active_search.value = !is_active_search.value; 646 is_active_search.value = !is_active_search.value;
641 - searchUserList.value = []; // 清空搜索列表 647 + search_input.value = '';
648 + // 后台数据集合
649 + searchUserList.value = _.cloneDeep(deptList.value[0]['user'].concat(roleList.value));
650 + //
651 + searchUserList.value.forEach((ele) => {
652 + ele.show = true;
653 + });
654 + // 如果 tags 里存在的值,需要在搜索列表中勾选
655 + checkSearchStatus();
642 }; 656 };
643 657
644 /** 658 /**
...@@ -697,30 +711,25 @@ const onClearSearch = () => { ...@@ -697,30 +711,25 @@ const onClearSearch = () => {
697 * @return {void} No return value. 711 * @return {void} No return value.
698 */ 712 */
699 const onSearch = () => { 713 const onSearch = () => {
700 - // TODO: 获取后台数据 714 + // 后台数据集合
701 - searchUserList.value = [ 715 + searchUserList.value = _.cloneDeep(deptList.value[0]['user'].concat(roleList.value));
702 - { 716 + //
703 - id: "user-1-1", 717 + searchUserList.value.forEach((ele) => {
704 - name: "用户1-1", 718 + ele.show = true;
705 - checked: false, 719 + });
706 - disabled: false
707 - },
708 - {
709 - id: "user-1-2",
710 - name: "用户1-2",
711 - checked: false,
712 - disabled: false
713 - },
714 - {
715 - id: "user-1-3",
716 - name: "用户1-3",
717 - checked: false,
718 - disabled: true
719 - }
720 - ];
721 // 如果 tags 里存在的值,需要在搜索列表中勾选 720 // 如果 tags 里存在的值,需要在搜索列表中勾选
722 checkSearchStatus(); 721 checkSearchStatus();
723 }; 722 };
723 +
724 +const onSearchInput = (val) => {
725 + searchUserList.value.forEach((ele) => {
726 + if (ele.name.indexOf(val) > -1) {
727 + ele.show = true;
728 + } else {
729 + ele.show = false;
730 + }
731 + })
732 +}
724 </script> 733 </script>
725 734
726 <style lang="scss"> 735 <style lang="scss">
......