| | |
| | | <template> |
| | | <basic-container> |
| | | <avue-crud |
| | | :addBtn="false" |
| | | :option="option" |
| | | :table-loading="loading" |
| | | :data="data" |
| | | ref="crud" |
| | | v-model:search="search" |
| | | v-model:page="mypage" |
| | | @search-change="searchChange" |
| | | @search-reset="searchReset" |
| | | @current-change="currentChange" |
| | | @size-change="sizeChange" |
| | | @refresh-change="refreshChange" |
| | | @on-load="onLoad" |
| | | > |
| | | <template #menu-left> |
| | | <el-button type="primary" size="default" icon="el-icon-circle-plus" plain @click="handleExport">导出</el-button> |
| | | <!-- <el-button type="primary" size="default" icon="el-icon-circle-plus" plain @click="handleView">导入</el-button> --> |
| | | <el-button type="primary" size="default" icon="el-icon-circle-plus" plain @click="handleAdd">新增</el-button> |
| | | </template> |
| | | <template #menu="scope"> |
| | | <el-button type="primary" text size="default" icon="el-icon-upload" @click.stop="handleEdit(scope.row, scope.index)">编辑</el-button> |
| | | <el-button type="primary" text size="default" icon="el-icon-upload" @click.stop="handleDel(scope.row, scope.index)">删除</el-button> |
| | | <el-button type="primary" text size="default" icon="el-icon-upload" @click.stop="handleUp(scope.row, scope.index)">产生机床回传机构树</el-button> |
| | | </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" |
| | | :option="option" |
| | | :table-loading="loading" |
| | | :data="data" |
| | | ref="crud" |
| | | v-model:search="search" |
| | | v-model:page="mypage" |
| | | @search-change="searchChange" |
| | | @search-reset="searchReset" |
| | | @current-change="currentChange" |
| | | @size-change="sizeChange" |
| | | @refresh-change="refreshChange" |
| | | @on-load="onLoad" |
| | | > |
| | | <template #menu-left> |
| | | <el-button type="primary" size="default" icon="el-icon-circle-plus" plain @click="handleExport">导出</el-button> |
| | | |
| | | <template #status="{ row }"> |
| | | <span>{{ row.status=="1"?"启用":"禁用" }}</span> |
| | | </template> |
| | | </avue-crud> |
| | | |
| | | <el-dialog :title="machineTitle" append-to-body v-model="editBox" width="60%"> |
| | | <avue-form ref="editFormModal1" :option="editFormModal" v-model="editForm" @submit="formSubmit" @resetForm="resetForm"> |
| | | <template #ownerDept="{}"> |
| | | <el-tree-select v-model="editForm.ownerDept" :data="organizationTreeList" :props="treePropsConfig"/> |
| | | </template> |
| | | </avue-form> |
| | | </el-dialog> |
| | | </basic-container> |
| | | <el-upload :show-file-list="false" class="upload-demo" |
| | | action="/api/blade-mdm/machine/import" |
| | | :on-change="handleChange"> |
| | | <el-button type="primary" plain size="default">导入</el-button> |
| | | </el-upload> |
| | | |
| | | |
| | | |
| | | <el-button type="primary" size="default" icon="el-icon-circle-plus" plain @click="handleAdd">新增</el-button> |
| | | </template> |
| | | <template #menu="scope"> |
| | | <el-button type="primary" text size="default" icon="el-icon-upload" @click.stop="handleEdit(scope.row, scope.index)">编辑</el-button> |
| | | <el-button type="primary" text size="default" icon="el-icon-upload" @click.stop="handleDel(scope.row, scope.index)">删除</el-button> |
| | | <el-button type="primary" text size="default" icon="el-icon-upload" @click.stop="handleUp(scope.row, scope.index)">产生机床回传机构树</el-button> |
| | | </template> |
| | | |
| | | <template #status="{ row }"> |
| | | <span>{{ row.status=="1"?"启用":"禁用" }}</span> |
| | | </template> |
| | | </avue-crud> |
| | | |
| | | <el-dialog :title="machineTitle" append-to-body v-model="editBox" width="60%"> |
| | | <avue-form ref="editFormModal1" :option="editFormModal" v-model="editForm" @submit="formSubmit" @resetForm="resetForm"> |
| | | <template #ownerDept="{}"> |
| | | <el-tree-select v-model="editForm.ownerDept" :data="organizationTreeList" :props="treePropsConfig"/> |
| | | </template> |
| | | </avue-form> |
| | | </el-dialog> |
| | | </basic-container> |
| | | </el-col> |
| | | </el-row> |
| | | </template> |
| | | |
| | | <script> |
| | |
| | | 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', |
| | |
| | | span: 12, |
| | | dataType: 'string', |
| | | }, |
| | | { |
| | | label: '程序临时目录', |
| | | prop: 'progTempDir', |
| | | type: 'input', |
| | | span: 12, |
| | | dataType: 'string', |
| | | }, |
| | | { |
| | | label: '备注', |
| | | prop: 'remark', |
| | |
| | | }; |
| | | }, |
| | | 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; |
| | | } |
| | | ); |
| | | handleChange(a,b,c) { |
| | | console.log(a,b,c); |
| | | }, |
| | | nodeClick(data) { |
| | | this.treeDeptId = data.id; |
| | | this.mypage.current = 1; |
| | | this.onLoad(this.page); |
| | | }, |
| | | handleAdd() { |
| | | this.machineTitle = "新增"; |
| | |
| | | |
| | | }, |
| | | onLoad() { |
| | | this.loading = true; |
| | | var obj = { |
| | | keyword: this.search.keyword, |
| | | machineGroupCode: this.search.machineGroupName, |
| | | current: this.mypage.current, |
| | | size: this.mypage.size, |
| | | } |
| | | axios({ |
| | | url: '/blade-mdm/machine/page', |
| | | method: 'get', |
| | | params: obj, |
| | | }).then( |
| | | res => { |
| | | const data = res.data.data; |
| | | this.mypage.total = data.total; |
| | | this.data = data.records; |
| | | this.loading = false; |
| | | }, |
| | | error => { |
| | | |
| | | this.$nextTick(()=> { |
| | | this.loading = true; |
| | | var obj = { |
| | | keyword: this.search.keyword, |
| | | machineGroupCode: this.search.machineGroupName, |
| | | current: this.mypage.current, |
| | | size: this.mypage.size, |
| | | deptId: this.treeDeptId |
| | | } |
| | | ); |
| | | axios({ |
| | | url: '/blade-mdm/machine/page', |
| | | method: 'get', |
| | | params: obj, |
| | | }).then( |
| | | res => { |
| | | const data = res.data.data; |
| | | this.mypage.total = data.total; |
| | | this.data = data.records; |
| | | this.loading = false; |
| | | }, |
| | | error => { |
| | | |
| | | } |
| | | ); |
| | | }) |
| | | }, |
| | | traversalLabelValueToTree(tree) { //遍历数组 |
| | | return tree.map(node => { |
| | |
| | | </script> |
| | | |
| | | <style lang="scss"> |
| | | |
| | | .upload-demo { |
| | | display: inline-block; |
| | | margin-left: 6px; |
| | | margin-right: 6px; |
| | | } |
| | | </style> |