田源
2024-03-21 ebef4e035f5c6a00b291cf50b01ff008fa655609
Merge remote-tracking branch 'origin/master'

# Conflicts:
# Source/ProjectWeb/src/components/dynamic-components/dynamic-table.vue
# Source/ProjectWeb/src/views/base/uiDefineVO.js
已修改5个文件
已添加16个文件
5851 ■■■■■ 文件已修改
Source/ProjectWeb/src/api/refer/table.js 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/ProjectWeb/src/api/refer/tree.js 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/ProjectWeb/src/components/dynamic-components/dynamic-custom.vue 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/ProjectWeb/src/components/dynamic-components/dynamic-form.vue 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/ProjectWeb/src/components/dynamic-components/dynamic-tree.vue 1944 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/ProjectWeb/src/components/dynamic-components/index.vue 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/ProjectWeb/src/components/refer/BasicClassifyRefer.vue 109 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/ProjectWeb/src/components/refer/orgDeptRefer.vue 148 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/ProjectWeb/src/components/refer/orgUserRefer.vue 148 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/ProjectWeb/src/components/refer/vciWebRefer.vue 252 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/ProjectWeb/src/components/refer/vciWebReferClassify.vue 575 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/ProjectWeb/src/components/refer/vciWebReferDefalut.vue 427 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/ProjectWeb/src/components/refer/vciWebReferTable.vue 414 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/ProjectWeb/src/components/refer/vciWebReferTree.vue 260 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/ProjectWeb/src/util/formatTime.js 169 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/ProjectWeb/src/util/platformUtils.js 107 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/ProjectWeb/src/util/validate.js 547 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/ProjectWeb/src/views/test/referDemo/DynamicsFrom.vue 349 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/ProjectWeb/src/views/test/referDemo/index.vue 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/ProjectWeb/src/views/test/referDemo/referDemo.js 226 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/ProjectWeb/src/views/test/referDemo/referDemoDialog.vue 77 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/ProjectWeb/src/api/refer/table.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,33 @@
import request from '@/router/axios';
export function getList(params,page, limit, url, method){
  if(method && method.toLowerCase() == 'post'){
    params.pageNum =page;
    params.pageSize = limit;
    return request({
      url: url,
      method: method,
      data:params
    });
  }else {
    return request({
      url: url,
      method: method,
      params: {
        ...params,
        pageNum:page,
        pageSize:limit
      }
    });
  }
}
export function getLazyList(params,url) {
  return request({
    url: url,
    method: 'get',
    params: {
      ...params
    }
  });
}
Source/ProjectWeb/src/api/refer/tree.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,21 @@
import request from '@/router/axios';
export function getTree(params,url) {
  return request({
    url: url,
    method: 'get',
    params: {
      ...params
    }
  });
}
export function getLazyTree(params,url){
  return request({
    url: url,
    method: 'get',
    params: {
      ...params
    }
  });
}
Source/ProjectWeb/src/components/dynamic-components/dynamic-custom.vue
@@ -28,7 +28,12 @@
    paramVOS:{
      type:Object,
      default: {}
    }
    },
    isShow: {
      //所在区域是否已显示,针对tab和collapse
      type: Boolean,
      default: true
    },
  },
  data() {
    return {}
Source/ProjectWeb/src/components/dynamic-components/dynamic-form.vue
@@ -47,6 +47,11 @@
      type: Object,
      default: {}
    },
    isShow: {
      //所在区域是否已显示,针对tab和collapse
      type: Boolean,
      default: true
    },
  },
  data() {
    return {
Source/ProjectWeb/src/components/dynamic-components/dynamic-tree.vue
@@ -1,6 +1,19 @@
<template>
  <div class="UI-dynamic" :id="'UI-dynamic-'+areasName+componentVO.oid">
    <el-input
      placeholder="输入关键字进行过滤"
      v-model="filterText">
    </el-input>
    <el-tree
      class="filter-tree"
      show-checkbox
      :data="data"
      :props="defaultProps"
      :filter-node-method="filterNode"
      highlight-current
      node-key="id"
      ref="tree">
    </el-tree>
  </div>
</template>
@@ -28,14 +41,1939 @@
    paramVOS:{
      type:Object,
      default: {}
    },
    isShow: {
      //所在区域是否已显示,针对tab和collapse
      type: Boolean,
      default: true
    },
  },
  watch: {
    filterText(val) {
      this.$refs.tree.filter(val);
    },
    isShow:{
      handler(newval) {
        if(newval) {
          console.log(this.$el.clientHeight)}
      }
    }
  },
  methods: {
    filterNode(value, data) {
      if (!value) return true;
      return data[this.defaultProps.label].indexOf(value) !== -1;
    },
    initData(){
      this.data=[
        {
          "attributes": {
            "lastmodifier": "1",
            "revisionseq": "1",
            "versionvalue": "",
            "querycondition": "",
            "description": "",
            "oid": "0C6A3624-4A90-45E1-BEB2-75384E542613",
            "versionseq": "1",
            "checkinby": "",
            "revisionrule": "",
            "lctid": "ObjectLC",
            "lcstatus_text": "编辑中",
            "id": "",
            "owner": "1",
            "checkoutby": "",
            "workcontextoid": "",
            "creator": "1",
            "createtime": "2021-12-13 20:41:14.747",
            "isfirstv": "1",
            "folderoid": "",
            "lastmodifier_name": "测试",
            "revisionoid": "6053D009-934D-4528-A51D-69B63FC27BFF",
            "btmname": "folder",
            "checkouttime": "",
            "revisionvalue": "-",
            "sequence": "1",
            "versionrule": "0",
            "name": "工艺文档库",
            "islastr": "1",
            "lastmodifytime": "2021-12-13 20:41:14.747",
            "copyfromversion": "",
            "creator_name": "测试",
            "nameoid": "9D1B7934-3502-4DAF-9A1A-BE1B019DE8BC",
            "lcstatus": "Editing",
            "secretgrade": "2",
            "islastv": "1",
            "checkintime": "",
            "folderbusinesstype": "documentlib",
            "isfirstr": "1",
            "ts": "2021-12-13 20:41:14.747"
          },
          "checked": false,
          "children": [],
          "expanded": false,
          "href": null,
          "icon": null,
          "iconCls": null,
          "index": "0",
          "leaf": true,
          "oid": "0C6A3624-4A90-45E1-BEB2-75384E542613",
          "parentBtmName": null,
          "parentId": "",
          "parentName": null,
          "showCheckbox": false,
          "text": "工艺文档库[documentlib]"
        },
        {
          "attributes": {
            "lastmodifier": "1",
            "revisionseq": "1",
            "versionvalue": "",
            "querycondition": "",
            "description": "",
            "oid": "CFA35842-29E6-45D0-99B2-C7F19561E2F1",
            "versionseq": "1",
            "checkinby": "",
            "revisionrule": "",
            "lctid": "ObjectLC",
            "lcstatus_text": "编辑中",
            "id": "",
            "owner": "1",
            "checkoutby": "",
            "workcontextoid": "",
            "creator": "1",
            "createtime": "2021-12-13 22:16:32.272",
            "isfirstv": "1",
            "folderoid": "",
            "lastmodifier_name": "测试",
            "revisionoid": "6A03D6E4-7028-4D38-8584-0424FC6C7D7F",
            "btmname": "folder",
            "checkouttime": "",
            "revisionvalue": "-",
            "sequence": "1",
            "versionrule": "0",
            "name": "工艺知识库",
            "islastr": "1",
            "lastmodifytime": "2021-12-13 22:16:32.272",
            "copyfromversion": "",
            "creator_name": "测试",
            "nameoid": "957C8F17-D0C3-424E-B520-C9533E969440",
            "lcstatus": "Editing",
            "secretgrade": "2",
            "islastv": "1",
            "checkintime": "",
            "folderbusinesstype": "knowledgelib",
            "isfirstr": "1",
            "ts": "2021-12-13 22:16:32.272"
          },
          "checked": false,
          "children": [],
          "expanded": false,
          "href": null,
          "icon": null,
          "iconCls": null,
          "index": "1",
          "leaf": true,
          "oid": "CFA35842-29E6-45D0-99B2-C7F19561E2F1",
          "parentBtmName": null,
          "parentId": "",
          "parentName": null,
          "showCheckbox": false,
          "text": "工艺知识库[knowledgelib]"
        },
        {
          "attributes": {
            "lastmodifier": "1",
            "revisionseq": "1",
            "versionvalue": "",
            "querycondition": "",
            "description": "",
            "oid": "8D2E9F26-06C9-454D-8F5E-D95FD9DEA867",
            "versionseq": "1",
            "checkinby": "",
            "revisionrule": "",
            "lctid": "ObjectLC",
            "lcstatus_text": "编辑中",
            "id": "",
            "owner": "1",
            "checkoutby": "",
            "workcontextoid": "",
            "creator": "1",
            "createtime": "2021-12-13 22:16:58.87",
            "isfirstv": "1",
            "folderoid": "CFA35842-29E6-45D0-99B2-C7F19561E2F1",
            "lastmodifier_name": "测试",
            "revisionoid": "D1A22FC3-039E-49D6-B391-465BE17B3D46",
            "btmname": "folder",
            "checkouttime": "",
            "revisionvalue": "-",
            "sequence": "1",
            "versionrule": "0",
            "name": "常用术语",
            "islastr": "1",
            "lastmodifytime": "2022-01-06 14:29:56.841",
            "copyfromversion": "",
            "creator_name": "测试",
            "nameoid": "335A13B8-59F8-461D-A549-82543EF2B867",
            "lcstatus": "Editing",
            "secretgrade": "2",
            "islastv": "1",
            "checkintime": "",
            "folderbusinesstype": "常用术语",
            "isfirstr": "1",
            "ts": "2022-01-06 14:29:56.841"
          },
          "checked": false,
          "children": [],
          "expanded": false,
          "href": null,
          "icon": null,
          "iconCls": null,
          "index": "2",
          "leaf": true,
          "oid": "8D2E9F26-06C9-454D-8F5E-D95FD9DEA867",
          "parentBtmName": null,
          "parentId": "",
          "parentName": null,
          "showCheckbox": false,
          "text": "常用术语[常用术语]"
        },
        {
          "attributes": {
            "lastmodifier": "1",
            "revisionseq": "1",
            "versionvalue": "",
            "querycondition": "",
            "description": "1111222",
            "oid": "C8072146-781B-41F1-81AF-48C493492D9B",
            "versionseq": "1",
            "checkinby": "",
            "revisionrule": "",
            "lctid": "ObjectLC",
            "lcstatus_text": "编辑中",
            "id": "",
            "owner": "1",
            "checkoutby": "",
            "workcontextoid": "",
            "creator": "1",
            "createtime": "2021-12-13 22:19:43.066",
            "isfirstv": "1",
            "folderoid": "0C6A3624-4A90-45E1-BEB2-75384E542613",
            "lastmodifier_name": "测试",
            "revisionoid": "E9B07546-E2B1-487F-AF5C-BA36E7D562D0",
            "btmname": "folder",
            "checkouttime": "",
            "revisionvalue": "-",
            "sequence": "1",
            "versionrule": "0",
            "name": "工艺说明书",
            "islastr": "1",
            "lastmodifytime": "2021-12-13 22:19:43.066",
            "copyfromversion": "",
            "creator_name": "测试",
            "nameoid": "8466E055-685A-4E50-979F-8BE474FDEDBB",
            "lcstatus": "Editing",
            "secretgrade": "2",
            "islastv": "1",
            "checkintime": "",
            "folderbusinesstype": "工艺说明书",
            "isfirstr": "1",
            "ts": "2021-12-13 22:19:43.066"
          },
          "checked": false,
          "children": [],
          "expanded": false,
          "href": null,
          "icon": null,
          "iconCls": null,
          "index": "3",
          "leaf": true,
          "oid": "C8072146-781B-41F1-81AF-48C493492D9B",
          "parentBtmName": null,
          "parentId": "",
          "parentName": null,
          "showCheckbox": false,
          "text": "工艺说明书[工艺说明书]"
        },
        {
          "attributes": {
            "lastmodifier": "1",
            "revisionseq": "1",
            "versionvalue": "",
            "querycondition": "",
            "description": "222",
            "oid": "59F14C83-1345-4A7D-8225-0B09DE61400B",
            "versionseq": "1",
            "checkinby": "",
            "revisionrule": "",
            "lctid": "ObjectLC",
            "lcstatus_text": "编辑中",
            "id": "",
            "owner": "1",
            "checkoutby": "",
            "workcontextoid": "",
            "creator": "1",
            "createtime": "2021-12-13 22:42:24.901",
            "isfirstv": "1",
            "folderoid": "0C6A3624-4A90-45E1-BEB2-75384E542613",
            "lastmodifier_name": "测试",
            "revisionoid": "AF87EA19-5651-4920-8D73-4015962C082C",
            "btmname": "folder",
            "checkouttime": "",
            "revisionvalue": "-",
            "sequence": "1",
            "versionrule": "0",
            "name": "技术总结",
            "islastr": "1",
            "lastmodifytime": "2021-12-13 22:42:24.901",
            "copyfromversion": "",
            "creator_name": "测试",
            "nameoid": "95AFAAD8-B9B5-44A2-BAE2-12FAB2643193",
            "lcstatus": "Editing",
            "secretgrade": "2",
            "islastv": "1",
            "checkintime": "",
            "folderbusinesstype": "技术总结",
            "isfirstr": "1",
            "ts": "2021-12-13 22:42:24.901"
          },
          "checked": false,
          "children": [],
          "expanded": false,
          "href": null,
          "icon": null,
          "iconCls": null,
          "index": "4",
          "leaf": true,
          "oid": "59F14C83-1345-4A7D-8225-0B09DE61400B",
          "parentBtmName": null,
          "parentId": "",
          "parentName": null,
          "showCheckbox": false,
          "text": "技术总结[技术总结]"
        },
        {
          "attributes": {
            "lastmodifier": "1",
            "revisionseq": "1",
            "versionvalue": "",
            "querycondition": "",
            "description": "",
            "oid": "712FF8AC-48CC-45DB-A79C-7F783B4AD8B1",
            "versionseq": "1",
            "checkinby": "",
            "revisionrule": "",
            "lctid": "ObjectLC",
            "lcstatus_text": "编辑中",
            "id": "",
            "owner": "1",
            "checkoutby": "",
            "workcontextoid": "",
            "creator": "1",
            "createtime": "2021-12-13 22:48:25.242",
            "isfirstv": "1",
            "folderoid": "",
            "lastmodifier_name": "测试",
            "revisionoid": "61F5E6E8-3062-4FD8-9B35-0885E6A7ED21",
            "btmname": "folder",
            "checkouttime": "",
            "revisionvalue": "-",
            "sequence": "1",
            "versionrule": "0",
            "name": "HJSJ1155",
            "islastr": "1",
            "lastmodifytime": "2021-12-13 22:48:25.242",
            "copyfromversion": "",
            "creator_name": "测试",
            "nameoid": "CC3E9E86-FE2F-474F-94D3-DFB2ABF233DD",
            "lcstatus": "Editing",
            "secretgrade": "2",
            "islastv": "1",
            "checkintime": "",
            "folderbusinesstype": "技术文件",
            "isfirstr": "1",
            "ts": "2021-12-13 22:48:25.242"
          },
          "checked": false,
          "children": [],
          "expanded": false,
          "href": null,
          "icon": null,
          "iconCls": null,
          "index": "5",
          "leaf": true,
          "oid": "712FF8AC-48CC-45DB-A79C-7F783B4AD8B1",
          "parentBtmName": null,
          "parentId": "",
          "parentName": null,
          "showCheckbox": false,
          "text": "HJSJ1155[技术文件]"
        },
        {
          "attributes": {
            "lastmodifier": "1",
            "revisionseq": "1",
            "versionvalue": "",
            "querycondition": "",
            "description": "",
            "oid": "1ADD9030-2F3E-4363-84B9-31F08C5C12AB",
            "versionseq": "1",
            "checkinby": "",
            "revisionrule": "",
            "lctid": "ObjectLC",
            "lcstatus_text": "编辑中",
            "id": "",
            "owner": "1",
            "checkoutby": "",
            "workcontextoid": "5611E481-157B-4799-914F-5938A5BC1FA9",
            "creator": "1",
            "createtime": "2021-12-13 22:48:45.055",
            "isfirstv": "1",
            "folderoid": "712FF8AC-48CC-45DB-A79C-7F783B4AD8B1",
            "lastmodifier_name": "测试",
            "revisionoid": "F5862E44-372B-4C46-96F6-AEFFE1B63B6D",
            "btmname": "folder",
            "checkouttime": "",
            "revisionvalue": "-",
            "sequence": "1",
            "versionrule": "0",
            "name": "技术文件",
            "islastr": "1",
            "lastmodifytime": "2021-12-13 22:48:45.055",
            "copyfromversion": "",
            "creator_name": "测试",
            "nameoid": "34A45F92-2DC3-481C-82F2-B2F916CEDE2C",
            "lcstatus": "Editing",
            "secretgrade": "2",
            "islastv": "1",
            "checkintime": "",
            "folderbusinesstype": "技术文件",
            "isfirstr": "1",
            "ts": "2021-12-13 22:48:45.055"
          },
          "checked": false,
          "children": [],
          "expanded": false,
          "href": null,
          "icon": null,
          "iconCls": null,
          "index": "6",
          "leaf": true,
          "oid": "1ADD9030-2F3E-4363-84B9-31F08C5C12AB",
          "parentBtmName": null,
          "parentId": "",
          "parentName": null,
          "showCheckbox": false,
          "text": "技术文件[技术文件]"
        },
        {
          "attributes": {
            "lastmodifier": "1",
            "revisionseq": "1",
            "versionvalue": "",
            "querycondition": "",
            "description": "",
            "oid": "87A6D912-FDCA-496B-AA4E-FBDE9858853B",
            "versionseq": "1",
            "checkinby": "",
            "revisionrule": "",
            "lctid": "ObjectLC",
            "lcstatus_text": "编辑中",
            "id": "",
            "owner": "1",
            "checkoutby": "",
            "workcontextoid": "",
            "creator": "1",
            "createtime": "2021-12-09 13:53:26.939",
            "isfirstv": "1",
            "folderoid": "",
            "lastmodifier_name": "测试",
            "revisionoid": "69E38F00-01AE-4E2C-97DC-7C412C521959",
            "btmname": "folder",
            "checkouttime": "",
            "revisionvalue": "-",
            "sequence": "1",
            "versionrule": "0",
            "name": "资源库",
            "islastr": "1",
            "lastmodifytime": "2021-12-09 13:53:26.939",
            "copyfromversion": "",
            "creator_name": "测试",
            "nameoid": "60AD4F1B-D2E6-4C68-BC16-0F4052737D92",
            "lcstatus": "Editing",
            "secretgrade": "2",
            "islastv": "1",
            "checkintime": "",
            "folderbusinesstype": "resourcelib",
            "isfirstr": "1",
            "ts": "2021-12-09 13:53:26.939"
          },
          "checked": false,
          "children": [],
          "expanded": false,
          "href": null,
          "icon": null,
          "iconCls": null,
          "index": "7",
          "leaf": true,
          "oid": "87A6D912-FDCA-496B-AA4E-FBDE9858853B",
          "parentBtmName": null,
          "parentId": "",
          "parentName": null,
          "showCheckbox": false,
          "text": "资源库[resourcelib]"
        },
        {
          "attributes": {
            "lastmodifier": "1",
            "revisionseq": "1",
            "versionvalue": "",
            "querycondition": "",
            "description": "",
            "oid": "42B3DADB-5B19-478F-AE8F-C808151A9247",
            "versionseq": "1",
            "checkinby": "",
            "revisionrule": "",
            "lctid": "ObjectLC",
            "lcstatus_text": "编辑中",
            "id": "",
            "owner": "1",
            "checkoutby": "",
            "workcontextoid": "",
            "creator": "1",
            "createtime": "2021-12-09 13:53:50.744",
            "isfirstv": "1",
            "folderoid": "87A6D912-FDCA-496B-AA4E-FBDE9858853B",
            "lastmodifier_name": "测试",
            "revisionoid": "CA316DAC-65D0-4D37-ACCE-CD61ABB9C267",
            "btmname": "folder",
            "checkouttime": "",
            "revisionvalue": "-",
            "sequence": "1",
            "versionrule": "0",
            "name": "工作单元",
            "islastr": "1",
            "lastmodifytime": "2021-12-09 13:53:50.744",
            "copyfromversion": "",
            "creator_name": "测试",
            "nameoid": "8FFF9F4E-9567-4830-9C4B-D3E882DBFCE1",
            "lcstatus": "Editing",
            "secretgrade": "2",
            "islastv": "1",
            "checkintime": "",
            "folderbusinesstype": "workunit",
            "isfirstr": "1",
            "ts": "2021-12-09 13:53:50.744"
          },
          "checked": false,
          "children": [],
          "expanded": false,
          "href": null,
          "icon": null,
          "iconCls": null,
          "index": "8",
          "leaf": true,
          "oid": "42B3DADB-5B19-478F-AE8F-C808151A9247",
          "parentBtmName": null,
          "parentId": "",
          "parentName": null,
          "showCheckbox": false,
          "text": "工作单元[workunit]"
        },
        {
          "attributes": {
            "lastmodifier": "1",
            "revisionseq": "1",
            "versionvalue": "",
            "querycondition": "",
            "description": "",
            "oid": "411E568F-AE64-4C64-9BC2-8E6E566DE06B",
            "versionseq": "1",
            "checkinby": "",
            "revisionrule": "",
            "lctid": "ObjectLC",
            "lcstatus_text": "编辑中",
            "id": "",
            "owner": "1",
            "checkoutby": "",
            "workcontextoid": "",
            "creator": "1",
            "createtime": "2021-12-30 14:06:43.618",
            "isfirstv": "1",
            "folderoid": "87A6D912-FDCA-496B-AA4E-FBDE9858853B",
            "lastmodifier_name": "测试",
            "revisionoid": "459996CD-C952-47C8-A2CC-8E8A42179364",
            "btmname": "folder",
            "checkouttime": "",
            "revisionvalue": "-",
            "sequence": "1",
            "versionrule": "0",
            "name": "设备",
            "islastr": "1",
            "lastmodifytime": "2021-12-30 14:06:43.618",
            "copyfromversion": "",
            "creator_name": "测试",
            "nameoid": "E7FA6D19-62BE-4ED4-9D37-4312F34C1B48",
            "lcstatus": "Editing",
            "secretgrade": "2",
            "islastv": "1",
            "checkintime": "",
            "folderbusinesstype": "machine",
            "isfirstr": "1",
            "ts": "2021-12-30 14:06:43.618"
          },
          "checked": false,
          "children": [],
          "expanded": false,
          "href": null,
          "icon": null,
          "iconCls": null,
          "index": "9",
          "leaf": true,
          "oid": "411E568F-AE64-4C64-9BC2-8E6E566DE06B",
          "parentBtmName": null,
          "parentId": "",
          "parentName": null,
          "showCheckbox": false,
          "text": "设备[machine]"
        },
        {
          "attributes": {
            "lastmodifier": "1",
            "revisionseq": "1",
            "versionvalue": "",
            "querycondition": "",
            "description": "",
            "oid": "3B582AE0-9A60-4E52-9806-F8729ED5A4F0",
            "versionseq": "1",
            "checkinby": "",
            "revisionrule": "",
            "lctid": "ObjectLC",
            "lcstatus_text": "编辑中",
            "id": "",
            "owner": "1",
            "checkoutby": "",
            "workcontextoid": "",
            "creator": "1",
            "createtime": "2021-12-30 14:07:20.736",
            "isfirstv": "1",
            "folderoid": "87A6D912-FDCA-496B-AA4E-FBDE9858853B",
            "lastmodifier_name": "测试",
            "revisionoid": "877DBFF6-A63A-435A-99FC-DF54540387BA",
            "btmname": "folder",
            "checkouttime": "",
            "revisionvalue": "-",
            "sequence": "1",
            "versionrule": "0",
            "name": "工装",
            "islastr": "1",
            "lastmodifytime": "2021-12-30 14:07:20.736",
            "copyfromversion": "",
            "creator_name": "测试",
            "nameoid": "0E53FBDB-01DB-4B18-9A2D-30C30AC2E6BF",
            "lcstatus": "Editing",
            "secretgrade": "2",
            "islastv": "1",
            "checkintime": "",
            "folderbusinesstype": "equipment",
            "isfirstr": "1",
            "ts": "2021-12-30 14:07:20.736"
          },
          "checked": false,
          "children": [],
          "expanded": false,
          "href": null,
          "icon": null,
          "iconCls": null,
          "index": "10",
          "leaf": true,
          "oid": "3B582AE0-9A60-4E52-9806-F8729ED5A4F0",
          "parentBtmName": null,
          "parentId": "",
          "parentName": null,
          "showCheckbox": false,
          "text": "工装[equipment]"
        },
        {
          "attributes": {
            "lastmodifier": "1",
            "revisionseq": "1",
            "versionvalue": "",
            "querycondition": "",
            "description": "",
            "oid": "CCE97F36-05A0-4419-BA6C-E766C8FB08EF",
            "versionseq": "1",
            "checkinby": "",
            "revisionrule": "",
            "lctid": "ObjectLC",
            "lcstatus_text": "编辑中",
            "id": "",
            "owner": "1",
            "checkoutby": "",
            "workcontextoid": "",
            "creator": "1",
            "createtime": "2022-04-02 13:36:19.627",
            "isfirstv": "1",
            "folderoid": "CCCC5958-5BAA-49E3-AB76-AF728157C19C",
            "lastmodifier_name": "测试",
            "revisionoid": "4584960B-1EF3-44AA-BDE4-37628DB340CF",
            "btmname": "folder",
            "checkouttime": "",
            "revisionvalue": "-",
            "sequence": "1",
            "versionrule": "0",
            "name": "辅材",
            "islastr": "1",
            "lastmodifytime": "2022-04-02 13:36:19.627",
            "copyfromversion": "",
            "creator_name": "测试",
            "nameoid": "B3716837-ADCC-4B58-88DF-20D19E8B0C99",
            "lcstatus": "Editing",
            "secretgrade": "2",
            "islastv": "1",
            "checkintime": "",
            "folderbusinesstype": "AssMaterial",
            "isfirstr": "1",
            "ts": "2022-04-02 13:36:19.627"
          },
          "checked": false,
          "children": [],
          "expanded": false,
          "href": null,
          "icon": null,
          "iconCls": null,
          "index": "11",
          "leaf": true,
          "oid": "CCE97F36-05A0-4419-BA6C-E766C8FB08EF",
          "parentBtmName": null,
          "parentId": "",
          "parentName": null,
          "showCheckbox": false,
          "text": "辅材[AssMaterial]"
        },
        {
          "attributes": {
            "lastmodifier": "1",
            "revisionseq": "1",
            "versionvalue": "",
            "querycondition": "",
            "description": "",
            "oid": "7C886BC5-79F9-489D-9CB6-31522D877CEA",
            "versionseq": "1",
            "checkinby": "",
            "revisionrule": "",
            "lctid": "ObjectLC",
            "lcstatus_text": "编辑中",
            "id": "",
            "owner": "1",
            "checkoutby": "",
            "workcontextoid": "",
            "creator": "1",
            "createtime": "2022-04-02 13:36:27.366",
            "isfirstv": "1",
            "folderoid": "CCCC5958-5BAA-49E3-AB76-AF728157C19C",
            "lastmodifier_name": "测试",
            "revisionoid": "FA544E83-29C9-4456-9ECD-3658BB5D675F",
            "btmname": "folder",
            "checkouttime": "",
            "revisionvalue": "-",
            "sequence": "1",
            "versionrule": "0",
            "name": "主材",
            "islastr": "1",
            "lastmodifytime": "2022-04-02 13:36:27.366",
            "copyfromversion": "",
            "creator_name": "测试",
            "nameoid": "3333EA57-5F17-40DA-9790-E1FD59ED8EB1",
            "lcstatus": "Editing",
            "secretgrade": "2",
            "islastv": "1",
            "checkintime": "",
            "folderbusinesstype": "material",
            "isfirstr": "1",
            "ts": "2022-04-02 13:36:27.366"
          },
          "checked": false,
          "children": [],
          "expanded": false,
          "href": null,
          "icon": null,
          "iconCls": null,
          "index": "12",
          "leaf": true,
          "oid": "7C886BC5-79F9-489D-9CB6-31522D877CEA",
          "parentBtmName": null,
          "parentId": "",
          "parentName": null,
          "showCheckbox": false,
          "text": "主材[material]"
        },
        {
          "attributes": {
            "lastmodifier": "1",
            "revisionseq": "1",
            "versionvalue": "",
            "querycondition": "",
            "description": "",
            "oid": "A10C10B6-9C85-4B03-AE65-EFBE4D3433A0",
            "versionseq": "1",
            "checkinby": "",
            "revisionrule": "",
            "lctid": "ObjectLC",
            "lcstatus_text": "编辑中",
            "id": "",
            "owner": "1",
            "checkoutby": "",
            "workcontextoid": "",
            "creator": "1",
            "createtime": "2022-04-02 13:45:44.686",
            "isfirstv": "1",
            "folderoid": "",
            "lastmodifier_name": "测试",
            "revisionoid": "C4122548-1612-47BE-B5A8-7C858DB2AA97",
            "btmname": "folder",
            "checkouttime": "",
            "revisionvalue": "-",
            "sequence": "1",
            "versionrule": "0",
            "name": "CAXA工艺库",
            "islastr": "1",
            "lastmodifytime": "2022-04-02 13:45:44.686",
            "copyfromversion": "",
            "creator_name": "测试",
            "nameoid": "CFB4AD69-A78C-49F2-8BE8-32B2A8E62ADC",
            "lcstatus": "Editing",
            "secretgrade": "2",
            "islastv": "1",
            "checkintime": "",
            "folderbusinesstype": "caxaprocesslib",
            "isfirstr": "1",
            "ts": "2022-04-02 13:45:44.686"
          },
          "checked": false,
          "children": [],
          "expanded": false,
          "href": null,
          "icon": null,
          "iconCls": null,
          "index": "13",
          "leaf": true,
          "oid": "A10C10B6-9C85-4B03-AE65-EFBE4D3433A0",
          "parentBtmName": null,
          "parentId": "",
          "parentName": null,
          "showCheckbox": false,
          "text": "CAXA工艺库[caxaprocesslib]"
        },
        {
          "attributes": {
            "lastmodifier": "1",
            "revisionseq": "1",
            "versionvalue": "",
            "querycondition": "",
            "description": "",
            "oid": "A2872581-8E91-4BB2-A8B5-6D421655377D",
            "versionseq": "1",
            "checkinby": "",
            "revisionrule": "",
            "lctid": "ObjectLC",
            "lcstatus_text": "编辑中",
            "id": "",
            "owner": "1",
            "checkoutby": "",
            "workcontextoid": "",
            "creator": "1",
            "createtime": "2022-06-23 11:01:31.408",
            "isfirstv": "1",
            "folderoid": "DAA0F5E3-9F02-4A92-8551-8C97C6EBEAA0",
            "lastmodifier_name": "测试",
            "revisionoid": "2598EB13-B27C-4B8B-9C8A-301EAA2D3BF1",
            "btmname": "folder",
            "checkouttime": "",
            "revisionvalue": "-",
            "sequence": "1",
            "versionrule": "0",
            "name": "2022",
            "islastr": "1",
            "lastmodifytime": "2022-06-23 11:01:31.408",
            "copyfromversion": "",
            "creator_name": "测试",
            "nameoid": "2BDF5977-83A3-455B-A132-16694A6C5902",
            "lcstatus": "Editing",
            "secretgrade": "2",
            "islastv": "1",
            "checkintime": "",
            "folderbusinesstype": "year",
            "isfirstr": "1",
            "ts": "2022-06-23 11:01:31.408"
          },
          "checked": false,
          "children": [],
          "expanded": false,
          "href": null,
          "icon": null,
          "iconCls": null,
          "index": "14",
          "leaf": true,
          "oid": "A2872581-8E91-4BB2-A8B5-6D421655377D",
          "parentBtmName": null,
          "parentId": "",
          "parentName": null,
          "showCheckbox": false,
          "text": "2022[year]"
        },
        {
          "attributes": {
            "lastmodifier": "1",
            "revisionseq": "1",
            "versionvalue": "",
            "querycondition": "",
            "description": "",
            "oid": "61E0061F-FFCE-4A33-B373-1A4B334FBF76",
            "versionseq": "1",
            "checkinby": "",
            "revisionrule": "",
            "lctid": "ObjectLC",
            "lcstatus_text": "编辑中",
            "id": "",
            "owner": "1",
            "checkoutby": "",
            "workcontextoid": "",
            "creator": "1",
            "createtime": "2021-12-30 17:09:44.651",
            "isfirstv": "1",
            "folderoid": "",
            "lastmodifier_name": "测试",
            "revisionoid": "A9BC94BD-525D-42EF-9AEE-CB028BF01A8B",
            "btmname": "folder",
            "checkouttime": "",
            "revisionvalue": "-",
            "sequence": "1",
            "versionrule": "0",
            "name": "卡片模板",
            "islastr": "1",
            "lastmodifytime": "2021-12-30 17:09:44.651",
            "copyfromversion": "",
            "creator_name": "测试",
            "nameoid": "F9A89BE9-44E9-42AD-B682-46C7BE220024",
            "lcstatus": "Editing",
            "secretgrade": "2",
            "islastv": "1",
            "checkintime": "",
            "folderbusinesstype": "cardtemplate",
            "isfirstr": "1",
            "ts": "2021-12-30 17:09:44.651"
          },
          "checked": false,
          "children": [],
          "expanded": false,
          "href": null,
          "icon": null,
          "iconCls": null,
          "index": "15",
          "leaf": true,
          "oid": "61E0061F-FFCE-4A33-B373-1A4B334FBF76",
          "parentBtmName": null,
          "parentId": "",
          "parentName": null,
          "showCheckbox": false,
          "text": "卡片模板[cardtemplate]"
        },
        {
          "attributes": {
            "lastmodifier": "1",
            "revisionseq": "1",
            "versionvalue": "",
            "querycondition": "",
            "description": "",
            "oid": "BC88822E-6A5A-402F-BFFF-9B7749D9B786",
            "versionseq": "1",
            "checkinby": "",
            "revisionrule": "",
            "lctid": "ObjectLC",
            "lcstatus_text": "编辑中",
            "id": "favorite",
            "owner": "1",
            "checkoutby": "",
            "workcontextoid": "",
            "creator": "1",
            "createtime": "2022-03-08 10:33:31.143",
            "isfirstv": "1",
            "folderoid": "87A6D912-FDCA-496B-AA4E-FBDE9858853B",
            "lastmodifier_name": "测试",
            "revisionoid": "F4D86664-7F3B-4F89-B2B7-3A0D048C4CA2",
            "btmname": "folder",
            "checkouttime": "",
            "revisionvalue": "-",
            "sequence": "1",
            "versionrule": "0",
            "name": "收藏夹",
            "islastr": "1",
            "lastmodifytime": "2022-03-08 10:33:31.143",
            "copyfromversion": "",
            "creator_name": "测试",
            "nameoid": "BAFBAC43-E098-4E8A-8541-832AA1399A04",
            "lcstatus": "Editing",
            "secretgrade": "2",
            "islastv": "1",
            "checkintime": "",
            "folderbusinesstype": "favorite",
            "isfirstr": "1",
            "ts": "2022-03-08 10:33:31.143"
          },
          "checked": false,
          "children": [],
          "expanded": false,
          "href": null,
          "icon": null,
          "iconCls": null,
          "index": "16",
          "leaf": true,
          "oid": "BC88822E-6A5A-402F-BFFF-9B7749D9B786",
          "parentBtmName": null,
          "parentId": "",
          "parentName": null,
          "showCheckbox": false,
          "text": "收藏夹[favorite]"
        },
        {
          "attributes": {
            "lastmodifier": "1",
            "revisionseq": "1",
            "versionvalue": "",
            "querycondition": "",
            "description": "",
            "oid": "35E19F40-ADD7-4C80-8391-05ED0CB43C5E",
            "versionseq": "1",
            "checkinby": "",
            "revisionrule": "",
            "lctid": "ObjectLC",
            "lcstatus_text": "编辑中",
            "id": "favoriteimage",
            "owner": "1",
            "checkoutby": "",
            "workcontextoid": "",
            "creator": "1",
            "createtime": "2022-03-08 10:33:31.204",
            "isfirstv": "1",
            "folderoid": "BC88822E-6A5A-402F-BFFF-9B7749D9B786",
            "lastmodifier_name": "测试",
            "revisionoid": "10BBD523-4A84-4074-A76B-20E9DA38B1E6",
            "btmname": "folder",
            "checkouttime": "",
            "revisionvalue": "-",
            "sequence": "1",
            "versionrule": "0",
            "name": "图",
            "islastr": "1",
            "lastmodifytime": "2022-03-08 10:33:31.204",
            "copyfromversion": "",
            "creator_name": "测试",
            "nameoid": "69D3C8CC-9105-4EDF-8840-62A13E8D7A0B",
            "lcstatus": "Editing",
            "secretgrade": "2",
            "islastv": "1",
            "checkintime": "",
            "folderbusinesstype": "favorite",
            "isfirstr": "1",
            "ts": "2022-03-08 10:33:31.204"
          },
          "checked": false,
          "children": [],
          "expanded": false,
          "href": null,
          "icon": null,
          "iconCls": null,
          "index": "17",
          "leaf": true,
          "oid": "35E19F40-ADD7-4C80-8391-05ED0CB43C5E",
          "parentBtmName": null,
          "parentId": "",
          "parentName": null,
          "showCheckbox": false,
          "text": "图[favorite]"
        },
        {
          "attributes": {
            "lastmodifier": "1",
            "revisionseq": "1",
            "versionvalue": "",
            "querycondition": "",
            "description": "",
            "oid": "E5A8F0AD-5B7B-4F95-80CE-9F9B7FFE0138",
            "versionseq": "1",
            "checkinby": "",
            "revisionrule": "",
            "lctid": "ObjectLC",
            "lcstatus_text": "编辑中",
            "id": "",
            "owner": "1",
            "checkoutby": "",
            "workcontextoid": "",
            "creator": "1",
            "createtime": "2022-06-21 11:08:58.156",
            "isfirstv": "1",
            "folderoid": "A0162414-1D57-43CD-995E-D497638ABB37",
            "lastmodifier_name": "测试",
            "revisionoid": "B2940B6C-1806-47D8-9C72-B87508CD71D1",
            "btmname": "folder",
            "checkouttime": "",
            "revisionvalue": "-",
            "sequence": "1",
            "versionrule": "0",
            "name": "2022",
            "islastr": "1",
            "lastmodifytime": "2022-06-21 11:08:58.156",
            "copyfromversion": "",
            "creator_name": "测试",
            "nameoid": "D77C7397-E9CF-49E0-B944-594C5BFAFA16",
            "lcstatus": "Editing",
            "secretgrade": "2",
            "islastv": "1",
            "checkintime": "",
            "folderbusinesstype": "year",
            "isfirstr": "1",
            "ts": "2022-06-21 11:08:58.156"
          },
          "checked": false,
          "children": [],
          "expanded": false,
          "href": null,
          "icon": null,
          "iconCls": null,
          "index": "18",
          "leaf": true,
          "oid": "E5A8F0AD-5B7B-4F95-80CE-9F9B7FFE0138",
          "parentBtmName": null,
          "parentId": "",
          "parentName": null,
          "showCheckbox": false,
          "text": "2022[year]"
        },
        {
          "attributes": {
            "lastmodifier": "1",
            "revisionseq": "1",
            "versionvalue": "",
            "querycondition": "",
            "description": "",
            "oid": "9A474856-C775-4819-9DDE-B54DCE496945",
            "versionseq": "1",
            "checkinby": "",
            "revisionrule": "",
            "lctid": "ObjectLC",
            "lcstatus_text": "编辑中",
            "id": "",
            "owner": "1",
            "checkoutby": "",
            "workcontextoid": "",
            "creator": "1",
            "createtime": "2022-01-05 17:32:03.423",
            "isfirstv": "1",
            "folderoid": "87A6D912-FDCA-496B-AA4E-FBDE9858853B",
            "lastmodifier_name": "测试",
            "revisionoid": "9A49A0C6-8B63-45DB-8CD2-DD963C9C6DC4",
            "btmname": "folder",
            "checkouttime": "",
            "revisionvalue": "-",
            "sequence": "1",
            "versionrule": "0",
            "name": "工具",
            "islastr": "1",
            "lastmodifytime": "2022-01-05 17:32:03.423",
            "copyfromversion": "",
            "creator_name": "测试",
            "nameoid": "F791C662-0D37-4EC1-A0EE-E783BCB293CA",
            "lcstatus": "Editing",
            "secretgrade": "2",
            "islastv": "1",
            "checkintime": "",
            "folderbusinesstype": "tool",
            "isfirstr": "1",
            "ts": "2022-01-05 17:32:03.423"
          },
          "checked": false,
          "children": [],
          "expanded": false,
          "href": null,
          "icon": null,
          "iconCls": null,
          "index": "19",
          "leaf": true,
          "oid": "9A474856-C775-4819-9DDE-B54DCE496945",
          "parentBtmName": null,
          "parentId": "",
          "parentName": null,
          "showCheckbox": false,
          "text": "工具[tool]"
        },
        {
          "attributes": {
            "lastmodifier": "1",
            "revisionseq": "1",
            "versionvalue": "",
            "querycondition": "",
            "description": "",
            "oid": "4B47C04E-229F-4C7F-A4B3-CC9214231EF5",
            "versionseq": "1",
            "checkinby": "",
            "revisionrule": "",
            "lctid": "ObjectLC",
            "lcstatus_text": "编辑中",
            "id": "",
            "owner": "1",
            "checkoutby": "",
            "workcontextoid": "",
            "creator": "1",
            "createtime": "2022-01-06 12:06:29.828",
            "isfirstv": "1",
            "folderoid": "CFA35842-29E6-45D0-99B2-C7F19561E2F1",
            "lastmodifier_name": "测试",
            "revisionoid": "F6AC2A03-504D-4C78-8F48-21B151F8C074",
            "btmname": "folder",
            "checkouttime": "",
            "revisionvalue": "-",
            "sequence": "1",
            "versionrule": "0",
            "name": "常用缩略语",
            "islastr": "1",
            "lastmodifytime": "2022-01-06 14:29:09.804",
            "copyfromversion": "",
            "creator_name": "测试",
            "nameoid": "3E1202E9-17C7-4968-BE75-BB4C20414F9F",
            "lcstatus": "Editing",
            "secretgrade": "2",
            "islastv": "1",
            "checkintime": "",
            "folderbusinesstype": "常用缩略语",
            "isfirstr": "1",
            "ts": "2022-01-06 14:29:09.804"
          },
          "checked": false,
          "children": [],
          "expanded": false,
          "href": null,
          "icon": null,
          "iconCls": null,
          "index": "20",
          "leaf": true,
          "oid": "4B47C04E-229F-4C7F-A4B3-CC9214231EF5",
          "parentBtmName": null,
          "parentId": "",
          "parentName": null,
          "showCheckbox": false,
          "text": "常用缩略语[常用缩略语]"
        },
        {
          "attributes": {
            "lastmodifier": "1",
            "revisionseq": "1",
            "versionvalue": "",
            "querycondition": "",
            "description": "",
            "oid": "64DDC985-FD7D-44A0-A564-4CA52797218B",
            "versionseq": "1",
            "checkinby": "",
            "revisionrule": "",
            "lctid": "ObjectLC",
            "lcstatus_text": "编辑中",
            "id": "",
            "owner": "1",
            "checkoutby": "",
            "workcontextoid": "",
            "creator": "1",
            "createtime": "2022-01-06 12:06:39.949",
            "isfirstv": "1",
            "folderoid": "CFA35842-29E6-45D0-99B2-C7F19561E2F1",
            "lastmodifier_name": "测试",
            "revisionoid": "A66CC240-3BA6-4774-B10D-EB186A95CA07",
            "btmname": "folder",
            "checkouttime": "",
            "revisionvalue": "-",
            "sequence": "1",
            "versionrule": "0",
            "name": "常用工艺标准",
            "islastr": "1",
            "lastmodifytime": "2022-01-06 15:27:59.253",
            "copyfromversion": "",
            "creator_name": "测试",
            "nameoid": "5E947EDA-1922-42F2-97D8-CA536A4043FE",
            "lcstatus": "Editing",
            "secretgrade": "2",
            "islastv": "1",
            "checkintime": "",
            "folderbusinesstype": "常用工艺标准",
            "isfirstr": "1",
            "ts": "2022-01-06 15:27:59.253"
          },
          "checked": false,
          "children": [],
          "expanded": false,
          "href": null,
          "icon": null,
          "iconCls": null,
          "index": "21",
          "leaf": true,
          "oid": "64DDC985-FD7D-44A0-A564-4CA52797218B",
          "parentBtmName": null,
          "parentId": "",
          "parentName": null,
          "showCheckbox": false,
          "text": "常用工艺标准[常用工艺标准]"
        },
        {
          "attributes": {
            "lastmodifier": "1",
            "revisionseq": "1",
            "versionvalue": "",
            "querycondition": "",
            "description": "",
            "oid": "44B91E7B-E8B5-4790-B4E5-2897C75B7E6E",
            "versionseq": "1",
            "checkinby": "",
            "revisionrule": "",
            "lctid": "ObjectLC",
            "lcstatus_text": "编辑中",
            "id": "",
            "owner": "1",
            "checkoutby": "",
            "workcontextoid": "",
            "creator": "1",
            "createtime": "2022-01-06 14:29:39.124",
            "isfirstv": "1",
            "folderoid": "CFA35842-29E6-45D0-99B2-C7F19561E2F1",
            "lastmodifier_name": "测试",
            "revisionoid": "04A16265-5504-4D7C-B947-6A12079E23F2",
            "btmname": "folder",
            "checkouttime": "",
            "revisionvalue": "-",
            "sequence": "1",
            "versionrule": "0",
            "name": "常用工序",
            "islastr": "1",
            "lastmodifytime": "2022-01-06 14:29:39.124",
            "copyfromversion": "",
            "creator_name": "测试",
            "nameoid": "D6FAEABF-E842-43AE-B12F-9FC4CE8B863D",
            "lcstatus": "Editing",
            "secretgrade": "2",
            "islastv": "1",
            "checkintime": "",
            "folderbusinesstype": "工序名称",
            "isfirstr": "1",
            "ts": "2022-01-06 14:29:39.124"
          },
          "checked": false,
          "children": [],
          "expanded": false,
          "href": null,
          "icon": null,
          "iconCls": null,
          "index": "22",
          "leaf": true,
          "oid": "44B91E7B-E8B5-4790-B4E5-2897C75B7E6E",
          "parentBtmName": null,
          "parentId": "",
          "parentName": null,
          "showCheckbox": false,
          "text": "常用工序[工序名称]"
        },
        {
          "attributes": {
            "lastmodifier": "1",
            "revisionseq": "1",
            "versionvalue": "",
            "querycondition": "",
            "description": "",
            "oid": "08143E46-E7F3-4F6C-950C-989749FEBCE5",
            "versionseq": "1",
            "checkinby": "",
            "revisionrule": "",
            "lctid": "ObjectLC",
            "lcstatus_text": "编辑中",
            "id": "",
            "owner": "1",
            "checkoutby": "",
            "workcontextoid": "",
            "creator": "1",
            "createtime": "2022-01-06 14:32:48.245",
            "isfirstv": "1",
            "folderoid": "CFA35842-29E6-45D0-99B2-C7F19561E2F1",
            "lastmodifier_name": "测试",
            "revisionoid": "661ADE9B-D453-403B-B858-937DF8401038",
            "btmname": "folder",
            "checkouttime": "",
            "revisionvalue": "-",
            "sequence": "1",
            "versionrule": "0",
            "name": "常用符号",
            "islastr": "1",
            "lastmodifytime": "2022-01-06 14:32:48.245",
            "copyfromversion": "",
            "creator_name": "测试",
            "nameoid": "8E055006-B25A-48D8-9CE8-C7A3FE41EC83",
            "lcstatus": "Editing",
            "secretgrade": "2",
            "islastv": "1",
            "checkintime": "",
            "folderbusinesstype": "常用符号",
            "isfirstr": "1",
            "ts": "2022-01-06 14:32:48.245"
          },
          "checked": false,
          "children": [],
          "expanded": false,
          "href": null,
          "icon": null,
          "iconCls": null,
          "index": "23",
          "leaf": true,
          "oid": "08143E46-E7F3-4F6C-950C-989749FEBCE5",
          "parentBtmName": null,
          "parentId": "",
          "parentName": null,
          "showCheckbox": false,
          "text": "常用符号[常用符号]"
        },
        {
          "attributes": {
            "lastmodifier": "1",
            "revisionseq": "1",
            "versionvalue": "",
            "querycondition": "",
            "description": "",
            "oid": "8042DD6F-2CB9-41E7-AD9F-E5106B55DFEE",
            "versionseq": "1",
            "checkinby": "",
            "revisionrule": "",
            "lctid": "ObjectLC",
            "lcstatus_text": "编辑中",
            "id": "",
            "owner": "1",
            "checkoutby": "",
            "workcontextoid": "",
            "creator": "1",
            "createtime": "2022-02-08 15:13:31.721",
            "isfirstv": "1",
            "folderoid": "",
            "lastmodifier_name": "测试",
            "revisionoid": "B777905C-97D4-4C74-9EF9-1CDD488C897B",
            "btmname": "folder",
            "checkouttime": "",
            "revisionvalue": "-",
            "sequence": "1",
            "versionrule": "0",
            "name": "部门分类",
            "islastr": "1",
            "lastmodifytime": "2022-02-08 15:13:31.721",
            "copyfromversion": "",
            "creator_name": "测试",
            "nameoid": "E6202A1A-82C2-4D88-8B70-D05D0DF799C6",
            "lcstatus": "Editing",
            "secretgrade": "2",
            "islastv": "1",
            "checkintime": "",
            "folderbusinesstype": "departmentlib",
            "isfirstr": "1",
            "ts": "2022-02-08 15:13:31.721"
          },
          "checked": false,
          "children": [],
          "expanded": false,
          "href": null,
          "icon": null,
          "iconCls": null,
          "index": "24",
          "leaf": true,
          "oid": "8042DD6F-2CB9-41E7-AD9F-E5106B55DFEE",
          "parentBtmName": null,
          "parentId": "",
          "parentName": null,
          "showCheckbox": false,
          "text": "部门分类[departmentlib]"
        },
        {
          "attributes": {
            "lastmodifier": "1",
            "revisionseq": "1",
            "versionvalue": "",
            "querycondition": "",
            "description": "",
            "oid": "F2833B29-EF5D-4D20-9CFB-7E6B6CDCB673",
            "versionseq": "1",
            "checkinby": "",
            "revisionrule": "",
            "lctid": "ObjectLC",
            "lcstatus_text": "编辑中",
            "id": "",
            "owner": "1",
            "checkoutby": "",
            "workcontextoid": "",
            "creator": "1",
            "createtime": "2022-02-08 15:14:23.888",
            "isfirstv": "1",
            "folderoid": "7170DFF8-C1DE-04A8-46F0-BC4379980BC7",
            "lastmodifier_name": "测试",
            "revisionoid": "DB17F69D-11C4-48EA-8417-95602EE3EFA0",
            "btmname": "folder",
            "checkouttime": "",
            "revisionvalue": "-",
            "sequence": "1",
            "versionrule": "0",
            "name": "一车间",
            "islastr": "1",
            "lastmodifytime": "2022-02-08 15:14:23.888",
            "copyfromversion": "",
            "creator_name": "测试",
            "nameoid": "3512BA1D-F688-443E-B55E-AF6699618B63",
            "lcstatus": "Editing",
            "secretgrade": "2",
            "islastv": "1",
            "checkintime": "",
            "folderbusinesstype": "部门分类",
            "isfirstr": "1",
            "ts": "2022-02-08 15:14:23.888"
          },
          "checked": false,
          "children": [],
          "expanded": false,
          "href": null,
          "icon": null,
          "iconCls": null,
          "index": "25",
          "leaf": true,
          "oid": "F2833B29-EF5D-4D20-9CFB-7E6B6CDCB673",
          "parentBtmName": null,
          "parentId": "",
          "parentName": null,
          "showCheckbox": false,
          "text": "一车间[部门分类]"
        },
        {
          "attributes": {
            "lastmodifier": "1",
            "revisionseq": "1",
            "versionvalue": "",
            "querycondition": "",
            "description": "",
            "oid": "6515E8BF-B47B-47CA-8826-E2DD770D90B7",
            "versionseq": "1",
            "checkinby": "",
            "revisionrule": "",
            "lctid": "ObjectLC",
            "lcstatus_text": "编辑中",
            "id": "",
            "owner": "1",
            "checkoutby": "",
            "workcontextoid": "",
            "creator": "1",
            "createtime": "2022-02-08 15:16:11.632",
            "isfirstv": "1",
            "folderoid": "7170DFF8-C1DE-04A8-46F0-BC4379980BC7",
            "lastmodifier_name": "测试",
            "revisionoid": "A0C294B4-42BF-4498-B172-345377F78D15",
            "btmname": "folder",
            "checkouttime": "",
            "revisionvalue": "-",
            "sequence": "1",
            "versionrule": "0",
            "name": "2022",
            "islastr": "1",
            "lastmodifytime": "2022-02-08 15:16:11.632",
            "copyfromversion": "",
            "creator_name": "测试",
            "nameoid": "D086B051-8F7E-40D9-925C-37DE39C2B9E0",
            "lcstatus": "Editing",
            "secretgrade": "2",
            "islastv": "1",
            "checkintime": "",
            "folderbusinesstype": "部门分类",
            "isfirstr": "1",
            "ts": "2022-02-08 15:16:11.632"
          },
          "checked": false,
          "children": [],
          "expanded": false,
          "href": null,
          "icon": null,
          "iconCls": null,
          "index": "26",
          "leaf": true,
          "oid": "6515E8BF-B47B-47CA-8826-E2DD770D90B7",
          "parentBtmName": null,
          "parentId": "",
          "parentName": null,
          "showCheckbox": false,
          "text": "2022[部门分类]"
        },
        {
          "attributes": {
            "lastmodifier": "1",
            "revisionseq": "1",
            "versionvalue": "",
            "querycondition": "",
            "description": "",
            "oid": "CCCC5958-5BAA-49E3-AB76-AF728157C19C",
            "versionseq": "1",
            "checkinby": "",
            "revisionrule": "",
            "lctid": "ObjectLC",
            "lcstatus_text": "编辑中",
            "id": "",
            "owner": "1",
            "checkoutby": "",
            "workcontextoid": "",
            "creator": "1",
            "createtime": "2022-01-05 10:11:51.622",
            "isfirstv": "1",
            "folderoid": "",
            "lastmodifier_name": "测试",
            "revisionoid": "BE298E2C-DE36-40B8-8DA9-8523C3858745",
            "btmname": "folder",
            "checkouttime": "",
            "revisionvalue": "-",
            "sequence": "1",
            "versionrule": "0",
            "name": "材料库",
            "islastr": "1",
            "lastmodifytime": "2022-01-05 10:11:51.622",
            "copyfromversion": "",
            "creator_name": "测试",
            "nameoid": "2DE9AADC-BACF-4ABE-B2D5-BBE6D85D2246",
            "lcstatus": "Editing",
            "secretgrade": "2",
            "islastv": "1",
            "checkintime": "",
            "folderbusinesstype": "materiallib",
            "isfirstr": "1",
            "ts": "2022-01-05 10:11:51.622"
          },
          "checked": false,
          "children": [],
          "expanded": false,
          "href": null,
          "icon": null,
          "iconCls": null,
          "index": "27",
          "leaf": true,
          "oid": "CCCC5958-5BAA-49E3-AB76-AF728157C19C",
          "parentBtmName": null,
          "parentId": "",
          "parentName": null,
          "showCheckbox": false,
          "text": "材料库[materiallib]"
        },
        {
          "attributes": {
            "lastmodifier": "1",
            "revisionseq": "1",
            "versionvalue": "",
            "querycondition": "",
            "description": "",
            "oid": "658EA343-AC20-4AE3-B845-2A2610D3C267",
            "versionseq": "1",
            "checkinby": "",
            "revisionrule": "",
            "lctid": "ObjectLC",
            "lcstatus_text": "编辑中",
            "id": "",
            "owner": "1",
            "checkoutby": "",
            "workcontextoid": "",
            "creator": "1",
            "createtime": "2022-04-12 10:19:29.043",
            "isfirstv": "1",
            "folderoid": "A10C10B6-9C85-4B03-AE65-EFBE4D3433A0",
            "lastmodifier_name": "测试",
            "revisionoid": "586316B0-E80F-456C-BA9A-B90379898F44",
            "btmname": "folder",
            "checkouttime": "",
            "revisionvalue": "-",
            "sequence": "1",
            "versionrule": "0",
            "name": "机加",
            "islastr": "1",
            "lastmodifytime": "2022-04-12 10:19:29.043",
            "copyfromversion": "",
            "creator_name": "测试",
            "nameoid": "96CC24F4-6F24-4F1C-A690-F50425942020",
            "lcstatus": "Editing",
            "secretgrade": "2",
            "islastv": "1",
            "checkintime": "",
            "folderbusinesstype": "specialty",
            "isfirstr": "1",
            "ts": "2022-04-12 10:19:29.043"
          },
          "checked": false,
          "children": [],
          "expanded": false,
          "href": null,
          "icon": null,
          "iconCls": null,
          "index": "28",
          "leaf": true,
          "oid": "658EA343-AC20-4AE3-B845-2A2610D3C267",
          "parentBtmName": null,
          "parentId": "",
          "parentName": null,
          "showCheckbox": false,
          "text": "机加[specialty]"
        },
        {
          "attributes": {
            "lastmodifier": "1",
            "revisionseq": "1",
            "versionvalue": "",
            "querycondition": "",
            "description": "",
            "oid": "DAA0F5E3-9F02-4A92-8551-8C97C6EBEAA0",
            "versionseq": "1",
            "checkinby": "",
            "revisionrule": "",
            "lctid": "ObjectLC",
            "lcstatus_text": "编辑中",
            "id": "",
            "owner": "1",
            "checkoutby": "",
            "workcontextoid": "",
            "creator": "1",
            "createtime": "2022-04-12 10:19:57.716",
            "isfirstv": "1",
            "folderoid": "A10C10B6-9C85-4B03-AE65-EFBE4D3433A0",
            "lastmodifier_name": "测试",
            "revisionoid": "FDD1952A-8D0F-4653-BD4D-D62224ED35C7",
            "btmname": "folder",
            "checkouttime": "",
            "revisionvalue": "-",
            "sequence": "1",
            "versionrule": "0",
            "name": "电装",
            "islastr": "1",
            "lastmodifytime": "2022-04-12 10:19:57.716",
            "copyfromversion": "",
            "creator_name": "测试",
            "nameoid": "AAC2E304-1342-4308-BCF8-CA51D6D5ED44",
            "lcstatus": "Editing",
            "secretgrade": "2",
            "islastv": "1",
            "checkintime": "",
            "folderbusinesstype": "specialty",
            "isfirstr": "1",
            "ts": "2022-04-12 10:19:57.716"
          },
          "checked": false,
          "children": [],
          "expanded": false,
          "href": null,
          "icon": null,
          "iconCls": null,
          "index": "29",
          "leaf": true,
          "oid": "DAA0F5E3-9F02-4A92-8551-8C97C6EBEAA0",
          "parentBtmName": null,
          "parentId": "",
          "parentName": null,
          "showCheckbox": false,
          "text": "电装[specialty]"
        },
        {
          "attributes": {
            "lastmodifier": "1",
            "revisionseq": "1",
            "versionvalue": "",
            "querycondition": "",
            "description": "",
            "oid": "A0162414-1D57-43CD-995E-D497638ABB37",
            "versionseq": "1",
            "checkinby": "",
            "revisionrule": "",
            "lctid": "ObjectLC",
            "lcstatus_text": "编辑中",
            "id": "",
            "owner": "1",
            "checkoutby": "",
            "workcontextoid": "",
            "creator": "1",
            "createtime": "2022-04-12 10:19:47.716",
            "isfirstv": "1",
            "folderoid": "A10C10B6-9C85-4B03-AE65-EFBE4D3433A0",
            "lastmodifier_name": "测试",
            "revisionoid": "EDD708C6-29CC-4187-8988-A7DF33ABBB06",
            "btmname": "folder",
            "checkouttime": "",
            "revisionvalue": "-",
            "sequence": "1",
            "versionrule": "0",
            "name": "一车间(机装)",
            "islastr": "1",
            "lastmodifytime": "2022-04-12 10:19:47.716",
            "copyfromversion": "",
            "creator_name": "测试",
            "nameoid": "66654D96-EF40-4D27-92D6-B4AE5BA5ED02",
            "lcstatus": "Editing",
            "secretgrade": "2",
            "islastv": "1",
            "checkintime": "",
            "folderbusinesstype": "specialty",
            "isfirstr": "1",
            "ts": "2022-04-12 10:19:47.716"
          },
          "checked": false,
          "children": [],
          "expanded": false,
          "href": null,
          "icon": null,
          "iconCls": null,
          "index": "30",
          "leaf": true,
          "oid": "A0162414-1D57-43CD-995E-D497638ABB37",
          "parentBtmName": null,
          "parentId": "",
          "parentName": null,
          "showCheckbox": false,
          "text": "一车间(机装)[specialty]"
        },
        {
          "attributes": {
            "lastmodifier": "1",
            "revisionseq": "1",
            "versionvalue": "",
            "querycondition": "",
            "description": "",
            "oid": "C96EFAED-BC72-4248-B336-8D7B65132A3E",
            "versionseq": "1",
            "checkinby": "",
            "revisionrule": "",
            "lctid": "ObjectLC",
            "lcstatus_text": "编辑中",
            "id": "",
            "owner": "1",
            "checkoutby": "",
            "workcontextoid": "",
            "creator": "1",
            "createtime": "2022-04-12 10:20:20.274",
            "isfirstv": "1",
            "folderoid": "658EA343-AC20-4AE3-B845-2A2610D3C267",
            "lastmodifier_name": "测试",
            "revisionoid": "6C808AB8-609D-4B73-94D2-C73D8B680333",
            "btmname": "folder",
            "checkouttime": "",
            "revisionvalue": "-",
            "sequence": "1",
            "versionrule": "0",
            "name": "2022",
            "islastr": "1",
            "lastmodifytime": "2022-04-12 10:20:20.274",
            "copyfromversion": "",
            "creator_name": "测试",
            "nameoid": "5D01F523-7EE1-4876-AFB0-167FC9CE6265",
            "lcstatus": "Editing",
            "secretgrade": "2",
            "islastv": "1",
            "checkintime": "",
            "folderbusinesstype": "year",
            "isfirstr": "1",
            "ts": "2022-04-12 10:20:20.274"
          },
          "checked": false,
          "children": [],
          "expanded": false,
          "href": null,
          "icon": null,
          "iconCls": null,
          "index": "31",
          "leaf": true,
          "oid": "C96EFAED-BC72-4248-B336-8D7B65132A3E",
          "parentBtmName": null,
          "parentId": "",
          "parentName": null,
          "showCheckbox": false,
          "text": "2022[year]"
        },
        {
          "attributes": {
            "lastmodifier": "1",
            "revisionseq": "1",
            "versionvalue": "",
            "querycondition": "",
            "description": "",
            "oid": "F0B31119-0DC3-460A-9A47-A518993959BE",
            "versionseq": "1",
            "checkinby": "",
            "revisionrule": "",
            "lctid": "ObjectLC",
            "lcstatus_text": "编辑中",
            "id": "favoritetable",
            "owner": "1",
            "checkoutby": "",
            "workcontextoid": "",
            "creator": "1",
            "createtime": "2022-05-12 09:58:34.075",
            "isfirstv": "1",
            "folderoid": "BC88822E-6A5A-402F-BFFF-9B7749D9B786",
            "lastmodifier_name": "测试",
            "revisionoid": "4C155EDE-9C04-468A-B7E1-E140B0DCD89E",
            "btmname": "folder",
            "checkouttime": "",
            "revisionvalue": "-",
            "sequence": "2",
            "versionrule": "0",
            "name": "表",
            "islastr": "1",
            "lastmodifytime": "2022-05-12 09:58:34.075",
            "copyfromversion": "",
            "creator_name": "测试",
            "nameoid": "736A53AA-9F32-4A2F-896B-FD35F094EF52",
            "lcstatus": "Editing",
            "secretgrade": "2",
            "islastv": "1",
            "checkintime": "",
            "folderbusinesstype": "favorite",
            "isfirstr": "1",
            "ts": "2022-05-12 09:58:34.075"
          },
          "checked": false,
          "children": [],
          "expanded": false,
          "href": null,
          "icon": null,
          "iconCls": null,
          "index": "32",
          "leaf": true,
          "oid": "F0B31119-0DC3-460A-9A47-A518993959BE",
          "parentBtmName": null,
          "parentId": "",
          "parentName": null,
          "showCheckbox": false,
          "text": "表[favorite]"
        }
      ];
    }
  },
  data() {
    return {}
    return {
      filterText: '',
      defaultProps: {
        children: 'children',
        label: 'text'
      },
      data:[]
    }
  },
  created() {
    this.initData();
  },
  mounted() {
    console.log(this.$el.clientHeight)
  }
}
</script>
<style scoped>
.filter-tree{
  height: calc(100% - 50px);
  overflow: auto;
  box-sizing: border-box;
  padding-top: 10px;
}
</style>
Source/ProjectWeb/src/components/dynamic-components/index.vue
@@ -27,7 +27,7 @@
                :areasName="areasName"
                :paramVOS="paramVOS"
                :isShow="isShow">
