This commit is contained in:
clay
2022-09-25 12:53:43 +08:00
parent 362b39a1a8
commit b7e8c3609b
9 changed files with 145 additions and 107 deletions

View File

@@ -3,8 +3,8 @@ ENV = 'development'
# EBTS/开发环境
#VUE_APP_BASE_API = '/dev-api'
#VUE_APP_BASE_API = 'http://192.168.190.67/dev-api'
VUE_APP_BASE_API = 'http://127.0.0.1:8085/dev-api'
VUE_APP_BASE_API = 'http://192.168.190.67/dev-api'
#VUE_APP_BASE_API = 'http://127.0.0.1:8085/dev-api'
#VUE_APP_BASE_API = 'http://sistapi.hchyun.cn/dev-api'
# 路由懒加载

View File

@@ -4,3 +4,4 @@ ENV = 'production'
# EBTS/生产环境
#VUE_APP_BASE_API = '/prod-api'
VUE_APP_BASE_API = 'http://192.168.190.67/dev-api'
#VUE_APP_BASE_API = 'http://sist.swjtu.edu.cn/dev-api'

View File

@@ -26,6 +26,7 @@ export function getArticle(id) {
method: 'get'
})
}
// 查询系统文章详细
export function getArticleType() {
return request({
@@ -34,6 +35,15 @@ export function getArticleType() {
})
}
// 查询系统文章详细
export function getArticleNav() {
return request({
url: '/sist/article/nav',
method: 'get'
})
}
export function getArticleApprove(type) {
return request({
url: '/sist/article/approve/'+type,

View File

@@ -9,12 +9,13 @@ module.exports = {
* 单点登录url
*/
casloginUrl: 'https://cas.swjtu.edu.cn/authserver/login?service=http://192.168.190.67/dev-api/cas-login',
// casloginUrl: 'https://cas.swjtu.edu.cn/authserver/login?service=http://sist.swjtu.edu.cn/dev-api/cas-login',
/**
* 单点登出url
*/
// caslogoutUrl: 'http://localhost:8888/cas/logout?service=http://localhost:8080',
caslogoutUrl: 'https://cas.swjtu.edu.cn/authserver/logout?service=http://192.168.190.67/admin/logout',
// caslogoutUrl: 'https://cas.swjtu.edu.cn/authserver/logout?service=http://sist.swjtu.edu.cn/admin/logout',
/**

View File

@@ -6,7 +6,7 @@ import {setToken} from "@/utils/auth";
export default {
name: "cas-login",
mounted() {
// debugger
debugger
let search = window.location.search;
let token = search.slice(search.indexOf("=") + 1)
setToken(token)

View File

@@ -47,9 +47,9 @@
placeholder="请选择文章类型" clearable :style="{width: '100%'}">
<el-option
v-for="dict in sistArticleTypeOption"
:key="dict.dictCode"
:label="dict.dictLabel"
:value="dict.dictCode"
:key="dict.id"
:label="dict.title"
:value="dict.id"
/>
</el-select>
</el-form-item>
@@ -74,9 +74,9 @@
@change="getLabApprove(params.labArticleType)" clearable :style="{width: '100%'}">
<el-option
v-for="dict in labArticleTypeOption"
:key="dict.dictCode"
:label="dict.dictLabel"
:value="dict.dictCode"
:key="dict.id"
:label="dict.title"
:value="dict.id"
/>
</el-select>
</el-form-item>
@@ -126,6 +126,7 @@ import Editor from '@/components/Editor';
import {updateArticle, getArticle, drafts, getArticleType, getArticleApprove} from "@/api/sist/article";
import {Message} from "element-ui";
import UploadFile from '@/views/utils/uploadFile.vue';
import { getArticleNav } from '../../../../api/sist/article'
export default {
components: {
@@ -245,22 +246,37 @@ export default {
this.getDicts("article_status").then(response => {
this.statusOptions = response.data;
});
getArticleType().then(res => {
let dictCodes = res.data
let articleList = this.articleTypeOptions
console.log("dictCodes",dictCodes,"articleList",articleList)
for (let i = 0; i < articleList.length; i++) {
for (let j = 0; j < dictCodes.length; j++) {
if (articleList[i].dictCode == dictCodes[j]) {
if (articleList[i].attribute2 == 1) {
this.sistArticleTypeOption.push(articleList[i])
} else if (articleList[i].attribute2 == 2) {
this.labArticleTypeOption.push(articleList[i])
}
}
getArticleNav().then(res=>{
let data = res.data
for (let item of data) {
if (item.sitetype == 1){
this.sistArticleTypeOption.push(item)
}else {
this.labArticleTypeOption.push(item)
}
}
console.log(res)
})
// getArticleType().then(res => {
// let dictCodes = res.data
// let articleList = this.articleTypeOptions
// console.log("dictCodes",dictCodes,"articleList",articleList)
// for (let i = 0; i < articleList.length; i++) {
// for (let j = 0; j < dictCodes.length; j++) {
// if (articleList[i].dictCode == dictCodes[j]) {
// if (articleList[i].attribute2 == 1) {
// this.sistArticleTypeOption.push(articleList[i])
// } else if (articleList[i].attribute2 == 2) {
// this.labArticleTypeOption.push(articleList[i])
// }
// }
// }
// }
// })
},
mounted() {
},

View File

@@ -25,7 +25,8 @@
size="mini"
@click="handleAdd"
v-hasPermi="['test:emplee:add']"
>新增</el-button>
>新增
</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
@@ -37,8 +38,8 @@
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="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>
@@ -57,14 +58,16 @@
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['test:emplee:edit']"
>修改</el-button>
>修改
</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['test:emplee:remove']"
>删除</el-button>
>删除
</el-button>
</template>
</el-table-column>
</el-table>
@@ -73,13 +76,18 @@
<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" />
<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-input-number type="number" :min="1" :max="3" v-model="form.level" placeholder="请输入层"/>
</el-form-item>
<el-form-item label="名称" prop="name">
<el-input v-model="form.name" placeholder="请输入名称" />
<el-input v-model="form.name" placeholder="请输入名称"/>
</el-form-item>
<el-form-item v-if="form.level === 3" label="跳转链接" prop="link">
<el-input v-model="form.link" placeholder="请输跳转链接">
<template slot="prepend">Http://</template>
</el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
@@ -91,12 +99,12 @@
</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";
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",
name: 'Emplee',
components: {
Treeselect
},
@@ -113,63 +121,62 @@ export default {
// 层级结构树选项
empleeOptions: [],
// 弹出层标题
title: "",
title: '',
// 是否显示弹出层
open: false,
// 站点类型字典
// 查询参数
queryParams: {
type: null,
name: null,
name: null
},
// 表单参数
form: {},
// 表单校验
rules: {
}
};
rules: {}
}
},
created() {
this.getList();
this.getList()
},
methods: {
/** 查询层级结构列表 */
getList() {
this.loading = true;
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");
});
this.loading = false
this.empleeList = this.handleTree(response.data, 'id', 'pid')
})
},
/** 转换层级结构数据结构 */
normalizer(node) {
if (node.children && !node.children.length) {
delete node.children;
delete node.children
}
return {
id: node.id,
label: node.name,
children: node.children
};
}
},
/** 查询部门下拉树结构 */
getTreeselect() {
listEmplee({type:this.direId,siteType:this.siteType,}).then(response => {
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 = []
const data = { id: 0, name: '顶级节点', children: [] }
if (response.code == 200) {
data.children = this.handleTree(response.data, 'id', 'pid')
}
this.empleeOptions.push(data);
});
this.empleeOptions.push(data)
})
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
this.open = false
this.reset()
},
// 表单重置
reset() {
@@ -178,86 +185,85 @@ export default {
siteType: null,
pid: null,
type: null,
level: null,
level: 1,
name: null,
link: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null
};
this.resetForm("form");
}
this.resetForm('form')
},
/** 搜索按钮操作 */
handleQuery() {
this.getList();
this.getList()
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
this.resetForm('queryForm')
this.handleQuery()
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.getTreeselect();
this.open = true;
this.title = "添加层级结构";
this.reset()
this.getTreeselect()
this.open = true
this.title = '添加层级结构'
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
this.getTreeselect();
this.reset()
this.getTreeselect()
if (row != null) {
this.form.pid = row.id;
this.form.pid = row.id
}
getEmplee(row.id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改层级结构";
});
this.form = response.data
this.open = true
this.title = '修改层级结构'
})
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
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();
});
this.msgSuccess('修改成功')
this.open = false
this.getList()
})
} else {
addEmplee(this.form).then(response => {
this.msgSuccess("新增成功");
this.open = false;
this.getList();
});
this.msgSuccess('新增成功')
this.open = false
this.getList()
})
}
}
});
})
},
/** 删除按钮操作 */
handleDelete(row) {
this.$confirm('是否确认删除层级结构编号为"' + row.id + '"的数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
this.$confirm('是否确认删除层级结构编号为"' + row.id + '"的数据项?', '警告', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(function() {
return delEmplee(row.id);
return delEmplee(row.id)
}).then(() => {
this.getList();
this.msgSuccess("删除成功");
this.getList()
this.msgSuccess('删除成功')
})
}
}
};
}
</script>
<!--<template>-->
<!-- <div>-->
<!-- {{ direId }}-->

