|
|
@ -3,10 +3,10 @@ |
|
|
|
<el-form :disabled="isDetail"> |
|
|
|
<el-form :disabled="isDetail"> |
|
|
|
<el-card shadow="hover" class="m-b-20"> |
|
|
|
<el-card shadow="hover" class="m-b-20"> |
|
|
|
<div class="flex-between"> |
|
|
|
<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"> |
|
|
|
<div v-if="!isDetail"> |
|
|
|
<el-button v-if="!projectId && item != 0" type="success" @click="handleSubmit(0)">保存为草稿</el-button> |
|
|
|
<el-button type="success" @click="handleSubmit(0)">保存为草稿</el-button> |
|
|
|
<el-button v-if='item != 0' type="primary" @click="handleSubmit(1)">确定并发布</el-button> |
|
|
|
<el-button type="primary" @click="handleSubmit(1)">确定并发布</el-button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</el-card> |
|
|
|
</el-card> |
|
|
@ -14,10 +14,10 @@ |
|
|
|
<el-card shadow="hover" class="m-b-20"> |
|
|
|
<el-card shadow="hover" class="m-b-20"> |
|
|
|
<h6 class="p-title">基本信息</h6> |
|
|
|
<h6 class="p-title">基本信息</h6> |
|
|
|
<div> |
|
|
|
<div> |
|
|
|
<el-form label-width="80px"> |
|
|
|
<el-form label-width="80px" :disabled="isDetail"> |
|
|
|
<div class="flex"> |
|
|
|
<div class="flex"> |
|
|
|
<el-form-item label="系统"> |
|
|
|
<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 |
|
|
|
<el-option |
|
|
|
v-for="item in systemList" |
|
|
|
v-for="item in systemList" |
|
|
|
:key="item.id" |
|
|
|
:key="item.id" |
|
|
@ -27,10 +27,10 @@ |
|
|
|
</el-select> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="项目名称"> |
|
|
|
<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> |
|
|
|
<el-form-item label="项目权限"> |
|
|
|
<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="0"></el-option> |
|
|
|
<el-option label="考核" :value="1"></el-option> |
|
|
|
<el-option label="考核" :value="1"></el-option> |
|
|
|
<el-option label="竞赛" :value="2"></el-option> |
|
|
|
<el-option label="竞赛" :value="2"></el-option> |
|
|
@ -46,7 +46,7 @@ |
|
|
|
<div> |
|
|
|
<div> |
|
|
|
<el-form label-width="0"> |
|
|
|
<el-form label-width="0"> |
|
|
|
<el-form-item> |
|
|
|
<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-item> |
|
|
|
</el-form> |
|
|
|
</el-form> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@ -57,7 +57,7 @@ |
|
|
|
<div> |
|
|
|
<div> |
|
|
|
<el-form label-width="0"> |
|
|
|
<el-form label-width="0"> |
|
|
|
<el-form-item> |
|
|
|
<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-item> |
|
|
|
</el-form> |
|
|
|
</el-form> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@ -76,13 +76,13 @@ |
|
|
|
<!-- <div>权重 <div class="dib"><el-input></el-input></div></div> --> |
|
|
|
<!-- <div>权重 <div class="dib"><el-input></el-input></div></div> --> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div> |
|
|
|
<div> |
|
|
|
<el-button :disabled="isDetail || item == 0" class="m-r-20" type="text" @click="avgDistributionScore">平均分配分值</el-button> |
|
|
|
<el-button 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="manualDistributionScore">手动分配分值</el-button> |
|
|
|
<span>(待分配分值: {{ handDistributionScore }}/100分)</span> |
|
|
|
<span>(待分配分值: {{ handDistributionScore }}/100分)</span> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</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 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-delete" round @click="batchDeleteProjectJudgment" style="margin-bottom: 10px">批量删除</el-button> |
|
|
|
<div class="draggable"> |
|
|
|
<div class="draggable"> |
|
|
|
<el-table |
|
|
|
<el-table |
|
|
|
ref="projectJudgementTable" |
|
|
|
ref="projectJudgementTable" |
|
|
@ -110,13 +110,13 @@ |
|
|
|
<el-table-column prop="score" label="分数" align="center" width="120"> |
|
|
|
<el-table-column prop="score" label="分数" align="center" width="120"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<!--type="number" @blur="updateProjectJudgment"--> |
|
|
|
<!--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> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="操作" width="100" align="center"> |
|
|
|
<el-table-column label="操作" width="100" align="center"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<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" 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> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
</el-table> |
|
|
@ -128,13 +128,13 @@ |
|
|
|
<h6 class="p-title" style="margin-bottom: 0">实验提示</h6> |
|
|
|
<h6 class="p-title" style="margin-bottom: 0">实验提示</h6> |
|
|
|
<div> |
|
|
|
<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> |
|
|
|
</div> |
|
|
|
<div> |
|
|
|
<div> |
|
|
|
<el-form label-width="0"> |
|
|
|
<el-form label-width="0"> |
|
|
|
<el-form-item prop="tips" label=""> |
|
|
|
<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-item> |
|
|
|
</el-form> |
|
|
|
</el-form> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@ -194,7 +194,6 @@ export default { |
|
|
|
data() { |
|
|
|
data() { |
|
|
|
return { |
|
|
|
return { |
|
|
|
projectId: this.$route.query.projectId, |
|
|
|
projectId: this.$route.query.projectId, |
|
|
|
item: this.$route.query.item, |
|
|
|
|
|
|
|
founder: this.$route.query.founder, |
|
|
|
founder: this.$route.query.founder, |
|
|
|
systemList: [], |
|
|
|
systemList: [], |
|
|
|
token: btoa(util.local.get(Setting.tokenKey)), |
|
|
|
token: btoa(util.local.get(Setting.tokenKey)), |
|
|
@ -231,7 +230,8 @@ export default { |
|
|
|
isToPoint: false, // 判断是否是跳转到判分点系统 |
|
|
|
isToPoint: false, // 判断是否是跳转到判分点系统 |
|
|
|
visibleLoading: false, // 加载弹框 |
|
|
|
visibleLoading: false, // 加载弹框 |
|
|
|
listLoading:false,// 列表加载 |
|
|
|
listLoading:false,// 列表加载 |
|
|
|
submiting: false // 新增编辑员工防抖标识 |
|
|
|
submiting: false, // 新增编辑员工防抖标识 |
|
|
|
|
|
|
|
updateTime: 0 |
|
|
|
}; |
|
|
|
}; |
|
|
|
}, |
|
|
|
}, |
|
|
|
computed: { |
|
|
|
computed: { |
|
|
@ -256,12 +256,13 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
watch: { |
|
|
|
watch: { |
|
|
|
// projectJudgmentData: { |
|
|
|
// 监听信息是否有更改,有的话页面离开的时候要询问是否要保存 |
|
|
|
// handler(newValue) { |
|
|
|
projectManage: { |
|
|
|
// console.log("newValue:", newValue); |
|
|
|
handler(){ |
|
|
|
// }, |
|
|
|
this.updateTime++ |
|
|
|
// deep: true |
|
|
|
}, |
|
|
|
// }, |
|
|
|
deep:true |
|
|
|
|
|
|
|
}, |
|
|
|
judgementpointsquery(n) { |
|
|
|
judgementpointsquery(n) { |
|
|
|
clearTimeout(this.searchTimer); |
|
|
|
clearTimeout(this.searchTimer); |
|
|
|
this.searchTimer = setTimeout(() => { |
|
|
|
this.searchTimer = setTimeout(() => { |
|
|
@ -295,19 +296,6 @@ export default { |
|
|
|
...mapActions("project", [ |
|
|
|
...mapActions("project", [ |
|
|
|
"setSystemId", "setProject" |
|
|
|
"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() { |
|
|
|
getSystemData() { |
|
|
|
this.$get(this.api.getSystemIdBySchool).then(res => { |
|
|
|
this.$get(this.api.getSystemIdBySchool).then(res => { |
|
|
|
this.systemList = res.data; |
|
|
|
this.systemList = res.data; |
|
|
@ -444,7 +432,7 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
updateProject(params) { // 更新项目 |
|
|
|
updateProject(params) { // 更新项目 |
|
|
|
this.$post(`${this.api.updateProjectManage}`, params).then(res => { |
|
|
|
this.$post(this.api[params.projectManage.state ? 'updateProjectManage' : 'editProjectDraft'], params).then(res => { |
|
|
|
util.successMsg("更新实验项目成功"); |
|
|
|
util.successMsg("更新实验项目成功"); |
|
|
|
this.$router.back(); |
|
|
|
this.$router.back(); |
|
|
|
}).catch(err => { |
|
|
|
}).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) { // 暂时解决,输入分数,页面没有更新 |
|
|
|
scoreChange(row, index, val) { // 暂时解决,输入分数,页面没有更新 |
|
|
|
this.projectJudgmentData.splice(index, 1, row); |
|
|
|
this.projectJudgmentData.splice(index, 1, row); |
|
|
|
}, |
|
|
|
}, |
|
|
@ -698,6 +676,25 @@ export default { |
|
|
|
}).catch(err => { |
|
|
|
}).catch(err => { |
|
|
|
console.log(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() |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|