sssss
  </dynamic-tree>
  <dynamic-custom v-else-if="componentVO.uiComponentType=='custom'"  :inDialog="inDialog"
                  :key="areasName+'custom-'+componentVO.oid"
@@ -76,6 +76,8 @@
      default: true
    },
  },
  created() {
  }
}
</script>
Source/ProjectWeb/src/components/refer/BasicClassifyRefer.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,109 @@
<!--通用的分类的参照,只是显示分类树-->
<template>
    <vciWebReferTree
        :key="typeKey"
        :data-key="typeKey"
        :disabled="disabled"
        :referConfig="rConfig"
        :text="textD"
        :title="titleD"
        :value="valueD"
        :width="width"
        :height="height"
        :reloadFormKey="reloadFormKey"
        @setReferValue="setValue">
    </vciWebReferTree>
</template>
<script>
import vciWebReferTree from "./vciWebReferTree.vue";
import {verifyNull} from "@/util/validate";
export default {
  name: "basicClassifyRefer",
  props: {
    referConfig: {
      type: Object,
    }, value: {
      type: String,
      default: ''
    }, text: {
      type: String,
      default: ''
    }, disabled: {
      type: Boolean,
      default: false,
    }, url: {
      type: String,
      default: ''
    }, typeKey: {
      type: String,
      default: ''
    }, referType: {
      type: String,
      default:''
    }, width: {
      type: String,
      default:'70%'
    }, height: {
      type: String,
      default:'60%'
    },
    reloadFormKey: {
      type: String,
      default: '',
    }
  },
  components: {vciWebReferTree },
  data() {
    return {
      emitData: {},
    };
  },
  computed: {
    rConfig() {
      let rConfig = this.referConfig;
      if (!rConfig.options) {
        rConfig.options = {};
      }
      rConfig.options.isMuti = rConfig.options.muti || rConfig.options.isMuti || false;
      rConfig.options.url=this.referConfig.options.url;
      return rConfig;
    },
    titleD(){
      let title = this.referConfig.title || "";
      title = title.replace(":", "");
      title = title
          ? "为【" + title + "】选取值"
          : "为【" + this.referConfig.showProp + "】选取值";
      return title;
    },
    textD(){
      return verifyNull(this.text) ? (this.referConfig.options.defalutText || '') : this.text;
    },
    valueD(){
      return verifyNull(this.value) ? (this.referConfig.options.defalutValue || '') :this.value;
    }
  },
  created() {
  },
  methods: {
    setValue(value) {
      this.emitData = value;
    }
  },
  watch: {
    // ä¿®æ”¹åé¦ˆåˆ°çˆ¶ç»„ä»¶
    emitData: {
      deep: true,
      handler(newV) {
        this.$emit("setReferValue", newV);
      }
    }
  }
};
</script>
<style scoped>
</style>
Source/ProjectWeb/src/components/refer/orgDeptRefer.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,148 @@
<template>
  <div v-if="display">
    <vciWebReferTree
        v-if="referType=='tree'"
        :key="typeKey"
        :data-key="typeKey"
        :disabled="disabled"
        :referConfig="rConfig"
        :text="textD"
        :title="titleD"
        :value="valueD"
        :width="width"
        :height="height"
        :reloadFormKey="reloadFormKey"
        @setReferValue="setValue">
    </vciWebReferTree>
    <vciWebReferTable
        v-else-if="referType=='grid'"
        :key="typeKey"
        :data-key="typeKey"
        :disabled="disabled"
        :referConfig="rConfig"
        :referType="referType"
        :text="textD"
        :title="titleD"
        :value="valueD"
        :width="width"
        :height="height"
        :reloadFormKey="reloadFormKey"
        @setReferValue="setValue">
    </vciWebReferTable>
  </div>
