产品结构树:
1、实现文档批量删除功能
2、实现文档列表的排序以及筛选功能
设备结构树:
1、新增权限配置弹窗,提交后由后端测试
已添加2个文件
已修改12个文件
1272 ■■■■ 文件已修改
src/api/dnc.js 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/mixins/JeecgListMixin.js 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/base/modules/DeviceStructure/DeviceStructureTree.vue 53 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/base/modules/DeviceStructure/Permission/AssignPermissionModal.vue 100 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/base/modules/DeviceStructure/Permission/UserPermissionTransfer.vue 110 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/base/modules/ProductStructure/Document/NcDocumentAssignModal.vue 137 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/base/modules/ProductStructure/Document/NcDocumentTableList.vue 65 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/base/modules/ProductStructure/Document/OtherDocumentTableList.vue 63 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/base/modules/ProductStructure/Permission/AssignPermissionModal.vue 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/base/modules/ProductStructure/Permission/DepartPermissionTransfer.vue 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/base/modules/ProductStructure/ProductStructureMainTop.vue 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/common/DocumentBatchDeleteModal.vue 242 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/common/TableContextMenu.vue 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mdc/base/modules/EquipmentList/UserModal.vue 451 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/dnc.js
@@ -69,12 +69,22 @@
  assignPermissionToUser: ({ treeNodeType, treeNodeId, isAssignSonNode, userIdArray }) => {
    return postAction(`/nc/product/assign/add/user/${treeNodeType}/${treeNodeId}/${isAssignSonNode}`, userIdArray)
  },
  // ç§»é™¤éƒ¨é—¨æƒé™
  // ç§»é™¤ç”¨æˆ·æƒé™
  removePermissionFromUser: ({ treeNodeType, treeNodeId, isAssignSonNode, userIdArray }) => {
    return postAction(`/nc/product/assign/remove/user/${treeNodeType}/${treeNodeId}/${isAssignSonNode}`, userIdArray)
  },
  //-------------------------设备结构树------------------------------------------------
  // åˆ é™¤æ–‡æ¡£
  deleteDeviceRelativeDocumentApi: ({ docId, attributionId }) => deleteAction(`doc/relative/delete/device/${docId}/${attributionId}`)
  deleteDeviceRelativeDocumentApi: ({ docId, attributionId }) => deleteAction(`doc/relative/delete/device/${docId}/${attributionId}`),
  // èŽ·å–æœ‰æƒé™çš„ç”¨æˆ·åˆ—è¡¨
  getDeviceTreeHasPermissionUserApi: ({ type, key }) => getAction(`/nc/device/get/perm/user/${type}/${key}`),
  // åˆ†é…ç”¨æˆ¶æƒé™
  assignDeviceDeviceTreePermissionToUser: ({ treeNodeType, treeNodeId, isAssignSonNode, userIdArray }) => {
    return postAction(`/nc/device/assign/add/user/${treeNodeType}/${treeNodeId}/${isAssignSonNode}`, userIdArray)
  },
  // ç§»é™¤ç”¨æˆ·æƒé™
  removeDeviceTreePermissionFromUser: ({ treeNodeType, treeNodeId, isAssignSonNode, userIdArray }) => {
    return postAction(`/nc/device/assign/remove/user/${treeNodeType}/${treeNodeId}/${isAssignSonNode}`, userIdArray)
  },
}
src/mixins/JeecgListMixin.js
@@ -33,6 +33,10 @@
        column: 'createTime',
        order: 'desc',
      },
      defaultSorter:{
        column: 'createTime',
        order: 'desc',
      },
      /* ç­›é€‰å‚æ•° */
      filters: {},
      /* table加载状态 */
@@ -84,7 +88,6 @@
        this.ipagination.current = 1;
      }
      var params = this.getQueryParams();//查询条件
      console.log('params',params)
      if(!params){
        return false;
      }
src/views/dnc/base/modules/DeviceStructure/DeviceStructureTree.vue
@@ -34,6 +34,9 @@
        </div>
      </div>
    </a-spin>
    <!--权限配置弹窗-->
    <AssignPermissionModal :currentTreeNodeInfo="rightClickSelected" @submitSuccess="getTreeDataByApi"/>
  </a-card>
