This commit is contained in:
clay
2022-01-11 17:23:14 +08:00
parent 5d30050152
commit da11bb6bad
8 changed files with 106 additions and 87 deletions

View File

@@ -47,20 +47,26 @@
default-expand-all
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
>
<el-table-column label="导航名称" align="center" prop="title"/>
<el-table-column label="导航名称" align="left" prop="title"/>
<el-table-column label="英语名称" align="center" prop="englishTitle"/>
<el-table-column label="导航类型" align="center" prop="type" :formatter="typeFormat"/>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<el-table-column label="操作" align="center" width="300" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
<el-button v-show="scope.row.type == '0'"
type="text"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd(scope.row)"
v-hasPermi="['sist:navigation:add']"
>新增下级
</el-button>
<el-button v-show="scope.row.type == '1'"
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
>修改详情
</el-button>
<el-button
size="mini"
type="text"
@@ -174,6 +180,7 @@ export default {
sistDireTypeOptions: [],
labDireTypeOptions: [],
navigationType: [],
navList:[],
// 弹出层标题
title: "",
// 是否显示弹出层
@@ -228,8 +235,8 @@ export default {
getList() {
this.loading = true;
listNavigation(this.queryParams).then(response => {
this.navList = response.data;
this.navigationList = this.handleTree(response.data, "id", "pid");
console.log(this.navigationList)
this.loading = false;
});
},
@@ -292,11 +299,11 @@ export default {
this.form.ptitle = row.title
this.form.pid = row.id
this.form.sitetype = row.sitetype
this.form.type= '0'
this.title = "添加下级导航";
},
//导航类型变化
navigationTypeChang(type) {
console.log(type)
this.articleTypeOptions = []
this.direTypeOptions = []
if (type == 2) {
@@ -323,10 +330,6 @@ export default {
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
// this.getTreeselect();
// if (row != null) {
// this.form.pid = row.id;
// }
if (row.sisttype == 1) {
this.articleTypeOptions = this.sistArticleTypeOption
} else if (row.sisttype == 2) {
@@ -334,6 +337,18 @@ export default {
}
getNavigation(row.id).then(response => {
this.form = response.data;
if (this.form.pid==0){
this.form.ptitle = "顶级节点"
}else {
for (let nav of this.navList) {
if (nav.id == this.form.pid){
this.form.ptitle = nav.title;
}
}
console.log(this.navigationList);
}
this.form.refId = parseInt(this.form.refId)
this.navigationTypeChang(this.form.type)
this.open = true;
this.title = "修改导航";
});