DisFeatureItem.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434
  1. <template>
  2. <tr>
  3. <td class="FeatureSort" >{{index+1}}</td>
  4. <td class="FeatureType" >
  5. <el-select size="mini" :class="{selectType: item.typeNull}" v-model.trim="item.type" placeholder="标签类型" @change="clickItem(index,'FeatureType')">
  6. <el-option v-for="item in featureTypeList" :label="item.name" :value="item.key" :key="item.key"></el-option>
  7. </el-select>
  8. </td>
  9. <td class="FeatureNumber" :class="{borderRed:item.verifyCode||item.codeNull}" @click.self="clickItemBox" >
  10. <el-tooltip :disabled="!item.verifyCode&&!item.codeNull&&!item.codeError" class="item" effect="dark" :content="item.verifyCode||item.codeNull||item.codeError" placement="top">
  11. <el-input class="groupTextarea"
  12. ref="textarea"
  13. type="textarea"
  14. :autosize="{ minRows: 1}"
  15. :class="{colorRed: item.codeError}"
  16. :title="item.code"
  17. v-model.trim="item.code"
  18. @input="handleInp(index,$event,'FeatureNumber')"
  19. @focus="clickItem(index,'FeatureNumber')">
  20. </el-input>
  21. </el-tooltip>
  22. </td>
  23. <td class="FeatureStand" :class="{borderRed:item.verifyStandard||item.standardNull}" @click.self="clickItemBox">
  24. <el-tooltip :disabled="!item.verifyStandard&&!item.standardNull" class="item" effect="dark" :content="item.verifyStandard||item.standardNull" placement="top">
  25. <el-input class="groupTextarea"
  26. ref="textarea"
  27. type="textarea"
  28. :autosize="{ minRows: 1}"
  29. :title="item.standard"
  30. v-model.trim="item.standard"
  31. @input="handleInp(index,$event,'FeatureStand',item.type)"
  32. @focus="clickItem(index,'FeatureStand')">
  33. </el-input>
  34. </el-tooltip>
  35. <div class="searchItemBox">
  36. <ul
  37. class="searchItemList"
  38. v-if="showDiagList&&index === searchIndex && searchFiled ==='FeatureStand' && searchResultList.length > 0"
  39. >
  40. <li v-for="(item, ind) in searchResultList"
  41. class="diagItem ellipsis"
  42. :key="ind"
  43. :title="item"
  44. @click="selectSearchItem(index,item,'FeatureStand')"
  45. >
  46. {{item}}
  47. </li>
  48. </ul>
  49. </div>
  50. </td>
  51. <td class="FeatureRelate" :class="{borderRed:item.verifyRelation|| item.relationNull}" @click.self="clickItemBox">
  52. <el-tooltip :disabled="!item.verifyRelation&&!item.relationNull" class="item" effect="dark" :content="item.verifyRelation||item.relationNull" placement="top">
  53. <el-input class="groupTextarea"
  54. ref="textarea"
  55. type="textarea"
  56. :autosize="{ minRows: 1}"
  57. :title="item.relation"
  58. v-model.trim="item.relation"
  59. @input="handleInp(index,$event,'FeatureRelate',item.type)"
  60. @focus="clickItem(index,'FeatureRelate')">
  61. </el-input>
  62. </el-tooltip>
  63. <div class="searchItemBox">
  64. <ul
  65. class="searchItemList"
  66. v-if="showDiagList&&index === searchIndex && searchFiled ==='FeatureRelate' && searchResultList.length > 0"
  67. >
  68. <li v-for="(item, ind) in searchResultList"
  69. class="diagItem ellipsis"
  70. :key="ind"
  71. :title="item"
  72. @click="selectSearchItem(index,item,'FeatureRelate')"
  73. >
  74. {{item}}
  75. </li>
  76. </ul>
  77. </div>
  78. </td>
  79. <td class="FeatureuniqueName inpDisabled" :class="{borderRed:item.uniqueName===null ||item.verifyUnique}" >
  80. <el-tooltip :disabled="!item.verifyUnique" class="item" effect="dark" :content="item.verifyUnique" placement="top">
  81. <el-input class="groupTextarea inpDisabled"
  82. ref="textarea"
  83. type="textarea"
  84. :readonly = true
  85. :autosize="{ minRows: 1}"
  86. :title="item.uniqueName"
  87. v-model.trim="item.uniqueName"
  88. >
  89. </el-input>
  90. </el-tooltip>
  91. </td>
  92. <td class="FeatureResult" :class="{inpDisabled:item.type!=3,borderRed:item.verifyResult,}" @click.self="clickItemBox">
  93. <el-tooltip :disabled="!item.verifyResult" class="item" effect="dark" :content="item.verifyResult" placement="top">
  94. <el-input class="groupTextarea"
  95. ref="textarea"
  96. type="textarea"
  97. :autosize="{ minRows: 1}"
  98. :readonly="item.type!=3"
  99. :class="{inpDisabled:item.type!=3}"
  100. :title="item.midResult"
  101. v-model.trim="item.midResult"
  102. @input="handleInp(index,$event,'FeatureResult')"
  103. @focus="clickItem(index,'FeatureResult')">
  104. </el-input>
  105. </el-tooltip>
  106. </td>
  107. <td class="FeatureOpera">
  108. <el-button type="text" size="small" class="delete" @click="addItem(index, 1)"><div class="btnOpera">+</div></el-button>
  109. <el-button v-if="index !=0" type="text" size="small" class="delete" @click="delItem(index, 1)"><div class="btnOpera">-</div></el-button>
  110. </td>
  111. </tr>
  112. </template>
  113. <script>
  114. export default {
  115. props:['item', 'index','featureTypeList','showDiagList','searchIndex',
  116. 'searchFiled', 'searchResultList'],
  117. data() {
  118. return {
  119. timer: undefined
  120. }
  121. },
  122. mounted(){
  123. this.$nextTick(()=>{
  124. if(Array.isArray(this.$refs.textarea)) {
  125. for(let i=0; i <this.$refs.textarea.length; i++) {
  126. this.$refs.textarea[i].resizeTextarea()
  127. }
  128. }else {
  129. this.$refs.textarea&&this.$refs.textarea.resizeTextarea()
  130. }
  131. })
  132. },
  133. methods: {
  134. handleInp(index,e,type,itemType) {
  135. clearTimeout(this.timer)
  136. let timer = setTimeout(()=>{
  137. clearTimeout(this.timer);
  138. this.$emit('handleInp',{index,e,type,itemType})
  139. }, 100)
  140. this.timer = timer
  141. },
  142. clickItem(index, type) {
  143. this.$emit('clickItem',{index, type})
  144. },
  145. addItem(index, type) {
  146. this.$emit('addItem',{index, type})
  147. },
  148. delItem(index, type) {
  149. this.$emit('delItem',{index, type})
  150. },
  151. selectSearchItem(index, item, searchType) {
  152. this.$emit('selectSearchItem',{index, item, searchType})
  153. },
  154. clickItemBox(e) {
  155. e.target.children[0].focus()
  156. },
  157. }
  158. }
  159. </script>
  160. <style lang="less" scoped>
  161. @import '../../less/common.less';
  162. table,tr,td {
  163. list-style: none;
  164. }
  165. .topBack {
  166. top: 0;
  167. }
  168. .groupTitle {
  169. background-color: #fff;
  170. height: 40px;
  171. line-height: 40px;
  172. padding-left: 20px;
  173. }
  174. .searchInput, .searchName {
  175. display: inline-block;
  176. height: 32px;
  177. line-height: 32px;
  178. border: 1px solid #a9a9a9;
  179. margin: 0px 0 0 0;
  180. padding: 0 5px;
  181. float: left;
  182. margin-top: 4px;
  183. }
  184. .isRequired .el-form-item__label::before {
  185. content: '*';
  186. color: red;
  187. }
  188. .searchName {
  189. border-left: none;
  190. cursor: pointer;
  191. font-size: 16px;
  192. padding: 0 14px;
  193. }
  194. .itemList {
  195. position: absolute;
  196. background: #fff;
  197. width: 162px;
  198. max-height: 150px;
  199. border: 1px solid #a9a9a9;
  200. left: 138px;
  201. top: 37px;
  202. z-index: 2;
  203. overflow-y: auto;
  204. }
  205. .diagItem {
  206. padding: 0 5px;
  207. height: 30px;
  208. line-height: 30px;
  209. font-size: 14px;
  210. cursor: pointer;
  211. }
  212. .diagItem:hover {
  213. background: #f5f7fa;
  214. }
  215. .addDepartForm {
  216. position: relative;
  217. background-color: #fff;
  218. padding: 20px;
  219. margin: 70px 20px 0px 20px;
  220. }
  221. .addDiagName {
  222. position: relative;
  223. }
  224. .symptomList {
  225. position: relative;
  226. background-color: #fff;
  227. padding: 0px 20px 100px 20px;
  228. margin: 0px 20px 40px 20px;
  229. min-height: 400px;
  230. }
  231. .diagTable {
  232. width: 100%;
  233. border-collapse: collapse;
  234. margin-bottom: 20px;
  235. tr {
  236. td {
  237. /deep/textarea::-webkit-scrollbar{
  238. display: none;
  239. }
  240. position: relative;
  241. border: 1px solid #a9a9a9;
  242. text-align: center;
  243. }
  244. .FormulaOpera, .FeatureOpera{
  245. background: #fff;
  246. border: none;
  247. text-align: left;
  248. padding-left: 30px;
  249. }
  250. /deep/.el-textarea__inner {
  251. width: 100%;
  252. line-height: 20px;
  253. resize:none;
  254. border: none;
  255. border-radius: 0;
  256. text-align: center;
  257. }
  258. }
  259. .selectedContent {
  260. width: 25%;
  261. }
  262. .selectedContentGroup {
  263. width: 55%;
  264. }
  265. .selectedContentOpera {
  266. width: 20%;
  267. }
  268. }
  269. .groupInput {
  270. text-align: center;
  271. color: #606266;
  272. width: 80%;
  273. }
  274. .groupTextarea {
  275. text-align: center;
  276. color: #606266;
  277. width: 100%;
  278. }
  279. .btn {
  280. position: absolute;
  281. background-color: #fff;
  282. width: 100%;
  283. margin: 20px 0;
  284. height: 40px;
  285. bottom: 0px;
  286. right: 0px;
  287. .btnBox {
  288. position: absolute;
  289. right: 0px;
  290. }
  291. .el-button {
  292. margin-right: 20px;
  293. }
  294. }
  295. .tableTitle{
  296. background: rgba(239,243,249,1);
  297. height: 40px;
  298. }
  299. .require::after{
  300. content:"*";
  301. color: red;
  302. }
  303. .borderRed {
  304. border: 3px solid red !important;
  305. box-sizing: border-box !important;
  306. }
  307. .colorRed {
  308. color: red;
  309. }
  310. .FeatureSort {
  311. width: 5%;
  312. }
  313. .FeatureType {
  314. width: 7%;
  315. padding: 0 5px;
  316. }
  317. .FeatureNumber {
  318. width: 8%;
  319. }
  320. .FeatureStand {
  321. width: 20%;
  322. }
  323. .FeatureRelate {
  324. width: 30%;
  325. }
  326. .FeatureuniqueName {
  327. width: 10%;
  328. }
  329. .FeatureResult {
  330. width: 10%;
  331. }
  332. .FeatureOpera{
  333. width: 10%;
  334. }
  335. .FormulaSort{
  336. width: 5%;
  337. }
  338. .FormulaType{
  339. width: 7%;
  340. padding: 0 5px;
  341. }
  342. .FormulaNumber{
  343. width: 78%;
  344. }
  345. .FormulaOpera{
  346. width: 10%;
  347. }
  348. .btnOpera {
  349. width:16px;
  350. height:16px;
  351. background:rgba(176,190,197,1);
  352. border-radius: 50%;
  353. color: #fff;
  354. line-height: 16px;
  355. text-align: center;
  356. }
  357. /deep/.el-input--mini .el-input__inner {
  358. width: 80px;
  359. }
  360. /deep/ .is-disabled {
  361. background: #ECECEC;
  362. color: #AAAAAA;
  363. border: none;
  364. }
  365. .selectType {
  366. input {
  367. border: 3px solid red;
  368. }
  369. input:hover {
  370. border: 3px solid red;
  371. }
  372. }
  373. .moduleTitle {
  374. margin: 0 0 10px 0;
  375. font-weight: 600;
  376. }
  377. .inpDisabled{
  378. background: #ECECEC;
  379. cursor: not-allowed;
  380. textarea {
  381. background: #ECECEC;
  382. color: #AAAAAA;
  383. border: none;
  384. cursor: not-allowed;
  385. height: 100%;
  386. }
  387. }
  388. .inpTips {
  389. font-size: 14px;
  390. color: red;
  391. margin-bottom: 10px;
  392. }
  393. #upFile{
  394. display: none
  395. }
  396. .disableDiv {
  397. background: rgb(236, 236, 236);
  398. box-sizing: border-box;
  399. cursor: not-allowed;
  400. font-size: 14px;
  401. line-height: 20px;
  402. padding: 5px 0;
  403. min-height: 30px;
  404. }
  405. .searchItemBox{
  406. position: relative;
  407. bottom: 0px;
  408. }
  409. .searchItemList {
  410. position: absolute;
  411. border: 1px solid #a9a9a9;
  412. box-sizing: border-box;
  413. top: 4px;
  414. z-index: 2;
  415. width: 100%;
  416. max-height: 150px;
  417. overflow: auto;
  418. background: #fff;
  419. margin: 0 0 20px 0;
  420. }
  421. </style>