</template>
@@ -41,10 +44,12 @@
  import { mapActions } from 'vuex'
  import { deleteAction } from '@/api/manage'
  import DeviceStructureTreeContextMenu from './DeviceStructureTreeContextMenu'
  import AssignPermissionModal from './Permission/AssignPermissionModal'
  export default {
    name: 'DeviceStructureTree',
    components: {
      AssignPermissionModal,
      DeviceStructureTreeContextMenu
    },
    data() {
@@ -124,54 +129,6 @@
        // è‹¥å³é”®æ—¶å½“前右侧展示层级为设备层级且当前右键树层级同为设备层级时则在触发右键菜单功能时同时触发左键选中功能
        if (this.currentSelected.type === 2 && record.type === 2) this.handleTreeSelect([record.key], { node })
        this.rightClickSelected = Object.assign({}, record)
      },
      // æ ‘节点右键单击菜单中删除按钮时触发
      handleDelete() {
        const that = this
        that.$confirm({
          title: '提示',
          content: '确认删除此条记录吗?',
          okText: '确认',
          okType: 'danger',
          cancelText: '取消',
          onOk: () => {
            if (!this.url.delete) {
              this.$message.error('请设置url.delete属性!')
              return
            }
            deleteAction(that.url.delete, { id: this.rightClickSelected.id })
              .then((res) => {
                if (res.success) {
                  that.getTreeDataByApi()
                  that.$notification.success({
                    message: '消息',
                    description: res.message
                  })
                } else {
                  that.$notification.warning({
                    message: '消息',
                    description: res.message
                  })
                }
              })
              .finally(() => {
                that.$destroyAll()
              })
          },
          onCancel: () => {
            that.$destroyAll()
          }
        })
      },
      /**
       * è‡ªåŠ¨å±•å¼€æ·»åŠ ä¸‹çº§èŠ‚ç‚¹çš„çˆ¶èŠ‚ç‚¹
       */
      modalFormSubmitSuccess(isAddNextLevel) {
        // åˆ¤æ–­æ˜¯å¦ä¸ºæ·»åŠ ä¸‹çº§å¹¶ä¸”åˆ¤æ–­çˆ¶èŠ‚ç‚¹æ˜¯å¦å±•å¼€
        if (isAddNextLevel && !this.expandedKeys.includes(this.rightClickSelected.id)) this.expandedKeys.push(this.rightClickSelected.id)
        this.getTreeDataByApi()
      },
      /**
src/views/dnc/base/modules/DeviceStructure/Permission/AssignPermissionModal.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,100 @@
<template>
  <a-modal :visible="visible" :title="title" width="50%" :maskClosable="false" @cancel="handleModalClose"
           :footer="null">
    <a-form-model layout="inline">
      <a-form-item label="名称">
        <a-input readOnly :value="currentTreeNodeInfo.title"></a-input>
      </a-form-item>
      <a-form-item label="是否同时配置子节点" v-if="currentTreeNodeInfo.type!==2">
        <a-switch v-model="isAssignSonNode"></a-switch>
      </a-form-item>
    </a-form-model>
    <a-tabs v-model="activeTabKey">
      <a-tab-pane :key="1" tab="分配用户">
        <UserPermissionTransfer ref="userPermissionTransferRef" :currentTreeNodeInfo="currentTreeNodeInfo"
                                :dataSource="allUsersList" :isAssignSonNode="isAssignSonNode"/>
      </a-tab-pane>
    </a-tabs>
  </a-modal>
</template>
<script>
  import dncApi from '@/api/dnc'
  import UserPermissionTransfer from './UserPermissionTransfer'
  import { queryProductionTreeList } from '@/api/api'
  export default {
    name: 'AssignPermissionModal',
    components: { UserPermissionTransfer },
    props: {
      currentTreeNodeInfo: {
        type: Object
      }
    },
    data() {
      return {
        visible: false,
        title: '',
        isAssignSonNode: true,
        activeTabKey: 1,
        allDepartmentsList: [],
        allUsersList: [],
        allTreeKeys: [],
        hasLoadedDataTabKeyArray: []
      }
    },
    watch: {
      visible: {
        handler(value) {
          if (value) {
            if (this.currentTreeNodeInfo.type === 1) this.isAssignSonNode = true
            else this.isAssignSonNode = false
            this.getAllUsersListByApi()
          }
        }
      }
    },
    created() {
      this.$bus.$on('treeMenuItemMethodTrigger', this.triggerCorrespondingMethod)
    },
    methods: {
      // ç‚¹å‡»æ ‘节点右键菜单权限配置按钮后触发
      handleAssignPermission() {
        this.visible = true
      },
      // è°ƒç”¨æŽ¥å£èŽ·å–æ‰€æœ‰ç”¨æˆ·åˆ—è¡¨
      getAllUsersListByApi() {
        dncApi.getAllUsersListApi()
          .then(res => {
            if (res.success) {
              this.allUsersList = res.result.records.map(item => {
                return {
                  ...item,
                  disabled: item.username === 'admin'
                }
              })
              this.$nextTick(() => this.$refs.userPermissionTransferRef.getHasPermissionUserByApi())
            }
          })
      },
      // æŽ§åˆ¶å¼¹çª—关闭
      handleModalClose() {
        this.visible = false
      },
      triggerCorrespondingMethod({ methodName, modalTitle }) {
        if (this[methodName]) {
          this[methodName]()
          this.title = modalTitle
        }
      }
    }
  }
</script>
<style scoped>
</style>
src/views/dnc/base/modules/DeviceStructure/Permission/UserPermissionTransfer.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,110 @@
<template>
  <a-spin :spinning="spinning">
    <a-transfer
      class="transfer-container"
      :data-source="dataSource"
      show-search
      :list-style="{flex:1,height: '500px'}"
      :titles="['未分配用户', '已分配用户']"
      :operations="['分配用户', '移除用户']"
      :target-keys="targetKeys"
      :render="item => `${item.realname}`"
      @change="handleChange"
      :rowKey="record => record.id"
    >
      <span slot="notFoundContent">暂无数据</span>
    </a-transfer>
  </a-spin>
</template>
<script>
  import dncApi from '@/api/dnc'
  export default {
    name: 'UserPermissionTransfer',
    components: {},
    props: {
      currentTreeNodeInfo: {
        type: Object
      },
      dataSource: {
        type: Array
      },
      isAssignSonNode: {
        type: Boolean
      }
    },
    data() {
      return {
        targetKeys: [],
        spinning: false
      }
    },
    methods: {
      // èŽ·å–æœ‰æƒé™çš„ç”¨æˆ·åˆ—è¡¨
      getHasPermissionUserByApi() {
        const that = this
        that.spinning = true
        that.targetKeys = []
        dncApi.getDeviceTreeHasPermissionUserApi(this.currentTreeNodeInfo)
          .then(res => {
            if (res.success) this.targetKeys = res.list.map(item => item.id)
          })
          .finally(() => {
            that.spinning = false
          })
      },
      handleChange(targetKeys, direction, moveKeys) {
        const { currentTreeNodeInfo: { type, key }, isAssignSonNode, $notification, dataSource } = this
        const that = this
        let method
        const params = {
          treeNodeType: type,
          treeNodeId: key,
          isAssignSonNode: isAssignSonNode ? 1 : 2,
          userIdArray: moveKeys
        }
        console.log('params--------------------------', params)
        console.log(targetKeys, direction, moveKeys)
        if (direction === 'right') {
          method = dncApi.assignPermissionToUser
        } else {
          method = dncApi.removePermissionFromUser
        }
        that.spinning = true
        method(params)
          .then(res => {
            if (res.success) {
              $notification.success({
                message: '消息',
                description: res.message
              })
              this.targetKeys = targetKeys
            } else {
              $notification.error({
                message: '消息',
                description: res.message
              })
            }
          })
          .catch(err => {
            $notification.error({
              message: '消息',
              description: err.message
            })
          })
          .finally(() => {
            that.spinning = false
          })
      }
    }
  }
</script>
<style scoped lang="less">
  .transfer-container {
    display: flex;
    align-items: center;
  }
</style>
src/views/dnc/base/modules/ProductStructure/Document/NcDocumentAssignModal.vue
@@ -10,13 +10,14 @@
                <a-row :gutter="24">
                  <a-col :md="7" :sm="7">
                    <a-form-item label="文件名称">
                      <a-input placeholder="请输入文件名称" v-model="queryParam.docName"></a-input>
                      <a-input placeholder="请输入文件名称" v-model="queryParam.docName" allow-clear></a-input>
                    </a-form-item>
                  </a-col>
                  <a-col :md="11" :sm="11">
                    <a-form-item label="上传时间">
                      <a-range-picker v-model="queryParam.collectTime"></a-range-picker>
                      <a-range-picker v-model="date" value-format="YYYY-MM-DD"
                                      @change="handleDateChange" allow-clear></a-range-picker>
                    </a-form-item>
                  </a-col>
@@ -30,6 +31,7 @@
            <a-table :columns="columns" :data-source="dataSource" bordered :pagination="false" :loading="loading"
                     :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
                     @change="handleTableChange"
                     :scroll="{y:456}" :size="size" rowKey="docId">
            </a-table>
@@ -55,10 +57,10 @@
                  <a-tree blockNode checkable :checkedKeys="checkedKeys" :expandedKeys.sync="expandedKeys"
                          :autoExpandParent="autoExpandParent" @select="handleTreeNodeSelect"
                          :treeData="treeDataSource" @check="handleTreeNodeCheck" @expand="handleTreeNodeExpand">
                    <template slot="title" slot-scope="{ label, parentId, entity, key:treeKey,type}">
                     <span v-if="label.indexOf(searchValue) > -1">{{ label.substr(0, label.indexOf(searchValue)) }}<span
                       class="replaceSearch">{{ searchValue }}</span>{{ label.substr(label.indexOf(searchValue) + searchValue.length) }}</span>
                      <span v-else>{{ label }}</span>
                    <template slot="title" slot-scope="{ title, parentId, entity, key:treeKey,type}">
                     <span v-if="title.indexOf(searchValue) > -1">{{ title.substr(0, title.indexOf(searchValue)) }}<span
                       class="replaceSearch">{{ searchValue }}</span>{{ title.substr(title.indexOf(searchValue) + searchValue.length) }}</span>
                      <span v-else>{{ title }}</span>
                    </template>
                  </a-tree>
                </div>
@@ -83,6 +85,7 @@
  import { getAction } from '@/api/manage'
  import dncApi from '@/api/dnc'
  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  import { mapActions } from 'vuex'
  export default {
    name: 'NcDocumentAssignModal',
@@ -112,11 +115,43 @@
              return parseInt(index) + 1
            }
          },
          { title: '文件名称', dataIndex: 'docName', align: 'center', width: 300 },
          {
            title: '文件名称',
            dataIndex: 'docName',
            key: 'docName',
            align: 'center',
            width: 300,
            sorter: true
          },
          { title: '设备编号', dataIndex: 'docCode', align: 'center' },
          { title: '出库状态', dataIndex: 'pullStatus_dictText', align: 'center' },
          { title: '状  æ€', dataIndex: 'docStatus_dictText', align: 'center' },
          { title: '上传时间', dataIndex: 'createTime', align: 'center', width: 200 }
          {
            title: '出库状态',
            dataIndex: 'pullStatus_dictText',
            key: 'pullStatus',
            align: 'center',
            filters: [
              { text: '未出库', value: 1 },
              { text: '已出库', value: 2 }
            ]
          },
          {
            title: '状  æ€',
            dataIndex: 'docStatus_dictText',
            key: 'docStatus',
            align: 'center',
            filters: [
              { text: '设计', value: 1 },
              { text: '发布', value: 2 },
              { text: '归档', value: 3 }
            ]
          },
          {
            title: '创建时间',
            dataIndex: 'createTime',
            align: 'center',
            width: 200,
            sorter: true
          }
        ],
        searchValue: '',
        searchInput: '',
@@ -127,6 +162,7 @@
        expandedKeys: [],
        autoExpandParent: true,
        isExpandAllTreeNode: false,
        date: [],
        url: {
          list: '/nc/doc/find/list'
        }
@@ -150,6 +186,9 @@
      }
    },
    methods: {
      ...mapActions(['QueryProduction']),
      // èŽ·å–å½“å‰å·¥åºæˆ–å·¥æ­¥å¯¹åº”æ–‡æ¡£åˆ—è¡¨
      loadData() {
        this.dataSource = []
        if (!this.url.list) {
@@ -157,14 +196,11 @@
          return
        }
        var params = this.getQueryParams()//查询条件
        if (!params) {
          return false
        }
        if (!params) return false
        const { attributionType, attributionId, param } = this.currentDocumentInfo
        params.attributionType = attributionType
        params.attributionId = attributionId
        params.docClassCode = param
        console.log('params', params)
        this.loading = true
        getAction(this.url.list, params).then((res) => {
          if (res.success) this.dataSource = res.result
@@ -174,16 +210,18 @@
        })
      },
      // èŽ·å–DNC设备树
      getDocumentAssignDeviceTreeByApi() {
        this.spinning = true
        this.treeDataSource = []
        dncApi.getDocumentAssignDeviceTreeApi(this.currentDocumentInfo)
        this.QueryProduction('DNC')
          .then(res => {
            if (res.success) {
              this.dataList = []
              this.allTreeKeys = []
              this.treeDataSource = res.list
              this.treeDataSource = res.result
              this.generateList(this.treeDataSource)
              this.expandedKeys = this.allTreeKeys
            } else {
              this.$message.warn(res.message)
            }
@@ -193,15 +231,42 @@
          })
      },
      // æ—¶é—´é€‰æ‹©å™¨é€‰æ‹©å®ŒæˆåŽè§¦å‘
      handleDateChange(value) {
        this.queryParam.startTime = value[0]
        this.queryParam.endTime = value[1]
      },
      /**
       * è¡¨æ ¼åˆ†é¡µã€æŽ’序改变、筛选时触发
       * @param pagination åˆ†é¡µå™¨é€‰é¡¹
       * @param filters ç­›é€‰é€‰é¡¹
       * @param sorter æŽ’序选项
       */
      handleTableChange(pagination, filters, sorter) {
        if (sorter.order) {
          this.isorter.column = sorter.field
          this.isorter.order = sorter.order === 'ascend' ? 'asc' : 'desc'
        } else {
          this.isorter.column = 'createTime'
          this.isorter.order = 'desc'
        }
        for (let key in filters) {
          this.filters[key] = filters[key].join(',')
        }
        this.loadData()
      },
      // æŒ‡æ´¾åˆ°è®¾å¤‡çª—口点击确定指派设备后触发
      handleAssignDocumentToDevice() {
        const { checkedKeys, selectedRowKeys, dataList, $confirm, $notification, currentDocumentInfo, queryParam: { applyReason }, $set } = this
        const { publishFileId, attributionId } = currentDocumentInfo
        const { checkedKeys, selectedRowKeys, dataList, $confirm, $notification, currentDocumentInfo, queryParam: { applyReason }, $destroyAll, $bus } = this
        const { publishFileId, attributionId, attributionType } = currentDocumentInfo
        const paramsArray = []
        // è¿‡æ»¤åˆ†ç»„Id仅放入设备Id
        // è¿‡æ»¤è½¦é—´key仅放入设备key
        const treeCheckedDeviceKeys = []
        checkedKeys.forEach(checkedKey => {
          const deviceId = dataList.find(item => item.key === checkedKey && item.type === 2)
          if (deviceId) treeCheckedDeviceKeys.push(deviceId.key)
          const device = dataList.find(item => item.key === checkedKey && item.type === 2)
          if (device) treeCheckedDeviceKeys.push(device.key)
        })
        if (treeCheckedDeviceKeys.length === 0 || selectedRowKeys.length === 0) {
@@ -218,13 +283,15 @@
          okText: '确认',
          cancelText: '取消',
          onOk: () => {
            // åŒé‡å¾ªçŽ¯ç¡®å®šæ¯ä¸€ç»„è®¾å¤‡ä¸Žæ–‡æ¡£çš„å‚æ•°
            treeCheckedDeviceKeys.forEach(deviceId => {
              selectedRowKeys.forEach(docId => {
                paramsArray.push({
                  docId,
                  deviceId,
                  fileId: publishFileId,
                  processId: attributionId,
                  attributionId,
                  attributionType,
                  applyReason
                })
              })
@@ -234,7 +301,7 @@
              dncApi.assignDocumentToDeviceApi(item)
                .then(res => {
                  if (res.success) {
                    this.$bus.$emit('reloadMainBottomTableData', 'useDocumentEquipment')
                    $bus.$emit('reloadMainBottomTableData', 'useDocumentEquipment')
                    $notification.success({
                      message: '消息',
                      description: res.message
@@ -252,13 +319,15 @@
                    description: err.message
                  })
                })
                .finally(() => {
                  $destroyAll()
                })
            })
            console.log('paramsArray', paramsArray)
          },
          onCancel: () => {
            $destroyAll()
          }
        })
        // console.log('table', this.selectedRowKeys)
        // console.log('treeCheckedDeviceKeys', treeCheckedDeviceKeys)
        // console.log('currentDocumentInfo', this.currentDocumentInfo)
      },
      /* è¾“入查询内容变化时触发 */
@@ -302,6 +371,11 @@
        this.checkedKeys = checkedKeys
      },
      /**
       * æ ‘节点选中时触发(模拟树节点复选框选中时的效果)
       * @param selectedKeys é€‰ä¸­èŠ‚ç‚¹key
       * @param {node} node èŠ‚ç‚¹å¯¹è±¡
       */
      handleTreeNodeSelect(selectedKeys, { node }) {
        node.$el.childNodes[1].click()
      },
