DisFeatureItem.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435
  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. import config from '@api/config.js';
  115. export default {
  116. props:['item', 'index','featureTypeList','showDiagList','searchIndex',
  117. 'searchFiled', 'searchResultList'],
  118. data() {
  119. return {
  120. timer: undefined
  121. }
  122. },
  123. mounted(){
  124. this.$nextTick(()=>{
  125. if(Array.isArray(this.$refs.textarea)) {
  126. for(let i=0; i <this.$refs.textarea.length; i++) {
  127. this.$refs.textarea[i].resizeTextarea()
  128. }
  129. }else {
  130. this.$refs.textarea&&this.$refs.textarea.resizeTextarea()
  131. }
  132. })
  133. },
  134. methods: {
  135. handleInp(index,e,type,itemType) {
  136. clearTimeout(this.timer)
  137. let timer = setTimeout(()=>{
  138. clearTimeout(this.timer);
  139. this.$emit('handleInp',{index,e,type,itemType})
  140. }, config.delayTime)
  141. this.timer = timer
  142. },
  143. clickItem(index, type) {
  144. this.$emit('clickItem',{index, type})
  145. },
  146. addItem(index, type) {
  147. this.$emit('addItem',{index, type})
  148. },
  149. delItem(index, type) {
  150. this.$emit('delItem',{index, type})
  151. },
  152. selectSearchItem(index, item, searchType) {
  153. this.$emit('selectSearchItem',{index, item, searchType})
  154. },
  155. clickItemBox(e) {
  156. e.target.children[0].focus()
  157. },
  158. }
  159. }
  160. </script>
  161. <style lang="less" scoped>
  162. @import '../../less/common.less';
  163. table,tr,td {
  164. list-style: none;
  165. }
  166. .topBack {
  167. top: 0;
  168. }
  169. .groupTitle {
  170. background-color: #fff;
  171. height: 40px;
  172. line-height: 40px;
  173. padding-left: 20px;
  174. }
  175. .searchInput, .searchName {
  176. display: inline-block;
  177. height: 32px;
  178. line-height: 32px;
  179. border: 1px solid #a9a9a9;
  180. margin: 0px 0 0 0;
  181. padding: 0 5px;
  182. float: left;
  183. margin-top: 4px;
  184. }
  185. .isRequired .el-form-item__label::before {
  186. content: '*';
  187. color: red;
  188. }
  189. .searchName {
  190. border-left: none;
  191. cursor: pointer;
  192. font-size: 16px;
  193. padding: 0 14px;
  194. }
  195. .itemList {
  196. position: absolute;
  197. background: #fff;
  198. width: 162px;
  199. max-height: 150px;
  200. border: 1px solid #a9a9a9;
  201. left: 138px;
  202. top: 37px;
  203. z-index: 2;
  204. overflow-y: auto;
  205. }
  206. .diagItem {
  207. padding: 0 5px;
  208. height: 30px;
  209. line-height: 30px;
  210. font-size: 14px;
  211. cursor: pointer;
  212. }
  213. .diagItem:hover {
  214. background: #f5f7fa;
  215. }
  216. .addDepartForm {
  217. position: relative;
  218. background-color: #fff;
  219. padding: 20px;
  220. margin: 70px 20px 0px 20px;
  221. }
  222. .addDiagName {
  223. position: relative;
  224. }
  225. .symptomList {
  226. position: relative;
  227. background-color: #fff;
  228. padding: 0px 20px 100px 20px;
  229. margin: 0px 20px 40px 20px;
  230. min-height: 400px;
  231. }
  232. .diagTable {
  233. width: 100%;
  234. border-collapse: collapse;
  235. margin-bottom: 20px;
  236. tr {
  237. td {
  238. /deep/textarea::-webkit-scrollbar{
  239. display: none;
  240. }
  241. position: relative;
  242. border: 1px solid #a9a9a9;
  243. text-align: center;
  244. }
  245. .FormulaOpera, .FeatureOpera{
  246. background: #fff;
  247. border: none;
  248. text-align: left;
  249. padding-left: 30px;
  250. }
  251. /deep/.el-textarea__inner {
  252. width: 100%;
  253. line-height: 20px;
  254. resize:none;
  255. border: none;
  256. border-radius: 0;
  257. text-align: center;
  258. }
  259. }
  260. .selectedContent {
  261. width: 25%;
  262. }
  263. .selectedContentGroup {
  264. width: 55%;
  265. }
  266. .selectedContentOpera {
  267. width: 20%;
  268. }
  269. }
  270. .groupInput {
  271. text-align: center;
  272. color: #606266;
  273. width: 80%;
  274. }
  275. .groupTextarea {
  276. text-align: center;
  277. color: #606266;
  278. width: 100%;
  279. }
  280. .btn {
  281. position: absolute;
  282. background-color: #fff;
  283. width: 100%;
  284. margin: 20px 0;
  285. height: 40px;
  286. bottom: 0px;
  287. right: 0px;
  288. .btnBox {
  289. position: absolute;
  290. right: 0px;
  291. }
  292. .el-button {
  293. margin-right: 20px;
  294. }
  295. }
  296. .tableTitle{
  297. background: rgba(239,243,249,1);
  298. height: 40px;
  299. }
  300. .require::after{
  301. content:"*";
  302. color: red;
  303. }
  304. .borderRed {
  305. border: 3px solid red !important;
  306. box-sizing: border-box !important;
  307. }
  308. .colorRed {
  309. color: red;
  310. }
  311. .FeatureSort {
  312. width: 5%;
  313. }
  314. .FeatureType {
  315. width: 7%;
  316. padding: 0 5px;
  317. }
  318. .FeatureNumber {
  319. width: 8%;
  320. }
  321. .FeatureStand {
  322. width: 20%;
  323. }
  324. .FeatureRelate {
  325. width: 30%;
  326. }
  327. .FeatureuniqueName {
  328. width: 10%;
  329. }
  330. .FeatureResult {
  331. width: 10%;
  332. }
  333. .FeatureOpera{
  334. width: 10%;
  335. }
  336. .FormulaSort{
  337. width: 5%;
  338. }
  339. .FormulaType{
  340. width: 7%;
  341. padding: 0 5px;
  342. }
  343. .FormulaNumber{
  344. width: 78%;
  345. }
  346. .FormulaOpera{
  347. width: 10%;
  348. }
  349. .btnOpera {
  350. width:16px;
  351. height:16px;
  352. background:rgba(176,190,197,1);
  353. border-radius: 50%;
  354. color: #fff;
  355. line-height: 16px;
  356. text-align: center;
  357. }
  358. /deep/.el-input--mini .el-input__inner {
  359. width: 80px;
  360. }
  361. /deep/ .is-disabled {
  362. background: #ECECEC;
  363. color: #AAAAAA;
  364. border: none;
  365. }
  366. .selectType {
  367. input {
  368. border: 3px solid red;
  369. }
  370. input:hover {
  371. border: 3px solid red;
  372. }
  373. }
  374. .moduleTitle {
  375. margin: 0 0 10px 0;
  376. font-weight: 600;
  377. }
  378. .inpDisabled{
  379. background: #ECECEC;
  380. cursor: not-allowed;
  381. textarea {
  382. background: #ECECEC;
  383. color: #AAAAAA;
  384. border: none;
  385. cursor: not-allowed;
  386. height: 100%;
  387. }
  388. }
  389. .inpTips {
  390. font-size: 14px;
  391. color: red;
  392. margin-bottom: 10px;
  393. }
  394. #upFile{
  395. display: none
  396. }
  397. .disableDiv {
  398. background: rgb(236, 236, 236);
  399. box-sizing: border-box;
  400. cursor: not-allowed;
  401. font-size: 14px;
  402. line-height: 20px;
  403. padding: 5px 0;
  404. min-height: 30px;
  405. }
  406. .searchItemBox{
  407. position: relative;
  408. bottom: 0px;
  409. }
  410. .searchItemList {
  411. position: absolute;
  412. border: 1px solid #a9a9a9;
  413. box-sizing: border-box;
  414. top: 4px;
  415. z-index: 2;
  416. width: 100%;
  417. max-height: 150px;
  418. overflow: auto;
  419. background: #fff;
  420. margin: 0 0 20px 0;
  421. }
  422. </style>