| | |
| | | <!-- |
| | | * @Date: 2024-04-27 20:04:34 |
| | | * @LastEditors: Sneed |
| | | * @LastEditTime: 2024-05-08 23:13:10 |
| | | * @FilePath: /belleson-frontend/Users/mache/Documents/demo/cps-web/src/views/tpm/MachineTab.vue |
| | | * @LastEditors: gaoshp |
| | | * @LastEditTime: 2024-09-24 21:03:08 |
| | | * @FilePath: /cps-web/src/views/tpm/MachineTab.vue |
| | | --> |
| | | <template> |
| | | <el-container> |
| | | <el-aside width="200px" v-loading="showGrouploading"> |
| | | <el-container> |
| | | <el-main class="nopadding"> |
| | | <el-tree ref="group" default-expand-all node-key="id" :data="group" |
| | | <el-tree :expand-on-click-node="false" ref="group" default-expand-all node-key="id" :data="group" |
| | | :current-node-key="params.groupId" :highlight-current="true" @node-click="nodeClick"></el-tree> |
| | | </el-main> |
| | | </el-container> |
| | |
| | | }, |
| | | methods: { |
| | | init() { |
| | | this.$HTTP.get('/api/blade-cps/device-types/page?keyWord=¤t=1&size=-1').then(res => { |
| | | this.$HTTP.get('/api/smis/device-types/page?keyWord=¤t=1&size=-1').then(res => { |
| | | if (res.code === 200) { |
| | | this.types = res.data.records.map(item => ({ |
| | | label: item.name, |
| | |
| | | }) |
| | | }, |
| | | getTreeData() { |
| | | this.$HTTP.get('/api/blade-cps/group/tree?groupCategory=1&groupType=group_machine').then(res => { |
| | | this.$HTTP.get('/api/smis/group/tree?groupCategory=1&groupType=group_machine').then(res => { |
| | | if (res.code === 200) { |
| | | this.group = res.data |
| | | // this.params.groupId = res.data[0].id |
| | |
| | | this.getTreeData() |
| | | }, |
| | | table_del(row, index, type) { |
| | | this.$HTTP.delete(`/api/blade-cps/machine?type=${type}`, { |
| | | this.$HTTP.delete(`/api/smis/machine?type=${type}`, { |
| | | ids: [row.id] |
| | | }).then(res => { |
| | | if (res.code === 200) { |
| | | this.$message.success("操作成功"); |
| | | this.getTreeData() |
| | | } else { |
| | | this.$message.error(res.msg); |
| | | } |
| | | }) |
| | | }, |
| | |
| | | if (this.selection.length === 0) { |
| | | return this.$message.warning("请选择"); |
| | | } |
| | | this.$HTTP.delete(`/api/blade-cps/machine?type=1`, { |
| | | this.$HTTP.delete(`/api/smis/machine?type=1`, { |
| | | ids: this.selection.map(item => item.id) |
| | | }).then(res => { |
| | | if (res.code === 200) { |
| | | this.$message.success("操作成功"); |
| | | this.getTreeData() |
| | | } else { |
| | | this.$message.error(res.msg); |
| | | } |
| | | }) |
| | | }, |