@@ -330,14 +404,13 @@
      /**
       * é€’归获得所有树节点key
       * @param data
       * @param data è®¾å¤‡æ ‘数据
       */
      generateList(data) {
        for (let i = 0; i < data.length; i++) {
          data[i].key = data[i].id
          const node = data[i]
          const key = node.id
          const title = node.label
          const key = node.key
          const title = node.title
          const type = node.type
          this.dataList.push({ key, title, type })
          this.allTreeKeys.push(key)
@@ -350,6 +423,8 @@
        this.expandedKeys = []
        this.selectedRowKeys = []
        this.checkedKeys = []
        this.filters = {}
        this.isorter = Object.assign({}, this.defaultSorter)
      }
    }
  }
src/views/dnc/base/modules/ProductStructure/Document/NcDocumentTableList.vue
@@ -44,12 +44,44 @@
              return parseInt(index) + 1
            }
          },
          { title: '文件名称', dataIndex: 'docName', align: 'center' },
          {
            title: '文件名称',
            dataIndex: 'docName',
            key: 'docName',
            align: 'center',
            width: 300,
            sorter: true
          },
          { title: '代码版本', dataIndex: 'docAlias', align: 'center' },
          { title: '出库状态', dataIndex: 'pullStatus_dictText', align: 'center' },
          { title: '状  æ€', dataIndex: 'docStatus_dictText', align: 'center' },
          { title: '系统指定版本', dataIndex: 'publishVersion', align: 'center' },
          { title: '上传时间', dataIndex: 'createTime', align: 'center' }
          {
            title: '出库状态',
            dataIndex: 'pullStatus_dictText',
            key: 'pullStatus',
            align: 'center',
            filters: [
              { text: '未出库', value: 1 },
              { text: '已出库', value: 2 }
            ]
          },
          {
            title: '状  æ€',
            dataIndex: 'docStatus_dictText',
            key: 'docStatus',
            align: 'center',
            filters: [
              { text: '设计', value: 1 },
              { text: '发布', value: 2 },
              { text: '归档', value: 3 }
            ]
          },
          { title: '系统指定版本', dataIndex: 'publishVersion', align: 'center', width: 200 },
          {
            title: '创建时间',
            dataIndex: 'createTime',
            align: 'center',
            width: 200,
            sorter: true
          }
        ],
        dataSource: [],
        currentRightClickedDocumentInfo: {},
@@ -79,7 +111,6 @@
        //加载数据 è‹¥ä¼ å…¥å‚æ•°1则加载第一页的内容
        if (arg === 1) this.ipagination.current = 1
        var params = this.getQueryParams()//查询条件
        console.log('currentTreeNodeInfo', this.currentTreeNodeInfo)
        params.attributionId = this.currentTreeNodeInfo.id
        params.attributionType = this.currentTreeNodeInfo.type
        params.docClassCode = 'NC'
@@ -119,12 +150,34 @@
        }
      },
      /**
       * è¡¨æ ¼åˆ†é¡µã€æŽ’序改变、筛选时触发
       * @param pagination åˆ†é¡µå™¨é€‰é¡¹
       * @param filters ç­›é€‰é€‰é¡¹
       * @param sorter æŽ’序选项
       */
      handleTableChange(pagination, filters, sorter) {
        if (sorter.order) {
          this.isorter.column = sorter.field
          this.isorter.order = sorter.order === 'ascend' ? 'asc' : 'desc'
        } else {
          this.isorter.column = 'createTime'
          this.isorter.order = 'desc'
        }
        for (let key in filters) {
          this.filters[key] = filters[key].join(',')
        }
        this.ipagination = pagination
        this.loadData()
      },
      handleDocumentEdit(record, modalTitle) {
        this.$refs.modalForm.edit(record)
        this.$refs.modalForm.title = modalTitle
      },
      handleDocumentAssign(record, modalTitle) {
        if (!this.$refs.documentAssignModalRef) return
        this.$refs.documentAssignModalRef.title = modalTitle
        this.$refs.documentAssignModalRef.visible = true
      },
