zhuzhuanzhuan
2023-08-09 90e466c3e52c189e802ad1898becba54c55d91e8
src/views/mdc/base/Torqueconfiguration.vue
@@ -1,20 +1,28 @@
<template>
  <a-card :bordered="false">
    <div style="width: 100%; height: 100%;overflow: hidden">
  <div style="width: 100%; height: 100%;">
    <a-card :bordered="false">
      <a-row type="flex" :gutter="16">
        <a-col :md="5" :sm="24">
          <base-tree @getCurrSelected="changeSelectionNode"></base-tree>
        <a-col :md="4">
          <a-tabs :activeKey="activeKey"  @change="tabChange">
            <a-tab-pane key="1" tab="车间层级" force-render>
              <base-tree @getCurrSelected="changeSelectionNode"></base-tree>
            </a-tab-pane>
            <a-tab-pane  v-if="isDepartType == 0" key="2" tab="部门层级">,
              <depart-tree  @getCurrSelectedDD="changeSelectionNodedd"></depart-tree>
            </a-tab-pane>
          </a-tabs>
        </a-col>
        <a-col :md="24-5" :sm="24">
          <torqueconfiguration-list :equement="selectEquement"></torqueconfiguration-list>
        <a-col :md="20">
          <torqueconfiguration-list  ref="TorqueconfigurationList" :nodePeople='selectPeople' :nodeTree = 'selectEquement' :Type="slectTypeTree"></torqueconfiguration-list>
        </a-col>
      </a-row>
    </div>
  </a-card>
    </a-card>
  </div>
</template>
<script>
  import { putAction,getAction } from '@/api/manage'
  import { putAction, getAction } from '@/api/manage'
  import { frozenBatch } from '@/api/api'
  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  import JInput from '@/components/jeecg/JInput'
@@ -22,7 +30,8 @@
  import TorqueconfigurationList from './modules/TorqueconfigurationList/TorqueconfigurationList'
  import JSuperQuery from '@/components/jeecg/JSuperQuery'
  import JThirdAppButton from '@/components/jeecgbiz/thirdApp/JThirdAppButton'
  import DepartTree from './modules/DepartList/DepartListTree/DepartTree'
  import {mapActions} from 'vuex'
  export default {
    name: 'Torqueconfiguration',
    components: {
@@ -30,23 +39,55 @@
      JInput,
      BaseTree,
      JSuperQuery,
      TorqueconfigurationList,
      DepartTree,
      TorqueconfigurationList
    },
    data() {
      return {
        description: '扭矩配置管理页面',
        selectEquement:{},
        equipmentStatisticsInfo:{},
        url:{
          equipmentStatistics:"/mdc/equipment/equipmentStatistics"
        }
        activeKey: '1',
        description: '设备信息',
        selectEquementId: '',
        selectEquement: {},
        selectPeople:{},
        slectTypeTree:"",
        url: {
          equipmentStatistics: '/mdc/equipment/equipmentStatistics'
        },
        isDepartType:'',
      }
    },
    created() {
      this.queryTreeData()
    },
    methods: {
      changeSelectionNode(val){
      ...mapActions(['QueryDepartTree']),
      queryTreeData() {
        this.QueryDepartTree().then(res => {
          if (res.success) {
            this.isDepartType = res.result[0].value
          } else {
            this.$message.warn(res.message)
          }
        }).finally(() =>{
        })
      },
      tabChange(val) {
        // console.log(val);
        this.activeKey = val
        this.slectTypeTree = val
      },
      // changeSelection(val) {
      //   this.selectEquementId = val
      //   this.$refs.efficiencyList.pQuery(val)
      //   this.$refs.efficiencyList.searchQuery()
      // },
      changeSelectionNode(val) {
        this.selectEquement = val
        this.slectTypeTree = "1"
      },
      changeSelectionNodedd(val) {
        this.selectPeople = val
        this.slectTypeTree = "2"
      }
    }