格试化代码

dev_2022-05-11
yujialong 3 years ago
parent 365ec55cb5
commit 76b0820e1e
  1. 106
      src/pages/project/add/index.vue
  2. 2
      src/setting.js

@ -83,7 +83,7 @@
</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-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-delete" round @click="batchDeleteProjectJudgment" style="margin-bottom: 10px">批量删除</el-button>
<div class="draggable" style="padding: 20px"> <div class="draggable">
<el-table <el-table
ref="projectJudgementTable" ref="projectJudgementTable"
:data="projectJudgmentData" :data="projectJudgmentData"
@ -183,7 +183,8 @@ import Setting from "@/setting";
import util from "@/libs/util"; import util from "@/libs/util";
import { mapState, mapActions } from "vuex"; import { mapState, mapActions } from "vuex";
import quill from "@/components/quill"; import quill from "@/components/quill";
import Sortable from 'sortablejs'; import Sortable from "sortablejs";
export default { export default {
components: { components: {
quill quill
@ -223,7 +224,7 @@ export default {
searchTimer: null, searchTimer: null,
isToPoint: false, // isToPoint: false, //
visibleLoading:false,// visibleLoading: false//
}; };
}, },
computed: { computed: {
@ -243,7 +244,7 @@ export default {
// util.warningMsg(res.message); // util.warningMsg(res.message);
util.errorMsg("分配的数值已超过100"); util.errorMsg("分配的数值已超过100");
} }
console.log('chuli') console.log("chuli");
return score; return score;
} }
}, },
@ -263,7 +264,6 @@ export default {
}, },
created() { created() {
this.getSystemData(); this.getSystemData();
console.log(this.projectManage.systemId, "this.projectManage.systemId", this.lastSystemId);
}, },
mounted() { mounted() {
if (this.$route.query.projectId) { if (this.$route.query.projectId) {
@ -276,7 +276,7 @@ export default {
this.projectManage = projectManage; this.projectManage = projectManage;
this.projectJudgmentData = projectJudgmentData; this.projectJudgmentData = projectJudgmentData;
} }
this.rowDrop() this.rowDrop();
}, },
beforeDestroy() { beforeDestroy() {
if (!this.isToPoint) { if (!this.isToPoint) {
@ -311,8 +311,8 @@ export default {
this.projectManage = projectManage; this.projectManage = projectManage;
this.projectJudgmentData = projectJudgmentVos; this.projectJudgmentData = projectJudgmentVos;
this.projectJudgmentData.forEach((e, i) => { this.projectJudgmentData.forEach((e, i) => {
e.sort = i+1 e.sort = i + 1;
}) });
} else { } else {
util.warningMsg(res.message); util.warningMsg(res.message);
} }
@ -344,7 +344,7 @@ export default {
this.setSystemId(this.projectManage.systemId); this.setSystemId(this.projectManage.systemId);
}).catch(() => { }).catch(() => {
this.projectManage.systemId = this.lastSystemId; this.projectManage.systemId = this.lastSystemId;
console.log(this.lastSystemId, "this.lastSystemId"); // console.log(this.lastSystemId, "this.lastSystemId");
}); });
} }
}, },
@ -462,7 +462,7 @@ export default {
item.score = res.data[index]; item.score = res.data[index];
return item; return item;
}); });
this.updateProjectJudgment() this.updateProjectJudgment();
} }
}); });
} }
@ -485,7 +485,7 @@ export default {
type: "warning" type: "warning"
}).then(() => { }).then(() => {
if (this.projectId) { if (this.projectId) {
this.deleteProjectJudgment([this.projectJudgmentData[index].id]) this.deleteProjectJudgment([this.projectJudgmentData[index].id]);
} else { } else {
this.projectJudgmentData.splice(index, 1); this.projectJudgmentData.splice(index, 1);
} }
@ -502,8 +502,8 @@ export default {
}).then(() => { }).then(() => {
// this.projectJudgmentData.splice(index, 1); // this.projectJudgmentData.splice(index, 1);
if (this.projectId) {// if (this.projectId) {//
let param = this.selectedProjectJudgment.map(e=>e.id) let param = this.selectedProjectJudgment.map(e => e.id);
this.deleteProjectJudgment(param)// this.deleteProjectJudgment(param);//
} else { } else {
let list = this.projectJudgmentData; let list = this.projectJudgmentData;
let result = []; let result = [];
@ -543,7 +543,7 @@ export default {
} }
}, },
getProcessClassData(params) { // getProcessClassData(params) { //
this.visibleLoading = true this.visibleLoading = true;
this.$post(`${this.api.getLcJudgmentPoint}`, params).then(res => { this.$post(`${this.api.getLcJudgmentPoint}`, params).then(res => {
if (res.status === 200) { if (res.status === 200) {
let list = res.message.records; let list = res.message.records;
@ -552,7 +552,7 @@ export default {
i.judgmentId = i.lcId; i.judgmentId = i.lcId;
this.projectJudgmentData.find(j => j.judgmentId === i.judgmentId) || result.push(i); this.projectJudgmentData.find(j => j.judgmentId === i.judgmentId) || result.push(i);
}); });
this.visibleLoading = false this.visibleLoading = false;
this.judgementData = result; this.judgementData = result;
} }
}).catch(err => { }).catch(err => {
@ -560,7 +560,7 @@ export default {
}); });
}, },
getProgrammingClassData(params) { // getProgrammingClassData(params) { //
this.visibleLoading = true this.visibleLoading = true;
this.$post(this.api.getBcJudgmentPoint, params).then(res => { this.$post(this.api.getBcJudgmentPoint, params).then(res => {
if (res.status === 200) { if (res.status === 200) {
let list = res.message.records; let list = res.message.records;
@ -569,12 +569,11 @@ export default {
i.judgmentId = i.bcId; i.judgmentId = i.bcId;
this.projectJudgmentData.find(j => j.judgmentId === i.judgmentId) || result.push(i); this.projectJudgmentData.find(j => j.judgmentId === i.judgmentId) || result.push(i);
}); });
this.visibleLoading = false this.visibleLoading = false;
this.judgementData = result; this.judgementData = result;
console.log(res,'res') // console.log(res, "res");
console.log(this.projectJudgmentData,'projectJudgmentData') // console.log(this.projectJudgmentData, "projectJudgmentData");
} }
}).catch(err => { }).catch(err => {
console.log(err); console.log(err);
}); });
@ -584,10 +583,10 @@ export default {
}, },
addJudgment() { // addJudgment() { //
if (this.selectedJudgment.length) { if (this.selectedJudgment.length) {
console.log(this.selectedJudgment,'queren') // console.log(this.selectedJudgment, "queren");
this.dialogVisible = false; this.dialogVisible = false;
if (this.projectId) { // if (this.projectId) { //
this.addProjectJudgment() this.addProjectJudgment();
} else { } else {
// //
let tempArr = this.selectedJudgment.map(i => { let tempArr = this.selectedJudgment.map(i => {
@ -596,8 +595,8 @@ export default {
}); });
this.projectJudgmentData = this.projectJudgmentData.concat(tempArr); this.projectJudgmentData = this.projectJudgmentData.concat(tempArr);
this.projectJudgmentData.map((e, i) => { this.projectJudgmentData.map((e, i) => {
e.sort = i+1 e.sort = i + 1;
}) });
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.projectJudgementTable.clearSelection(); this.$refs.projectJudgementTable.clearSelection();
}); });
@ -655,24 +654,24 @@ export default {
// //
rowDrop() { rowDrop() {
// //
const tbody = document.querySelector('.draggable .el-table__body-wrapper tbody'); const tbody = document.querySelector(".draggable .el-table__body-wrapper tbody");
const _this = this; const _this = this;
Sortable.create(tbody, { Sortable.create(tbody, {
// //
draggable: ".draggable .el-table__row", draggable: ".draggable .el-table__row",
onEnd({ newIndex, oldIndex }) { onEnd({ newIndex, oldIndex }) {
let newItem = _this.projectJudgmentData[newIndex] let newItem = _this.projectJudgmentData[newIndex];
_this.projectJudgmentData[newIndex] = _this.projectJudgmentData[oldIndex] _this.projectJudgmentData[newIndex] = _this.projectJudgmentData[oldIndex];
_this.projectJudgmentData[oldIndex] = newItem _this.projectJudgmentData[oldIndex] = newItem;
// //
_this.projectJudgmentData.forEach((e, i) => { _this.projectJudgmentData.forEach((e, i) => {
_this.$set(e,'sort',i+1)// _this.$set(e, "sort", i + 1);//
_this.$set(e,'name',e.name+"?") _this.$set(e, "name", e.name + "?");
_this.$set(e,'name',e.name.slice(0,e.name.length-1)) // _this.$set(e, "name", e.name.slice(0, e.name.length - 1)); //
}) });
// //
if (_this.projectId) {// if (_this.projectId) {//
_this.updateProjectJudgment() _this.updateProjectJudgment();
} }
} }
}); });
@ -682,18 +681,18 @@ export default {
let param = this.selectedJudgment.map((e, i) => { let param = this.selectedJudgment.map((e, i) => {
let obj = { let obj = {
judgmentId: e.judgmentId, judgmentId: e.judgmentId,
projectId:this.projectId||'', projectId: this.projectId || "",
score: 0, score: 0,
sort: i + 1 sort: i + 1
} };
return obj return obj;
}) });
console.log(param,'param',this.projectId,) // console.log(param, "param", this.projectId);
this.$post(this.api.addProjectJudgment, param).then(res => { this.$post(this.api.addProjectJudgment, param).then(res => {
// //
console.log('添加成功',res) // console.log("", res);
if (this.projectId) { // idid if (this.projectId) { // idid
this.listAgain() this.listAgain();
} }
}).catch(err => { }).catch(err => {
console.log(err); console.log(err);
@ -706,18 +705,17 @@ export default {
let param = this.projectJudgmentData.map((e, i) => { let param = this.projectJudgmentData.map((e, i) => {
let obj = { let obj = {
judgmentId: e.judgmentId, judgmentId: e.judgmentId,
projectId:this.projectId||'', projectId: this.projectId || "",
score: e.score, score: e.score,
sort: i + 1, sort: i + 1,
id: e.id id: e.id
} };
return obj return obj;
}) });
this.$post(this.api.updateProjectJudgment, param).then(res => { this.$post(this.api.updateProjectJudgment, param).then(res => {
// //
if (this.projectId) { // idid if (this.projectId) { // idid
this.listAgain() this.listAgain();
} }
}).catch(err => { }).catch(err => {
console.log(err); console.log(err);
@ -727,14 +725,11 @@ export default {
deleteProjectJudgment(values) { deleteProjectJudgment(values) {
if (values && values.length > 0) { if (values && values.length > 0) {
this.$post(this.api.deleteProjectJudgment + "?projectJudgmentIds=" + `${values}`).then(res => { this.$post(this.api.deleteProjectJudgment + "?projectJudgmentIds=" + `${values}`).then(res => {
// //
if (this.projectId) { // idid if (this.projectId) { // idid
this.listAgain() this.listAgain();
} }
}).catch(err => { }).catch(err => {});
});
} }
}, },
// , // ,
@ -743,11 +738,10 @@ export default {
let { projectManage, projectJudgmentVos } = res; let { projectManage, projectJudgmentVos } = res;
this.projectJudgmentData = projectJudgmentVos; this.projectJudgmentData = projectJudgmentVos;
this.projectJudgmentData.map((e, i) => { this.projectJudgmentData.map((e, i) => {
e.sort = i+1 e.sort = i + 1;
}) });
}) });
}, }
} }

@ -5,7 +5,7 @@ const url = location.host;
const isDev = process.env.NODE_ENV === "development"; // 开发环境 const isDev = process.env.NODE_ENV === "development"; // 开发环境
const isHh = url.includes("10.196.131.73"); //是否河海版本 const isHh = url.includes("10.196.131.73"); //是否河海版本
const isCH = url.includes("120.78.127.12"); //是否巢湖版本 const isCH = url.includes("120.78.127.12"); //是否巢湖版本
const isBeta = url.includes("120.78.198.231"); //是否职站测试(本地亦调用测试服接口) const isBeta = url.includes("120.78.198.231"); //是否职站测试
const isPro = url.includes("occupationlab.com"); //是否职站生产 const isPro = url.includes("occupationlab.com"); //是否职站生产
const isTest = url.includes('39.108.250.202'); //是否中台测试服 const isTest = url.includes('39.108.250.202'); //是否中台测试服

Loading…
Cancel
Save