src/views/dnc/base/modules/ProductStructure/Document/OtherDocumentTableList.vue
@@ -40,12 +40,44 @@
              return parseInt(index) + 1
            }
          },
          { title: '文件名称', dataIndex: 'docName', align: 'center' },
          {
            title: '文件名称',
            dataIndex: 'docName',
            key: 'docName',
            align: 'center',
            width: 300,
            sorter: true
          },
          { title: '设备编号', dataIndex: 'docCode', align: 'center' },
          { title: '出库状态', dataIndex: 'pullStatus_dictText', align: 'center' },
          { title: '状  æ€', dataIndex: 'docStatus_dictText', align: 'center' },
          { title: '系统指定版本', dataIndex: 'publishVersion', align: 'center' },
          { title: '上传时间', dataIndex: 'createTime', align: 'center' }
          {
            title: '出库状态',
            dataIndex: 'pullStatus_dictText',
            key: 'pullStatus',
            align: 'center',
            filters: [
              { text: '未出库', value: 1 },
              { text: '已出库', value: 2 }
            ]
          },
          {
            title: '状  æ€',
            dataIndex: 'docStatus_dictText',
            key: 'docStatus',
            align: 'center',
            filters: [
              { text: '设计', value: 1 },
              { text: '发布', value: 2 },
              { text: '归档', value: 3 }
            ]
          },
          { title: '系统指定版本', dataIndex: 'publishVersion', align: 'center', width: 200 },
          {
            title: '创建时间',
            dataIndex: 'createTime',
            align: 'center',
            width: 200,
            sorter: true
          }
        ],
        dataSource: [],
        currentClickedDocumentInfo: {},
@@ -113,6 +145,27 @@
        }
      },
      /**
       * è¡¨æ ¼åˆ†é¡µã€æŽ’序改变、筛选时触发
       * @param pagination åˆ†é¡µå™¨é€‰é¡¹
       * @param filters ç­›é€‰é€‰é¡¹
       * @param sorter æŽ’序选项
       */
      handleTableChange(pagination, filters, sorter) {
        if (sorter.order) {
          this.isorter.column = sorter.field
          this.isorter.order = sorter.order === 'ascend' ? 'asc' : 'desc'
        } else {
          this.isorter.column = 'createTime'
          this.isorter.order = 'desc'
        }
        for (let key in filters) {
          this.filters[key] = filters[key].join(',')
        }
        this.ipagination = pagination
        this.loadData()
      },
      handleDocumentEdit(record, modalTitle) {
        this.$refs.modalForm.edit(record)
        this.$refs.modalForm.title = modalTitle
src/views/dnc/base/modules/ProductStructure/Permission/AssignPermissionModal.vue
@@ -11,7 +11,7 @@
    </a-form-model>
    <a-tabs v-model="activeTabKey">
      <a-tab-pane :key="1" tab="分配部门">
      <a-tab-pane :key="1" tab="分配车间">
        <DepartPermissionTransfer ref="departPermissionTransferRef" :currentTreeNodeInfo="currentTreeNodeInfo"
                                  :treeDataProps="allDepartmentsList" :allTreeKeys="allTreeKeys"
                                  :isAssignSonNode="isAssignSonNode"/>
@@ -78,7 +78,7 @@
        this.visible = true
      },
      // è°ƒç”¨æŽ¥å£èŽ·å–æ‰€æœ‰éƒ¨é—¨åˆ—è¡¨
      // è°ƒç”¨æŽ¥å£èŽ·å–æ‰€æœ‰è½¦é—´åˆ—è¡¨
      getAllDepartmentsListByApi() {
        this.allTreeKeys = []
        queryProductionTreeList()
@@ -92,7 +92,7 @@
                this.$refs.departPermissionTransferRef.expandedKeys = this.allTreeKeys
                this.$refs.departPermissionTransferRef.flatten(JSON.parse(JSON.stringify(this.allDepartmentsList)))
              })
              // åªæœ‰ä¸Šæ¬¡é€€å‡ºæ—¶åœ¨éƒ¨é—¨åˆ†é…tab界面才会进入此判断
              // åªæœ‰ä¸Šæ¬¡é€€å‡ºæ—¶åœ¨è½¦é—´åˆ†é…tab界面才会进入此判断
              // è‹¥ä¸Šæ¬¡é€€å‡ºæ—¶åœ¨ç”¨æˆ·åˆ†é…tab界面则再次进入时key由2变为1时会触发watch监测activeTabKey变化则会将key:1加入hasLoadedDataTabKeyArray,因此无需再次加入key:1
              if (!this.hasLoadedDataTabKeyArray.includes(this.activeTabKey)) this.hasLoadedDataTabKeyArray.push(this.activeTabKey)
            }
src/views/dnc/base/modules/ProductStructure/Permission/DepartPermissionTransfer.vue
@@ -5,8 +5,8 @@
      :data-source="dataSource"
      show-search
      :list-style="{flex:1,height: '500px'}"
      :titles="['未分配部门', '已分配部门']"
      :operations="['分配部门', '移除部门']"
      :titles="['未分配车间', '已分配车间']"
      :operations="['分配车间', '移除车间']"
      :target-keys="targetKeys"
      :render="item => `${item.title}`"
      @change="handleChange"
