完善添加课程与添加项目

dev
yujialong 3 years ago
parent 99a7e26020
commit 82d8677731
  1. 6
      package-lock.json
  2. 1
      package.json
  3. 11
      src/utils/api.js
  4. 2
      src/views/course/AddCurriculum.vue
  5. 228
      src/views/serve/projectAdd.vue

6
package-lock.json generated

@ -11381,9 +11381,9 @@
}
},
"sortablejs": {
"version": "1.10.1",
"resolved": "https://registry.npmjs.org/sortablejs/-/sortablejs-1.10.1.tgz",
"integrity": "sha512-N6r7GrVmO8RW1rn0cTdvK3JR0BcqecAJ0PmYMCL3ZuqTH3pY+9QyqkmJSkkLyyDvd+AJnwaxTP22Ybr/83V9hQ=="
"version": "1.14.0",
"resolved": "https://registry.npmjs.org/sortablejs/-/sortablejs-1.14.0.tgz",
"integrity": "sha512-pBXvQCs5/33fdN1/39pPL0NZF20LeRbLQ5jtnheIPN9JQAaufGjKdWduZn4U7wCtVuzKhmRkI0DFYHYRbB2H1w=="
},
"source-list-map": {
"version": "2.0.1",

@ -15,6 +15,7 @@
"mavon-editor": "^2.6.17",
"postcss-px2rem": "^0.3.0",
"px2rem-loader": "^0.1.9",
"sortablejs": "^1.14.0",
"vue": "^2.6.10",
"vue-cropperjs": "^3.0.0",
"vue-pdf": "^4.3.0",

@ -1,6 +1,6 @@
import Setting from '@/setting';
let host = Setting.host;
let uploadURL = "http://8.134.8.197:8001";
let uploadURL = "http://39.108.250.202:10000";
export default {
@ -93,6 +93,9 @@ export default {
// 判分点
getBcJudgmentPoint: `${host}/judgment/bcJudgmentPoint/getBcJudgmentPoint`, // 获取编程类判分点列表(分页)
getLcJudgmentPoint: `${host}/judgment/lcJudgmentPoint/queryAllJudgmentPoint`, // 获取流程类判分点列表(分页)
addProjectJudgment: `${host}occupationlab/projectJudgment/addProjectJudgment`, // 添加项目管理、判分点中间表
updateProjectJudgment: `${host}occupationlab/projectJudgment/updateProjectJudgment`, // 判分点中间表批量更新
deleteProjectJudgment: `${host}occupationlab/projectJudgment/deleteProjectJudgment`, // 判分点中间表批量删除
// 课程管理三级联查
courseDiscipline: `${host}/nakadai/nakadai/subject/courseDiscipline`, //课程学科类别
@ -120,9 +123,9 @@ export default {
// 阿里云文件/视频管理
fileDeletion: `${host}/nakadai/nakadai/oss/fileDeletion`, // 删除OSS文件
fileupload: `${host}/nakadai/nakadai/oss/fileUpload`, // 文件上传
getPlayAuth: `${host}/nakadai/nakadai/oss/getPlayAuth`, // 获取播放凭证
fileDeletion: `${uploadURL}/oss/manage/fileDeletion`, // 删除OSS文件
fileupload: `${uploadURL}/oss/manage/fileUpload`, // 文件上传
getPlayAuth: `${uploadURL}/oss/manage/getPlayAuth`, // 获取播放凭证

@ -100,7 +100,7 @@
<div slot="tip" class="el-upload__tip">
<p>只能上传jpg/png文件</p>
<p>课程封面图将按2:1显示最佳分辨率1400*700</p>
<p>课程封面图将按1:1显示最佳分辨率80*80</p>
</div>
</el-upload>
</el-form-item>

@ -6,7 +6,8 @@
<div class="flex-between">
<el-page-header @back="goBack" content="项目配置"></el-page-header>
<div v-if="!isDetail">
<el-button v-if="!projectId" type="success" size="small" @click="handleSubmit(0)">保存为草稿</el-button>
<el-button v-if="!projectId" type="success" size="small" @click="handleSubmit(0)">保存为草稿
</el-button>
<el-button type="primary" size="small" @click="handleSubmit(1)">确定并发布</el-button>
</div>
</div>
@ -23,10 +24,12 @@
<el-form label-width="80px">
<div style="display: flex">
<el-form-item label="项目名称">
<el-input :disabled="isDetail" v-model.trim="projectManage.projectName" placeholder="20个字符以内" @blur="projectNameExistis"></el-input>
<el-input :disabled="isDetail" v-model.trim="projectManage.projectName"
placeholder="20个字符以内" @blur="projectNameExistis"></el-input>
</el-form-item>
<el-form-item label="项目权限">
<el-select :disabled="isDetail" v-model="projectManage.permissions" placeholder="请选择">
<el-select :disabled="isDetail" v-model="projectManage.permissions"
placeholder="请选择">
<el-option label="练习" :value="0"></el-option>
<el-option label="考核" :value="1"></el-option>
<el-option label="竞赛" :value="2"></el-option>
@ -46,7 +49,8 @@
<div>
<el-form label-width="0">
<el-form-item>
<quill :border="true" :readonly="isDetail" 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>
@ -61,7 +65,8 @@
<div>
<el-form label-width="0">
<el-form-item>
<quill :border="true" :readonly="isDetail" 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>
@ -74,7 +79,8 @@
<span>实验任务</span>
</div>
<div>
<el-button :disabled="isDetail" type="primary" @click="toJudgePoint('home')">进入判分点</el-button>
<el-button :disabled="isDetail" type="primary" @click="toJudgePoint('home')">进入判分点
</el-button>
</div>
</div>
<div class="border-b-dashed"></div>
@ -86,13 +92,22 @@
</div>
<div>
<el-button :disabled="isDetail" class="m-r-20" type="text" @click="avgDistributionScore">平均分配分值</el-button>
<el-button :disabled="isDetail" class="m-r-20" type="text" @click="manualDistributionScore">手动分配分值</el-button>
<el-button :disabled="isDetail" class="m-r-20" type="text" @click="avgDistributionScore">
平均分配分值
</el-button>
<el-button :disabled="isDetail" class="m-r-20" type="text" @click="manualDistributionScore">
手动分配分值
</el-button>
<span>(待分配分值: {{ handDistributionScore }}/100)</span>
</div>
</div>
<el-button :disabled="isDetail" type="primary" icon="el-icon-plus" round @click="handleQueryJudgment" style="margin-bottom: 10px">判分点</el-button>
<el-button :disabled="isDetail" type="primary" icon="el-icon-delete" round @click="batchDeleteProjectJudgment" style="margin-bottom: 10px">批量删除</el-button>
<el-button :disabled="isDetail" type="primary" icon="el-icon-plus" round
@click="handleQueryJudgment" style="margin-bottom: 10px">判分点
</el-button>
<el-button :disabled="isDetail" type="primary" icon="el-icon-delete" round
@click="batchDeleteProjectJudgment" style="margin-bottom: 10px">批量删除
</el-button>
<div class="draggable">
<el-table
ref="projectJudgementTable"
:data="projectJudgmentData"
@ -103,51 +118,38 @@
row-key="judgmentId"
>
<el-table-column type="selection" width="55" align="center"></el-table-column>
<el-table-column prop="id" label="序号" width="80" align="center">
<el-table-column prop="sort" label="序号" width="80" align="center">
<template slot-scope="scope">
{{ scope.$index + 1 }}
{{ scope.row.sort }}
</template>
</el-table-column>
<el-table-column prop="name" label="判分指标" align="center"></el-table-column>
<el-table-column prop="name" label="判分点名称" align="center"></el-table-column>
<el-table-column label="排序" align="center">
<template slot-scope="scope">
<el-button
:disabled="isDetail"
v-show="scope.$index > 0"
type="text"
icon="el-icon-top"
@click="handleMoveUp(scope.$index)"
style="font-size: 24px"
></el-button>
<el-button
:disabled="isDetail"
v-show="(scope.$index+1) < projectJudgmentData.length"
type="text"
icon="el-icon-bottom"
@click="handleMoveDown(scope.$index)"
style="font-size: 24px"
></el-button>
</template>
</el-table-column>
<el-table-column label="实验要求" align="center">
<template slot-scope="scope">
<quill :border="true" :readonly="true" elseRead="true" v-model="scope.row.experimentalRequirements" :minHeight="150" :height="150" />
<quill :border="true" :readonly="true" elseRead="true"
v-model="scope.row.experimentalRequirements" :minHeight="150"
:height="150" />
</template>
</el-table-column>
<el-table-column label="操作" width="140" 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" type="text" @click="delJudgePoint(scope.$index)">删除</el-button>
<el-button :disabled="isDetail" type="text" @click="delJudgePoint(scope.$index)">
删除
</el-button>
</template>
</el-table-column>
<el-table-column prop="score" label="分数" align="center">
<template slot-scope="scope">
<!--type="number"-->
<el-input :disabled="isDetail" v-model.trim="scope.row.score" @input="scoreChange(scope.row, scope.$index)"></el-input>
<el-input :disabled="isDetail" v-model.trim="scope.row.score"
@blur="updateProjectJudgment"
@input="scoreChange(scope.row, scope.$index,$event)"></el-input>
</template>
</el-table-column>
</el-table>
</div>
</el-card>
<el-card shadow="hover" class="mgb20">
@ -158,14 +160,16 @@
</div>
<div>
启用
<el-switch :disabled="isDetail" :active-value="0" :inactive-value="1" v-model="projectManage.hintOpen"></el-switch>
<el-switch :disabled="isDetail" :active-value="0" :inactive-value="1"
v-model="projectManage.hintOpen"></el-switch>
</div>
</div>
<div class="border-b-dashed"></div>
<div>
<el-form label-width="0">
<el-form-item prop="tips" label="">
<quill :border="true" :readonly="isDetail" 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>
@ -175,13 +179,14 @@
<!--选择判分点对话框-->
<el-dialog title="添加判分点" :visible.sync="dialogVisible" width="40%" :close-on-click-modal="false">
<div class="text-right m-b-10">
<div class="text-right mgb10">
<div>
<el-input placeholder="请输入需要查找的判分点" prefix-icon="el-icon-search" v-model.trim="judgementpointsquery" clearable></el-input>
</div>
</div>
<el-table
v-loading="visibleLoading"
:data="judgementData"
ref="judgementTable"
class="table"
@ -215,6 +220,8 @@
<script>
import Setting from "@/setting";
import quill from "@/components/quill";
import Sortable from "sortablejs";
export default {
components: {
quill
@ -222,8 +229,7 @@ export default {
data() {
return {
projectId: this.$route.query.projectId,
systemList: Setting.systemList,
token: btoa(sessionStorage.getItem('token')),
token: btoa(sessionStorage.getItem("token")),
isDetail: Boolean(this.$route.query.show),
projectManage: {
@ -254,7 +260,8 @@ export default {
avgValuelist: [], //
searchTimer: null,
isToPoint: false //
isToPoint: false, //
visibleLoading: false//
};
},
computed: {
@ -302,15 +309,16 @@ export default {
this.getInfoData();
}
//
if (JSON.stringify(this.projectFields) != '{}') {
if (JSON.stringify(this.projectFields) != "{}") {
let { projectManage, projectJudgmentData } = this.projectFields;
this.projectManage = projectManage;
this.projectJudgmentData = projectJudgmentData;
}
this.rowDrop();
},
beforeDestroy() {
if (!this.isToPoint) {
this.$store.dispatch('setProject',{});
this.$store.dispatch("setProject", {});
}
},
methods: {
@ -362,7 +370,7 @@ export default {
type: "warning"
}).then(() => {
this.projectJudgmentData = [];
this.$store.dispatch('setSystemId',this.projectManage.systemId);
this.$store.dispatch("setSystemId", this.projectManage.systemId);
}).catch(() => {
this.projectManage.systemId = this.lastSystemId;
console.log(this.lastSystemId, "this.lastSystemId");
@ -415,7 +423,7 @@ export default {
if (!this.judgmentRelease()) { //
return;
}
this.$store.dispatch('setSystemId',this.projectManage.systemId)
this.$store.dispatch("setSystemId", this.projectManage.systemId);
this.projectManage.state = state;
let tempArr = this.projectJudgmentData.map(i => {
let obj = {
@ -486,12 +494,12 @@ export default {
});
}
},
handleMoveUp(index) { //
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) { //
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]));
@ -553,6 +561,7 @@ export default {
}
},
getProcessClassData(params) { //
this.visibleLoading = true;
this.$post(`${this.api.getLcJudgmentPoint}`, params).then(res => {
if (res.status === 200) {
let list = res.message.records;
@ -561,6 +570,7 @@ export default {
i.judgmentId = i.lcId;
this.projectJudgmentData.find(j => j.judgmentId === i.judgmentId) || result.push(i);
});
this.visibleLoading = false;
this.judgementData = result;
}
}).catch(err => {
@ -568,6 +578,7 @@ export default {
});
},
getProgrammingClassData(params) { //
this.visibleLoading = true;
this.$post(this.api.getBcJudgmentPoint, params).then(res => {
if (res.status === 200) {
let list = res.message.records;
@ -576,9 +587,9 @@ export default {
i.judgmentId = i.bcId;
this.projectJudgmentData.find(j => j.judgmentId === i.judgmentId) || result.push(i);
});
this.visibleLoading = false;
this.judgementData = result;
}
}).catch(err => {
console.log(err);
});
@ -589,34 +600,139 @@ export default {
addJudgment() { //
if (this.selectedJudgment.length) {
this.dialogVisible = false;
if (this.projectId) { //
this.addProjectJudgment();
} else {
//
let tempArr = this.selectedJudgment.map(i => {
i.score = 0;
return i;
});
this.projectJudgmentData = this.projectJudgmentData.concat(tempArr);
this.projectJudgmentData.map((e, i) => {
e.sort = i + 1;
});
this.$nextTick(() => {
this.$refs.projectJudgementTable.clearSelection();
});
}
} else {
this.$message.warning("请选择判分点");
}
},
//
rowDrop() {
//
const tbody = document.querySelector(".draggable .el-table__body-wrapper tbody");
const _this = this;
Sortable.create(tbody, {
//
draggable: ".draggable .el-table__row",
onEnd({ newIndex, oldIndex }) {
let newItem = _this.projectJudgmentData[newIndex];
_this.projectJudgmentData[newIndex] = _this.projectJudgmentData[oldIndex];
_this.projectJudgmentData[oldIndex] = newItem;
//
_this.projectJudgmentData.forEach((e, i) => {
_this.$set(e, "sort", i + 1);//
_this.$set(e, "name", e.name + "?");
_this.$set(e, "name", e.name.slice(0, e.name.length - 1)); //
});
//
if (_this.projectId) {//
_this.updateProjectJudgment();
}
}
});
},
//
addProjectJudgment() {
let param = this.selectedJudgment.map((e, i) => {
let obj = {
judgmentId: e.judgmentId,
projectId: this.projectId || "",
score: 0,
sort: i + 1
};
return obj;
});
console.log(param, "param", this.projectId);
this.$post(this.api.addProjectJudgment, param).then(res => {
//
console.log("添加成功", res);
if (this.projectId) { // idid
this.listAgain();
}
}).catch(err => {
console.log(err);
});
},
//
updateProjectJudgment() {
// data
let param = this.projectJudgmentData.map((e, i) => {
let obj = {
judgmentId: e.judgmentId,
projectId: this.projectId || "",
score: e.score,
sort: i + 1,
id: e.id
};
return obj;
});
this.$post(this.api.updateProjectJudgment, param).then(res => {
//
if (this.projectId) { // idid
this.listAgain();
}
}).catch(err => {
console.log(err);
});
},
//
deleteProjectJudgment(values) {
if (values && values.length > 0) {
this.$post(this.api.deleteProjectJudgment + "?projectJudgmentIds=" + `${values}`).then(res => {
//
if (this.projectId) { // idid
this.listAgain();
}
}).catch(err => {
});
}
},
// ,
listAgain() {
this.$get(`${this.api.getProjectDetail}?projectId=${this.projectId}`).then(res => {
let { projectManage, projectJudgmentVos } = res;
this.projectJudgmentData = projectJudgmentVos;
this.projectJudgmentData.map((e, i) => {
e.sort = i + 1;
});
});
},
handleCacheData() { //
this.isToPoint = true;
this.$store.dispatch('setProject',{ projectManage: this.projectManage, projectJudgmentData: this.projectJudgmentData });
this.$store.dispatch("setProject", {
projectManage: this.projectManage,
projectJudgmentData: this.projectJudgmentData
});
},
toJudgePoint(type, row) { //
this.handleCacheData();
let jumpPath = Setting.jumpPath;
// let jumpPath = "http://192.168.31.154:8087/"; //
let { systemId } = this.projectManage;
let href = "";
if (type === "view") {
//
if (systemId == 2) {
href = `${jumpPath}/#/programOption?id=${row.judgmentPointsId}`;
console.log(systemId);
} else if (systemId == 3) {
href = `${jumpPath}/#/programOptions?id=${row.judgmentPointsId}`;
console.log(systemId);
} else if (systemId == 11) {
//
href = `${jumpPath}/#/Transaction?isView=true&systemId=${systemId}&lcId=${row.judgmentId}&token=${this.token}&referrer=${btoa(location.href)}`;
@ -627,9 +743,9 @@ export default {
} else if (type === "edit") {
//
if (systemId == 2) {
href = `${jumpPath}/#/programOption?id=${row.judgmentPointsId}`;
console.log(systemId);
} else if (systemId == 3) {
href = `${jumpPath}/#/programOptions?id=${row.judgmentPointsId}`;
console.log(systemId);
} else if (systemId == 11) {
//
href = `${jumpPath}/#/Transaction?isEdit=true&systemId=${systemId}&lcId=${row.judgmentId}&token=${this.token}&referrer=${btoa(location.href)}`;
@ -637,7 +753,7 @@ export default {
// python
href = `${jumpPath}/#/program?isEdit=true&systemId=${systemId}&bcId=${row.judgmentId}&token=${this.token}&referrer=${btoa(location.href)}`;
}
} else if (type === 'home') {
} else if (type === "home") {
if (systemId == 2 || systemId == 3) {
href = `${jumpPath}/#/list`;
} else {
@ -648,7 +764,7 @@ export default {
location.href = href;
}
}
}
};
</script>
<style lang="scss" scoped>

Loading…
Cancel
Save