1
李喆(开发组)
2025-08-06 400fc8829bbfc163417f16d11083f7ad78049938
1
已修改1个文件
56 ■■■■ 文件已修改
src/views/basesetting/machine.vue 56 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/basesetting/machine.vue
@@ -1,4 +1,15 @@
<template>
  <el-row>
    <el-col :span="5">
      <div class="box">
        <el-scrollbar>
          <basic-container>
            <avue-tree :option="treeOption" :data="treeData" @node-click="nodeClick" />
          </basic-container>
        </el-scrollbar>
      </div>
    </el-col>
    <el-col :span="19">
  <basic-container>
    <avue-crud
      :addBtn="false"
@@ -39,6 +50,8 @@
      </avue-form>
    </el-dialog>
  </basic-container>
    </el-col>
  </el-row>
</template>
<script>
@@ -47,10 +60,38 @@
import NProgress from 'nprogress';
import { downloadXls } from '@/utils/util';
import 'nprogress/nprogress.css';
import { getDeptLazyTree } from '@/api/system/dept';
export default {
  data() {
    var that = this;
    return {
      treeOption: {
        nodeKey: 'id',
        lazy: true,
        treeLoad: function (node, resolve) {
          const parentId = node.level === 0 ? 0 : node.data.id;
          getDeptLazyTree(parentId).then(res => {
            resolve(
              res.data.data.map(item => {
                return {
                  ...item,
                  leaf: !item.hasChildren,
                };
              })
            );
          });
        },
        addBtn: false,
        menu: false,
        size: 'small',
        props: {
          labelText: '标题',
          label: 'title',
          value: 'value',
          children: 'children',
        },
      },
      treeData: [],
      treePropsConfig: {
        value:  'id',
        label: 'title',
@@ -272,16 +313,10 @@
    };
  },
  methods: {
    initData(tenantId) {
      axios({
        url: 'blade-system/dept/tree',
        method: 'get'
      }).then(
        res => {
          //const column = this.findObject(this.option.column, 'parentId');
          //column.dicData = res.data.data;
        }
      );
    nodeClick(data) {
      this.treeDeptId = data.id;
      this.mypage.current = 1;
      this.onLoad(this.page);
    },
    handleAdd() {
      this.machineTitle = "新增";
@@ -417,6 +452,7 @@
          machineGroupCode: this.search.machineGroupName,
          current: this.mypage.current,
          size: this.mypage.size,
          deptId: this.treeDeptId
        }
        axios({
          url: '/blade-mdm/machine/page',