序号修复

master
jialong.yu 3 years ago
parent b1fd5ee8dc
commit 861861215a
  1. 18
      src/views/Program.vue
  2. 43
      src/views/Transaction.vue

@ -69,7 +69,11 @@
header-align="center" header-align="center"
:header-cell-style="headClass" :header-cell-style="headClass"
> >
<el-table-column prop="id" type="index" label="序号" width="80"></el-table-column> <el-table-column prop="id" type="index" label="序号" width="80">
<template slot-scope="scope">
{{ scope.row.isSubject && scope.row.index + 1 }}
</template>
</el-table-column>
<el-table-column label="编译器中正确答案" align="center"> <el-table-column label="编译器中正确答案" align="center">
<template slot-scope="scope" v-if="scope.row.isSubject"> <template slot-scope="scope" v-if="scope.row.isSubject">
<p class="p">字段一致性规则用户编辑器中至少出现如下语句</p> <p class="p">字段一致性规则用户编辑器中至少出现如下语句</p>
@ -199,6 +203,13 @@ export default {
console.log(err) console.log(err)
}); });
}, },
//
setIndex() {
let i = 0
this.tableData.map(e => {
if (e.isSubject) e.index = i++
})
},
// //
anewPosttingData(judgmentRule){ anewPosttingData(judgmentRule){
let length = judgmentRule.length; let length = judgmentRule.length;
@ -239,7 +250,7 @@ export default {
tempArr.push({ruleOperation: item.ruleOperation}); tempArr.push({ruleOperation: item.ruleOperation});
} }
this.tableData = tempArr; this.tableData = tempArr;
console.log(this.tableData) this.setIndex()
}); });
}, },
handleBlur() { // / handleBlur() { // /
@ -372,6 +383,7 @@ export default {
value5: "" value5: ""
}); });
} }
this.setIndex()
} }
}, },
changeResult(row) { // (0 1 0) changeResult(row) { // (0 1 0)
@ -402,6 +414,7 @@ export default {
// this.tableData.splice(index, 1); // this.tableData.splice(index, 1);
this.isAddRule = false; this.isAddRule = false;
} }
this.setIndex()
}, },
handleDelete(index) { // handleDelete(index) { //
this.$confirm("此操作将永久删除该规则, 是否继续?", "提示", { this.$confirm("此操作将永久删除该规则, 是否继续?", "提示", {
@ -417,6 +430,7 @@ export default {
} }
this.itemkey = Math.random() this.itemkey = Math.random()
this.isAddRule = false; this.isAddRule = false;
this.setIndex()
}).catch(() => {}) }).catch(() => {})
}, },
// //

