AddNewRule.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700
  1. <style lang="less" scoped>
  2. // @import "../../less/admin.less";
  3. #AddRuleContent {
  4. width: 100%;
  5. min-width: 1000px;
  6. padding: 20px;
  7. padding-top: 50px;
  8. padding-bottom: 0;
  9. box-sizing: border-box;
  10. .table_form {
  11. width: 100%;
  12. box-sizing: border-box;
  13. background: #fff;
  14. padding: 20px;
  15. padding-bottom: 0;
  16. display: flex;
  17. flex-wrap: wrap;
  18. .table_cell {
  19. flex: 1;
  20. min-width: 25%;
  21. }
  22. }
  23. /deep/ .el-input--mini .el-input__inner,
  24. .el-select {
  25. width: 100%;
  26. font-size: 14px;
  27. }
  28. .tip_text {
  29. // margin-top: -8px;
  30. font-size: 12px;
  31. color: red;
  32. line-height: 16px;
  33. // transform: scale(.8, .8);
  34. }
  35. .form_btn {
  36. width: 100%;
  37. background: #fff;
  38. padding-bottom: 20px;
  39. text-align: center;
  40. }
  41. /deep/ .el-form-item.is-success .el-input__inner,
  42. .el-form-item.is-success .el-textarea__inner {
  43. border-color: #c9c9c9 !important;
  44. }
  45. /deep/ .el-form-item.is-success .el-textarea__inner{
  46. border-color: #c9c9c9 !important;
  47. }
  48. /deep/ .el-form-item.is-success .el-textarea__inner{
  49. border-color: #c9c9c9 !important;
  50. }
  51. }
  52. </style>
  53. <template>
  54. <div>
  55. <crumbs
  56. :title="title"
  57. :param="$route.params"
  58. linkTo="ZskRuleManager"
  59. ></crumbs>
  60. <div id="AddRuleContent">
  61. <el-form size="mini" :model="form" ref="ruleForm">
  62. <div class="table_form">
  63. <div class="table_cell">
  64. <!-- 规则名称 -->
  65. <el-form-item
  66. label-width="130px"
  67. label="规则名称:"
  68. :rules="rules.parDescription"
  69. prop="parDescription"
  70. >
  71. <el-input
  72. style="width: 100%"
  73. v-model.trim="form.parDescription"
  74. />
  75. </el-form-item>
  76. </div>
  77. <div class="table_cell">
  78. <!-- 规则类型 -->
  79. <el-form-item
  80. label-width="130px"
  81. label="规则类型:"
  82. :rules="rules.parRuleType"
  83. prop="parRuleType"
  84. >
  85. <el-select
  86. v-model="form.parRuleType"
  87. placeholder="请选择"
  88. @change="ruleTypeChange"
  89. >
  90. <el-option
  91. v-for="item in ruleTypeList"
  92. :key="item.id"
  93. :label="item.name"
  94. :value="item.id"
  95. >
  96. </el-option>
  97. </el-select>
  98. <div class="tip_text">
  99. 注:更改规则类型,将会清空已填写的规则内容~
  100. </div>
  101. </el-form-item>
  102. </div>
  103. <div class="table_cell">
  104. <!-- 规则术语类型: -->
  105. <el-form-item
  106. label-width="130px"
  107. label="规则术语类型:"
  108. :rules="rules.parLenCode"
  109. prop="parLenCode"
  110. >
  111. <el-select
  112. v-model="form.parLenCode"
  113. placeholder="请选择"
  114. @change="ruleTermChange"
  115. >
  116. <el-option
  117. v-for="item in ruleTermTypeList"
  118. :key="item.id"
  119. :label="item.name"
  120. :value="item.code"
  121. >
  122. </el-option>
  123. </el-select>
  124. <div class="tip_text">
  125. 注:更改规则术语类型,将会清空已填写的规则内容~
  126. </div>
  127. </el-form-item>
  128. </div>
  129. <div class="table_cell">
  130. <el-form-item
  131. label-width="130px"
  132. label="医学标准术语:"
  133. :style="{ height: '100%' }"
  134. :rules="rules.parConceptId"
  135. prop="parConceptId"
  136. >
  137. <el-select
  138. clearable
  139. filterable
  140. remote
  141. :remote-method="searchConcept"
  142. v-model.trim="form.parConceptId"
  143. @change="parConceptIdChange"
  144. >
  145. <el-option
  146. v-for="item in conceptList"
  147. :key="item.conceptId"
  148. :label="item.conceptName"
  149. :value="item.conceptId"
  150. >
  151. </el-option>
  152. </el-select>
  153. </el-form-item>
  154. </div>
  155. <div class="table_cell" v-if="showHasSub" style="max-width: 25%">
  156. <el-form-item
  157. label-width="130px"
  158. label="有无子条件:"
  159. :rules="rules.parHasSub"
  160. prop="parHasSub"
  161. >
  162. <el-select
  163. v-model="form.parHasSub"
  164. placeholder="请选择"
  165. @change="hasSubChange"
  166. >
  167. <el-option label="有" :value="1"></el-option>
  168. <el-option label="无" :value="0"></el-option>
  169. </el-select>
  170. </el-form-item>
  171. </div>
  172. <div
  173. class="table_cell"
  174. style="flex: 3; max-width: 50%"
  175. v-if="showMsg"
  176. >
  177. <el-form-item
  178. label-width="130px"
  179. label="附加信息:"
  180. :rules="rules.parMsg"
  181. prop="parMsg"
  182. >
  183. <el-input
  184. type="textarea"
  185. :rows="1"
  186. placeholder="请输入附加信息"
  187. v-model.trim="form.parMsg"
  188. ></el-input>
  189. </el-form-item>
  190. </div>
  191. </div>
  192. <!-- 表格 -->
  193. <AddNewRuleTable
  194. v-if="form.parHasSub && tableShow"
  195. :klRuleByIdSub="form.klRuleByIdSub"
  196. :maxNum="subRuleMaxNum"
  197. @subTypeChange="subTypeChange"
  198. @searchConcept="searchConcept"
  199. @addGroup="addGroup"
  200. @delGroup="delGroup"
  201. @delGroupChild="delGroupChild"
  202. @setFormData="setFormData"
  203. @editKlRuleByIdSub="editKlRuleByIdSub"
  204. @clearValidate="clearValidate"
  205. />
  206. <el-form-item>
  207. <div class="form_btn">
  208. <el-button
  209. type="primary"
  210. size="medium "
  211. @click="submitForm('ruleForm')"
  212. >确定</el-button
  213. >
  214. </div>
  215. </el-form-item>
  216. </el-form>
  217. </div>
  218. </div>
  219. </template>
  220. <script type="text/javascript">
  221. import api from "@api/knowledgeLib.js";
  222. import { formRules } from "./rules";
  223. import AddNewRuleTable from "./AddNewRuleTable";
  224. export default {
  225. name: "AddRule",
  226. data() {
  227. return {
  228. title: "规则维护-添加规则",
  229. ruleTypeList: [], //规则类型列表 1
  230. ruleTermTypeList: [], //规则术语类型列表 2
  231. conceptList: [], //医学标准术语列表 3
  232. baseTypeList: [], //基础规则类型列表 4
  233. baseTermTypeList: [], //基础规则术语类型 5
  234. subRuleMaxNum: null, //规则内容中规则的限制个数
  235. isCopy: false,
  236. parId: null,
  237. msgDict: "", //显示附加信息的类型
  238. firstPlace: null,
  239. tableShow: true,
  240. form: {
  241. parDescription: "",
  242. parRuleType: "",
  243. parConceptId: "",
  244. parlibName: "",
  245. parLenName: "",
  246. parHasSub: undefined,
  247. parLenCode: "",
  248. parMsg: "",
  249. klRuleByIdSub: []
  250. },
  251. rules: formRules
  252. };
  253. },
  254. created() {
  255. this.getTypeList();
  256. this.setDict();
  257. const param = this.$route.params;
  258. let info = param.data;
  259. if (info) {
  260. this.parId = info.parId;
  261. this.isCopy = param.copy;
  262. this.title = "规则维护-" + (this.isCopy ? "复制" : "修改") + "规则";
  263. this.form = JSON.parse(JSON.stringify(info));
  264. // 编辑初始化选择框
  265. this.initEdidData();
  266. }
  267. },
  268. methods: {
  269. clearValidate(data){
  270. this.$refs.ruleForm.clearValidate(data)
  271. },
  272. // 编辑初始化
  273. async initEdidData() {
  274. // 规则术语类型初始化
  275. const newruleTermTypeList = await this.ruleTypeList.find(
  276. (it) => it.id == this.form.parRuleType
  277. );
  278. this.ruleTermTypeList = await newruleTermTypeList.subMenuList;
  279. // 基础规则类型初始化
  280. const obj = await this.ruleTermTypeList.find(
  281. (it1) => it1.code == this.form.parLenCode
  282. );
  283. this.baseTypeList = obj.subMenuList;
  284. this.subRuleMaxNum = obj.number;
  285. this.conceptList = [
  286. { conceptName: this.form.parlibName, conceptId: this.form.parConceptId }
  287. ];
  288. if (this.form.parConceptId && this.checkFirstPlace && this.conceptList) {
  289. this.firstPlace = this.conceptList.find(
  290. (it) => it.conceptId === this.form.parConceptId
  291. );
  292. if (this.firstPlace) {
  293. this.firstPlace["checkedType"] = this.ruleTermCodeStr;
  294. }
  295. } else if (!this.form.parConceptId) {
  296. this.setInitGroupData();
  297. this.firstPlace = null;
  298. } else {
  299. this.firstPlace = null;
  300. }
  301. await this.form.klRuleByIdSub.forEach((item, i, arr) => {
  302. item.groupId = "groupId" + item.groupType;
  303. item.groupChildId = "child" + item.subId;
  304. //TODO => 赋值时一定要注意set更新页面
  305. this.$set(item, "baseTypes", [...this.baseTypeList]);
  306. this.$set(
  307. item,
  308. "baseTermTypeList",
  309. item.baseTypes.find((it2) => it2.type === item.subType).subMenuList
  310. );
  311. this.$set(item, "conceptList", [
  312. {
  313. conceptName: item.subLibName || item.subConceptName,
  314. conceptId: item.subConceptId
  315. }
  316. ]);
  317. if (item.subMaxOperator || item.subMinOperator) {
  318. item.dataType = "1";
  319. } else if (item.subEqValue) {
  320. item.dataType = "2";
  321. }
  322. // disable
  323. if (this.form.parHasSub && this.firstPlace) {
  324. if (arr[i - 1] && arr[i - 1].groupId == item.groupId) {
  325. this.$set(item, "disabled", false);
  326. } else {
  327. this.$set(item, "disabled", true);
  328. }
  329. }
  330. });
  331. },
  332. // 提交
  333. submitForm(formName) {
  334. this.$refs[formName].validate((valid) => {
  335. if (valid) {
  336. let params = JSON.parse(JSON.stringify(this.form));
  337. params.klRuleInfoSaveSub = params.klRuleByIdSub;
  338. delete params.klRuleByIdSub;
  339. params.klRuleInfoSaveSub.forEach((item, i, arr) => {
  340. if (i === 0) {
  341. item.groupType = 1;
  342. } else {
  343. if (item.groupId == arr[i - 1].groupId) {
  344. item.groupType = arr[i - 1].groupType;
  345. } else {
  346. item.groupType = arr[i - 1].groupType + 1;
  347. }
  348. }
  349. });
  350. params.klRuleInfoSaveSub.forEach((ite) => {
  351. delete ite.groupId;
  352. delete ite.groupChildId;
  353. delete ite.rowIndex;
  354. delete ite.baseTypes;
  355. delete ite.baseTermTypeList;
  356. delete ite.conceptList;
  357. });
  358. if (this.parId) {
  359. params.parId = this.isCopy ? undefined : this.parId;
  360. params.parStatus = this.isCopy ? 1 : this.form.parStatus;
  361. }
  362. this.saveRule(params);
  363. } else {
  364. return false;
  365. }
  366. });
  367. },
  368. // 子集修改父级的数组
  369. setFormData(index, data) {
  370. this.form.klRuleByIdSub[index].conceptList = data;
  371. },
  372. // table_form 规则类型选中
  373. ruleTypeChange(val) {
  374. this.form.parLenCode = "";
  375. this.form.parMsg = "";
  376. const obj = this.ruleTypeList.find((it) => it.id === val);
  377. this.ruleTermTypeList = obj.subMenuList;
  378. this.subRuleMaxNum = undefined;
  379. this.setInitGroupData();
  380. },
  381. // table_form 规则术语类型选中
  382. ruleTermChange(val) {
  383. this.form.parMsg = "";
  384. const obj = this.ruleTermTypeList.find((it) => it.code === val);
  385. this.form.parLenName = obj.name;
  386. this.baseTypeList = obj.subMenuList;
  387. this.subRuleMaxNum = obj.number;
  388. this.form.parHasSub = obj.subMenuList.length ? 1 : 0;
  389. this.setInitGroupData();
  390. },
  391. // 医学标准术语
  392. parConceptIdChange(val) {
  393. this.$nextTick(() => {
  394. if (val && this.checkFirstPlace && this.conceptList) {
  395. this.firstPlace = this.conceptList.find((it) => it.conceptId === val);
  396. if (this.firstPlace) {
  397. this.firstPlace["checkedType"] = this.ruleTermCodeStr;
  398. }
  399. } else if (!val) {
  400. this.setInitGroupData();
  401. this.firstPlace = null;
  402. } else {
  403. this.firstPlace = null;
  404. }
  405. if (this.form.parHasSub && this.firstPlace) {
  406. const dict =
  407. localStorage
  408. .getItem("zskDicts")
  409. .match(new RegExp(this.firstPlace.checkedType + "-\\d+", "g")) ||
  410. [];
  411. const types = dict[0].split("-");
  412. let obj = this.form.klRuleByIdSub;
  413. obj.forEach((item, i, arr) => {
  414. if (arr[i - 1] && arr[i - 1].groupId == item.groupId) {
  415. this.$set(item, "disabled", false);
  416. } else {
  417. this.$set(item, "disabled", true);
  418. this.$set(item, "subType", parseInt(types[2]));
  419. const subobj = this.baseTypeList.find(
  420. (it) => it.type == types[2]
  421. );
  422. this.$set(item, "baseTermTypeList", subobj.subMenuList);
  423. this.$set(item, "subLenCode", types[1]);
  424. this.$set(item, "subDescription", this.firstPlace.conceptName);
  425. this.$set(item, "subConceptId", this.firstPlace.conceptId);
  426. this.$set(item, "subConceptName", this.firstPlace.conceptName);
  427. this.$set(item, "conceptList", [this.firstPlace]);
  428. }
  429. });
  430. this.$set(this.form, "klRuleByIdSub", obj);
  431. }
  432. });
  433. },
  434. // 初始化表格
  435. setInitGroupData(init) {
  436. this.tableShow = false;
  437. const date = new Date().valueOf();
  438. this.$nextTick(() => {
  439. if (this.form.parHasSub && this.form.parHasSub != 0) {
  440. this.$set(this.form, "klRuleByIdSub", [
  441. {
  442. groupId: date,
  443. groupChildId: "child" + new Date().valueOf(),
  444. baseTypes: this.baseTypeList,
  445. baseTermTypeList: [],
  446. conceptList: [],
  447. subDescription: "",
  448. parRuleType: "",
  449. subConceptId: "",
  450. subType: "",
  451. subMaxOperator: "",
  452. subMaxUnit: "",
  453. subMaxValue: "",
  454. subMinOperator: "",
  455. subMinUnit: "",
  456. subMinValue: "",
  457. subEqValue: "",
  458. subLenCode: "",
  459. dataType: ""
  460. }
  461. ]);
  462. } else {
  463. this.$set(this.form, "klRuleByIdSub", []);
  464. }
  465. if (!init) {
  466. this.form.parConceptId = ""; //医学标准术语清空
  467. this.conceptList = []; //下拉列表清空
  468. this.firstPlace = null;
  469. }
  470. this.tableShow = true;
  471. });
  472. },
  473. // 有无子条件切换
  474. hasSubChange(val) {
  475. if (val) {
  476. this.setInitGroupData(true);
  477. } else {
  478. this.form.klRuleByIdSub = [];
  479. }
  480. },
  481. // 基础规则类型切换
  482. subTypeChange(val, index) {
  483. // index
  484. const obj = this.baseTypeList.find((it) => it.type === val);
  485. this.form.klRuleByIdSub[index].baseTermTypeList = obj.subMenuList;
  486. this.form.klRuleByIdSub[index].subLenCode = "";
  487. this.form.klRuleByIdSub[index].dataType = "";
  488. this.clearConcept(index);
  489. this.clearNumText(index);
  490. },
  491. clearConcept(index) {
  492. this.form.klRuleByIdSub[index].subConceptId = "";
  493. this.conceptList = [];
  494. },
  495. clearNumText(index) {
  496. this.form.klRuleByIdSub[index].subMaxOperator = "";
  497. this.form.klRuleByIdSub[index].subMaxValue = "";
  498. this.form.klRuleByIdSub[index].subMaxUnit = "";
  499. this.form.klRuleByIdSub[index].subMinOperator = "";
  500. this.form.klRuleByIdSub[index].subMinValue = "";
  501. this.form.klRuleByIdSub[index].subMinUnit = "";
  502. this.form.klRuleByIdSub[index].subEqValue = "";
  503. this.form.klRuleByIdSub[index].subEqOperator = "";
  504. },
  505. editKlRuleByIdSub(data) {
  506. this.form.klRuleByIdSub = data;
  507. },
  508. // 添加分组 || 规则
  509. addGroup(date, arg = { index: null, groupId: null }) {
  510. /**
  511. * @params
  512. * date:存在则添加规则 不存在则添加分组
  513. * arg:{index:添加规则用索引,groupId:添加分组用确切id}
  514. */
  515. !date && (date = new Date().valueOf());
  516. const obj = {
  517. groupId: date,
  518. groupChildId: "child" + new Date().valueOf(),
  519. baseTypes: this.baseTypeList,
  520. baseTermTypeList: [],
  521. conceptList: [],
  522. subDescription: "",
  523. parRuleType: "",
  524. subConceptId: "",
  525. subType: "",
  526. subMaxOperator: "",
  527. subMaxUnit: "",
  528. subMaxValue: "",
  529. subMinOperator: "",
  530. subMinUnit: "",
  531. subMinValue: "",
  532. subEqValue: "",
  533. subLenCode: "",
  534. dataType: ""
  535. };
  536. if (typeof arg.index == "number") {
  537. // 添加规则 直接在当前位置之后添加
  538. this.form.klRuleByIdSub.splice(arg.index + 1, 0, obj);
  539. } else {
  540. // 添加分组 在列表中相同groupId之后添加
  541. // 添加分组时判断是否需要加disabled和添加默认值
  542. if (this.form.parHasSub && this.firstPlace) {
  543. obj.disabled = true;
  544. const dict =
  545. localStorage
  546. .getItem("zskDicts")
  547. .match(new RegExp(this.firstPlace.checkedType + "-\\d+", "g")) ||
  548. [];
  549. const types = dict[0].split("-");
  550. this.$set(obj, "disabled", true);
  551. this.$set(obj, "subType", parseInt(types[2]));
  552. const subobj = this.baseTypeList.find((it) => it.type == types[2]);
  553. this.$set(obj, "baseTermTypeList", subobj.subMenuList);
  554. this.$set(obj, "subLenCode", types[1]);
  555. this.$set(obj, "subDescription", this.firstPlace.conceptName);
  556. this.$set(obj, "subConceptId", this.firstPlace.conceptId);
  557. this.$set(obj, "subConceptName", this.firstPlace.conceptName);
  558. this.$set(obj, "conceptList", [this.firstPlace]);
  559. }
  560. var i = -1;
  561. this.form.klRuleByIdSub.forEach((item, inx) => {
  562. if (item.groupId === arg.groupId) {
  563. i = inx;
  564. }
  565. });
  566. this.form.klRuleByIdSub.splice(i + 1, 0, obj);
  567. }
  568. },
  569. // 删除分组
  570. delGroup(groupId) {
  571. const list = this.form.klRuleByIdSub.filter(
  572. (item) => item.groupId != groupId
  573. );
  574. this.form.klRuleByIdSub = list;
  575. },
  576. // 删除规则
  577. delGroupChild(groupChildId) {
  578. const newGroupList = this.form.klRuleByIdSub.filter(
  579. (item) => item.groupChildId != groupChildId
  580. );
  581. this.form.klRuleByIdSub = newGroupList;
  582. },
  583. setDict() {
  584. this.dict = localStorage.getItem("zskDicts");
  585. this.msgDict = localStorage.getItem("zskMsgDict");
  586. this.subDict = localStorage.getItem("zskSubDict");
  587. },
  588. showConfirmDialog(msg, resolve) {
  589. this.$alert(msg, "提示", {
  590. confirmButtonText: "确定",
  591. type: "warning"
  592. })
  593. .then(() => {
  594. resolve();
  595. })
  596. .catch(() => {});
  597. },
  598. searchConcept(val) {
  599. const param = {
  600. excludedConceptIds: [this.form.parRuleType],
  601. libType: this.form.parLenCode,
  602. name: val
  603. };
  604. api
  605. .searchConcept(param)
  606. .then((res) => {
  607. if (res.data.code == "0") {
  608. const data = res.data.data;
  609. this.conceptList = data;
  610. }
  611. })
  612. .catch((error) => {
  613. console.log(error);
  614. });
  615. },
  616. getTypeList() {
  617. this.ruleTypeList = JSON.parse(localStorage.getItem("zskTypesList"));
  618. },
  619. saveRule(params) {
  620. api.saveRule(params).then((res) => {
  621. if (res.data.code == 0) {
  622. this.$message({
  623. message: "操作成功",
  624. type: "success"
  625. });
  626. this.$router.push({
  627. name: "ZskRuleManager",
  628. params: Object.assign({}, this.$route.params, { currentPage: 1 })
  629. });
  630. } else {
  631. this.$message({
  632. message: res.data.msg,
  633. type: "warning"
  634. });
  635. }
  636. });
  637. }
  638. },
  639. watch: {
  640. "form.klRuleByIdSub": {
  641. handler(val) {
  642. this.form.klRuleByIdSub.forEach((item, i, arr) => {
  643. if (i == 0) {
  644. item.rowIndex = 1;
  645. } else if (item.groupId == arr[i - 1].groupId) {
  646. item.rowIndex = arr[i - 1].rowIndex;
  647. } else {
  648. item.rowIndex = arr[i - 1].rowIndex + 1;
  649. }
  650. });
  651. },
  652. deep: true
  653. },
  654. "form.parHasSub"(val) {
  655. console.log(val);
  656. console.log(this.form);
  657. // if (!val || val == 0) {
  658. // // this.form.klRuleByIdSub = [];
  659. // this.$set(this.form, "klRuleByIdSub", []);
  660. // console.log(this.form);
  661. // }
  662. }
  663. },
  664. computed: {
  665. disable: function () {
  666. return Object.keys(this.firstPlace || {}).length > 0;
  667. },
  668. ruleTermCodeStr: function () {
  669. const str = this.form.parRuleType + "-" + this.form.parLenCode;
  670. if (str.length <= 1) {
  671. return "";
  672. }
  673. return str;
  674. },
  675. showMsg: function () {
  676. console.log(this.ruleTermCodeStr, "???", this.msgDict);
  677. return (
  678. this.ruleTermCodeStr.length > 2 &&
  679. this.msgDict.indexOf(this.ruleTermCodeStr) > -1
  680. );
  681. },
  682. showHasSub() {
  683. if (this.ruleTermCodeStr.length > 2) {
  684. return this.subDict.indexOf(this.ruleTermCodeStr) != -1;
  685. }
  686. return false;
  687. },
  688. checkFirstPlace: function () {
  689. return this.dict.indexOf(this.ruleTermCodeStr) > -1;
  690. }
  691. },
  692. components: { AddNewRuleTable }
  693. };
  694. </script>