</template>
<script>
import vciWebReferTable from "./vciWebReferTable.vue";
import vciWebReferTree from "./vciWebReferTree.vue";
import {verifyNull} from "@/util/validate";
export default {
  name: "orgDeptRefer",
  props: {
    referConfig: {
      type: Object,
    }, value: {
      type: String,
      default: ''
    }, text: {
      type: String,
      default: ''
    }, disabled: {
      type: Boolean,
      default: false,
    }, display: {
      type: Boolean,
      default: true
    }, typeKey: {
      type: String,
      default: ''
    }, referType: {
      type: String,
      default:''
    }, width: {
      type: String,
      default:'70%'
    }, height: {
      type: String,
      default:'60%'
    },
    reloadFormKey: {
      type: String,
      default: '',
    }
  },
  components: {vciWebReferTable,vciWebReferTree },
  data() {
    return {
      emitData: {},
    };
  },
  computed: {
    rConfig() {
      let rConfig = this.referConfig;
      if (!rConfig.options) {
        rConfig.options = {};
      }
      rConfig.options.isMuti = rConfig.options.muti || rConfig.options.isMuti || false;
      rConfig.options.url='/org/deptController/referGridHasChildren';
      if(this.referType=='grid'){
        rConfig.options.tableConfig={
          cols:[{
            prop: 'code',
            label: '编号',
            sortable: true,
            width: 150,
            search: true
          }, {
            prop: 'name',
            label: '名称',
            sortable: true,
            width: 260,
            search: true
          }, {
            prop: 'description',
            label: '描述'
          }]
        };
      }
      return rConfig;
    },
    titleD(){
      let title = this.referConfig.title || "";
      title = title.replace(":", "");
      title = title
          ? "为【" + title + "】选取值"
          : "为【" + this.referConfig.showProp + "】选取值";
      return title;
    },
    textD(){
      return verifyNull(this.text) ? (this.referConfig.options.defalutText || '') : this.text;
    },
    valueD(){
      return verifyNull(this.value) ? (this.referConfig.options.defalutValue || '') :this.value;
    }
  },
  created() {
  },
  methods: {
    setValue(value) {
      this.emitData = value;
    }
  },
  watch: {
    // ä¿®æ”¹åé¦ˆåˆ°çˆ¶ç»„ä»¶
    emitData: {
      deep: true,
      handler(newV) {
        this.$emit("setReferValue", newV);
      }
    }
  }
};
</script>
<style scoped>
</style>
Source/ProjectWeb/src/components/refer/orgUserRefer.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,148 @@
<template>
  <div v-if="display">
    <vciWebReferClassify
        :key="typeKey" :data-key="typeKey"
        :disabled="disabled"
        :referConfig="rConfig"
        :referType="referType"
        :text="textD"
        :title="titleD"
        :value="valueD"
        :width="width"
        :height="height"
        :reloadFormKey="reloadFormKey"
        @setReferValue="setValue">
    </vciWebReferClassify>
  </div>
