Jelajahi Sumber

增加仪表盘列表部门显示,统一所有列表表头搜索为事务名称搜索

cyy 1 tahun lalu
induk
melakukan
76b24c3103

+ 12 - 7
src/views/platform/bpmn/completed/index.vue

@@ -10,9 +10,9 @@
                 @click-left="$router.push({ name: 'dashboard' })"
             />
             <van-search
-                v-model="subject"
+                v-model="proName"
                 show-action
-                placeholder="请输入搜索关键词"
+                placeholder="请输入事务名称"
                 @search="onSearch"
             >
                 <template #left>
@@ -37,11 +37,14 @@
                 <van-cell
                     v-for="(item, index) in listData"
                     :key="item.id + index"
-                    :title="item.procDefName"
                     :label="getTaskDesc(item.subject)"
                     size="large"
                     @click="onClick(item, index)"
                 >
+                    <template #title>
+                        <span class="custom-title">{{item.procDefName + ' '}}</span>
+                        <van-tag v-if="$store.getters.deptList.find(i=>i.positionId==getTaskInfo(item.subject))" color="#f4f4f5" text-color="#909399" type="success" >{{ $store.getters.deptList.find(i=>i.positionId==getTaskInfo(item.subject)).positionName }}</van-tag>
+                    </template>
                     <template slot="icon">
                         <ibps-avatar
                             :icon="_randomIcon(index)"
@@ -115,6 +118,8 @@ import IbpsTypeTree from '@/business/platform/cat/type/tree'
 import IbpsAvatar from '@/components/ibps-avatar'
 import IbpsListResultPage from '@/components/ibps-list-result-page'
 import IbpsBpmnFormrenderDialog from '@/business/platform/bpmn/form/dialog'
