DisFormulaItem.vue 9.6 KB

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