</template>
<script>
import vciWebReferClassify from "./vciWebReferClassify.vue";
import {verifyNull} from "@/util/validate";
export default {
  name: "orgUserRefer",
  props: {
    referConfig: {
      type: Object,
    }, value: {
      type: String,
      default: ''
    }, text: {
      type: String,
      default: ''
    }, disabled: {
      type: Boolean,
      default: false,
    }, display: {
      type: Boolean,
      default: true
    }, typeKey: {
      type: String,
      default: ''
    }, referType: {
      type: String,
      default:''
    }, width: {
      type: String,
      default:'70%'
    }, height: {
      type: String,
      default:'60%'
    },
    reloadFormKey: {
      type: String,
      default: '',
    }
  },
  components: {vciWebReferClassify },
  data() {
    return {
      emitData: {},
    };
  },
  computed: {
    rConfig() {
      let rConfig = this.referConfig;
      if (!rConfig.options) {
        rConfig.options = {};
      }
      rConfig.options.isMuti = rConfig.options.muti || rConfig.options.isMuti || false;
      rConfig.options.url='/org/userQueryController/referGrid';
      rConfig.options.width=this.referConfig.options.width || '80%';
      rConfig.options.tableConfig={
        cols:[{
          prop: 'code',
          label: '用户名',
          sortable: true,
          width: 150,
          search: true
        },{
          prop: 'name',
          label: '姓名',
          sortable: true,
          width: 150,
          search: true
        },  {
          prop: 'deptIdName',
          label: '所属部门',
          width: 260,
        },  {
          prop: 'sexText',
          label: '性别',
          width: 80
        }]
      };
      rConfig.options.classifys=[{
        title:'部门',
        treeUrl:'/org/deptController/referGrid', //分类的路径
        queryByClassifyUrl:'/permission/userQueryController/listUserByDeptId',  //'列表'
        queryField:'deptId', //列表数据中分类的字段
        classifyValueField:'id',  //从树上获取的字段
      },{
        title:'角色',
        treeUrl:'/permission/roleController/referGrid', //分类的路径
        queryByClassifyUrl:'/permission/userQueryController/listUserByRoleId',  //'列表'
        queryField:'roleId', //列表数据中分类的字段
        classifyValueField:'id',  //从树上获取的字段
      }];
      rConfig.options.onlyTable=false;
      return rConfig;
    },
    titleD(){
      let title = this.referConfig.title || "";
      title = title.replace(":", "");
      title = title
          ? "为【" + title + "】选取值"
          : "为【" + this.referConfig.showProp + "】选取值";
      return title;
    },
    textD(){
      return verifyNull(this.text) ? (this.referConfig.options.defalutText || '') : this.text;
    },
    valueD(){
      return verifyNull(this.value) ? (this.referConfig.options.defalutValue || '') :this.value;
    }
  },
  created() {
  },
  methods: {
    setValue(value) {
      this.emitData = value;
    }
  },
  watch: {
    // ä¿®æ”¹åé¦ˆåˆ°çˆ¶ç»„ä»¶
    emitData: {
      deep: true,
      handler(newV) {
        this.$emit("setReferValue", newV);
      }
    }
  }
};
</script>
<style scoped>
</style>
Source/ProjectWeb/src/components/refer/vciWebRefer.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,252 @@
<template>
  <div v-if="display">
    <orgDeptRefer
      v-if="refertype == 'dept' || refertype == 'deptGrid'"
      :refer-type="referConfig.options.type == 'dept' ? 'tree' : 'grid'"
      :key="typeKey"
      ref="orgDeptRefer"
      :data-key="typeKey"
      :type-key="typeKey"
      :disabled="disabled"
      :referConfig="rConfig"
      :text="textD"
      :title="title"
      :value="valueD"
      :width="width"
      :height="height"
      :reloadFormKey="reloadFormKey"
      @setReferValue="setValue"
    >
    </orgDeptRefer>
    <basicClassifyRefer
      v-else-if="refertype == 'basicClassify'"
      :key="typeKey"
      ref="basicClassifyRefer"
      :data-key="typeKey"
      :type-key="typeKey"
      :disabled="disabled"
      :referConfig="rConfig"
      :text="textD"
      :title="title"
      :value="valueD"
      :width="width"
      :height="height"
      :reloadFormKey="reloadFormKey"
      @setReferValue="setValue"
    >
    </basicClassifyRefer>
    <orgUserRefer
      v-else-if="refertype == 'user'"
      :refer-type="'grid'"
      :key="typeKey"
      ref="orgUserRefer"
      :data-key="typeKey"
      :type-key="typeKey"
      :disabled="disabled"
      :referConfig="rConfig"
      :text="textD"
      :title="title"
      :value="valueD"
      :width="width"
      :height="height"
      :reloadFormKey="reloadFormKey"
      @setReferValue="setValue"
    >
    </orgUserRefer>
    <vciWebReferTree
      v-else-if="refertype == 'tree'"
      :key="typeKey"
      ref="vciWebReferTree"
      :data-key="typeKey"
      :disabled="disabled"
      :referConfig="rConfig"
      :text="textD"
      :title="title"
      :value="valueD"
      :width="width"
      :height="height"
      :reloadFormKey="reloadFormKey"
      @setReferValue="setValue"
    >
    </vciWebReferTree>
    <vciWebReferTable
      v-else-if="refertype == 'grid'"
      :key="typeKey"
      :data-key="typeKey"
      :disabled="disabled"
      :referConfig="rConfig"
      :referType="referType"
      :text="textD"
      :title="title"
      :value="valueD"
      :width="width"
      :height="height"
      :reloadFormKey="reloadFormKey"
      @setReferValue="setValue"
    >
    </vciWebReferTable>
    <vciWebReferClassify
        v-else-if="refertype=='classify'"
        :key="typeKey" :data-key="typeKey"
        :disabled="disabled"
        :referConfig="rConfig"
        :referType="referType"
        :text="textD"
        :title="title"
        :value="valueD"
        :width="width"
        :height="height"
        :reloadFormKey="reloadFormKey"
        @setReferValue="setValue">
    </vciWebReferClassify>
    <vciWebReferDefalut
      v-else
      :key="typeKey"
      :data-key="typeKey"
      :disabled="disabled"
      :referConfig="rConfig"
      :referType="referType"
      :text="textD"
      :title="title"
      :value="valueD"
      :width="width"
      :height="height"
      :reloadFormKey="reloadFormKey"
      @setReferValue="setValue"
    >
    </vciWebReferDefalut>
  </div>
</template>
<script>
import vciWebReferTree from "./vciWebReferTree.vue";
import vciWebReferTable from "./vciWebReferTable.vue";
import vciWebReferDefalut from "./vciWebReferDefalut.vue";
import vciWebReferClassify from "./vciWebReferClassify.vue";
import orgDeptRefer from "./orgDeptRefer.vue";
import orgUserRefer from "./orgUserRefer.vue";
import basicClassifyRefer from "./BasicClassifyRefer.vue";
import {verifyNull,verifyNotNull} from "@/util/validate";
export default {
  name: "vciWebRefer",
  props: {
    referConfig: {
      type: Object,
    },
    value: {
      type: String,
      default: "",
    },
    text: {
      type: String,
      default: "",
    },
    disabled: {
      type: Boolean,
      default: false,
    },
    display: {
      type: Boolean,
      default: true,
    },
    typeKey: {
      type: String,
      default: "",
    },
    referType: {
      type: String,
      default: "",
    },
    reloadFormKey: {
      type: String,
      default: '',
    }
  },
  components: {
    vciWebReferTree,
    vciWebReferTable,
    vciWebReferDefalut,
    vciWebReferClassify,
    orgDeptRefer,
    orgUserRefer,
    basicClassifyRefer,
  },
  data() {
    return {
      refertype: this.referConfig.options.type,
      emitData: {},
      width:this.referConfig.options.width || '900px',
      height:this.referConfig.options.height || '600px'
    };
  },
  computed: {
    rConfig() {
      let rConfig = this.referConfig;
      if (!rConfig.options) {
        rConfig.options = {};
      }
      rConfig.options.isMuti =
        rConfig.options.muti || rConfig.options.isMuti || false;
      return rConfig;
    },
    title(){
      let title = this.referConfig.title || "";
      title = title.replace(":", "");
      title = title
          ? "为【" + title + "】选取值"
          : "为【" + this.referConfig.showProp + "】选取值";
      return title;
    },
    textD(){
      if(verifyNull(this.text)){
        return (this.referConfig.options.defalutText || '');
      }else{
        return this.text;
      }
    },
    valueD(){
      if(verifyNull(this.value)){
        if(verifyNotNull( this.referConfig.options.defalutValue)){
          this.setValue({
            prop: this.referConfig.prop,
            showProp: this.referConfig.showProp,
            value: this.referConfig.options.defalutValue || '',
            text: this.referConfig.options.defalutText || '',
            isTreeMuti: this.isMuti,
            rawData: [],
            propMap: []
          });
        }
        return (this.referConfig.options.defalutValue || '');
      }else{
        return this.value;
      }
    }
  },
  created() {
  },
  methods: {
    setValue(value) {
      this.emitData = value;
    },
  },
  watch: {
    // ä¿®æ”¹åé¦ˆåˆ°çˆ¶ç»„ä»¶
    emitData: {
      deep: true,
      immediate:true,
      handler(newV) {
        this.$emit("setReferValue", newV);
      },
    }
  },
};
</script>
<style scoped></style>
Source/ProjectWeb/src/components/refer/vciWebReferClassify.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,575 @@
<!--分类参照,左树右列表-->
<template>
  <div>
    <el-dialog
      v-dialogDrag
      :height="options.height || '70vh'"
      :title="title"
      :visible.sync="visible"
      :width="onlyTable?'60%': '80%'"
      :append-to-body="true"
      class="avue-dialog avue-dialog--top"
      @close="dialogClose"
    >
      <el-container>
        <el-aside width="300px" v-if="!onlyTable && classifys.length>0">
          <el-tabs type="border-card" style="height: 100%" @tab-click="tabClick"
                   v-model="tabName">
            <el-tab-pane
              v-for="(treeItem, index) in classifys"
              :key="index"
              :label="treeItem.title"
              :name="'tab'+index"
            >
              <el-input placeholder="输入关键字进行过滤" v-model="filterText">
              </el-input>
              <el-tree
                class="filter-tree"
                :data="treeItem.treeData"
                :lazy="lazy"
                :load="treeLoad"
                :props="treeProps"
                :filter-node-method="filterNode"
                @node-click="nodeClick"
                :ref="'tree'+index"
              >
              </el-tree>
            </el-tab-pane>
          </el-tabs>
        </el-aside>
        <el-main style="padding: 0 0 0 20px">
          <avue-crud
            ref="referCrud"
            v-model="formValue"
            :data="data"
            :option="option"
            :page.sync="page"
            :table-loading="loading"
            @search-change="searchChange"
            @search-reset="searchReset"
            @selection-change="selectionChange"
            @row-click="rowClick"
            @current-change="currentChange"
            @size-change="sizeChange"
            @refresh-change="refreshChange"
            @on-load="onLoad"
          >
            <template slot="icon" slot-scope="scope">
              <i :class="scope.row.icon" style="font-size: 24px"></i>
            </template>
          </avue-crud>
        </el-main>
      </el-container>
      <div class="avue-dialog__footer">
        <div class="avue-dialog__footer--left valueInfo">{{ valueInfo }}</div>
        <el-button @click="escHandler">取 æ¶ˆ</el-button>
        <el-button @click="clearValue">清 ç©º</el-button>
        <el-button type="primary" @click="setValue">ç¡® å®š</el-button>
      </div>
    </el-dialog>
    <el-input v-if="options.edit" class="w100" :clearable="true" v-model="textD" :disabled="disabled" :placeholder="placeholder" type="text" @change="changeValue"  @clear="clearValue">
      <i slot="suffix" class="el-input__icon el-icon-search" style="cursor: pointer" @click="handleFocus"></i>
    </el-input>
    <el-input v-else class="w100" :clearable="true" v-model="textD" :disabled="disabled" :placeholder="placeholder" :readonly="true" type="text"
              @focus="handleFocus" @clear="clearValue"></el-input>
  </div>