@ -85,6 +85,9 @@
header-align="center" header-align="center"
> >
<el-table-column prop="indexNo" type="index" label="序号" width="80"> <el-table-column prop="indexNo" type="index" label="序号" width="80">
<template slot-scope="scope">
{{ scope.row.isSubject && scope.row.index + 1 }}
</template>
</el-table-column> </el-table-column>
<el-table-column label="流程类考核点"> <el-table-column label="流程类考核点">
<template slot-scope="scope" v-if="scope.row.isSubject"> <template slot-scope="scope" v-if="scope.row.isSubject">
@ -92,25 +95,12 @@
<div class="tree-con"> <div class="tree-con">
<div class="block1" :id="'divTree'+scope.$index"> <div class="block1" :id="'divTree'+scope.$index">
<el-tree :data="scope.row.operationIData" :props="defaultProp" :default-expand-all="true"></el-tree> <el-tree :data="scope.row.operationIData" :props="defaultProp" :default-expand-all="true"></el-tree>
<!-- <my-tree-->
<!-- :id="'depTree'+scope.$index"-->
<!-- class="action"-->
<!-- :ref="'tree-'+scope.$index"-->
<!-- :data="treeData"-->
<!-- :props="defaultProps"-->
<!-- default-expand-all-->
<!-- node-key="operationIds"-->
<!-- show-checkbox-->
<!-- @check-change="(data, checked, indeterminate) => {-->
<!-- handleCheckChange(data, checked, indeterminate, scope.row, scope.$index);-->
<!-- }"-->
<!-- ></my-tree>-->
</div> </div>
<div v-show="scope.row.isDisabled" class="mask"></div> <div v-show="scope.row.isDisabled" class="mask"></div>
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label=" " width="150"> <el-table-column label=" " width="150" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
circle circle
@ -118,7 +108,6 @@
v-if="scope.row.isSubject" v-if="scope.row.isSubject"
:disabled="isView || scope.row.isDisabled" :disabled="isView || scope.row.isDisabled"
@click="changeResult(scope.row)" @click="changeResult(scope.row)"
style="position: absolute; right: 55px"
> >
{{ scope.row.resultOperation === 0 ? "且" : "或" }} {{ scope.row.resultOperation === 0 ? "且" : "或" }}
</el-button> </el-button>
@ -446,6 +435,7 @@ export default {
// await this.getSubjectData(item.emptyOne, index); // await this.getSubjectData(item.emptyOne, index);
} }
}); });
this.setIndex()
this.loading = false this.loading = false
} else { } else {
this.$message.warning(res.message); this.$message.warning(res.message);
@ -476,7 +466,7 @@ export default {
this.counts = this.counts+1 this.counts = this.counts+1
let list = [] let list = []
if (this.SelectedObj.checkedNodes.length > 0){ if (this.SelectedObj.checkedNodes.length > 0){
for (var i=0;i<this.SelectedObj.checkedNodes.length;i++){ for (let i=0;i<this.SelectedObj.checkedNodes.length;i++){
if(this.SelectedObj.checkedNodes[i].children.length > 0){ if(this.SelectedObj.checkedNodes[i].children.length > 0){
}else{ }else{
@ -488,6 +478,7 @@ export default {
} }
} }
this.anewPosttingDatas(list) this.anewPosttingDatas(list)
let i = 0
this.tableData.forEach(async (item, index) => { this.tableData.forEach(async (item, index) => {
// //
if (!item.type){ if (!item.type){
@ -512,6 +503,7 @@ export default {
item.operationIData.push(testObj) item.operationIData.push(testObj)
} }
}); });
this.setIndex()
this.configVisible = false this.configVisible = false
}, },
anewPosttingDatas(judgmentRuleList){ anewPosttingDatas(judgmentRuleList){
@ -823,15 +815,10 @@ export default {
addRules(){ addRules(){
this.configVisible = true; this.configVisible = true;
let operationIds = [] let operationIds = []
console.log(this.treeData) this.tableData.map((e, i) => {
for (var i=0;i<this.tableData.length;i++){ e.operationIds && operationIds.push(e.operationIds)
if (this.tableData[i].operationIds){ })
operationIds.push(this.tableData[i].operationIds)
}
}
console.log(operationIds)
this.$refs.tree.setCheckedKeys([]); this.$refs.tree.setCheckedKeys([]);
}, },
addRule() { // addRule() { //
this.changeArr.splice(0, this.changeArr.length) this.changeArr.splice(0, this.changeArr.length)
@ -884,6 +871,13 @@ export default {
row.ruleOperation = row.ruleOperation === 0 ? 1 : 0; row.ruleOperation = row.ruleOperation === 0 ? 1 : 0;
this.tableData[index - 1].ruleOperation = row.ruleOperation; this.tableData[index - 1].ruleOperation = row.ruleOperation;
}, },
//
setIndex() {
let i = 0
this.tableData.map(e => {
if (e.isSubject) e.index = i++
})
},
handleEdit(row) { // handleEdit(row) { //
this.judgePoints = true this.judgePoints = true
this.tableDataCopy = deepCopy(this.tableData); // this.tableDataCopy = deepCopy(this.tableData); //
@ -954,6 +948,7 @@ export default {
} }
this.isAddRule = false; this.isAddRule = false;
} }
this.setIndex()
}, },
handleDelete(row, index) { // handleDelete(row, index) { //
this.$confirm("此操作将永久删除该规则, 是否继续?", "提示", { this.$confirm("此操作将永久删除该规则, 是否继续?", "提示", {

Loading…
Cancel
Save