|
@@ -33,6 +33,7 @@
|
|
<!-- 操作按钮区域 -->
|
|
<!-- 操作按钮区域 -->
|
|
<div class="table-operator">
|
|
<div class="table-operator">
|
|
<a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
|
|
<a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
|
|
|
|
+ <a-button @click="expandClose" type="primary">{{tableTreeStatus == 1 ? '一键展开':'一键折叠'}}</a-button>
|
|
<!-- <a-button type="primary" icon="download" @click="handleExportXls('设备树定义')">导出</a-button>
|
|
<!-- <a-button type="primary" icon="download" @click="handleExportXls('设备树定义')">导出</a-button>
|
|
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
|
|
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
|
|
<a-button type="primary" icon="import">导入</a-button>
|
|
<a-button type="primary" icon="import">导入</a-button>
|
|
@@ -161,6 +162,8 @@
|
|
dictOptions: {},
|
|
dictOptions: {},
|
|
loadParent: false,
|
|
loadParent: false,
|
|
superFieldList:[],
|
|
superFieldList:[],
|
|
|
|
+ // 展开/折叠
|
|
|
|
+ tableTreeStatus: 1,
|
|
}
|
|
}
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|
|
@@ -361,6 +364,16 @@
|
|
fieldList.push({type:'string',value:'name',text:'设备分类名称',dictCode:''})
|
|
fieldList.push({type:'string',value:'name',text:'设备分类名称',dictCode:''})
|
|
fieldList.push({type:'string',value:'parentid',text:'上级ID',dictCode:"ems_tpm_equipment_tree,name,id"})
|
|
fieldList.push({type:'string',value:'parentid',text:'上级ID',dictCode:"ems_tpm_equipment_tree,name,id"})
|
|
this.superFieldList = fieldList
|
|
this.superFieldList = fieldList
|
|
|
|
+ },
|
|
|
|
+ expandClose(){
|
|
|
|
+ this.tableTreeStatus = - this.tableTreeStatus
|
|
|
|
+ if (this.tableTreeStatus == 1) {
|
|
|
|
+ this.expandedRowKeys = []
|
|
|
|
+ } else {
|
|
|
|
+ this.expandedRowKeys = this.dataSource.map(item =>{
|
|
|
|
+ return item.id
|
|
|
|
+ })
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|