DiagCheckRule.vue 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243
  1. <template>
  2. <div>
  3. <div style="margin: 10px 0">
  4. <span v-if="description" class="span1"
  5. ><i>规则名称:</i>{{ description }}</span
  6. >
  7. <span class="span1"><i>规则类型:</i>{{ row.ruleTypeName || "-" }}</span>
  8. <span class="span1"
  9. ><i>规则术语类型:</i>{{ row.libTypeName || "-" }}</span
  10. >
  11. <span class="span1"><i>医学标准术语:</i>{{ row.libName || "-" }}</span>
  12. <span v-if="baseTermTypeName" class="span1"
  13. ><i>基础规则术语类型:</i>{{ baseTermTypeName }}</span
  14. >
  15. <span v-if="baseLibName" class="span1"
  16. ><i>基础医学标准术语:</i>{{ baseLibName }}</span
  17. >
  18. <!--<el-form :inline="true" style="margin-top: 10px;height: 45px;">
  19. <el-form-item label="基础规则术语类型:">
  20. <el-select v-model="filter.baseLibType" clearable placeholder="请选择" size="mini">
  21. <el-option v-for="item in baseTermTypeList2" :key="item.val" :label="item.name"
  22. :value="item.val">
  23. </el-option>
  24. </el-select>
  25. </el-form-item>
  26. <el-form-item label="基础医学标准术语:">
  27. <el-input size="mini" v-model="filter.baseLibName" placeholder="请输入" clearable></el-input>
  28. </el-form-item>
  29. <el-form-item>
  30. <el-button size="mini" @click="getRuleDetail">确认</el-button>
  31. </el-form-item>
  32. </el-form>-->
  33. </div>
  34. <el-main>
  35. <ux-grid
  36. ref="plxTable"
  37. :merge-cells="tdSpanArr"
  38. show-overflow
  39. style="width: 100%"
  40. height="600px"
  41. >
  42. <ux-table-column
  43. field="id"
  44. :title="'组(共' + total + '组)'"
  45. width="120"
  46. ></ux-table-column>
  47. <ux-table-column field="description" title="规则名称"></ux-table-column>
  48. <ux-table-column field="hasSubCond" title="子条件">
  49. <template slot-scope="scope">
  50. {{ scope.row.hasSubCond ? "有" : "无" }}
  51. </template>
  52. </ux-table-column>
  53. <ux-table-column
  54. field="msg"
  55. title="附加信息"
  56. show-overflow-tooltip
  57. ></ux-table-column>
  58. <ux-table-column field="baseType" title="基础规则类型">
  59. <template slot-scope="scope">
  60. {{ transDataMap(baseTypeList)[scope.row.baseType] }}
  61. </template>
  62. </ux-table-column>
  63. <ux-table-column prop="baseLibType" title="基础规则术语类型">
  64. <template slot-scope="scope">
  65. {{ transDataMap(baseTermTypeList)[scope.row.baseLibType] }}
  66. </template>
  67. </ux-table-column>
  68. <ux-table-column
  69. field="baseLibName"
  70. title="基础医学标准术语"
  71. ></ux-table-column>
  72. <ux-table-column
  73. field="baseMinOperator"
  74. title="最小域比较符"
  75. width="80"
  76. ></ux-table-column>
  77. <ux-table-column
  78. field="baseMinValue"
  79. title="最小域值"
  80. width="80"
  81. ></ux-table-column>
  82. <ux-table-column
  83. field="baseMinUnit"
  84. title="最小域单位"
  85. width="80"
  86. ></ux-table-column>
  87. <ux-table-column
  88. field="baseMaxOperator"
  89. title="最大域比较符"
  90. width="80"
  91. ></ux-table-column>
  92. <ux-table-column
  93. field="baseMaxValue"
  94. title="最大域值"
  95. width="80"
  96. ></ux-table-column>
  97. <ux-table-column
  98. field="baseMaxUnit"
  99. title="最大域单位"
  100. width="80"
  101. ></ux-table-column>
  102. <ux-table-column
  103. field="baseEqValue"
  104. title="等于阈值"
  105. width="80"
  106. ></ux-table-column>
  107. <ux-table-column
  108. field="baseEqUnit"
  109. title="等于域单位"
  110. width="80"
  111. ></ux-table-column>
  112. </ux-grid>
  113. </el-main>
  114. </div>
  115. </template>
  116. <script>
  117. import api from "@api/knowledgeLib.js";
  118. export default {
  119. name: "CheckRule",
  120. data: function () {
  121. return {
  122. tdSpanArr: this.mergeCells,
  123. pos: 0,
  124. filter: {
  125. baseLibType: "",
  126. baseLibName: "",
  127. },
  128. baseTermTypeList2: [],
  129. total: this.ruleTeamNum,
  130. };
  131. },
  132. computed: {
  133. baseTermTypeName() {
  134. const item = this.baseTermTypeList.filter((it) => {
  135. return it.val === this.filterp.baseLibType;
  136. });
  137. return item[0] ? item[0].name : "";
  138. },
  139. },
  140. created() {
  141. this.baseTermTypeList2 = this.baseTermTypeList;
  142. this.filter.baseLibName = this.baseLibName;
  143. this.filter.baseLibType = this.baseLibType;
  144. },
  145. mounted() {
  146. this.$refs.plxTable.reloadData(this.rulelist);
  147. //this.loading.close();
  148. },
  149. props: [
  150. "loading",
  151. "mergeCells",
  152. "filterp",
  153. "rulelist",
  154. "ruleTeamNum",
  155. "baseTypeList",
  156. "baseTermTypeList",
  157. "row",
  158. "description",
  159. "baseLibType",
  160. "baseLibName",
  161. ],
  162. methods: {
  163. transDataMap(data) {
  164. const obj = {};
  165. data.map((it) => {
  166. obj[it.val] = it.name;
  167. });
  168. return obj;
  169. },
  170. getRuleDetail() {
  171. console.log(456);
  172. const param = {
  173. baseLibName: this.filter.baseLibName,
  174. baseLibType: this.filter.baseLibType,
  175. description: this.description,
  176. libName: this.row.libName,
  177. libType: this.row.libType,
  178. ruleType: this.row.ruleType,
  179. };
  180. api
  181. .zskgetRuleDetail(param)
  182. .then((res) => {
  183. if (res.data.code == "0") {
  184. let datalist = [];
  185. const data = res.data.data.ruleConditionDTOList;
  186. this.total = data.length;
  187. let mergeArr = [];
  188. for (let i in data) {
  189. let datai = data[i];
  190. const dtoList = datai.ruleBaseDTOList;
  191. for (let j = 0; j < dtoList.length; j++) {
  192. const isFirst = j === 0;
  193. if (isFirst) {
  194. const len = datalist.length;
  195. mergeArr.push(
  196. { row: len, col: 0, rowspan: dtoList.length, colspan: 1 },
  197. { row: len, col: 1, rowspan: dtoList.length, colspan: 1 },
  198. { row: len, col: 2, rowspan: dtoList.length, colspan: 1 }
  199. );
  200. }
  201. datalist.push({
  202. id: +i + 1,
  203. rowspan: isFirst ? dtoList.length : 0,
  204. colspan: isFirst ? 1 : 0,
  205. ruleGroup: datai.ruleGroup,
  206. msg: datai.msg,
  207. description: datai.description,
  208. ...dtoList[j],
  209. });
  210. }
  211. }
  212. this.tdSpanArr = mergeArr;
  213. this.$refs.plxTable.reloadData(datalist);
  214. } else {
  215. this.$message(res.data.msg || "获取详情失败,请稍后重试");
  216. }
  217. })
  218. .catch((error) => {
  219. this.$message(error.msg || "接口出错");
  220. });
  221. },
  222. },
  223. };
  224. </script>
  225. <style scoped lang="less">
  226. /deep/.el-table .cell {
  227. line-height: 25px;
  228. }
  229. .span1 {
  230. i {
  231. font-weight: bolder;
  232. }
  233. margin: 0 60px 0 0;
  234. }
  235. /deep/.el-form--inline .el-form-item__label {
  236. font-weight: bolder;
  237. font-size: 14px;
  238. }
  239. </style>