|
@@ -21,137 +21,113 @@
|
|
|
</el-form>
|
|
|
</div>
|
|
|
<el-main>
|
|
|
- <el-table :data="tableData" :span-method="objectSpanMethod" border style="width: 100%;" height="600px">
|
|
|
- <el-table-column prop="id" :label="'组(共'+total+'组)'" width="100"></el-table-column>
|
|
|
- <el-table-column prop="description" label="规则名称"></el-table-column>
|
|
|
- <el-table-column prop="msg" label="附加信息" show-overflow-tooltip></el-table-column>
|
|
|
- <el-table-column prop="baseType" label="基础规则类型">
|
|
|
+ <ux-grid ref="plxTable" :merge-cells="tdSpanArr" show-overflow style="width: 100%;" height="600px">
|
|
|
+ <ux-table-column field="id" :title="'组(共'+total+'组)'" width="120"></ux-table-column>
|
|
|
+ <ux-table-column field="description" title="规则名称"></ux-table-column>
|
|
|
+ <ux-table-column field="msg" title="附加信息" show-overflow-tooltip></ux-table-column>
|
|
|
+ <ux-table-column field="baseType" title="基础规则类型">
|
|
|
<template slot-scope="scope">
|
|
|
- {{tofind(scope.row,1)}}
|
|
|
+ {{transDataMap(baseTypeList)[scope.row.baseType]}}
|
|
|
</template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="baseLibType" label="基础规则术语类型">
|
|
|
+ </ux-table-column>
|
|
|
+ <ux-table-column prop="baseLibType" title="基础规则术语类型">
|
|
|
<template slot-scope="scope">
|
|
|
- {{tofind(scope.row,2)}}
|
|
|
+ {{transDataMap(baseTermTypeList)[scope.row.baseLibType]}}
|
|
|
</template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="baseLibName" label="基础医学标准术语"></el-table-column>
|
|
|
- <el-table-column prop="baseMinOperator" label="最小域比较符" width="80"></el-table-column>
|
|
|
- <el-table-column prop="baseMinValue" label="最小域值" width="80"></el-table-column>
|
|
|
- <el-table-column prop="baseMinUnit" label="最小域单位" width="80"></el-table-column>
|
|
|
- <el-table-column prop="baseMaxOperator" label="最大域比较符" width="80"></el-table-column>
|
|
|
- <el-table-column prop="baseMaxValue" label="最大域值" width="80"></el-table-column>
|
|
|
- <el-table-column prop="baseMaxUnit" label="最大域单位" width="80"></el-table-column>
|
|
|
- <el-table-column prop="baseEqOperator" label="等于阈值" width="80"></el-table-column>
|
|
|
- <el-table-column prop="baseEqUnit" label="等于域单位" width="80"></el-table-column>
|
|
|
- </el-table>
|
|
|
+ </ux-table-column>
|
|
|
+ <ux-table-column field="baseLibName" title="基础医学标准术语"></ux-table-column>
|
|
|
+ <ux-table-column field="baseMinOperator" title="最小域比较符" width="80"></ux-table-column>
|
|
|
+ <ux-table-column field="baseMinValue" title="最小域值" width="80"></ux-table-column>
|
|
|
+ <ux-table-column field="baseMinUnit" title="最小域单位" width="80"></ux-table-column>
|
|
|
+ <ux-table-column field="baseMaxOperator" title="最大域比较符" width="80"></ux-table-column>
|
|
|
+ <ux-table-column field="baseMaxValue" title="最大域值" width="80"></ux-table-column>
|
|
|
+ <ux-table-column field="baseMaxUnit" title="最大域单位" width="80"></ux-table-column>
|
|
|
+ <ux-table-column field="baseEqOperator" title="等于阈值" width="80"></ux-table-column>
|
|
|
+ <ux-table-column field="baseEqUnit" title="等于域单位" width="80"></ux-table-column>
|
|
|
+ </ux-grid>
|
|
|
</el-main>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import api from '@api/knowledgeLib.js';
|
|
|
- import config from '@api/config.js';
|
|
|
- import utils from '@api/utils.js';
|
|
|
export default {
|
|
|
name: 'CheckRule',
|
|
|
data: function() {
|
|
|
return {
|
|
|
- tableData: [],
|
|
|
- spanArr: [],
|
|
|
+ tdSpanArr: this.mergeCells,
|
|
|
pos: 0,
|
|
|
filter: {
|
|
|
baseLibType: "",
|
|
|
baseLibName: ""
|
|
|
},
|
|
|
baseTermTypeList2: [],
|
|
|
- total: 0
|
|
|
+ total: this.ruleTeamNum,
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
|
- const list = this.$props.rulelist
|
|
|
- const baseTermTypeList1 = this.$props.baseTermTypeList
|
|
|
- this.baseTermTypeList2 = baseTermTypeList1
|
|
|
- this.filter.baseLibName=this.$props.baseLibName
|
|
|
- this.filter.baseLibType=this.$props.baseLibType
|
|
|
- this.tableData = list
|
|
|
- this.getSpanArr(this.tableData)
|
|
|
- this.total = this.tableData.slice(-1)[0].id
|
|
|
+ this.baseTermTypeList2 = this.baseTermTypeList;
|
|
|
+ this.filter.baseLibName=this.baseLibName;
|
|
|
+ this.filter.baseLibType=this.baseLibType;
|
|
|
},
|
|
|
- props: ['rulelist', 'baseTypeList', 'baseTermTypeList', 'row', 'description','baseLibType','baseLibName'],
|
|
|
+ mounted(){
|
|
|
+ this.$refs.plxTable.reloadData(this.rulelist)
|
|
|
+ //this.loading.close();
|
|
|
+ },
|
|
|
+ props: ['loading','mergeCells','rulelist','ruleTeamNum', 'baseTypeList', 'baseTermTypeList', 'row', 'description','baseLibType','baseLibName'],
|
|
|
methods: {
|
|
|
- tofind(row, a) {
|
|
|
- let type = ''
|
|
|
- if (a == 1) {
|
|
|
- type = this.$props.baseTypeList.find(it => it.val == row.baseType)
|
|
|
- } else {
|
|
|
- type = this.$props.baseTermTypeList.find(it => it.val == row.baseLibType)
|
|
|
- }
|
|
|
- return type.name
|
|
|
- },
|
|
|
- objectSpanMethod({
|
|
|
- row,
|
|
|
- column,
|
|
|
- rowIndex,
|
|
|
- columnIndex
|
|
|
- }) {
|
|
|
- if (columnIndex === 1 || columnIndex === 0 || columnIndex === 2) {
|
|
|
- const _row = this.spanArr[rowIndex];
|
|
|
- const _col = _row > 0 ? 1 : 0;
|
|
|
- return {
|
|
|
- rowspan: _row,
|
|
|
- colspan: _col
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
- getSpanArr(data) {
|
|
|
- for (var i = 0; i < data.length; i++) {
|
|
|
- if (i === 0) {
|
|
|
- this.spanArr.push(1);
|
|
|
- this.pos = 0
|
|
|
- } else {
|
|
|
- // 判断当前元素与上一个元素是否相同
|
|
|
- if (data[i].id === data[i - 1].id) {
|
|
|
- this.spanArr[this.pos] += 1;
|
|
|
- this.spanArr.push(0);
|
|
|
- } else {
|
|
|
- this.spanArr.push(1);
|
|
|
- this.pos = i;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
+ transDataMap(data){
|
|
|
+ const obj = {};
|
|
|
+ data.map((it)=>{
|
|
|
+ obj[it.val] = it.name;
|
|
|
+ });
|
|
|
+ return obj;
|
|
|
+ },
|
|
|
getRuleDetail() {
|
|
|
const param = {
|
|
|
baseLibName: this.filter.baseLibName,
|
|
|
baseLibType: this.filter.baseLibType,
|
|
|
- description: this.$props.description,
|
|
|
- libName: this.$props.row.libName,
|
|
|
- libType: this.$props.row.libType,
|
|
|
- ruleType: this.$props.row.ruleType,
|
|
|
+ description: this.description,
|
|
|
+ libName: this.row.libName,
|
|
|
+ libType: this.row.libType,
|
|
|
+ ruleType: this.row.ruleType,
|
|
|
+ }
|
|
|
+ api.zskgetRuleDetail(param).then((res) => {
|
|
|
+ if (res.data.code == "0") {
|
|
|
+ let datalist =[]
|
|
|
+ const data=res.data.data.ruleConditionDTOList;
|
|
|
+ this.total = data.length;
|
|
|
+ let mergeArr = [];
|
|
|
+ for(let i in data){
|
|
|
+ let datai = data[i];
|
|
|
+ const dtoList = datai.ruleBaseDTOList;
|
|
|
+ for(let j=0;j<dtoList.length;j++){
|
|
|
+ const isFirst = j===0;
|
|
|
+ if(isFirst){
|
|
|
+ const len = datalist.length;
|
|
|
+ mergeArr.push({ row: len, col: 0, rowspan: dtoList.length, colspan: 1 },
|
|
|
+ { row: len, col: 1, rowspan: dtoList.length, colspan: 1 },
|
|
|
+ { row: len, col: 2, rowspan: dtoList.length, colspan: 1 });
|
|
|
+ }
|
|
|
+ datalist.push({
|
|
|
+ id: +i+1,
|
|
|
+ rowspan:isFirst?dtoList.length:0,
|
|
|
+ colspan:isFirst?1:0,
|
|
|
+ ruleGroup:datai.ruleGroup,
|
|
|
+ msg:datai.msg,
|
|
|
+ description:datai.description,
|
|
|
+ ...dtoList[j]
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.tdSpanArr=mergeArr;
|
|
|
+ this.$refs.plxTable.reloadData(datalist);
|
|
|
+ }else{
|
|
|
+ this.$message(res.data.msg||'获取详情失败,请稍后重试');
|
|
|
}
|
|
|
- api.zskgetRuleDetail(param).then((res) => {
|
|
|
- if (res.data.code == "0") {
|
|
|
- // this.rulelist = res.data.data
|
|
|
- let datalist = []
|
|
|
- const data = res.data.data.ruleConditionDTOList
|
|
|
- for (let i in data) {
|
|
|
- for (let j of data[i].ruleBaseDTOList) {
|
|
|
- let a = parseInt(i)
|
|
|
- datalist.push({
|
|
|
- id: a + 1,
|
|
|
- msg: data[i].msg,
|
|
|
- description: data[i].description,
|
|
|
- ...j
|
|
|
- })
|
|
|
- }
|
|
|
- }
|
|
|
- this.tableData = datalist
|
|
|
- this.getSpanArr(this.tableData)
|
|
|
- }
|
|
|
- })
|
|
|
+ })
|
|
|
.catch((error) => {
|
|
|
- console.log(error);
|
|
|
+ this.$message(error.msg||'接口出错');
|
|
|
});
|
|
|
},
|
|
|
}
|