|
@@ -14,7 +14,10 @@
|
|
<!-- <div slot="title"></div> -->
|
|
<!-- <div slot="title"></div> -->
|
|
<el-form ref="rowInfoFormRef" :model="rowInfo" :rules="rowInfoRules" inline>
|
|
<el-form ref="rowInfoFormRef" :model="rowInfo" :rules="rowInfoRules" inline>
|
|
<el-form-item label="评卷方式:" label-width="80px">
|
|
<el-form-item label="评卷方式:" label-width="80px">
|
|
- <el-radio-group v-model="rowInfo.doubleEnable">
|
|
|
|
|
|
+ <el-radio-group
|
|
|
|
+ v-model="rowInfo.doubleEnable"
|
|
|
|
+ @change="doubleEnableChange"
|
|
|
|
+ >
|
|
<el-radio :label="false">单评</el-radio>
|
|
<el-radio :label="false">单评</el-radio>
|
|
<el-radio :label="true">双评</el-radio>
|
|
<el-radio :label="true">双评</el-radio>
|
|
</el-radio-group>
|
|
</el-radio-group>
|
|
@@ -289,6 +292,7 @@ export default {
|
|
},
|
|
},
|
|
],
|
|
],
|
|
},
|
|
},
|
|
|
|
+ instRow: {},
|
|
rowInfo: {},
|
|
rowInfo: {},
|
|
rowInfoRules: {
|
|
rowInfoRules: {
|
|
doubleRate: [
|
|
doubleRate: [
|
|
@@ -342,6 +346,7 @@ export default {
|
|
this.rowInfo.doubleRate = this.rowInfo.doubleRate || undefined;
|
|
this.rowInfo.doubleRate = this.rowInfo.doubleRate || undefined;
|
|
this.rowInfo.arbitrateThreshold =
|
|
this.rowInfo.arbitrateThreshold =
|
|
this.rowInfo.arbitrateThreshold || undefined;
|
|
this.rowInfo.arbitrateThreshold || undefined;
|
|
|
|
+ this.instRow = { ...this.rowInfo };
|
|
},
|
|
},
|
|
cancel() {
|
|
cancel() {
|
|
this.modalIsShow = false;
|
|
this.modalIsShow = false;
|
|
@@ -350,6 +355,10 @@ export default {
|
|
open() {
|
|
open() {
|
|
this.modalIsShow = true;
|
|
this.modalIsShow = true;
|
|
},
|
|
},
|
|
|
|
+ doubleEnableChange() {
|
|
|
|
+ this.rowInfo.arbitrateThreshold = undefined;
|
|
|
|
+ this.rowInfo.doubleRate = undefined;
|
|
|
|
+ },
|
|
// user
|
|
// user
|
|
switchUserType(type) {
|
|
switchUserType(type) {
|
|
this.filterLabel = "";
|
|
this.filterLabel = "";
|
|
@@ -584,12 +593,55 @@ export default {
|
|
.map((item) => `${item.mainNumber}_${item.subNumber}`)
|
|
.map((item) => `${item.mainNumber}_${item.subNumber}`)
|
|
.join();
|
|
.join();
|
|
},
|
|
},
|
|
|
|
+ equalArr(arr1, arr2) {
|
|
|
|
+ arr1.sort((a, b) => {
|
|
|
|
+ return a > b ? -1 : 1;
|
|
|
|
+ });
|
|
|
|
+ arr2.sort((a, b) => {
|
|
|
|
+ return a > b ? -1 : 1;
|
|
|
|
+ });
|
|
|
|
+ // console.log(arr1, arr2);
|
|
|
|
+ return JSON.stringify(arr1) === JSON.stringify(arr2);
|
|
|
|
+ },
|
|
|
|
+ checkDataChange() {
|
|
|
|
+ const fields = ["doubleEnable", "arbitrateThreshold", "doubleRate"];
|
|
|
|
+ let changed = fields.some(
|
|
|
|
+ (field) => this.rowInfo[field] !== this.instRow[field]
|
|
|
|
+ );
|
|
|
|
+ if (changed) return true;
|
|
|
|
+
|
|
|
|
+ const prevUserIds = this.instance.markers.map((item) => item.userId);
|
|
|
|
+ const curUserIds = this.selectedUsers.map((item) => item.id);
|
|
|
|
+ changed = !this.equalArr(prevUserIds, curUserIds);
|
|
|
|
+ if (changed) return true;
|
|
|
|
+
|
|
|
|
+ const prevQnos = this.instance.questions.map(
|
|
|
|
+ (item) => `${item.mainNumber}-${item.subNumber}`
|
|
|
|
+ );
|
|
|
|
+ const curQnos = this.selectedQuestions.map(
|
|
|
|
+ (item) => `${item.mainNumber}-${item.subNumber}`
|
|
|
|
+ );
|
|
|
|
+ changed = !this.equalArr(prevQnos, curQnos);
|
|
|
|
+ return changed;
|
|
|
|
+ },
|
|
// confirm
|
|
// confirm
|
|
async confirm() {
|
|
async confirm() {
|
|
const valid1 = await this.$refs.rowInfoFormRef.validate().catch(() => {});
|
|
const valid1 = await this.$refs.rowInfoFormRef.validate().catch(() => {});
|
|
const valid2 = await this.$refs.modalFormRef.validate().catch(() => {});
|
|
const valid2 = await this.$refs.modalFormRef.validate().catch(() => {});
|
|
if (!valid1 || !valid2) return;
|
|
if (!valid1 || !valid2) return;
|
|
|
|
|
|
|
|
+ const changed = this.checkDataChange();
|
|
|
|
+ if (changed) {
|
|
|
|
+ const confirm = await this.$confirm(
|
|
|
|
+ `保存后分组关联所有评卷任务都将删除,并生成新的分组任务!`,
|
|
|
|
+ "提示",
|
|
|
|
+ {
|
|
|
|
+ type: "warning",
|
|
|
|
+ }
|
|
|
|
+ ).catch(() => {});
|
|
|
|
+ if (confirm !== "confirm") return;
|
|
|
|
+ }
|
|
|
|
+
|
|
let datas = Object.assign({}, this.instance, this.rowInfo);
|
|
let datas = Object.assign({}, this.instance, this.rowInfo);
|
|
datas.markers = this.selectedUsers.map((item) => {
|
|
datas.markers = this.selectedUsers.map((item) => {
|
|
return {
|
|
return {
|