项目保存等修复

dev_2022-05-11
yujialong 3 years ago
parent 66069cfc15
commit b31ac40f29
  1. 1
      src/api/index.js
  2. 6
      src/libs/util.cookies.js
  3. 31
      src/pages/achievement/list/index.vue
  4. 13
      src/pages/assessment/add/index.vue
  5. 62
      src/pages/project/add/index.vue
  6. 2
      src/pages/project/list/index.vue
  7. 8
      src/pages/setting/list/info.vue
  8. 4
      src/setting.js
  9. 1
      src/store/modules/user.js

@ -87,6 +87,7 @@ export default {
queryProjectManage: `${host}occupationlab/projectManage/queryProjectManage`, // 项目管理列表(分页、筛选) queryProjectManage: `${host}occupationlab/projectManage/queryProjectManage`, // 项目管理列表(分页、筛选)
updateIsOpen: `${host}occupationlab/projectManage/updateIsOpen`, // 更新开启状态 updateIsOpen: `${host}occupationlab/projectManage/updateIsOpen`, // 更新开启状态
getProjectDetail: `${host}occupationlab/projectManage/getProjectDetail`, // 根据项目id查询详情 getProjectDetail: `${host}occupationlab/projectManage/getProjectDetail`, // 根据项目id查询详情
saveProjectDraft: `${host}occupationlab/projectManage/saveProjectDraft`, // 新增项目管理
addProjectManage: `${host}occupationlab/projectManage/addProjectManage`, // 新增项目管理 addProjectManage: `${host}occupationlab/projectManage/addProjectManage`, // 新增项目管理
updateProjectManage: `${host}occupationlab/projectManage/updateProjectManage`, // 修改项目管理 updateProjectManage: `${host}occupationlab/projectManage/updateProjectManage`, // 修改项目管理
copyProjectManage: `${host}occupationlab/projectManage/copyProjectManage`, // 复制项目管理 copyProjectManage: `${host}occupationlab/projectManage/copyProjectManage`, // 复制项目管理

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

@ -89,7 +89,7 @@
<el-table-column label="操作" align="center" min-width="300"> <el-table-column label="操作" align="center" min-width="300">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button v-if="auth('练习成绩管理') || auth('考核成绩管理')" type="text" @click="entry(scope.row)">成绩管理</el-button> <el-button v-if="auth('练习成绩管理') || auth('考核成绩管理')" type="text" @click="entry(scope.row)">成绩管理</el-button>
<el-button type="text" v-if="(scope.row.isAdmin === 1 && (scope.row.isDel === 1 || scope.row.courseDel === 1)) || (scope.row.isAdmin === 0 && scope.row.isDel === 1)" @click="handleDelete(scope.row)" >删除</el-button> <el-button type="text" v-if="scope.row.canDel" @click="handleDelete(scope.row)" >删除</el-button>
<el-button type="text" v-else style='color:#999' >删除</el-button> <el-button type="text" v-else style='color:#999' >删除</el-button>
</template> </template>
</el-table-column> </el-table-column>
@ -208,11 +208,12 @@ export default {
this.loadIns = Loading.service({ this.loadIns = Loading.service({
background: "rgba(255,255,255,.6)" background: "rgba(255,255,255,.6)"
}); });
const per = this.projectPermissions
const curriculumId = this.curriculumId const curriculumId = this.curriculumId
const curr = this.curriculumList.find(e => e.cid == curriculumId) const curr = this.curriculumList.find(e => e.cid == curriculumId)
let data = { let data = {
classId: this.classId, classId: this.classId,
permissions: this.projectPermissions, permissions: per,
curriculumId, curriculumId,
keyWord: this.keyword, keyWord: this.keyword,
startTime: this.startingtime, startTime: this.startingtime,
@ -223,22 +224,32 @@ export default {
systemId: curr ? curr.systemId : '' systemId: curr ? curr.systemId : ''
}; };
this.$post(this.api.getAchievementInfo, data).then(res => { this.$post(this.api.getAchievementInfo, data).then(res => {
if(this.projectPermissions == 0){ let list = []
this.listData = res.page; if(per == 0){
this.total = res.total; list = res.page
this.total = res.total
}else{ }else{
this.listData = res.page.records; list = res.page.records
this.total = res.page.total; this.total = res.page.total
} }
console.log(33, per)
list.map(e => {
// isAdmin1 isdel=1courseDel=1 (1. 2.3)isAdmin0isDel1
e.canDel = per ?
e.isDel :
(e.isAdmin === 0 && e.isDel === 1) || (e.isAdmin === 1 && e.isDel === 1 && e.courseDel === 1)
})
this.listData = list
this.$nextTick(() => { this.$nextTick(() => {
this.loadIns.close(); this.loadIns.close()
}); });
}).catch(res => { }).catch(res => {
this.loadIns.close(); this.loadIns.close()
}); });
}, },
perChange(val) { perChange(val) {
this.$router.push(`list?per=${val}`) this.$router.push(`list?per=${val}`)
this.getData()
}, },
initData() { initData() {
this.$refs.table.clearSelection(); this.$refs.table.clearSelection();
@ -246,7 +257,7 @@ export default {
this.getData(); this.getData();
}, },
disabledSelection(row, index) { // disabledSelection(row, index) { //
if ((row.isAdmin === 1 && (row.isDel === 1 || row.courseDel === 1)) || (row.isAdmin === 0 && row.isDel === 1)) return true if (row.canDel) return true
return false return false
}, },
// //

@ -39,11 +39,11 @@
<!-- 手动发布显示 --> <!-- 手动发布显示 -->
<div class="date-inputs" v-if="form.type==1"> <div class="date-inputs" v-if="form.type==1">
实验时长 实验时长
<el-input v-model.trim="duration.day" placeholder></el-input> <el-input type="number" v-model.trim="duration.day" placeholder></el-input>
<el-input v-model.trim="duration.hour" placeholder></el-input> <el-input type="number" v-model.trim="duration.hour" placeholder></el-input>
小时 小时
<el-input v-model.trim="duration.minute" placeholder></el-input> <el-input type="number" v-model.trim="duration.minute" placeholder></el-input>
</div> </div>
<!-- 定时发布显示 --> <!-- 定时发布显示 -->
@ -434,11 +434,18 @@ export default {
} }
if (this.form.type == 1 && this.form.experimentDuration == "0d0h0m") return util.warningMsg("请填写实验时长"); if (this.form.type == 1 && this.form.experimentDuration == "0d0h0m") return util.warningMsg("请填写实验时长");
if (this.form.type == 2 && this.startTime == "0000-00-00 00:00:00") return util.warningMsg("请填写实验时间"); if (this.form.type == 2 && this.startTime == "0000-00-00 00:00:00") return util.warningMsg("请填写实验时间");
if (this.form.type == 1) {
const duration = this.duration
if (String(duration.day).includes('.')) return util.warningMsg('实验天数请填写整数')
if (String(duration.hour).includes('.')) return util.warningMsg('实验小时请填写整数')
if (String(duration.minute).includes('.')) return util.warningMsg('实验分钟请填写整数')
}
if (!this.form.projectId) return util.warningMsg("请选择实训项目"); if (!this.form.projectId) return util.warningMsg("请选择实训项目");
if (this.form.isSpecify == 0 && this.form.isEnableCode == 1) { if (this.form.isSpecify == 0 && this.form.isEnableCode == 1) {
if (!this.form.invitationCode) return util.warningMsg("请设置邀请码"); if (!this.form.invitationCode) return util.warningMsg("请设置邀请码");
if (!this.form.invitationCode || String(this.form.invitationCode).length < 6 || isNaN(this.form.invitationCode)) return util.warningMsg("请输入6位纯数字邀请码"); if (!this.form.invitationCode || String(this.form.invitationCode).length < 6 || isNaN(this.form.invitationCode)) return util.warningMsg("请输入6位纯数字邀请码");
} }
debugger
if (this.form.type == 2) { if (this.form.type == 2) {
this.form.startTime = this.startTime; this.form.startTime = this.startTime;
this.form.stopTime = this.stopTime; this.form.stopTime = this.stopTime;

@ -16,16 +16,6 @@
<div> <div>
<el-form label-width="80px"> <el-form label-width="80px">
<div class="flex"> <div class="flex">
<el-form-item label="项目名称">
<el-input :disabled="isDetail || item == 0" 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-option label="练习" :value="0"></el-option>
<el-option label="考核" :value="1"></el-option>
<el-option label="竞赛" :value="2"></el-option>
</el-select>
</el-form-item>
<el-form-item label="系统"> <el-form-item label="系统">
<el-select :disabled="isDetail || item == 0" v-model="projectManage.systemId" placeholder="请选择" @change="systemChange"> <el-select :disabled="isDetail || item == 0" v-model="projectManage.systemId" placeholder="请选择" @change="systemChange">
<el-option <el-option
@ -36,6 +26,16 @@
></el-option> ></el-option>
</el-select> </el-select>
</el-form-item> </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-form-item>
<el-form-item label="项目权限">
<el-select :disabled="isDetail || item == 0" 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>
</el-select>
</el-form-item>
</div> </div>
</el-form> </el-form>
</div> </div>
@ -222,6 +222,7 @@ export default {
selectedJudgment: [], // selectedJudgment: [], //
rowKey: "", // Key rowKey: "", // Key
projectNameRepeat: false, // projectNameRepeat: false, //
originName: '',
flag: false, // flag: false, //
avgValuelist: [], // avgValuelist: [], //
@ -316,6 +317,7 @@ export default {
this.$get(`${this.api.getProjectDetail}?projectId=${this.projectId}`).then(res => { this.$get(`${this.api.getProjectDetail}?projectId=${this.projectId}`).then(res => {
let { projectManage, projectJudgmentVos } = res; let { projectManage, projectJudgmentVos } = res;
this.projectManage = projectManage; this.projectManage = projectManage;
this.originName = projectManage.projectName
this.projectJudgmentData = projectJudgmentVos; this.projectJudgmentData = projectJudgmentVos;
this.projectJudgmentData.forEach((e, i) => { this.projectJudgmentData.forEach((e, i) => {
e.sort = i + 1; e.sort = i + 1;
@ -328,16 +330,17 @@ export default {
}); });
}, },
projectNameExistis() { // projectNameExistis() { //
if (this.projectManage.projectName) { const { projectName } = this.projectManage
this.$post(this.api.queryNameIsExist, { projectName: this.projectManage.projectName }).then(res => { if (this.originName === projectName) {
this.projectNameRepeat = false
} else {
this.$post(this.api.queryNameIsExist, { projectName }).then(res => {
if (res.status === 200) { if (res.status === 200) {
this.projectNameRepeat = false; this.projectNameRepeat = false
} }
}).catch(err => { }).catch(err => {
this.projectNameRepeat = true; this.projectNameRepeat = true
}); })
} else {
this.projectNameRepeat = false;
} }
}, },
systemChange() { // systemChange() { //
@ -353,7 +356,11 @@ export default {
}); });
} }
}, },
judgmentRelease() { // //
removeTag(val) {
return val.replace('<p><br></p>', '')
},
judgmentRelease(state) { //
let { let {
projectName, projectName,
experimentTarget, experimentTarget,
@ -369,11 +376,12 @@ export default {
util.warningMsg("该项目名称已存在"); util.warningMsg("该项目名称已存在");
return false; return false;
} }
if (!experimentTarget) { if (state) {
if (!experimentTarget || !this.removeTag(experimentTarget)) {
util.warningMsg("请输入实验目标"); util.warningMsg("请输入实验目标");
return false; return false;
} }
if (!experimentDescription) { if (!experimentDescription || !this.removeTag(experimentDescription)) {
util.warningMsg("请输入案例描述"); util.warningMsg("请输入案例描述");
return false; return false;
} }
@ -389,15 +397,16 @@ export default {
util.warningMsg("判分点分数已超过100"); util.warningMsg("判分点分数已超过100");
return false; return false;
} }
if (!experimentHint && hintOpen == 0) { if ((!experimentHint || !this.removeTag(experimentHint)) && hintOpen == 0) {
util.warningMsg("请输入实验提示"); util.warningMsg("请输入实验提示");
return false; return false;
} }
}
return true; return true;
}, },
handleSubmit(state) { // handleSubmit(state) { //
if (this.submiting) return false if (this.submiting) return false
if (!this.judgmentRelease()) { // if (!this.judgmentRelease(state)) { //
return; return;
} }
this.submiting = true this.submiting = true
@ -443,7 +452,8 @@ export default {
}); });
}, },
addProject(params) { // addProject(params) { //
this.$post(`${this.api.addProjectManage}`, params).then(res => { console.log("🚀 ~ file: index.vue ~ line 448 ~ addProject ~ params", params)
this.$post(this.api[params.projectManage.state ? 'addProjectManage' : 'saveProjectDraft'], params).then(res => {
util.successMsg("添加实验项目成功"); util.successMsg("添加实验项目成功");
this.$router.back(); this.$router.back();
}).catch(err => { }).catch(err => {
@ -543,7 +553,7 @@ export default {
this.visibleLoading = false; this.visibleLoading = false;
this.judgementData = result; this.judgementData = result;
}).catch(err => { }).catch(err => {
console.log(err); this.visibleLoading = false
}); });
}, },
getProgrammingClassData(params) { // getProgrammingClassData(params) { //
@ -556,10 +566,8 @@ export default {
}); });
this.visibleLoading = false; this.visibleLoading = false;
this.judgementData = result; this.judgementData = result;
// console.log(res, "res");
// console.log(this.projectJudgmentData, "projectJudgmentData");
}).catch(err => { }).catch(err => {
console.log(err); this.visibleLoading = false
}); });
}, },
handleSelectionJudgment(val) { // handleSelectionJudgment(val) { //

@ -91,7 +91,7 @@
<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="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-button v-if="auth('复制')" type="text" @click="copyData(scope.row.projectId)">复制</el-button>
<el-switch <el-switch
v-if="auth('禁用')" v-if="auth('禁用') && scope.row.state"
v-model="scope.row.ccupationlabOpen" v-model="scope.row.ccupationlabOpen"
:active-text="scope.row.ccupationlabOpen ? '关闭' : '启用'" :active-text="scope.row.ccupationlabOpen ? '关闭' : '启用'"
:active-value="0" :active-value="0"

@ -64,8 +64,8 @@
</el-date-picker> </el-date-picker>
</li> </li>
<li> <li>
<label></label> <label>身份</label>
<el-input onkeyup="value=value.replace(/[^\w\.\/]/ig,'')" id="idnumber" class="idnumber" placeholder="请输入证" type="text" v-model="personalInformation.idNumber" /> <el-input onkeyup="value=value.replace(/[^\w\.\/]/ig,'')" id="idnumber" class="idnumber" placeholder="请输入身份证" type="text" v-model="personalInformation.idNumber" />
</li> </li>
</div> </div>
<div class="line info"> <div class="line info">
@ -77,7 +77,7 @@
</li> </li>
<li> <li>
<label>当前所在学校</label> <label>当前所在学校</label>
<el-input size="small" placeholder="请输入学校" v-model="personalInformation.schoolName" clearable></el-input> <el-input size="small" readonly placeholder="请输入学校" v-model="personalInformation.schoolName" clearable></el-input>
</li> </li>
</div> </div>
</ul> </ul>
@ -776,7 +776,7 @@ export default {
// }); // });
// if (isEmpty) return util.warningMsg(""); // if (isEmpty) return util.warningMsg("");
// if (this.accountReapeat) return util.warningMsg(""); // if (this.accountReapeat) return util.warningMsg("");
if (this.personalInformation.idNumber && !/(^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$)/.test(this.personalInformation.idNumber)) return util.warningMsg("请输入正确的证号码"); if (this.personalInformation.idNumber && !/(^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$)/.test(this.personalInformation.idNumber)) return util.warningMsg("请输入正确的身份证号码");
let form = this.personalInformation; let form = this.personalInformation;
let personalFileList = []; let personalFileList = [];
this.archivesList.forEach((n, k) => { this.archivesList.forEach((n, k) => {

@ -40,8 +40,8 @@ if (isHh) {
jumpPath = "http://192.168.31.125:8087/"; jumpPath = "http://192.168.31.125:8087/";
bankPath = `http://192.168.31.125:8093` bankPath = `http://192.168.31.125:8093`
// host = "http://www.occupationlab.com:9000/";//线上 // host = "http://www.occupationlab.com:9000/";//线上
host = "http://39.108.250.202:9000/"; // 中台测试服 // host = "http://39.108.250.202:9000/"; // 中台测试服
// host = "http://192.168.31.151:9000/"; // 榕 host = "http://192.168.31.151:9000/"; // 榕
// host = 'http://192.168.31.137:9000/'; // 赓 // host = 'http://192.168.31.137:9000/'; // 赓
title = "职站服务端管理系统"; title = "职站服务端管理系统";
} else { } else {

@ -89,6 +89,7 @@ export default {
util.local.remove(Setting.storeKey); util.local.remove(Setting.storeKey);
util.local.remove(Setting.tokenKey); util.local.remove(Setting.tokenKey);
if (state.fromClient) { if (state.fromClient) {
util.cookies.remove('serverLogin')
location.href = Setting.isDev location.href = Setting.isDev
? `http://192.168.31.125:8082/#/` ? `http://192.168.31.125:8082/#/`
: Setting.isTest : Setting.isTest

Loading…
Cancel
Save