调整样式,修复bug

master
yujialong 3 years ago
parent 8ccd8c80df
commit 018fd60f8e
  1. 109
      src/views/Transaction.vue

@ -62,12 +62,12 @@
header-align="center"
:header-cell-style="headClass"
>
<el-table-column prop="id" type="index" label="序号" width="80"></el-table-column>
<el-table-column prop="indexNo" label="序号" width="80"></el-table-column>
<el-table-column label="流程判分正确答案">
<template slot-scope="scope" v-if="scope.row.isSubject">
<p class="p">操作一致性规则用户完成的功能操作与下方设置的操作点一致</p>
<div class="tree-con">
<div class="block">
<div class="block1">
<my-tree
class="action"
:ref="'tree-'+scope.$index"
@ -95,10 +95,10 @@
@click="changeResult(scope.row)"
style="position: absolute; right: 55px"
>
{{ scope.row.resultOperation === 0 ? '且' : '或' }}
{{ scope.row.resultOperation === 0 ? "且" : "或" }}
</el-button>
<el-button v-else type="primary" circle @click="changeRule(scope.row, scope.$index)">
{{ scope.row.ruleOperation === 0 ? '且' : '或' }}
{{ scope.row.ruleOperation === 0 ? "且" : "或" }}
</el-button>
</template>
</el-table-column>
@ -206,6 +206,8 @@
class="number-input"
v-model.trim="scope.row.value2"
:disabled="isView || scope.row.isDisabled"
onkeyup="value=this.value.replace(/\D+/g,'')"
oninput="value=value.replace(/[^0-9.]/g,'')"
type="number"
min="1"
size="mini"
@ -300,10 +302,17 @@
</el-table-column>
<el-table-column label="操作" width="300" v-if="!isView">
<template slot-scope="scope" v-if="scope.row.isSubject">
<el-button v-show="scope.row.isDisabled" size="mini" type="text" @click="handleEdit(scope.row)">编辑</el-button>
<el-button v-show="!scope.row.isDisabled" size="mini" type="text" @click="handleSave(scope.row, scope.$index)">保存</el-button>
<el-button v-show="!scope.row.isDisabled" size="mini" type="text" @click="handleCancel(scope.row, scope.$index)">取消</el-button>
<el-button v-show="scope.row.isDisabled" size="mini" type="text" @click="handleDelete(scope.row, scope.$index)">删除</el-button>
<el-button v-show="scope.row.isDisabled" size="mini" type="text" @click="handleEdit(scope.row)">编辑
</el-button>
<el-button v-show="!scope.row.isDisabled" size="mini" type="text"
@click="handleSave(scope.row, scope.$index)">保存
</el-button>
<el-button v-show="!scope.row.isDisabled" size="mini" type="text"
@click="handleCancel(scope.row, scope.$index)">取消
</el-button>
<el-button v-show="scope.row.isDisabled" size="mini" type="text"
@click="handleDelete(scope.row, scope.$index)">删除
</el-button>
</template>
</el-table-column>
</el-table>
@ -314,9 +323,10 @@
</template>
<script>
import quill from '@/components/quill'
import MyTree from '@/components/myTree/src/tree'
import {deepCopy} from '@/utils/deepCopy'
import quill from "@/components/quill";
import MyTree from "@/components/myTree/src/tree";
import {deepCopy} from "@/utils/deepCopy";
export default {
components: {quill, MyTree},
data() {
@ -328,8 +338,8 @@ export default {
isNameRepeat: false, //
treeData: [], //
defaultProps: {
children: 'children',
label: 'name'
children: "children",
label: "name"
}, //
currentNodeData: {}, //
formData: {
@ -345,11 +355,11 @@ export default {
}, //
tableData: [], //
tableDataCopy: [], //
isAddRule: false, //
isAddRule: false //
};
},
mounted() {
this.$route.query.token && this.$store.commit('setParam', {
this.$route.query.token && this.$store.commit("setParam", {
token: atob(decodeURI(this.$route.query.token))
});
this.getTreeData();
@ -369,7 +379,7 @@ export default {
this.formData = {
lcJudgmentPoint: judgmentPoint,
lcJudgmentRuleList: judgmentRuleList
}
};
//
let length = judgmentRuleList.length;
@ -390,24 +400,24 @@ export default {
obj.value1 = item.emptyTwo;
} else if (item.type == 4) {
// id
if (item.emptyOne === '无限制') {
if (item.emptyOne === "无限制") {
obj.value1 = item.emptyOne;
obj.value2 = "";
} else {
obj.value1 = item.emptyOne.substring(0,item.emptyOne.indexOf(','));
obj.value2 = item.emptyOne.substring(item.emptyOne.indexOf(',') + 1,item.emptyOne.length)
obj.value1 = item.emptyOne.substring(0, item.emptyOne.indexOf(","));
obj.value2 = item.emptyOne.substring(item.emptyOne.indexOf(",") + 1, item.emptyOne.length);
}
obj.value3 = item.emptyTwo;
} else if (item.type == 5) {
obj.subjectId = Number(item.emptyOne);
obj.value2 = item.emptyTwo[0];
obj.value3 = item.emptyTwo.substring(1,item.emptyTwo.indexOf('~'));
obj.value4 = item.emptyTwo.substring(item.emptyTwo.indexOf('~') + 1,item.emptyTwo.length - 1)
obj.value3 = item.emptyTwo.substring(1, item.emptyTwo.indexOf("~"));
obj.value4 = item.emptyTwo.substring(item.emptyTwo.indexOf("~") + 1, item.emptyTwo.length - 1);
obj.value5 = item.emptyTwo[item.emptyTwo.length - 1];
}
tempArr.push(obj);
if (length > 1 && index !== (length - 1)) {
tempArr.push({ruleOperation: item.ruleOperation})
tempArr.push({ruleOperation: item.ruleOperation});
}
this.tableData = tempArr;
});
@ -426,10 +436,10 @@ export default {
});
} else {
this.$message.warning(res.message)
this.$message.warning(res.message);
}
}).catch(err => {
console.log(err)
console.log(err);
});
},
getSubjectData(subjectId, index) { //
@ -439,12 +449,12 @@ export default {
...this.tableData[index],
...res.subject,
items: res.items
}
};
this.$set(this.tableData, index, item);
// console.log(JSON.stringify(this.tableData))
}
}).catch(err => {
console.log(err)
console.log(err);
});
},
handleCheckChange(data, checked, indeterminate, row, index) { //
@ -477,7 +487,7 @@ export default {
this.$message.warning(res.message);
}
}).catch(err => {
console.log(err)
console.log(err);
});
},
toTreeId(data, parentId) { // id++,便key,id
@ -507,7 +517,7 @@ export default {
let params = {
lcId: this.lcId,
name: this.formData.lcJudgmentPoint.name
}
};
this.$post(this.api.queryNameIsExist, params).then(res => {
if (res.status === 200) {
this.isNameRepeat = false;
@ -515,7 +525,7 @@ export default {
this.isNameRepeat = true;
}
}).catch(err => {
console.log(err)
console.log(err);
});
}
},
@ -567,7 +577,7 @@ export default {
obj.emptyOne = i.subjectId ? i.subjectId.toString() : "";
obj.emptyTwo = i.value1;
} else if (i.type == 4) {
if (i.value1 === '无限制') {
if (i.value1 === "无限制") {
obj.emptyOne = i.value1; // ,id
} else if (i.value1 && i.value2) {
obj.emptyOne = `${i.value1},${i.value2}`; // ,id
@ -580,7 +590,7 @@ export default {
}
tempArr.push(obj);
}
})
});
this.formData.lcJudgmentRuleList = tempArr;
if (this.isAdd) { //
@ -592,8 +602,8 @@ export default {
this.$message.warning(res.message);
}
}).catch(err => {
console.log(err)
})
console.log(err);
});
} else if (this.isEdit) { //
this.$post(this.api.updateJudgmentPoint, this.formData).then(res => {
if (res.status === 200) {
@ -603,14 +613,15 @@ export default {
this.$message.warning(res.message);
}
}).catch(err => {
console.log(err)
})
console.log(err);
});
}
},
addRule() { //
this.isAddRule = true;
this.tableData.length && this.tableData.push({ruleOperation: 0});
this.tableData.length && this.tableData.push({ruleOperation: 0, indexNo: ""});
this.tableData.push({
indexNo: this.tableData.length ? parseInt(this.tableData.length/2)+1 : 1,
isSubject: true,
isDisabled: false, //
isSave: false, //
@ -622,8 +633,8 @@ export default {
value2: "",
value3: "",
value4: "",
value5: "",
})
value5: ""
});
},
changeResult(row) { // (0 1 0)
row.resultOperation = row.resultOperation === 0 ? 1 : 0;
@ -635,6 +646,7 @@ export default {
handleEdit(row) { //
this.tableDataCopy = deepCopy(this.tableData); //
row.isDisabled = false;
row.isSave = false;
},
handleSave(row, index) { //
let keys = this.$refs[`tree-${index}`].getCheckedKeys();
@ -657,7 +669,7 @@ export default {
if (!row.value1) {
this.$message.warning(`请选择字数要求`);
return;
} else if (row.value1 !== '无限制' && !row.value2) {
} else if (row.value1 !== "无限制" && !row.value2) {
this.$message.warning(`请输入字数要求`);
return;
} else if (!row.value3) {
@ -699,12 +711,13 @@ export default {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
center: true,
center: true
}).then(() => {
this.tableData.splice(index, 1);
index ? this.tableData.splice(index - 1, 1) : this.tableData.splice(0, 1);
this.isAddRule = false;
}).catch(() => {})
}).catch(() => {
});
},
//
headClass() {
@ -827,9 +840,11 @@ export default {
border-radius: 0;
background: #dddddd;
}
.tree-con {
height: 230px;
position: relative;
.mask {
width: 100%;
height: 100%;
@ -847,19 +862,27 @@ export default {
border: 1px solid #e4e7ed;
border-radius: 4px;
}
.block {
.block1 {
@include block;
height: 230px;
background-color: #fff;
overflow: auto;
}
.block {
@include block;
min-height: 100px;
background-color: #fff;
overflow: auto;
.box {
padding: 0 24px;
}
.line {
display: flex;
align-items: center;
margin: 12px 0;
.label {
//width: 100px;
margin-right: 10px;

Loading…
Cancel
Save