层级数据
This commit is contained in:
54
ebts-ui/src/api/test/emplee.js
Normal file
54
ebts-ui/src/api/test/emplee.js
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
|
||||||
|
// 查询层级结构列表
|
||||||
|
export function listEmplee(data) {
|
||||||
|
return request({
|
||||||
|
url: '/test/emplee/list',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 导出层级结构
|
||||||
|
export function exportEmplee(data) {
|
||||||
|
return request({
|
||||||
|
url: '/test/emplee/export',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询层级结构详细
|
||||||
|
export function getEmplee(id) {
|
||||||
|
return request({
|
||||||
|
url: '/test/emplee/' + id,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增层级结构
|
||||||
|
export function addEmplee(data) {
|
||||||
|
return request({
|
||||||
|
url: '/test/emplee',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改层级结构
|
||||||
|
export function updateEmplee(data) {
|
||||||
|
return request({
|
||||||
|
url: '/test/emplee',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除层级结构
|
||||||
|
export function delEmplee(id) {
|
||||||
|
return request({
|
||||||
|
url: '/test/emplee/' + id,
|
||||||
|
method: 'delete'
|
||||||
|
})
|
||||||
|
}
|
||||||
@@ -105,6 +105,19 @@ export const constantRoutes = [
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: '/dire',
|
||||||
|
component: Layout,
|
||||||
|
hidden: true,
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
path: 'data/:direId/:siteType',
|
||||||
|
component: (resolve) => require(['@/views/sist/dire/direData'], resolve),
|
||||||
|
name: 'direData',
|
||||||
|
meta: { title: '数据配置' }
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: '/article',
|
path: '/article',
|
||||||
component: Layout,
|
component: Layout,
|
||||||
|
|||||||
@@ -7,141 +7,145 @@ const baseURL = process.env.VUE_APP_BASE_API
|
|||||||
|
|
||||||
// 日期格式化
|
// 日期格式化
|
||||||
export function parseTime(time, pattern) {
|
export function parseTime(time, pattern) {
|
||||||
if (arguments.length === 0 || !time) {
|
if (arguments.length === 0 || !time) {
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
const format = pattern || '{y}-{m}-{d} {h}:{i}:{s}'
|
const format = pattern || '{y}-{m}-{d} {h}:{i}:{s}'
|
||||||
let date
|
let date
|
||||||
if (typeof time === 'object') {
|
if (typeof time === 'object') {
|
||||||
date = time
|
date = time
|
||||||
} else {
|
} else {
|
||||||
if ((typeof time === 'string') && (/^[0-9]+$/.test(time))) {
|
if ((typeof time === 'string') && (/^[0-9]+$/.test(time))) {
|
||||||
time = parseInt(time)
|
time = parseInt(time)
|
||||||
} else if (typeof time === 'string') {
|
} else if (typeof time === 'string') {
|
||||||
time = time.replace(new RegExp(/-/gm), '/');
|
time = time.replace(new RegExp(/-/gm), '/');
|
||||||
}
|
}
|
||||||
if ((typeof time === 'number') && (time.toString().length === 10)) {
|
if ((typeof time === 'number') && (time.toString().length === 10)) {
|
||||||
time = time * 1000
|
time = time * 1000
|
||||||
}
|
}
|
||||||
date = new Date(time)
|
date = new Date(time)
|
||||||
}
|
}
|
||||||
const formatObj = {
|
const formatObj = {
|
||||||
y: date.getFullYear(),
|
y: date.getFullYear(),
|
||||||
m: date.getMonth() + 1,
|
m: date.getMonth() + 1,
|
||||||
d: date.getDate(),
|
d: date.getDate(),
|
||||||
h: date.getHours(),
|
h: date.getHours(),
|
||||||
i: date.getMinutes(),
|
i: date.getMinutes(),
|
||||||
s: date.getSeconds(),
|
s: date.getSeconds(),
|
||||||
a: date.getDay()
|
a: date.getDay()
|
||||||
}
|
}
|
||||||
const time_str = format.replace(/{(y|m|d|h|i|s|a)+}/g, (result, key) => {
|
const time_str = format.replace(/{(y|m|d|h|i|s|a)+}/g, (result, key) => {
|
||||||
let value = formatObj[key]
|
let value = formatObj[key]
|
||||||
// Note: getDay() returns 0 on Sunday
|
// Note: getDay() returns 0 on Sunday
|
||||||
if (key === 'a') { return ['日', '一', '二', '三', '四', '五', '六'][value] }
|
if (key === 'a') {
|
||||||
if (result.length > 0 && value < 10) {
|
return ['日', '一', '二', '三', '四', '五', '六'][value]
|
||||||
value = '0' + value
|
}
|
||||||
}
|
if (result.length > 0 && value < 10) {
|
||||||
return value || 0
|
value = '0' + value
|
||||||
})
|
}
|
||||||
return time_str
|
return value || 0
|
||||||
|
})
|
||||||
|
return time_str
|
||||||
}
|
}
|
||||||
|
|
||||||
// 表单重置
|
// 表单重置
|
||||||
export function resetForm(refName) {
|
export function resetForm(refName) {
|
||||||
if (this.$refs[refName]) {
|
if (this.$refs[refName]) {
|
||||||
this.$refs[refName].resetFields();
|
this.$refs[refName].resetFields();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 添加日期范围
|
// 添加日期范围
|
||||||
export function addDateRange(params, dateRange) {
|
export function addDateRange(params, dateRange) {
|
||||||
var search = params;
|
var search = params;
|
||||||
search.beginTime = "";
|
search.beginTime = "";
|
||||||
search.endTime = "";
|
search.endTime = "";
|
||||||
if (null != dateRange && '' != dateRange) {
|
if (null != dateRange && '' != dateRange) {
|
||||||
search.beginTime = dateRange[0];
|
search.beginTime = dateRange[0];
|
||||||
search.endTime = dateRange[1];
|
search.endTime = dateRange[1];
|
||||||
}
|
}
|
||||||
return search;
|
return search;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 添加搜索创建时间日期范围
|
// 添加搜索创建时间日期范围
|
||||||
export function addCreateDateRange(params, dateRange) {
|
export function addCreateDateRange(params, dateRange) {
|
||||||
var search = params;
|
var search = params;
|
||||||
let data = {
|
let data = {
|
||||||
beginCreateTime : "",
|
beginCreateTime: "",
|
||||||
endCreateTime : "",
|
endCreateTime: "",
|
||||||
};
|
};
|
||||||
if (null != dateRange && '' != dateRange) {
|
if (null != dateRange && '' != dateRange) {
|
||||||
data.beginCreateTime = dateRange[0];
|
data.beginCreateTime = dateRange[0];
|
||||||
data.endCreateTime = dateRange[1];
|
data.endCreateTime = dateRange[1];
|
||||||
}
|
}
|
||||||
search.parameter= JSON.stringify(data)
|
search.parameter = JSON.stringify(data)
|
||||||
return search;
|
return search;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 回显数据字典
|
// 回显数据字典
|
||||||
export function selectDictLabel(datas, value) {
|
export function selectDictLabel(datas, value) {
|
||||||
var actions = [];
|
var actions = [];
|
||||||
Object.keys(datas).some((key) => {
|
Object.keys(datas).some((key) => {
|
||||||
if (datas[key].dictValue == ('' + value)) {
|
if (datas[key].dictValue == ('' + value)) {
|
||||||
actions.push(datas[key].dictLabel);
|
actions.push(datas[key].dictLabel);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
return actions.join('');
|
return actions.join('');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 回显数据字典
|
// 回显数据字典
|
||||||
export function selectDictCode(datas, value) {
|
export function selectDictCode(datas, value) {
|
||||||
var actions = [];
|
var actions = [];
|
||||||
Object.keys(datas).some((key) => {
|
Object.keys(datas).some((key) => {
|
||||||
if (datas[key].dictCode == ('' + value)) {
|
if (datas[key].dictCode == ('' + value)) {
|
||||||
actions.push(datas[key].dictLabel);
|
actions.push(datas[key].dictLabel);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
return actions.join('');
|
return actions.join('');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 回显数据字典(字符串数组)
|
// 回显数据字典(字符串数组)
|
||||||
export function selectDictLabels(datas, value, separator) {
|
export function selectDictLabels(datas, value, separator) {
|
||||||
var actions = [];
|
var actions = [];
|
||||||
var currentSeparator = undefined === separator ? "," : separator;
|
var currentSeparator = undefined === separator ? "," : separator;
|
||||||
var temp = value.split(currentSeparator);
|
var temp = value.split(currentSeparator);
|
||||||
Object.keys(value.split(currentSeparator)).some((val) => {
|
Object.keys(value.split(currentSeparator)).some((val) => {
|
||||||
Object.keys(datas).some((key) => {
|
Object.keys(datas).some((key) => {
|
||||||
if (datas[key].dictValue == ('' + temp[val])) {
|
if (datas[key].dictValue == ('' + temp[val])) {
|
||||||
actions.push(datas[key].dictLabel + currentSeparator);
|
actions.push(datas[key].dictLabel + currentSeparator);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
return actions.join('').substring(0, actions.join('').length - 1);
|
return actions.join('').substring(0, actions.join('').length - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 通用下载方法
|
// 通用下载方法
|
||||||
export function download(fileName) {
|
export function download(fileName) {
|
||||||
window.location.href = baseURL + "/common/download?fileName=" + encodeURI(fileName) + "&delete=" + true;
|
window.location.href = baseURL + "/common/download?fileName=" + encodeURI(fileName) + "&delete=" + true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 字符串格式化(%s )
|
// 字符串格式化(%s )
|
||||||
export function sprintf(str) {
|
export function sprintf(str) {
|
||||||
var args = arguments, flag = true, i = 1;
|
var args = arguments, flag = true, i = 1;
|
||||||
str = str.replace(/%s/g, function () {
|
str = str.replace(/%s/g, function () {
|
||||||
var arg = args[i++];
|
var arg = args[i++];
|
||||||
if (typeof arg === 'undefined') {
|
if (typeof arg === 'undefined') {
|
||||||
flag = false;
|
flag = false;
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
return arg;
|
return arg;
|
||||||
});
|
});
|
||||||
return flag ? str : '';
|
return flag ? str : '';
|
||||||
}
|
}
|
||||||
|
|
||||||
// 转换字符串,undefined,null等转化为""
|
// 转换字符串,undefined,null等转化为""
|
||||||
export function praseStrEmpty(str) {
|
export function praseStrEmpty(str) {
|
||||||
if (!str || str == "undefined" || str == "null") {
|
if (!str || str == "undefined" || str == "null") {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -153,21 +157,28 @@ export function praseStrEmpty(str) {
|
|||||||
* @param {*} rootId 根Id 默认 0
|
* @param {*} rootId 根Id 默认 0
|
||||||
*/
|
*/
|
||||||
export function handleTree(data, id, parentId, children, rootId) {
|
export function handleTree(data, id, parentId, children, rootId) {
|
||||||
id = id || 'id'
|
try {
|
||||||
parentId = parentId || 'parentId'
|
|
||||||
children = children || 'children'
|
id = id || 'id'
|
||||||
rootId = rootId || Math.min.apply(Math, data.map(item => { return item[parentId] })) || 0
|
parentId = parentId || 'parentId'
|
||||||
//对源数据深度克隆
|
children = children || 'children'
|
||||||
const cloneData = JSON.parse(JSON.stringify(data))
|
rootId = rootId || Math.min.apply(Math, data.map(item => {
|
||||||
//循环所有项
|
return item[parentId]
|
||||||
const treeData = cloneData.filter(father => {
|
})) || 0
|
||||||
let branchArr = cloneData.filter(child => {
|
//对源数据深度克隆
|
||||||
//返回每一项的子级数组
|
const cloneData = JSON.parse(JSON.stringify(data))
|
||||||
return father[id] === child[parentId]
|
//循环所有项
|
||||||
});
|
const treeData = cloneData.filter(father => {
|
||||||
branchArr.length > 0 ? father.children = branchArr : '';
|
let branchArr = cloneData.filter(child => {
|
||||||
//返回第一层
|
//返回每一项的子级数组
|
||||||
return father[parentId] === rootId;
|
return father[id] === child[parentId]
|
||||||
});
|
});
|
||||||
return treeData != '' ? treeData : data;
|
branchArr.length > 0 ? father.children = branchArr : '';
|
||||||
|
//返回第一层
|
||||||
|
return father[parentId] === rootId;
|
||||||
|
});
|
||||||
|
return treeData != '' ? treeData : data;
|
||||||
|
} catch (e) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,26 +8,8 @@
|
|||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
|
||||||
<!-- <el-form-item label="发布人" prop="publishUserName">-->
|
|
||||||
<!-- <el-input v-model="formData.publishUserName" placeholder="请输入发布人" clearable :style="{width: '100%'}">-->
|
|
||||||
<!-- </el-input>-->
|
|
||||||
<!-- </el-form-item>-->
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row>
|
<el-row>
|
||||||
<!-- <el-col :span="6">-->
|
|
||||||
<!-- <el-form-item label="文章类型" prop="type">-->
|
|
||||||
<!-- <el-select v-model="formData.type" placeholder="请选择文章类型" clearable :style="{width: '100%'}">-->
|
|
||||||
<!-- <el-option-->
|
|
||||||
<!-- v-for="dict in articleTypeOptions"-->
|
|
||||||
<!-- :key="dict.dictValue"-->
|
|
||||||
<!-- :label="dict.dictLabel"-->
|
|
||||||
<!-- :value="dict.dictValue"-->
|
|
||||||
<!-- />-->
|
|
||||||
<!-- </el-select>-->
|
|
||||||
<!-- </el-form-item>-->
|
|
||||||
<!-- </el-col>-->
|
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="是否顶置" prop="isTop">
|
<el-form-item label="是否顶置" prop="isTop">
|
||||||
<el-radio-group v-model="formData.isTop">
|
<el-radio-group v-model="formData.isTop">
|
||||||
@@ -56,57 +38,70 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row v-show="sistArticleTypeOption.length>0 && approveShow.sist">
|
<el-row>
|
||||||
<el-col :span="6">
|
<el-col :span="12">
|
||||||
<el-form-item label="信息网站">
|
<el-row v-show="sistArticleTypeOption.length>0 && approveShow.sist">
|
||||||
<el-select v-model="params.sistArticleType" @change="getSistApprove(params.sistArticleType)"
|
<el-col :span="12">
|
||||||
placeholder="请选择文章类型" clearable :style="{width: '100%'}">
|
<el-form-item label="信息网站">
|
||||||
<el-option
|
<el-select v-model="params.sistArticleType" @change="getSistApprove(params.sistArticleType)"
|
||||||
v-for="dict in sistArticleTypeOption"
|
placeholder="请选择文章类型" clearable :style="{width: '100%'}">
|
||||||
:key="dict.dictCode"
|
<el-option
|
||||||
:label="dict.dictLabel"
|
v-for="dict in sistArticleTypeOption"
|
||||||
:value="dict.dictCode"
|
:key="dict.dictCode"
|
||||||
/>
|
:label="dict.dictLabel"
|
||||||
</el-select>
|
:value="dict.dictCode"
|
||||||
</el-form-item>
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="审批人">
|
||||||
|
<el-select v-model="params.sistApprove" placeholder="请选择文章类型" clearable :style="{width: '100%'}">
|
||||||
|
<el-option
|
||||||
|
v-for="dict in sistApproveOption"
|
||||||
|
:key="dict.userId"
|
||||||
|
:label="dict.userName"
|
||||||
|
:value="dict.userId"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row v-show="labArticleTypeOption.length>0 && approveShow.lab">
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="实验室网站">
|
||||||
|
<el-select v-model="params.labArticleType" placeholder="请选择文章类型"
|
||||||
|
@change="getLabApprove(params.labArticleType)" clearable :style="{width: '100%'}">
|
||||||
|
<el-option
|
||||||
|
v-for="dict in labArticleTypeOption"
|
||||||
|
:key="dict.dictCode"
|
||||||
|
:label="dict.dictLabel"
|
||||||
|
:value="dict.dictCode"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="审批人">
|
||||||
|
<el-select v-model="params.labApprove" placeholder="请选择文章类型" clearable :style="{width: '100%'}">
|
||||||
|
<el-option
|
||||||
|
v-for="dict in labApproveOption"
|
||||||
|
:key="dict.userId"
|
||||||
|
:label="dict.userName"
|
||||||
|
:value="dict.userId"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="6">
|
<el-col :span="12" v-show="imgurlShow">
|
||||||
<el-form-item label="审批人">
|
<el-form-item >
|
||||||
<el-select v-model="params.sistApprove" placeholder="请选择文章类型" clearable :style="{width: '100%'}">
|
<UploadFile v-model="formData.imgurl"
|
||||||
<el-option
|
file-type="image"
|
||||||
v-for="dict in sistApproveOption"
|
:v-public="true"
|
||||||
:key="dict.userId"
|
:v-data="false"
|
||||||
:label="dict.userName"
|
/>
|
||||||
:value="dict.userId"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row v-show="labArticleTypeOption.length>0 && approveShow.lab">
|
|
||||||
<el-col :span="6">
|
|
||||||
<el-form-item label="实验室网站">
|
|
||||||
<el-select v-model="params.labArticleType" placeholder="请选择文章类型"
|
|
||||||
@change="getLabApprove(params.labArticleType)" clearable :style="{width: '100%'}">
|
|
||||||
<el-option
|
|
||||||
v-for="dict in labArticleTypeOption"
|
|
||||||
:key="dict.dictCode"
|
|
||||||
:label="dict.dictLabel"
|
|
||||||
:value="dict.dictCode"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="6">
|
|
||||||
<el-form-item label="审批人">
|
|
||||||
<el-select v-model="params.labApprove" placeholder="请选择文章类型" clearable :style="{width: '100%'}">
|
|
||||||
<el-option
|
|
||||||
v-for="dict in labApproveOption"
|
|
||||||
:key="dict.userId"
|
|
||||||
:label="dict.userName"
|
|
||||||
:value="dict.userId"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
@@ -130,21 +125,25 @@
|
|||||||
import Editor from '@/components/Editor';
|
import Editor from '@/components/Editor';
|
||||||
import {updateArticle, getArticle, drafts, getArticleType, getArticleApprove} from "@/api/sist/article";
|
import {updateArticle, getArticle, drafts, getArticleType, getArticleApprove} from "@/api/sist/article";
|
||||||
import {Message} from "element-ui";
|
import {Message} from "element-ui";
|
||||||
|
import UploadFile from '@/views/utils/uploadFile.vue';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
Editor,
|
Editor,
|
||||||
|
UploadFile
|
||||||
},
|
},
|
||||||
props: [],
|
props: [],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
submit: 1,
|
submit: 1,
|
||||||
|
imgurlShow:false,
|
||||||
formData: {
|
formData: {
|
||||||
id: null,
|
id: null,
|
||||||
title: null,
|
title: null,
|
||||||
isTop: null,
|
isTop: null,
|
||||||
isEnglish: null,
|
isEnglish: null,
|
||||||
content: "",
|
content: "",
|
||||||
|
imgurl:null,
|
||||||
},
|
},
|
||||||
approveShow: {
|
approveShow: {
|
||||||
sist: true,
|
sist: true,
|
||||||
@@ -186,6 +185,11 @@ export default {
|
|||||||
message: '请选择是否显示',
|
message: '请选择是否显示',
|
||||||
trigger: 'change'
|
trigger: 'change'
|
||||||
}],
|
}],
|
||||||
|
imgurl: [{
|
||||||
|
required: true,
|
||||||
|
message: '请选择是否显示',
|
||||||
|
trigger: 'change'
|
||||||
|
}],
|
||||||
sitetype: [{
|
sitetype: [{
|
||||||
required: true,
|
required: true,
|
||||||
message: '单选框组不能为空',
|
message: '单选框组不能为空',
|
||||||
@@ -244,7 +248,6 @@ export default {
|
|||||||
getArticleType().then(res => {
|
getArticleType().then(res => {
|
||||||
let dictCodes = res.data
|
let dictCodes = res.data
|
||||||
let articleList = this.articleTypeOptions
|
let articleList = this.articleTypeOptions
|
||||||
console.log(articleList, dictCodes);
|
|
||||||
for (let i = 0; i < articleList.length; i++) {
|
for (let i = 0; i < articleList.length; i++) {
|
||||||
for (let j = 0; j < dictCodes.length; j++) {
|
for (let j = 0; j < dictCodes.length; j++) {
|
||||||
if (articleList[i].dictCode === dictCodes[j]) {
|
if (articleList[i].dictCode === dictCodes[j]) {
|
||||||
@@ -262,58 +265,76 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getSistApprove(dictCode) {
|
getSistApprove(dictCode) {
|
||||||
|
this.judgeThumbnail(dictCode)
|
||||||
getArticleApprove(dictCode).then(res => {
|
getArticleApprove(dictCode).then(res => {
|
||||||
this.sistApproveOption = res.data
|
this.sistApproveOption = res.data
|
||||||
})
|
})
|
||||||
|
|
||||||
},
|
},
|
||||||
getLabApprove(dictCode) {
|
getLabApprove(dictCode) {
|
||||||
|
this.judgeThumbnail(dictCode)
|
||||||
getArticleApprove(dictCode).then(res => {
|
getArticleApprove(dictCode).then(res => {
|
||||||
this.labApproveOption = res.data
|
this.labApproveOption = res.data
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
judgeThumbnail(dictCode){
|
||||||
|
let articleList = this.articleTypeOptions
|
||||||
|
for (let article of articleList) {
|
||||||
|
if (dictCode === article.dictCode && article.attribute1 == 1){
|
||||||
|
this.imgurlShow = true
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
submitForm() {
|
submitForm() {
|
||||||
|
let that_ = this
|
||||||
this.$refs['elForm'].validate(valid => {
|
this.$refs['elForm'].validate(valid => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
if ((this.params.sistArticleType === null || this.params.sistArticleType === "") && (this.params.labArticleType === null || this.params.labArticleType === "")) {
|
if ((that_.params.sistArticleType === null || that_.params.sistArticleType === "") && (that_.params.labArticleType === null || that_.params.labArticleType === "")) {
|
||||||
Message({
|
Message({
|
||||||
message: "请至少选择一个网站发布文章",
|
message: "请至少选择一个网站发布文章",
|
||||||
type: "error",
|
type: "error",
|
||||||
})
|
})
|
||||||
this.msgSuccess("请至少选择一个网站发布文章")
|
|
||||||
return
|
return
|
||||||
} else if ((this.params.sistArticleType === null || this.params.sistArticleType === "") && (this.params.labArticleType !== null || this.params.labArticleType !== "") && (this.formData.sistApprove === null || this.params.sistApprove === "")) {
|
} else if ((that_.params.sistArticleType === null || that_.params.sistArticleType === "") && (that_.params.labArticleType !== null || that_.params.labArticleType !== "") && (that_.formData.sistApprove === null || that_.params.sistApprove === "")) {
|
||||||
Message({
|
Message({
|
||||||
message: "请选择信息网站的审批人",
|
message: "请选择信息网站的审批人",
|
||||||
type: "error",
|
type: "error",
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
} else if ((this.params.sistArticleType === null || this.params.sistArticleType === "") && (this.params.labArticleType != null || this.params.labArticleType !== "") && (this.params.labApprove === null || this.params.labApprove === "")) {
|
} else if ((that_.params.sistArticleType === null || that_.params.sistArticleType === "") && (that_.params.labArticleType != null || that_.params.labArticleType !== "") && (that_.params.labApprove === null || that_.params.labApprove === "")) {
|
||||||
Message({
|
Message({
|
||||||
message: "请选择实验室网站的审批人",
|
message: "请选择实验室网站的审批人",
|
||||||
type: "error",
|
type: "error",
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if (that_.imgurlShow&&(that_.formData.imgurl == ''||that_.formData.imgurl == null)){
|
||||||
|
Message({
|
||||||
|
message: "请选择缩略图",
|
||||||
|
type: "error",
|
||||||
|
})
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
this.formData.params = this.params
|
that_.formData.params = that_.params
|
||||||
if (this.submit == 0) {
|
if (that_.submit == 0) {
|
||||||
Message({
|
Message({
|
||||||
message: "您操作过快",
|
message: "您操作过快",
|
||||||
type: "error",
|
type: "error",
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
this.submit = 0
|
that_.submit = 0
|
||||||
this.loading = true;
|
that_.loading = true;
|
||||||
updateArticle(this.formData).then(response => {
|
// this.formData.imgurl = this.form.imgurl.url
|
||||||
this.loading = false;
|
updateArticle(that_.formData).then(response => {
|
||||||
|
that_.loading = false;
|
||||||
if (response.code == 200) {
|
if (response.code == 200) {
|
||||||
this.msgSuccess("提交审批成功");
|
that_.msgSuccess("提交审批成功");
|
||||||
this.submit = 1
|
that_.submit = 1
|
||||||
this.close();
|
that_.close();
|
||||||
}
|
}
|
||||||
}).catch(e => {
|
}).catch(e => {
|
||||||
this.submit = 1
|
that_.submit = 1
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
// TODO 提交表单
|
// TODO 提交表单
|
||||||
|
|||||||
@@ -121,7 +121,11 @@
|
|||||||
<el-table-column label="是否置顶" align="center" prop="isTop" :formatter="isTopFormat"/>
|
<el-table-column label="是否置顶" align="center" prop="isTop" :formatter="isTopFormat"/>
|
||||||
<el-table-column label="是否显示" align="center" prop="isView" :formatter="isViewFormat"/>
|
<el-table-column label="是否显示" align="center" prop="isView" :formatter="isViewFormat"/>
|
||||||
<el-table-column label="查看次数" align="center" prop="viewCount"/>
|
<el-table-column label="查看次数" align="center" prop="viewCount"/>
|
||||||
<el-table-column label="缩略图" align="center" prop="imgurl"/>
|
<el-table-column label="缩略图" align="center" prop="imgurl">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<img style="width: 100%;" :src="scope.row.imgurl" alt="">
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column label="是否英文" align="center" prop="isEnglish" :formatter="isEnglishFormat"/>
|
<el-table-column label="是否英文" align="center" prop="isEnglish" :formatter="isEnglishFormat"/>
|
||||||
<el-table-column label="状态" align="center" prop="status" :formatter="statusFormat"/>
|
<el-table-column label="状态" align="center" prop="status" :formatter="statusFormat"/>
|
||||||
<!-- <template slot-scope="scope">-->
|
<!-- <template slot-scope="scope">-->
|
||||||
@@ -200,7 +204,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {listArticle, delArticle, exportArticle,offline} from "@/api/sist/article";
|
import {listArticle, delArticle, exportArticle, offline} from "@/api/sist/article";
|
||||||
import Editor from '@/components/Editor';
|
import Editor from '@/components/Editor';
|
||||||
import store from "@/store";
|
import store from "@/store";
|
||||||
|
|
||||||
@@ -311,7 +315,7 @@ export default {
|
|||||||
this.statusOptions = response.data;
|
this.statusOptions = response.data;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
activated(){
|
activated() {
|
||||||
this.getList();
|
this.getList();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@@ -381,7 +385,7 @@ export default {
|
|||||||
handleApprova(row) {
|
handleApprova(row) {
|
||||||
this.$router.push("/article/approve/" + row.id);
|
this.$router.push("/article/approve/" + row.id);
|
||||||
},
|
},
|
||||||
handleOffline(row){
|
handleOffline(row) {
|
||||||
let that_ = this
|
let that_ = this
|
||||||
this.$confirm('是否确认下线标题为:"' + row.title + '"的数据项?', "警告", {
|
this.$confirm('是否确认下线标题为:"' + row.title + '"的数据项?', "警告", {
|
||||||
confirmButtonText: "确定",
|
confirmButtonText: "确定",
|
||||||
@@ -390,8 +394,8 @@ export default {
|
|||||||
}).then(function () {
|
}).then(function () {
|
||||||
that_.loading = true;
|
that_.loading = true;
|
||||||
return offline(row.id);
|
return offline(row.id);
|
||||||
}).then(res=>{
|
}).then(res => {
|
||||||
if (res.code==200){
|
if (res.code == 200) {
|
||||||
this.msgSuccess("下线成功");
|
this.msgSuccess("下线成功");
|
||||||
this.getList()
|
this.getList()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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="attribute1">
|
||||||
<el-select v-model="queryParams.attribute1" placeholder="数据状态" clearable size="small">
|
<el-select v-model="queryParams.attribute1" placeholder="数据状态" clearable size="small">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="dict in attribute1Options"
|
v-for="dict in attribute1Options"
|
||||||
@@ -20,7 +20,7 @@
|
|||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</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"
|
||||||
@@ -30,16 +30,16 @@
|
|||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="状态" prop="status">
|
<!-- <el-form-item label="状态" prop="status">-->
|
||||||
<el-select v-model="queryParams.status" placeholder="数据状态" clearable size="small">
|
<!-- <el-select v-model="queryParams.status" placeholder="数据状态" clearable size="small">-->
|
||||||
<el-option
|
<!-- <el-option-->
|
||||||
v-for="dict in statusOptions"
|
<!-- v-for="dict in statusOptions"-->
|
||||||
:key="dict.dictValue"
|
<!-- :key="dict.dictValue"-->
|
||||||
:label="dict.dictLabel"
|
<!-- :label="dict.dictLabel"-->
|
||||||
:value="dict.dictValue"
|
<!-- :value="dict.dictValue"-->
|
||||||
/>
|
<!-- />-->
|
||||||
</el-select>
|
<!-- </el-select>-->
|
||||||
</el-form-item>
|
<!-- </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>
|
||||||
@@ -98,7 +98,7 @@
|
|||||||
<el-table-column label="网站类型" align="center" prop="attribute2" :formatter="attribute2Format" />
|
<el-table-column label="网站类型" align="center" prop="attribute2" :formatter="attribute2Format" />
|
||||||
<el-table-column label="类型名" align="center" prop="dictLabel" />
|
<el-table-column label="类型名" align="center" prop="dictLabel" />
|
||||||
<el-table-column label="类型排序" align="center" prop="dictSort" />
|
<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="status" :formatter="statusFormat" />-->
|
||||||
<el-table-column label="缩略图" align="center" prop="attribute1" :formatter="attribute1Format" />
|
<el-table-column label="缩略图" align="center" prop="attribute1" :formatter="attribute1Format" />
|
||||||
<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">
|
||||||
@@ -163,15 +163,15 @@
|
|||||||
>{{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-form-item label="状态" prop="status">-->
|
||||||
<el-radio-group v-model="form.status">
|
<!-- <el-radio-group v-model="form.status">-->
|
||||||
<el-radio
|
<!-- <el-radio-->
|
||||||
v-for="dict in statusOptions"
|
<!-- v-for="dict in statusOptions"-->
|
||||||
:key="dict.dictValue"
|
<!-- :key="dict.dictValue"-->
|
||||||
:label="dict.dictValue"
|
<!-- :label="dict.dictValue"-->
|
||||||
>{{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="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>
|
||||||
@@ -327,6 +327,8 @@ export default {
|
|||||||
const dictCode = row.dictCode || this.ids
|
const dictCode = row.dictCode || this.ids
|
||||||
getData(dictCode).then(response => {
|
getData(dictCode).then(response => {
|
||||||
this.form = response.data;
|
this.form = response.data;
|
||||||
|
this.form.attribute1 +=""
|
||||||
|
this.form.attribute2 +=""
|
||||||
this.open = true;
|
this.open = true;
|
||||||
this.title = "修改文章类型";
|
this.title = "修改文章类型";
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -86,7 +86,7 @@
|
|||||||
<el-table-column type="selection" width="55" align="center" />
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
<el-table-column label="序号" type="index" align="center">
|
<el-table-column label="序号" type="index" align="center">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span>{{ ((queryParams.pageInfo.pageNum - 1) * queryParams.pageInfo.pageSize + scope.$index + 1)}}</span>
|
<span>{{ ((queryParams.pageInfo.pageNum - 1) * queryParams.pageInfo.pageSize + scope.$index + 1)}}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="标题" align="center" prop="title" />
|
<el-table-column label="标题" align="center" prop="title" />
|
||||||
@@ -330,7 +330,7 @@ export default {
|
|||||||
submitForm() {
|
submitForm() {
|
||||||
this.$refs["form"].validate(valid => {
|
this.$refs["form"].validate(valid => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
this.form.imgurl = this.form.imgurl.url
|
// this.form.imgurl = this.form.imgurl.url
|
||||||
if (this.form.id != null) {
|
if (this.form.id != null) {
|
||||||
updateBanner(this.form).then(response => {
|
updateBanner(this.form).then(response => {
|
||||||
this.msgSuccess("修改成功");
|
this.msgSuccess("修改成功");
|
||||||
|
|||||||
285
ebts-ui/src/views/sist/dire/direData.vue
Normal file
285
ebts-ui/src/views/sist/dire/direData.vue
Normal file
@@ -0,0 +1,285 @@
|
|||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
|
||||||
|
<el-form-item label="名称" prop="name">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.name"
|
||||||
|
placeholder="请输入名称"
|
||||||
|
clearable
|
||||||
|
size="small"
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||||
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
<el-row :gutter="10" class="mb8">
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
plain
|
||||||
|
icon="el-icon-plus"
|
||||||
|
size="mini"
|
||||||
|
@click="handleAdd"
|
||||||
|
v-hasPermi="['test:emplee:add']"
|
||||||
|
>新增</el-button>
|
||||||
|
</el-col>
|
||||||
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-table
|
||||||
|
v-loading="loading"
|
||||||
|
:data="empleeList"
|
||||||
|
row-key="id"
|
||||||
|
default-expand-all
|
||||||
|
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
|
||||||
|
>
|
||||||
|
<el-table-column label="名称" align="center" prop="name" />
|
||||||
|
<el-table-column label="层" align="center" prop="level" />
|
||||||
|
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d} {h}:{m}:{s}') }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="更新时间" align="center" prop="updateTime" width="180">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{ parseTime(scope.row.updateTime, '{y}-{m}-{d} {h}:{m}:{s}') }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
icon="el-icon-edit"
|
||||||
|
@click="handleUpdate(scope.row)"
|
||||||
|
v-hasPermi="['test:emplee:edit']"
|
||||||
|
>修改</el-button>
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
icon="el-icon-delete"
|
||||||
|
@click="handleDelete(scope.row)"
|
||||||
|
v-hasPermi="['test:emplee:remove']"
|
||||||
|
>删除</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
|
||||||
|
<!-- 添加或修改层级结构对话框 -->
|
||||||
|
<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-item label="上级" prop="pid">
|
||||||
|
<treeselect v-model="form.pid" :options="empleeOptions" :normalizer="normalizer" placeholder="请选择父id" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="层" prop="level">
|
||||||
|
<el-input v-model="form.level" placeholder="请输入层" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="名称" prop="name">
|
||||||
|
<el-input v-model="form.name" placeholder="请输入名称" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||||
|
<el-button @click="cancel">取 消</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { listEmplee, getEmplee, delEmplee, addEmplee, updateEmplee, exportEmplee } from "@/api/test/emplee";
|
||||||
|
import Treeselect from "@riophae/vue-treeselect";
|
||||||
|
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "Emplee",
|
||||||
|
components: {
|
||||||
|
Treeselect
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
direId: this.$route.params && this.$route.params.direId,
|
||||||
|
siteType: this.$route.params && this.$route.params.siteType,
|
||||||
|
// 遮罩层
|
||||||
|
loading: true,
|
||||||
|
// 显示搜索条件
|
||||||
|
showSearch: true,
|
||||||
|
// 层级结构表格数据
|
||||||
|
empleeList: [],
|
||||||
|
// 层级结构树选项
|
||||||
|
empleeOptions: [],
|
||||||
|
// 弹出层标题
|
||||||
|
title: "",
|
||||||
|
// 是否显示弹出层
|
||||||
|
open: false,
|
||||||
|
// 站点类型字典
|
||||||
|
// 查询参数
|
||||||
|
queryParams: {
|
||||||
|
type: null,
|
||||||
|
name: null,
|
||||||
|
},
|
||||||
|
// 表单参数
|
||||||
|
form: {},
|
||||||
|
// 表单校验
|
||||||
|
rules: {
|
||||||
|
}
|
||||||
|
};
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
/** 查询层级结构列表 */
|
||||||
|
getList() {
|
||||||
|
this.loading = true;
|
||||||
|
this.queryParams.type = this.direId
|
||||||
|
this.queryParams.siteType = this.siteType
|
||||||
|
listEmplee(this.queryParams).then(response => {
|
||||||
|
this.loading = false;
|
||||||
|
this.empleeList = this.handleTree(response.data, "id", "pid");
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/** 转换层级结构数据结构 */
|
||||||
|
normalizer(node) {
|
||||||
|
if (node.children && !node.children.length) {
|
||||||
|
delete node.children;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
id: node.id,
|
||||||
|
label: node.name,
|
||||||
|
children: node.children
|
||||||
|
};
|
||||||
|
},
|
||||||
|
/** 查询部门下拉树结构 */
|
||||||
|
getTreeselect() {
|
||||||
|
listEmplee({type:this.direId,siteType:this.siteType,}).then(response => {
|
||||||
|
console.log(response)
|
||||||
|
this.empleeOptions = [];
|
||||||
|
const data = { id: 0, name: '顶级节点', children: [] };
|
||||||
|
if (response.code == 200){
|
||||||
|
data.children = this.handleTree(response.data, "id", "pid");
|
||||||
|
}
|
||||||
|
this.empleeOptions.push(data);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 取消按钮
|
||||||
|
cancel() {
|
||||||
|
this.open = false;
|
||||||
|
this.reset();
|
||||||
|
},
|
||||||
|
// 表单重置
|
||||||
|
reset() {
|
||||||
|
this.form = {
|
||||||
|
id: null,
|
||||||
|
siteType: null,
|
||||||
|
pid: null,
|
||||||
|
type: null,
|
||||||
|
level: null,
|
||||||
|
name: null,
|
||||||
|
createBy: null,
|
||||||
|
createTime: null,
|
||||||
|
updateBy: null,
|
||||||
|
updateTime: null
|
||||||
|
};
|
||||||
|
this.resetForm("form");
|
||||||
|
},
|
||||||
|
/** 搜索按钮操作 */
|
||||||
|
handleQuery() {
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
/** 重置按钮操作 */
|
||||||
|
resetQuery() {
|
||||||
|
this.resetForm("queryForm");
|
||||||
|
this.handleQuery();
|
||||||
|
},
|
||||||
|
/** 新增按钮操作 */
|
||||||
|
handleAdd() {
|
||||||
|
this.reset();
|
||||||
|
this.getTreeselect();
|
||||||
|
this.open = true;
|
||||||
|
this.title = "添加层级结构";
|
||||||
|
},
|
||||||
|
/** 修改按钮操作 */
|
||||||
|
handleUpdate(row) {
|
||||||
|
this.reset();
|
||||||
|
this.getTreeselect();
|
||||||
|
if (row != null) {
|
||||||
|
this.form.pid = row.id;
|
||||||
|
}
|
||||||
|
getEmplee(row.id).then(response => {
|
||||||
|
this.form = response.data;
|
||||||
|
this.open = true;
|
||||||
|
this.title = "修改层级结构";
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/** 提交按钮 */
|
||||||
|
submitForm() {
|
||||||
|
this.$refs["form"].validate(valid => {
|
||||||
|
if (valid) {
|
||||||
|
this.form.type = this.direId
|
||||||
|
this.form.siteType = this.siteType
|
||||||
|
if (this.form.id != null) {
|
||||||
|
updateEmplee(this.form).then(response => {
|
||||||
|
this.msgSuccess("修改成功");
|
||||||
|
this.open = false;
|
||||||
|
this.getList();
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
addEmplee(this.form).then(response => {
|
||||||
|
this.msgSuccess("新增成功");
|
||||||
|
this.open = false;
|
||||||
|
this.getList();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/** 删除按钮操作 */
|
||||||
|
handleDelete(row) {
|
||||||
|
this.$confirm('是否确认删除层级结构编号为"' + row.id + '"的数据项?', "警告", {
|
||||||
|
confirmButtonText: "确定",
|
||||||
|
cancelButtonText: "取消",
|
||||||
|
type: "warning"
|
||||||
|
}).then(function() {
|
||||||
|
return delEmplee(row.id);
|
||||||
|
}).then(() => {
|
||||||
|
this.getList();
|
||||||
|
this.msgSuccess("删除成功");
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<!--<template>-->
|
||||||
|
<!-- <div>-->
|
||||||
|
<!-- {{ direId }}-->
|
||||||
|
<!-- </div>-->
|
||||||
|
<!--</template>-->
|
||||||
|
|
||||||
|
<!--<script>-->
|
||||||
|
<!--export default {-->
|
||||||
|
<!-- name: "direData",-->
|
||||||
|
<!-- data() {-->
|
||||||
|
<!-- return {-->
|
||||||
|
<!-- direId: this.$route.params && this.$route.params.direId,-->
|
||||||
|
<!-- }-->
|
||||||
|
<!-- },-->
|
||||||
|
<!-- created() {-->
|
||||||
|
<!-- let direId = this.$route.params && this.$route.params.direId;-->
|
||||||
|
<!-- console.log(direId)-->
|
||||||
|
|
||||||
|
<!-- }-->
|
||||||
|
<!--}-->
|
||||||
|
<!--</script>-->
|
||||||
|
|
||||||
|
<!--<style scoped>-->
|
||||||
|
|
||||||
|
<!--</style>-->
|
||||||
@@ -1,10 +1,10 @@
|
|||||||
<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="dictLabel">
|
<el-form-item label="层级数据" prop="dictLabel">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="queryParams.dictLabel"
|
v-model="queryParams.dictLabel"
|
||||||
placeholder="请输入名录类型"
|
placeholder="请输入层级数据"
|
||||||
clearable
|
clearable
|
||||||
size="small"
|
size="small"
|
||||||
@keyup.enter.native="handleQuery"
|
@keyup.enter.native="handleQuery"
|
||||||
@@ -84,10 +84,16 @@
|
|||||||
|
|
||||||
<el-table v-loading="loading" :data="dataList" @selection-change="handleSelectionChange">
|
<el-table v-loading="loading" :data="dataList" @selection-change="handleSelectionChange">
|
||||||
<el-table-column type="selection" width="55" align="center" />
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
<el-table-column label="名录类型编码" align="center" prop="dictCode" />
|
<!-- <el-table-column label="层级数据编码" align="center" prop="dictCode" />-->
|
||||||
<el-table-column label="网站类型" align="center" prop="attribute2" :formatter="attribute2Format" />
|
<el-table-column label="网站类型" align="center" prop="attribute2" :formatter="attribute2Format" />
|
||||||
<el-table-column label="名录类型" align="center" prop="dictLabel" />
|
<el-table-column label="层级数据" align="center" prop="dictLabel" >
|
||||||
<el-table-column label="名录类型排序" align="center" prop="dictSort" />
|
<template slot-scope="scope">
|
||||||
|
<router-link :to="'/dire/data/' + scope.row.dictValue+'/'+scope.row.cssClass" class="link-type">
|
||||||
|
<span>{{ scope.row.dictLabel }}</span>
|
||||||
|
</router-link>
|
||||||
|
</template>
|
||||||
|
</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="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">
|
||||||
@@ -128,7 +134,7 @@
|
|||||||
<!-- 添加或修改参数配置对话框 -->
|
<!-- 添加或修改参数配置对话框 -->
|
||||||
<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="名录类型" prop="dictLabel">
|
<el-form-item label="层级数据" prop="dictLabel">
|
||||||
<el-input v-model="form.dictLabel" placeholder="请输入数据" />
|
<el-input v-model="form.dictLabel" placeholder="请输入数据" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="显示排序" prop="dictSort">
|
<el-form-item label="显示排序" prop="dictSort">
|
||||||
@@ -206,7 +212,7 @@ export default {
|
|||||||
// 表单校验
|
// 表单校验
|
||||||
rules: {
|
rules: {
|
||||||
dictLabel: [
|
dictLabel: [
|
||||||
{ required: true, message: "名录类型不能为空", trigger: "blur" }
|
{ required: true, message: "层级数据不能为空", trigger: "blur" }
|
||||||
],
|
],
|
||||||
attribute2: [
|
attribute2: [
|
||||||
{ required: true, message: "网站类型不能为空", trigger: "blur" }
|
{ required: true, message: "网站类型不能为空", trigger: "blur" }
|
||||||
@@ -277,7 +283,7 @@ export default {
|
|||||||
handleAdd() {
|
handleAdd() {
|
||||||
this.reset();
|
this.reset();
|
||||||
this.open = true;
|
this.open = true;
|
||||||
this.title = "添加名录类型";
|
this.title = "添加层级数据";
|
||||||
this.form.dictType = this.queryParams.dictType;
|
this.form.dictType = this.queryParams.dictType;
|
||||||
},
|
},
|
||||||
// 多选框选中数据
|
// 多选框选中数据
|
||||||
@@ -293,7 +299,7 @@ export default {
|
|||||||
getData(dictCode).then(response => {
|
getData(dictCode).then(response => {
|
||||||
this.form = response.data;
|
this.form = response.data;
|
||||||
this.open = true;
|
this.open = true;
|
||||||
this.title = "修改名录类型";
|
this.title = "修改层级数据";
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
/** 提交按钮 */
|
/** 提交按钮 */
|
||||||
|
|||||||
@@ -38,10 +38,10 @@
|
|||||||
</el-switch>
|
</el-switch>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="图片上传" v-show="!fileTypeShow">
|
<el-form-item label="图片上传" v-show="!fileTypeShow">
|
||||||
<ImageUpload v-model="staticUrl" v-on:change="changeAddress"/>
|
<ImageUpload v-model="value" v-on:change="changeAddress"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="文件上传" v-show="fileTypeShow">
|
<el-form-item label="文件上传" v-show="fileTypeShow">
|
||||||
<FileUpload v-model="staticUrl" v-on:change="changeAddress"/>
|
<FileUpload v-model="value" v-on:change="changeAddress"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
@@ -89,6 +89,15 @@ export default {
|
|||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: null
|
default: null
|
||||||
},
|
},
|
||||||
|
/**
|
||||||
|
* 是否需要url 1:需要 2:uri 3:同时
|
||||||
|
* 在vData为true有用
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
url:{
|
||||||
|
type:Number,
|
||||||
|
default:1,
|
||||||
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
const checkRoleIds = (rule, value, callback) => {
|
const checkRoleIds = (rule, value, callback) => {
|
||||||
@@ -110,7 +119,7 @@ export default {
|
|||||||
fileAddr: "",
|
fileAddr: "",
|
||||||
unionId: this.unionId,
|
unionId: this.unionId,
|
||||||
},
|
},
|
||||||
staticUrl: this.value,
|
// staticUrl: this.value,
|
||||||
// 文件夹列表
|
// 文件夹列表
|
||||||
folderOptions: [],
|
folderOptions: [],
|
||||||
// 角色列表
|
// 角色列表
|
||||||
@@ -146,7 +155,7 @@ export default {
|
|||||||
*/
|
*/
|
||||||
fileTypeChange() {
|
fileTypeChange() {
|
||||||
this.form.fileAddr = ""
|
this.form.fileAddr = ""
|
||||||
this.staticUrl = ""
|
this.value = ""
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* 改变地址
|
* 改变地址
|
||||||
@@ -174,7 +183,15 @@ export default {
|
|||||||
flag = true
|
flag = true
|
||||||
} else {
|
} else {
|
||||||
flag = uploadFile(this.form).then(res => {
|
flag = uploadFile(this.form).then(res => {
|
||||||
this.$emit("input", res)
|
let data = ""
|
||||||
|
if (this.url == 1){
|
||||||
|
data = res.url
|
||||||
|
}else if (this.url == 2){
|
||||||
|
data = res.uri
|
||||||
|
}else if (this.url == 3){
|
||||||
|
data = res
|
||||||
|
}
|
||||||
|
this.$emit("input", data)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user