2023/1/1
parent
8ffc42419c
commit
7510ef8f67
|
@ -17,34 +17,72 @@ export function modifyFramework(data) {
|
|||
}
|
||||
|
||||
export function getDepartmentDetail(params) {
|
||||
return request({
|
||||
url: '/job/department-detail',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
return request({
|
||||
url: '/job/department-detail',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
export function modifyDepartmentDetail(data) {
|
||||
return request({
|
||||
url: '/job/department-detail',
|
||||
method: 'post',
|
||||
data
|
||||
url: '/job/department-detail',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function getJobDetail(params) {
|
||||
return request({
|
||||
url: '/job/job-detail',
|
||||
method: 'get',
|
||||
params
|
||||
url: '/job/job-detail',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
export function modifyJobDetail(data) {
|
||||
return request({
|
||||
url: '/job/job-detail',
|
||||
method: 'post',
|
||||
data
|
||||
url: '/job/job-detail',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function queryDepartmentJob() {
|
||||
return request({
|
||||
url: '/ahp/department-job-copy/query',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export function queryAhpFramework(params) {
|
||||
return request({
|
||||
url: '/ahp/framework/query',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
export function modifyAhpFramework(params) {
|
||||
return request({
|
||||
url: '/ahp/framework/save',
|
||||
method: 'post',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
export function queryScore(params) {
|
||||
return request({
|
||||
url: '/ahp/score/query',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
export function saveScore(params) {
|
||||
return request({
|
||||
url: '/ahp/score/save',
|
||||
method: 'post',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
|
|
@ -29,4 +29,4 @@ export function changePassword(data) {
|
|||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,12 @@
|
|||
<template>
|
||||
<div v-if="!item.hidden">
|
||||
<div
|
||||
v-if="
|
||||
!item.hidden &&
|
||||
(item.path != '/manage' ||
|
||||
(item.path === '/manage' && role != 'ordinary')) &&
|
||||
(item.path != '/test' || (item.path === '/test' && role != 'ordinary'))
|
||||
"
|
||||
>
|
||||
<template
|
||||
v-if="
|
||||
hasOneShowingChild(item.children, item) &&
|
||||
|
@ -10,7 +17,11 @@
|
|||
<app-link
|
||||
v-if="
|
||||
onlyOneChild.meta &&
|
||||
(item.path != '/priority' || (item.path === '/priority' && admin))
|
||||
(item.path != '/supermanage' ||
|
||||
(item.path === '/supermanage' && role === 'super')) &&
|
||||
(item.path != '/analysis' ||
|
||||
(item.path === '/analysis' &&
|
||||
(role === 'super' || role === 'manager')))
|
||||
"
|
||||
:to="resolvePath(onlyOneChild.path)"
|
||||
>
|
||||
|
@ -82,7 +93,7 @@ export default {
|
|||
// TODO: refactor with render function
|
||||
this.onlyOneChild = null;
|
||||
return {
|
||||
admin: this.$store.state.user.is_admin,
|
||||
role: this.$store.state.user.role,
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
|
|
|
@ -97,6 +97,12 @@ export const constantRoutes = [
|
|||
name: 'JobEvaluation',
|
||||
component: () => import('@/views/job/evaluation'),
|
||||
meta: { title: '岗位胜任度评价标准' }
|
||||
},
|
||||
{
|
||||
path: 'score',
|
||||
name: 'score',
|
||||
component: () => import('@/views/job/score'),
|
||||
meta: { title: 'score' }
|
||||
}
|
||||
]
|
||||
},
|
||||
|
|
|
@ -4,7 +4,8 @@ import { resetRouter } from '@/router'
|
|||
const getDefaultState = () => {
|
||||
return {
|
||||
token: '',
|
||||
id_card: ''
|
||||
id_card: '',
|
||||
role: ''
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -19,6 +20,9 @@ const mutations = {
|
|||
},
|
||||
SET_ID_CARD: (state, id_card) => {
|
||||
state.id_card = id_card;
|
||||
},
|
||||
SET_ROLE: (state, role) => {
|
||||
state.role = role
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -30,6 +34,11 @@ const actions = {
|
|||
login({ user_num: username.trim(), password: password }).then(response => {
|
||||
commit('SET_TOKEN', response.token)
|
||||
commit('SET_ID_CARD', username)
|
||||
// 解码jwt 获得role
|
||||
// let payload = response.token.split('.')[1]
|
||||
// let data = JSON.parse(decodeURIComponent(escape(window.atob(payload))));
|
||||
// let role = data.role
|
||||
// commit('SET_ROLE', role)
|
||||
// 存储到本地 关闭页面后,自动登录的功能还在考虑
|
||||
// if (response.code == 0) {
|
||||
// sessionStorage['zssr_token'] = response.token;
|
||||
|
|
|
@ -42,58 +42,59 @@ service.interceptors.response.use(
|
|||
* You can also judge the status by HTTP Status Code
|
||||
*/
|
||||
|
||||
/* response => {
|
||||
const res = response.data
|
||||
/* response => {
|
||||
const res = response.data
|
||||
|
||||
// if the custom code is not 20000, it is judged as an error.
|
||||
if (res.code !== 20000) {
|
||||
// if the custom code is not 20000, it is judged as an error.
|
||||
if (res.code !== 20000) {
|
||||
Message({
|
||||
message: res.message || 'Error',
|
||||
type: 'error',
|
||||
duration: 5 * 1000
|
||||
})
|
||||
|
||||
// 50008: Illegal token; 50012: Other clients logged in; 50014: Token expired;
|
||||
if (res.code === 50008 || res.code === 50012 || res.code === 50014) {
|
||||
// to re-login
|
||||
MessageBox.confirm('You have been logged out, you can cancel to stay on this page, or log in again', 'Confirm logout', {
|
||||
confirmButtonText: 'Re-Login',
|
||||
cancelButtonText: 'Cancel',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
store.dispatch('user/resetToken').then(() => {
|
||||
location.reload()
|
||||
})
|
||||
})
|
||||
}
|
||||
return Promise.reject(new Error(res.message || 'Error'))
|
||||
} else {
|
||||
return res
|
||||
}
|
||||
},
|
||||
error => {
|
||||
console.log('err' + error) // for debug
|
||||
Message({
|
||||
message: res.message || 'Error',
|
||||
message: error.message,
|
||||
type: 'error',
|
||||
duration: 5 * 1000
|
||||
})
|
||||
|
||||
// 50008: Illegal token; 50012: Other clients logged in; 50014: Token expired;
|
||||
if (res.code === 50008 || res.code === 50012 || res.code === 50014) {
|
||||
// to re-login
|
||||
MessageBox.confirm('You have been logged out, you can cancel to stay on this page, or log in again', 'Confirm logout', {
|
||||
confirmButtonText: 'Re-Login',
|
||||
cancelButtonText: 'Cancel',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
store.dispatch('user/resetToken').then(() => {
|
||||
location.reload()
|
||||
})
|
||||
})
|
||||
}
|
||||
return Promise.reject(new Error(res.message || 'Error'))
|
||||
} else {
|
||||
return res
|
||||
}
|
||||
},
|
||||
error => {
|
||||
console.log('err' + error) // for debug
|
||||
Message({
|
||||
message: error.message,
|
||||
type: 'error',
|
||||
duration: 5 * 1000
|
||||
})
|
||||
return Promise.reject(error)
|
||||
} */
|
||||
return Promise.reject(error)
|
||||
} */
|
||||
|
||||
response => {
|
||||
const res = response.data
|
||||
// 状态码
|
||||
if (res.code !== 0) {
|
||||
Message({
|
||||
message: `${res.code}: ${res.msg}` || 'Error check your token or method',
|
||||
type: 'error',
|
||||
duration: 2 * 1000
|
||||
})
|
||||
return Promise.reject(new Error(res.msg || 'Error'))
|
||||
} else{
|
||||
return res
|
||||
}
|
||||
return res
|
||||
// if (res.code !== 0) {
|
||||
// Message({
|
||||
// message: `${res.code}: ${res.msg}` || 'Error check your token or method',
|
||||
// type: 'error',
|
||||
// duration: 2 * 1000
|
||||
// })
|
||||
// return Promise.reject(new Error(res.msg || 'Error'))
|
||||
// } else {
|
||||
// return res
|
||||
// }
|
||||
},
|
||||
error => {
|
||||
Message({
|
||||
|
|
|
@ -1,21 +1,14 @@
|
|||
<template>
|
||||
<div>
|
||||
统计与分析首页
|
||||
</div>
|
||||
<div>统计与分析首页</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
export default {
|
||||
name: 'AnalysisShow',
|
||||
data() {
|
||||
return {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
name: "AnalysisShow",
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
<style scoped></style>
|
||||
|
|
|
@ -1,21 +1,445 @@
|
|||
<template>
|
||||
<div>
|
||||
岗位胜任度评价标准
|
||||
</div>
|
||||
<el-container class="main-body">
|
||||
<el-header height="10%">
|
||||
<el-row type="flex" justify="space-around" style="width: 90%">
|
||||
<el-col :span="5">
|
||||
<el-select
|
||||
placeholder="department"
|
||||
v-model="department"
|
||||
@change="change_curDepartmant"
|
||||
>
|
||||
<el-option
|
||||
v-for="(item, index) in departments"
|
||||
:key="item"
|
||||
:label="item"
|
||||
:value="index"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-select placeholder="job" v-model="job">
|
||||
<el-option
|
||||
v-for="item in curJobs"
|
||||
:key="item"
|
||||
:label="item"
|
||||
:value="item"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<el-button @click="bindData">查询</el-button>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<el-button
|
||||
@click="clickSaveTree"
|
||||
size="medium"
|
||||
v-bind:disabled="!allowSave"
|
||||
>保存</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="2">
|
||||
<el-button @click="clickModify" size="medium">修改</el-button></el-col
|
||||
>
|
||||
</el-row>
|
||||
</el-header>
|
||||
<div
|
||||
style="height: 90%; width: 100%"
|
||||
id="jsmind_container"
|
||||
v-on:click="clickNode"
|
||||
@dblclick="editNode"
|
||||
></div>
|
||||
</el-container>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import "@/assets/css/jsmind.css";
|
||||
import jsMind from "jsmind/js/jsmind.js";
|
||||
window.jsMind = jsMind;
|
||||
|
||||
// const { init } = require("@/assets/js/jsmind.menu.js");
|
||||
// require("jsmind/js/jsmind.draggable.js");
|
||||
require("jsmind/js/jsmind.screenshot.js");
|
||||
|
||||
import * as jobApi from "@/api/job";
|
||||
|
||||
import { verifyJobPriority } from "@/api/priotity";
|
||||
export default {
|
||||
name: 'JobEvaluation',
|
||||
data() {
|
||||
return {
|
||||
name: "jobEvaluation",
|
||||
data() {
|
||||
return {
|
||||
jm: null,
|
||||
mindData: null,
|
||||
department: "部门",
|
||||
job: "岗位",
|
||||
departments: [],
|
||||
jobs: [],
|
||||
curJobs: [],
|
||||
//
|
||||
mindDataJobs: [],
|
||||
chosenDataJobs: null,
|
||||
//
|
||||
|
||||
options: {
|
||||
// options 将在下一章中详细介绍
|
||||
container: "jsmind_container", // [必选] 容器的ID,或者为容器的对象
|
||||
editable: false, // [可选] 是否启用编辑
|
||||
theme: "belizehole", // [可选] 主题
|
||||
mode: "full",
|
||||
support_html: false,
|
||||
view: {
|
||||
engine: "canvas", // 思维导图各节点之间线条的绘制引擎
|
||||
hmargin: 50, // 思维导图距容器外框的最小水平距离
|
||||
vmargin: 50, // 思维导图距容器外框的最小垂直距离
|
||||
line_width: 1, // 思维导图线条的粗细
|
||||
line_color: "#555", // 思维导图线条的颜色
|
||||
draggable: true, // 当容器不能完全容纳思维导图时,是否允许拖动画布代替鼠标滚动
|
||||
hide_scrollbars_when_draggable: false, // 当设置 draggable = true 时,是否隐藏滚动条
|
||||
},
|
||||
layout: {
|
||||
hspace: 30, // 节点之间的水平间距
|
||||
vspace: 20, // 节点之间的垂直间距
|
||||
pspace: 13, // 节点与连接线之间的水平间距(用于容纳节点收缩/展开控制器)
|
||||
},
|
||||
shortcut: {
|
||||
enable: true, // 是否启用快捷键
|
||||
handles: {
|
||||
myAddChild: function (jm, e) {
|
||||
let node = jm.get_selected_node();
|
||||
if (node) {
|
||||
if (jm.options.editable) {
|
||||
let childId = jm.options.maxIndex;
|
||||
jm.options.maxIndex += 1;
|
||||
jm.add_node(node, childId, "新节点", "");
|
||||
jm.select_node(jm.get_node(childId));
|
||||
// jm.begin_edit(childId);
|
||||
}
|
||||
}
|
||||
},
|
||||
myAddBrother: function (jm, e) {
|
||||
let node = jm.get_selected_node();
|
||||
if (node) {
|
||||
if (jm.options.editable && !node.isroot) {
|
||||
let broId = jm.options.maxIndex;
|
||||
jm.options.maxIndex += 1;
|
||||
jm.insert_node_after(node, broId, "新节点", "");
|
||||
jm.select_node(jm.get_node(broId));
|
||||
// jm.begin_edit(broId);
|
||||
}
|
||||
}
|
||||
},
|
||||
}, // 命名的快捷键事件处理器
|
||||
mapping: {
|
||||
// 快捷键映射
|
||||
myAddChild: 9, // <Tab>
|
||||
myAddBrother: 13, // <Enter>
|
||||
editnode: 113, // <F2>
|
||||
delnode: 46, // <Delete>
|
||||
toggle: 32, // <Space>
|
||||
left: 37, // <Left>
|
||||
up: 38, // <Up>
|
||||
right: 39, // <Right>
|
||||
down: 40, // <Down>
|
||||
},
|
||||
},
|
||||
// 新增节点id十万起步,保证容错
|
||||
maxIndex: 100000,
|
||||
},
|
||||
|
||||
writePriority: null,
|
||||
allowSave: false,
|
||||
|
||||
depth: null,
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
jobApi.queryDepartmentJob().then((res) => {
|
||||
console.log(res);
|
||||
let depathment_job_info = res.data.children;
|
||||
|
||||
for (const item of depathment_job_info) {
|
||||
this.departments.push(item.topic);
|
||||
console.log(item.topic);
|
||||
const jobs = [];
|
||||
if (item.children != undefined) {
|
||||
for (const job of item.children) {
|
||||
jobs.push(job.topic);
|
||||
}
|
||||
this.jobs.push(jobs);
|
||||
} else this.jobs.push([]);
|
||||
}
|
||||
});
|
||||
this.jm = new jsMind(this.options);
|
||||
},
|
||||
methods: {
|
||||
change_curDepartmant(num) {
|
||||
this.department = this.departments[num];
|
||||
this.curJobs = this.jobs[num];
|
||||
this.chosenDataJobs = this.mindDataJobs[num];
|
||||
},
|
||||
showChart() {
|
||||
var mind = {
|
||||
/* 元数据,定义思维导图的名称、作者、版本等信息 */
|
||||
meta: {
|
||||
name: "jsMind-demo-tree",
|
||||
author: "iec",
|
||||
version: "1.0",
|
||||
},
|
||||
/* 数据格式声明 */
|
||||
format: "node_tree",
|
||||
/* 数据内容 */
|
||||
data: this.mindData,
|
||||
};
|
||||
|
||||
this.jm.show(mind);
|
||||
},
|
||||
clickNode() {
|
||||
let node = this.jm.get_selected_node();
|
||||
if (node) {
|
||||
// 新节点 添加文档
|
||||
if (node.topic == "新节点") {
|
||||
// this.curNewNode = node;
|
||||
// this.addNewDoc();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 重复点击不变
|
||||
if (node.id === this.preSelectNodeId) {
|
||||
return;
|
||||
} else {
|
||||
this.preSelectNodeId = node.id;
|
||||
}
|
||||
|
||||
// 根节点无动作
|
||||
if (node.isroot) {
|
||||
return;
|
||||
}
|
||||
// if (this.isDepartment(node)) {
|
||||
// // 请求部门详细数据
|
||||
// jobApi.getDepartmentDetail({ department: node.topic }).then(
|
||||
// (res) => {
|
||||
// if (res.code === 0) {
|
||||
// // 切换右边页面
|
||||
// this.depData = res.data;
|
||||
// this.comName = "DepDescription";
|
||||
// this.comData = this.depData;
|
||||
// this.comTitleEdit = false;
|
||||
// this.renderComponent();
|
||||
// this.curDep = node.topic;
|
||||
// } else {
|
||||
// this.comName = "NoData";
|
||||
// this.comData = null;
|
||||
// }
|
||||
// },
|
||||
// (err) => {
|
||||
// console.log("err: ", err);
|
||||
// }
|
||||
// );
|
||||
// } else {
|
||||
// // 请求岗位详细数据
|
||||
// let jobDep = node.parent.topic;
|
||||
// jobApi.getJobDetail({ department: jobDep, job: node.topic }).then(
|
||||
// (res) => {
|
||||
// if (res.code === 0) {
|
||||
// // 数据存在
|
||||
// this.jobData = res.data;
|
||||
// this.comName = "JobDescription";
|
||||
// this.comData = this.jobData;
|
||||
// this.comTitleEdit = false;
|
||||
// this.renderComponent();
|
||||
// this.curDep = jobDep;
|
||||
// this.curJob = node.topic;
|
||||
// } else {
|
||||
// this.comName = "NoData";
|
||||
// this.comData = null;
|
||||
// }
|
||||
// },
|
||||
// (err) => {
|
||||
// console.log("err: ", err);
|
||||
// }
|
||||
// );
|
||||
// }
|
||||
}
|
||||
},
|
||||
editNode() {
|
||||
let node = this.jm.get_selected_node();
|
||||
if (node) {
|
||||
if (node.topic == "新节点") {
|
||||
this.curNewNode = node;
|
||||
this.addNewDoc();
|
||||
}
|
||||
}
|
||||
},
|
||||
bindData() {
|
||||
jobApi
|
||||
.queryAhpFramework({ department: this.department, job: this.job })
|
||||
.then((res) => {
|
||||
this.depth = res.depth;
|
||||
let originalMindData = res.data;
|
||||
originalMindData["expanded"] = true;
|
||||
var i = 1;
|
||||
let addId = function (data) {
|
||||
if (!data.hasOwnProperty("id")) {
|
||||
data["id"] = i;
|
||||
i += 1;
|
||||
}
|
||||
if (!data.hasOwnProperty("expanded")) {
|
||||
data["expanded"] = true;
|
||||
}
|
||||
if (data.hasOwnProperty("children")) {
|
||||
for (let j = 0; j < data["children"].length; j++) {
|
||||
addId(data["children"][j]);
|
||||
}
|
||||
}
|
||||
};
|
||||
addId(originalMindData);
|
||||
|
||||
// 修改方向
|
||||
// for (let j = 0; j < originalMindData["children"].length; j++) {
|
||||
// if (j % 2 == 0) {
|
||||
// originalMindData["children"][j]["direction"] = "right";
|
||||
// } else {
|
||||
// originalMindData["children"][j]["direction"] = "left";
|
||||
// }
|
||||
// }
|
||||
this.mindData = originalMindData;
|
||||
console.log("minddata", this.mindData);
|
||||
this.showChart();
|
||||
});
|
||||
},
|
||||
verifyWritePriority() {
|
||||
if (this.writePriority === null) {
|
||||
return new Promise((resolve, reject) => {
|
||||
verifyJobPriority({
|
||||
id_card: this.$store.state.user.id_card,
|
||||
priority_type: "job_write",
|
||||
}).then(
|
||||
(res) => {
|
||||
this.writePriority = res.data.result;
|
||||
resolve();
|
||||
},
|
||||
(err) => {
|
||||
this.writePriority = 0;
|
||||
console.log("err:", err);
|
||||
reject();
|
||||
}
|
||||
);
|
||||
});
|
||||
} else {
|
||||
return new Promise((resolve, reject) => {
|
||||
resolve();
|
||||
});
|
||||
}
|
||||
},
|
||||
async clickModify() {
|
||||
await this.verifyWritePriority();
|
||||
if (this.writePriority) {
|
||||
this.allowSave = true;
|
||||
this.jm.enable_edit();
|
||||
} else {
|
||||
// 没有权限
|
||||
this.$message({
|
||||
message: "没有修改权限",
|
||||
type: "error",
|
||||
duration: 2000,
|
||||
});
|
||||
}
|
||||
// 判断是否有修改权限
|
||||
// verifyJobPriority({
|
||||
// id_card: this.$store.state.user.id_card,
|
||||
// priority_type: "job_write",
|
||||
// }).then(
|
||||
// (res) => {
|
||||
// if (!res.data.result) {
|
||||
// // 没有权限
|
||||
// this.$message({
|
||||
// message: "没有修改权限",
|
||||
// type: "warning",
|
||||
// duration: 2000,
|
||||
// });
|
||||
// } else {
|
||||
// this.allowSave = true;
|
||||
// this.jm.enable_edit();
|
||||
// }
|
||||
// },
|
||||
// (err) => {
|
||||
// console.log("err:", err);
|
||||
// }
|
||||
// );
|
||||
},
|
||||
cleanTreeData() {
|
||||
// 深复制对象
|
||||
// let deepClone = function (obj, newObj) {
|
||||
// var newObj = newObj || {};
|
||||
// for (let key in obj) {
|
||||
// if (typeof obj[key] == "object") {
|
||||
// newObj[key] = obj[key].constructor === Array ? [] : {};
|
||||
// deepClone(obj[key], newObj[key]);
|
||||
// } else {
|
||||
// newObj[key] = obj[key];
|
||||
// }
|
||||
// }
|
||||
// return newObj;
|
||||
// };
|
||||
// let resData = deepClone(this.jm.get_data("node_tree")["data"]);
|
||||
let resData = this.jm.get_data("node_tree")["data"];
|
||||
// 去除id, expanded, direction
|
||||
let removeInvalidAttribution = function (data) {
|
||||
// if (data.hasOwnProperty("id")) {
|
||||
// delete data.id;
|
||||
// }
|
||||
if (data.hasOwnProperty("expanded")) {
|
||||
delete data.expanded;
|
||||
}
|
||||
if (data.hasOwnProperty("direction")) {
|
||||
delete data.direction;
|
||||
}
|
||||
if (data.hasOwnProperty("children")) {
|
||||
for (let i = 0; i < data.children.length; i++) {
|
||||
if (data.children[i].topic == "新节点") {
|
||||
data.children.splice(i, 1);
|
||||
i -= 1;
|
||||
} else {
|
||||
removeInvalidAttribution(data.children[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
removeInvalidAttribution(resData);
|
||||
return resData;
|
||||
},
|
||||
clickSaveTree() {
|
||||
let resData = this.cleanTreeData();
|
||||
// 发送请求
|
||||
let post_res = {};
|
||||
post_res.data = resData;
|
||||
post_res.depth = this.depth;
|
||||
post_res.department = this.department;
|
||||
post_res.job = this.job;
|
||||
jobApi.modifyAhpFramework({ params: post_res }).then(
|
||||
(res) => {
|
||||
if (res.code === 0) {
|
||||
Message({
|
||||
message: "保存成功",
|
||||
type: "success",
|
||||
duration: 1 * 1000,
|
||||
});
|
||||
}
|
||||
console.log(res);
|
||||
},
|
||||
(err) => {
|
||||
console.log("err: ", err);
|
||||
}
|
||||
);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
.main-body {
|
||||
width: 100%;
|
||||
height: calc(100vh - 50px);
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -0,0 +1,251 @@
|
|||
<template>
|
||||
<el-container class="main-body">
|
||||
<el-header height="10%">
|
||||
<el-row type="flex" justify="space-around" style="width: 90%">
|
||||
<el-col :span="5">
|
||||
<el-select
|
||||
placeholder="department"
|
||||
v-model="department"
|
||||
@change="change_curDepartmant"
|
||||
>
|
||||
<el-option
|
||||
v-for="(item, index) in departments"
|
||||
:key="item"
|
||||
:label="item"
|
||||
:value="index"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-select placeholder="job" v-model="job">
|
||||
<el-option
|
||||
v-for="item in curJobs"
|
||||
:key="item"
|
||||
:label="item"
|
||||
:value="item"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<el-button @click="bindData">查询</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-header>
|
||||
<el-table
|
||||
:data="composed_info"
|
||||
:header-cell-style="{ 'text-align': 'center' }"
|
||||
:cell-style="{ 'text-align': 'center' }"
|
||||
style="width: 100%"
|
||||
>
|
||||
<!-- <el-table-column prop="content" label="Content"></el-table-column> -->
|
||||
<!-- <template v-for="item in tableItems[navID]">
|
||||
<el-table-column
|
||||
:key="item.prop"
|
||||
:prop="item.prop"
|
||||
:label="item.label"
|
||||
:width="item.width"
|
||||
>
|
||||
</el-table-column>
|
||||
</template> -->
|
||||
<el-table-column>
|
||||
<template slot-scope="scope">
|
||||
<span
|
||||
:style="contentColor(scope.row.modify)"
|
||||
@click="showDialog(scope.row)"
|
||||
>{{ scope.row.content }}</span
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-dialog title="判断矩阵编辑" :visible.sync="dialogVisible">
|
||||
<!-- <el-table
|
||||
:data="chosen_row"
|
||||
:header-cell-style="{ 'text-align': 'center' }"
|
||||
:cell-style="{ 'text-align': 'center' }"
|
||||
:show-header="false"
|
||||
style="width: 80%"
|
||||
> -->
|
||||
<!-- <el-table-column v-for="column in current_matrix">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-for="value in column" value="1"></el-input>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<!-- </span>
|
||||
</template>
|
||||
</el-table> -->
|
||||
<el-row>
|
||||
<p v-for="(item,index) in chosen_row[0].content">{{index+1}}.{{item}}</p>
|
||||
</el-row>
|
||||
<el-row
|
||||
v-for="(row, row_index) in current_matrix_obj"
|
||||
style="display: flex; justify-content: space-between"
|
||||
>
|
||||
<input
|
||||
v-for="(item, col_index) in current_matrix_obj[row_index].value"
|
||||
|
||||
v-model="current_matrix_obj[row_index].value[col_index].value"
|
||||
type="number"
|
||||
oninput="if(value.length>1)value=value.slice(0,1)"
|
||||
style="width:45px"
|
||||
:disabled="col_index===row_index?true:false"
|
||||
@input="input_change(event,row_index,col_index)"
|
||||
></input>
|
||||
</el-row>
|
||||
<el-button style="float:right" @click="postMatrix">提交</el-button>
|
||||
</el-dialog>
|
||||
</el-container>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import * as jobApi from "@/api/job";
|
||||
export default {
|
||||
name: "score",
|
||||
data() {
|
||||
return {
|
||||
departments: [],
|
||||
jobs: [],
|
||||
curJobs: [],
|
||||
department: "部门",
|
||||
job: "岗位",
|
||||
|
||||
show_contents: [],
|
||||
matrice: [],
|
||||
modify: [],
|
||||
composed_info: [],
|
||||
|
||||
chosen_row: [{content:''}],
|
||||
current_matrix: [],
|
||||
current_matrix_obj:[],
|
||||
current_number:null,
|
||||
dialogVisible: false,
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
contentColor(modify) {
|
||||
return (modify) => {
|
||||
if (modify === 0) return { color: "red" };
|
||||
else if (modify === 1) return { color: "green" };
|
||||
};
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
jobApi.queryDepartmentJob().then((res) => {
|
||||
console.log(res);
|
||||
let depathment_job_info = res.data.children;
|
||||
|
||||
for (const item of depathment_job_info) {
|
||||
this.departments.push(item.topic);
|
||||
console.log(item.topic);
|
||||
const jobs = [];
|
||||
if (item.children != undefined) {
|
||||
for (const job of item.children) {
|
||||
jobs.push(job.topic);
|
||||
}
|
||||
this.jobs.push(jobs);
|
||||
} else this.jobs.push([]);
|
||||
}
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
input_change($event,row,col){
|
||||
this.current_matrix_obj[row].value[col].value=event.target.value
|
||||
let num=1/event.target.value
|
||||
num=num.toFixed(2)
|
||||
this.current_matrix_obj[col].value[row].value=num
|
||||
|
||||
this.current_matrix[row][col]=event.target.value
|
||||
this.current_matrix[col][row]=num
|
||||
},
|
||||
change_curDepartmant(num) {
|
||||
this.department = this.departments[num];
|
||||
this.curJobs = this.jobs[num];
|
||||
},
|
||||
bindData() {
|
||||
jobApi
|
||||
.queryScore({ department: this.department, job: this.job })
|
||||
.then((res) => {
|
||||
let re_content = /^\d+$/;
|
||||
let re_matrix = /^\d+_matrix$/;
|
||||
let re_modify = /^\d+_modify$/;
|
||||
const data = res.data;
|
||||
this.show_contents = [];
|
||||
this.matrice = [];
|
||||
this.modify = [];
|
||||
for (let key in data) {
|
||||
if (re_content.test(key))
|
||||
this.show_contents.push({ name: key, value: data[key] });
|
||||
else if (re_matrix.test(key))
|
||||
this.matrice.push({ name: key, value: data[key] });
|
||||
else if (re_modify.test(key))
|
||||
this.modify.push({ name: key, value: data[key] });
|
||||
}
|
||||
});
|
||||
let length = this.modify.length;
|
||||
this.composed_info = [];
|
||||
for (let i = 0; i < length; i++) {
|
||||
this.composed_info.push({
|
||||
number:this.show_contents[i].name,
|
||||
content: this.show_contents[i].value,
|
||||
matrix: this.matrice[i].value,
|
||||
modify: this.modify[i].value,
|
||||
length: this.show_contents[i].value.length,
|
||||
});
|
||||
}
|
||||
console.log(this.composed_info);
|
||||
},
|
||||
showDialog(row) {
|
||||
this.dialogVisible = true;
|
||||
this.current_number=row['number']
|
||||
this.chosen_row = [];
|
||||
this.chosen_row.push(row);
|
||||
this.current_matrix = row["matrix"];
|
||||
console.log(this.current_matrix);
|
||||
this.current_matrix_obj=[]
|
||||
for(let i of this.current_matrix){
|
||||
console.log(i)
|
||||
let tmp=[]
|
||||
for(let j of i){
|
||||
tmp.push({value:j})
|
||||
}
|
||||
this.current_matrix_obj.push({value:tmp})
|
||||
}
|
||||
console.log(this.current_matrix_obj)
|
||||
},
|
||||
postMatrix(){
|
||||
let matrix=[]
|
||||
for(let i of this.current_matrix_obj){
|
||||
let tmp=[]
|
||||
for(let j of i.value){
|
||||
tmp.push(j.value)
|
||||
}
|
||||
matrix.push(tmp)
|
||||
}
|
||||
let post_data={}
|
||||
post_data.department=this.department
|
||||
post_data.job=this.job
|
||||
post_data.number=this.current_number
|
||||
post_data.data=matrix
|
||||
jobApi.saveScore({ params: post_data }).then(
|
||||
(res) => {
|
||||
if (res.code === 0) {
|
||||
Message({
|
||||
message: "保存成功",
|
||||
type: "success",
|
||||
duration: 1 * 1000,
|
||||
});
|
||||
}
|
||||
console.log(res);
|
||||
},
|
||||
(err) => {
|
||||
console.log("err: ", err);
|
||||
}
|
||||
);
|
||||
this.dialogVisible=false
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped></style>
|
|
@ -319,6 +319,7 @@ export default {
|
|||
};
|
||||
this.jm = new jsMind(options);
|
||||
this.jm.show(mind);
|
||||
console.log(this.mindData);
|
||||
},
|
||||
isDepartment(jmNode) {
|
||||
// 二级节点一定是部门
|
||||
|
@ -550,7 +551,7 @@ export default {
|
|||
} else {
|
||||
return new Promise((resolve, reject) => {
|
||||
resolve();
|
||||
})
|
||||
});
|
||||
}
|
||||
},
|
||||
async clickModify() {
|
||||
|
@ -642,6 +643,7 @@ export default {
|
|||
duration: 1 * 1000,
|
||||
});
|
||||
}
|
||||
console.log(resData);
|
||||
},
|
||||
(err) => {
|
||||
console.log("err: ", err);
|
||||
|
|
|
@ -193,13 +193,26 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<!-- <div class="slide">
|
||||
<div class="section-title">员工专业统计</div>
|
||||
<div class="section-body">
|
||||
<div class="sbody-left"></div>
|
||||
<div class="sbody-right"></div>
|
||||
<div class="slide">
|
||||
<div class="section-title">员工专业统计</div>
|
||||
<div class="section-body">
|
||||
<div class="sbody-left2">
|
||||
<el-tabs
|
||||
type="border-card"
|
||||
class="tab-card2"
|
||||
@tab-click="handleMajorTabClick"
|
||||
>
|
||||
<el-tab-pane label="全日制">
|
||||
<div id="pic_full_major" class="pic2"></div>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="在职">
|
||||
<div id="pic_work_major" class="pic2"></div>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</div>
|
||||
<div class="sbody-right"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
|
||||
<div class="section">
|
||||
|
@ -558,7 +571,7 @@
|
|||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
<script>
|
||||
import "@/assets/css/jquery.fullPage.css";
|
||||
import "@/assets/js/jquery.fullPage.min.js";
|
||||
|
@ -589,6 +602,9 @@ export default {
|
|||
fullSchoolData: {},
|
||||
workSchoolData: {},
|
||||
schoolCategory: ["211", "985"],
|
||||
majorData: [],
|
||||
fullMajorData: [],
|
||||
workMajorData: [],
|
||||
|
||||
// 党务
|
||||
partyFaceData: [],
|
||||
|
@ -781,6 +797,7 @@ export default {
|
|||
this.showFullSchoolPie();
|
||||
} else if (destination == 4) {
|
||||
// 专业
|
||||
this.showFullMajorPie();
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -810,6 +827,10 @@ export default {
|
|||
this.fullSchoolChart = echarts.init(chartDom);
|
||||
chartDom = document.getElementById("pic_work_school");
|
||||
this.workSchoolChart = echarts.init(chartDom);
|
||||
chartDom = document.getElementById("pic_full_major");
|
||||
this.fullMajorChart = echarts.init(chartDom);
|
||||
chartDom = document.getElementById("pic_work_major");
|
||||
this.workMajorChart = echarts.init(chartDom);
|
||||
// 党
|
||||
chartDom = document.getElementById("pic_party_face");
|
||||
this.partyFaceChart = echarts.init(chartDom);
|
||||
|
@ -1033,6 +1054,25 @@ export default {
|
|||
tempArr.push(workSchoolData["级别"][key]);
|
||||
}
|
||||
this.workSchoolData["级别"] = tempArr;
|
||||
//专业
|
||||
tempArr = [];
|
||||
tempObj = { 类别: "全日制" };
|
||||
Object.assign(tempObj, resData["全日制专业"]);
|
||||
tempArr.push(tempObj);
|
||||
tempObj = { 类别: "在职" };
|
||||
Object.assign(tempObj, resData["在职专业"]);
|
||||
tempArr.push(tempObj);
|
||||
this.majorData = tempArr;
|
||||
tempArr = [];
|
||||
tempArr2 = [];
|
||||
for (let major in this.majorData[0]) {
|
||||
tempArr.push({ name: major, value: this.majorData[0][major] });
|
||||
}
|
||||
this.fullMajorData = tempArr;
|
||||
for (let major in this.majorData[1]) {
|
||||
tempArr2.push({ name: major, value: this.majorData[1][major] });
|
||||
this.workMajorData = tempArr2;
|
||||
}
|
||||
},
|
||||
(err) => {
|
||||
console.log("err", err);
|
||||
|
@ -1865,6 +1905,107 @@ export default {
|
|||
setTimeout(this.showWorkSchoolPie, 10);
|
||||
}
|
||||
},
|
||||
showFullMajorPie() {
|
||||
let option = {
|
||||
grid: [
|
||||
{
|
||||
x: "70%",
|
||||
y: "20%",
|
||||
width: "30%",
|
||||
height: "60%",
|
||||
},
|
||||
],
|
||||
xAxis: [
|
||||
{
|
||||
gridIndex: 0,
|
||||
type: "category",
|
||||
data: this.majorCategory,
|
||||
},
|
||||
],
|
||||
yAxis: [
|
||||
{
|
||||
gridIndex: 0,
|
||||
},
|
||||
],
|
||||
title: [
|
||||
{
|
||||
text: "全日制教育专业分布饼图",
|
||||
x: "20%",
|
||||
y: "3%",
|
||||
},
|
||||
],
|
||||
tooltip: {},
|
||||
legend: {
|
||||
x: "center",
|
||||
y: "bottom",
|
||||
},
|
||||
series: [
|
||||
{
|
||||
type: "pie",
|
||||
radius: "50%",
|
||||
center: ["30%", "50%"],
|
||||
data: this.fullMajorData,
|
||||
},
|
||||
],
|
||||
};
|
||||
this.fullMajorChart.setOption(option);
|
||||
},
|
||||
showWorkMajorPie() {
|
||||
let option = {
|
||||
grid: [
|
||||
{
|
||||
x: "70%",
|
||||
y: "20%",
|
||||
width: "30%",
|
||||
height: "60%",
|
||||
},
|
||||
],
|
||||
xAxis: [
|
||||
{
|
||||
gridIndex: 0,
|
||||
type: "category",
|
||||
data: this.majorCategory,
|
||||
},
|
||||
],
|
||||
yAxis: [
|
||||
{
|
||||
gridIndex: 0,
|
||||
},
|
||||
],
|
||||
title: [
|
||||
{
|
||||
text: "在职教育专业分布饼图",
|
||||
x: "20%",
|
||||
y: "3%",
|
||||
},
|
||||
],
|
||||
tooltip: {},
|
||||
legend: {
|
||||
x: "center",
|
||||
y: "bottom",
|
||||
},
|
||||
series: [
|
||||
{
|
||||
type: "pie",
|
||||
radius: "50%",
|
||||
center: ["30%", "50%"],
|
||||
data: this.workMajorData,
|
||||
},
|
||||
],
|
||||
};
|
||||
this.workMajorChart.setOption(option);
|
||||
},
|
||||
handleMajorTabClick(tab, event) {
|
||||
if (tab.label == "在职") {
|
||||
setTimeout(this.showWorkMajorPie, 10);
|
||||
}
|
||||
console.log(this.majorData);
|
||||
console.log(this.degreeData);
|
||||
personApi.getReviewEducation().then((res) => {
|
||||
console.log(res.data);
|
||||
});
|
||||
console.log(this.fullEduData);
|
||||
},
|
||||
showFullCheckBar() {
|
||||
let option = {
|
||||
// title: {
|
||||
|
@ -3160,7 +3301,7 @@ export default {
|
|||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
<style scoped>
|
||||
.section {
|
||||
text-align: center;
|
||||
|
@ -3311,4 +3452,4 @@ export default {
|
|||
background-color: rgb(148, 197, 238);
|
||||
border-color: rgb(148, 197, 238);
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
|
|
@ -39,9 +39,11 @@ module.exports = {
|
|||
proxy: {
|
||||
'/': {
|
||||
// target: 'http://127.0.0.1:4523/m1/1256020-0-default/',
|
||||
target: 'http://127.0.0.1:8000',
|
||||
// target: 'http://127.0.0.1:8000',
|
||||
// target: 'http://192.168.31.102:8000',
|
||||
// target: 'http://222.20.95.239:8000',
|
||||
target: 'http://127.0.0.1:4523/m1/1256020-0-default',
|
||||
// target: 'http://127.0.0.1:8123',
|
||||
changeOrigin: true,
|
||||
pathRewrite: {
|
||||
}
|
||||
|
@ -97,7 +99,7 @@ module.exports = {
|
|||
.use('coffee-loader')
|
||||
.loader('coffee-loader')
|
||||
.end()
|
||||
|
||||
|
||||
|
||||
config
|
||||
.when(process.env.NODE_ENV !== 'development',
|
||||
|
|
Loading…
Reference in New Issue