|
@@ -1,5 +1,5 @@
|
|
|
<style lang="less" scoped>
|
|
|
-.AddNewRuleTable {
|
|
|
+#AddNewRuleTable {
|
|
|
width: 100%;
|
|
|
background: #fff;
|
|
|
margin-top: 10px;
|
|
@@ -75,9 +75,6 @@
|
|
|
margin-right: 4px;
|
|
|
}
|
|
|
}
|
|
|
- // ::v-deep .el-table tbody tr:hover > td {
|
|
|
- // // background-color: transparent;
|
|
|
- // }
|
|
|
/deep/ .el-table th {
|
|
|
background: transparent;
|
|
|
}
|
|
@@ -87,9 +84,6 @@
|
|
|
.table_cell_cls {
|
|
|
vertical-align: top;
|
|
|
}
|
|
|
- // /deep/ .el-table__body .el-table__row.hover-row td {
|
|
|
- // // background-color: transparent;
|
|
|
- // }
|
|
|
/deep/ .el-form-item__label {
|
|
|
font-size: 12px;
|
|
|
}
|
|
@@ -97,15 +91,15 @@
|
|
|
font-size: 14px;
|
|
|
font-weight: 400;
|
|
|
}
|
|
|
- // /deep/ .el-table__body tr.current-row>td{
|
|
|
- // background: #fff;
|
|
|
- // }
|
|
|
+ /deep/ .el-select{
|
|
|
+ font-size: 12px;
|
|
|
+ }
|
|
|
}
|
|
|
</style>
|
|
|
|
|
|
<template>
|
|
|
<!-- :prop="`klRuleByIdSub[${scope.$index}].subDescription`" -->
|
|
|
- <div class="AddNewRuleTable">
|
|
|
+ <div id="AddNewRuleTable">
|
|
|
<h4 style="margin-bottom: 24px">规则内容:</h4>
|
|
|
<!-- 隔行换色 :row-style="rowStyle" -->
|
|
|
<el-table
|
|
@@ -113,7 +107,7 @@
|
|
|
:data="klRuleByIdSub"
|
|
|
size="mini"
|
|
|
style="min-height: 200px"
|
|
|
- height="calc(100vh - 383px)"
|
|
|
+ height="calc(100vh - 393px)"
|
|
|
:header-row-style="{ background: '#E3EAF4' }"
|
|
|
:cell-style="cellStyle"
|
|
|
:span-method="ObjectSpanMethod"
|
|
@@ -169,8 +163,8 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column width="170px" prop="subDescription">
|
|
|
- <template slot="header">
|
|
|
+ <el-table-column width="170px" prop="subDescription" label="基础规则名称">
|
|
|
+ <template slot="header" slot-scope="scope">
|
|
|
<div class="custom_table_header">基础规则名称</div>
|
|
|
</template>
|
|
|
<template slot-scope="scope">
|
|
@@ -189,8 +183,8 @@
|
|
|
</el-form-item>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column width="170px" prop="subType">
|
|
|
- <template slot="header">
|
|
|
+ <el-table-column width="170px" prop="subType" label="基础规则类型">
|
|
|
+ <template slot="header" slot-scope="scope">
|
|
|
<div class="custom_table_header">基础规则类型</div>
|
|
|
</template>
|
|
|
<template slot-scope="scope">
|
|
@@ -204,6 +198,10 @@
|
|
|
:disabled="scope.row.disabled"
|
|
|
placeholder="请选择"
|
|
|
@change="subTypeChange($event, scope.$index)"
|
|
|
+ @focus="
|
|
|
+ setTheRef($event, `klRuleByIdSub[${scope.$index}].subType`)
|
|
|
+ "
|
|
|
+ :ref="`klRuleByIdSub[${scope.$index}].subType`"
|
|
|
>
|
|
|
<el-option
|
|
|
v-for="item in scope.row.baseTypes"
|
|
@@ -216,8 +214,8 @@
|
|
|
</el-form-item>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column width="170px" prop="subLenCode">
|
|
|
- <template slot="header">
|
|
|
+ <el-table-column width="170px" prop="subLenCode" label="基础规则术语类型">
|
|
|
+ <template slot="header" slot-scope="scope">
|
|
|
<div class="custom_table_header">基础规则术语类型</div>
|
|
|
</template>
|
|
|
<template slot-scope="scope">
|
|
@@ -230,7 +228,11 @@
|
|
|
:disabled="scope.row.disabled"
|
|
|
v-model="scope.row.subLenCode"
|
|
|
placeholder="请选择"
|
|
|
+ :ref="`klRuleByIdSub[${scope.$index}].subLenCode`"
|
|
|
@change="subCodeChange($event, scope.$index)"
|
|
|
+ @focus="
|
|
|
+ setTheRef($event, `klRuleByIdSub[${scope.$index}].subLenCode`)
|
|
|
+ "
|
|
|
>
|
|
|
<el-option
|
|
|
v-for="item in scope.row.baseTermTypeList"
|
|
@@ -244,7 +246,7 @@
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column width="170px" label="医学标准术语" prop="subConceptId">
|
|
|
- <template slot="header">
|
|
|
+ <template slot="header" slot-scope="scope">
|
|
|
<div class="custom_table_header">医学标准术语</div>
|
|
|
</template>
|
|
|
<template slot-scope="scope">
|
|
@@ -261,6 +263,7 @@
|
|
|
@focus="subConceptIdfocus(scope.$index)"
|
|
|
:remote-method="searchConcept"
|
|
|
v-model.trim="scope.row.subConceptId"
|
|
|
+ :ref="`klRuleByIdSub[${scope.$index}].subConceptId`"
|
|
|
>
|
|
|
<el-option
|
|
|
v-for="item in scope.row.conceptList"
|
|
@@ -286,6 +289,10 @@
|
|
|
v-model="scope.row.dataType"
|
|
|
placeholder="选择类型"
|
|
|
@change="dataTypeChange($event, scope.$index)"
|
|
|
+ @focus="
|
|
|
+ setTheRef($event, `klRuleByIdSub[${scope.$index}].dataType`)
|
|
|
+ "
|
|
|
+ :ref="`klRuleByIdSub[${scope.$index}].dataType`"
|
|
|
>
|
|
|
<el-option label="数值类型" value="1"> </el-option>
|
|
|
<el-option label="文本类型" value="2"> </el-option>
|
|
@@ -308,7 +315,7 @@
|
|
|
validator: (rule, value, callback) => {
|
|
|
subMaxOperator(scope, rule, value, callback);
|
|
|
},
|
|
|
- trigger: ['blur']
|
|
|
+ trigger: ['change']
|
|
|
}
|
|
|
]"
|
|
|
>
|
|
@@ -316,6 +323,14 @@
|
|
|
v-model="scope.row.subMaxOperator"
|
|
|
placeholder="请选择"
|
|
|
clearable
|
|
|
+ @change="maxChange($event, scope.$index, 's')"
|
|
|
+ @focus="
|
|
|
+ setTheRef(
|
|
|
+ $event,
|
|
|
+ `klRuleByIdSub[${scope.$index}].subMaxOperator`
|
|
|
+ )
|
|
|
+ "
|
|
|
+ :ref="`klRuleByIdSub[${scope.$index}].subMaxOperator`"
|
|
|
>
|
|
|
<el-option
|
|
|
v-for="item in operMaxList"
|
|
@@ -335,12 +350,14 @@
|
|
|
validator: (rule, value, callback) => {
|
|
|
subMaxValue(scope, rule, value, callback);
|
|
|
},
|
|
|
- trigger: ['blur']
|
|
|
+ trigger: ['change']
|
|
|
}
|
|
|
]"
|
|
|
>
|
|
|
<el-input
|
|
|
type="text"
|
|
|
+ @focus="maxChange($event, scope.$index, 'i')"
|
|
|
+ :ref="`klRuleByIdSub[${scope.$index}].subMaxValue`"
|
|
|
v-model="scope.row.subMaxValue"
|
|
|
placeholder="填写数值"
|
|
|
/>
|
|
@@ -349,10 +366,10 @@
|
|
|
<el-col :span="6">
|
|
|
<el-form-item
|
|
|
:prop="`klRuleByIdSub[${scope.$index}].subMaxUnit`"
|
|
|
- :rules="rules.subMaxUnit"
|
|
|
>
|
|
|
<el-input
|
|
|
type="text"
|
|
|
+ @focus="setScrollRight"
|
|
|
v-model.trim="scope.row.subMaxUnit"
|
|
|
placeholder="填写单位"
|
|
|
/>
|
|
@@ -376,7 +393,7 @@
|
|
|
validator: (rule, value, callback) => {
|
|
|
subMinOperatorRule(scope, rule, value, callback);
|
|
|
},
|
|
|
- trigger: ['blur']
|
|
|
+ trigger: ['change']
|
|
|
}
|
|
|
]"
|
|
|
>
|
|
@@ -384,6 +401,14 @@
|
|
|
v-model="scope.row.subMinOperator"
|
|
|
placeholder="请选择"
|
|
|
clearable
|
|
|
+ :ref="`klRuleByIdSub[${scope.$index}].subMinOperator`"
|
|
|
+ @change="minChange($event, scope.$index, 's')"
|
|
|
+ @focus="
|
|
|
+ setTheRef(
|
|
|
+ $event,
|
|
|
+ `klRuleByIdSub[${scope.$index}].subMinOperator`
|
|
|
+ )
|
|
|
+ "
|
|
|
>
|
|
|
<el-option
|
|
|
v-for="item in operMinList"
|
|
@@ -403,12 +428,14 @@
|
|
|
validator: (rule, value, callback) => {
|
|
|
subMinValueRule(scope, rule, value, callback);
|
|
|
},
|
|
|
- trigger: ['blur']
|
|
|
+ trigger: ['change']
|
|
|
}
|
|
|
]"
|
|
|
>
|
|
|
<el-input
|
|
|
type="text"
|
|
|
+ :ref="`klRuleByIdSub[${scope.$index}].subMinValue`"
|
|
|
+ @focus="minChange($event, scope.$index, 'i')"
|
|
|
v-model="scope.row.subMinValue"
|
|
|
placeholder="填写数值"
|
|
|
/>
|
|
@@ -417,10 +444,11 @@
|
|
|
<el-col :span="6">
|
|
|
<el-form-item
|
|
|
:prop="`klRuleByIdSub[${scope.$index}].subMinUnit`"
|
|
|
- :rules="rules.subMinUnit"
|
|
|
+ :rules="[{ required: true, trigger: 'blur' }]"
|
|
|
>
|
|
|
<el-input
|
|
|
type="text"
|
|
|
+ @focus="setScrollRight"
|
|
|
v-model.trim="scope.row.subMinUnit"
|
|
|
placeholder="填写单位"
|
|
|
/>
|
|
@@ -429,63 +457,74 @@
|
|
|
</el-row>
|
|
|
</el-form-item>
|
|
|
<!-- v-if="klRuleByIdSub[scope.$index].subType !== 6 && klRuleByIdSub[scope.$index].dataType === '2'" -->
|
|
|
- <el-form-item
|
|
|
- class="type_content_item"
|
|
|
+ <div
|
|
|
style="flex: 2"
|
|
|
- v-if="scope.row.subType !== 6 && scope.row.dataType === '2'"
|
|
|
- label="医学内容:"
|
|
|
- label-width="100px"
|
|
|
- :prop="`klRuleByIdSub[${scope.$index}].subEqValue`"
|
|
|
- :rules="[
|
|
|
- {
|
|
|
- required: true,
|
|
|
- message: '请输入' + textName(scope.$index),
|
|
|
- trigger: 'blur'
|
|
|
- },
|
|
|
- {
|
|
|
- validator: (rule, value, callback) => {
|
|
|
- subEqValue(scope, rule, value, callback);
|
|
|
- },
|
|
|
- trigger: 'blur'
|
|
|
- }
|
|
|
- ]"
|
|
|
+ v-if="scope.row.subType != 6 && scope.row.dataType == '2'"
|
|
|
>
|
|
|
- <el-input
|
|
|
- type="textarea"
|
|
|
- rows="1"
|
|
|
- placeholder="请输入医学内容"
|
|
|
- v-model.trim="scope.row.subEqValue"
|
|
|
- ></el-input>
|
|
|
- </el-form-item>
|
|
|
+ <el-form-item
|
|
|
+ class="type_content_item"
|
|
|
+ style="width: 100%"
|
|
|
+ label="医学内容:"
|
|
|
+ label-width="100px"
|
|
|
+ :prop="`klRuleByIdSub[${scope.$index}].subEqValue`"
|
|
|
+ :rules="[
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: '请输入' + textName(scope.$index),
|
|
|
+ trigger: 'blur'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ validator: (rule, value, callback) => {
|
|
|
+ subEqValue(scope, rule, value, callback);
|
|
|
+ },
|
|
|
+ trigger: 'blur'
|
|
|
+ }
|
|
|
+ ]"
|
|
|
+ >
|
|
|
+ <el-input
|
|
|
+ type="textarea"
|
|
|
+ rows="1"
|
|
|
+ placeholder="请输入医学内容"
|
|
|
+ @focus="setScrollRight"
|
|
|
+ v-model.trim="scope.row.subEqValue"
|
|
|
+ ></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </div>
|
|
|
+
|
|
|
<!-- v-if="groupData.subType === 6" -->
|
|
|
- <el-form-item
|
|
|
- class="type_content_item"
|
|
|
- label="正则表达式:"
|
|
|
- label-width="120px"
|
|
|
+ <div
|
|
|
style="flex: 2"
|
|
|
- v-if="scope.row.subType === 6"
|
|
|
- :prop="`klRuleByIdSub[${scope.$index}].subEqValue1`"
|
|
|
- :rules="[
|
|
|
- {
|
|
|
- required: true,
|
|
|
- message: '请输入' + textName(scope.$index),
|
|
|
- trigger: 'blur'
|
|
|
- },
|
|
|
- {
|
|
|
- validator: (rule, value, callback) => {
|
|
|
- subEqValue(scope, rule, value, callback);
|
|
|
- },
|
|
|
- trigger: 'blur'
|
|
|
- }
|
|
|
- ]"
|
|
|
+ v-if="scope.row.subType == 6"
|
|
|
>
|
|
|
- <el-input
|
|
|
- type="textarea"
|
|
|
- rows="1"
|
|
|
- placeholder="请输入正则表达式"
|
|
|
- v-model.trim="scope.row.subEqValue"
|
|
|
- ></el-input>
|
|
|
- </el-form-item>
|
|
|
+ <el-form-item
|
|
|
+ class="type_content_item"
|
|
|
+ label="正则表达式:"
|
|
|
+ label-width="120px"
|
|
|
+ style="width: 100%"
|
|
|
+ :prop="`klRuleByIdSub[${scope.$index}].subEqValue1`"
|
|
|
+ :rules="[
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: '请输入' + textName(scope.$index),
|
|
|
+ trigger: 'blur'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ validator: (rule, value, callback) => {
|
|
|
+ subEqValue(scope, rule, value, callback);
|
|
|
+ },
|
|
|
+ trigger: 'blur'
|
|
|
+ }
|
|
|
+ ]"
|
|
|
+ >
|
|
|
+ <el-input
|
|
|
+ type="textarea"
|
|
|
+ rows="1"
|
|
|
+ placeholder="请输入正则表达式"
|
|
|
+ @focus="setScrollRight"
|
|
|
+ v-model.trim="scope.row.subEqValue"
|
|
|
+ ></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
@@ -510,10 +549,60 @@ export default {
|
|
|
{ name: ">", key: ">" },
|
|
|
{ name: ">=", key: ">=" }
|
|
|
],
|
|
|
- rules: tableRules
|
|
|
+ rules: tableRules,
|
|
|
+ theRef: null
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
|
+ setScrollRight() {
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.table.bodyWrapper.scrollLeft = this.$refs.table.bodyWrapper.scrollWidth;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ maxChange(e, val, type) {
|
|
|
+ if (
|
|
|
+ type === "i" &&
|
|
|
+ this.klRuleByIdSub[val].subMaxOperator &&
|
|
|
+ this.klRuleByIdSub[val].subMaxOperator != ""
|
|
|
+ ) {
|
|
|
+ this.$emit("clearValidate", [
|
|
|
+ `klRuleByIdSub[${val}].subMinValue`,
|
|
|
+ `klRuleByIdSub[${val}].subMinOperator`
|
|
|
+ ]);
|
|
|
+ } else if (
|
|
|
+ type === "s" &&
|
|
|
+ this.klRuleByIdSub[val].subMaxValue &&
|
|
|
+ this.klRuleByIdSub[val].subMaxValue != ""
|
|
|
+ ) {
|
|
|
+ this.$emit("clearValidate", [
|
|
|
+ `klRuleByIdSub[${val}].subMinValue`,
|
|
|
+ `klRuleByIdSub[${val}].subMinOperator`
|
|
|
+ ]);
|
|
|
+ }
|
|
|
+ this.setScrollRight();
|
|
|
+ },
|
|
|
+ minChange(e, val, type) {
|
|
|
+ if (
|
|
|
+ type === "i" &&
|
|
|
+ this.klRuleByIdSub[val].subMinOperator &&
|
|
|
+ this.klRuleByIdSub[val].subMinOperator != ""
|
|
|
+ ) {
|
|
|
+ this.$emit("clearValidate", [
|
|
|
+ `klRuleByIdSub[${val}].subMaxOperator`,
|
|
|
+ `klRuleByIdSub[${val}].subMaxValue`
|
|
|
+ ]);
|
|
|
+ } else if (
|
|
|
+ type === "s" &&
|
|
|
+ this.klRuleByIdSub[val].subMinValue &&
|
|
|
+ this.klRuleByIdSub[val].subMinValue != ""
|
|
|
+ ) {
|
|
|
+ this.$emit("clearValidate", [
|
|
|
+ `klRuleByIdSub[${val}].subMaxOperator`,
|
|
|
+ `klRuleByIdSub[${val}].subMaxValue`
|
|
|
+ ]);
|
|
|
+ }
|
|
|
+ this.setScrollRight();
|
|
|
+ },
|
|
|
addGroup(scope) {
|
|
|
this.$emit("addGroup", null, { groupId: scope.row.groupId });
|
|
|
this.$refs.table.bodyWrapper.scrollLeft = 0;
|
|
@@ -522,6 +611,10 @@ export default {
|
|
|
this.$emit("addGroup", scope.row.groupId, { index: scope.$index });
|
|
|
this.$refs.table.bodyWrapper.scrollLeft = 0;
|
|
|
},
|
|
|
+ scrollFun() {
|
|
|
+ this.$refs.table.bodyWrapper.scrollTop =
|
|
|
+ this.$refs.table.bodyWrapper.scrollTop + 60;
|
|
|
+ },
|
|
|
// table 隔行换色
|
|
|
// rowStyle({ row }) {
|
|
|
// if (row.rowIndex % 2 == 0) {
|
|
@@ -608,35 +701,26 @@ export default {
|
|
|
subTypeChange(e, index) {
|
|
|
this.$emit("subTypeChange", e, index);
|
|
|
},
|
|
|
+ //
|
|
|
+ setTheRef(e, val) {
|
|
|
+ this.theRef = val;
|
|
|
+ },
|
|
|
// 规则术语类型
|
|
|
subCodeChange(val, index) {
|
|
|
//基础规则术语类型修改
|
|
|
- if ((this.numTypes + ",").indexOf(val + ",") > -1) {
|
|
|
- this.klRuleByIdSub[index].dataType = "1";
|
|
|
- } else {
|
|
|
- this.klRuleByIdSub[index].dataType = "";
|
|
|
- }
|
|
|
- this.clearConcept(index);
|
|
|
- this.clearNumText(index);
|
|
|
+ this.$emit("childSubCodeChange", val, index, this.numTypes);
|
|
|
},
|
|
|
clearConcept(index) {
|
|
|
- this.klRuleByIdSub[index].subConceptId = "";
|
|
|
- this.klRuleByIdSub[index].conceptList = [];
|
|
|
+ this.$emit("childClearConcept", index);
|
|
|
},
|
|
|
clearNumText(index) {
|
|
|
- this.klRuleByIdSub[index].subMaxOperator = "";
|
|
|
- this.klRuleByIdSub[index].subMaxValue = "";
|
|
|
- this.klRuleByIdSub[index].subMaxUnit = "";
|
|
|
- this.klRuleByIdSub[index].subMinOperator = "";
|
|
|
- this.klRuleByIdSub[index].subMinValue = "";
|
|
|
- this.klRuleByIdSub[index].subMinUnit = "";
|
|
|
- this.klRuleByIdSub[index].subEqValue = "";
|
|
|
- this.klRuleByIdSub[index].subEqOperator = "";
|
|
|
+ this.$emit("childClearNumText", index);
|
|
|
},
|
|
|
//医学标准术语change
|
|
|
subConceptIdfocus(index) {
|
|
|
this.subConceptIdIndex = "";
|
|
|
this.subConceptIdIndex = index;
|
|
|
+ this.setTheRef(1, `klRuleByIdSub[${index}].subConceptId`);
|
|
|
},
|
|
|
// 医学标准术语
|
|
|
searchConcept(val) {
|
|
@@ -660,10 +744,7 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
dataTypeChange(val, index) {
|
|
|
- this.klRuleByIdSub[index].subEqOperator = val === "2" ? "=" : "";
|
|
|
- this.clearNumText(index);
|
|
|
- delete this.klRuleByIdSub[index].dataType; //触发更新
|
|
|
- this.$set(this.klRuleByIdSub[index], "dataType", val);
|
|
|
+ this.$emit("ChildDataTypeChange", val, index);
|
|
|
},
|
|
|
// 处理要合并相同行的列
|
|
|
getSpanArr(data) {
|
|
@@ -714,12 +795,31 @@ export default {
|
|
|
},
|
|
|
textName(index) {
|
|
|
return this.klRuleByIdSub[index].subType !== 6 &&
|
|
|
- this.klRuleByIdSub[index].dataType === "2"
|
|
|
+ this.klRuleByIdSub[index].dataType == "2"
|
|
|
? "医学内容"
|
|
|
: "正则表达式";
|
|
|
+ },
|
|
|
+ blurRef() {
|
|
|
+ console.log("11111");
|
|
|
+ this.$nextTick(() => {
|
|
|
+ console.log("???", this.$refs[this.theRef]);
|
|
|
+ this.$refs[this.theRef].handleClose();
|
|
|
+ });
|
|
|
}
|
|
|
},
|
|
|
components: {},
|
|
|
+ mounted() {
|
|
|
+ // this.theRef
|
|
|
+ // FIXME 滚动问题BUG 暂无解决办法
|
|
|
+ let that = this;
|
|
|
+ this.$refs.table.bodyWrapper.addEventListener("scroll", function () {
|
|
|
+ console.log("scroll");
|
|
|
+ if (that.theRef) {
|
|
|
+ console.log("theRef", that.theRef);
|
|
|
+ that.blurRef();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
created() {
|
|
|
this.numTypes = localStorage.getItem("zskNumDict");
|
|
|
this.getSpanArr(this.klRuleByIdSub);
|
|
@@ -727,6 +827,8 @@ export default {
|
|
|
beforeUpdate() {
|
|
|
this.getSpanArr(this.klRuleByIdSub);
|
|
|
},
|
|
|
+
|
|
|
+ updated() {},
|
|
|
props: {
|
|
|
klRuleByIdSub: {
|
|
|
type: Array,
|