| | |
| | | </avue-tree> |
| | | </el-col> |
| | | </el-row> |
| | | |
| | | <div slot="footer" class="dialog-footer" style="height: 50px;line-height: 50px"> |
| | | <el-button icon="el-icon-plus" size="small" type="primary" @click="empower">æ æ</el-button> |
| | | <el-button icon="el-icon-close" size="small" type="danger">é ç½®</el-button> |
| | |
| | | methods: { |
| | | empower() { |
| | | batchAddSave(this.checkAll.oid, this.checkAll.id, this.ParentList).then(res => { |
| | | console.log(res) |
| | | // console.log(res.data) |
| | | if(res.data.code === 200){ |
| | | this.$message.success(res.data.msg) |
| | | this.dialogVisible=false; |
| | | } |
| | | }) |
| | | }, |
| | | //åç±»ææå¤éåè° |
| | | checkChange(row, checked) { |
| | | // this.ParentList=[] |
| | | // console.log('row',row) |
| | | if (checked) { |
| | | if (!row.parentId) { |
| | | const parentRecord = { |
| | |
| | | classParentOid: row.parentId, |
| | | }; |
| | | this.ParentList.push(parentRecord); |
| | | // 妿rowçchildrenä¸ä¸ºç©ºï¼ç»§ç»å¾ªç¯childrenä¸çæ¯ä¸ªå¯¹è±¡ |
| | | // 妿rowçchildrenä¸ä¸ºç©º ç»§ç»å¾ªç¯childrenä¸çæ¯ä¸ªå¯¹è±¡ |
| | | if (row.children && row.children.length > 0) { |
| | | for (let child of row.children) { |
| | | const childRecord = { |
| | |
| | | classParentOid: child.parentId, |
| | | }; |
| | | this.ParentList.push(childRecord); |
| | | // 妿å对象çchildrenä¸ä¸ºç©ºï¼ç»§ç»å¾ªç¯è·åæ°æ® |
| | | // 妿å对象çchildrenä¸ä¸ºç©º ç»§ç»å¾ªç¯è·åæ°æ® |
| | | if (child.children && child.children.length > 0) { |
| | | for (let subChild of child.children) { |
| | | const subRecord = { |
| | |
| | | } |
| | | } |
| | | } |
| | | console.log(this.ParentList); |
| | | console.log('this.ParentList',this.ParentList); |
| | | }, |
| | | //åç±»ææ |
| | | classifyHandler(row) { |
| | | this.loading = true; |
| | | this.checkAll = row |
| | | sysInfoTree({systemOid: row.oid, systemId: row.id}).then(res => { |
| | | this.TreeData = res.data; |
| | | this.ModifyProperties(this.TreeData, 'text', 'label'); |
| | | // æ ¹æ® this.TreeData çé¿åº¦è®¡ç®å»¶è¿æ¶é´ |
| | | let List = []; |
| | | let value = 0; |
| | | let NumberList= []; |
| | | function traverse(obj, parent) { |
| | | //éæ°æå»ºä¸æ¬¡éä¸å½årowçæ°æ® |
| | | const record = { |
| | | label: obj.text, |
| | | oid: obj.oid, |
| | | attributes:{ |
| | | classifyId: obj.attributes.classifyId, |
| | | classifyOid: obj.attributes.classifyOid, |
| | | selected:obj.attributes.selected |
| | | }, |
| | | classParentOid: obj.parentId, |
| | | value: value, |
| | | children: [] |
| | | }; |
| | | //å½åå·²éæ©æ°æ®åå¡« |
| | | if (record.attributes.selected == 'true') { |
| | | NumberList.push(record.value); |
| | | } |
| | | if (parent) { |
| | | const stingChild = parent.children.find(child => child.label === record.label); |
| | | if (stingChild) { |
| | | record.value = stingChild.value; // 使ç¨å·²åå¨çåèç¹çvalueå¼ |
| | | } else { |
| | | parent.children.push(record); |
| | | value++; |
| | | } |
| | | } else { |
| | | const stingRecord = List.find(item => item.label === record.label); |
| | | if (stingRecord) { |
| | | record.value = stingRecord.value; // 使ç¨å·²åå¨çé¡¶å±èç¹çvalueå¼ |
| | | } else { |
| | | List.push(record); |
| | | value++; |
| | | } |
| | | } |
| | | if (obj.children && obj.children.length > 0) { |
| | | for (let child of obj.children) { |
| | | traverse(child, record); |
| | | } |
| | | } |
| | | } |
| | | for (let item of res.data) { |
| | | traverse(item, null); |
| | | } |
| | | // console.log('list', List); |
| | | this.TreeData = List; |
| | | // this.ModifyProperties(this.TreeData, 'text', 'label'); |
| | | // æ ¹æ®this.TreeDataçé¿åº¦è®¡ç®å»¶è¿æ¶é´ |
| | | const delayTime = this.TreeData.length * 1; |
| | | setTimeout(() => { |
| | | this.loading = false; |
| | | this.reload = Math.random() |
| | | this.reload = Math.random(); |
| | | this.dialogVisible = true; |
| | | |
| | | this.$nextTick(() => { |
| | | if (this.$refs.tree) { |
| | | this.$refs.tree.setCheckedKeys(NumberList); |
| | | } |
| | | }); |
| | | }, delayTime); |
| | | }); |
| | | }, |
| | |
| | | }, |
| | | async getDataList() { |
| | | this.loading = true; |
| | | console.log(this.search); |
| | | const {pageSize, currentPage} = this.page; |
| | | const conditions = {}; |
| | | if (Object.keys(this.search).length > 0) { |
| | |
| | | } |
| | | const response = await getSysInfoList(pageSize, currentPage, conditions); |
| | | if (response.status === 200) { |
| | | console.log(response); |
| | | // console.log(response); |
| | | this.loading = false; |
| | | const data = response.data.data; |
| | | this.data = data.records; |
| | |
| | | }).then(async () => { |
| | | const response = await sysInfoDel(param) |
| | | if (response.status === 200) { |
| | | console.log(response) |
| | | // console.log(response) |
| | | this.$message({ |
| | | type: 'success', |
| | | message: 'å 餿å!' |