项目保存等修复

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`, // 项目管理列表(分页、筛选)
updateIsOpen: `${host}occupationlab/projectManage/updateIsOpen`, // 更新开启状态
getProjectDetail: `${host}occupationlab/projectManage/getProjectDetail`, // 根据项目id查询详情
saveProjectDraft: `${host}occupationlab/projectManage/saveProjectDraft`, // 新增项目管理
addProjectManage: `${host}occupationlab/projectManage/addProjectManage`, // 新增项目管理
updateProjectManage: `${host}occupationlab/projectManage/updateProjectManage`, // 修改项目管理
copyProjectManage: `${host}occupationlab/projectManage/copyProjectManage`, // 复制项目管理

@ -14,7 +14,7 @@ cookies.set = function(name = "default", value = "", cookieSetting = {}) {
expires: Setting.cookiesExpires
};
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
*/
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
*/
cookies.remove = function(name = "default") {
return Cookies.remove(`admin-${name}`);
return Cookies.remove(name);
};
export default cookies;

@ -89,7 +89,7 @@
<el-table-column label="操作" align="center" min-width="300">
<template slot-scope="scope">
<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>
</template>
</el-table-column>
@ -208,11 +208,12 @@ export default {
this.loadIns = Loading.service({
background: "rgba(255,255,255,.6)"
});
const per = this.projectPermissions
const curriculumId = this.curriculumId
const curr = this.curriculumList.find(e => e.cid == curriculumId)
let data = {
classId: this.classId,
permissions: this.projectPermissions,
permissions: per,
curriculumId,
keyWord: this.keyword,
startTime: this.startingtime,
@ -223,22 +224,32 @@ export default {
systemId: curr ? curr.systemId : ''
};
this.$post(this.api.getAchievementInfo, data).then(res => {
if(this.projectPermissions == 0){
this.listData = res.page;
this.total = res.total;
let list = []
if(per == 0){
list = res.page
this.total = res.total
}else{
this.listData = res.page.records;
this.total = res.page.total;
list = res.page.records
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.loadIns.close();
this.loadIns.close()
});
}).catch(res => {
this.loadIns.close();
this.loadIns.close()
});
},
perChange(val) {
this.$router.push(`list?per=${val}`)
this.getData()
},
initData() {
this.$refs.table.clearSelection();
@ -246,7 +257,7 @@ export default {
this.getData();
},
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
},
//

@ -39,11 +39,11 @@
<!-- 手动发布显示 -->
<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>
<!-- 定时发布显示 -->
@ -434,11 +434,18 @@ export default {
}
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 == 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.isSpecify == 0 && this.form.isEnableCode == 1) {
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位纯数字邀请码");
}
debugger
if (this.form.type == 2) {
this.form.startTime = this.startTime;
this.form.stopTime = this.stopTime;

@ -16,16 +16,6 @@
<div>
<el-form label-width="80px">
<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-select :disabled="isDetail || item == 0" v-model="projectManage.systemId" placeholder="请选择" @change="systemChange">
<el-option
@ -36,6 +26,16 @@
></el-option>
</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-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>
</el-form>
</div>
@ -222,6 +222,7 @@ export default {
selectedJudgment: [], //
rowKey: "", // Key
projectNameRepeat: false, //
originName: '',
flag: false, //
avgValuelist: [], //
@ -316,6 +317,7 @@ export default {
this.$get(`${this.api.getProjectDetail}?projectId=${this.projectId}`).then(res => {
let { projectManage, projectJudgmentVos } = res;
this.projectManage = projectManage;
this.originName = projectManage.projectName
this.projectJudgmentData = projectJudgmentVos;
this.projectJudgmentData.forEach((e, i) => {
e.sort = i + 1;
@ -328,16 +330,17 @@ export default {
});
},
projectNameExistis() { //
if (this.projectManage.projectName) {
this.$post(this.api.queryNameIsExist, { projectName: this.projectManage.projectName }).then(res => {
const { projectName } = this.projectManage
if (this.originName === projectName) {
this.projectNameRepeat = false
} else {
this.$post(this.api.queryNameIsExist, { projectName }).then(res => {
if (res.status === 200) {
this.projectNameRepeat = false;
this.projectNameRepeat = false
}
}).catch(err => {
this.projectNameRepeat = true;
});
} else {
this.projectNameRepeat = false;
this.projectNameRepeat = true
})
}
},
systemChange() { //
@ -353,7 +356,11 @@ export default {
});
}
},
judgmentRelease() { //
//
removeTag(val) {
return val.replace('<p><br></p>', '')
},
judgmentRelease(state) { //
let {
projectName,
experimentTarget,
@ -369,11 +376,12 @@ export default {
util.warningMsg("该项目名称已存在");
return false;
}
if (!experimentTarget) {
if (state) {
if (!experimentTarget || !this.removeTag(experimentTarget)) {
util.warningMsg("请输入实验目标");
return false;
}
if (!experimentDescription) {
if (!experimentDescription || !this.removeTag(experimentDescription)) {
util.warningMsg("请输入案例描述");
return false;
}
@ -389,15 +397,16 @@ export default {
util.warningMsg("判分点分数已超过100");
return false;
}
if (!experimentHint && hintOpen == 0) {
if ((!experimentHint || !this.removeTag(experimentHint)) && hintOpen == 0) {
util.warningMsg("请输入实验提示");
return false;
}
}
return true;
},
handleSubmit(state) { //
if (this.submiting) return false
if (!this.judgmentRelease()) { //
if (!this.judgmentRelease(state)) { //
return;
}
this.submiting = true
@ -443,7 +452,8 @@ export default {
});
},
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("添加实验项目成功");
this.$router.back();
}).catch(err => {
@ -543,7 +553,7 @@ export default {
this.visibleLoading = false;
this.judgementData = result;
}).catch(err => {
console.log(err);
this.visibleLoading = false
});
},
getProgrammingClassData(params) { //
@ -556,10 +566,8 @@ export default {
});
this.visibleLoading = false;
this.judgementData = result;
// console.log(res, "res");
// console.log(this.projectJudgmentData, "projectJudgmentData");
}).catch(err => {
console.log(err);
this.visibleLoading = false
});
},
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="auth('复制')" type="text" @click="copyData(scope.row.projectId)">复制</el-button>
<el-switch
v-if="auth('禁用')"
v-if="auth('禁用') && scope.row.state"
v-model="scope.row.ccupationlabOpen"
:active-text="scope.row.ccupationlabOpen ? '关闭' : '启用'"
:active-value="0"

@ -64,8 +64,8 @@
</el-date-picker>
</li>
<li>
<label></label>
<el-input onkeyup="value=value.replace(/[^\w\.\/]/ig,'')" id="idnumber" class="idnumber" placeholder="请输入证" type="text" v-model="personalInformation.idNumber" />
<label>身份</label>
<el-input onkeyup="value=value.replace(/[^\w\.\/]/ig,'')" id="idnumber" class="idnumber" placeholder="请输入身份证" type="text" v-model="personalInformation.idNumber" />
</li>
</div>
<div class="line info">
@ -77,7 +77,7 @@
</li>
<li>
<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>
</div>
</ul>
@ -776,7 +776,7 @@ export default {
// });
// if (isEmpty) 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 personalFileList = [];
this.archivesList.forEach((n, k) => {

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

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

Loading…
Cancel
Save