|
@@ -17,7 +17,6 @@
|
|
|
justify-content: space-around;
|
|
|
.btn_div {
|
|
|
flex: 1;
|
|
|
- height: 80px;
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
justify-content: center;
|
|
@@ -34,7 +33,8 @@
|
|
|
margin: 0 auto;
|
|
|
}
|
|
|
/deep/ .el-form-item__error {
|
|
|
- position: relative;
|
|
|
+ // position: absolute;
|
|
|
+ top: 28px;
|
|
|
}
|
|
|
.type_content {
|
|
|
/deep/ .el-form-item--mini.el-form-item,
|
|
@@ -43,31 +43,27 @@
|
|
|
width: 100%;
|
|
|
}
|
|
|
display: flex;
|
|
|
- // flex-wrap: wrap;
|
|
|
- .type_content_item {
|
|
|
- padding: 10px 0;
|
|
|
- // flex: 1;
|
|
|
- // min-width: 200px;
|
|
|
- }
|
|
|
.type_content_item1 {
|
|
|
+ /deep/ .el-form-item__content {
|
|
|
+ padding-bottom: 0px;
|
|
|
+ }
|
|
|
.row_box {
|
|
|
.el-col {
|
|
|
+ /deep/ .el-form-item__content {
|
|
|
+ position: static;
|
|
|
+ }
|
|
|
/deep/ .el-form-item__error {
|
|
|
position: absolute;
|
|
|
width: 260px;
|
|
|
- // top: -10px;
|
|
|
- left: 0;
|
|
|
+ left: 72px;
|
|
|
white-space: normal;
|
|
|
- opacity: 0;
|
|
|
- }
|
|
|
- }
|
|
|
- .el-col:nth-child(1) {
|
|
|
- /deep/ .el-form-item__error {
|
|
|
- opacity: 1;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ /deep/ .el-input.is-disabled .el-input__inner {
|
|
|
+ color: #888;
|
|
|
+ }
|
|
|
}
|
|
|
.custom_table_header {
|
|
|
vertical-align: middle;
|
|
@@ -78,19 +74,33 @@
|
|
|
margin-right: 4px;
|
|
|
}
|
|
|
}
|
|
|
+ ::v-deep .el-table tbody tr:hover > td {
|
|
|
+ background-color: transparent;
|
|
|
+ }
|
|
|
+ /deep/ .el-table th {
|
|
|
+ background: transparent;
|
|
|
+ }
|
|
|
+ /deep/ .el-form-item__content {
|
|
|
+ padding-bottom: 14px;
|
|
|
+ }
|
|
|
+ .table_cell_cls {
|
|
|
+ vertical-align: top;
|
|
|
+ }
|
|
|
}
|
|
|
</style>
|
|
|
|
|
|
<template>
|
|
|
<!-- :prop="`klRuleByIdSub[${scope.$index}].subDescription`" -->
|
|
|
<div class="AddNewRuleTable">
|
|
|
- <h4 style="marginbottom: 20px">规则内容</h4>
|
|
|
+ <h4 style="margin-bottom: 20px">规则内容</h4>
|
|
|
<el-table
|
|
|
border
|
|
|
:data="klRuleByIdSub"
|
|
|
style="width: 100%"
|
|
|
size="mini"
|
|
|
- stripe
|
|
|
+ :row-style="rowStyle"
|
|
|
+ :header-row-style="{ background: '#E3EAF4' }"
|
|
|
+ :cell-style="cellStyle"
|
|
|
:span-method="ObjectSpanMethod"
|
|
|
>
|
|
|
<el-table-column width="80px" label="组" prop="groupType">
|
|
@@ -103,10 +113,9 @@
|
|
|
alt=""
|
|
|
/>
|
|
|
</div>
|
|
|
- <div class="btn_div">
|
|
|
+ <div class="btn_div" v-if="!isLastDate(scope.row.groupId)">
|
|
|
<img
|
|
|
@click="$emit('delGroup', scope.row.groupId)"
|
|
|
- v-if="!isLastDate(scope.row.groupId)"
|
|
|
src="../../images/add-new-rule-del.png"
|
|
|
alt=""
|
|
|
/>
|
|
@@ -122,9 +131,8 @@
|
|
|
>
|
|
|
<template slot-scope="scope">
|
|
|
<div class="btn_box">
|
|
|
- <div class="btn_div">
|
|
|
+ <div class="btn_div" v-if="!isMax(scope.row.groupId)">
|
|
|
<img
|
|
|
- v-if="!isMax(scope.row.groupId)"
|
|
|
@click="
|
|
|
$emit('addGroup', scope.row.groupId, { index: scope.$index })
|
|
|
"
|
|
@@ -132,10 +140,12 @@
|
|
|
alt=""
|
|
|
/>
|
|
|
</div>
|
|
|
- <div class="btn_div">
|
|
|
+ <div
|
|
|
+ class="btn_div"
|
|
|
+ v-if="klRuleByIdSub.length > 1 && !scope.row.disabled"
|
|
|
+ >
|
|
|
<img
|
|
|
@click="$emit('delGroupChild', scope.row.groupChildId)"
|
|
|
- v-if="klRuleByIdSub.length > 1 && !scope.row.disabled"
|
|
|
src="../../images/add-new-rule-del.png"
|
|
|
alt=""
|
|
|
/>
|
|
@@ -251,17 +261,14 @@
|
|
|
<template slot-scope="scope">
|
|
|
<div class="type_content">
|
|
|
<el-form-item
|
|
|
- class="type_content_item"
|
|
|
- style="width: 240px; marginright: 20px"
|
|
|
- label="选择类型:"
|
|
|
- label-width="100px"
|
|
|
+ style="width: 100px; margin-right: 20px"
|
|
|
:prop="`klRuleByIdSub[${scope.$index}].dataType`"
|
|
|
:rules="rules.dataType"
|
|
|
v-if="scope.row.subType === 2 && showDataType(scope.$index)"
|
|
|
>
|
|
|
<el-select
|
|
|
v-model="scope.row.dataType"
|
|
|
- placeholder="请选择"
|
|
|
+ placeholder="选择类型"
|
|
|
@change="dataTypeChange($event, scope.$index)"
|
|
|
>
|
|
|
<el-option label="数值类型" value="1"> </el-option>
|
|
@@ -271,7 +278,7 @@
|
|
|
<!-- v-if="klRuleByIdSub[scope.$index].dataType === '1'" -->
|
|
|
<el-form-item
|
|
|
class="type_content_item type_content_item1"
|
|
|
- style="flex: 2; height: 54px; margin: 0 10px"
|
|
|
+ style="flex: 2; margin: 0 10px"
|
|
|
label="最大值:"
|
|
|
v-if="scope.row.dataType === '1'"
|
|
|
>
|
|
@@ -353,7 +360,7 @@
|
|
|
validator: (rule, value, callback) => {
|
|
|
subMinOperatorRule(scope, rule, value, callback);
|
|
|
},
|
|
|
- trigger: 'blur'
|
|
|
+ trigger: 'change'
|
|
|
}
|
|
|
]"
|
|
|
>
|
|
@@ -424,7 +431,7 @@
|
|
|
>
|
|
|
<el-input
|
|
|
type="textarea"
|
|
|
- rows="3"
|
|
|
+ rows="1"
|
|
|
placeholder="请输入医学内容"
|
|
|
v-model.trim="scope.row.subEqValue"
|
|
|
></el-input>
|
|
@@ -448,7 +455,7 @@
|
|
|
>
|
|
|
<el-input
|
|
|
type="textarea"
|
|
|
- rows="2"
|
|
|
+ rows="1"
|
|
|
placeholder="请输入正则表达式"
|
|
|
v-model.trim="scope.row.subEqValue"
|
|
|
></el-input>
|
|
@@ -481,6 +488,20 @@ export default {
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
|
+ // table 隔行换色
|
|
|
+ rowStyle({ row }) {
|
|
|
+ if (row.rowIndex % 2 == 0) {
|
|
|
+ return {
|
|
|
+ background: "#DFF7EF"
|
|
|
+ };
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // cellStyle
|
|
|
+ cellStyle({ row, column, rowIndex, columnIndex }) {
|
|
|
+ console.log(column);
|
|
|
+ if (column.label == "组" || column.label == "基础规则") return {};
|
|
|
+ return { "vertical-align": "top", "padding-top": "14px" };
|
|
|
+ },
|
|
|
// 最大值 选择rule
|
|
|
subMaxOperator(scope, rule, value, callback) {
|
|
|
const { subMaxValue, subMinOperator, subMinValue } = scope.row;
|
|
@@ -508,10 +529,7 @@ export default {
|
|
|
subMinOperatorRule(scope, rule, value, callback) {
|
|
|
const { subMaxValue, subMaxOperator, subMinValue } = scope.row;
|
|
|
const val = value + subMaxOperator + subMinValue + subMaxValue;
|
|
|
- if (
|
|
|
- !val ||
|
|
|
- (!value && subMinValue !== "最大值和最小值至少完整填写一个,单位不必填")
|
|
|
- ) {
|
|
|
+ if (!val || (!value && subMinValue !== "")) {
|
|
|
callback(new Error("最大值和最小值至少完整填写一个,单位不必填"));
|
|
|
} else {
|
|
|
callback();
|