@@ -92,7 +92,7 @@
      }
    },
    methods: {
      // è°ƒç”¨æŽ¥å£èŽ·å–æœ‰æƒé™çš„éƒ¨é—¨åˆ—è¡¨
      // è°ƒç”¨æŽ¥å£èŽ·å–æœ‰æƒé™çš„è½¦é—´åˆ—è¡¨
      getHasPermissionDepartByApi() {
        const that = this
        that.spinning = true
src/views/dnc/base/modules/ProductStructure/ProductStructureMainTop.vue
@@ -12,6 +12,9 @@
    </a-tab-pane>
    <TableContextMenu :tableRowInfo="currentRightClickedTableRowInfo" ref="tableContextMenuRef"/>
    <DocumentBatchDeleteModal :currentDocumentInfo="currentRightClickedTableRowInfo" :size="tableContainerSize"
                              @reloadDocumentListData="reloadDocumentListData" ref="documentBatchDeleteModalRef"/>
  </a-tabs>
</template>
@@ -20,10 +23,11 @@
  import NcDocumentTableList from './Document/NcDocumentTableList'
  import OtherDocumentTableList from './Document/OtherDocumentTableList'
  import TableContextMenu from '../../../common/TableContextMenu'
  import DocumentBatchDeleteModal from '../../../common/DocumentBatchDeleteModal'
  export default {
    name: 'ProductStructureMainTop',
    components: { TableContextMenu, OtherDocumentTableList, NcDocumentTableList },
    components: { DocumentBatchDeleteModal, TableContextMenu, OtherDocumentTableList, NcDocumentTableList },
    data() {
      return {
        activeTabKey: 1,
@@ -142,6 +146,12 @@
        })
      },
      handleBatchRemove(modalTitle) {
        if (!this.$refs.documentBatchDeleteModalRef) return
        this.$refs.documentBatchDeleteModalRef.title = modalTitle
        this.$refs.documentBatchDeleteModalRef.visible = true
      },
      /**
       * å‡ºåº“当前右键选中文档
       * @param menuLabel
src/views/dnc/common/DocumentBatchDeleteModal.vue
@@ -1,20 +1,244 @@
<template>
    <div>
  <a-modal width="65%" :title="title" :visible="visible" @cancel="visible=false" :maskClosable="false" centered
           @ok="confirmBatchDeleteDocument">
    <div class="table-page-search-wrapper">
      <a-form layout="inline" @keyup.enter.native="searchQuery">
        <a-row :gutter="24">
          <a-col :md="6" :sm="6">
            <a-form-item label="文件名称">
              <a-input placeholder="请输入文件名称" v-model="queryParam.docName" allow-clear></a-input>
            </a-form-item>
          </a-col>
          <a-col :md="8" :sm="8">
            <a-form-item label="创建时间">
              <a-range-picker v-model="date" value-format="YYYY-MM-DD" @change="handleDateChange"
                              allow-clear></a-range-picker>
            </a-form-item>
          </a-col>
          <a-col :md="4" :sm="4">
            <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
          </a-col>
        </a-row>
      </a-form>
    </div>
    <a-table :columns="columns" :data-source="dataSource" bordered :pagination="ipagination" :loading="loading"
             :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" @change="handleTableChange"
             :scroll="{y:380}" :size="size" rowKey="docId" style="min-height: 480px">
      <span slot="docName" slot-scope="text">{{text}}</span>
    </a-table>
  </a-modal>
</template>
<script>
  import { getAction } from '@/api/manage'
  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  import dncApi from '@/api/dnc'
  export default {
    name: 'DocumentBatchDeleteModal',
    components: {},
    data() {
      return {}
    mixins: [JeecgListMixin],
    props: {
      currentDocumentInfo: {
        type: Object
      },
      size: {
        type: String
      }
    },
    methods: {}
    data() {
      return {
        disableMixinCreated: true,
        visible: false,
        title: '',
        date: [],
        columns: [
          {
            title: '序号',
            dataIndex: 'rowIndex',
            key: 'rowIndex',
            width: 65,
            align: 'center',
            customRender: function(t, r, index) {
              return parseInt(index) + 1
            }
          },
          {
            title: '文件名称',
            dataIndex: 'docName',
            key: 'docName',
            align: 'center',
            width: 300,
            sorter: true
          },
          { title: '设备编号', dataIndex: 'docCode', align: 'center' },
          {
            title: '出库状态',
            dataIndex: 'pullStatus_dictText',
            key: 'pullStatus',
            align: 'center',
            filters: [
              { text: '未出库', value: 1 },
              { text: '已出库', value: 2 }
            ],
          },
          {
            title: '状  æ€',
            dataIndex: 'docStatus_dictText',
            key: 'docStatus',
            align: 'center',
            filters: [
              { text: '设计', value: 1 },
              { text: '发布', value: 2 },
              { text: '归档', value: 3 }
            ],
          },
          { title: '系统指定版本', dataIndex: 'publishVersion', align: 'center', width: 200 },
          {
            title: '创建时间',
            dataIndex: 'createTime',
            align: 'center',
            width: 200,
            sorter: true
          }
        ],
        spinning: false,
        url: {
          list: '/nc/doc/find/page'
        }
      }
    },
    watch: {
      visible: {
        handler(value) {
          if (value) {
            this.resetData()
            this.loadData()
          }
        }
      }
    },
    methods: {
      // èŽ·å–å½“å‰å·¥åºæˆ–å·¥æ­¥å¯¹åº”æ–‡æ¡£åˆ—è¡¨
      loadData() {
        this.dataSource = []
        if (!this.url.list) {
          this.$message.error('请设置url.list属性!')
          return
        }
        var params = this.getQueryParams()//查询条件
        if (!params) return false
        const { attributionType, attributionId, param } = this.currentDocumentInfo
        params.attributionType = attributionType
        params.attributionId = attributionId
        params.docClassCode = param
        console.log('params', params)
        this.loading = true
        getAction(this.url.list + `/${this.ipagination.current}/${this.ipagination.pageSize}`, params).then((res) => {
          if (res.success) {
            this.dataSource = res.result.records
            if (res.result.total) {
              this.ipagination.total = res.result.total
            } else {
              this.ipagination.total = 0
            }
          }
          else this.$message.warning(res.message)
        }).finally(() => {
          this.loading = false
        })
      },
      /**
       * è¡¨æ ¼åˆ†é¡µã€æŽ’序改变、筛选时触发
       * @param pagination åˆ†é¡µå™¨é€‰é¡¹
       * @param filters ç­›é€‰é€‰é¡¹
       * @param sorter æŽ’序选项
       */
      handleTableChange(pagination, filters, sorter) {
        if (sorter.order) {
          this.isorter.column = sorter.field
          this.isorter.order = sorter.order === 'ascend' ? 'asc' : 'desc'
        } else {
          this.isorter.column = 'createTime'
          this.isorter.order = 'desc'
        }
        for (let key in filters) {
          this.filters[key] = filters[key].join(',')
        }
        this.ipagination = pagination
        this.loadData()
      },
      // æ—¶é—´é€‰æ‹©å™¨é€‰æ‹©å®ŒæˆåŽè§¦å‘
      handleDateChange(value) {
        this.queryParam.startTime = value[0]
        this.queryParam.endTime = value[1]
      },
      // ç¡®è®¤æ‰¹é‡åˆ é™¤æ–‡æ¡£
      confirmBatchDeleteDocument() {
        const that = this
        const { selectedRowKeys, $notification, $confirm, currentDocumentInfo: { param, attributionId } } = that
        if (selectedRowKeys.length === 0) {
          $notification.warning({
            message: '消息',
            description: '请选择文档'
          })
          return
        }
        $confirm({
          title: '提示',
          content: `删除后不可取消,确认删除吗?`,
          okText: '确认',
          cancelText: '取消',
          onOk: () => {
            let hasRequestedSuccessCount = 0
            let hasRequestedCount = 0
            selectedRowKeys.forEach(key => {
              dncApi.deleteDocumentApi(key)
                .then(res => {
                  if (res.success) {
                    $notification.success({
                      message: '消息',
                      description: res.message
                    })
                    hasRequestedSuccessCount++
                  } else {
                    $notification.error({
                      message: '消息',
                      description: res.message
                    })
                  }
                })
                .finally(() => {
                  hasRequestedCount++
                  if (hasRequestedCount === selectedRowKeys.length && hasRequestedSuccessCount > 0) {
                    this.loadData()
                    this.$emit('reloadDocumentListData', { docClassCode: param, attributionId })
                  }
                })
            })
            that.$destroyAll()
          },
          onCancel: () => {
            that.$destroyAll()
          }
        })
      },
      resetData() {
        this.queryParam = {}
        this.selectedRowKeys = []
      }
    }
  }
