Browse Source

添加操作icon过滤器,统一管理操作icon + 修改table组件 + 修改gojs引入方式

林倩 3 năm trước cách đây
mục cha
commit
7831e37c21

+ 1 - 1
src/common/index.js

@@ -10,12 +10,12 @@ if (!process.env.IS_BASE_PACKAGE) {
 } else {
     common = require("ui-jz-v4-common/src/common/common").default;
 }
+
 // import common from ;
 // export default common;
 // deploy包使用
 // import common from "ui-jz-v4-common/src/common/common";
 
-
 /**
  *
     common = {

+ 55 - 40
src/filters/index.js

@@ -1,67 +1,82 @@
-import utils from "@/common/utils";
+import utils from '@/common/utils';
 const { ztMoment } = utils;
 
 function pluralize(time, label) {
-    if (time === 1) {
-        return time + label;
-    }
-    return time + label + "s";
+  if (time === 1) {
+    return time + label;
+  }
+  return time + label + 's';
 }
 
 export function timeAgo(time) {
-    const between = Date.now() / 1000 - Number(time);
-    if (between < 3600) {
-        return pluralize(~~(between / 60), " minute");
-    } else if (between < 86400) {
-        return pluralize(~~(between / 3600), " hour");
-    } else {
-        return pluralize(~~(between / 86400), " day");
-    }
+  const between = Date.now() / 1000 - Number(time);
+  if (between < 3600) {
+    return pluralize(~~(between / 60), ' minute');
+  } else if (between < 86400) {
+    return pluralize(~~(between / 3600), ' hour');
+  } else {
+    return pluralize(~~(between / 86400), ' day');
+  }
 }
 
 /* 数字 格式化*/
 export function numberFormatter(num, digits) {
-    const si = [
-        { value: 1e18, symbol: "E" },
-        { value: 1e15, symbol: "P" },
-        { value: 1e12, symbol: "T" },
-        { value: 1e9, symbol: "G" },
-        { value: 1e6, symbol: "M" },
-        { value: 1e3, symbol: "k" }
-    ];
-    for (let i = 0; i < si.length; i++) {
-        if (num >= si[i].value) {
-            return (num / si[i].value + 0.1).toFixed(digits).replace(/\.0+$|(\.[0-9]*[1-9])0+$/, "$1") + si[i].symbol;
-        }
+  const si = [
+    { value: 1e18, symbol: 'E' },
+    { value: 1e15, symbol: 'P' },
+    { value: 1e12, symbol: 'T' },
+    { value: 1e9, symbol: 'G' },
+    { value: 1e6, symbol: 'M' },
+    { value: 1e3, symbol: 'k' }
+  ];
+  for (let i = 0; i < si.length; i++) {
+    if (num >= si[i].value) {
+      return (num / si[i].value + 0.1).toFixed(digits).replace(/\.0+$|(\.[0-9]*[1-9])0+$/, '$1') + si[i].symbol;
     }
-    return num.toString();
+  }
+  return num.toString();
 }
 
 export function toThousandFilter(num) {
-    return (+num || 0).toString().replace(/^-?\d+/g, m => m.replace(/(?=(?!\b)(\d{3})+$)/g, ","));
+  return (+num || 0).toString().replace(/^-?\d+/g, m => m.replace(/(?=(?!\b)(\d{3})+$)/g, ','));
 }
 
 export function dateFormatter(value, fmt) {
-    if(value) {
-       return ztMoment(value).format(fmt || "YYYY-MM-DD");
-    }else {
-        return ""
-    }
+  if (value) {
+    return ztMoment(value).format(fmt || 'YYYY-MM-DD');
+  } else {
+    return '';
+  }
+}
+
+export function optIcon(type, defaultIcon) {
+  if (defaultIcon) {
+    return defaultIcon;
+  }
+  let iconMap = new Map();
+  iconMap
+    .set('修改', 'el-icon-edit')
+    .set('详情', 'el-icon-document')
+    .set('删除', 'el-icon-delete')
+    .set('移除', 'el-icon-remove-outline')
+    .set('功能配置', 'el-icon-menu');
+  const icon = iconMap.get(type);
+  return icon ? icon : 'el-icon-edit';
 }
 
 const install = function(Vue) {
-    let filters = {pluralize,timeAgo,numberFormatter,toThousandFilter,dateFormatter}
-    Object.keys(filters).forEach(key => {
-        Vue.filter(key, filters[key]);
-    });
+  let filters = { pluralize, timeAgo, numberFormatter, toThousandFilter, dateFormatter, optIcon };
+  Object.keys(filters).forEach(key => {
+    Vue.filter(key, filters[key]);
+  });
 };
 
 /* istanbul ignore if */
-if (typeof window !== "undefined" && window.Vue) {
-    install(window.Vue);
+if (typeof window !== 'undefined' && window.Vue) {
+  install(window.Vue);
 }
 
 export default {
-    version: "1.0.0",
-    install
+  version: '1.0.0',
+  install
 };

+ 40 - 17
src/pages/common/new-table/index.vue

@@ -1,5 +1,5 @@
 <!--
-复选框缓存表格
+基础通用表格
 @Author: linqian
 @Date: 2021-07-07 17:11
 -->
@@ -7,7 +7,7 @@
   <div>
     <!-- 列表 -->
     <dg-table
-      ref="selectionTable"
+      ref="baseTable"
       :url="tableUrl"
       :condition="condition"
       :data="data"
@@ -15,20 +15,37 @@
       :row-key="rowKey"
       :lazy="lazy"
       :load="load"
-      :tree-props="treeProps"
       :before-quest="handleBeforeQuest"
-      :paging-type="pagingType"
-      :pagination-total="paginationTotal"
       @select="handleSelect"
       @select-all="handleCheckAll"
     >
-      <dg-table-column type="selection" reserve-selection width="55" align="center" />
+      <dg-table-column v-if="selection" type="selection" reserve-selection width="55" align="center" />
       <dg-table-column type="index" label="序号" width="75" align="center" />
       <template v-for="item in tableHeader">
-        <dg-table-column :key="item.id" v-bind="item" align="center"> </dg-table-column>
+        <dg-table-column :key="item.id" v-bind="item" align="center">
+          <template slot-scope="{ row }">
+            <span v-if="item.dateFormat">{{ row[item.prop] | dateFormatter(item.dateFormat) }}</span>
+            <slot v-if="item.custom" v-bind:row="scope.row" :name="item.prop"></slot>
+          </template>
+        </dg-table-column>
       </template>
-      <!--操作栏-->
       <slot></slot>
+      <!--操作栏-->
+      <!-- <dg-table-column label="操作" align="center" v-if="optList.length">
+        <template slot-scope="scope">
+          <div class="u-table__operation">
+            <el-tooltip
+              v-for="(item, index) in optList"
+              :key="index"
+              :content="item.tooltip"
+              effect="dark"
+              placement="top-end"
+            >
+              <i :class="item.icon" @click="item.on(scope.row, $event)"></i>
+            </el-tooltip>
+          </div>
+        </template>
+      </dg-table-column> -->
     </dg-table>
   </div>
 </template>
@@ -36,6 +53,7 @@
 <script>
 import _ from 'lodash';
 import DgTable from '@srcPath/components/jz-base/table';
+
 export default {
   mixins: [DgTable],
   props: {
@@ -49,10 +67,6 @@ export default {
       type: Boolean,
       default: false
     },
-    treeProps: {
-      type: Object,
-      default: () => {}
-    },
     load: {
       type: Function,
       default: (conditions) => conditions
@@ -60,12 +74,21 @@ export default {
     rowKey: {
       type: String,
       default: 'id'
+    },
+    selection: {
+      type: Boolean,
+      default: false
+    },
+    // 列表操作
+    optList: {
+      type: Array,
+      default: () => []
     }
   },
   components: {},
   data() {
     return {
-      newChooseArr: []
+      newChooseArr: [],
     };
   },
   computed: {},
@@ -74,14 +97,14 @@ export default {
      * 查询
      */
     handleSearch() {
-      this.$refs.selectionTable.searchForm();
+      this.$refs.baseTable.searchForm();
     },
     /**
      * 清除复选框选中的数据
      */
     handleClearSelection() {
-      this.$refs.selectionTable.clearAll();
-       this.newChooseArr = [];
+      this.$refs.baseTable.clearAll();
+      this.newChooseArr = [];
     },
 
     /**
@@ -100,7 +123,7 @@ export default {
           }
         }
         setTimeout(() => {
-          this.$refs.selectionTable.setCheck(rowKeys);
+          this.$refs.baseTable.setCheck(rowKeys);
         }, 500);
       }
 

+ 330 - 336
src/pages/common/table/index.vue

@@ -4,363 +4,357 @@
     @Date: 2019-03-23
 -->
 <template>
-    <dg-table
-        ref="grid"
-        row-key="id"
-        border
-        :auto-page="(h) => h * 0.6"
-        :expand-row-keys="expands"
-        @change-current="handleChangeCurrent"
-        @change-size="handleChangeSize"
-        @selection-change="handleSelectionChange"
-        @expand-change="handleExpandChange"
-        @row-click="handleRowClick"
-        @cell-click="handleCellClick"
-        :url="url"
-        :condition="condition"
-        :pagination="pagination"
-        :pagination-props="paginationProps"
-        :mapping="mapping"
-        :lazyLoad="lazyLoad"
-        highlight-current-row
-        :before-search="_beforeSearch"
-        :before-quest="beforeQuest"
-    >
-        <!--序号-->
-        <dg-table-column type="index" width="70" label="序号" align="center" fixed="left" />
-        <!--复选框情况-->
-        <dg-table-column type="selection" width="55" v-if="selection" />
-        <slot name="expand" />
-        <template v-for="(item, indexs) in headerData">
-            <dg-table-column :key="indexs" v-bind="item" align="center">
-                <template slot-scope="scope">
-                    <slot v-if="item.custom" v-bind:row="scope.row" :name="item.prop"></slot>
-                    <span v-if="item.state">{{ converterText(scope.row, item) }}</span>
-                    <span v-if="item.timestamp">{{ formatTimestamp(scope.row, item) }}</span>
-                    <span v-if="item.adminAudit">{{ transformText(scope.row, item) }}</span>
-                    <span v-if="item.transOperateType">{{ transformOperateType(scope.row, item) }}</span>
-                    <!-- <span v-if="item.tranformBusiness">{{ tranformBusinessText(scope.row, item) }}</span> -->
-                </template>
-            </dg-table-column>
+  <dg-table
+    ref="grid"
+    row-key="id"
+    border
+    :auto-page="(h) => h * 0.6"
+    :expand-row-keys="expands"
+    @change-current="handleChangeCurrent"
+    @change-size="handleChangeSize"
+    @selection-change="handleSelectionChange"
+    @expand-change="handleExpandChange"
+    @row-click="handleRowClick"
+    @cell-click="handleCellClick"
+    :url="url"
+    :condition="condition"
+    :pagination="pagination"
+    :pagination-props="paginationProps"
+    :mapping="mapping"
+    :lazyLoad="lazyLoad"
+    highlight-current-row
+    :before-search="_beforeSearch"
+    :before-quest="beforeQuest"
+  >
+    <!--序号-->
+    <dg-table-column type="index" width="70" label="序号" align="center" fixed="left" />
+    <!--复选框情况-->
+    <dg-table-column type="selection" width="55" v-if="selection" />
+    <slot name="expand" />
+    <template v-for="(item, indexs) in headerData">
+      <dg-table-column :key="indexs" v-bind="item" align="center">
+        <template slot-scope="scope">
+          <slot v-if="item.custom" v-bind:row="scope.row" :name="item.prop"></slot>
+          <span v-if="item.state">{{ converterText(scope.row, item) }}</span>
+          <span v-if="item.timestamp">{{ formatTimestamp(scope.row, item) }}</span>
+          <span v-if="item.adminAudit">{{ transformText(scope.row, item) }}</span>
+          <span v-if="item.transOperateType">{{ transformOperateType(scope.row, item) }}</span>
         </template>
-        <!--操作栏-->
-        <slot></slot>
-    </dg-table>
+      </dg-table-column>
+    </template>
+    <!--操作栏-->
+    <slot></slot>
+  </dg-table>
 </template>
 
 <script>
-import moment from "moment";
-import * as dd from "@/api/dd";
+import moment from 'moment';
+import * as dd from '@/api/dd';
 export default {
-    name: "Ltable",
-    props: {
-        lazyLoad: {
-            type: Boolean,
-            default: false
-        },
-        data: {
-            type: Array,
-            default: () => []
-        },
-        // 表头配置
-        headerData: {
-            type: Array,
-            default: () => []
-        },
-        // 开启复选
-        selection: {
-            type: Boolean,
-            default: false
-        },
-        // 开启复选
-        url: {
-            type: String,
-            default: "",
-            require: true
-        },
-        // 表格查询参数
-        condition: {
-            type: Object,
-            default: () => {}
-        },
-        sort: {
-             type: Object,
-            default: () => {}
-        },
-        // 是否开启分页
-        pagination: {
-            type: Boolean,
-            default: true
-        },
-        // 分页选项
-        paginationProps: {
-            type: Object,
-            default: () => {
-                return {
-                    currentPage: 1,
-                    pageSizes: [10, 20, 30],
-                    pageSize: 10,
-                    layout: "total, sizes, prev, pager, next, jumper"
-                };
-            }
-        },
-        // 最大高度
-        maxheight: {
-            type: [Number, String],
-            default: ""
-        },
-        converter: Function,
-        beforeSearch: {
-            type: Function,
-            default: (conditions) => conditions
-        },
-        tableName: {
-            type: String,
-            default: "表格"
-        }
+  name: 'Ltable',
+  props: {
+    lazyLoad: {
+      type: Boolean,
+      default: false
+    },
+    data: {
+      type: Array,
+      default: () => []
+    },
+    // 表头配置
+    headerData: {
+      type: Array,
+      default: () => []
+    },
+    // 开启复选
+    selection: {
+      type: Boolean,
+      default: false
+    },
+    // 开启复选
+    url: {
+      type: String,
+      default: '',
+      require: true
+    },
+    // 表格查询参数
+    condition: {
+      type: Object,
+      default: () => {}
+    },
+    sort: {
+      type: Object,
+      default: () => {}
+    },
+    // 是否开启分页
+    pagination: {
+      type: Boolean,
+      default: true
     },
-    // 页面数据绑定
-    data() {
+    // 分页选项
+    paginationProps: {
+      type: Object,
+      default: () => {
         return {
-            expands: [],
-            mapping: {
-                list: "content",
-                total: "totalPages"
-            }
+          currentPage: 1,
+          pageSizes: [10, 20, 30],
+          pageSize: 10,
+          layout: 'total, sizes, prev, pager, next, jumper'
         };
+      }
     },
+    // 最大高度
+    maxheight: {
+      type: [Number, String],
+      default: ''
+    },
+    converter: Function,
+    beforeSearch: {
+      type: Function,
+      default: (conditions) => conditions
+    },
+    tableName: {
+      type: String,
+      default: '表格'
+    }
+  },
+  // 页面数据绑定
+  data() {
+    return {
+      expands: [],
+      mapping: {
+        list: 'content',
+        total: 'totalPages'
+      }
+    };
+  },
 
-    mounted() {},
+  mounted() {},
 
-    // 方法
-    methods: {
-        _beforeSearch(conditions) {
-            conditions = this.beforeSearch(conditions);
-            let tmpCond = JSON.parse(conditions.searchCondition);
-            let result = [];
-            tmpCond.map((item, i) => {
-                if (item.op === "between") {
-                    if (item.value[0]) {
-                        // tmpCond.splice(i, 1);
-                        result.push({ ...item, op: ">=", value: item.value[0] });
-                        result.push({ ...item, op: "<=", value: item.value[1] });
-                    }
-                } else {
-                    result.push(item);
-                }
-            });
+  // 方法
+  methods: {
+    _beforeSearch(conditions) {
+      conditions = this.beforeSearch(conditions);
+      let tmpCond = JSON.parse(conditions.searchCondition);
+      let result = [];
+      tmpCond.map((item, i) => {
+        if (item.op === 'between') {
+          if (item.value[0]) {
+            // tmpCond.splice(i, 1);
+            result.push({ ...item, op: '>=', value: item.value[0] });
+            result.push({ ...item, op: '<=', value: item.value[1] });
+          }
+        } else {
+          result.push(item);
+        }
+      });
 
-            conditions.searchCondition = JSON.stringify(result);
-            conditions.sort = JSON.stringify(this.sort);
-            return conditions;
-        },
-        /**
-         * 页码切换
-         * @current 切换值
-         * */
-        handleChangeCurrent(current) {
-            this.$emit("handleChangeCurrent", current);
-        },
+      conditions.searchCondition = JSON.stringify(result);
+      conditions.sort = JSON.stringify(this.sort);
+      return conditions;
+    },
+    /**
+     * 页码切换
+     * @current 切换值
+     * */
+    handleChangeCurrent(current) {
+      this.$emit('handleChangeCurrent', current);
+    },
 
-        /**
-         * 页面切换
-         * @current 切换值
-         * */
-        handleChangeSize(size) {
-            this.$emit("handleChangeSize", size);
-        },
+    /**
+     * 页面切换
+     * @current 切换值
+     * */
+    handleChangeSize(size) {
+      this.$emit('handleChangeSize', size);
+    },
 
-        /**
-         * 页码切换
-         * @data 选中数据数组
-         * */
-        handleSelectionChange(data) {
-            this.$emit("handleSelectionChange", data);
-        },
+    /**
+     * 页码切换
+     * @data 选中数据数组
+     * */
+    handleSelectionChange(data) {
+      this.$emit('handleSelectionChange', data);
+    },
 
-        handleExpandChange(row, expanded) {
-            const that = this;
-            if (expanded.length) {
-                that.expands = [];
-                if (row) {
-                    that.expands.push(row.id);
-                    this.$emit("expand", row, expanded);
-                }
-            } else {
-                that.expands = [];
-            }
-        },
+    handleExpandChange(row, expanded) {
+      const that = this;
+      if (expanded.length) {
+        that.expands = [];
+        if (row) {
+          that.expands.push(row.id);
+          this.$emit('expand', row, expanded);
+        }
+      } else {
+        that.expands = [];
+      }
+    },
 
-        /**
-         * 查询
-         * */
-        handleSearchClick() {
-            this.$refs.grid.searchForm();
-        },
-        /**
-         * 表格某行被点击
-         * */
-        handleRowClick(row, column, event) {
-            this.$refs.grid.setCurrentRow(row);
+    /**
+     * 查询
+     * */
+    handleSearchClick() {
+      this.$refs.grid.searchForm();
+    },
+    /**
+     * 表格某行被点击
+     * */
+    handleRowClick(row, column, event) {
+      this.$refs.grid.setCurrentRow(row);
 
-            this.$emit("handleRowClick", { row, column });
-        },
-        // 某单元格被点击
-        handleCellClick(row, column, cell, event) {
-            this.$emit("handleCellClick", { row, column });
-        },
-        /**
-         * 文案转换状态
-         * */
-        converterText(rowData, item) {
-            const prop = item.prop || { label: "label", value: "value" };
-            let resultItem = item.state.find((val) => val["value"] == rowData[item.prop]);
-            if (resultItem) {
-                return resultItem["label"];
-            } else {
-                return moment(rowData[item.prop]).format("YYYY-MM-DD");
-            }
+      this.$emit('handleRowClick', { row, column });
+    },
+    // 某单元格被点击
+    handleCellClick(row, column, cell, event) {
+      this.$emit('handleCellClick', { row, column });
+    },
+    /**
+     * 文案转换状态
+     * */
+    converterText(rowData, item) {
+      const prop = item.prop || { label: 'label', value: 'value' };
+      let resultItem = item.state.find((val) => val['value'] == rowData[item.prop]);
+      if (resultItem) {
+        return resultItem['label'];
+      } else {
+        return moment(rowData[item.prop]).format('YYYY-MM-DD');
+      }
 
-            // return resultItem ? resultItem["label"] : rowData[item.prop];
-        },
-        /**
-         * 时间戳转换
-         * */
-        formatTimestamp(rowData, item) {
-            let str = "";
-            const type = item.format || "YYYY-MM-DD";
-            if (rowData[item.prop]) {
-                return moment(rowData[item.prop]).format(type);
-            }
-        },
-        /**
-         * 管理员表格 文案转换
-         * */
-        transformText(rowData, item) {
-            const user = dd.adminAuditsLabel.user;
-            const org = dd.adminAuditsLabel.org;
-            const admin = dd.adminAuditsLabel.admin;
-            let transformString = "";
-            if (rowData.auditType == "user_audit") {
-                for (let i = 0; i < user.length; i++) {
-                    if (rowData[item.prop] == user[i].value) {
-                        transformString = user[i].label;
-                        break;
-                    }
-                }
-            } else if (rowData.auditType == "org_audit") {
-                transformString = org[0].label;
-            } else {
-                for (let i = 0; i < admin.length; i++) {
-                    if (rowData[item.prop] == admin[i].value) {
-                        transformString = admin[i].label;
-                        break;
-                    }
-                }
-            }
-            return transformString;
-        },
-        /**
-         * 管理员审计 文案转换
-         * 操作内容
-         * */
-        transformOperateType(rowData, item) {
-            let transformString = "";
-            if (rowData.auditType == "user_audit") {
-                if (rowData.operateType == "10") {
-                    transformString = "新增";
-                } else if (rowData.operateType == "20") {
-                    transformString = "修改";
-                } else if (rowData.operateType == "30") {
-                    transformString = "删除";
-                } else if (rowData.operateType == "40") {
-                    transformString = "审批通过";
-                } else if (rowData.operateType == "41") {
-                    transformString = "审批不通过";
-                } else if (rowData.operateType == "50") {
-                    transformString = "启用";
-                } else if (rowData.operateType == "51") {
-                    transformString = "停用";
-                } else if (rowData.operateType == "61") {
-                    transformString = "入职";
-                } else if (rowData.objectType == "62") {
-                    transformString = "离职";
-                } else {
-                    transformString = "";
-                }
-            }
-            if (rowData.auditType == "org_audit") {
-                if (rowData.operateType == "10") {
-                    transformString = "新增机构";
-                } else if (rowData.operateType == "20") {
-                    transformString = "修改机构";
-                } else if (rowData.operateType == "30") {
-                    transformString = "删除机构";
-                } else if (rowData.operateType == "40") {
-                    transformString = "调离机构";
-                } else if (rowData.operateType == "50") {
-                    transformString = "合并机构";
-                } else {
-                    transformString = "";
-                }
-            } else {
-                if (rowData.operateType == "10") {
-                    transformString = "管理员创建";
-                } else if (rowData.operateType == "11") {
-                    transformString = "管理员删除";
-                } else if (rowData.operateType == "20") {
-                    transformString = "平台菜单权限新增";
-                } else if (rowData.operateType == "21") {
-                    transformString = "平台菜单权限移除";
-                } else if (rowData.operateType == "30") {
-                    transformString = "机构管理范围新增";
-                } else if (rowData.operateType == "31") {
-                    transformString = "机构管理范围变更";
-                } else if (rowData.operateType == "40") {
-                    transformString = "用户管理范围新增";
-                } else if (rowData.operateType == "41") {
-                    transformString = "用户管理范围变更";
-                } else if (rowData.objectType == "50") {
-                    transformString = "授权管理范围新增";
-                } else if (rowData.objectType == "51") {
-                    transformString = "授权管理范围变更";
-                } else if (rowData.objectType == "60") {
-                    transformString = "管理员管理范围新增";
-                } else if (rowData.objectType == "61") {
-                    transformString = "管理员管理范围变更";
-                } else {
-                    transformString = "";
-                }
-            }
-            return transformString;
-        },
-        /**
-         * 转换业务域
-         * */
-        tranformBusinessText(row, item) {},
-        /*
-         * 切换勾选状态
-         * */
-        toggleRowSelection(row, bool = false) {
-            return this.$refs.grid.toggleRowSelection(row, bool);
-        },
-        getReqSearchCondition() {
-            return this.$refs.grid.getReqSearchCondition();
-        },
-        beforeQuest(res) {
-            const { content, totalElements } = res.data;
-            const result = {
-                data: {
-                    content,
-                    totalElements
-                }
-            };
-            this.$emit("getTotalElements", { totalElements, tableName: this.tableName });
-            return result;
+      // return resultItem ? resultItem["label"] : rowData[item.prop];
+    },
+    /**
+     * 时间戳转换
+     * */
+    formatTimestamp(rowData, item) {
+      let str = '';
+      const type = item.format || 'YYYY-MM-DD';
+      if (rowData[item.prop]) {
+        return moment(rowData[item.prop]).format(type);
+      }
+    },
+    /**
+     * 管理员表格 文案转换
+     * */
+    transformText(rowData, item) {
+      const user = dd.adminAuditsLabel.user;
+      const org = dd.adminAuditsLabel.org;
+      const admin = dd.adminAuditsLabel.admin;
+      let transformString = '';
+      if (rowData.auditType == 'user_audit') {
+        for (let i = 0; i < user.length; i++) {
+          if (rowData[item.prop] == user[i].value) {
+            transformString = user[i].label;
+            break;
+          }
+        }
+      } else if (rowData.auditType == 'org_audit') {
+        transformString = org[0].label;
+      } else {
+        for (let i = 0; i < admin.length; i++) {
+          if (rowData[item.prop] == admin[i].value) {
+            transformString = admin[i].label;
+            break;
+          }
         }
+      }
+      return transformString;
     },
-    created() {
+    /**
+     * 管理员审计 文案转换
+     * 操作内容
+     * */
+    transformOperateType(rowData, item) {
+      let transformString = '';
+      if (rowData.auditType == 'user_audit') {
+        if (rowData.operateType == '10') {
+          transformString = '新增';
+        } else if (rowData.operateType == '20') {
+          transformString = '修改';
+        } else if (rowData.operateType == '30') {
+          transformString = '删除';
+        } else if (rowData.operateType == '40') {
+          transformString = '审批通过';
+        } else if (rowData.operateType == '41') {
+          transformString = '审批不通过';
+        } else if (rowData.operateType == '50') {
+          transformString = '启用';
+        } else if (rowData.operateType == '51') {
+          transformString = '停用';
+        } else if (rowData.operateType == '61') {
+          transformString = '入职';
+        } else if (rowData.objectType == '62') {
+          transformString = '离职';
+        } else {
+          transformString = '';
+        }
+      }
+      if (rowData.auditType == 'org_audit') {
+        if (rowData.operateType == '10') {
+          transformString = '新增机构';
+        } else if (rowData.operateType == '20') {
+          transformString = '修改机构';
+        } else if (rowData.operateType == '30') {
+          transformString = '删除机构';
+        } else if (rowData.operateType == '40') {
+          transformString = '调离机构';
+        } else if (rowData.operateType == '50') {
+          transformString = '合并机构';
+        } else {
+          transformString = '';
+        }
+      } else {
+        if (rowData.operateType == '10') {
+          transformString = '管理员创建';
+        } else if (rowData.operateType == '11') {
+          transformString = '管理员删除';
+        } else if (rowData.operateType == '20') {
+          transformString = '平台菜单权限新增';
+        } else if (rowData.operateType == '21') {
+          transformString = '平台菜单权限移除';
+        } else if (rowData.operateType == '30') {
+          transformString = '机构管理范围新增';
+        } else if (rowData.operateType == '31') {
+          transformString = '机构管理范围变更';
+        } else if (rowData.operateType == '40') {
+          transformString = '用户管理范围新增';
+        } else if (rowData.operateType == '41') {
+          transformString = '用户管理范围变更';
+        } else if (rowData.objectType == '50') {
+          transformString = '授权管理范围新增';
+        } else if (rowData.objectType == '51') {
+          transformString = '授权管理范围变更';
+        } else if (rowData.objectType == '60') {
+          transformString = '管理员管理范围新增';
+        } else if (rowData.objectType == '61') {
+          transformString = '管理员管理范围变更';
+        } else {
+          transformString = '';
+        }
+      }
+      return transformString;
+    },
+    /*
+     * 切换勾选状态
+     * */
+    toggleRowSelection(row, bool = false) {
+      return this.$refs.grid.toggleRowSelection(row, bool);
+    },
+    getReqSearchCondition() {
+      return this.$refs.grid.getReqSearchCondition();
+    },
+    beforeQuest(res) {
+      const { content, totalElements } = res.data;
+      const result = {
+        data: {
+          content,
+          totalElements
+        }
+      };
+      this.$emit('getTotalElements', { totalElements, tableName: this.tableName });
+      return result;
     }
+  },
+  created() {}
 };
 </script>
 

+ 0 - 1
src/pages/data-auth-module/auth-object-manage/appfun-resource-manage/add-app-form.vue

@@ -69,7 +69,6 @@
 
 <script>
 import { appRestApi } from "@/api/application";
-import moment from "moment";
 export default {
     props: {
         id: String,

+ 8 - 7
src/pages/data-auth-module/auth-object-manage/appfun-resource-manage/app-list.vue

@@ -49,11 +49,11 @@
                         <el-tooltip
                             v-for="(item, index) in optList"
                             :key="index"
-                            :content="item.tooltip"
+                            :content="item.label"
                             effect="dark"
                             placement="top-end"
                         >
-                            <i :class="item.icon" @click="item.on(scope.row, $event)"></i>
+                            <i :class="item.label | optIcon" @click="item.on(scope.row, $event)"></i>
                         </el-tooltip>
                     </div>
                 </template>
@@ -87,10 +87,10 @@ export default {
             },
             tableUrl: appRestApi.table,
             optList: [
-                { icon: "el-icon-edit", tooltip: "修改", on: this.handleEdit },
-                { icon: "el-icon-document", tooltip: "详情", on: this.handleViewDetail },
-                { icon: "el-icon-delete", tooltip: "删除", on: this.handleDelete },
-                { icon: "el-icon-menu", tooltip: "功能配置", on: this.handleSetFunc }
+                { label: "修改", on: this.handleEdit },
+                { label: "详情", on: this.handleViewDetail },
+                { label: "删除", on: this.handleDelete },
+                { label: "功能配置", on: this.handleSetFunc }
             ]
         };
     },
@@ -218,7 +218,8 @@ export default {
             this.$emit("rowClick", row);
         }
     },
-    created() {},
+    created() {
+    },
     mounted() {}
 };
 </script>

+ 3 - 3
src/pages/list-manage/white-list-manage/component/batch-add-user.vue

@@ -9,10 +9,10 @@
       <!-- 搜索栏 -->
       <el-form :inline="true" class="search-form">
         <el-form-item label="姓名">
-          <el-input v-model="form.name.value" clearable style="width: 130px"></el-input>
+          <el-input v-model="form.name.value" placeholder="请输入姓名" clearable style="width: 130px"></el-input>
         </el-form-item>
         <el-form-item label="身份证号码">
-          <el-input v-model="form.idcard.value" clearable></el-input>
+          <el-input v-model="form.idcard.value" placeholder="身份证号码" clearable></el-input>
         </el-form-item>
         <el-form-item label="所属单位">
           <select-tree
@@ -28,7 +28,7 @@
         </el-form-item>
       </el-form>
       <!-- 表格 -->
-      <new-table ref="table" :tableUrl="tableUrl" :tableHeader="tableHeader" :condition="form"> </new-table>
+      <new-table ref="table" :selection="true" :tableUrl="tableUrl" :tableHeader="tableHeader" :condition="form"> </new-table>
     </dg-row>
     <div v-footer>
       <dg-button @click="handleCancel">取消</dg-button>

+ 1 - 0
src/pages/list-manage/white-list-manage/component/user-list.vue

@@ -39,6 +39,7 @@
       :tableHeader="userListHeader"
       rowKey="idcard"
       :condition="form"
+      :selection="true"
     >
       <dg-table-column label="操作" align="center">
         <template slot-scope="scope">

+ 1 - 1
src/pages/permission-selfhelp-manage/component/detail.vue

@@ -26,7 +26,7 @@
 </template>
 
 <script>
-import flowChart from './flow-chart';
+import flowChart from './flow-chart/index';
 import processStatus from './process-status';
 import basicForm from './basic-form.vue';
 import commentsTable from './comments-table';

+ 19 - 4
src/pages/permission-selfhelp-manage/component/flow-chart/index.vue

@@ -61,8 +61,7 @@
 </template>
 
 <script>
-// import '../../../../../static/go';
-import go from "ui-gojs"
+import go from 'ui-gojs';
 import icons from './icon.js';
 import { processConfig, getFlowChartDetail } from '@/api/permission-selfhelp-manage';
 import moment from 'moment';
@@ -379,7 +378,22 @@ export default {
             const status = e.category === 'subprocess' ? getSubContainerStatus(e.id) : getTaskStatus(e.id);
             return bgColor[status];
           })
-        )
+        ),
+        // $(
+        //   go.Shape,
+        //   {
+        //     desiredSize: new go.Size(14, 14),
+        //     margin: new go.Margin(5, 0, 0, 5),
+        //     strokeWidth: 0
+        //   },
+        //   new go.Binding('fill', function (e) {
+        //     const status = e.category === 'subprocess' ? getSubContainerStatus(e.id) : getTaskStatus(e.id);
+        //     return textColor[status];
+        //   }),
+        //   new go.Binding('geometry', function (e) {
+        //     return geoFunc('' + e.type);
+        //   })
+        // )
       );
     },
 