</template>
<script>
import { verifyNull } from "@/util/validate";
import { getTree, getLazyTree } from "@/api/refer/tree";
import { getList } from "@/api/refer/table";
export default {
  name: "vciWebReferClassify",
  props: {
    referConfig: {
      type: Object,
    },
    value: {
      type: String,
      default: "",
    },
    text: {
      type: String,
      default: "",
    },
    disabled: {
      type: Boolean,
      default: false,
    },
    title: {
      type: String,
      default: "",
    },
    referType: {
      type: String,
      default: "",
    }, width: {
      type: String,
      default:'70%'
    }, height: {
      type: String,
      default:'60%'
    },
    reloadFormKey: {
      type: String,
      default: '',
    }
  },
  data() {
    return {
      reloadData:this.referConfig.options.reloadData || false,
      visible: false,
      options: this.referConfig.options || {},
      onlyTable: this.referConfig.options.onlyTable || false,
      textD: this.text || '',
      valueD: this.value || '',
      formValue:{},
      classifys:[],
      isMuti:
        "true" == this.referConfig.options.isMuti ||
        this.referConfig.options.isMuti == true ||
        this.referConfig.options.muti == true
          ? true
          : false,
      treeProps: {
        label: "label",
        value: "value",
        children: "children",
      },
      props: {
        value: this.referConfig.valueField || this.referConfig.options.valueField || 'id',
        label: this.referConfig.textField || this.referConfig.options.textField || "name"
      },
      tabName:'tab0',
      currentTreeIndex: 0,
      filterText:'',
      currentNode: {},
      params: {},
      lazy: this.referConfig.options.loadType == 'node',
      loadType: { all: "all", node: "node" },
      url: this.referConfig.options.url || "referGrid",
      query: {},
      loading: false,
      page: {
        layout: "sizes,prev,pager,next,jumper,total",
        pageSize: 10,
        currentPage: 1,
        total: this.referConfig.options.data
          ? this.referConfig.options.data.length
          : 0,
      },
      data: this.referConfig.options.data || [],
      selectionList: [],
      option: {
        addBtn: false,
        columnBtn: false,
        calcHeight: 30,
        tip: false,
        menu: false,
        searchShow: true,
        searchMenuSpan: 6,
        searchLabelWidth: 90,
        border: true,
        index: true,
        selection: true,
        reserveSelection: true,
        dialogClickModal: false,
        highlightCurrentRow: true,
        rowKey: "id",
        rowParentKey: "parentId",
        column: [],
      },
    };
  },
  created() {
    this.options.classifys.forEach(item => {
      return {
        ...item,
        filterText: "1",
        treeData:item.treeData || []
      };
    });
    this.classifys =this.options.classifys;
    this.formValue[this.props.value]=this.valueD;
    this.formValue[this.props.label]=this.textD;
    this.getParams();
  },
  mounted() {
    this.classifys.forEach((item,index) => {
      this.getTree(index);
    });
    if (
      this.referConfig.options.tableConfig &&
      this.referConfig.options.tableConfig.page
    ) {
      this.page.pageSize =
        this.referConfig.options.tableConfig.page.limit ||
        this.referConfig.options.tableConfig.page.pageSize;
      this.page.currentPage =
        this.referConfig.options.tableConfig.page.page ||
        this.referConfig.options.tableConfig.page.currentPage;
    } else if (!verifyNull(this.referConfig.options.limit)) {
      this.page.pageSize = this.referConfig.options.limit;
    } else if (
      this.referConfig.options.tableConfig &&
      !verifyNull(this.referConfig.options.tableConfig.limit)
    ) {
      this.page.pageSize = this.referConfig.options.tableConfig.limit;
    }
    this.$nextTick(() => {
      if (this.visible) {
        this.$refs.referCrud.doLayout();
      }
    });
  },
  watch: {
    text:{
      handler(val) {
        this.textD=val;
      }
    },
    value:{
      handler(val) {
        this.valueD=val;
      }
    },
    filterText(val) {
      this.classifys[this.currentTreeIndex].filterText=val;
      this.$refs['tree'+this.currentTreeIndex][0].filter(val);
    },
    reloadFormKey:{
      handler(val) {
        if(val != this.params[(this.options.paramForFormKey ? this.options.paramForFormKey : this.options.useFormKey)]){
          this.params[(this.options.paramForFormKey ? this.options.paramForFormKey : this.options.useFormKey)] = val;
          this.clearValue();
          this.onLoad(this.page);
        }
      },
    }
  },
  computed: {
    valueInfo: function () {
      return this.text ? "已设置的值为[" + this.text + "]" : "未设置值";
    },
    placeholder: function () {
      return this.options.placeholder ? this.options.placeholder : this.title;
    }
  },
  methods: {
    escHandler() {
      this.visible = false;
      this.$refs.referCrud.refreshTable();
    },
    dialogClose() {
      this.visible = false;
      this.$refs.referCrud.refreshTable();
    },
    tabClick:function (tab){
      this.currentTreeIndex= tab.index;
      this.filterText=this.classifys[tab.index].filterText;
    },
    handleFocus() {
      if (!this.disabled) {
        this.visible = true;
      }
    },
    getTreeParams: function (treeIndex) {
      var queryParams = {};
      if (this.classifys[treeIndex].treeParams) {
        queryParams = this.classifys[treeIndex].treeParams;
      }
      queryParams["referBusCode"] = this.classifys[treeIndex]["referBusCode"];
      /*if (this.classifys[treeIndex].useFormKey && this.options.formValues) {
        //使用表单上的字段来过滤
        queryParams[this.options.paramForFormKey ? this.options.paramForFormKey : this.options.useFormKey] = this.options.formValues[this.options.useFormKey];
      }*/
      if (this.classifys[treeIndex].rootParams) {
        for (let key in this.classifys[treeIndex].rootParams) {
          queryParams[key] = this.classifys[treeIndex].rootParams[key];
        }
      }
      this.classifys[treeIndex].treeParams = queryParams;
    },
    getParams: function () {
      var queryParams = {};
      if (this.options.extraParams) {
        queryParams = this.options.extraParams;
      }
      if (this.options.useFormKey && this.options.formValues) {
        //使用表单上的字段来过滤
        queryParams[ (this.options.paramForFormKey ? this.options.paramForFormKey : this.options.useFormKey)] = this.options.formValues[this.options.useFormKey];
      }
      queryParams['referBusCode'] = this.options['referBusCode'];
      var tableConfig = this.options.tableConfig;
      if (!tableConfig) {
        this.$message.error('没有定义参照的表格配置');
      }
      if (this.options.tableConfig && this.options.tableConfig.cols && this.options.tableConfig.cols.length > 0) {
        //说明传递了的
        this.option.column = this.options.tableConfig.cols.map(item => {
          let formatter = item.formatter;
          if (typeof formatter == "string" && formatter != '') {
            formatter = eval("(" + formatter + ")");
          }
          return {
            ...item,
            formatter: formatter
          };
        });
      }
      this.params = queryParams;
    },
    changeValue(val){
      if(this.options.edit){
        let mapFields =  this.referConfig.propMap || {};
        try {
          if (this.options.propMap) {
            mapFields = Object.assign(mapFields,this.options.propMap);
          }
          if (this.options.mapProps) {
            mapFields = Object.assign(mapFields,this.options.mapProps);
          }
        } catch (e) {
          ;
        }
        this.$emit("setReferValue", {
          prop: this.referConfig.prop,
          showProp: this.referConfig.showProp,
          value: '',
          text: val,
          rawData: [],
          propMap: mapFields
        });
      }
    },
    clearValue(){
      this.valueD = '';
      this.textD = '';
      let mapFields =  this.referConfig.propMap || {};
      try {
        if (this.options.propMap) {
          mapFields = Object.assign(mapFields,this.options.propMap);
        }
        if (this.options.mapProps) {
          mapFields = Object.assign(mapFields,this.options.mapProps);
        }
      } catch (e) {
        ;
      }
      this.$emit("setReferValue", {
        prop: this.referConfig.prop,
        showProp: this.referConfig.showProp,
        value: this.valueD,
        text: this.textD,
        rawData: [],
        propMap: mapFields
      });
      this.visible = false;
    },
    setValue() {
      if (this.selectionList.length == 0) {
        this.$message.warning('没有选择数据');
        return false;
      } else if (this.selectionList.length > 1 && !this.isMuti) {
        this.$message.warning('每次只能选择一条数据');
        return false;
      }
      let value = [];
      let text = [];
      let isMutiValue = (this.props.value.indexOf(",") > -1);
      let isMutiRaw = (this.props.label.indexOf(",") > -1);
      var _that = this;
      this.selectionList.forEach((item) => {
        if (isMutiValue) {
          var valueFieldArray = _that.props.value.split(",");
          valueFieldArray.forEach((_itemField) => {
            let itemValue = item[_itemField];
            if (verifyNull(itemValue) && item['extendData']) {
              itemValue = item['extendData'][_itemField];
            }
            value.push(itemValue + (_that.referConfig.valueSep ? _that.referConfig.valueSep : ' '));
          });
        } else {
          let itemValue = item[_that.props.value];
          if (verifyNull(itemValue) && item['extendData']) {
            itemValue = item['extendData'][_that.props.value];
          }
          value.push(itemValue);
        }
        if (isMutiRaw) {
          var rawFieldArray = _that.props.label.split(",");
          rawFieldArray.forEach((_itemField) => {
            let itemText = item[_itemField];
            if (verifyNull(itemText) && item['extendData']) {
              itemText = item['extendData'][_itemField];
            }
            text.push(itemText + (_that.referConfig.textSep ? _that.referConfig.textSep : ' '));
          });
        } else {
          let itemText = item[_that.props.label];
          if (verifyNull(itemText) && item['extendData']) {
            itemText = item['extendData'][_that.props.label];
          }
          text.push(itemText);
        }
      });
      let mapFields =  this.referConfig.propMap || {};
      try {
        if (this.options.propMap) {
          mapFields = Object.assign(mapFields,this.options.propMap);
        }
        if (this.options.mapProps) {
          mapFields = Object.assign(mapFields,this.options.mapProps);
        }
      } catch (e) {
        ;
      }
      this.valueD = value.join(',');
      this.textD = text.join(',');
      this.$emit("setReferValue", {
        prop: this.referConfig.prop,
        showProp: this.referConfig.showProp,
        value: this.valueD,
        text: this.textD,
        rawData: this.selectionList,
        propMap: mapFields
      });
      this.visible = false;
    },
    searchReset() {
      this.query = {};
      this.onLoad(this.page);
    },
    searchChange(params, done) {
      this.query = params;
      this.page.currentPage = 1;
      this.onLoad(this.page);
      done();
    },
    currentChange(currentPage) {
      this.page.currentPage = currentPage;
    },
    sizeChange(pageSize) {
      this.page.pageSize = pageSize;
    },
    rowClick(row) {
      this.$refs.referCrud.toggleSelection();
      this.$refs.referCrud.toggleRowSelection(row); //选中当前行
      this.selectionList = [row];
    },
    selectionChange(list) {
      if (!this.isMuti && list.length > 1) {
        const nowVal = list.shift();
        this.$refs.referCrud.toggleRowSelection(nowVal, false);
      }
      this.selectionList = list;
    },
    selectionClear() {
      this.selectionList = [];
      this.$refs.referCrud.toggleSelection();
    },
    refreshChange() {
      this.onLoad(this.page, this.query);
    },
    onLoad(page, params = {}) {
      if (this.url) {
        this.loading = true;
        getList(
          Object.assign(params, this.params, this.query),
          page.currentPage,
          page.pageSize,
          this.url
        )
          .then((res) => {
            let data = [];
            if (res.data && res.data.data) {
              data = res.data.data;
              this.page.total = res.data.total;
            } else {
              data = res.data;
              this.page.total = res.total;
            }
            if(!data || data == null){
              data = [];
            }
            this.data = data;
            this.loading = false;
            this.selectionClear();
          })
          .catch((error) => {
            this.$message.error(error);
            this.loading = false;
          });
      }
    },
    getTree(treeIndex) {
      this.getTreeParams(treeIndex);
      //加载全部
      getTree(this.classifys[treeIndex].treeParams, this.classifys[treeIndex].treeUrl).then((res) => {
        this.classifys[treeIndex].treeData = this.initTreeData(res.data);
      });
    },
    treeLoad: function (treeNode, resolve) {
      //逐级加载
      const parentId = treeNode.level === 0 ? 0 : treeNode.data.attributes.id;
      this.classifys[this.currentTreeIndex].treeParams.parentId =  parentId;
      this.classifys[this.currentTreeIndex].treeParams.parentValue = parentId;
      if (this.options.rootParams && treeNode.level !== 0) {
        for (var key in this.options.rootParams) {
          delete this.classifys[this.currentTreeIndex].treeParams[key];
        }
      }
      getLazyTree(this.classifys[this.currentTreeIndex].treeParams, this.classifys[this.currentTreeIndex].treeUrl).then((res) => {
        resolve(this.initTreeData(res.data));
      });
    },
    initTreeData: function (nodes) {
      let treeData = [];
      nodes.forEach((item) => {
        let children = item.children;
        if (children) {
          children = this.initTreeData(children);
        }
        treeData.push({
          label: item[this.props.label],
          value: item[this.props.value],
          leaf: !item.children,
          children: children,
          attributes: item,
        });
      });
      return treeData;
    },
    filterNode(value, data) {
      if (!value) return true;
      return data.label.indexOf(value) !== -1;
    },
    nodeClick(data) {
      let where = {};
      let classifyValueField = this.classifys[this.currentTreeIndex].classifyValueField?this.classifys[this.currentTreeIndex].classifyValueField:'id';
      where[this.classifys[this.currentTreeIndex].queryField] = data.attributes[classifyValueField];
      this.url = this.classifys[this.currentTreeIndex].queryByClassifyUrl || this.options.url;
      this.page.currentPage=1;
      this.onLoad(this.page, where);
    },
  },
};
</script>
<style scoped>
.valueInfo {
  float: left;
  border: 1px solid #e9e7e7;
  display: inline-block;
  vertical-align: middle;
  padding: 6px 15px;
  line-height: 1;
}
</style>
Source/ProjectWeb/src/components/refer/vciWebReferDefalut.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,427 @@
<template>
  <div>
    <el-dialog v-dialogDrag
               :height="options.height|| 'auto'" :title="title"
               :visible.sync="visible"
               :width="options.width|| '450'"
               :append-to-body="true"
               class="avue-dialog avue-dialog--top"
               @close="dialogClose">
      <avue-crud ref="referDefalutCrud"
                 v-model="formValue"
                 :data="data"
                 :option="option"
                 :page.sync="page"
                 :table-loading="loading"
                 @search-change="searchChange"
                 @search-reset="searchReset"
                 @selection-change="selectionChange"
                 @row-click="rowClick"
                 @current-change="currentChange"
                 @size-change="sizeChange"
                 @refresh-change="refreshChange"
                 @on-load="onLoad">
      </avue-crud>
      <div class="avue-dialog__footer">
        <div class="avue-dialog__footer--left valueInfo">{{ valueInfo }}</div>
        <el-button @click="escHandler">取 æ¶ˆ</el-button>
        <el-button @click="clearValue">清 ç©º</el-button>
        <el-button type="primary" @click="setValue">ç¡® å®š</el-button>
      </div>
    </el-dialog>
    <el-input v-if="options.edit" class="w100" :clearable="true" v-model="textD" :disabled="disabled" :placeholder="placeholder" type="text" @change="changeValue"  @clear="clearValue">
      <i slot="suffix" class="el-input__icon el-icon-search" style="cursor: pointer" @click="handleFocus"></i>
    </el-input>
    <el-input v-else class="w100" :clearable="true" v-model="textD" :disabled="disabled" :placeholder="placeholder" :readonly="true" type="text"
              @focus="handleFocus" @clear="clearValue"></el-input>
  </div>
</template>
<script>
import {verifyNull} from "@/util/validate";
import {getList} from "@/api/refer/table";
export default {
  name: "vciWebReferDefalut",
  props: {
    referConfig: {
      type: Object,
    },
    value: {
      type: String,
      default: ''
    },
    text: {
      type: String,
      default: ''
    },
    disabled: {
      type: Boolean,
      default: false,
    },
    title: {
      type: String,
      default:''
    },
    referType: {
      type: String,
      default:''
    }, width: {
      type: String,
      default:'70%'
    }, height: {
      type: String,
      default:'60%'
    },
    reloadFormKey: {
      type: String,
      default: '',
    }
  } ,
  data() {
    return {
      reloadData:this.referConfig.options.reloadData || false,
      visible: false,
      options: this.referConfig.options || {},
      textD: this.text || '',
      valueD: this.value || '',
      formValue:{},
      isMuti: ("true" == this.referConfig.options.isMuti || this.referConfig.options.isMuti == true || this.referConfig.options.muti == true) ? true : false,
      props: {
        value: this.referConfig.valueField || this.referConfig.options.valueField || 'id',
        label: this.referConfig.textField || this.referConfig.options.textField || "name"
      },
      url: this.referConfig.options.url || '/referGrid',
      method: this.referConfig.options.method || 'GET',
      query: {},
      loading: false,
      page: {
        layout: "sizes,prev,pager,next,jumper,total",
        pageSize: 10,
        currentPage: 1,
        total: this.referConfig.options.data ? this.referConfig.options.data.length : 0
      },
      data: this.referConfig.options.data || [],
      selectionList: [],
      option: {
        addBtn: false,
        columnBtn: false,
        calcHeight: 30,
        tip: false,
        menu: false,
        searchShow: true,
        searchMenuSpan: 6,
        searchLabelWidth: 90,
        border: true,
        index: true,
        selection: true,
        reserveSelection: true,
        dialogClickModal: false,
        highlightCurrentRow: true,
        rowKey: 'id',
        rowParentKey: 'parentId',
        column: []
      }
    };
  },
  created() {
    this.formValue[this.props.value]=this.valueD;
    this.formValue[this.props.label]=this.textD;
    this.getParams();
  },
  mounted() {
    if (this.referConfig.options.tableConfig && this.referConfig.options.tableConfig.page) {
      this.page.pageSize = this.referConfig.options.tableConfig.page.limit || this.referConfig.options.tableConfig.page.pageSize;
      this.page.currentPage = this.referConfig.options.tableConfig.page.page || this.referConfig.options.tableConfig.page.currentPage;
    } else if (!verifyNull(this.referConfig.options.limit)) {
      this.page.pageSize = this.referConfig.options.limit;
    } else if (this.referConfig.options.tableConfig && !verifyNull(this.referConfig.options.tableConfig.limit)) {
      this.page.pageSize = this.referConfig.options.tableConfig.limit;
    }
    this.$nextTick(() => {
      if(this.visible){
        this.$refs.referDefalutCrud.doLayout();
      }
    });
  },
  watch:{
    text:{
      handler(val) {
        this.textD=val;
      }
    },
    value:{
      handler(val) {
        this.valueD=val;
      }
    },
    reloadFormKey:{
      handler(val) {
        if(val != this.params[(this.options.paramForFormKey ? this.options.paramForFormKey : this.options.useFormKey)]){
          this.params[(this.options.paramForFormKey ? this.options.paramForFormKey : this.options.useFormKey)] = val;
          this.clearValue();
          this.onLoad(this.page);
        }
      },
    }
  },
  computed: {
    valueInfo: function () {
      return this.text ? ("已设置的值为[" + this.text + "]") : '未设置值';
    },
    placeholder: function () {
      return this.options.placeholder ? this.options.placeholder : this.title;
    }
  },
  methods: {
    escHandler() {
      this.visible = false;
      this.$refs.referDefalutCrud.refreshTable();
    },
    dialogClose() {
      this.visible = false;
      this.$refs.referDefalutCrud.refreshTable();
    },
    handleFocus() {
      if (!this.disabled) {
        this.visible = true;
      }
    },
    getParams: function () {
      var queryParams = {};
      if (this.options.extraParams) {
        queryParams = this.options.extraParams;
      }
      if (this.options.useFormKey && this.options.formValues) {
        //使用表单上的字段来过滤
        queryParams[ (this.options.paramForFormKey ? this.options.paramForFormKey : this.options.useFormKey)] = this.options.formValues[this.options.useFormKey];
      }
      queryParams['referBusCode'] =this.options['referBusCode'];
      if (!this.options.tableConfig || !this.options.tableConfig.cols || this.options.tableConfig.cols.length == 0) {
        this.option.column = [{
          prop: 'code',
          label: '编号',
          sortable: true,
          width: 150,
          search: true
        }, {
          prop: 'name',
          label: '名称',
          sortable: true,
          width: 260,
          search: true
        }, {
          prop: 'description',
          label: '描述'
        }, {
          prop: 'secretShow',
          label: '密级',
          width: 60,
          hide: (!this.controllerSecret)
        }];
      } else {
        this.option.column = this.options.tableConfig.cols.map(item => {
          let formatter = item.formatter;
          if (typeof formatter == "string" && formatter != '') {
            formatter = eval("(" + formatter + ")");
          }
          return {
            ...item,
            formatter: formatter
          };
        });
      }
      this.params = queryParams;
    },
    changeValue(val){
      if(this.options.edit){
        let mapFields =  this.referConfig.propMap || {};
        try {
          if (this.options.propMap) {
            mapFields = Object.assign(mapFields,this.options.propMap);
          }
          if (this.options.mapProps) {
            mapFields = Object.assign(mapFields,this.options.mapProps);
          }
        } catch (e) {
          ;
        }
        this.$emit("setReferValue", {
          prop: this.referConfig.prop,
          showProp: this.referConfig.showProp,
          value: '',
          text: val,
          rawData: [],
          propMap: mapFields
        });
      }
    },
    clearValue(){
      this.valueD = '';
      this.textD = '';
      let mapFields =  this.referConfig.propMap || {};
      try {
        if (this.options.propMap) {
          mapFields = Object.assign(mapFields,this.options.propMap);
        }
        if (this.options.mapProps) {
          mapFields = Object.assign(mapFields,this.options.mapProps);
        }
      } catch (e) {
        ;
      }
      this.$emit("setReferValue", {
        prop: this.referConfig.prop,
        showProp: this.referConfig.showProp,
        value: this.valueD,
        text: this.textD,
        rawData: [],
        propMap: mapFields
      });
      this.visible = false;
    },
    setValue() {
      if (this.selectionList.length == 0) {
        this.$message.warning('没有选择数据');
        return false;
      } else if (this.selectionList.length > 1 && !this.isMuti) {
        this.$message.warning('每次只能选择一条数据');
        return false;
      }
      let value = [];
      let text = [];
      let isMutiValue = (this.props.value.indexOf(",") > -1);
      let isMutiRaw = (this.props.label.indexOf(",") > -1);
      var _that = this;
      this.selectionList.forEach((item) => {
        if (isMutiValue) {
          var valueFieldArray = _that.props.value.split(",");
          valueFieldArray.forEach((_itemField) => {
            let itemValue = item[_itemField];
            if (verifyNull(itemValue) && item['extendData']) {
              itemValue = item['extendData'][_itemField];
            }
            value.push(itemValue + (_that.referConfig.valueSep ? _that.referConfig.valueSep : ' '));
          });
        } else {
          let itemValue = item[_that.props.value];
          if (verifyNull(itemValue) && item['extendData']) {
            itemValue = item['extendData'][_that.props.value];
          }
          value.push(itemValue);
        }
        if (isMutiRaw) {
          var rawFieldArray = _that.props.label.split(",");
          rawFieldArray.forEach((_itemField) => {
            let itemText = item[_itemField];
            if (verifyNull(itemText) && item['extendData']) {
              itemText = item['extendData'][_itemField];
            }
            text.push(itemText + (_that.referConfig.textSep ? _that.referConfig.textSep : ' '));
          });
        } else {
          let itemText = item[_that.props.label];
          if (verifyNull(itemText) && item['extendData']) {
            itemText = item['extendData'][_that.props.label];
          }
          text.push(itemText);
        }
      });
      let mapFields =  this.referConfig.propMap || {};
      try {
        if (this.options.propMap) {
          mapFields = Object.assign(mapFields,this.options.propMap);
        }
        if (this.options.mapProps) {
          mapFields = Object.assign(mapFields,this.options.mapProps);
        }
      } catch (e) {
        ;
      }
      this.valueD = value.join(',');
      this.textD = text.join(',');
      this.$emit("setReferValue", {
        prop: this.referConfig.prop,
        showProp: this.referConfig.showProp,
        value: this.valueD,
        text: this.textD,
        rawData: this.selectionList,
        propMap: mapFields
      });
      this.visible = false;
    },
    searchReset() {
      this.query = {};
      this.onLoad(this.page);
    },
    searchChange(params, done) {
      this.query = params;
      this.page.currentPage = 1;
      this.onLoad(this.page);
      done();
    },
    currentChange(currentPage) {
      this.page.currentPage = currentPage;
    },
    sizeChange(pageSize) {
      this.page.pageSize = pageSize;
    },
    rowClick(row) {
      this.$refs.referDefalutCrud.toggleSelection();
      this.$refs.referDefalutCrud.toggleRowSelection(row); //选中当前行
      this.selectionList = [row];
    },
    selectionChange(list) {
      if (!this.isMuti && list.length > 1) {
        const nowVal = list.shift();
        this.$refs.referDefalutCrud.toggleRowSelection(nowVal, false);
      }
      this.selectionList = list;
    },
    selectionClear() {
      this.selectionList = [];
      this.$refs.referDefalutCrud.toggleSelection();
    },
    refreshChange() {
      this.onLoad(this.page, this.query);
    },
    onLoad(page, params = {}) {
      if (this.url) {
        this.loading = true;
        getList(Object.assign(params, this.params, this.query), page.currentPage, page.pageSize, this.url, this.method).then(res => {
          let data = [];
          if (res.data && res.data.data) {
            data = res.data.data;
            this.page.total = res.data.total;
          } else {
            data = res.data;
            this.page.total = res.total;
          }
          if(!data || data == null){
            data = [];
          }
          this.data = data;
          this.loading = false;
          this.selectionClear();
        }).catch(error => {
          this.$message.error(error);
          this.loading = false;
        });
      }
    },
  }
};
</script>
<style scoped>
.valueInfo {
  float: left;
  border: 1px solid #E9E7E7;
  display: inline-block;
  vertical-align: middle;
  padding: 6px 15px;
  line-height: 1;
}
</style>
Source/ProjectWeb/src/components/refer/vciWebReferTable.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,414 @@
<template>
  <div>
    <el-dialog v-dialogDrag
               :height="height|| 'auto'" :title="title"
               :visible.sync="visible"
               :width="width"
               :append-to-body="true"
               class="avue-dialog avue-dialog--top"
               @close="dialogClose">
      <avue-crud ref="referCrud"
                 v-model="formValue"
                 :data="data"
                 :option="option"
                 :page.sync="page"
                 :table-loading="loading"
                 @search-change="searchChange"
                 @search-reset="searchReset"
                 @selection-change="selectionChange"
                 @row-click="rowClick"
                 @current-change="currentChange"
                 @size-change="sizeChange"
                 @refresh-change="refreshChange"
                 @on-load="onLoad">
        <template slot="icon" slot-scope="scope">
          <i :class="scope.row.icon" style="font-size:24px"></i>
        </template>
      </avue-crud>
      <div class="avue-dialog__footer">
        <div class="avue-dialog__footer--left valueInfo">{{ valueInfo }}</div>
        <el-button @click="escHandler">取 æ¶ˆ</el-button>
        <el-button @click="clearValue">清 ç©º</el-button>
        <el-button type="primary" @click="setValue">ç¡® å®š</el-button>
      </div>
    </el-dialog>
    <el-input v-if="options.edit" class="w100" :clearable="true" v-model="textD" :disabled="disabled" :placeholder="placeholder" type="text" @change="changeValue"  @clear="clearValue">
      <i slot="suffix" class="el-input__icon el-icon-search" style="cursor: pointer" @click="handleFocus"></i>
    </el-input>
    <el-input v-else class="w100" :clearable="true" v-model="textD" :disabled="disabled" :placeholder="placeholder" :readonly="true" type="text"
              @focus="handleFocus" @clear="clearValue"></el-input>
  </div>
