|
@@ -13,7 +13,7 @@
|
|
:row-class-name="getRowClassName"
|
|
:row-class-name="getRowClassName"
|
|
>
|
|
>
|
|
<el-table-column width="50" align="center">
|
|
<el-table-column width="50" align="center">
|
|
- <template slot-scope="scope" v-if="scope.row.isMainFirstSub">
|
|
|
|
|
|
+ <template slot-scope="scope" v-if="scope.row.mainFirstSub">
|
|
<div
|
|
<div
|
|
:class="[
|
|
:class="[
|
|
'expand-btn',
|
|
'expand-btn',
|
|
@@ -28,7 +28,7 @@
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
<el-table-column prop="mainTitle" label="大题名称">
|
|
<el-table-column prop="mainTitle" label="大题名称">
|
|
- <span slot-scope="scope" v-if="scope.row.isMainFirstSub">
|
|
|
|
|
|
+ <span slot-scope="scope" v-if="scope.row.mainFirstSub">
|
|
<el-input
|
|
<el-input
|
|
v-model.trim="scope.row.mainTitle"
|
|
v-model.trim="scope.row.mainTitle"
|
|
size="small"
|
|
size="small"
|
|
@@ -39,7 +39,7 @@
|
|
</span>
|
|
</span>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
<el-table-column prop="qType" label="类型" width="160">
|
|
<el-table-column prop="qType" label="类型" width="160">
|
|
- <template slot-scope="scope" v-if="scope.row.isMainFirstSub">
|
|
|
|
|
|
+ <template slot-scope="scope" v-if="scope.row.mainFirstSub">
|
|
<el-radio-group
|
|
<el-radio-group
|
|
v-model="scope.row.qType"
|
|
v-model="scope.row.qType"
|
|
size="mini"
|
|
size="mini"
|
|
@@ -55,7 +55,7 @@
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
<el-table-column prop="mainNumber" label="大题号" width="80">
|
|
<el-table-column prop="mainNumber" label="大题号" width="80">
|
|
- <template slot-scope="scope" v-if="scope.row.isMainFirstSub">
|
|
|
|
|
|
+ <template slot-scope="scope" v-if="scope.row.mainFirstSub">
|
|
<span>{{ scope.row.mainNumber }}</span>
|
|
<span>{{ scope.row.mainNumber }}</span>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
@@ -163,16 +163,16 @@ export default {
|
|
mainNumber: 1,
|
|
mainNumber: 1,
|
|
subNumber: 1,
|
|
subNumber: 1,
|
|
totalScore: undefined,
|
|
totalScore: undefined,
|
|
- isMainFirstSub: true,
|
|
|
|
|
|
+ mainFirstSub: true,
|
|
expandSub: true
|
|
expandSub: true
|
|
});
|
|
});
|
|
},
|
|
},
|
|
getRowClassName({ row }) {
|
|
getRowClassName({ row }) {
|
|
let classNames = [];
|
|
let classNames = [];
|
|
- if (row.isMainFirstSub) {
|
|
|
|
|
|
+ if (row.mainFirstSub) {
|
|
classNames.push("row-main-first-sub");
|
|
classNames.push("row-main-first-sub");
|
|
}
|
|
}
|
|
- if (!row.isMainFirstSub && !row.expandSub) {
|
|
|
|
|
|
+ if (!row.mainFirstSub && !row.expandSub) {
|
|
classNames.push("row-unexpand-sub");
|
|
classNames.push("row-unexpand-sub");
|
|
}
|
|
}
|
|
return classNames.join(" ");
|
|
return classNames.join(" ");
|
|
@@ -199,7 +199,7 @@ export default {
|
|
mainNumber: row.mainNumber + 1,
|
|
mainNumber: row.mainNumber + 1,
|
|
subNumber: 1,
|
|
subNumber: 1,
|
|
totalScore: row.totalScore,
|
|
totalScore: row.totalScore,
|
|
- isMainFirstSub: true,
|
|
|
|
|
|
+ mainFirstSub: true,
|
|
expandSub: true
|
|
expandSub: true
|
|
});
|
|
});
|
|
this.updateMainData();
|
|
this.updateMainData();
|
|
@@ -225,7 +225,7 @@ export default {
|
|
mainNumber: row.mainNumber,
|
|
mainNumber: row.mainNumber,
|
|
subNumber: row.subNumber + 1,
|
|
subNumber: row.subNumber + 1,
|
|
totalScore: row.totalScore,
|
|
totalScore: row.totalScore,
|
|
- isMainFirstSub: false,
|
|
|
|
|
|
+ mainFirstSub: false,
|
|
expandSub: row.expandSub
|
|
expandSub: row.expandSub
|
|
});
|
|
});
|
|
this.updateSubData(row.mainId);
|
|
this.updateSubData(row.mainId);
|
|
@@ -244,7 +244,7 @@ export default {
|
|
this.tableData
|
|
this.tableData
|
|
.filter(item => item.mainId === row.mainId)
|
|
.filter(item => item.mainId === row.mainId)
|
|
.forEach((item, index) => {
|
|
.forEach((item, index) => {
|
|
- item.isMainFirstSub = !index;
|
|
|
|
|
|
+ item.mainFirstSub = !index;
|
|
});
|
|
});
|
|
this.updateSubData(row.mainId);
|
|
this.updateSubData(row.mainId);
|
|
this.updateMainData();
|
|
this.updateMainData();
|
|
@@ -252,17 +252,17 @@ export default {
|
|
switchExpandSub(row) {
|
|
switchExpandSub(row) {
|
|
row.expandSub = !row.expandSub;
|
|
row.expandSub = !row.expandSub;
|
|
this.tableData
|
|
this.tableData
|
|
- .filter(item => item.mainId === row.mainId && !item.isMainFirstSub)
|
|
|
|
|
|
+ .filter(item => item.mainId === row.mainId && !item.mainFirstSub)
|
|
.forEach(item => (item.expandSub = row.expandSub));
|
|
.forEach(item => (item.expandSub = row.expandSub));
|
|
},
|
|
},
|
|
mainTitleChange(row) {
|
|
mainTitleChange(row) {
|
|
this.tableData
|
|
this.tableData
|
|
- .filter(item => item.mainId === row.mainId && !item.isMainFirstSub)
|
|
|
|
|
|
+ .filter(item => item.mainId === row.mainId && !item.mainFirstSub)
|
|
.forEach(item => (item.mainTitle = row.mainTitle));
|
|
.forEach(item => (item.mainTitle = row.mainTitle));
|
|
},
|
|
},
|
|
qTypeChange(row) {
|
|
qTypeChange(row) {
|
|
this.tableData
|
|
this.tableData
|
|
- .filter(item => item.mainId === row.mainId && !item.isMainFirstSub)
|
|
|
|
|
|
+ .filter(item => item.mainId === row.mainId && !item.mainFirstSub)
|
|
.forEach(item => (item.qType = row.qType));
|
|
.forEach(item => (item.qType = row.qType));
|
|
},
|
|
},
|
|
checkData() {
|
|
checkData() {
|
|
@@ -275,7 +275,7 @@ export default {
|
|
// }
|
|
// }
|
|
|
|
|
|
// const objectiveNos = this.tableData
|
|
// const objectiveNos = this.tableData
|
|
- // .filter(item => item.isMainFirstSub && item.qType === "objective")
|
|
|
|
|
|
+ // .filter(item => item.mainFirstSub && item.qType === "objective")
|
|
// .map(item => item.mainNumber);
|
|
// .map(item => item.mainNumber);
|
|
// const unValid = objectiveNos.some(
|
|
// const unValid = objectiveNos.some(
|
|
// (no, index) => objectiveNos[0] + index !== no
|
|
// (no, index) => objectiveNos[0] + index !== no
|
|
@@ -288,7 +288,7 @@ export default {
|
|
let errorMessages = [];
|
|
let errorMessages = [];
|
|
this.tableData.forEach(item => {
|
|
this.tableData.forEach(item => {
|
|
let errorMsg = ``;
|
|
let errorMsg = ``;
|
|
- if (item.isMainFirstSub) {
|
|
|
|
|
|
+ if (item.mainFirstSub) {
|
|
let errorFields = [];
|
|
let errorFields = [];
|
|
if (!item.mainTitle) {
|
|
if (!item.mainTitle) {
|
|
errorFields.push("大题名称");
|
|
errorFields.push("大题名称");
|