@@ -680,6 +694,7 @@ export default {
       const defaultGroupTemplate = $(
         go.Group,
         'Auto',
+        nodeStyle(),
         {
           layout: $(go.TreeLayout, {
             angle: 90,
@@ -781,7 +796,7 @@ export default {
           // curve: go.Link.JumpOver,
           corner: 5
         },
-         new go.Binding('points').makeTwoWay(),
+        new go.Binding('points').makeTwoWay(),
         $(
           go.Shape, // the link path shape
           { isPanelMain: true, strokeWidth: 1 },

+ 6 - 3
src/pages/permission-selfhelp-manage/component/flow-chart/index1.vue

@@ -65,6 +65,7 @@ import go from "ui-gojs"
 import icons from './icon.js';
 import { processConfig, getFlowChartDetail } from '@/api/permission-selfhelp-manage';
 import moment from 'moment';
+
 // 颜色变量
 const lightGray = 'rgb(233,233,233)';
 const lightBlue = 'rgb(227,239,255)';
@@ -794,7 +795,8 @@ export default {
       myDiagram.linkTemplate = $(
         go.Link, // the whole link panel
         {
-          routing: go.Link.AvoidsNodes
+          routing: go.Link.AvoidsNodes,
+          // curve: go.Link.JumpGap
           // curve: go.Link.JumpOver,
           // corner: 5,
         },
@@ -823,9 +825,10 @@ export default {
           $(
             go.TextBlock,
             {
-              textAlign: 'center',
+              // textAlign: 'center',
               font: '9pt helvetica, arial, sans-serif',
-              margin: 4
+              margin: 4,
+              // segmentOffset: new go.Point(0, -30) 
             },
             new go.Binding('text')
           )