</template>
<script>
import {verifyNull} from "@/util/validate";
import {getList} from "@/api/refer/table";
export default {
  name: "vciWebReferTable",
  props: {
    referConfig: {
      type: Object,
    },
    value: {
      type: String,
      default: ''
    },
    text: {
      type: String,
      default: ''
    },
    disabled: {
      type: Boolean,
      default: false,
    },
    title: {
      type: String,
      default:''
    },
    referType: {
      type: String,
      default:''
    }, width: {
      type: String,
      default:'70%'
    }, height: {
      type: String,
      default:'60%'
    },
    reloadFormKey: {
      type: String,
      default: '',
    }
  },
  data() {
    return {
      reloadData:this.referConfig.options.reloadData || false,
      visible: false,
      options: this.referConfig.options || {},
      textD: this.text || '',
      valueD: this.value || '',
      formValue:{},
      isMuti: ("true" == this.referConfig.options.isMuti || this.referConfig.options.isMuti == true || this.referConfig.options.muti == true) ? true : false,
      props: {
        value: this.referConfig.valueField || this.referConfig.options.valueField || 'id',
        label: this.referConfig.textField || this.referConfig.options.textField || "name"
      },
      url: this.referConfig.options.url || 'referGrid',
      method: this.referConfig.options.method || 'get',
      query: {},
      loading: false,
      page: {
        layout:  "sizes,prev,pager,next,jumper,total",
        pageSize: 10,
        currentPage: 1,
        total: this.referConfig.options.data ? this.referConfig.options.data.length : 0
      },
      data: this.referConfig.options.data || [],
      selectionList: [],
      option: {
        addBtn: false,
        columnBtn: false,
        calcHeight: 30,
        tip: false,
        menu: false,
        searchShow: true,
        searchMenuSpan: 6,
        searchLabelWidth: 90,
        border: true,
        index: true,
        selection: true,
        reserveSelection: true,
        dialogClickModal: false,
        highlightCurrentRow: true,
        rowKey: 'id',
        rowParentKey: 'parentId',
        column: []
      }
    };
  },
  created() {
    this.formValue[this.props.value]=this.valueD;
    this.formValue[this.props.label]=this.textD;
    this.getParams();
  },
  mounted() {
    if (this.referConfig.options.tableConfig && this.referConfig.options.tableConfig.page) {
      this.page.pageSize = this.referConfig.options.tableConfig.page.limit || this.referConfig.options.tableConfig.page.pageSize;
      this.page.currentPage = this.referConfig.options.tableConfig.page.page || this.referConfig.options.tableConfig.page.currentPage;
    } else if (!verifyNull(this.referConfig.options.limit)) {
      this.page.pageSize = this.referConfig.options.limit;
    } else if (this.referConfig.options.tableConfig && !verifyNull(this.referConfig.options.tableConfig.limit)) {
      this.page.pageSize = this.referConfig.options.tableConfig.limit;
    }
    this.$nextTick(() => {
      if(this.visible){
        this.$refs.referCrud.doLayout();
      }
    });
  },
  watch:{
    text:{
      handler(val) {
        this.textD=val;
      }
    },
    value:{
      handler(val) {
        this.valueD=val;
      }
    },
    reloadFormKey:{
      handler(val) {
        if(val != this.params[(this.options.paramForFormKey ? this.options.paramForFormKey : this.options.useFormKey)]){
          this.params[(this.options.paramForFormKey ? this.options.paramForFormKey : this.options.useFormKey)] = val;
          this.clearValue();
          this.onLoad(this.page);
        }
      },
    },
  },
  computed: {
    valueInfo: function () {
      return this.text ? ("已设置的值为[" + this.text + "]") : '未设置值';
    },
    placeholder: function () {
      return this.options.placeholder ? this.options.placeholder : this.title;
    }
  },
  methods: {
    escHandler() {
      this.visible = false;
      this.$refs.referCrud.refreshTable();
    },
    dialogClose() {
      this.visible = false;
      this.$refs.referCrud.refreshTable();
    },
    handleFocus() {
      if (!this.disabled) {
        this.visible = true;
      }
    },
    getParams: function () {
      var queryParams = {};
      if (this.options.extraParams) {
        queryParams = this.options.extraParams;
      }
      if (this.options.useFormKey && this.options.formValues) {
        //使用表单上的字段来过滤
        queryParams[ (this.options.paramForFormKey ? this.options.paramForFormKey : this.options.useFormKey)] = this.options.formValues[this.options.useFormKey];
      }
      queryParams['referBusCode'] = this.options['referBusCode'];
      //说明是自定义的表格
      var tableConfig = this.options.tableConfig;
      if (!tableConfig) {
        this.$message.error('没有定义参照的表格配置');
      }
      if (this.options.tableConfig && this.options.tableConfig.cols && this.options.tableConfig.cols.length > 0) {
        //说明传递了的
        this.option.column = this.options.tableConfig.cols.map(item => {
          let formatter = item.formatter;
          if (typeof formatter == "string" && formatter != '') {
            formatter = eval("(" + formatter + ")");
          }
          return {
            ...item,
            formatter: formatter
          };
        });
      }
      this.params = queryParams;
    },
    changeValue(val){
      if(this.options.edit){
        let mapFields =  this.referConfig.propMap || {};
        try {
          if (this.options.propMap) {
            mapFields = Object.assign(mapFields,this.options.propMap);
          }
          if (this.options.mapProps) {
            mapFields = Object.assign(mapFields,this.options.mapProps);
          }
        } catch (e) {
          ;
        }
        this.$emit("setReferValue", {
          prop: this.referConfig.prop,
          showProp: this.referConfig.showProp,
          value: '',
          text: val,
          rawData: [],
          propMap: mapFields
        });
      }
    },
    clearValue(){
      this.valueD = '';
      this.textD = '';
      let mapFields =  this.referConfig.propMap || {};
      try {
        if (this.options.propMap) {
          mapFields = Object.assign(mapFields,this.options.propMap);
        }
        if (this.options.mapProps) {
          mapFields = Object.assign(mapFields,this.options.mapProps);
        }
      } catch (e) {
        ;
      }
      this.$emit("setReferValue", {
        prop: this.referConfig.prop,
        showProp: this.referConfig.showProp,
        value: this.valueD,
        text: this.textD,
        rawData: [],
        propMap: mapFields
      });
      this.visible = false;
    },
    setValue() {
      if (this.selectionList.length == 0) {
        this.$message.warning('没有选择数据');
        return false;
      } else if (this.selectionList.length > 1 && !this.isMuti) {
        this.$message.warning('每次只能选择一条数据');
        return false;
      }
      let value = [];
      let text = [];
      let isMutiValue = (this.props.value.indexOf(",") > -1);
      let isMutiRaw = (this.props.label.indexOf(",") > -1);
      var _that = this;
      this.selectionList.forEach((item) => {
        if (isMutiValue) {
          var valueFieldArray = _that.props.value.split(",");
          valueFieldArray.forEach((_itemField) => {
            let itemValue = item[_itemField];
            if (verifyNull(itemValue) && item['extendData']) {
              itemValue = item['extendData'][_itemField];
            }
            value.push(itemValue + (_that.referConfig.valueSep ? _that.referConfig.valueSep : ' '));
          });
        } else {
          let itemValue = item[_that.props.value];
          if (verifyNull(itemValue) && item['extendData']) {
            itemValue = item['extendData'][_that.props.value];
          }
          value.push(itemValue);
        }
        if (isMutiRaw) {
          var rawFieldArray = _that.props.label.split(",");
          rawFieldArray.forEach((_itemField) => {
            let itemText = item[_itemField];
            if (verifyNull(itemText) && item['extendData']) {
              itemText = item['extendData'][_itemField];
            }
            text.push(itemText + (_that.referConfig.textSep ? _that.referConfig.textSep : ' '));
          });
        } else {
          let itemText = item[_that.props.label];
          if (verifyNull(itemText) && item['extendData']) {
            itemText = item['extendData'][_that.props.label];
          }
          text.push(itemText);
        }
      });
      let mapFields =  this.referConfig.propMap || {};
      try {
        if (this.options.propMap) {
          mapFields = Object.assign(mapFields,this.options.propMap);
        }
        if (this.options.mapProps) {
          mapFields = Object.assign(mapFields,this.options.mapProps);
        }
      } catch (e) {
        ;
      }
      this.valueD = value.join(',');
      this.textD = text.join(',');
      this.$emit("setReferValue", {
        prop: this.referConfig.prop,
        showProp: this.referConfig.showProp,
        value: this.valueD,
        text: this.textD,
        rawData: this.selectionList,
        propMap: mapFields
      });
      this.visible = false;
    },
    searchReset() {
      this.query = {};
      this.onLoad(this.page);
    },
    searchChange(params, done) {
      this.query = params;
      this.page.currentPage = 1;
      this.onLoad(this.page);
      done();
    },
    currentChange(currentPage) {
      this.page.currentPage = currentPage;
    },
    sizeChange(pageSize) {
      this.page.pageSize = pageSize;
    },
    rowClick(row) {
      this.$refs.referCrud.toggleSelection();
      this.$refs.referCrud.toggleRowSelection(row); //选中当前行
      this.selectionList = [row];
    },
    selectionChange(list) {
      if (!this.isMuti && list.length > 1) {
        const nowVal = list.shift();
        this.$refs.referCrud.toggleRowSelection(nowVal, false);
      }
      this.selectionList = list;
    },
    selectionClear() {
      this.selectionList = [];
      this.$refs.referCrud.toggleSelection();
    },
    refreshChange() {
      this.onLoad(this.page, this.query);
    },
    onLoad(page, params = {}) {
      if (this.url) {
        this.loading = true;
        getList(Object.assign(params, this.params, this.query), page.currentPage, page.pageSize, this.url,this.method).then(res => {
          let data = [];
          if (res.data && res.data.data) {
            data = res.data.data;
            this.page.total = res.data.total;
          } else {
            data = res.data;
            this.page.total = res.total;
          }
          if(!data || data == null){
            data = [];
          }
          this.data = data;
          this.loading = false;
          this.selectionClear();
        }).catch(error => {
          this.$message.error(error);
          this.loading = false;
        });
      }
    },
  }
};
</script>
<style scoped>
.valueInfo {
  float: left;
  border: 1px solid #E9E7E7;
  display: inline-block;
  vertical-align: middle;
  padding: 6px 15px;
  line-height: 1;
}
</style>
Source/ProjectWeb/src/components/refer/vciWebReferTree.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,260 @@
<template>
  <avue-input-tree ref="referTree" class="w100" :clearable="true"
                   v-model="valueD"
                   :checked="checked"
                   :dic="treeData"
                   :disabled="disabled"
                   :lazy="lazy"
                   :leaf-only="referConfig.onlyLeaf"
                   :multiple="isMuti"
                   :node-click="nodeClick"
                   :placeholder="placeholder"
                   :props="props"
                   :default-expand-all="true"
                   :tree-load="treeLoad"></avue-input-tree>
</template>
<script>
import {getTree, getLazyTree} from "@/api/refer/tree";
import {verifyNull} from "@/util/validate";
export default {
  name: "vciWebReferTree",
  props: {
    referConfig: {
      type: Object,
    },
    value: {
      type: String,
      default: ''
    },
    text: {
      type: String,
      default: ''
    },
    disabled: {
      type: Boolean,
      default: false,
    },
    title: {
      type: String,
      default:''
    }, width: {
      type: String,
      default:'70%'
    }, height: {
      type: String,
      default:'60%'
    },
    reloadFormKey: {
      type: String,
      default: '',
    }
  },
  data() {
    return {
      reloadData: this.referConfig.options.reloadData || false,
      visible: false,
      options: this.referConfig.options,
      textD: this.text || '',
      valueD: this.value || '',
      lazy: this.referConfig.options.loadType == 'node',
      isMuti: ("true" == this.referConfig.options.isMuti || this.referConfig.options.isMuti == true || this.referConfig.options.muti == true) ? true : false,
      props: {
        label: 'label',
        value: 'value',
        children: 'children'
      },
      config: {
        valueField: this.referConfig.valueField || this.referConfig.options.valueField || 'id',
        textField: this.referConfig.textField || this.referConfig.options.textField || "name",
        textSep: this.referConfig.textSep || ' '
      },
      treeUrl: this.referConfig.options.url || 'defaultReferTree',
      treeData: [],
      checkedData: [],
      currentNode: {},
      params: {},
      loadType: {'all': 'all', 'node': 'node'}
    };
  },
  created() {
    this.getParams();
  },
  mounted() {
    if(!this.lazy){
      if (this.options.data) {//如果是固定数据的情况下
        this.treeData = this.options.data;
      } else {
        this.getTree();
      }
    }
  },
  watch:{
    text:{
      handler(val) {
        this.textD=val;
      }
    },
    value:{
      handler(val) {
        this.valueD=val;
      }
    },
    reloadFormKey:{
      handler(val) {
        if(val != this.params[(this.options.paramForFormKey ? this.options.paramForFormKey : this.options.useFormKey)]){
          this.params[(this.options.paramForFormKey ? this.options.paramForFormKey : this.options.useFormKey)] = val;
          this.clearValue();
          this.getTree();
        }
      },
    }
  },
  computed: {
    placeholder: function () {
      return this.options.placeholder ? this.options.placeholder : this.title;
    }
  },
  methods: {
    getParams: function () {
      var queryParams = {};
      if (this.options.extraParams) {
        queryParams = this.options.extraParams;
      }
      queryParams['referBusCode'] = this.options['referBusCode'];
      if (this.options.useFormKey && this.options.formValues) {
        //使用表单上的字段来过滤
        queryParams[ (this.options.paramForFormKey ? this.options.paramForFormKey : this.options.useFormKey)] = this.options.formValues[this.options.useFormKey];
      }
      if (this.options.rootParams) {
        for (let key in this.options.rootParams) {
          queryParams[key] = this.options.rootParams[key];
        }
      }
      this.params = queryParams;
    },
    getTree() {
      //加载全部
      getTree(this.params, this.treeUrl).then(res => {
        this.treeData =  this.initTreeData(res.data);
      });
    },
    treeLoad: function (treeNode, resolve) {
      //逐级加载
      const parentId = (treeNode.level === 0) ? 0 : treeNode.data.attributes.id;
      this.params.parentId =  parentId;
      this.params.parentValue = parentId;
      if (this.options.rootParams && treeNode.level !== 0) {
        for (var key in this.options.rootParams) {
          delete this.params[key];
        }
      }
      getLazyTree(this.params, this.treeUrl).then(res => {
        resolve(this.initTreeData(res.data));
      });
    },
    initTreeData:function (nodes){
      let treeData=[];
      if(nodes && nodes.length>0){
        nodes.forEach(item => {
          let children=item.children || [];
          if(children && children.length>0){
            children=this.initTreeData(children);
          }
          treeData.push({
            label:item[this.config.textField],
            value:item[this.config.valueField],
            leaf: !item.children,
            children:children,
            attributes:item
          });
        });
      }
      return treeData;
    },
    nodeClick(data) {
      if (!this.isMuti) {
        this.setValue({checkedNodes: [data]});
      }
    },
    checked(checkedNode, checkedData) {
      this.setValue(checkedData);
    },
    clearValue(){
      this.valueD = '';
      this.textD = '';
      let mapFields =  this.referConfig.propMap || {};
      try {
        if (this.options.propMap) {
          mapFields = Object.assign(mapFields,this.options.propMap);
        }
        if (this.options.mapProps) {
          mapFields = Object.assign(mapFields,this.options.mapProps);
        }
      } catch (e) {
        ;
      }
      this.$emit("setReferValue", {
        prop: this.referConfig.prop,
        showProp: this.referConfig.showProp,
        value: this.valueD,
        text: this.textD,
        rawData: [],
        propMap: mapFields
      });
      this.visible = false;
    },
    setValue: function (checkedData) {
      this.checkedData = checkedData;
      let value = [];
      let text = [];
      let rawData=[];
      const textSep = this.config.textSep;
      for (var j = 0; j < checkedData.checkedNodes.length; j++) {
        const item = checkedData.checkedNodes[j].attributes || checkedData.checkedNodes[j];
        rawData.push(item);
        let v = item[this.config.valueField] || item.extendData[this.config.valueField];
        value.push(v);
        var tempRaw = [];
        var textFieldArray = this.config.textField.split(",");
        for (var i = 0; i < textFieldArray.length; i++) {//显示的字段可能有多个
          if (!verifyNull(textFieldArray[i])) {
            var t = item[textFieldArray[i]] || item.extendData[textFieldArray[i]];
            tempRaw.push(t);
          }
        }
        text.push(tempRaw.join(textSep));
      }
      let mapFields =  this.referConfig.propMap || {};
      try {
        if (this.options.propMap) {
          mapFields = Object.assign(mapFields,this.options.propMap);
        }
        if (this.options.mapProps) {
          mapFields = Object.assign(mapFields,this.options.mapProps);
        }
      } catch (e) {
        ;
      }
      this.valueD = value.join(',');
      this.textD = text.join(',');
      this.$emit("setReferValue", {
        prop: this.referConfig.prop,
        showProp: this.referConfig.showProp,
        value: this.valueD,
        text: this.textD || '',
        isTreeMuti: this.isMuti,
        rawData: rawData,
        propMap: mapFields
      });
    }
  }
};
</script>
<style scoped>
</style>
Source/ProjectWeb/src/util/formatTime.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,169 @@
/*
 * å¹´(Y) å¯ç”¨1-4个占位符
 * æœˆ(m)、日(d)、小时(H)、分(M)、秒(S) å¯ç”¨1-2个占位符
 * æ˜ŸæœŸ(W) å¯ç”¨1-3个占位符
 * å­£åº¦(q为阿拉伯数字,Q为中文数字)可用1或4个占位符
 *
 * let date = new Date()
 * formatDate(date, "YYYY-mm-dd HH:MM:SS")           // 2020-02-09 14:04:23
 * formatDate(date, "YYYY-mm-dd HH:MM:SS Q")         // 2020-02-09 14:09:03 ä¸€
 * formatDate(date, "YYYY-mm-dd HH:MM:SS WWW")       // 2020-02-09 14:45:12 æ˜ŸæœŸæ—¥
 * formatDate(date, "YYYY-mm-dd HH:MM:SS QQQQ")      // 2020-02-09 14:09:36 ç¬¬ä¸€å­£åº¦
 * formatDate(date, "YYYY-mm-dd HH:MM:SS WWW QQQQ")  // 2020-02-09 14:46:12 æ˜ŸæœŸæ—¥ ç¬¬ä¸€å­£åº¦
 */