+import CommonData from '../mixin/utils'
+
 
 export default {
     components: {
@@ -124,7 +129,7 @@ export default {
         IbpsListResultPage,
         IbpsBpmnFormrenderDialog
     },
-    mixins: [random, bpmnStatus],
+    mixins: [random, bpmnStatus,CommonData],
     data() {
         return {
             stateActive: false,
@@ -158,7 +163,7 @@ export default {
                     }
                 ]
             },
-
+            proName: '',
             subject: '',
             typeId: '',
             checker: '',
@@ -210,8 +215,8 @@ export default {
      */
         getSearcFormData() {
             let params = { end: '1' }
-            if (this.$utils.isNotEmpty(this.subject)) {
-                params['Q^subject_^SL'] = this.subject
+            if (this.$utils.isNotEmpty(this.proName)) {
+                params['Q^inst.proc_def_name_^SL'] = this.proName
             }
             if (this.$utils.isNotEmpty(this.moreParams)) {
                 params = Object.assign(params, this.moreParams)

+ 15 - 11
src/views/platform/bpmn/handled/index.vue

@@ -10,9 +10,9 @@
                 @click-left="$router.push({ name: 'dashboard' })"
             />
             <van-search
-                v-model="subject"
+                v-model="proName"
                 show-action
-                placeholder="请输入搜索关键词"
+                placeholder="请输入事务名称"
                 @search="onSearch"
             >
                 <template #left>
@@ -38,15 +38,18 @@
                 <van-cell
                     v-for="(item, index) in listData"
                     :key="item.id + index"
-                    :title="item.procDefName"
                     :label="getTaskDesc(item.subject)"
                     size="large"
                     @click="onClick(item, index)"
                 >
-                    <!-- <template slot="icon">
-            <ibps-avatar :icon="_randomIcon(index)" :text="item.name" :bg-color="_randomColor(index)" radius="4"
-              icon-prefix="ibps-icon" class="ibps-mr-10" />
-          </template> -->
+                    <template #title>
+                        <span class="custom-title">{{item.procDefName + ' '}}</span>
+                        <van-tag v-if="$store.getters.deptList.find(i=>i.positionId==getTaskInfo(item.subject))" color="#f4f4f5" text-color="#909399" type="success" >{{ $store.getters.deptList.find(i=>i.positionId==getTaskInfo(item.subject)).positionName }}</van-tag>
+                    </template>
+                    <template slot="icon">
+                        <ibps-avatar :icon="_randomIcon(index)" :text="item.name" :bg-color="_randomColor(index)" radius="4"
+                        icon-prefix="ibps-icon" class="ibps-mr-10" />
+                    </template>
                     <span>{{ item.createTime | formatRelativeTime }}</span>
                     <div>
                         <!-- <van-tag plain :type=" item.status | optionsFilter(bpmnStatusOptions,'type')">{{ item.status | optionsFilter(bpmnStatusOptions) }}</van-tag> -->
@@ -114,6 +117,7 @@ import IbpsMoreSearch from '@/components/ibps-more-search'
 import IbpsTypeTree from '@/business/platform/cat/type/tree'
 import IbpsAvatar from '@/components/ibps-avatar'
 import IbpsListResultPage from '@/components/ibps-list-result-page'
+import CommonData from '../mixin/utils'
 import IbpsBpmnFormrenderDialog from '@/business/platform/bpmn/form/dialog'
 
 export default {
@@ -124,7 +128,7 @@ export default {
         IbpsListResultPage,
         IbpsBpmnFormrenderDialog
     },
-    mixins: [random, bpmnStatus],
+    mixins: [random, bpmnStatus,CommonData],
     data() {
         return {
             stateActive: false,
@@ -158,7 +162,7 @@ export default {
                     }
                 ]
             },
-
+            proName: '',
             subject: '',
             typeId: '',
             moreParams: {},
@@ -209,8 +213,8 @@ export default {
      */
         getSearcFormData() {
             let params = {}
-            if (this.$utils.isNotEmpty(this.subject)) {
-                params['Q^subject_^SL'] = this.subject
+            if (this.$utils.isNotEmpty(this.proName)) {
+                params['Q^inst.proc_def_name_^SL'] = this.proName
             }
             if (this.$utils.isNotEmpty(this.moreParams)) {
                 params = Object.assign(params, this.moreParams)

+ 135 - 0
src/views/platform/bpmn/mixin/utils.js

@@ -0,0 +1,135 @@
+import ActionUtils from "@/utils/action";
+export default {
+  // components: {
+  //     'bpmn-formrender': () => import('@/business/platform/bpmn/form/dialog'),
+  //     'ibps-type-tree': () => import('@/business/platform/cat/type/tree'),
+  //     'ibps-card-list': () => import('@/components/ibps-card-list/list'),
+  //     'form-rights': () => import('@/business/platform/form/form-rights'),
+  //     'form-builder': () => import('@/business/platform/form/formbuilder/dialog'),
+  //     'formrender-preview': () => import('@/business/platform/form/formrender/preview/index')
+  // },
+  data() {
+    const { userList = [], deptList = [] } = this.$store.getters;
+    const defaultWidth = 225;
+    return {
+      userList,
+      deptList,
+      defaultWidth,
+      width: defaultWidth,
+      height: document.clientHeight,
+      createText: "创建表单",
+      query: "",
+      typeId: "",
+      pkKey: "id", // 主键  如果主键不是pk需要传主键
+      loading: false,
+      dialogFormVisible: false,
+      copyDialogFormVisible: false,
+      rightsDialogFormVisible: false,
+      formbuilderDialogVisible: false,
+      formrenderDialogVisible: false,
+      importFormVisible: false,
+      formPrintDialogVisible: false,
+      defId: "",
+      taskId: "",
+      editId: "",
+      proInstId: "",
+      instanceId: "",
+      flowName: "",
+      formKey: "",
+      searchField: "",
+      searchName: "",
+      listData: [],
+      pagination: {},
+      sorts: {}
+    };
+  },
+  methods: {
+    /**
+     * 获取格式化参数
+     */
+    getFormatParams(args) {
+      let params = this.$refs["crud"]
+        ? this.$refs["crud"].getSearcFormData()
+        : {};
+      if (this.$utils.isNotEmpty(this.typeId)) {
+        params["Q^TYPE_ID_^S"] = this.typeId;
+      }
+      params = {
+        ...params,
+        ...args
+      };
+      return ActionUtils.formatParams(params, this.pagination, this.sorts);
+    },
+    /**
+     * 处理分页事件
+     */
+    handlePaginationChange(page) {
+      ActionUtils.setPagination(this.pagination, page);
+      this.loadData();
+    },
+    /**
+     * 处理排序
+     */
+    handleSortChange(sort) {
+      ActionUtils.setSorts(this.sorts, sort);
+      this.loadData();
+    },
+    search() {
+      this.loadData();
+    },
+    /**
+     * 重置查询条件
+     */
+    reset() {
+      this.$refs["crud"].handleReset();
+    },
+    handleNodeClick(typeId) {
+      this.typeId = typeId;
+      this.loadData();
+    },
+    handleExpandCollapse(isExpand) {
+      this.width = isExpand ? this.defaultWidth : 30;
+    },
+    getTaskDesc(v) {
+      if (!v.includes("#")) {
+        return "";
+      }
+      return v.split("#")[1] || "";
+    },
+    getTaskInfo(val, arg = "dept") {
+      const arr = val.split("#");
+      if (!arr[2]) {
+        return "";
+      }
+      const result = JSON.parse(`{${arr[2]}}`);
+      if (!result.dept) {
+        return "";
+      }
+      const depts = result.dept.split(",");
+      const deptNames = [];
+      depts.forEach(item => {
+        const t = this.deptList.find(i => i.positionId === item);
+        deptNames.push(t ? t.positionName : result.dept);
+      });
+      result.deptName = deptNames.join(",");
+      return result[arg];
+    },
+    /**
+     * 点击表格
+     */
+    handleLinkClick(data) {
+      this.instanceId = data.id || "";
+      this.dialogFormVisible = true;
+    },
+    /**
+     * 数据转换,用户、部门
+     */
+    getTransformData(val, dataset, from, to) {
+      if (!val) {
+        return "";
+      }
+      const temp = this[dataset].find(u => u[from] === val);
+      return temp ? temp[to] : "";
+    }
+  }
+};

+ 28 - 23
src/views/platform/bpmn/my-request/index.vue

@@ -10,9 +10,9 @@
         @click-left="$router.push({ name: 'dashboard' })"
       />
       <van-search
-        v-model="subject"
+        v-model="proName"
         show-action
-        placeholder="请输入搜索关键词"
+        placeholder="请输入事务名称"
         @search="onSearch"
       >
         <template #left>
@@ -40,10 +40,13 @@
           :right-width="65"
         >
           <van-cell
-            :title="item.procDefName"
             :label="getTaskDesc(item.subject)"
             @click="onClick(item, index)"
           >
+            <template #title>
+              <span class="custom-title">{{item.procDefName + ' '}}</span>
+              <van-tag v-if="$store.getters.deptList.find(i=>i.positionId==getTaskInfo(item.subject))" color="#f4f4f5" text-color="#909399" type="success" >{{ $store.getters.deptList.find(i=>i.positionId==getTaskInfo(item.subject)).positionName }}</van-tag>
+            </template>
             <template slot="icon">
               <ibps-avatar
                 :icon="_randomIcon(index)"
@@ -57,21 +60,23 @@
             <span>{{ item.createTime | formatRelativeTime }}</span>
             <div>
               <!-- <van-tag plain :type=" item.status | optionsFilter(bpmnStatusOptions,'type')">{{ item.status | optionsFilter(bpmnStatusOptions) }}</van-tag> -->
-              <van-tag
-                size="medium"
-                :color="
-                  item.status
-                    | optionsFilter(bpmnStatusOptions, 'type')
-                    | optionsFilter(colorOptions, 'color', 'type')
-                "
-                :text-color="
-                  item.status
-                    | optionsFilter(bpmnStatusOptions, 'type')
-                    | optionsFilter(colorOptions, 'textColor', 'type')
-                "
-              >
-                {{ item.status | optionsFilter(bpmnStatusOptions) }}</van-tag
-              >
+              <div>
+                <van-tag
+                  :color="
+                    item.status
+                      | optionsFilter(bpmnStatusOptions, 'type')
+                      | optionsFilter(colorOptions, 'color', 'type')
+                  "
+                  :text-color="
+                    item.status
+                      | optionsFilter(bpmnStatusOptions, 'type')
+                      | optionsFilter(colorOptions, 'textColor', 'type')
+                  "
+                >
+                  {{ item.status | optionsFilter(bpmnStatusOptions) }}
+                </van-tag>
+              </div>
+              <div><van-tag type="success" plain>{{ '待'+item.curNode }}</van-tag></div>
             </div>
           </van-cell>
           <van-button
@@ -131,7 +136,7 @@ import IbpsTypeTree from '@/business/platform/cat/type/tree'
 import IbpsAvatar from '@/components/ibps-avatar'
 import IbpsListResultPage from '@/components/ibps-list-result-page'
 import IbpsBpmnFormrenderDialog from '@/business/platform/bpmn/form/dialog'
-
+import CommonData from '../mixin/utils'
 export default {
   components: {
     IbpsMoreSearch,
@@ -140,7 +145,7 @@ export default {
     IbpsListResultPage,
     IbpsBpmnFormrenderDialog
   },
-  mixins: [random, bpmnStatus],
+  mixins: [random, bpmnStatus,CommonData],
   data() {
     return {
       stateActive: false,
@@ -159,7 +164,7 @@ export default {
           }
         ]
       },
-
+      proName: '',
       subject: '',
       typeId: '',
       moreParams: {},
@@ -213,8 +218,8 @@ export default {
      */
     getSearcFormData() {
       let params = {}
-      if (this.$utils.isNotEmpty(this.subject)) {
-        params['Q^subject_^SL'] = this.subject
+      if (this.$utils.isNotEmpty(this.proName)) {
+        params['Q^proc_def_name_^SL'] = this.proName
       }
       if (this.$utils.isNotEmpty(this.moreParams)) {
         params = Object.assign(params, this.moreParams)

+ 10 - 6
src/views/platform/bpmn/pending/index.vue

@@ -27,7 +27,7 @@
           :title="data.title"
         />
       </van-tabs> -->
-            <van-search v-model="subject" show-action placeholder="请输入事务名称" @search="onSearch">
+            <van-search v-model="proName" show-action placeholder="请输入事务名称" @search="onSearch">
                 <template #left>
                     <van-icon
                         name="bars"
@@ -47,10 +47,13 @@
                     <van-cell
                         v-for="(item, index) in listData"
                         :key="item.id + index"
-                        :title="item.procDefName"
                         :label="getTaskDesc(item.subject)"
                         @click="onClick(item, index)"
                     >
+                        <template #title>
+                            <span class="custom-title">{{item.procDefName + ' '}}</span>
+                            <van-tag v-if="$store.getters.deptList.find(i=>i.positionId==getTaskInfo(item.subject))" color="#f4f4f5" text-color="#909399" type="success" >{{ $store.getters.deptList.find(i=>i.positionId==getTaskInfo(item.subject)).positionName }}</van-tag>
+                        </template>
                         <template slot="icon">
                             <van-checkbox v-if="checkMode" ref="checkboxes" :name="item.taskId" class="ibps-mr-10" />
                             <ibps-avatar
@@ -171,7 +174,7 @@ import IbpsToolbar from '@/components/ibps-toolbar'
 import IbpsListResultPage from '@/components/ibps-list-result-page'
 import IbpsTypeTree from '@/business/platform/cat/type/tree'
 import IbpsBpmnDefinition from '@/business/platform/bpmn/definition/field'
-
+import CommonData from '../mixin/utils'
 import IbpsBpmnFormrenderDialog from '@/business/platform/bpmn/form/dialog'
 
 export default {
@@ -185,7 +188,7 @@ export default {
         ApprovePopup,
         IbpsBpmnFormrenderDialog
     },
-    mixins: [random, bpmnStatus],
+    mixins: [random, bpmnStatus, CommonData],
     data() {
         return {
         // tabActive: 'userType',
@@ -232,6 +235,7 @@ export default {
                 ]
             },
             subject: '',
+            proName: '',
             typeId: '',
             defKey: '',
             moreParams: {},
@@ -353,8 +357,8 @@ export default {
             // if (this.$utils.isNotEmpty(this.subject)) {
             //   params['Q^temp.procDefName^SL'] = this.subject
             // }
-            if (this.$utils.isNotEmpty(this.subject)) {
-                params['Q^procDefName^SL'] = this.subject
+            if (this.$utils.isNotEmpty(this.proName)) {
+                params['Q^procDefName^SL'] = this.proName
             }
             //流程树搜索
             if (this.$utils.isNotEmpty(this.typeId)) {