zhaowei
2025-02-14 7a173d873b252b4b04e6ff034a18f8b808ccab05
设备结构树与mdc设备树接口分开为两个接口
已修改4个文件
50 ■■■■ 文件已修改
src/api/dnc.js 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/store/modules/Production.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/base/modules/DeviceStructure/DeviceStructureTree.vue 37 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/base/modules/ProductStructure/Document/NcDocumentAssignModal.vue 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/dnc.js
@@ -75,6 +75,8 @@
  },
  //-------------------------设备结构树------------------------------------------------
  // 获取设备树
  getDeviceTreeDataApi: () => getAction('/nc/device/queryTreeListByProduction'),
  // 删除文档
  deleteDeviceRelativeDocumentApi: ({ docId, attributionId }) => deleteAction(`doc/relative/delete/device/${docId}/${attributionId}`),
  // 获取有权限的用户列表
@@ -86,5 +88,5 @@
  // 移除用户权限
  removeDeviceTreePermissionFromUser: ({ treeNodeType, treeNodeId, isAssignSonNode, userIdArray }) => {
    return postAction(`/nc/device/assign/remove/user/${treeNodeType}/${treeNodeId}/${isAssignSonNode}`, userIdArray)
  },
  }
}
src/store/modules/Production.js
@@ -21,9 +21,9 @@
  actions: {
    // 产线树
      QueryProduction({ commit },type='MDC') {
      QueryProduction({ commit }) {
      return new Promise((resolve, reject) => {
        getAction("/mdc/mdcEquipment/queryTreeListByProduction",{type}).then(response => {
        getAction("/mdc/mdcEquipment/queryTreeListByProduction").then(response => {
          if(response.success){
            const result = response.result
            Vue.ls.set(SYS_PRODUCTION, result)
src/views/dnc/base/modules/DeviceStructure/DeviceStructureTree.vue
@@ -41,8 +41,7 @@
</template>
<script>
  import { mapActions } from 'vuex'
  import { deleteAction } from '@/api/manage'
  import dncApi from '@/api/dnc'
  import DeviceStructureTreeContextMenu from './DeviceStructureTreeContextMenu'
  import AssignPermissionModal from './Permission/AssignPermissionModal'
@@ -79,26 +78,26 @@
      this.$bus.$on('handleSwitchDeviceDocClassCode', this.setCurrentDeviceDocClassCode)
    },
    methods: {
      ...mapActions(['QueryProduction']),
      getTreeDataByApi() {
        this.loading = true
        this.cardLoading = true
        this.QueryProduction('DNC').then(res => {
          if (res.success) {
            this.dataList = []
            this.allTreeKeys = []
            this.treeDataSource = res.result
            this.generateList(this.treeDataSource)
            this.expandedKeys = this.allTreeKeys
            this.$bus.$emit('sendCurrentTreeNodeInfo', this.treeDataSource[0])
          } else {
            this.$message.warn(res.message)
          }
        }).finally(() => {
          this.loading = false
          this.cardLoading = false
        })
        dncApi.getDeviceTreeDataApi()
          .then(res => {
            if (res.success) {
              this.dataList = []
              this.allTreeKeys = []
              this.treeDataSource = res.result
              this.generateList(this.treeDataSource)
              this.expandedKeys = this.allTreeKeys
              this.$bus.$emit('sendCurrentTreeNodeInfo', this.treeDataSource[0])
            } else {
              this.$message.warn(res.message)
            }
          })
          .finally(() => {
            this.loading = false
            this.cardLoading = false
          })
      },
      setCurrentDeviceDocClassCode(documentActiveTabKey) {
src/views/dnc/base/modules/ProductStructure/Document/NcDocumentAssignModal.vue
@@ -85,7 +85,6 @@
  import { getAction } from '@/api/manage'
  import dncApi from '@/api/dnc'
  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  import { mapActions } from 'vuex'
  export default {
    name: 'NcDocumentAssignModal',
@@ -186,8 +185,6 @@
      }
    },
    methods: {
      ...mapActions(['QueryProduction']),
      // 获取当前工序或工步对应文档列表
      loadData() {
        this.dataSource = []
@@ -214,7 +211,7 @@
      getDocumentAssignDeviceTreeByApi() {
        this.spinning = true
        this.treeDataSource = []
        this.QueryProduction('DNC')
        dncApi.getDeviceTreeDataApi()
          .then(res => {
            if (res.success) {
              this.dataList = []