export function formatDate(date, format) {
  if(!date){
    return "";
  }
  date = new Date(date);
  let we = date.getDay(); // æ˜ŸæœŸ
  let qut = Math.floor((date.getMonth() + 3) / 3).toString(); // å­£åº¦
  const opt = {
    "y+": date.getFullYear().toString(), // å¹´
    "M+": (date.getMonth() + 1).toString(), // æœˆ(月份从0开始,要+1)
    "d+": date.getDate().toString(), // æ—¥
    "H+": date.getHours().toString(), // æ—¶
    "m+": date.getMinutes().toString(), // åˆ†
    "s+": date.getSeconds().toString(), // ç§’
    "q+": qut, // å­£åº¦
  };
  const week = {
    // ä¸­æ–‡æ•°å­— (星期)
    0: "日",
    1: "一",
    2: "二",
    3: "三",
    4: "四",
    5: "五",
    6: "六",
  };
  const quarter = {
    // ä¸­æ–‡æ•°å­—(季度)
    1: "一",
    2: "二",
    3: "三",
    4: "四",
  };
  if (/(W+)/.test(format)) {
    format = format.replace(
      RegExp.$1,
      RegExp.$1.length > 1
        ? RegExp.$1.length > 2
          ? "星期" + week[we]
          : "周" + week[we]
        : week[we]
    );
  }
  if (/(Q+)/.test(format)) {
    // è¾“入一个Q,只输出一个中文数字,输入4个Q,则拼接上字符串
    format = format.replace(
      RegExp.$1,
      RegExp.$1.length == 4 ? "第" + quarter[qut] + "季度" : quarter[qut]
    );
  }
  for (let k in opt) {
    let r = new RegExp("(" + k + ")").exec(format);
    if (r) {
      // è‹¥è¾“入的长度不为1,则前面补零
      format = format.replace(
        r[1],
        RegExp.$1.length == 1 ? opt[k] : opt[k].padStart(RegExp.$1.length, "0")
      );
    }
  }
  return format;
}
// æ—¶é—´å‡½æ•°ç²¾ç¡®æ¯«ç§’
export function formatMilliseconds(date) {
  const year = date.getFullYear();
  const month = addLeadingZero(date.getMonth() + 1);
  const day = addLeadingZero(date.getDate());
  const hours = addLeadingZero(date.getHours());
  const minutes = addLeadingZero(date.getMinutes());
  const seconds = addLeadingZero(date.getSeconds());
  const milliseconds = addLeadingZero(date.getMilliseconds(), 3);
  return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}.${milliseconds}`;
}
export function addLeadingZero(value, digits = 2) {
  return value.toString().padStart(digits, "0");
}
/**
 * 10秒:  10 * 1000
 * 1分:   60 * 1000
 * 1小时: 60 * 60 * 1000
 * 24小时:60 * 60 * 24 * 1000
 * 3天:   60 * 60* 24 * 1000 * 3
 *
 * let data = new Date()
 * formatPast(data)                                           // åˆšåˆš
 * formatPast(data - 11 * 1000)                               // 11秒前
 * formatPast(data - 2 * 60 * 1000)                           // 2分钟前
 * formatPast(data - 60 * 60 * 2 * 1000)                      // 2小时前
 * formatPast(data - 60 * 60 * 2 * 1000)                      // 2小时前
 * formatPast(data - 60 * 60 * 71 * 1000)                     // 2天前
 * formatPast("2020-06-01")                                   // 2020-06-01
 * formatPast("2020-06-01", "YYYY-mm-dd HH:MM:SS WWW QQQQ")   // 2020-06-01 08:00:00 æ˜ŸæœŸä¸€ ç¬¬äºŒå­£åº¦
 */
export function formatPast(param, format = "YYYY-mm-dd") {
  const params = typeof param;
  // ä¼ å…¥æ ¼å¼å¤„理、存储转换值
  let t, s;
  // èŽ·å–js æ—¶é—´æˆ³
  let time = new Date().getTime();
  // æ˜¯å¦æ˜¯å¯¹è±¡
  if (params === "string" || params === "object") t = new Date(param).getTime();
  else t = param;
  // å½“前时间戳 - ä¼ å…¥æ—¶é—´æˆ³
  time = Number.parseInt(time - t);
  if (time < 10000) {
    // 10秒内
    return "刚刚";
  } else if (time < 60000 && time >= 10000) {
    // è¶…过10秒少于1分钟内
    s = Math.floor(time / 1000);
    return `${s}秒前`;
  } else if (time < 3600000 && time >= 60000) {
    // è¶…过1分钟少于1小时
    s = Math.floor(time / 60000);
    return `${s}分钟前`;
  } else if (time < 86400000 && time >= 3600000) {
    // è¶…过1小时少于24小时
    s = Math.floor(time / 3600000);
    return `${s}小时前`;
  } else if (time < 259200000 && time >= 86400000) {
    // è¶…过1天少于3天内
    s = Math.floor(time / 86400000);
    return `${s}天前`;
  } else {
    // è¶…过3天
    let date =
      params === "string" || params === "object" ? new Date(param) : param;
    return formatDate(date, format);
  }
}
/**
 * formatAxis(new Date())   // ä¸Šåˆå¥½
 */
export function formatAxis(param) {
  let hour = new Date(param).getHours();
  if (hour < 6) {
    return "凌晨好";
  } else if (hour < 9) {
    return "早上好";
  } else if (hour < 12) {
    return "上午好";
  } else if (hour < 14) {
    return "中午好";
  } else if (hour < 17) {
    return "下午好";
  } else if (hour < 19) {
    return "傍晚好";
  } else if (hour < 22) {
    return "晚上好";
  } else {
    return "夜里好";
  }
}
Source/ProjectWeb/src/util/platformUtils.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,107 @@
import { formatDate } from "@/util/formatTime";
//处理动态表单函数数组提取格式 {prop:key}
export const handlerObj = (prop, key, data) => {
  const keyObj = data.reduce((v, cur) => {
    if (!v[cur[prop]]) {
      v[cur[prop]] = [];
    }
    v[cur[prop]] = cur[key];
    return v;
  }, {});
  return keyObj;
};
//处理动态表单函数数组提取格式 {prop:key}
export const handlerProp = (prop, data) => {
  const keyObj = data.reduce((v, cur) => {
    if (!v[cur[prop]]) {
      v[cur[prop]] = [];
    }
    v[cur[prop]] = undefined;
    return v;
  }, {});
  return keyObj;
};
//过滤对象空值/单个值
export const filterateObj = (obj, filter) => {
  return Object.entries(obj).reduce((acc, [key, value]) => {
    if (!filter) {
      if (value !== "" && value !== null && value !== undefined) {
        acc[key] = value;
      }
    } else {
      if (value !== filter) {
        acc[key] = value;
      }
    }
    return acc;
  }, {});
};
// è¿‡æ»¤æ•°ç»„多个值
export const filterateKeys = (data, keys, prop = "prop") => {
  if (typeof keys === "string") keys = keys.split(",");
  return data.filter((v) => {
    if (keys.length > 0) {
      for (let key of keys) {
        if (v[prop] == key) {
          return false;
        }
      }
    }
    return true;
  });
};
/**
 * ä¸‹è½½æ–‡ä»¶
 * @param data    æ–‡ä»¶æµç¨‹
 */
export function blobDownload(data) {
  const newFileName = formatDate(new Date(), "yyyyMMddHHmmss");
  //如果能用,打赏下呗 åšä¸»çŒœå‘不容易 å¤´å‘都白了很多
  let name = newFileName;
  var content = data;
  var datas = new Blob([content], {
    type: "application/vnd.ms-excel;charset=utf-8",
  });
  var downloadUrl = window.URL.createObjectURL(datas);
  var anchor = document.createElement("a");
  anchor.href = downloadUrl;
  anchor.download = name + ".xls";
  anchor.click();
  window.URL.revokeObjectURL(datas);
}
/**
 * æ•°ç»„合并取并集
 * @param arr    æ•°ç»„1   ä¸»
 * @param data     æ•°ç»„2 è¾…
 * @param key     æ•°ç»„2的相同字段key
 * @param prop     æ•°ç»„2的字段拼接到数组1中,不传默认全部字段
 */
export function combineData(arr, data, key, prop) {
  let newArr = [];
  data.forEach((d) => {
    let findObj = arr.find((a) => a.id === d[key]);
    if (findObj) {
      newArr.push(findObj);
    }
  });
  const arrArray = newArr.map((obj, index) => {
    if (prop) {
      const filteredObj = Object.fromEntries(
        Object.entries(data[index]).filter(([key]) => prop.includes(key))
      );
      return { ...obj, ...filteredObj };
    } else {
      return { ...obj, ...data[index] };
    }
  });
  const differentObjects = arr.filter(
    (v) => !data.some((da) => da[key] === v.id)
  );
  console.log("newArr", differentObjects);
  const r = [...differentObjects, ...arrArray];
  return r;
}
Source/ProjectWeb/src/util/validate.js
@@ -1,254 +1,335 @@
/**
 * Created by jiachenpan on 16/11/18.
 * éªŒè¯ç™¾åˆ†æ¯”(不可以小数)
 * @param val å½“前值字符串
 * @returns è¿”回处理后的字符串
 */
export function isvalidUsername(str) {
    const valid_map = ['admin', 'editor']
    return valid_map.indexOf(str.trim()) >= 0
}
/* åˆæ³•uri*/
export function validateURL(textval) {
    const urlregex = /^(https?|ftp):\/\/([a-zA-Z0-9.-]+(:[a-zA-Z0-9.&%$-]+)*@)*((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]?)(\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3}|([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+\.(com|edu|gov|int|mil|net|org|biz|arpa|info|name|pro|aero|coop|museum|[a-zA-Z]{2}))(:[0-9]+)*(\/($|[a-zA-Z0-9.,?'\\+&%$#=~_-]+))*$/
    return urlregex.test(textval)
}
export const verifyNumberPercentage = (val) => {
  const patternSpace = /(^\s*)|(\s*$)/g;
  const patternNum = /[^\d]/g;
  // åŒ¹é…ç©ºæ ¼
  let v = val.replace(patternSpace, "");
  // åªèƒ½æ˜¯æ•°å­—和小数点,不能是其他输入
  v = v.replace(patternNum, "");
  // ä¸èƒ½ä»¥0开始
  v = v.replace(/^0/g, "");
  // æ•°å­—超过100,赋值成最大值100
  v = v.replace(/^[1-9]\d\d{1,3}$/, "100");
  // è¿”回结果
  return v;
};
/**
 * é‚®ç®±
 * @param {*} s
 * éªŒè¯ç™¾åˆ†æ¯”(可以小数)
 * @param val å½“前值字符串
 * @returns è¿”回处理后的字符串
 */
export function isEmail(s) {
    return /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+((.[a-zA-Z0-9_-]{2,3}){1,2})$/.test(s)
}
export const verifyNumberPercentageFloat = (val) => {
  let v = verifyNumberIntegerAndFloat(val);
  // æ•°å­—超过100,赋值成最大值100
  v = v.replace(/^[1-9]\d\d{1,3}$/, "100");
  // è¶…过100之后不给再输入值
  v = v.replace(/^100\.$/, "100");
  // è¿”回结果
  return v;
};
/**
 * æ‰‹æœºå·ç 
 * @param {*} s
 * å°æ•°æˆ–æ•´æ•°(不可以负数)
 * @param val å½“前值字符串
 * @returns è¿”回处理后的字符串
 */
export function isMobile(s) {
    return /^1[0-9]{10}$/.test(s)
}
export const verifyNumberIntegerAndFloat = (val) => {
  // åŒ¹é…ç©ºæ ¼
  let v = val.replace(/(^\s*)|(\s*$)/g, "");
  // åªèƒ½æ˜¯æ•°å­—和小数点,不能是其他输入
  v = v.replace(/[^\d.]/g, "");
  // ä»¥0开始只能输入一个
  v = v.replace(/^0{2}$/g, "0");
  // ä¿è¯ç¬¬ä¸€ä½åªèƒ½æ˜¯æ•°å­—,不能是点
  v = v.replace(/^\./g, "");
  // å°æ•°åªèƒ½å‡ºçް1位
  v = v.replace(".", "$#$").replace(/\./g, "").replace("$#$", ".");
  // å°æ•°ç‚¹åŽé¢ä¿ç•™2位
  v = v.replace(/^(\\-)*(\d+)\.(\d\d).*$/, "$1$2.$3");
  // è¿”回结果
  return v;
};
// æ­£æ•´æ•°éªŒè¯
export const verifiyNumberInteger = (val) => {
  const pattern = /(^\s*)|(\s*$)/g;
  // åŒ¹é…ç©ºæ ¼
  let v = val.replace(pattern, "");
  // åŽ»æŽ‰ '.' , é˜²æ­¢è´´è´´çš„æ—¶å€™å‡ºçŽ°é—®é¢˜ å¦‚ 0.1.12.12
  v = v.replace(/[\\.]*/g, "");
  // åŽ»æŽ‰ä»¥ 0 å¼€å§‹åŽé¢çš„æ•°, é˜²æ­¢è´´è´´çš„æ—¶å€™å‡ºçŽ°é—®é¢˜ å¦‚ 00121323
  v = v.replace(/(^0[\d]*)$/g, "0");
  // é¦–位是0,只能出现一次
  v = v.replace(/^0\d$/g, "0");
  // åªåŒ¹é…æ•°å­—
  v = v.replace(/[^\d]/g, "");
  // è¿”回结果
  return v;
};
// åŽ»æŽ‰ä¸­æ–‡åŠç©ºæ ¼
export const verifyCnAndSpace = (val) => {
  const pattern = /[\u4e00-\u9fa5\s]+/g;
  // åŒ¹é…ä¸­æ–‡ä¸Žç©ºæ ¼
  let v = val.replace(pattern, "");
  // åŒ¹é…ç©ºæ ¼
  v = v.replace(/(^\s*)|(\s*$)/g, "");
  // è¿”回结果
  return v;
};
// åŽ»æŽ‰è‹±æ–‡åŠç©ºæ ¼
export const verifyEnAndSpace = (val) => {
  const pattern = /[a-zA-Z]+/g;
  const patternSpace = /(^\s*)|(\s*$)/g;
  // åŒ¹é…è‹±æ–‡ä¸Žç©ºæ ¼
  let v = val.replace(pattern, "");
  // åŒ¹é…ç©ºæ ¼
  v = v.replace(patternSpace, "");
  // è¿”回结果
  return v;
};
// ç¦æ­¢è¾“入空格
export const verifyAndSpace = (val) => {
  const pattern = /(^\s*)|(\s*$)/g;
  // åŒ¹é…ç©ºæ ¼
  let v = val.replace(pattern, "");
  // è¿”回结果
  return v;
};
// é‡‘额用 `,` åŒºåˆ†å¼€
export const verifyNumberComma = (val) => {
  const pattern = /\B(?=(\d{3})+(?!\d))/g;
  // è°ƒç”¨å°æ•°æˆ–æ•´æ•°(不可以负数)方法
  let v = verifyNumberIntegerAndFloat(val);
  // å­—符串转成数组
  v = v.toString().split(".");
  // \B åŒ¹é…éžå•词边界,两边都是单词字符或者两边都是非单词字符
  v[0] = v[0].replace(pattern, ",");
  // æ•°ç»„转字符串
  v = v.join(".");
  // è¿”回结果
  return v;
};
// åŒ¹é…æ–‡å­—变色(搜索时)
export const verifyTextColor = (val, text = "", color = "red") => {
  // è¿”回内容,添加颜色
  let v = text.replace(
    new RegExp(val, "gi"),
    `<span style='color: ${color}'>${val}</span>`
  );
  // è¿”回结果
  return v;
};
// æ•°å­—转中文大写
export const verifyNumberCnUppercase = (
  val,
  unit = "仟佰拾亿仟佰拾万仟佰拾元角分",
  v = ""
) => {
  // å½“前内容字符串添加 2个0,为什么??
  val += "00";
  // è¿”回某个指定的字符串值在字符串中首次出现的位置,没有出现,则该方法返回 -1
  let lookup = val.indexOf(".");
  // substring:不包含结束下标内容,substr:包含结束下标内容
  if (lookup >= 0)
    val = val.substring(0, lookup) + val.substring(lookup + 1, 2);
  // æ ¹æ®å†…容 val çš„长度,截取返回对应大写
  unit = unit.substring(unit.length - val.length);
  // å¾ªçŽ¯æˆªå–æ‹¼æŽ¥å¤§å†™
  for (let i = 0; i < val.length; i++) {
    v +=
      "零壹贰叁肆伍陆柒捌玖".substring(val.substring(i, 1), 1) +
      unit.substring(i, 1);
  }
  // æ­£åˆ™å¤„理
  v = v
    .replace(/零角零分$/, "整")
    .replace(/零[仟佰拾]/g, "零")
    .replace(/零{2,}/g, "零")
    .replace(/零([亿|万])/g, "$1")
    .replace(/零+元/, "元")
    .replace(/亿零{0,3}万/, "亿")
    .replace(/^元/, "零元");
  // è¿”回结果
  return v;
};
// æ‰‹æœºå·ç 
export const verifyPhone = (val) => {
  const petter =
    /^((12[0-9])|(13[0-9])|(14[5|7])|(15([0-3]|[5-9]))|(18[0,5-9]))\d{8}$/;
  // false: æ‰‹æœºå·ç ä¸æ­£ç¡®
  if (!petter.test(val)) return false;
  // true: æ‰‹æœºå·ç æ­£ç¡®
  else return true;
};
/**
 * ç”µè¯å·ç 
 * @param {*} s
 */
export function isPhone(s) {
    return /^([0-9]{3,4}-)?[0-9]{7,8}$/.test(s)
}
// å›½å†…电话号码
export const verifyTelPhone = (val) => {
  const petter = /\d{3}-\d{8}|\d{4}-\d{7}/;
  // false: å›½å†…电话号码不正确
  if (!petter.test(val)) return false;
  // true: å›½å†…电话号码正确
  else return true;
};
/**
 * URL地址
 * @param {*} s
 */
export function isURL(s) {
    return /^http[s]?:\/\/.*/.test(s)
}
// ç™»å½•账号 (字母开头,允许5-16字节,允许字母数字下划线)
export const verifyAccount = (val) => {
  const petter = /^[a-zA-Z][a-zA-Z0-9_]{4,15}$/;
  // false: ç™»å½•账号不正确
  if (!petter.test(val)) return false;
  // true: ç™»å½•账号正确
  else return true;
};
/* å°å†™å­—母*/
export function validateLowerCase(str) {
    const reg = /^[a-z]+$/
    return reg.test(str)
}
// å¯†ç  (以字母开头,长度在6~16之间,只能包含字母、数字和下划线)
export const verifyPassword = (val) => {
  const petter = /^[a-zA-Z]\w{5,15}$/;
  // false: å¯†ç ä¸æ­£ç¡®
  if (!petter.test(val)) return false;
  // true: å¯†ç æ­£ç¡®
  else return true;
};
/* å¤§å†™å­—母*/
export function validateUpperCase(str) {
    const reg = /^[A-Z]+$/
    return reg.test(str)
}
// å¼ºå¯†ç  (字母+数字+特殊字符,长度在6-16之间)
export const verifyPasswordPowerful = (val) => {
  const petter =
    /^(?![a-zA-z]+$)(?!\d+$)(?![!@#$%^&\\.*]+$)(?![a-zA-z\d]+$)(?![a-zA-z!@#$%^&\\.*]+$)(?![\d!@#$%^&\\.*]+$)[a-zA-Z\d!@#$%^&\\.*]{6,16}$/;
  // false: å¼ºå¯†ç ä¸æ­£ç¡®
  if (!petter.test(val)) return false;
  // true: å¼ºå¯†ç æ­£ç¡®
  else return true;
};
/* å¤§å°å†™å­—母*/
export function validatAlphabets(str) {
    const reg = /^[A-Za-z]+$/
    return reg.test(str)
}
/*验证pad还是pc*/
export const vaildatePc = function() {
        const userAgentInfo = navigator.userAgent;
        const Agents = ["Android", "iPhone",
            "SymbianOS", "Windows Phone",
            "iPad", "iPod"
        ];
        let flag = true;
        for (var v = 0; v < Agents.length; v++) {
            if (userAgentInfo.indexOf(Agents[v]) > 0) {
                flag = false;
                break;
            }
        }
        return flag;
    }
    /**
     * validate email
     * @param email
     * @returns {boolean}
     */
export function validateEmail(email) {
    const re = /^(([^<>()\\[\]\\.,;:\s@"]+(\.[^<>()\\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/
    return re.test(email)
}
// å¯†ç å¼ºåº¦
export const verifyPasswordStrength = (val) => {
  const weak = /^(?:\d+|[a-zA-Z]+|[!@#$%^&\\.*]+){6,16}$/;
  const centre =
    /^(?![a-zA-z]+$)(?!\d+$)(?![!@#$%^&\\.*]+$)[a-zA-Z\d!@#$%^&\\.*]{6,16}$/;
  const strong =
    /^(?![a-zA-z]+$)(?!\d+$)(?![!@#$%^&\\.*]+$)(?![a-zA-z\d]+$)(?![a-zA-z!@#$%^&\\.*]+$)(?![\d!@#$%^&\\.*]+$)[a-zA-Z\d!@#$%^&\\.*]{6,16}$/;
  let v = "";
  // å¼±ï¼šçº¯æ•°å­—,纯字母,纯特殊字符
  if (weak.test(val)) v = "å¼±";
  // ä¸­ï¼šå­—母+数字,字母+特殊字符,数字+特殊字符
  if (centre.test(val)) v = "中";
  // å¼ºï¼šå­—母+数字+特殊字符
  if (strong.test(val)) v = "强";
  // è¿”回结果
  return v;
};
/**
 * åˆ¤æ–­èº«ä»½è¯å·ç 
 */
export function cardid(code) {
    let list = [];
    let result = true;
    let msg = '';
    var city = {
        11: "北京",
        12: "天津",
        13: "河北",
        14: "山西",
        15: "内蒙古",
        21: "辽宁",
        22: "吉林",
        23: "黑龙江 ",
        31: "上海",
        32: "江苏",
        33: "浙江",
        34: "安徽",
        35: "福建",
        36: "江西",
        37: "山东",
        41: "河南",
        42: "湖北 ",
        43: "湖南",
        44: "广东",
        45: "广西",
        46: "海南",
        50: "重庆",
        51: "四川",
        52: "贵州",
        53: "云南",
        54: "西藏 ",
        61: "陕西",
        62: "甘肃",
        63: "青海",
        64: "宁夏",
        65: "新疆",
        71: "台湾",
        81: "香港",
        82: "澳门",
        91: "国外 "
    };
    if (!validatenull(code)) {
        if (code.length == 18) {
            if (!code || !/(^\d{18}$)|(^\d{17}(\d|X|x)$)/.test(code)) {
                msg = "证件号码格式错误";
            } else if (!city[code.substr(0, 2)]) {
                msg = "地址编码错误";
            } else {
                //18位身份证需要验证最后一位校验位
                code = code.split('');
                //∑(ai×Wi)(mod 11)
                //加权因子
                var factor = [7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2];
                //校验位
                var parity = [1, 0, 'X', 9, 8, 7, 6, 5, 4, 3, 2, 'x'];
                var sum = 0;
                var ai = 0;
                var wi = 0;
                for (var i = 0; i < 17; i++) {
                    ai = code[i];
                    wi = factor[i];
                    sum += ai * wi;
                }
                if (parity[sum % 11] != code[17]) {
                    msg = "证件号码校验位错误";
                } else {
                    result = false;
                }
// IP地址
export const verifyIPAddress = (val) => {
  const petter =
    /^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$/;
  // false: IP地址不正确
  if (!petter.test(val)) return false;
  // true: IP地址正确
  else return true;
};
            }
        } else {
            msg = "证件号码长度不为18位";
        }
// é‚®ç®±
export const verifyEmail = (val) => {
  const petter =
    /^(([^<>()\\[\]\\.,;:\s@"]+(\.[^<>()\\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
  // false: é‚®ç®±ä¸æ­£ç¡®
  if (!petter.test(val)) return false;
  // true: é‚®ç®±æ­£ç¡®
  else return true;
};
    } else {
        msg = "证件号码不能为空";
    }
    list.push(result);
    list.push(msg);
    return list;
}
/**
 * åˆ¤æ–­æ‰‹æœºå·ç æ˜¯å¦æ­£ç¡®
 */
export function isvalidatemobile(phone) {
    let list = [];
    let result = true;
    let msg = '';
    var isPhone = /^0\d{2,3}-?\d{7,8}$/;
    //增加134 å‡å°‘|1349[0-9]{7},增加181,增加145,增加17[678]
    if (!validatenull(phone)) {
        if (phone.length == 11) {
            if (isPhone.test(phone)) {
                msg = '手机号码格式不正确';
            } else {
                result = false;
            }
        } else {
            msg = '手机号码长度不为11位';
        }
    } else {
        msg = '手机号码不能为空';
    }
    list.push(result);
    list.push(msg);
    return list;
}
/**
 * åˆ¤æ–­å§“名是否正确
 */
export function validatename(name) {
    var regName = /^[\u4e00-\u9fa5]{2,4}$/;
    if (!regName.test(name)) return false;
    return true;
}
/**
 * åˆ¤æ–­æ˜¯å¦ä¸ºæ•´æ•°
 */
export function validatenum(num, type) {
    let regName = /[^\d.]/g;
    if (type == 1) {
        if (!regName.test(num)) return false;
    } else if (type == 2) {
        regName = /[^\d]/g;
        if (!regName.test(num)) return false;
    }
    return true;
}
/**
 * åˆ¤æ–­æ˜¯å¦ä¸ºå°æ•°
 */
export function validatenumord(num, type) {
    let regName = /[^\d.]/g;
    if (type == 1) {
        if (!regName.test(num)) return false;
    } else if (type == 2) {
        regName = /[^\d.]/g;
        if (!regName.test(num)) return false;
    }
    return true;
}
// èº«ä»½è¯
export const verifyIdCard = (val) => {
  const petter =
    /^[1-9]\d{5}(18|19|20)\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/;
  // false: èº«ä»½è¯ä¸æ­£ç¡®
  if (!petter.test(val)) return false;
  // true: èº«ä»½è¯æ­£ç¡®
  else return true;
};
// å§“名
export const verifyFullName = (val) => {
  const petter = /^[\u4e00-\u9fa5]{1,6}(·[\u4e00-\u9fa5]{1,6}){0,2}$/;
  // false: å§“名不正确
  if (!petter.test(val)) return false;
  // true: å§“名正确
  else return true;
};
// é‚®æ”¿ç¼–码
export const verifyPostalCode = (val) => {
  const petter = /^[1-9][0-9]{5}$/;
  // false: é‚®æ”¿ç¼–码不正确
  if (!petter.test(val)) return false;
  // true: é‚®æ”¿ç¼–码正确
  else return true;
};
// url
export const verifyUrl = (val) => {
  const petter =
    /^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})).?)(?::\d{2,5})?(?:[/?#]\S*)?$/i;
  // false: url不正确
  if (!petter.test(val)) return false;
  // true: url正确
  else return true;
};
// è½¦ç‰Œå·
export const verifyCarNum = (val) => {
  const petter =
    /^(([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][A-Z](([0-9]{5}[DF])|([DF]([A-HJ-NP-Z0-9])[0-9]{4})))|([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][A-Z][A-HJ-NP-Z0-9]{4}[A-HJ-NP-Z0-9挂学警港澳使领]))$/;
  // false: è½¦ç‰Œå·ä¸æ­£ç¡®
  if (!petter.test(val)) return false;
  // true:车牌号正确
  else return true;
};
// æ–œæ 
export const verifySlash = (val) => {
  const regex = /\//g;
  if (!regex.test(val)) return false;
  else return true;
};
// å­—符串,数组,对象非空
export const verifyNotNull = (val) => {
  if (val === null || val === undefined || val ==="") {
    return false;
  }
  if (typeof val === "string") {
    return val.trim().length !== 0;
  }
  if (Array.isArray(val)) {
    return val.length !== 0;
  }
  if (typeof val === "object" && val !== null) {
    return Object.keys(val).length !== 0;
  }
  return true;
};
export const verifyNull = (val) => {
  return !verifyNotNull(val);
};
/**
 * åˆ¤æ–­æ˜¯å¦ä¸ºç©º
 * å¯ä»¥åˆ¤æ–­æ•°ç»„和对象 å¦‚判断"null"、"undefined"也会返回是空
 */
export function validatenull(val) {
    if (typeof val == 'boolean') {
        return false;
    }
    if (typeof val == 'number') {
        return false;
    }
    if (val instanceof Array) {
        if (val.length == 0) return true;
    } else if (val instanceof Object) {
        if (JSON.stringify(val) === '{}') return true;
    } else {
        if (val == 'null' || val == null || val == 'undefined' || val == undefined || val == '') return true;
        return false;
    }
  if (typeof val == 'boolean') {
    return false;
  }
  if (typeof val == 'number') {
    return false;
  }
  if (val instanceof Array) {
    if (val.length == 0) return true;
  } else if (val instanceof Object) {
    if (JSON.stringify(val) === '{}') return true;
  } else {
    if (val == 'null' || val == null || val == 'undefined' || val == undefined || val == '') return true;
    return false;
  }
  return false;
}
Source/ProjectWeb/src/views/test/referDemo/DynamicsFrom.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,349 @@
<template>
  <el-form
    ref="dynamincsFormRef"
    :model="ruleForm"
    :label-width="labelWidth"
    :rules="rules"
  >
    <el-row :gutter="row">
      <el-col
        :xs="ft.col"
        :sm="ft.col"
        :md="ft.col"
        :lg="ft.col"
        :xl="ft.col"
        :class="ft.inputType === 'textarea' ? 'mb20' : 'form-col'"
        v-for="ft in formTemplateData"
        :key="ft.fieldId"
      >
        <el-form-item :label="ft.label" :prop="ft.prop">
          <!--date,datetime组件-->
          <template v-if="ft.type == 'date'">
            <el-date-picker
              class="w100"
              v-model="ruleForm[ft.prop]"
              :disabled="ft.disabled || false"
              :type="ft.type"
              clearable
              :format="ft.format"
              :value-format="ft.format"
              :placeholder="
                ft.placeholder ? ft.placeholder : ` è¯·é€‰æ‹©${ft.label}`
              "
            >
            </el-date-picker>
          </template>
          <!--date,datetime组件-->
          <template v-if="ft.type == 'datetime'">
            <el-date-picker
              class="w100"
              v-model="ruleForm[ft.prop]"
              :disabled="ft.disabled || false"
              :type="ft.type"
              clearable
              :format="ft.format"
              :value-format="ft.format"
              :placeholder="
                ft.placeholder ? ft.placeholder : ` è¯·é€‰æ‹©${ft.label}`
              "
            >
            </el-date-picker>
          </template>
          <!--time组件-->
          <template v-if="ft.type == 'time'">
            <el-time-picker
              class="w100"
              clearable
              v-model="ruleForm[ft.prop]"
              :disabled="ft.disabled || false"
              arrow-control
              :default-value="new Date()"
              :value-format="ft.format"
              :placeholder="`请选择${ft.label}`"
            >
            </el-time-picker>
          </template>
          <!--单选组件-->
          <template v-if="ft.type == 'radio'">
            <el-radio-group v-model="ruleForm[ft.prop]" :disabled="ft.disabled">
              <el-radio
                :label="r[props.value]"
                v-for="r in ft.dictData"
                :key="r[props.key]"
                >{{ r[props.label] }}
              </el-radio>
            </el-radio-group>
          </template>
          <!--数字组件-->
          <template v-if="ft.type == 'number'">
            <el-input-number
              class="w100"
              v-model.number="ruleForm[ft.prop]"
              controls-position="right"
              clearable
              :disabled="ft.disabled || false"
            ></el-input-number>
          </template>
          <!--开关组件-->
          <template v-if="ft.type == 'switch'">
            <el-switch
              v-model="ruleForm[ft.prop]"
              :disabled="ft.disabled || false"
              :active-text="ft.activeText || ''"
              :inactive-text="ft.inactiveText || ''"
            >
            </el-switch>
          </template>
          <!--文本组件-->
          <template v-if="ft.type == 'input'">
            <el-input
              class="w100"
              :type="ft.inputType || 'text'"
              v-model="ruleForm[ft.prop]"
              :disabled="ft.disabled || false"
              :maxlength="ft.maxlength"
              clearable
              :show-password="ft.inputType === 'password' ? true : false"
              :autosize="{ minRows: 3, maxRows: 6 }"
              :placeholder="
                ft.placeholder ? ft.placeholder : ` è¯·è¾“å…¥${ft.label}`
              "
            ></el-input>
          </template>
          <!--选择器-->
          <template v-if="ft.type == 'select'">
            <el-select
              class="w100"
              v-model="ruleForm[ft.prop]"
              :disabled="ft.disabled || false"
              clearable
              :placeholder="
                ft.placeholder ? ft.placeholder : ` è¯·é€‰æ‹©${ft.label}`
              "
            >
              <el-option
                v-for="item in ft.dictData"
                :key="item.key"
                :label="item.label"
                :value="item.value"
              >
              </el-option>
            </el-select>
          </template>
          <!--参照-->
          <template v-if="ft.type == 'refer'">
            <vciWebRefer
              :key="ft.prop"
              referType="master"
              :data-key="ft.prop"
              :disabled="ft.disabled || false"
              :display="ft.display || true"
              :referConfig="ft.referConfigTemp || {}"
              :reloadFormKey="(ft.referConfig.useFormKey && ft.referConfig.formValues && ft.referConfig.formValues[ft.referConfig.useFormKey]) || ''"
              :text="ruleForm[ft.referConfig.showProp]"
              :value="ruleForm[ft.prop]"
              @setReferValue="setReferValue"
              :ref="'referFormRef'+ft.prop"
            ></vciWebRefer>
          </template>
        </el-form-item>
      </el-col>
    </el-row>
  </el-form>
</template>
<script>
import vciWebRefer from "@/components/refer/vciWebRefer.vue";
import { handlerObj } from "@/util/platformUtils";
import { verifySlash, verifyNull } from "@/util/validate";
export default {
  name: "DynamicsFrom",
  components: { vciWebRefer },
  props: {
    // è¡¨å•数组
    formData: {
      type: Array,
      default: () => [],
    },
    // row:栅格间隔
    row: {
      type: Number,
      default: 35,
    },
    // è¡¨å•配置
    labelWidth: {
      type: String,
      default: "120px",
    },
    formProp: {
      type: Object,
      default: () => {},
    },
  },
  data() {
    return {
      ruleForm: {},
      formTemplateData: [],
      rules: {},
      props: {
        key: "value",
        label: "label",
        value: "value",
      },
    };
  },
  watch: {
    //formProp一定要写在formData上面,否则影响referConfig里formValues的构建
    formProp: {
      handler(val) {
        this.ruleForm = val;
      },
      immediate: true,
    },
    formData: {
      handler(val) {
        this.rules = handlerObj("prop", "rule", val);
        //this.getDictList(val);
      },
      immediate: true,
    },
    ruleForm: {
      handler(val) {
        for (let code of this.formTemplateData) {
          if (
            code.type == "refer" &&
            code.referConfig &&
            code.referConfig.useFormKey
          ) {
            code.referConfig.formValues = val;
            code.referConfigTemp.options = code.referConfig;
          }
        }
        this.$emit("input", val);
      },
      deep: true,
      immediate: true,
    },
  },
  methods: {
    //数据字典
    async getDictList(val) {
      for (let code of val) {
        if (!verifyNull(code.dictData) && code.type == "select") {
          if (
            verifySlash(code.dictCode) &&
            Object.prototype.hasOwnProperty.call(code, "dictCode")
          ) {
            const res = await getlistByCode(code.dictCode);
            if (res.success) {
              const dic = res.data;
              code.dictData = dic.map((d) => {
                return {
                  label: d.name,
                  key: d.code,
                  value: d.id,
                };
              });
            }
          } else {
            this.getDicts(code.dictCode)
              .then((res) => {
                if (res.success) {
                  const dic = res.obj.datas;
                  code.dictData = dic.map((d) => {
                    return {
                      label: d.name,
                      key: d.code,
                      value: d.code,
                    };
                  });
                }
              })
              .catch(() => {
                this.$message.error(` æ•°æ®å­—å…¸${code.dictCode}错误`);
              });
          }
        }
        if (code.type == "refer") {
          if (code.referConfig && code.referConfig.useFormKey) {
            if (verifyNull(code.referConfig.formValuesKey)) {
              code.referConfig.formValuesKey = "ruleForm";
            }
            code.referConfig.formValues = this[code.referConfig.formValuesKey];
          }
          code.referConfigTemp = {
            title: code.label,
            showProp:
              code.showProp || code.referConfig.showProp || code.prop + "Name",
            prop: code.prop,
            propMap: code.propMap || {},
            placeholder: code.placeholder
              ? code.placeholder
              : ` è¯·é€‰æ‹©` + code.label,
            options: code.referConfig,
          };
        }
      }
      this.formTemplateData = val;
    },
    // æ‰“开参照
    openReferDialog(refer, lable) {
      const e = { refer: refer, lable: lable };
      this.$refs.referDialogRef.openDialog(e);
    },
    // éªŒè¯
    validate(callback) {
      this.$refs.dynamincsFormRef.validate((valid) => {
        callback(valid, this.ruleForm);
      });
    },
    clearValidate() {
      this.$refs.dynamincsFormRef.clearValidate();
    },
    // æ¸…除校验
    reset() {
      this.$refs.dynamincsFormRef.resetFields();
    },
    // æ¸…除校验
    resetFields() {
      this.$refs.dynamincsFormRef.resetFields();
    },
    setReferValue(data) {
      if (data.prop) {
        this.ruleForm[data.prop] = data.value || "";
        this.ruleForm[data.showProp] = data.text || "";
        if (data.propMap) {
          //说明需要映射
          for (let key in data.propMap) {
            let mapFields = data.propMap[key].split(",");
            let value = [];
            data.rawData.forEach((_item) => {
              var temp;
              if (!_item.extendData) {
                _item.extendData = {};
              }
              if (mapFields.length == 1) {
                var mapField = mapFields[0];
                temp = _item[mapField] || _item["extendData"][mapField];
              } else {
                //有多个
                var mutiTemp = [];
                mapFields.forEach((_itemField) => {
                  mutiTemp.push(
                    _item[_itemField] || _item["extendData"][_itemField]
                  );
                });
                temp = mutiTemp.join(" ");
              }
              if (temp != null && temp != "") {
                value.push(temp);
              }
            });
            this.ruleForm[key] = value.join(",");
          }
        }
      }
    },
  },
};
</script>
Source/ProjectWeb/src/views/test/referDemo/index.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,29 @@
<template>
  <basic-container show-form>
    <el-button
      class="ml10"
      type="primary"
      icon="el-icon-plus"
      @click="onOpenDialogByAdd('add')"
      >新增</el-button
    >
    <refer-dialog ref="referDialogRef"></refer-dialog>
  </basic-container>
</template>
<script>
import referDialog from "./referDemoDialog.vue";
export default {
  name: "referIndex",
  components: { referDialog },
  methods: {
    // æ–°å¢ž
    onOpenDialogByAdd(type) {
      this.$refs.referDialogRef.openDialog({ type: type });
    },
  },
};
</script>
<style scoped></style>
Source/ProjectWeb/src/views/test/referDemo/referDemo.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,226 @@
//表单的定义
export const deferFormTemplate = [
  {
    prop: "userId",
    fieldId: "userId",
    label: "用户参照",
    rule: [],
    type: "refer",
    referConfig: {
      showProp: "userIdName",
      type:'user',
      extraParams:{
        aaa:'111'
      },//查询条件,可选
      paramForFormKey:'formDeptId', //使用表单上的数据作为查询条件参数,没有时使用useFormKey
      formValuesKey:'ruleForm',//页面上的表单数据对象名称,默认值‘form’
      useFormKey:'deptId',//需要从formValues中获取的表单字段,根据部门树参照选中数据动态查询用户
      isMuti:true,//是否多选,可选
      width: '1000px',
      referBusCode: "user",
      mapProps:{
        'personClassifyText':'personClassify'
      },
      defalutValue: '1', //参照默认值
      defalutText: '测试默认值' //参照默认显示值
    },
    col: 12,
    value: null,
  },
  {
    prop: "deptId",
    fieldId: "deptId",
    label: "部门树参照",
    rule: [],
    type: "refer",
    referConfig: {
      showProp: "deptIdName",
      type: 'dept',
      width: '400px',//弹窗宽度,可选
      height: '500px',//弹窗高度,可选
      extraParams: {
        'deptId':'tree'
      },//查询条件,可选
      paramForFormKey: 'formName', //使用表单上的数据作为查询条件,没有时使用useFormKey
      useFormKey: 'defaultId',//需要获取的表单字段
      isMuti: false,//是否多选,可选
      referBusCode: "dept",
      defalutValue: '1742475833773264896', //参照默认值
      defalutText: '测试默认值11' //参照默认显示值
    },
    col: 12,
    value: null,
  },
  {
    prop: "deptGridId",
    fieldId: "deptGridId",
    label: "部门列表参照",
    rule: [],
    type: "refer",
    referConfig: {
      showProp: "deptGridIdName",
      type:'deptGrid',
      width:'1500px',//弹窗宽度,可选
      height:'500px',//弹窗高度,可选
      extraParams:{
        'deptGridId':'grid'
      },//查询条件,可选
      isMuti:true,//是否多选,可选
      referBusCode: "dept",
      defalutValue: '1', //参照默认值
      defalutText: '测试默认值222' //参照默认显示值
    },
    col: 12,
    value: null,
  },
  {
    prop: "treeId",
    fieldId: "treeId",
    label: "树参照",
    rule: [],
    type: "refer",
    referConfig: {
      showProp: "treeIdName",
      type:'tree',
      url:'/org/deptController/referGrid',
      extraParams:{},//查询条件,可选
      isMuti:false,//是否多选,可选
      referBusCode: "dept",
      defalutValue: '1742475833773264896', //参照默认值
      defalutText: '' //参照默认显示值
    },
    col: 12,
    value: null,
  },
  {
    prop: "gridId",
    fieldId: "gridId",
    label: "列表参照",
    rule: [],
    type: "refer",
    referConfig: {
      edit:true,
      showProp: "gridIdName",
      url: "/bd/customerSaleClassifyController/list",
      type: "grid",
      width:'900px',//弹窗宽度,可选
      height:'70%',//弹窗高度,可选
      extraParams:{},//查询条件,可选
      paramForFormKey:'formDeptId', //使用表单上的数据作为查询条件,没有时使用useFormKey
      useFormKey:'deptId',//需要获取的表单字段
      isMuti:false,//是否多选,可选
      referBusCode: "customerSaleClf",
      tableConfig: {
        cols: [{
          prop: 'code',
          label: '编号',
          sortable: true,
          width: 150,
          search: true,
          formatter: function (d) {
            return d.code || d.extendData.code;
          }
        }, {
          prop: 'name',
          label: '名称',
          sortable: true,
          width: 150,
          search: true,
          formatter: function (d) {
            return d.name || d.extendData.name;
          }
        }, {
          prop: 'description',
          label: '描述'
        }]
      }
    },
    col: 12,
    value: null,
  },
  {
    prop: "defaultId",
    fieldId: "defaultId",
    label: "默认列表参照",
    rule: [],
    type: "refer",
    referConfig: {
      edit:true,
      showProp: "defaultIdName",
      url: "/org/deptController/referGrid",
      width:'60%',//弹窗宽度,可选
      height:'500px',//弹窗高度,可选
      extraParams:{},//查询条件,可选
      isMuti:false,//是否多选,可选
      referBusCode: "dept",
    },
    col: 12,
    value: null,
  },
  {
    prop: "classifyId",
    fieldId: "classifyId",
    label: "分类参照",
    rule: [],
    type: "refer",
    referConfig: {
      edit:true,
      placeholder:'自定义placeholder',
      showProp: "classifyIdName",
      type: "classify",
      classifys:[{
        title:'tab1',
        treeUrl:'/bd/customerClassifyController/referGrid', //分类的路径
        treeParams:{
          tree:'classifyId1' //树查询条件,可选
        },//分类查询条件
        queryByClassifyUrl:'/org/deptController/referGrid',  //'列表'
        queryField:'treeId', //列表数据中分类的字段
        classifyValueField:'id',  //从树上获取的字段
      },{
        title:'tab2',
        treeUrl:'/bd/materialClassifyController/referGrid', //分类的路径
        treeParams:{
          tree:'classifyId2' //树查询条件,可选
        },//分类查询条件
        queryByClassifyUrl:'/org/personController/referGrid',  //'列表'
        queryField:'treeName', //列表数据中分类的字段
        classifyValueField:'name',  //从树上获取的字段
      }],
      width:'70%',//弹窗宽度,可选
      isMuti:false,//是否多选,可选
      referBusCode: "",
      url: "/org/deptController/referGrid",  //列表的路径
      extraParams:{
        aa:'classifyId'
      },//查询条件,可选
      onlyTable:false,  //只显示列表,默认false
      tableConfig: {
        cols: [{
          prop: 'code',
          label: '编号',
          sortable: true,
          width: 150,
          search: true,
          formatter: function (d) {
            return d.code || d.extendData.code;
          }
        }, {
          prop: 'name',
          label: '名称',
          sortable: true,
          width: 150,
          search: true,
          formatter: function (d) {
            return d.name || d.extendData.name;
          }
        }, {
          prop: 'description',
          label: '描述'
        }]
      }
    },
    col: 12,
    value: null,
  }
];
Source/ProjectWeb/src/views/test/referDemo/referDemoDialog.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,77 @@
<template>
  <basic-dialog
    :visible.sync="dialog.showDialog"
    :title="dialog.title"
    width="40%"
    :submit-icon="dialog.submitIcon"
    :submit-txt="dialog.submitTxt"
    :loading="dialog.loading"
    @cancel="cancleDialog"
    @submit="submitDialog"
  >
    <!--动态模板-->
    <d-from
      :form-data="formData"
      :form-prop="ruleForm"
      ref="referDialogFormRef"
    ></d-from>
  </basic-dialog>
</template>
<script>
import { DFrom } from "@/views/test/referDemo/DynamicsFrom";
import { deferFormTemplate } from "@/views/test/referDemo/referDemo";
import { handlerObj } from "@/util/platformUtils";
export default {
  name: "referDemoDialog",
  components:{DFrom},
  data() {
    return {
      dialog: {
        showDialog: false,
        title: "",
        submitTxt: "",
        submitIcon: "",
        loading: false,
        type: "add",
      },
      formData: deferFormTemplate,
      ruleForm: {},
    };
  },
  methods: {
    // æ‰“开对话框
    openDialog(event) {
      this.dialog.type = event.type;
      if (event.type === "add") {
        this.dialog.title = "新增";
        this.dialog.submitTxt = "新增";
        this.dialog.submitIcon = "el-icon-plus";
        this.formData = deferFormTemplate;
        this.ruleForm = handlerObj("prop", "value", deferFormTemplate);
      } else if (event.type === "edit") {
        this.dialog.title = "修改";
        this.dialog.submitTxt = "修改";
        this.dialog.submitIcon = "el-icon-edit";
        // å¤„理修改逻辑
        this.handleEditForm(event.row);
      }
      this.dialog.showDialog = true;
    },
    // ç¡®è®¤æäº¤
    submitDialog() {
      this.$refs.referDialogFormRef.validate((valid, form) => {
        console.log("referDialogFormRef");
        console.log(form);
      });
    },
    // å–消
    cancleDialog() {
      this.dialog.loading = false;
      this.dialog.showDialog = false;
      this.formData = deferFormTemplate;
      this.ruleForm = {};
      this.$refs.referDialogFormRef.reset();
    },
  },
};
</script>