项目新增等修复

dev_2022-05-11
yujialong 3 years ago
parent b31ac40f29
commit d5ebb17584
  1. 1
      src/api/index.js
  2. 16
      src/layouts/header/index.vue
  3. 6
      src/libs/util.cookies.js
  4. 4
      src/pages/achievement/list/index.vue
  5. 95
      src/pages/project/add/index.vue
  6. 18
      src/pages/project/list/index.vue
  7. 1
      src/setting.js

@ -90,6 +90,7 @@ export default {
saveProjectDraft: `${host}occupationlab/projectManage/saveProjectDraft`, // 新增项目管理
addProjectManage: `${host}occupationlab/projectManage/addProjectManage`, // 新增项目管理
updateProjectManage: `${host}occupationlab/projectManage/updateProjectManage`, // 修改项目管理
editProjectDraft: `${host}occupationlab/projectManage/editProjectDraft`, // 修改项目管理
copyProjectManage: `${host}occupationlab/projectManage/copyProjectManage`, // 复制项目管理
// 判分点

@ -76,11 +76,17 @@ export default {
},
getUserDetail() { //
this.$get(this.api.queryUserInfoDetails).then(res => {
let { userAvatars, userName } = res.result.hrUserInfo;
userAvatars && this.setAvatar(userAvatars);
this.setUserName(userName);
}).catch(res => {
});
let { hrUserInfo } = res.result
if (hrUserInfo) {
const { userAvatars, userName } = hrUserInfo
userAvatars && this.setAvatar(userAvatars)
this.setUserName(userName)
} else {
this.$get(this.api.isClient).then(res => {
res.customerName && this.setUserName(res.customerName)
}).catch(res => {})
}
}).catch(res => {})
},
userCommand(command) { //
if (command == "person") {

@ -14,7 +14,7 @@ cookies.set = function(name = "default", value = "", cookieSetting = {}) {
expires: Setting.cookiesExpires
};
Object.assign(currentCookieSetting, cookieSetting);
Cookies.set(name, value, currentCookieSetting);
Cookies.set(`admin-${name}`, value, currentCookieSetting);
};
/**
@ -22,7 +22,7 @@ cookies.set = function(name = "default", value = "", cookieSetting = {}) {
* @param {String} name cookie name
*/
cookies.get = function(name = "default") {
return Cookies.get(name);
return Cookies.get(`admin-${name}`);
};
/**
@ -37,7 +37,7 @@ cookies.getAll = function() {
* @param {String} name cookie name
*/
cookies.remove = function(name = "default") {
return Cookies.remove(name);
return Cookies.remove(`admin-${name}`);
};
export default cookies;

@ -52,7 +52,7 @@
</el-select>
</li>
<li>
<el-input placeholder="请输入实验项目名称" prefix-icon="el-icon-search" v-model="keyword" clearable></el-input>
<el-input placeholder="请输入考核或项目名称" prefix-icon="el-icon-search" v-model="keyword" clearable></el-input>
</li>
</ul>
</div>
@ -71,7 +71,7 @@
</el-table-column>
<template v-if="projectPermissions == 1">
<el-table-column prop="className" label="班级" align="center" min-width="100"></el-table-column>
<el-table-column prop="experimentalName" label="实验名称" align="center" min-width="400">
<el-table-column prop="experimentalName" label="考核名称" align="center" min-width="400">
<template slot-scope="scope">
<span class="mul-ellipsis2">{{ scope.row.experimentalName }}</span>
</template>

@ -3,10 +3,10 @@
<el-form :disabled="isDetail">
<el-card shadow="hover" class="m-b-20">
<div class="flex-between">
<el-page-header @back="goBack" content="项目配置"></el-page-header>
<el-page-header @back="back" content="项目配置"></el-page-header>
<div v-if="!isDetail">
<el-button v-if="!projectId && item != 0" type="success" @click="handleSubmit(0)">保存为草稿</el-button>
<el-button v-if='item != 0' type="primary" @click="handleSubmit(1)">确定并发布</el-button>
<el-button type="success" @click="handleSubmit(0)">保存为草稿</el-button>
<el-button type="primary" @click="handleSubmit(1)">确定并发布</el-button>
</div>
</div>
</el-card>
@ -14,10 +14,10 @@
<el-card shadow="hover" class="m-b-20">
<h6 class="p-title">基本信息</h6>
<div>
<el-form label-width="80px">
<el-form label-width="80px" :disabled="isDetail">
<div class="flex">
<el-form-item label="系统">
<el-select :disabled="isDetail || item == 0" v-model="projectManage.systemId" placeholder="请选择" @change="systemChange">
<el-select v-model="projectManage.systemId" placeholder="请选择" @change="systemChange">
<el-option
v-for="item in systemList"
:key="item.id"
@ -27,10 +27,10 @@
</el-select>
</el-form-item>
<el-form-item label="项目名称">
<el-input :disabled="isDetail || item == 0" v-model.trim="projectManage.projectName" placeholder="20个字符以内" @blur="projectNameExistis"></el-input>
<el-input v-model.trim="projectManage.projectName" placeholder="20个字符以内" @blur="projectNameExistis"></el-input>
</el-form-item>
<el-form-item label="项目权限">
<el-select :disabled="isDetail || item == 0" v-model="projectManage.permissions" placeholder="请选择" @change="permissionChange">
<el-select v-model="projectManage.permissions" placeholder="请选择" @change="permissionChange">
<el-option label="练习" :value="0"></el-option>
<el-option label="考核" :value="1"></el-option>
<el-option label="竞赛" :value="2"></el-option>
@ -46,7 +46,7 @@
<div>
<el-form label-width="0">
<el-form-item>
<quill :border="true" :readonly="isDetail || item == 0" v-model="projectManage.experimentTarget" :minHeight="150" :height="150" />
<quill :border="true" :readonly="isDetail" v-model="projectManage.experimentTarget" :minHeight="150" :height="150" />
</el-form-item>
</el-form>
</div>
@ -57,7 +57,7 @@
<div>
<el-form label-width="0">
<el-form-item>
<quill :border="true" :readonly="isDetail || item == 0" v-model="projectManage.experimentDescription" :minHeight="150" :height="150" />
<quill :border="true" :readonly="isDetail" v-model="projectManage.experimentDescription" :minHeight="150" :height="150" />
</el-form-item>
</el-form>
</div>
@ -76,13 +76,13 @@
<!-- <div>权重&emsp;<div class="dib"><el-input></el-input></div></div> -->
</div>
<div>
<el-button :disabled="isDetail || item == 0" class="m-r-20" type="text" @click="avgDistributionScore">平均分配分值</el-button>
<el-button :disabled="isDetail || item == 0" class="m-r-20" type="text" @click="manualDistributionScore">手动分配分值</el-button>
<el-button class="m-r-20" type="text" @click="avgDistributionScore">平均分配分值</el-button>
<el-button class="m-r-20" type="text" @click="manualDistributionScore">手动分配分值</el-button>
<span>(待分配分值: {{ handDistributionScore }}/100)</span>
</div>
</div>
<el-button :disabled="isDetail || item == 0" type="primary" icon="el-icon-plus" round @click="handleQueryJudgment" style="margin-bottom: 10px">判分点</el-button>
<el-button :disabled="isDetail || item == 0" type="primary" icon="el-icon-delete" round @click="batchDeleteProjectJudgment" style="margin-bottom: 10px">批量删除</el-button>
<el-button type="primary" icon="el-icon-plus" round @click="handleQueryJudgment" style="margin-bottom: 10px">判分点</el-button>
<el-button type="primary" icon="el-icon-delete" round @click="batchDeleteProjectJudgment" style="margin-bottom: 10px">批量删除</el-button>
<div class="draggable">
<el-table
ref="projectJudgementTable"
@ -110,13 +110,13 @@
<el-table-column prop="score" label="分数" align="center" width="120">
<template slot-scope="scope">
<!--type="number" @blur="updateProjectJudgment"-->
<el-input :disabled="isDetail || item == 0" v-model.trim="scope.row.score" @input="scoreChange(scope.row, scope.$index,$event)"></el-input>
<el-input v-model.trim="scope.row.score" @input="scoreChange(scope.row, scope.$index,$event)"></el-input>
</template>
</el-table-column>
<el-table-column label="操作" width="100" align="center">
<template slot-scope="scope">
<!--<el-button :disabled="isDetail" type="text" style="margin-right: 10px" @click="toJudgePoint('edit', scope.row)">自定义</el-button>-->
<el-button :disabled="isDetail || item == 0" type="text" @click="delJudgePoint(scope.$index)">删除</el-button>
<el-button type="text" @click="delJudgePoint(scope.$index)">删除</el-button>
</template>
</el-table-column>
</el-table>
@ -128,13 +128,13 @@
<h6 class="p-title" style="margin-bottom: 0">实验提示</h6>
<div>
启用
<el-switch :disabled="isDetail || item == 0" :active-value="0" :inactive-value="1" v-model="projectManage.hintOpen"></el-switch>
<el-switch :active-value="0" :inactive-value="1" v-model="projectManage.hintOpen"></el-switch>
</div>
</div>
<div>
<el-form label-width="0">
<el-form-item prop="tips" label="">
<quill :border="true" :readonly="isDetail || item == 0" v-model="projectManage.experimentHint" :minHeight="150" :height="150" />
<quill :border="true" :readonly="isDetail" v-model="projectManage.experimentHint" :minHeight="150" :height="150" />
</el-form-item>
</el-form>
</div>
@ -194,7 +194,6 @@ export default {
data() {
return {
projectId: this.$route.query.projectId,
item: this.$route.query.item,
founder: this.$route.query.founder,
systemList: [],
token: btoa(util.local.get(Setting.tokenKey)),
@ -231,7 +230,8 @@ export default {
isToPoint: false, //
visibleLoading: false, //
listLoading:false,//
submiting: false //
submiting: false, //
updateTime: 0
};
},
computed: {
@ -256,12 +256,13 @@ export default {
}
},
watch: {
// projectJudgmentData: {
// handler(newValue) {
// console.log("newValue", newValue);
// },
// deep: true
// },
// ,
projectManage: {
handler(){
this.updateTime++
},
deep:true
},
judgementpointsquery(n) {
clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(() => {
@ -295,19 +296,6 @@ export default {
...mapActions("project", [
"setSystemId", "setProject"
]),
goBack() { //
if (this.isDetail || this.item == 0) {
this.$router.push(`/project/list?founder=${this.founder}`);
} else {
this.$confirm("确定返回?未更新的信息将不会保存。", "提示", {
type: "warning"
}).then(() => {
this.$router.push(`/project/list?founder=${this.founder}`);
// this.$router.back();
}).catch(() => {
});
}
},
getSystemData() {
this.$get(this.api.getSystemIdBySchool).then(res => {
this.systemList = res.data;
@ -444,7 +432,7 @@ export default {
}
},
updateProject(params) { //
this.$post(`${this.api.updateProjectManage}`, params).then(res => {
this.$post(this.api[params.projectManage.state ? 'updateProjectManage' : 'editProjectDraft'], params).then(res => {
util.successMsg("更新实验项目成功");
this.$router.back();
}).catch(err => {
@ -479,16 +467,6 @@ export default {
});
}
},
// handleMoveUp(index) { //
// let x = index;
// let y = index + 1;
// this.projectJudgmentData.splice(x - 1, 1, ...this.projectJudgmentData.splice(y - 1, 1, this.projectJudgmentData[x - 1]));
// },
// handleMoveDown(index) { //
// let x = index + 1;
// let y = index + 2;
// this.projectJudgmentData.splice(x - 1, 1, ...this.projectJudgmentData.splice(y - 1, 1, this.projectJudgmentData[x - 1]));
// },
scoreChange(row, index, val) { //
this.projectJudgmentData.splice(index, 1, row);
},
@ -698,6 +676,25 @@ export default {
}).catch(err => {
console.log(err);
});
},
//
toList() {
this.$router.push(`/project/list?founder=${this.founder}`)
},
//
back() {
//
if(this.updateTime > 1){
this.$confirm('编辑的内容未保存,是否保存?', "提示", {
type: "warning"
}).then(() => {
this.handleSubmit(this.projectManage.state)
}).catch(() => {
this.toList()
})
} else {
this.toList()
}
}
}
};

@ -67,27 +67,27 @@
<el-table-column type="index" width="100" label="序号" align="center">
<template slot-scope="scope">{{ scope.$index + (page - 1) * pageSize + 1 }}</template>
</el-table-column>
<el-table-column prop="projectName" label="实验项目名称" align="center" show-overflow-tooltip></el-table-column>
<el-table-column prop="founder" label="创建人" width="150" align="center">
<el-table-column prop="projectName" label="实验项目名称" min-width="400" align="center" show-overflow-tooltip></el-table-column>
<el-table-column prop="founder" label="创建人" min-width="150" align="center">
<template slot-scope="scope">
{{ founderKeys[scope.row.founder] }}
</template>
</el-table-column>
<el-table-column label="权限" width="120" align="center">
<el-table-column label="权限" min-width="120" align="center">
<template slot-scope="scope">
{{ permissionsKeys[scope.row.permissions] }}
</template>
</el-table-column>
<el-table-column prop="createTime" label="创建时间" width="150" align="center"></el-table-column>
<el-table-column prop="status" label="状态" width="100" align="center">
<el-table-column prop="createTime" label="创建时间" min-width="150" align="center"></el-table-column>
<el-table-column prop="status" label="状态" min-width="100" align="center">
<template slot-scope="scope">
{{ stateKeys[scope.row.state] }}
</template>
</el-table-column>
<el-table-column label="操作" width="300" align="center">
<template slot-scope="scope">
<el-button type="text" @click="edit(scope.row,'0',queryData.founder)">查看</el-button>
<el-button v-if="scope.row.founder && (roleName.includes('超级') || roleName === scope.row.roleName || (roleName === '管理员' && !scope.row.roleName.includes('超级')))" type="text" @click="edit(scope.row,'1',queryData.founder)">编辑</el-button>
<el-button type="text" @click="edit(scope.row, 1)">查看</el-button>
<el-button v-if="scope.row.founder && (roleName.includes('超级') || roleName === scope.row.roleName || (roleName === '管理员' && !scope.row.roleName.includes('超级')))" type="text" @click="edit(scope.row)">编辑</el-button>
<el-button v-if="scope.row.founder && (roleName.includes('超级') || roleName === scope.row.roleName || (roleName === '管理员' && !scope.row.roleName.includes('超级')))" type="text" @click="handleDelete(scope.row.projectId)">删除</el-button>
<el-button v-if="auth('复制')" type="text" @click="copyData(scope.row.projectId)">复制</el-button>
<el-switch
@ -291,9 +291,9 @@ export default {
this.setSystemId(this.systemId);
this.$router.push(`/project/add?founder=${this.queryData.founder}`);
},
edit(row,item) { //
edit(row, show) { //
this.setSystemId(row.systemId);
this.$router.push(`/project/add?projectId=${row.projectId}&item=${item}&founder=${this.queryData.founder}`);
this.$router.push(`/project/add?projectId=${row.projectId}&founder=${this.queryData.founder}${show ? `&show=1` : ''}`);
},
handleSelectionChange(val) { //
this.multipleSelection = val;

@ -30,6 +30,7 @@ if (isHh) {
// 职站生产
host = "http://www.occupationlab.com:9000/";
bankPath = `http://www.huorantech.cn/banksystem`
jumpPath = `http://www.huorantech.cn/judgmentPoint/`
title = "职站服务端管理系统";
} else if (isTest){
jumpPath = "http://39.108.250.202/judgmentPoint/";

Loading…
Cancel
Save