Pārlūkot izejas kodu

规则查询修改

mfmf 3 gadi atpakaļ
vecāks
revīzija
5784ed5624

+ 94 - 22
src/components/knowledgeExtra/CheckRule.vue

@@ -1,38 +1,58 @@
 <template>
 	<div>
-		<span >规则类型:{{ruleType||'-'}}</span>
-		<span style="margin: 0 100px;">规则术语类型:{{libType||'-'}}</span>
-		<span>医学标准术语:{{libName||'-'}}</span>
+		<div style="margin-top: 10px;">
+			<span class="span1">规则类型:</span>{{row.ruleTypeName||'-'}}
+			<span class="span1" style="margin-left:100px;">规则术语类型:</span>{{row.libTypeName||'-'}}
+			<span class="span1" style="margin-left:100px;">医学标准术语:</span>{{row.libName||'-'}}
+			<el-form :inline="true" style="margin-top: 10px;">
+				<el-form-item label="基础规则术语类型:">
+					<el-select v-model="filter.baseLibType" clearable placeholder="请选择" size="mini">
+						<el-option v-for="item in baseTermTypeList2" :key="item.val" :label="item.name"
+							:value="item.val">
+						</el-option>
+					</el-select>
+				</el-form-item>
+				<el-form-item label="基础医学标准术语:">
+					<el-input size="mini" v-model="filter.baseLibName" placeholder="请输入" clearable></el-input>
+				</el-form-item>
+				<el-form-item>
+					<el-button size="mini" @click="getRuleDetail">确认</el-button>
+				</el-form-item>
+			</el-form>
+		</div>
 		<el-main>
-			<el-table :data="tableData" :span-method="objectSpanMethod" border style="width: 100%;" height="347px">
-				<el-table-column prop="ruleGroup" label="组"></el-table-column>
+			<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="ruleBaseDTOList[0].baseType" label="基础规则类型">
+				<el-table-column prop="baseType" label="基础规则类型">
 					<template slot-scope="scope">
-						{{tofind(scope.row.ruleBaseDTOList[0],1)}}
+						{{tofind(scope.row,1)}}
 					</template>
 				</el-table-column>
-				<el-table-column prop="ruleBaseDTOList[0].baseLibType" label="基础规则术语类型">
+				<el-table-column prop="baseLibType" label="基础规则术语类型">
 					<template slot-scope="scope">
-						{{tofind(scope.row.ruleBaseDTOList[0],2)}}
+						{{tofind(scope.row,2)}}
 					</template>
 				</el-table-column>
-				<el-table-column prop="ruleBaseDTOList[0].baseLibName" label="基础医学标准术语"></el-table-column>
-				<el-table-column prop="ruleBaseDTOList[0].baseMinOperator" label="最小域比较符"></el-table-column>
-				<el-table-column prop="ruleBaseDTOList[0].baseMinValue" label="最小域值"></el-table-column>
-				<el-table-column prop="ruleBaseDTOList[0].baseMinUnit" label="最小域单位"></el-table-column>
-				<el-table-column prop="ruleBaseDTOList[0].baseMaxOperator" label="最大域比较符"></el-table-column>
-				<el-table-column prop="ruleBaseDTOList[0].baseMaxValue" label="最大域值"></el-table-column>
-				<el-table-column prop="ruleBaseDTOList[0].baseMaxUnit" label="最大域单位"></el-table-column>
-				<el-table-column prop="ruleBaseDTOList[0].baseEqOperator" label="等于阈值"></el-table-column>
-				<el-table-column prop="ruleBaseDTOList[0].baseEqUnit" label="等于域单位"></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>
 		</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() {
@@ -40,14 +60,25 @@
 				tableData: [],
 				spanArr: [],
 				pos: 0,
+				filter: {
+					baseLibType: "",
+					baseLibName: ""
+				},
+				baseTermTypeList2: [],
+				total: 0
 			};
 		},
 		created() {
-			const list = this.$props.rulelist.ruleConditionDTOList
+			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
 		},
