导航
This commit is contained in:
@@ -84,14 +84,19 @@ export function addCreateDateRange(params, dateRange) {
|
|||||||
|
|
||||||
// 回显数据字典
|
// 回显数据字典
|
||||||
export function selectDictLabel(datas, value) {
|
export function selectDictLabel(datas, value) {
|
||||||
var actions = [];
|
try {
|
||||||
Object.keys(datas).some((key) => {
|
var actions = [];
|
||||||
if (datas[key].dictValue == ('' + value)) {
|
Object.keys(datas).some((key) => {
|
||||||
actions.push(datas[key].dictLabel);
|
if (datas[key].dictValue == ('' + value)) {
|
||||||
return true;
|
actions.push(datas[key].dictLabel);
|
||||||
}
|
return true;
|
||||||
})
|
}
|
||||||
return actions.join('');
|
})
|
||||||
|
return actions.join('');
|
||||||
|
}catch (e) {
|
||||||
|
console.log(e)
|
||||||
|
return null
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 回显数据字典
|
// 回显数据字典
|
||||||
@@ -179,6 +184,7 @@ export function handleTree(data, id, parentId, children, rootId) {
|
|||||||
});
|
});
|
||||||
return treeData != '' ? treeData : data;
|
return treeData != '' ? treeData : data;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
console.log(e)
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
@keyup.enter.native="handleQuery"
|
@keyup.enter.native="handleQuery"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="网站类型" prop="status">
|
<el-form-item label="网站类型" prop="attribute2">
|
||||||
<el-select v-model="queryParams.attribute2" placeholder="数据状态" clearable size="small">
|
<el-select v-model="queryParams.attribute2" placeholder="数据状态" clearable size="small">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="dict in attribute2Options"
|
v-for="dict in attribute2Options"
|
||||||
@@ -20,16 +20,6 @@
|
|||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="状态" prop="status">
|
|
||||||
<el-select v-model="queryParams.status" placeholder="数据状态" clearable size="small">
|
|
||||||
<el-option
|
|
||||||
v-for="dict in statusOptions"
|
|
||||||
:key="dict.dictValue"
|
|
||||||
:label="dict.dictLabel"
|
|
||||||
:value="dict.dictValue"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
<el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||||
@@ -93,8 +83,6 @@
|
|||||||
</router-link>
|
</router-link>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="层级数据排序" align="center" prop="dictSort" />
|
|
||||||
<el-table-column label="状态" align="center" prop="status" :formatter="statusFormat" />
|
|
||||||
<el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true" />
|
<el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true" />
|
||||||
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
|
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
@@ -149,15 +137,6 @@
|
|||||||
>{{dict.dictLabel}}</el-radio>
|
>{{dict.dictLabel}}</el-radio>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="状态" prop="status">
|
|
||||||
<el-radio-group v-model="form.status">
|
|
||||||
<el-radio
|
|
||||||
v-for="dict in statusOptions"
|
|
||||||
:key="dict.dictValue"
|
|
||||||
:label="dict.dictValue"
|
|
||||||
>{{dict.dictLabel}}</el-radio>
|
|
||||||
</el-radio-group>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="备注" prop="remark">
|
<el-form-item label="备注" prop="remark">
|
||||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容"></el-input>
|
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@@ -198,7 +177,6 @@ export default {
|
|||||||
// 是否显示弹出层
|
// 是否显示弹出层
|
||||||
open: false,
|
open: false,
|
||||||
// 状态数据字典
|
// 状态数据字典
|
||||||
statusOptions: [],
|
|
||||||
attribute2Options: [],
|
attribute2Options: [],
|
||||||
// 查询参数
|
// 查询参数
|
||||||
queryParams: {
|
queryParams: {
|
||||||
@@ -225,9 +203,6 @@ export default {
|
|||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.getList();
|
this.getList();
|
||||||
this.getDicts("sys_normal_disable").then(response => {
|
|
||||||
this.statusOptions = response.data;
|
|
||||||
});
|
|
||||||
this.getDicts("unencrypted_site_type").then(response => {
|
this.getDicts("unencrypted_site_type").then(response => {
|
||||||
this.attribute2Options = response.data;
|
this.attribute2Options = response.data;
|
||||||
});
|
});
|
||||||
@@ -243,10 +218,6 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 数据状态字典翻译
|
// 数据状态字典翻译
|
||||||
statusFormat(row, column) {
|
|
||||||
return this.selectDictLabel(this.statusOptions, row.status);
|
|
||||||
},
|
|
||||||
// 数据状态字典翻译
|
|
||||||
attribute2Format(row, column) {
|
attribute2Format(row, column) {
|
||||||
return this.selectDictLabel(this.attribute2Options, row.attribute2);
|
return this.selectDictLabel(this.attribute2Options, row.attribute2);
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,16 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
|
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
|
||||||
<el-form-item label="站点类型" prop="sitetype">
|
|
||||||
<el-select v-model="queryParams.sitetype" placeholder="请选择站点类型 1: sist 2: lab" clearable size="small">
|
|
||||||
<el-option
|
|
||||||
v-for="dict in sitetypeOptions"
|
|
||||||
:key="dict.dictValue"
|
|
||||||
:label="dict.dictLabel"
|
|
||||||
:value="dict.dictValue"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="导航名称" prop="title">
|
<el-form-item label="导航名称" prop="title">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="queryParams.title"
|
v-model="queryParams.title"
|
||||||
@@ -20,15 +10,14 @@
|
|||||||
@keyup.enter.native="handleQuery"
|
@keyup.enter.native="handleQuery"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="状态" prop="delflag">
|
<el-form-item label="英语名称" prop="englishTitle">
|
||||||
<el-select v-model="queryParams.delflag" placeholder="请选择站点状态" clearable size="small">
|
<el-input
|
||||||
<el-option
|
v-model="queryParams.englishTitle"
|
||||||
v-for="dict in delflagOptions"
|
placeholder="请输入英语名称"
|
||||||
:key="dict.dictValue"
|
clearable
|
||||||
:label="dict.dictLabel"
|
size="small"
|
||||||
:value="dict.dictValue"
|
@keyup.enter.native="handleQuery"
|
||||||
/>
|
/>
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||||
@@ -37,17 +26,17 @@
|
|||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
<el-row :gutter="10" class="mb8">
|
<el-row :gutter="10" class="mb8">
|
||||||
<el-col :span="1.5">
|
<!-- <el-col :span="1.5">-->
|
||||||
<el-button
|
<!-- <el-button-->
|
||||||
type="primary"
|
<!-- type="primary"-->
|
||||||
plain
|
<!-- plain-->
|
||||||
icon="el-icon-plus"
|
<!-- icon="el-icon-plus"-->
|
||||||
size="mini"
|
<!-- size="mini"-->
|
||||||
@click="handleAdd"
|
<!-- @click="handleAdd"-->
|
||||||
v-hasPermi="['sist:navigation:add']"
|
<!-- v-hasPermi="['sist:navigation:add']"-->
|
||||||
>新增
|
<!-- >新增-->
|
||||||
</el-button>
|
<!-- </el-button>-->
|
||||||
</el-col>
|
<!-- </el-col>-->
|
||||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
@@ -60,12 +49,18 @@
|
|||||||
>
|
>
|
||||||
<el-table-column label="导航名称" align="center" prop="title"/>
|
<el-table-column label="导航名称" align="center" prop="title"/>
|
||||||
<el-table-column label="英语名称" align="center" prop="englishTitle"/>
|
<el-table-column label="英语名称" align="center" prop="englishTitle"/>
|
||||||
<el-table-column label="站点类型" align="center" prop="sitetype" :formatter="sitetypeFormat"/>
|
<el-table-column label="导航类型" align="center" prop="type" :formatter="typeFormat"/>
|
||||||
<el-table-column label="导航链接" align="center" prop="link"/>
|
|
||||||
<el-table-column label="状态" align="center" prop="delflag" :formatter="delflagFormat"/>
|
|
||||||
<el-table-column label="排序" align="center" prop="sort"/>
|
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
|
<el-button
|
||||||
|
type="text"
|
||||||
|
plain
|
||||||
|
icon="el-icon-plus"
|
||||||
|
size="mini"
|
||||||
|
@click="handleAdd(scope.row)"
|
||||||
|
v-hasPermi="['sist:navigation:add']"
|
||||||
|
>新增下级
|
||||||
|
</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
type="text"
|
type="text"
|
||||||
@@ -74,12 +69,12 @@
|
|||||||
v-hasPermi="['sist:navigation:edit']"
|
v-hasPermi="['sist:navigation:edit']"
|
||||||
>修改
|
>修改
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button
|
<el-button v-show="scope.row.pid != 0"
|
||||||
size="mini"
|
size="mini"
|
||||||
type="text"
|
type="text"
|
||||||
icon="el-icon-delete"
|
icon="el-icon-delete"
|
||||||
@click="handleDelete(scope.row)"
|
@click="handleDelete(scope.row)"
|
||||||
v-hasPermi="['sist:navigation:remove']"
|
v-hasPermi="['sist:navigation:remove']"
|
||||||
>删除
|
>删除
|
||||||
</el-button>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
@@ -89,18 +84,9 @@
|
|||||||
<!-- 添加或修改导航对话框 -->
|
<!-- 添加或修改导航对话框 -->
|
||||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||||
<el-form-item label="父ID" prop="pid">
|
<el-form-item label="父级">
|
||||||
<treeselect v-model="form.pid" :options="navigationOptions" :normalizer="normalizer" placeholder="请选择父ID"/>
|
<el-input v-model="form.ptitle" disabled/>
|
||||||
</el-form-item>
|
<!-- <treeselect v-model="form.pid" :options="navigationOptions" :normalizer="normalizer" placeholder="请选择父ID"/>-->
|
||||||
<el-form-item label="站点类型" prop="sitetype">
|
|
||||||
<el-select v-model="form.sitetype" placeholder="请选择站点类型">
|
|
||||||
<el-option
|
|
||||||
v-for="dict in sitetypeOptions"
|
|
||||||
:key="dict.dictValue"
|
|
||||||
:label="dict.dictLabel"
|
|
||||||
:value="dict.dictValue"
|
|
||||||
></el-option>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="导航名称" prop="title">
|
<el-form-item label="导航名称" prop="title">
|
||||||
<el-input v-model="form.title" placeholder="请输入导航名称"/>
|
<el-input v-model="form.title" placeholder="请输入导航名称"/>
|
||||||
@@ -108,19 +94,40 @@
|
|||||||
<el-form-item label="英语名称" prop="englishTitle">
|
<el-form-item label="英语名称" prop="englishTitle">
|
||||||
<el-input v-model="form.englishTitle" placeholder="英语名称"/>
|
<el-input v-model="form.englishTitle" placeholder="英语名称"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="导航链接" prop="link">
|
<el-form-item label="导航类型" prop="type">
|
||||||
<el-input v-model="form.link" placeholder="请输入导航链接"/>
|
<!-- <el-input v-model="form.link" placeholder="请输入导航链接"/>-->
|
||||||
</el-form-item>
|
<el-radio-group v-model="form.type" @change="navigationTypeChang(form.type)">
|
||||||
<el-form-item label="状态" prop="delflag">
|
<el-radio
|
||||||
<el-radio-group v-model="form.delflag">
|
v-for="dict in navigationTypeOptions"
|
||||||
<el-radio-button v-for="(item, index) in delflagOptions" :key="index"
|
:key="dict.dictValue"
|
||||||
:label="item.dictValue">{{ item.dictLabel }}
|
:label="dict.dictValue"
|
||||||
</el-radio-button>
|
>{{ dict.dictLabel }}
|
||||||
|
</el-radio>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="排序" prop="sort">
|
<el-form-item label="内容类型" prop="refId" v-show="articleSelShow">
|
||||||
<el-input v-model="form.sort" type="number" value="0" placeholder="请输入排序"/>
|
<el-select v-model="form.refId" placeholder="请选择内容类型" clearable :style="{width: '100%'}">
|
||||||
|
<el-option
|
||||||
|
v-for="dict in articleTypeOptions"
|
||||||
|
:key="dict.dictCode"
|
||||||
|
:label="dict.dictLabel"
|
||||||
|
:value="dict.dictCode"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item label="层次数据" prop="refId" v-show="empleeSelShow">
|
||||||
|
<el-select v-model="form.refId" placeholder="请选择层次数据" clearable :style="{width: '100%'}">
|
||||||
|
<el-option
|
||||||
|
v-for="dict in direTypeOptions"
|
||||||
|
:key="dict.dictCode"
|
||||||
|
:label="dict.dictLabel"
|
||||||
|
:value="dict.dictCode"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<!-- <el-form-item label="导航链接" prop="link">-->
|
||||||
|
<!-- <el-input v-model="form.link" placeholder="请输入导航链接"/>-->
|
||||||
|
<!-- </el-form-item>-->
|
||||||
</el-form>
|
</el-form>
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||||
@@ -141,6 +148,7 @@ import {
|
|||||||
} from "@/api/sist/navigation";
|
} from "@/api/sist/navigation";
|
||||||
import Treeselect from "@riophae/vue-treeselect";
|
import Treeselect from "@riophae/vue-treeselect";
|
||||||
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
||||||
|
import {getArticleType} from "@/api/sist/article";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "Navigation",
|
name: "Navigation",
|
||||||
@@ -153,55 +161,67 @@ export default {
|
|||||||
loading: true,
|
loading: true,
|
||||||
// 显示搜索条件
|
// 显示搜索条件
|
||||||
showSearch: true,
|
showSearch: true,
|
||||||
|
articleSelShow: false,
|
||||||
|
empleeSelShow: false,
|
||||||
// 导航表格数据
|
// 导航表格数据
|
||||||
navigationList: [],
|
navigationTypeOptions: [],
|
||||||
// 导航树选项
|
// 导航树选项
|
||||||
navigationOptions: [],
|
navigationList: [],
|
||||||
|
articleTypeOptions: [],
|
||||||
|
sistArticleTypeOption: [],
|
||||||
|
labArticleTypeOption: [],
|
||||||
|
direTypeOptions: [],
|
||||||
|
sistDireTypeOptions: [],
|
||||||
|
labDireTypeOptions: [],
|
||||||
|
navigationType: [],
|
||||||
// 弹出层标题
|
// 弹出层标题
|
||||||
title: "",
|
title: "",
|
||||||
// 是否显示弹出层
|
// 是否显示弹出层
|
||||||
open: false,
|
open: false,
|
||||||
// 站点类型 1: sist 2: lab字典
|
|
||||||
sitetypeOptions: [],
|
|
||||||
// 1: 正常 0:软删除字典
|
// 1: 正常 0:软删除字典
|
||||||
delflagOptions: [],
|
|
||||||
// 查询参数
|
// 查询参数
|
||||||
queryParams: {
|
queryParams: {
|
||||||
sitetype: null,
|
|
||||||
title: null,
|
title: null,
|
||||||
englishTitle: null,
|
englishTitle: null,
|
||||||
delflag: null,
|
|
||||||
},
|
},
|
||||||
// 表单参数
|
// 表单参数
|
||||||
form: {},
|
form: {},
|
||||||
// 表单校验
|
// 表单校验
|
||||||
rules: {
|
rules: {
|
||||||
pid: [
|
|
||||||
{required: true, message: "父ID不能为空", trigger: "blur"}
|
|
||||||
],
|
|
||||||
sitetype: [
|
|
||||||
{required: true, message: "站点类型 ", trigger: "change"}
|
|
||||||
],
|
|
||||||
title: [
|
title: [
|
||||||
{required: true, message: "导航名称不能为空", trigger: "blur"}
|
{required: true, message: "导航名称不能为空", trigger: "blur"}
|
||||||
],
|
],
|
||||||
englishTitle: [
|
englishTitle: [
|
||||||
{required: true, message: "英语名称不能为空", trigger: "blur"}
|
{required: true, message: "英语名称不能为空", trigger: "blur"}
|
||||||
],
|
],
|
||||||
link: [
|
|
||||||
{required: true, message: "导航链接不能为空", trigger: "blur"}
|
|
||||||
],
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.getList();
|
this.getList();
|
||||||
this.getDicts("site_type").then(response => {
|
this.getDicts("navigation_type").then(res => {
|
||||||
this.sitetypeOptions = response.data;
|
this.navigationTypeOptions = res.data;
|
||||||
});
|
})
|
||||||
this.getDicts("delflag").then(response => {
|
this.getDicts("dire_type").then(res => {
|
||||||
this.delflagOptions = response.data;
|
let direList = res.data
|
||||||
});
|
for (let dire of direList) {
|
||||||
|
if (dire.attribute2 === 1) {
|
||||||
|
this.sistDireTypeOptions.push(dire)
|
||||||
|
} else if (dire.attribute2 === 2) {
|
||||||
|
this.labDireTypeOptions.push(dire)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
this.getDicts("article_type").then(res => {
|
||||||
|
let articleList = res.data
|
||||||
|
for (let article of articleList) {
|
||||||
|
if (article.attribute2 === 1) {
|
||||||
|
this.sistArticleTypeOption.push(article)
|
||||||
|
} else if (article.attribute2 === 2) {
|
||||||
|
this.labArticleTypeOption.push(article)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
/** 查询导航列表 */
|
/** 查询导航列表 */
|
||||||
@@ -224,6 +244,9 @@ export default {
|
|||||||
children: node.children
|
children: node.children
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
typeFormat(row, column) {
|
||||||
|
return this.selectDictLabel(this.navigationTypeOptions, row.type);
|
||||||
|
},
|
||||||
/** 查询部门下拉树结构 */
|
/** 查询部门下拉树结构 */
|
||||||
getTreeselect() {
|
getTreeselect() {
|
||||||
listNavigation(this.queryParams).then(response => {
|
listNavigation(this.queryParams).then(response => {
|
||||||
@@ -233,14 +256,6 @@ export default {
|
|||||||
this.navigationOptions.push(data);
|
this.navigationOptions.push(data);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 站点类型 1: sist 2: lab字典翻译
|
|
||||||
sitetypeFormat(row, column) {
|
|
||||||
return this.selectDictLabel(this.sitetypeOptions, row.sitetype);
|
|
||||||
},
|
|
||||||
// 1: 正常 0:软删除字典翻译
|
|
||||||
delflagFormat(row, column) {
|
|
||||||
return this.selectDictLabel(this.delflagOptions, row.delflag);
|
|
||||||
},
|
|
||||||
// 取消按钮
|
// 取消按钮
|
||||||
cancel() {
|
cancel() {
|
||||||
this.open = false;
|
this.open = false;
|
||||||
@@ -248,14 +263,15 @@ export default {
|
|||||||
},
|
},
|
||||||
// 表单重置
|
// 表单重置
|
||||||
reset() {
|
reset() {
|
||||||
|
this.articleSelShow = false
|
||||||
|
this.empleeSelShow = false
|
||||||
this.form = {
|
this.form = {
|
||||||
id: null,
|
id: null,
|
||||||
pid: null,
|
pid: null,
|
||||||
sitetype: null,
|
|
||||||
title: null,
|
title: null,
|
||||||
link: null,
|
link: null,
|
||||||
delflag: null,
|
sort: null,
|
||||||
sort: null
|
refId: null,
|
||||||
};
|
};
|
||||||
this.resetForm("form");
|
this.resetForm("form");
|
||||||
},
|
},
|
||||||
@@ -269,18 +285,52 @@ export default {
|
|||||||
this.handleQuery();
|
this.handleQuery();
|
||||||
},
|
},
|
||||||
/** 新增按钮操作 */
|
/** 新增按钮操作 */
|
||||||
handleAdd() {
|
handleAdd(row) {
|
||||||
this.reset();
|
this.reset();
|
||||||
this.getTreeselect();
|
// this.getTreeselect();
|
||||||
this.open = true;
|
this.open = true;
|
||||||
this.title = "添加导航";
|
this.form.ptitle = row.title
|
||||||
|
this.form.pid = row.id
|
||||||
|
this.form.sitetype = row.sitetype
|
||||||
|
this.title = "添加下级导航";
|
||||||
|
},
|
||||||
|
//导航类型变化
|
||||||
|
navigationTypeChang(type) {
|
||||||
|
console.log(type)
|
||||||
|
this.articleTypeOptions = []
|
||||||
|
this.direTypeOptions = []
|
||||||
|
if (type == 2) {
|
||||||
|
this.articleSelShow = true
|
||||||
|
this.empleeSelShow = false
|
||||||
|
if (this.form.sitetype == 1) {
|
||||||
|
this.articleTypeOptions = this.sistArticleTypeOption
|
||||||
|
} else if (this.form.sitetype == 2) {
|
||||||
|
this.articleTypeOptions = this.labArticleTypeOption
|
||||||
|
}
|
||||||
|
} else if (type == 3) {
|
||||||
|
this.articleSelShow = false
|
||||||
|
this.empleeSelShow = true
|
||||||
|
if (this.form.sitetype == 1) {
|
||||||
|
this.direTypeOptions = this.sistDireTypeOptions
|
||||||
|
} else if (this.form.sitetype == 2) {
|
||||||
|
this.direTypeOptions = this.labDireTypeOptions
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.articleSelShow = false
|
||||||
|
this.empleeSelShow = false
|
||||||
|
}
|
||||||
},
|
},
|
||||||
/** 修改按钮操作 */
|
/** 修改按钮操作 */
|
||||||
handleUpdate(row) {
|
handleUpdate(row) {
|
||||||
this.reset();
|
this.reset();
|
||||||
this.getTreeselect();
|
// this.getTreeselect();
|
||||||
if (row != null) {
|
// if (row != null) {
|
||||||
this.form.pid = row.id;
|
// this.form.pid = row.id;
|
||||||
|
// }
|
||||||
|
if (row.sisttype == 1) {
|
||||||
|
this.articleTypeOptions = this.sistArticleTypeOption
|
||||||
|
} else if (row.sisttype == 2) {
|
||||||
|
this.articleTypeOptions = this.labArticleTypeOption
|
||||||
}
|
}
|
||||||
getNavigation(row.id).then(response => {
|
getNavigation(row.id).then(response => {
|
||||||
this.form = response.data;
|
this.form = response.data;
|
||||||
|
|||||||
Reference in New Issue
Block a user