调整样式,修复bug

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

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

Loading…
Cancel
Save