</script>
<style scoped>
</style>
</script>
src/views/dnc/common/TableContextMenu.vue
@@ -48,7 +48,7 @@
            { label: '导入NC程序', code: 'document_import', subMenu: [], icon: 'import', isCommonMethod: true },
            { label: '下载', code: 'document_download', subMenu: [], icon: 'download', isCommonMethod: true },
            { label: '删除', code: 'document_delete', subMenu: [], icon: 'delete', isCommonMethod: true },
            { label: '批量删除', code: 'document_batch_remove', subMenu: [], icon: 'delete', isCommonMethod: false },
            { label: '批量删除', code: 'document_batch_remove', subMenu: [], icon: 'delete', isCommonMethod: true },
            {
              label: '生命周期',
              subMenu: [
@@ -68,7 +68,7 @@
            { label: '导入文档', code: 'document_import', subMenu: [], icon: 'import', isCommonMethod: true },
            { label: '下载', code: 'document_download', subMenu: [], icon: 'download', isCommonMethod: true },
            { label: '删除', code: 'document_delete', subMenu: [], icon: 'delete', isCommonMethod: true },
            { label: '批量删除', code: 'document_batch_remove', subMenu: [], icon: 'delete', isCommonMethod: false },
            { label: '批量删除', code: 'document_batch_remove', subMenu: [], icon: 'delete', isCommonMethod: true },
            {
              label: '生命周期',
              subMenu: [
@@ -88,7 +88,7 @@
            { label: '导入NC程序', code: 'document_import', subMenu: [], icon: 'import', isCommonMethod: true },
            { label: '下载', code: 'document_download', subMenu: [], icon: 'download', isCommonMethod: true },
            { label: '删除', code: 'document_delete', subMenu: [], icon: 'delete', isCommonMethod: true },
            { label: '批量删除', code: 'document_batch_remove', subMenu: [], icon: 'delete', isCommonMethod: false },
            { label: '批量删除', code: 'document_batch_remove', subMenu: [], icon: 'delete', isCommonMethod: true },
            {
              label: '生命周期',
              subMenu: [
@@ -108,7 +108,7 @@
            { label: '导入NC程序', code: 'document_import', subMenu: [], icon: 'import', isCommonMethod: true },
            { label: '下载', code: 'document_download', subMenu: [], icon: 'download', isCommonMethod: true },
            { label: '删除', code: 'document_delete', subMenu: [], icon: 'delete', isCommonMethod: true },
            { label: '批量删除', code: 'document_batch_remove', subMenu: [], icon: 'delete', isCommonMethod: false },
            { label: '批量删除', code: 'document_batch_remove', subMenu: [], icon: 'delete', isCommonMethod: true },
            {
              label: '生命周期',
              subMenu: [
src/views/mdc/base/modules/EquipmentList/UserModal.vue
@@ -23,14 +23,13 @@
        <a-row :gutter="24">
          <a-col :span="12">
            <a-form-model-item label="统一编码" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="equipmentId">
              <a-input-search :readOnly="true"
                              v-model="model.equipmentId"
                              :disabled="disSearch"   @search="deviceSearch" enter-button placeholder='请选择统一编码' />
              <a-input-search v-model="model.equipmentId" :disabled="disableSubmit" @search="deviceSearch" enter-button
                              placeholder='请选择统一编码'/>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="设备名称" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <a-input :disabled="disSearch" :readOnly="disableSubmit" allow-clear placeholder="请输入设备名称"
              <a-input :disabled="disableSubmit" allow-clear placeholder="请输入设备名称"
                       v-model="model.equipmentName"/>
            </a-form-model-item>
          </a-col>
@@ -38,12 +37,15 @@
        <a-row :gutter="24">
          <a-col :span="12">
            <a-form-model-item  v-if="isDepartType == 0" label="部门分配" :labelCol="labelCol" :wrapperCol="wrapperCol" v-show="!departDisabled">
              <j-select-equipment-depart :disabled="disableSubmit" v-model="model.selectedDeparts" :multi="false" @back="backDepartInfo" :backDepart="true" :treeOpera="true"></j-select-equipment-depart>
            <a-form-model-item v-if="isDepartType == 0" label="部门分配" :labelCol="labelCol" :wrapperCol="wrapperCol"
                               v-show="!departDisabled">
              <j-select-equipment-depart :disabled="disableSubmit" v-model="model.selectedDeparts" :multi="false"
                                         @back="backDepartInfo" :backDepart="true"
                                         :treeOpera="true"></j-select-equipment-depart>
            </a-form-model-item>
            <a-form-model-item v-if="isDepartType == -1" label="设备类型" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <a-select :disabled="disableSubmit" :readOnly="disableSubmit" placeholder="请选择设备类型"
              <a-select :disabled="disableSubmit" placeholder="请选择设备类型"
                        :triggerChange="true"
                        v-model="model.equipmentType">
                <a-select-option v-for='item in selectList' :key='item.id' :value='item.equipmentTypeName'>
@@ -53,9 +55,12 @@
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="车间分配" :labelCol="labelCol" :wrapperCol="wrapperCol"  v-show="!productionDisabled" ref="selectedProduction"  prop="selectedProduction">
            <a-form-model-item label="车间分配" :labelCol="labelCol" :wrapperCol="wrapperCol" v-show="!productionDisabled"
                               ref="selectedProduction" prop="selectedProduction">
              <!--<j-select-equipment-production  v-decorator="['selectedProduction',{rules:[{required:true,message:'请选择车间!'}]}]" :multi="false" @back="backProductionInfo" :backProduction="true" :treeProductOpera="true"></j-select-equipment-production>-->
              <j-select-equipment-production :disabled="disableSubmit"  v-model="model.selectedProduction" :multi="false" @back="backProductionInfo" :backProduction="true" :treeProductOpera="true"></j-select-equipment-production>
              <j-select-equipment-production :disabled="disableSubmit" v-model="model.selectedProduction" :multi="false"
                                             @back="backProductionInfo" :backProduction="true"
                                             :treeProductOpera="true"></j-select-equipment-production>
            </a-form-model-item>
          </a-col>
@@ -63,23 +68,23 @@
        <a-row :gutter="24">
          <a-col :span="12">
            <a-form-model-item v-if="isDepartType == -1" label="系统版本号" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <a-input :disabled="disableSubmit" :readOnly="disableSubmit" allow-clear placeholder="请输入系统版本号"
              <a-input :disabled="disableSubmit" allow-clear placeholder="请输入系统版本号"
                       v-model="model.systemVersion"/>
            </a-form-model-item>
            <a-form-model-item v-if="isDepartType == 0" label="设备类型" :labelCol="labelCol" :wrapperCol="wrapperCol">
            <a-select :disabled="disableSubmit" :readOnly="disableSubmit" placeholder="请选择设备类型"
              :triggerChange="true"
                      v-model="model.equipmentType">
              <a-select-option v-for='item in selectList' :key='item.id' :value='item.equipmentTypeName'>
                {{item.equipmentTypeName}}
              </a-select-option>
            </a-select>
              <a-select :disabled="disableSubmit" placeholder="请选择设备类型"
                        :triggerChange="true"
                        v-model="model.equipmentType">
                <a-select-option v-for='item in selectList' :key='item.id' :value='item.equipmentTypeName'>
                  {{item.equipmentTypeName}}
                </a-select-option>
              </a-select>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="设备功率(kw)" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <a-input :disabled="disableSubmit" :readOnly="disableSubmit" allow-clear placeholder="请输入设备功率"
              <a-input :disabled="disableSubmit" allow-clear placeholder="请输入设备功率"
                       v-model="model.devicePower"/>
            </a-form-model-item>
          </a-col>
@@ -88,13 +93,13 @@
        <a-row :gutter="24">
          <a-col :span="12">
            <a-form-model-item label="机床IP" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <a-input :disabled="true" :readOnly="disableSubmit" placeholder="请输入机床IP"
              <a-input :disabled="true"  placeholder="请输入机床IP"
                       v-model="model.equipmentIp"/>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="机床端口" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <a-input :disabled="true" :readOnly="disableSubmit" placeholder="请输入机床端口"
              <a-input :disabled="true" placeholder="请输入机床端口"
                       v-model="model.dataPort"/>
            </a-form-model-item>
          </a-col>
@@ -103,14 +108,14 @@
        <a-row :gutter="24">
          <a-col :span="12">
            <a-form-model-item label="驱动类型" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <j-dict-select-tag :disabled="true" :readOnly="disableSubmit" placeholder="请选择驱动类型"
              <j-dict-select-tag :disabled="true" placeholder="请选择驱动类型"
                                 :triggerChange="true" dictCode="mdc_driveType"
                                 v-model="model.driveType" allow-clear/>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="设备型号" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <a-input :disabled="true" :readOnly="disableSubmit" allow-clear placeholder="请输入设备型号"
              <a-input :disabled="true"  allow-clear placeholder="请输入设备型号"
                       v-model="model.equipmentModel"/>
            </a-form-model-item>
          </a-col>
@@ -119,12 +124,13 @@
        <a-row :gutter="24">
          <a-col :span="12">
            <a-form-model-item label="系统类型" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <j-dict-select-tag  placeholder="请选择系统类型" :triggerChange="true" dictCode="system_type" v-model="model.systemType" allow-clear/>
              <j-dict-select-tag placeholder="请选择系统类型" :triggerChange="true" dictCode="system_type" :disabled="disableSubmit"
                                 v-model="model.systemType" allow-clear/>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="设备级别" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <j-dict-select-tag placeholder="请选择设备级别" dictCode="device_level" v-model="model.deviceLevel" allow-clear/>
              <j-dict-select-tag placeholder="请选择设备级别" dictCode="device_level" v-model="model.deviceLevel" :disabled="disableSubmit" allow-clear/>
            </a-form-model-item>
          </a-col>
        </a-row>
@@ -132,7 +138,8 @@
        <a-row :gutter="24">
          <a-col :span="12">
            <a-form-model-item label="设备种类" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <j-dict-select-tag placeholder="请选择设备种类" dictCode="device_category" v-model="model.deviceCategory" allow-clear/>
              <j-dict-select-tag placeholder="请选择设备种类" dictCode="device_category" v-model="model.deviceCategory" :disabled="disableSubmit"
                                 allow-clear/>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
@@ -144,15 +151,15 @@
        </a-row>
        <a-row :gutter="24" v-if="systemType">
            <a-col :span='24'>
              <a-form-model-item label="系统类型" :labelCol="{span:3}" :wrapperCol="{span:21}">
                <a-radio-group name="radioGroup" v-model="systemValue">
                  <a-radio value="1">DNC</a-radio>
                  <a-radio value="2">MDC</a-radio>
                  <a-radio value="3">通用</a-radio>
                </a-radio-group>
              </a-form-model-item>
            </a-col>
          <a-col :span='24'>
            <a-form-model-item label="系统类型" :labelCol="labelColLong" :wrapperCol="wrapperColLong">
              <a-radio-group name="radioGroup" v-model="systemValue" :disabled="disableSubmit">
                <a-radio value="1">DNC</a-radio>
                <a-radio value="2">MDC</a-radio>
                <a-radio value="3">通用</a-radio>
              </a-radio-group>
            </a-form-model-item>
          </a-col>
        </a-row>
@@ -167,7 +174,7 @@
        <a-row :gutter="24">
          <a-col :span="24">
            <a-form-model-item :labelCol="{span:3}" :wrapperCol="{span:21}" label="备注">
            <a-form-model-item :labelCol="labelColLong" :wrapperCol="wrapperColLong" label="备注">
              <a-textarea :disabled="disableSubmit" :readOnly="disableSubmit" placeholder="请输入备注"
                          v-model="model.remark"/>
            </a-form-model-item>
@@ -192,121 +199,129 @@
  import pick from 'lodash.pick'
  import moment from 'moment'
  import Vue from 'vue'
  import { ACCESS_TOKEN } from "@/store/mutation-types"
  import { ACCESS_TOKEN } from '@/store/mutation-types'
  import { getAction } from '@/api/manage'
  import { addEquipment,editEquipment} from '@/api/api'
  import { disabledAuthFilter } from "@/utils/authFilter"
  import { addEquipment, editEquipment } from '@/api/api'
  import { disabledAuthFilter } from '@/utils/authFilter'
  import { duplicateCheck } from '@/api/api'
  import JSelectEquipmentProduction from '../../../../../components/jeecgbiz/JSelectEquipmentProduction'
  import JSelectProduction from '../../../../../components/jeecgbiz/JSelectProduction'
  import DeviceListModel from './DeviceListModal'
  import JSelectEquipmentDepart from '../../../../../components/jeecgbiz/JSelectEquipmentDepart'
  import {mapActions} from 'vuex'
  import { mapActions } from 'vuex'
  export default {
    name: "UserModal",
    name: 'UserModal',
    components: {
      JSelectProduction,
      JSelectEquipmentDepart,
      JSelectEquipmentProduction,
      DeviceListModel
    },
    data () {
    data() {
      return {
        disSearch:false,
        departDisabled: false, //是否是我的部门调用该页面
        productionDisabled: false, //是否是我的车间调用该页面
        roleDisabled: false, //是否是角色维护调用该页面
        modalWidth:800,
        drawerWidth:700,
        modalToggleFlag:true,
        modalWidth: 800,
        drawerWidth: 700,
        modalToggleFlag: true,
        confirmDirty: false,
        userId:"", //保存用户id
        userId: '', //保存用户id
        // disableSubmit:false,
        disableSubmit: true,
        dateFormat:"YYYY-MM-DD",
        dateFormat: 'YYYY-MM-DD',
        form: this.$form.createForm(this),
        validatorRules:{
        validatorRules: {
          // equipmentId: [{required: false, message: '请选择设备编号!'}, {validator: this.validatequipmentId}],
          equipmentId:
            [
              {
              required: true, message: '请选择设备编号!'
              },
                required: true, message: '请选择设备编号!'
              }
              // {
              // validator: this.validatequipmentId
              // }
            ],
            // trigger: 'blur' // è§¦å‘方式
          // trigger: 'blur' // è§¦å‘方式
          selectedProduction:
            [
              {
                required:true,message: '请选择车间'
                required: true, message: '请选择车间'
              }
            ]
        },
        departIdShow:false,
        title:"操作",
        departIdShow: false,
        title: '操作',
        visible: false,
        model: {
          equipmentId: "",
          equipmentName: "",
          equipmentModel: "",
          equipmentIp: "",
          dataPort: "",
          driveType: "",
          systemType: "",
          deviceLevel: "",
          deviceCategory: "",
          deviceTypeDnc:"",
          deviceTypeMdc:"",
          equipmentId: '',
          equipmentName: '',
          equipmentModel: '',
          equipmentIp: '',
          dataPort: '',
          driveType: '',
          systemType: '',
          deviceLevel: '',
          deviceCategory: '',
          deviceTypeDnc: '',
          deviceTypeMdc: ''
        },
        labelCol: {
          xs: { span: 24 },
          sm: { span: 8 },
          sm: { span: 8 }
        },
        wrapperCol: {
          xs: { span: 24 },
          sm: { span: 15 },
          sm: { span: 14 }
        },
        uploadLoading:false,
        labelColLong: {
          xs: { span: 24 },
          sm: { span: 4 }
        },
        wrapperColLong: {
          xs: { span: 24 },
          sm: { span: 19 }
        },
        uploadLoading: false,
        confirmLoading: false,
        headers:{},
        systemType:false,
        systemValue:"3",
        headers: {},
        systemType: false,
        systemValue: '3',
        url: {
          fileUpload: window._CONFIG['domianURL']+"/sys/common/upload",
          userWithDepart: "/mdc/mdcEquipment/equipmentDepartList", // å¼•入为指定用户查看部门信息需要的url
          fileUpload: window._CONFIG['domianURL'] + '/sys/common/upload',
          userWithDepart: '/mdc/mdcEquipment/equipmentDepartList', // å¼•入为指定用户查看部门信息需要的url
          //引入为指定用户查看车间信息需要的url
          userProductionList: '/mdc/mdcEquipment/equipmentProductionList',
          userId:"/sys/user/generateUserId", // å¼•入生成添加用户情况下的url
          syncUserByUserName:"/act/process/extActProcess/doSyncUserByUserName",//同步用户到工作流
          userId: '/sys/user/generateUserId', // å¼•入生成添加用户情况下的url
          syncUserByUserName: '/act/process/extActProcess/doSyncUserByUserName',//同步用户到工作流
          queryTenantList: '/sys/tenant/queryList',
          check:'/sys/duplicate/check',
          queryEquipmentType:'/mdc/mdcEquipmentType/queryEquipmentType'
          check: '/sys/duplicate/check',
          queryEquipmentType: '/mdc/mdcEquipmentType/queryEquipmentType'
        },
        tenantsOptions: [],
        rolesOptions:[],
        nextDepartOptions:[],
        nextProductionOptions:[],
        selectList:[],
        isDepartType:''
        rolesOptions: [],
        nextDepartOptions: [],
        nextProductionOptions: [],
        selectList: [],
        isDepartType: ''
      }
    },
    created () {
      const token = Vue.ls.get(ACCESS_TOKEN);
      this.headers = {"X-Access-Token":token}
    created() {
      const token = Vue.ls.get(ACCESS_TOKEN)
      this.headers = { 'X-Access-Token': token }
      this.queryGroup()
      this.queryTreeData()
      this.getAppPlatformName();
      this.getAppPlatformName()
      // this.initRoleList()
      // this.initTenantList()
    },
    computed:{
      uploadAction:function () {
        return this.url.fileUpload;
    computed: {
      uploadAction: function() {
        return this.url.fileUpload
      }
    },
    methods: {
@@ -318,17 +333,17 @@
          } else {
            // this.$message.warn(res.message)
            this.$notification.warning({
              message:'消息',
              description:res.message
            });
              message: '消息',
              description: res.message
            })
          }
        }).finally(() =>{
        }).finally(() => {
        })
      },
      getAppPlatformName(){
        getAction(`/system/sysParams/query/by/settingKey?settingKey=system_type`).then(res=>{
          if(res.success){
            this.systemType = res.result.settingValue === '0';
      getAppPlatformName() {
        getAction(`/system/sysParams/query/by/settingKey?settingKey=system_type`).then(res => {
          if (res.success) {
            this.systemType = res.result.settingValue === '0'
          }
        })
      },
@@ -342,9 +357,9 @@
          } else {
            // this.$message.warning(res.message)
            this.$notification.warning({
              message:'消息',
              description:res.message
            });
              message: '消息',
              description: res.message
            })
          }
        }).finally(() => {
          this.loading = false
@@ -352,15 +367,15 @@
      },
      getDeviceRows(val) {
        console.log(val)
        if(val.equipmentid ){
        if (val.equipmentid) {
          this.model.equipmentId = val.equipmentid
          this.model.equipmentName = val.equipmentname
            this.model.equipmentModel = val.equipmentmodel
            this.model.equipmentIp = val.equipmentip
            this.model.dataPort =  val.dataport
            this.model.driveType = val.drivetype
            this.model.controlSystem = val.controlsystem
            this.model.saveTableName = val.savetablename
          this.model.equipmentModel = val.equipmentmodel
          this.model.equipmentIp = val.equipmentip
          this.model.dataPort = val.dataport
          this.model.driveType = val.drivetype
          this.model.controlSystem = val.controlsystem
          this.model.saveTableName = val.savetablename
        }
      },
@@ -369,68 +384,79 @@
        this.$refs.deviceListModel.title = '选择设备'
        this.$refs.deviceListModel.disableSubmit = false
      },
      add () {
        this.refresh();
        this.edit({activitiSync:'1',userIdentity:1,equipmentId:"",equipmentName:"",equipmentModel:"",equipmentIp:'',dataPort:"",driveType:"",controlSystem:"",saveTableName:""});
      add() {
        this.refresh()
        this.edit({
          activitiSync: '1',
          userIdentity: 1,
          equipmentId: '',
          equipmentName: '',
          equipmentModel: '',
          equipmentIp: '',
          dataPort: '',
          driveType: '',
          controlSystem: '',
          saveTableName: ''
        })
      },
      edit (record) {
        let that = this;
        that.visible = true;
      edit(record) {
        let that = this
        that.visible = true
        //根据屏幕宽度自适应抽屉宽度
        this.resetScreenSize();
        this.resetScreenSize()
        // that.userId = record.id;
        // console.log(record)
        if (record.systemValue!=null){
          this.systemValue=record.systemValue;
        }else {
          this.systemValue="3"
        if (record.systemValue != null) {
          this.systemValue = record.systemValue
        } else {
          this.systemValue = '3'
        }
        that.model = Object.assign({}, record);
        that.model = Object.assign({}, record)
        // that.model = Object.assign({},{selectedroles:'',selectedProduction:''}, record);
        // this.model = Object.assign({}, record)
        this.$nextTick(() => {
          this.form.setFieldsValue(pick(that.model, 'selectedDeparts', 'selectedProduction', 'equipmentId', 'equipmentName', 'equipmentModel', 'equipmentType', 'equipmentIp', 'dataPort',
            'driveType', 'sortNo', 'remark','systemVersion','devicePower','controlSystem','saveTableName','systemValue'))
            'driveType', 'sortNo', 'remark', 'systemVersion', 'devicePower', 'controlSystem', 'saveTableName', 'systemValue'))
        })
        if(record.hasOwnProperty("id")){
        if (record.hasOwnProperty('id')) {
          // that.getUserRoles(record.id);
          that.getUserDeparts(record.id);
          that.getUserDeparts(record.id)
        }
        // console.log('that.model=',that.model)
      },
      isDisabledAuth(code){
        return disabledAuthFilter(code);
      isDisabledAuth(code) {
        return disabledAuthFilter(code)
      },
      //窗口最大化切换
      toggleScreen(){
        if(this.modalToggleFlag){
          this.modalWidth = window.innerWidth;
        }else{
          this.modalWidth = 800;
      toggleScreen() {
        if (this.modalToggleFlag) {
          this.modalWidth = window.innerWidth
        } else {
          this.modalWidth = 800
        }
        this.modalToggleFlag = !this.modalToggleFlag;
        this.modalToggleFlag = !this.modalToggleFlag
      },
      // æ ¹æ®å±å¹•变化,设置抽屉尺寸
      resetScreenSize(){
        let screenWidth = document.body.clientWidth;
        if(screenWidth < 500){
          this.drawerWidth = screenWidth;
        }else{
          this.drawerWidth = 700;
      resetScreenSize() {
        let screenWidth = document.body.clientWidth
        if (screenWidth < 500) {
          this.drawerWidth = screenWidth
        } else {
          this.drawerWidth = 700
        }
      },
      getUserDeparts(userid){
        let that = this;
      getUserDeparts(userid) {
        let that = this
        //部门的url
        getAction(that.url.userWithDepart,{equipmentId:userid}).then((res)=>{
          if(res.success){
        getAction(that.url.userWithDepart, { equipmentId: userid }).then((res) => {
          if (res.success) {
            // console.log(res.result)
            let departOptions=[];
            let selectDepartKeys=[]
            let departOptions = []
            let selectDepartKeys = []
            for (let i = 0; i < res.result.length; i++) {
              selectDepartKeys.push(res.result[i].key);
              selectDepartKeys.push(res.result[i].key)
              //新增负责部门选择下拉框
              departOptions.push({
                value: res.result[i].key,
@@ -438,22 +464,22 @@
              })
            }
            that.model.selectedDeparts = selectDepartKeys.join(",")
            that.model.selectedDeparts = selectDepartKeys.join(',')
            // that.model.selectedProduction = selectDepartKeys.join(",")
            that.nextDepartOptions=departOptions;
            that.nextDepartOptions = departOptions
            // console.log('that.nextDepartOptions=',that.nextDepartOptions)
          }
        })
        getAction(that.url.userProductionList,{equipmentId:userid}).then((res)=>{
          if(res.success){
        getAction(that.url.userProductionList, { equipmentId: userid }).then((res) => {
          if (res.success) {
            // console.log(res.result)
            let ProductionOptions=[];
            let selectProductKeys=[]
            let ProductionOptions = []
            let selectProductKeys = []
            // console.log(res.result)
            for (let i = 0; i < res.result.length; i++) {
              selectProductKeys.push(res.result[i].key);
              selectProductKeys.push(res.result[i].key)
              //新增负责部门选择下拉框
              ProductionOptions.push({
                value: res.result[i].key,
@@ -461,9 +487,9 @@
              })
            }
            that.model.selectedProduction = selectProductKeys.join(",")
            that.model.selectedProduction = selectProductKeys.join(',')
            that.nextProductionOptions=ProductionOptions;
            that.nextProductionOptions = ProductionOptions
            // console.log('that.nextProductionOptions=',that.nextProductionOptions)
          }
        })
@@ -471,108 +497,109 @@
      },
      backDepartInfo(info) {
        // console.log(info)
        this.model.departIds = this.model.selectedDeparts;
        this.nextDepartOptions = info.map((item,index,arr)=>{
          let c = {label:item.text, value: item.value+""}
          return c;
        this.model.departIds = this.model.selectedDeparts
        this.nextDepartOptions = info.map((item, index, arr) => {
          let c = { label: item.text, value: item.value + '' }
          return c
        })
      },
      backProductionInfo(info) {
        // console.log(info)
        this.model.productionIds = this.model.selectedProduction;
        this.nextProductionOptions = info.map((item,index,arr)=>{
          let c = {label:item.text, value: item.value+""}
          return c;
        this.model.productionIds = this.model.selectedProduction
        this.nextProductionOptions = info.map((item, index, arr) => {
          let c = { label: item.text, value: item.value + '' }
          return c
        })
      },
      refresh () {
        this.userId=""
        this.nextDepartOptions=[];
        this.nextProductionOptions = [];
        this.departIdShow=false;
      },
      close () {
        this.$emit('close');
        this.visible = false;
        this.disableSubmit = false;
        this.nextDepartOptions=[];
      refresh() {
        this.userId = ''
        this.nextDepartOptions = []
        this.nextProductionOptions = []
        this.departIdShow=false;
        this.departIdShow = false
      },
      close() {
        this.$emit('close')
        this.visible = false
        this.disableSubmit = false
        this.nextDepartOptions = []
        this.nextProductionOptions = []
        this.departIdShow = false
        // this.$refs.form.resetFields();
      },
      moment,
      handleSubmit () {
        const that = this;
      handleSubmit() {
        const that = this
        // è§¦å‘表单验证
        this.$refs.form.validate(valid => {
          if (valid) {
            that.confirmLoading = true;
            that.confirmLoading = true
            //如果是上级择传入departIds,否则为空
            // if(this.model.userIdentity!==2){
            //   this.model.departIds="";
            // }
            let obj;
            if(!this.model.id){
              this.model.id = this.userId;
              this.model.systemValue=this.systemValue;
              obj=addEquipment(this.model);
            }else{
              this.model.systemValue=this.systemValue;
              obj=editEquipment(this.model,{
                        id: this.model.id
                      });
            let obj
            if (!this.model.id) {
              this.model.id = this.userId
              this.model.systemValue = this.systemValue
              obj = addEquipment(this.model)
            } else {
              this.model.systemValue = this.systemValue
              obj = editEquipment(this.model, {
                id: this.model.id
              })
            }
            obj.then((res)=>{
              if(res.success){
            obj.then((res) => {
              if (res.success) {
                that.$notification.success({
                  message:'消息',
                  description:res.message
                });
                that.$emit('ok');
              }else{
                  message: '消息',
                  description: res.message
                })
                that.$emit('ok')
              } else {
                that.$notification.warning({
                  message:'消息',
                  description:res.message
                });
                  message: '消息',
                  description: res.message
                })
              }
            }).finally(() => {
              that.confirmLoading = false;
              that.close();
              that.confirmLoading = false
              that.close()
            })
          }else{
            return false;
          } else {
            return false
          }
        })
      },
      handleConfirmBlur(e) {
        const value = e.target.value;
        const value = e.target.value
        this.confirmDirty = this.confirmDirty || !!value
      },
      identityChange(e){
        if(e.target.value===1){
          this.departIdShow=false;
        }else{
          this.departIdShow=true;
      identityChange(e) {
        if (e.target.value === 1) {
          this.departIdShow = false
        } else {
          this.departIdShow = true
        }
      },
      /**
       * ç¼–辑或查看详情数据时清除抽屉表单验证
       */
      removeValidate(){
      removeValidate() {
        this.$refs.form.clearValidate()
      }
    },
    }
  }
</script>
<style scoped>
  .avatar-uploader > .ant-upload {
    width:104px;
    height:104px;
    width: 104px;
    height: 104px;
  }
  .ant-upload-select-picture-card i {
    font-size: 49px;
    color: #999;
@@ -583,9 +610,9 @@
    color: #666;
  }
  .ant-table-tbody .ant-table-row td{
    padding-top:10px;
    padding-bottom:10px;
  .ant-table-tbody .ant-table-row td {
    padding-top: 10px;
    padding-bottom: 10px;
  }
  .drawer-bottom-button {