View File

@@ -100,8 +100,8 @@
</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-dialog :title="title" :visible.sync="open" width="550px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-form-item label="父级">
<el-input v-model="form.ptitle" disabled/>
<!-- <treeselect v-model="form.pid" :options="navigationOptions" :normalizer="normalizer" placeholder="请选择父ID"/>-->
@@ -139,7 +139,7 @@
/>
</el-select>
</el-form-item>
<el-form-item label="层次数据" prop="refId" v-show="empleeSelShow">
<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"
@@ -149,7 +149,7 @@
/>
</el-select>
</el-form-item>
<el-form-item label="层次数据" prop="enRefId" v-show="empleeSelShow">
<el-form-item label="英文层次数据" prop="enRefId" v-show="empleeSelShow">
<el-select v-model="form.enRefId" placeholder="请选择层次数据" clearable :style="{width: '100%'}">
<el-option
v-for="dict in direTypeOptions"
@@ -175,7 +175,7 @@
<el-dialog title="编辑详情" :visible="detailsShow" width="1100px" :close-on-click-modal="false" @close="detailsClose()"
append-to-body>
<el-form :model="formData" :rules="detailsRules" size="medium" label-width="100px">
<el-form :model="formData" size="medium" label-width="100px">
<el-row>
<el-col :span="12">
<!-- <el-form-item label="详情标题" prop="title">-->
@@ -228,8 +228,8 @@ export default {
data() {
return {
formData: {
title: null,
content: null,
title: "",
content: "",
},
detailsShow: false,
// 遮罩层
@@ -408,7 +408,9 @@ export default {
},
//导航类型变化
navigationTypeChang(type) {
this.form.refId = null
// if (type != "3"){
// this.form.refId = null
// }
this.articleTypeOptions = []
this.direTypeOptions = []
if (type == 2) {
@@ -448,6 +450,7 @@ export default {
}
getNavigation(row.id).then(response => {
this.form = response.data;
console.log(response.data,"data")
if (this.form.pid == 0) {
this.form.ptitle = "顶级节点"
} else {
@@ -459,10 +462,11 @@ export default {
this.anvTypeEdit = false;
}
}
console.log(this.navigationList);
console.log(this.navigationList,"fgfgfgfg");
}
this.form.refId = parseInt(this.form.refId)
this.navigationTypeChang(this.form.type)
console.log(this.form,"from")
this.navigationTypeChang(response.data.type)
// this.form.refId = parseInt(this.form.refId)
this.open = true;
this.title = "修改导航";
});

View File

@@ -28,10 +28,10 @@ module.exports = {
// 如果你不需要生产环境的 source map可以将其设置为 false 以加速生产环境构建。
productionSourceMap: true,
// webpack-dev-server 相关配置
// devServer: {
devServer: {
// host: '0.0.0.0',
// // port: port,
// port: 8080,
port: 8080,
// open: true,
// proxy: {
// // detail: https://cli.vuejs.org/config/#devserver-proxy
@@ -45,7 +45,7 @@ module.exports = {
// }
// },
// disableHostCheck: true
// },
},
// 强制内联CSS
// 默认true: 使用CSS分离插件 ExtractTextPlugin采用独立样式文件载入不采用 <style> 方式内联至 html 文件中
css: { extract: false },