| | |
| | | :addBtn="false" |
| | | :option="option" |
| | | :table-loading="loading" |
| | | :data="data" |
| | | :data="treeData" |
| | | ref="crud" |
| | | v-model:search="search" |
| | | v-model:page="mypage" |
| | |
| | | @tree-load="treeLoad" |
| | | @row-click="rowClick" |
| | | > |
| | | <template #search> |
| | | <el-row :gutter="24"> |
| | | <el-col :span="6"> |
| | | <el-input v-model="search.name" placeholder="请输入节点名称" clearable/> |
| | | </el-col> |
| | | <el-col :span="6"> |
| | | <el-select v-model="search.nodeType" placeholder="请输入节点类型" clearable> |
| | | <el-option v-for="item in nodeTypeList" :key="item.dictValue" :label="item.dictValue" :value="item.dictKey"/> |
| | | </el-select> |
| | | </el-col> |
| | | <el-col :span="6"> |
| | | <el-button type="primary" @click="searchTree"><el-icon class="el-icon--right" style="margin-right: 6px;"><Search /></el-icon>搜索</el-button> |
| | | <el-button :icon="Delete"><el-icon class="el-icon--right" style="margin-right: 6px;"><Delete /></el-icon>清空</el-button> |
| | | </el-col> |
| | | </el-row> |
| | | </template> |
| | | <template #menu-left> |
| | | <el-button :size="size" type="primary" @click="showAdd()">新增根节点</el-button> |
| | | </template> |
| | |
| | | id: "", |
| | | parentId:1, |
| | | search: { |
| | | keyword: "", |
| | | machineGroupCode: "" |
| | | name: "", |
| | | nodeType: "" |
| | | }, |
| | | loading: true, |
| | | mypage: { |
| | |
| | | delBtn: false, |
| | | fit: true, |
| | | menu: false, |
| | | searchBtn: false, |
| | | emptyBtn: false, |
| | | defaultExpandAll: false, |
| | | column: [ |
| | | { |
| | | label: '目录', |
| | |
| | | } |
| | | ], |
| | | }, |
| | | data: [], |
| | | treeData: [], |
| | | upData: [] |
| | | }; |
| | | }, |
| | |
| | | } |
| | | }, |
| | | methods: { |
| | | searchTree() { |
| | | axios({ |
| | | url: '/blade-mdm/program/node/search-list', |
| | | method: 'get', |
| | | params: this.search, |
| | | }).then(res => { |
| | | |
| | | // this.option.defaultExpandAll = true; |
| | | this.treeData = res.data.data; |
| | | if(this.treeData.length == 0) { |
| | | return; |
| | | } |
| | | |
| | | // this.$refs.crud.toggleRowExpansion(this.treeData[2],true) |
| | | // this.tabsForm = res.data.data[0]; //节点信息 |
| | | // this.nodeTypeList.forEach(item=> { |
| | | // if(item.dictKey == this.treeData[0].nodeType) { |
| | | // this.tabsForm.nodeTypeName = item.dictValue; |
| | | // } |
| | | // }) |
| | | |
| | | } |
| | | ); |
| | | }, |
| | | upgradeSubmit(row,done) { //升版 |
| | | axios({ |
| | | url: '/blade-mdm/program/ncfile/upgrade-process-edition', |
| | |
| | | res => { |
| | | var children = res.data.data || []; |
| | | if(parentId == 0) { |
| | | this.data = [...children]; |
| | | this.treeData = [...children]; |
| | | }else { |
| | | this.$refs.crud.$refs.table.store.states.lazyTreeNodeMap.value[parentId] = [...children]; |
| | | } |
| | |
| | | }).then( |
| | | res => { |
| | | this.loading = false; |
| | | this.data = res.data.data; |
| | | if(this.data.length == 0) { |
| | | this.treeData = res.data.data; |
| | | if(this.treeData.length == 0) { |
| | | return; |
| | | } |
| | | this.tabsForm = res.data.data[0]; //节点信息 |
| | | this.nodeTypeList.forEach(item=> { |
| | | if(item.dictKey == this.data[0].nodeType) { |
| | | if(item.dictKey == this.treeData[0].nodeType) { |
| | | this.tabsForm.nodeTypeName = item.dictValue; |
| | | } |
| | | }) |