-		props: ['rulelist', 'baseTypeList', 'baseTermTypeList', 'ruleType', 'libType', 'libName'],
+		props: ['rulelist', 'baseTypeList', 'baseTermTypeList', 'row', 'description','baseLibType','baseLibName'],
 		methods: {
 			tofind(row, a) {
 				let type = ''
@@ -80,7 +111,7 @@
 						this.pos = 0
 					} else {
 						// 判断当前元素与上一个元素是否相同
-						if (data[i].ruleGroup === data[i - 1].ruleGroup) {
+						if (data[i].id === data[i - 1].id) {
 							this.spanArr[this.pos] += 1;
 							this.spanArr.push(0);
 						} else {
@@ -90,13 +121,54 @@
 					}
 				}
 			},
+			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,
+				}
+				api.zskgetRuleDetail(param).then((res) => {
+						if (res.data.code == "0") {
+							// this.rulelist = res.data.data
+							console.log(res.data.data.ruleConditionDTOList)
+							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
+						}
+					})
+					.catch((error) => {
+						console.log(error);
+					});
+			},
 		}
 	};
 </script>
 
 <style scoped lang="less">
-	/deep/.el-table .cell{
+	/deep/.el-table .cell {
 		line-height: 25px;
 	}
 
+	.span1 {
+		font-weight: bolder;
+	}
+
+	/deep/.el-form--inline .el-form-item__label {
+		font-weight: bolder;
+		font-size: 14px;
+	}
 </style>

+ 28 - 11
src/components/knowledgeExtra/RuleCheck.vue

@@ -25,7 +25,7 @@
 			<el-form class="secLine" :inline="true">
 				<el-form-item label="基础规则术语类型:">
 					<el-select v-model="filter.baseLibType" clearable placeholder="请选择" size="mini">
-						<el-option v-for="item in baseTypeList" :key="item.val" :label="item.name" :value="item.val">
+						<el-option v-for="item in baseTermTypeList" :key="item.val" :label="item.name" :value="item.val">
 						</el-option>
 					</el-select>
 				</el-form-item>
@@ -56,11 +56,9 @@
 				:total="total"></el-pagination>
 		</div>
 		<el-dialog title="查看" :visible.sync="dialogVisible" :before-close="closecheckDialog" width="80rem"
-			v-if="dialogVisible" :close-on-click-modal="false">
+			v-if="dialogVisible" :close-on-click-modal="false" :fullscreen="true">
 			<CheckRule :rulelist="rulelist" :baseTypeList="baseTypeList" :baseTermTypeList="baseTermTypeList"
-				:ruleType="filter.ruleType?ruleTypeList.find(it => it.val == filter.ruleType).name:''"
-				:libType="filter.libType?ruleTermTypeList.find(it => it.val == filter.libType).name:''"
-				:libName="filter.libName?filter.libName:''">
+				:row="row" :description="filter.description" :baseLibType="filter.baseLibType" :baseLibName="filter.baseLibName">
 			</CheckRule>
 			<!-- <span slot="footer" class="dialog-footer">
 				<el-button @click="closecheckDialog" style="margin-right: 15px">关闭</el-button>
@@ -108,6 +106,7 @@
 				total: 0,
 				titleWidth: '970px', //头部最小宽度
 				dialogVisible: false,
+				row:{},
 			};
 		},
 		components: {
@@ -153,7 +152,6 @@
 							this.ruleTermTypeList = data[-102]
 							this.baseTypeList = data[-103]
 							this.baseTermTypeList = data[-104]
-							console.log(this.baseTypeList)
 							// const arr = data['20'].map(it => it.val);
 							// //this.dict = arr.join(",");
 							// //this.msgDict=(data['21'].map((it)=>it.val)||[]).join(",");
@@ -259,7 +257,9 @@
 				});
 			},
 			checkData(row) {
-				if (!this.searched) {
+				console.log(row)
+				this.row=row
+				if(!this.searched) {
 					this.clearFilter();
 				}
 				const param = {
@@ -272,7 +272,23 @@
 				}
 				api.zskgetRuleDetail(param).then((res) => {
 						if (res.data.code == "0") {
-							this.rulelist = res.data.data
+							// this.rulelist = res.data.data
+							console.log(res.data.data.ruleConditionDTOList)
+							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.rulelist=datalist
+							console.log(datalist)
 							this.dialogVisible = true
 						}
 					})
@@ -339,7 +355,8 @@
 			color: #f19061;
 		}
 	}
-	// /deep/.el-dialog__footer{
-	// 	 padding-bottom:10px
-	// }
+
+	/deep/.el-dialog__body{
+		 padding-top:0px
+	}
 </style>