Ver código fonte

4.0.63 修改审批人选择框

liuyanpeng 2 anos atrás
pai
commit
34f2878178

+ 2 - 2
package.json

@@ -1,7 +1,7 @@
 {
   "name": "client-base-v4",
   "description": "Leanwo Prodog Client",
-  "version": "4.0.62",
+  "version": "4.0.63",
   "author": "yangzhijie1488 <yangzhijie1488@163.com>",
   "scripts": {
     "dev": "cross-env webpack serve --config ./webpack.dev.js",
@@ -18,7 +18,7 @@
     "click-outside-vue3": "^4.0.1",
     "dayjs": "^1.11.6",
     "dingtalk-jsapi": "^2.10.3",
-    "pc-component-v3": "1.0.83",
+    "pc-component-v3": "1.0.84",
     "uuid": "^8.3.2",
     "v-tooltip": "^4.0.0-beta.17",
     "vue-request": "^1.2.4",

+ 4 - 0
src/App.vue

@@ -120,6 +120,10 @@ export default {
           count = 1;
         }
 
+        if (path.indexOf('/excel-import/') >= 0) {
+          count = 1;
+        }
+
         if (window.top !== window.self) {
           count = 1;
         }

+ 1 - 1
src/window/tabFormView/CurdWindowCommentCreate.vue

@@ -196,7 +196,7 @@ export default {
       const searchQueryParam = {
         range: {
           start: 0,
-          length: 100,
+          length: 1000,
         },
         conditional: search,
       };

+ 2 - 2
src/window/tabView/TabButton.vue

@@ -656,8 +656,8 @@ export default {
       console.log(modelData);
       localStorage.setItem(_self.uuid + '#GenerateDocumentTool', modelData);
 
-      var iWidth = 800;//弹出窗口的宽度;
-      var iHeight = 400; //弹出窗口的高度;
+      var iWidth = 1280;//弹出窗口的宽度;
+      var iHeight = 720; //弹出窗口的高度;
       var iTop = (window.screen.availHeight-30-iHeight)/2;//获得窗口的垂直位置;
       var iLeft = (window.screen.availWidth-10-iWidth)/2; //获得窗口的水平位置;
       window.open(frameUrl,'_blank','height='+iHeight+',innerHeight='+iHeight+',width='+iWidth+',innerWidth='+iWidth+',top='+iTop+',left='+iLeft+',toolbar=no,menubar=no,scrollbars=auto,resizeable=no,location=no,status=no');

+ 24 - 14
src/workflow/PreviousNodeSelectUser.vue

@@ -18,14 +18,20 @@
 
         <div>
           <div>{{ $t('lang.previousNodeSelectUser.copyUser') }}</div>
-          <v-select
-            v-model="copyUserIds"
-            :reduce="user => user.id"
+          <a-select
+            v-model:value="copyUserIds"
+            mode="multiple"
+            style="width: 100%"
             :options="copyUserList"
-            label="text"
-            multiple
-            @search="listInGroupCompanyByCondition"
-          />
+            :filter-option="false"
+            :not-found-content="fetching ? undefined : null"
+            :field-names="{ label: 'text', value: 'id' }"
+            @search="handleChange"
+          >
+            <template v-if="fetching" #notFoundContent>
+              <a-spin size="small" />
+            </template>
+          </a-select>
         </div>
       </div>
     </div>
@@ -89,6 +95,7 @@ export default {
       copyUserIds: [],
       copyUserList: [],
       timer: undefined,
+      fetching: false,
     };
   },
 
@@ -173,21 +180,24 @@ export default {
 
       return param;
     },
-
+    handleChange: Common.debounce(function (value) {
+      this.copyUserList = [];
+      this.fetching = true;
+      this.listInGroupCompanyByCondition(value);
+    },500),
     /**
          * 根据姓名获取抄送人用户集合
          */
-    listInGroupCompanyByCondition: function (search, loading) {
+    listInGroupCompanyByCondition: function (search) {
       let _self = this;
       const searchQueryParam = {
         range: {
           start: 0,
-          length: 100,
+          length: 1000,
         },
         conditional: search,
       };
 
-      loading(true);
       console.log('copyUserIds:' + _self.copyUserIds);
       //修复审批节点选择人员显示文件编码bug
       var selectList = [];
@@ -207,7 +217,7 @@ export default {
       UserResource.listInGroupCompanyByCondition(searchQueryParam).then(successData => {
         if (successData != null && successData.resultList != null) {
           successData.resultList.forEach(function (user) {
-            user.text = user.name + '(';
+            user.text = user.name + '(' + user.no + ')' + '(';
             if(user.organizations != null && user.organizations.length > 0){
               let isFirst = true;
               user.organizations.forEach(item => {
@@ -225,10 +235,10 @@ export default {
         } else {
           this.copyUserList = [];
         }
-        loading(false);
+        this.fetching = false;
       }, errorData => {
+        this.fetching = false;
         Common.processException(errorData);
-        loading(false);
       });
     },
     /**

+ 27 - 8
src/workflow/UserSelectDefine.vue

@@ -9,14 +9,28 @@
       >
         必选字段*
       </p>
-      <v-select
+      <!-- <v-select
         v-model="userIdsAll"
         :reduce="(user) => user.id"
         :options="userListAll"
         label="text"
         :multiple="multiSelect"
         @search="listInGroupCompanyByCondition"
-      />
+      /> -->
+      <a-select
+        v-model:value="userIdsAll"
+        style="width: 100%"
+        show-search
+        :options="userListAll"
+        :filter-option="false"
+        :not-found-content="fetching ? undefined : null"
+        :field-names="{ label: 'text', value: 'id' }"
+        @search="handleChange"
+      >
+        <template v-if="fetching" #notFoundContent>
+          <a-spin size="small" />
+        </template>
+      </a-select>
     </div>
     <div v-else-if="optionalRange === 'USER'">
       <p
@@ -106,6 +120,7 @@ export default {
       userIdsOfUserGroup: [],
 
       check: false, // 数据校验
+      fetching: false, // 数据校验
     };
   },
 
@@ -114,20 +129,24 @@ export default {
   },
 
   methods: {
+    handleChange: Common.debounce(function (value) {
+      this.copyUserList = [];
+      this.fetching = true;
+      this.listInGroupCompanyByCondition(value);
+    },500),
     /**
      * 根据姓名获取用户集合
      */
-    listInGroupCompanyByCondition: function (search, loading) {
+    listInGroupCompanyByCondition: function (search) {
       let _self = this;
       const searchQueryParam = {
         range: {
           start: 0,
-          length: 100,
+          length: 1000,
         },
         conditional: search,
       };
 
-      loading(true);
       //修复审批节点选择人员显示文件编码bug
       var selectList;
       if (
@@ -145,7 +164,7 @@ export default {
         successData => {
           if (successData != null && successData.resultList != null) {
             successData.resultList.forEach(function (user) {
-              user.text = user.name + '(';
+              user.text = user.name + '(' + user.no + ')' + '(';
               if(user.organizations != null && user.organizations.length > 0){
                 let isFirst = true;
                 user.organizations.forEach(item => {
@@ -170,11 +189,11 @@ export default {
           if (selectList != undefined && !result) {
             this.userListAll.push(selectList);
           }
-          loading(false);
+          this.fetching = false;
         },
         errorData => {
+          this.fetching = false;
           Common.processException(errorData);
-          loading(false);
         },
       );
     },

+ 28 - 12
src/workflow/WorkflowSearch.vue

@@ -1,5 +1,5 @@
 <template>
-  <a-dropdown v-model:visible="visible" :trigger="['click']">
+  <a-dropdown v-model:open="visible" :trigger="['click']">
     <a-button v-if="!isShowClear" style="margin-left: 12px">
       <align-center-outlined />
       高级筛选
@@ -23,13 +23,19 @@
         >
           <a-select
             v-model:value="formState.startUserId"
-            show-search
             placeholder="请选择审批人"
             style="width: 418px"
-            :options="copyUserIds"
+            :filter-option="false"
             :field-names="{ label: 'text', value: 'id' }"
-            :filter-option="filterOption"
-          />
+            :not-found-content="fetching ? undefined : null"
+            :options="copyUserIds"
+            show-search
+            @search="fetchUser"
+          >
+            <template v-if="fetching" #notFoundContent>
+              <a-spin size="small" />
+            </template>
+          </a-select>
         </a-form-item>
         <a-form-item label="提交审批时间:">
           <a-date-picker
@@ -115,6 +121,7 @@ const props = defineProps({
 });
 const formState = ref({});
 const visible = ref(false);
+const fetching = ref(false);
 const searchParams = ref({});
 const isShowClear = ref(false);
 const copyUserIds = ref([]);
@@ -149,10 +156,17 @@ onMounted(() => {
   getUsers();
 });
 
+const fetchUser = Common.debounce(value => {
+  copyUserIds.value = [];
+  fetching.value = true;
+  getUsers(value);
+}, 500);
+
+
 // 筛选
-const filterOption = (input, option) => {
-  return option.text.toLowerCase().indexOf(input.toLowerCase()) >= 0;
-};
+// const filterOption = (input, option) => {
+//   return option.text.toLowerCase().indexOf(input.toLowerCase()) >= 0;
+// };
 
 // 清空搜索条件
 const clearFilter = () => {
@@ -181,19 +195,19 @@ const validValue = obj => {
 };
 
 // 查询审批人
-const getUsers = () => {
+const getUsers = value => {
   const params = {
     range: {
       start: 0,
-      length: 99999,
+      length: 1000,
     },
-    conditional: '',
+    conditional: value,
   };
   UserResource.listInGroupCompanyByCondition(params).then(
     successData => {
       if (successData != null && successData.resultList != null) {
         successData.resultList.forEach(function (user) {
-          user.text = user.name + '(';
+          user.text = user.name + '(' + user.no + ')' + '(';
           if (user.organizations != null && user.organizations.length > 0) {
             let isFirst = true;
             user.organizations.forEach(item => {
@@ -211,8 +225,10 @@ const getUsers = () => {
       } else {
         copyUserIds.value = [];
       }
+      fetching.value = false;
     },
     errorData => {
+      fetching.value = false;
       Common.processException(errorData);
     },
   );

+ 25 - 16
src/workflow/WorkflowUserDefine.vue

@@ -17,14 +17,20 @@
 
         <div>
           <div>{{ $t("lang.workflowUserDefine.copyUser") }}</div>
-          <v-select
-            v-model="copyUserIds"
-            :reduce="(user) => user.id"
+          <a-select
+            v-model:value="copyUserIds"
+            mode="multiple"
+            style="width: 100%"
             :options="copyUserList"
-            label="text"
-            multiple
-            @search="listInGroupCompanyByCondition"
-          />
+            :filter-option="false"
+            :not-found-content="fetching ? undefined : null"
+            :field-names="{ label: 'text', value: 'id' }"
+            @search="handleChange"
+          >
+            <template v-if="fetching" #notFoundContent>
+              <a-spin size="small" />
+            </template>
+          </a-select>
         </div>
 
         <div style="margin-top: 10px">
@@ -82,13 +88,14 @@ export default {
       // 抄送人Id
       copyUserIds: [],
       copyUserList: [],
+      fetching: false,
     };
   },
 
   mounted: function () {
     var _self = this;
     _self.calculateUserSelect();
-    _self.listInGroupCompanyByCondition(null, function () {});
+    _self.listInGroupCompanyByCondition(null);
   },
 
   methods: {
@@ -99,7 +106,11 @@ export default {
     apply: function () {
       this.$emit('apply');
     },
-
+    handleChange: Common.debounce(function (value) {
+      this.copyUserList = [];
+      this.fetching = true;
+      this.listInGroupCompanyByCondition(value);
+    },500),
     /**
      * 计算哪些用户选择项可以执行
      */
@@ -161,18 +172,16 @@ export default {
     /**
      * 根据姓名获取抄送人用户集合
      */
-    listInGroupCompanyByCondition: function (search, loading) {
+    listInGroupCompanyByCondition: function (search) {
       let _self = this;
       const searchQueryParam = {
         range: {
           start: 0,
-          length: 100,
+          length: 1000,
         },
         conditional: search,
       };
 
-      loading(true);
-
       //修复审批节点选择人员显示文件编码bug
       var selectList = [];
       if (
@@ -195,7 +204,7 @@ export default {
         successData => {
           if (successData != null && successData.resultList != null) {
             successData.resultList.forEach(function (user) {
-              user.text = user.name + '(';
+              user.text = user.name + '(' + user.no + ')' + '(';
               if(user.organizations != null && user.organizations.length > 0){
                 let isFirst = true;
                 user.organizations.forEach(item => {
@@ -213,11 +222,11 @@ export default {
           } else {
             _self.copyUserList = [];
           }
-          loading(false);
+          this.fetching = false;
         },
         errorData => {
+          this.fetching = false;
           Common.processException(errorData);
-          loading(false);
         },
       );
     },