|
@@ -3,7 +3,8 @@
|
|
<div class="bill-left">
|
|
<div class="bill-left">
|
|
<div class="bill-tab">
|
|
<div class="bill-tab">
|
|
<div class="tab-title">导航</div>
|
|
<div class="tab-title">导航</div>
|
|
- <el-tree :data="data" node-key="id" :default-expanded-keys="expandedKeys" :props="props" @node-click="handleNodeClick"></el-tree>
|
|
|
|
|
|
+ <!-- <el-tree :data="data" node-key="id" :default-expanded-keys="expandedKeys" :props="props" @node-click="handleNodeClick"></el-tree> -->
|
|
|
|
+ <side-tree :propConfig="treeConfig" @onChange="onChangeTree" />
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="bill-main">
|
|
<div class="bill-main">
|
|
@@ -36,7 +37,7 @@
|
|
// 左边
|
|
// 左边
|
|
data : any = []
|
|
data : any = []
|
|
expandedKeys : any = []
|
|
expandedKeys : any = []
|
|
- parentId:any=''
|
|
|
|
|
|
+ parentId : any = ''
|
|
props = {
|
|
props = {
|
|
label: 'name',
|
|
label: 'name',
|
|
children: 'children'
|
|
children: 'children'
|
|
@@ -48,6 +49,21 @@
|
|
popTitle : any = ''
|
|
popTitle : any = ''
|
|
radio : any = 0
|
|
radio : any = 0
|
|
dialogFormVisible : boolean = false
|
|
dialogFormVisible : boolean = false
|
|
|
|
+ treeConfig = {
|
|
|
|
+ attr: {
|
|
|
|
+ retConfig: {
|
|
|
|
+ id: 'id',
|
|
|
|
+ name: 'name'
|
|
|
|
+ },
|
|
|
|
+ defaultExpandAll: true,
|
|
|
|
+ label: 'name',
|
|
|
|
+ resType: 'data'
|
|
|
|
+ },
|
|
|
|
+ request: {
|
|
|
|
+ url: '/maindata/maindataMaterialVmcategory/treeList',
|
|
|
|
+ method: 'GET'
|
|
|
|
+ }
|
|
|
|
+ }
|
|
config : any = {
|
|
config : any = {
|
|
search: {
|
|
search: {
|
|
attr: {
|
|
attr: {
|
|
@@ -224,11 +240,26 @@
|
|
]
|
|
]
|
|
}
|
|
}
|
|
mounted() {
|
|
mounted() {
|
|
- this.getTreeList()
|
|
|
|
|
|
+ // this.getTreeList()
|
|
this.timer = setInterval(() => {
|
|
this.timer = setInterval(() => {
|
|
this.getDataList()
|
|
this.getDataList()
|
|
}, 500)
|
|
}, 500)
|
|
}
|
|
}
|
|
|
|
+ //点击树获取数据
|
|
|
|
+ onChangeTree(e : any) {
|
|
|
|
+ this.parentId = e.id[0]
|
|
|
|
+ api.childrenTreeList({ id: e.id[0] }, 'maindataMaterialVmcategory').then((res : any) => {
|
|
|
|
+ if (res.code === 200) {
|
|
|
|
+ (this.$refs.moduleView as any).setTableValue(res.data);
|
|
|
|
+ let page = {
|
|
|
|
+ pageNo: res.data.current, //当前页
|
|
|
|
+ pageSize: res.data.size, //每页条数
|
|
|
|
+ total: res.data.total //总条数
|
|
|
|
+ };
|
|
|
|
+ (this.$refs.moduleView as any).setPage(page)
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
// 获取树型导航数据
|
|
// 获取树型导航数据
|
|
getTreeList() {
|
|
getTreeList() {
|
|
api.treeList('maindataMaterialVmcategory').then((res : any) => {
|
|
api.treeList('maindataMaterialVmcategory').then((res : any) => {
|
|
@@ -286,7 +317,7 @@
|
|
clearInterval(this.timer)
|
|
clearInterval(this.timer)
|
|
let query = (this.$refs.moduleView as any).getQuery();
|
|
let query = (this.$refs.moduleView as any).getQuery();
|
|
query.parentId = this.parentId;
|
|
query.parentId = this.parentId;
|
|
- let newData:any = {}
|
|
|
|
|
|
+ let newData : any = {}
|
|
for (let key in query) {
|
|
for (let key in query) {
|
|
if (query[key].toString()) {
|
|
if (query[key].toString()) {
|
|
newData[key] = query[key]
|
|
newData[key] = query[key]
|
|
@@ -325,8 +356,8 @@
|
|
this.popTitle = '编辑'
|
|
this.popTitle = '编辑'
|
|
this.dialogFormVisible = true;
|
|
this.dialogFormVisible = true;
|
|
this.radio = e.status
|
|
this.radio = e.status
|
|
- api.single({id:e.parentId},'maindataMaterialVmcategory').then((res:any) =>{
|
|
|
|
- if(res.code===200){
|
|
|
|
|
|
+ api.single({ id: e.parentId }, 'maindataMaterialVmcategory').then((res : any) => {
|
|
|
|
+ if (res.code === 200) {
|
|
e.parentName = res.data.name
|
|
e.parentName = res.data.name
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
if ((this as any).$refs.addFormId) (this as any).$refs.addFormId.setValue(e);
|
|
if ((this as any).$refs.addFormId) (this as any).$refs.addFormId.setValue(e);
|
|
@@ -397,23 +428,8 @@
|
|
});
|
|
});
|
|
});
|
|
});
|
|
}
|
|
}
|
|
- // 导航切换
|
|
|
|
- handleNodeClick(e : any) {
|
|
|
|
- this.parentId=e.id
|
|
|
|
- api.childrenTreeList({ id: e.id }, 'maindataMaterialVmcategory').then((res : any) => {
|
|
|
|
- if (res.code === 200) {
|
|
|
|
- (this.$refs.moduleView as any).setTableValue(res.data);
|
|
|
|
- let page = {
|
|
|
|
- pageNo: res.data.current, //当前页
|
|
|
|
- pageSize: res.data.size, //每页条数
|
|
|
|
- total: res.data.total //总条数
|
|
|
|
- };
|
|
|
|
- (this.$refs.moduleView as any).setPage(page)
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
// 刷新
|
|
// 刷新
|
|
- onRefresh(){
|
|
|
|
|
|
+ onRefresh() {
|
|
this.loading = this.$loading({ target: '.main-container' });
|
|
this.loading = this.$loading({ target: '.main-container' });
|
|
(this as any).$refs.moduleView.clearSearch();
|
|
(this as any).$refs.moduleView.clearSearch();
|
|
api.pageList({}, 'maindataMaterialVmcategory').then((res : any) => {
|
|
api.pageList({}, 'maindataMaterialVmcategory').then((res : any) => {
|
|
@@ -464,7 +480,7 @@
|
|
border-right: solid #EEE 1px;
|
|
border-right: solid #EEE 1px;
|
|
padding-right: 16px;
|
|
padding-right: 16px;
|
|
flex-shrink: 0;
|
|
flex-shrink: 0;
|
|
-
|
|
|
|
|
|
+ height: 740px;
|
|
// box-sizing: border-box;
|
|
// box-sizing: border-box;
|
|
.bill-tab {
|
|
.bill-tab {
|
|
width: 150px;
|
|
width: 150px;
|