Edit.vue 72 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213
  1. <template>
  2. <div class="page-index">
  3. <ul>
  4. <li>
  5. <div class="ind">序号</div>
  6. <div class="level">层次</div>
  7. <div class="order">顺序</div>
  8. <div class="isReq">必填</div>
  9. <div class="project" style="justify-content: center">项目</div>
  10. <div class="action" style="text-align: center">操作</div>
  11. </li>
  12. <li v-for="(item,index) in editList" :key="index">
  13. <div class="ind">{{index+1}}</div>
  14. <div class="level">{{item.level}}</div>
  15. <div class="order">
  16. <i class="el-icon-bottom" v-if="isHasDown(index, item)" @click="()=>down(index, item)"></i>
  17. <i class="el-icon-top" v-if="isHasUp(index, item)" @click="()=>up(index, item)"></i>
  18. </div>
  19. <div class="isReq">
  20. <i class="el-icon-check" v-if="item.isReq"></i>
  21. </div>
  22. <div class="project">
  23. <div class="project1" v-if="!item.isDoing && item.level === -1">
  24. <div class="projectLabel">
  25. <span style="color: #f00" v-if="item.isReq">*</span>
  26. <span>{{item.label}}</span>
  27. </div>
  28. <div class="projectType">
  29. <el-input
  30. type="textarea"
  31. :rows="2"
  32. v-model="item.inputDefaultValue"
  33. :placeholder="item.inputPlaceholderValue"
  34. size="small"
  35. v-if="item.selectValue !== 'upload'"
  36. ></el-input>
  37. </div>
  38. </div>
  39. <div class="project2" v-if="item.isDoing">
  40. <div class="project2Left">
  41. <div class="project2LeftName">
  42. <span style="color: #f00">*</span>
  43. <span>项目名称</span>
  44. </div>
  45. <el-input
  46. placeholder
  47. v-model="item.inputValue"
  48. size="small"
  49. :disabled="item.level === 1"
  50. ></el-input>
  51. </div>
  52. <div class="project2Left">
  53. <div class="project2LeftName">
  54. <span style="color: #f00">*</span>
  55. <span>备选项形式</span>
  56. </div>
  57. <el-select placeholder="请选择" v-model="item.selectValue" size="small">
  58. <el-option
  59. v-for="con in isDoingSelectList"
  60. :key="con.type"
  61. :label="con.label"
  62. :value="con.type"
  63. ></el-option>
  64. </el-select>
  65. </div>
  66. <div class="project2Left" v-if="item.selectValue !== 'subject' && item.selectValue">
  67. <div class="project2LeftName">
  68. <span>是否必填</span>
  69. </div>
  70. <el-checkbox v-model="item.isReq">必填</el-checkbox>
  71. </div>
  72. <div
  73. class="project2Left"
  74. v-if="item.selectValue === 'input' || item.selectValue === 'textarea'"
  75. >
  76. <div class="project2LeftName">
  77. <span>默认值</span>
  78. </div>
  79. <el-input placeholder v-model="item.inputDefaultValue" size="small"></el-input>
  80. </div>
  81. <div
  82. class="project2Left"
  83. v-if="item.selectValue === 'input' || item.selectValue === 'textarea' || item.selectValue === 'fill'"
  84. >
  85. <div class="project2LeftName">
  86. <span>提示语</span>
  87. </div>
  88. <el-input placeholder v-model="item.inputPlaceholderValue" size="small"></el-input>
  89. </div>
  90. <div class="project2Left" v-if="item.selectValue === 'input'">
  91. <div class="project2LeftName">
  92. <span>单位</span>
  93. </div>
  94. <el-input placeholder v-model="item.depart" size="small"></el-input>
  95. </div>
  96. <div v-if="item.selectValue === 'radio'">
  97. <div
  98. class="project2Left"
  99. style="flex-direction: column;"
  100. v-for="(con,ind) in item.radioList"
  101. :key="ind"
  102. >
  103. <div style="display: flex;">
  104. <div class="project2LeftName">
  105. <span style="color: #f00">*</span>
  106. <span>备选项</span>
  107. </div>
  108. <el-input placeholder v-model="item.radioList[ind].label" size="small"></el-input>
  109. <el-radio
  110. @input="()=>radioDefaultSelect(ind, index)"
  111. v-model="item.radioList[ind].radioDefault"
  112. label="1"
  113. >默认</el-radio>
  114. <span class="radioAdd" @click="()=>radioAdd(ind, index)">添加</span>
  115. <span
  116. class="radioDelete"
  117. @click="()=>item.radioList.length!==1 && radioDelete(ind, index)"
  118. :class="item.radioList.length===1 ? 'disabled' : ''"
  119. >删除</span>
  120. <span class="radioAddChild" @click="()=>radioAddChild(ind, index)">添加子备选项</span>
  121. </div>
  122. <div class="childBei" v-for="(conn,indd) in con.child" :key="indd">
  123. <div style="display: flex;">
  124. <div class="project2LeftName">
  125. <span style="color: #f00">*</span>
  126. <span>子备选项</span>
  127. </div>
  128. <div>
  129. <span class="radioAdd" @click="()=>radioAdd(ind, index, indd)">添加</span>
  130. <span class="radioDelete" @click="()=>radioDelete(ind, index, indd)">删除</span>
  131. </div>
  132. </div>
  133. <div class="project2LeftCon">
  134. <div class="project2Left">
  135. <div class="project2LeftName">
  136. <span style="color: #f00">*</span>
  137. <span>子项目名称</span>
  138. </div>
  139. <el-input placeholder v-model="con.child[indd].inputValue" size="small"></el-input>
  140. </div>
  141. <div class="project2Left">
  142. <div class="project2LeftName">
  143. <span style="color: #f00">*</span>
  144. <span>子备选项形式</span>
  145. </div>
  146. <el-select
  147. placeholder="请选择"
  148. v-model="con.child[indd].selectValue"
  149. size="small"
  150. >
  151. <el-option
  152. v-for="con in isDoingSelectList.slice(1, 5)"
  153. :key="con.type"
  154. :label="con.label"
  155. :value="con.type"
  156. ></el-option>
  157. </el-select>
  158. </div>
  159. <div
  160. class="project2Left"
  161. v-if="conn.selectValue !== 'subject' && conn.selectValue"
  162. >
  163. <div class="project2LeftName">
  164. <span>是否必填</span>
  165. </div>
  166. <el-checkbox v-model="conn.isReq">必填</el-checkbox>
  167. </div>
  168. <div
  169. class="project2Left"
  170. v-if="conn.selectValue === 'input' || conn.selectValue === 'textarea'"
  171. >
  172. <div class="project2LeftName">
  173. <span>默认值</span>
  174. </div>
  175. <el-input placeholder v-model="conn.inputDefaultValue" size="small"></el-input>
  176. </div>
  177. <div
  178. class="project2Left"
  179. v-if="conn.selectValue === 'input' || conn.selectValue === 'textarea'"
  180. >
  181. <div class="project2LeftName">
  182. <span>提示语</span>
  183. </div>
  184. <el-input placeholder v-model="conn.inputPlaceholderValue" size="small"></el-input>
  185. </div>
  186. <div class="project2Left" v-if="conn.selectValue === 'input'">
  187. <div class="project2LeftName">
  188. <span>单位</span>
  189. </div>
  190. <el-input placeholder v-model="conn.depart" size="small"></el-input>
  191. </div>
  192. <div v-if="conn.selectValue === 'radio'">
  193. <div
  194. class="project2Left"
  195. style="flex-direction: column;"
  196. v-for="(connn,inddd) in conn.radioList"
  197. :key="inddd"
  198. >
  199. <div style="display: flex;">
  200. <div class="project2LeftName">
  201. <span style="color: #f00">*</span>
  202. <span>备选项</span>
  203. </div>
  204. <el-input placeholder v-model="conn.radioList[inddd].label" size="small"></el-input>
  205. <el-radio
  206. @input="()=>radioDefaultSelect(ind, index, indd, inddd)"
  207. v-model="conn.radioList[inddd].radioDefault"
  208. label="1"
  209. >默认</el-radio>
  210. <span
  211. class="radioAdd"
  212. @click="()=>radioAdd(ind, index, indd, conn.selectValue, inddd)"
  213. >添加</span>
  214. <span
  215. class="radioDelete"
  216. @click="()=>conn.radioList.length!==1 && radioDelete(ind, index, indd, inddd)"
  217. :class="conn.radioList.length===1 ? 'disabled' : ''"
  218. >删除</span>
  219. </div>
  220. </div>
  221. </div>
  222. <div v-if="conn.selectValue === 'checkbox'">
  223. <div
  224. class="project2Left"
  225. style="flex-direction: column;"
  226. v-for="(connn,inddd) in conn.radioList"
  227. :key="inddd"
  228. >
  229. <div style="display: flex;">
  230. <div class="project2LeftName">
  231. <span style="color: #f00">*</span>
  232. <span>备选项</span>
  233. </div>
  234. <el-input placeholder v-model="conn.radioList[inddd].label" size="small"></el-input>
  235. <el-checkbox
  236. @change="()=>changeCheckbox(ind, index, indd, 'checkbox', inddd)"
  237. v-model="conn.radioList[inddd].radioDefault"
  238. >默认</el-checkbox>
  239. <el-checkbox
  240. @change="()=>changeCheckboxOther(item.radioList[ind].radioDefault, ind, index, indd, inddd)"
  241. v-model="conn.radioList[inddd].radioDefaultOther"
  242. >与其他项互斥</el-checkbox>
  243. <span
  244. class="radioAdd"
  245. @click="()=>radioAdd(ind, index, indd, 'checkbox', inddd)"
  246. >添加</span>
  247. <span
  248. class="radioDelete"
  249. @click="()=>conn.radioList.length!==1 && radioDelete(ind, index, indd, inddd)"
  250. :class="conn.radioList.length===1 ? 'disabled' : ''"
  251. >删除</span>
  252. </div>
  253. </div>
  254. </div>
  255. </div>
  256. </div>
  257. </div>
  258. </div>
  259. <div v-if="item.selectValue === 'checkbox'">
  260. <div
  261. class="project2Left"
  262. style="flex-direction: column;"
  263. v-for="(con,ind) in item.radioList"
  264. :key="ind"
  265. >
  266. <div class="bei">
  267. <div class="project2LeftName">
  268. <span style="color: #f00">*</span>
  269. <span>备选项</span>
  270. </div>
  271. <el-input placeholder v-model="item.radioList[ind].label" size="small"></el-input>
  272. <el-checkbox
  273. @change="()=>changeCheckbox(ind, index)"
  274. v-model="item.radioList[ind].radioDefault"
  275. >默认</el-checkbox>
  276. <el-checkbox
  277. @change="()=>changeCheckboxOther(item.radioList[ind].radioDefault, ind, index)"
  278. v-model="item.radioList[ind].radioDefaultOther"
  279. >与其他项互斥</el-checkbox>
  280. <span class="radioAdd" @click="()=>radioAdd(ind, index, null, 'checkbox')">添加</span>
  281. <span
  282. class="radioDelete"
  283. @click="()=>item.radioList.length!==1 && radioDelete(ind, index)"
  284. :class="item.radioList.length===1 ? 'disabled' : ''"
  285. >删除</span>
  286. <span class="radioAddChild" @click="()=>radioAddChild(ind, index)">添加子备选项</span>
  287. </div>
  288. <div class="childBei" v-for="(conn,indd) in con.child" :key="indd">
  289. <div style="display: flex;">
  290. <div class="project2LeftName">
  291. <span style="color: #f00">*</span>
  292. <span>子备选项</span>
  293. </div>
  294. <div>
  295. <span class="radioAdd" @click="()=>radioAdd(ind, index, indd)">添加</span>
  296. <span class="radioDelete" @click="()=>radioDelete(ind, index, indd)">删除</span>
  297. </div>
  298. </div>
  299. <div class="project2LeftCon">
  300. <div class="project2Left">
  301. <div class="project2LeftName">
  302. <span style="color: #f00">*</span>
  303. <span>子项目名称</span>
  304. </div>
  305. <el-input placeholder v-model="con.child[indd].inputValue" size="small"></el-input>
  306. </div>
  307. <div class="project2Left">
  308. <div class="project2LeftName">
  309. <span style="color: #f00">*</span>
  310. <span>子备选项形式</span>
  311. </div>
  312. <el-select
  313. placeholder="请选择"
  314. v-model="con.child[indd].selectValue"
  315. size="small"
  316. >
  317. <el-option
  318. v-for="con in isDoingSelectList.slice(1, 5)"
  319. :key="con.type"
  320. :label="con.label"
  321. :value="con.type"
  322. ></el-option>
  323. </el-select>
  324. </div>
  325. <div
  326. class="project2Left"
  327. v-if="conn.selectValue !== 'subject' && conn.selectValue"
  328. >
  329. <div class="project2LeftName">
  330. <span>是否必填</span>
  331. </div>
  332. <el-checkbox v-model="conn.isReq">必填</el-checkbox>
  333. </div>
  334. <div
  335. class="project2Left"
  336. v-if="conn.selectValue === 'input' || conn.selectValue === 'textarea'"
  337. >
  338. <div class="project2LeftName">
  339. <span>默认值</span>
  340. </div>
  341. <el-input placeholder v-model="conn.inputDefaultValue" size="small"></el-input>
  342. </div>
  343. <div
  344. class="project2Left"
  345. v-if="conn.selectValue === 'input' || conn.selectValue === 'textarea'"
  346. >
  347. <div class="project2LeftName">
  348. <span>提示语</span>
  349. </div>
  350. <el-input placeholder v-model="conn.inputPlaceholderValue" size="small"></el-input>
  351. </div>
  352. <div class="project2Left" v-if="conn.selectValue === 'input'">
  353. <div class="project2LeftName">
  354. <span>单位</span>
  355. </div>
  356. <el-input placeholder v-model="conn.depart" size="small"></el-input>
  357. </div>
  358. <div v-if="conn.selectValue === 'radio'">
  359. <div
  360. class="project2Left"
  361. style="flex-direction: column;"
  362. v-for="(connn,inddd) in conn.radioList"
  363. :key="inddd"
  364. >
  365. <div style="display: flex;">
  366. <div class="project2LeftName">
  367. <span style="color: #f00">*</span>
  368. <span>备选项</span>
  369. </div>
  370. <el-input placeholder v-model="conn.radioList[inddd].label" size="small"></el-input>
  371. <el-radio
  372. @input="()=>radioDefaultSelect(ind, index, indd, inddd)"
  373. v-model="conn.radioList[inddd].radioDefault"
  374. label="1"
  375. >默认</el-radio>
  376. <span
  377. class="radioAdd"
  378. @click="()=>radioAdd(ind, index, indd, conn.selectValue, inddd)"
  379. >添加</span>
  380. <span
  381. class="radioDelete"
  382. @click="()=>conn.radioList.length!==1 && radioDelete(ind, index, indd, inddd)"
  383. :class="conn.radioList.length===1 ? 'disabled' : ''"
  384. >删除</span>
  385. </div>
  386. </div>
  387. </div>
  388. <div v-if="conn.selectValue === 'checkbox'">
  389. <div
  390. class="project2Left"
  391. style="flex-direction: column;"
  392. v-for="(connn,inddd) in conn.radioList"
  393. :key="inddd"
  394. >
  395. <div style="display: flex;">
  396. <div class="project2LeftName">
  397. <span style="color: #f00">*</span>
  398. <span>备选项</span>
  399. </div>
  400. <el-input placeholder v-model="conn.radioList[inddd].label" size="small"></el-input>
  401. <el-checkbox
  402. @change="()=>changeCheckbox(ind, index, indd, 'checkbox', inddd)"
  403. v-model="conn.radioList[inddd].radioDefault"
  404. >默认</el-checkbox>
  405. <el-checkbox
  406. @change="()=>changeCheckboxOther(item.radioList[ind].radioDefault, ind, index, indd, inddd)"
  407. v-model="conn.radioList[inddd].radioDefaultOther"
  408. >与其他项互斥</el-checkbox>
  409. <span
  410. class="radioAdd"
  411. @click="()=>radioAdd(ind, index, indd, 'checkbox', inddd)"
  412. >添加</span>
  413. <span
  414. class="radioDelete"
  415. @click="()=>conn.radioList.length!==1 && radioDelete(ind, index, indd, inddd)"
  416. :class="conn.radioList.length===1 ? 'disabled' : ''"
  417. >删除</span>
  418. </div>
  419. </div>
  420. </div>
  421. </div>
  422. </div>
  423. </div>
  424. </div>
  425. <div v-if="item.selectValue === 'fill'">
  426. <div
  427. class="project2Left"
  428. style="flex-direction: column;"
  429. v-for="(con,ind) in item.radioList"
  430. :key="ind"
  431. >
  432. <div class="bei">
  433. <div class="project2LeftName">
  434. <span style="color: #f00">*</span>
  435. <span>备选项</span>
  436. </div>
  437. <el-input placeholder v-model="item.radioList[ind].label" size="small"></el-input>
  438. <el-checkbox
  439. @change="()=>changeCheckbox(ind, index)"
  440. v-model="item.radioList[ind].radioDefault"
  441. >默认</el-checkbox>
  442. <el-checkbox
  443. @change="()=>changeCheckboxOther(item.radioList[ind].radioDefault, ind, index)"
  444. v-model="item.radioList[ind].radioDefaultOther"
  445. >与其他项互斥</el-checkbox>
  446. <span class="radioAdd" @click="()=>radioAdd(ind, index, null, 'checkbox')">添加</span>
  447. <span
  448. class="radioDelete"
  449. @click="()=>item.radioList.length!==1 && radioDelete(ind, index)"
  450. :class="item.radioList.length===1 ? 'disabled' : ''"
  451. >删除</span>
  452. </div>
  453. </div>
  454. </div>
  455. </div>
  456. <div class="project3" v-if="!item.isDoing">
  457. <div class="project3Left" v-if="item.selectValue === isDoingSelectList[0].type">
  458. <span class="project3LeftName">
  459. <span style="color: #f00" v-if="item.isReq && item.level === 1">*</span>
  460. {{item.inputValue}}
  461. </span>
  462. </div>
  463. <div class="project3Left" v-if="item.selectValue === isDoingSelectList[1].type">
  464. <span class="project3LeftName">
  465. <span style="color: #f00" v-if="item.isReq && item.level === 1">*</span>
  466. {{item.inputValue}}
  467. </span>
  468. <div class="project3LeftDes">
  469. <el-input
  470. :placeholder="item.inputPlaceholderValue"
  471. v-model="item.inputDefaultValue"
  472. size="small"
  473. ></el-input>
  474. <span class="project3LeftDepart">{{item.depart}}</span>
  475. </div>
  476. </div>
  477. <div class="project3Left" v-if="item.selectValue === isDoingSelectList[2].type">
  478. <span class="project3LeftName">
  479. <span style="color: #f00" v-if="item.isReq && item.level === 1">*</span>
  480. {{item.inputValue}}
  481. </span>
  482. <el-input
  483. :placeholder="item.inputPlaceholderValue"
  484. v-model="item.inputDefaultValue"
  485. type="textarea"
  486. :rows="2"
  487. size="small"
  488. ></el-input>
  489. </div>
  490. <div class="project3Left" v-if="item.selectValue === isDoingSelectList[3].type">
  491. <span class="project3LeftName">
  492. <span style="color: #f00" v-if="item.isReq && item.level === 1">*</span>
  493. {{item.inputValue}}
  494. </span>
  495. <div class="radioChild">
  496. <el-radio-group
  497. v-model="item.radioListValue"
  498. @input="()=>onChangeRadioListValue(ind, index)"
  499. >
  500. <el-radio
  501. v-for="(con,ind) in item.radioList"
  502. :key="ind"
  503. :label="con.label"
  504. >{{con.label}}</el-radio>
  505. </el-radio-group>
  506. <div v-for="(con,ind) in item.radioList.filter(con=>con.radioDefault)" :key="ind">
  507. <div v-for="(conn,indd) in con.child" :key="indd">
  508. <div class="project3Left" v-if="conn.selectValue === isDoingSelectList[1].type">
  509. <span class="project3LeftName">{{conn.inputValue}}</span>
  510. <div class="project3LeftDes">
  511. <el-input
  512. :placeholder="conn.inputPlaceholderValue"
  513. v-model="conn.inputDefaultValue"
  514. size="small"
  515. ></el-input>
  516. <span class="project3LeftDepart">{{conn.depart}}</span>
  517. </div>
  518. </div>
  519. <div class="project3Left" v-if="conn.selectValue === isDoingSelectList[2].type">
  520. <span class="project3LeftName">{{conn.inputValue}}</span>
  521. <div class="project3LeftDes">
  522. <el-input
  523. :placeholder="conn.inputPlaceholderValue"
  524. v-model="conn.inputDefaultValue"
  525. type="textarea"
  526. :rows="2"
  527. size="small"
  528. ></el-input>
  529. </div>
  530. </div>
  531. <div class="project3Left" v-if="conn.selectValue === isDoingSelectList[3].type">
  532. <span class="project3LeftName">{{conn.inputValue}}</span>
  533. <div>
  534. <el-radio-group
  535. v-model="conn.radioListValue"
  536. @input="()=>onChangeRadioListValue(ind, index, indd)"
  537. >
  538. <el-radio
  539. v-for="(connn,inddd) in conn.radioList"
  540. :key="inddd"
  541. :label="connn.label"
  542. >{{connn.label}}</el-radio>
  543. </el-radio-group>
  544. </div>
  545. </div>
  546. <div class="project3Left" v-if="conn.selectValue === isDoingSelectList[4].type">
  547. <span class="project3LeftName">{{conn.inputValue}}</span>
  548. <div>
  549. <el-checkbox
  550. v-for="(connn,inddd) in conn.radioList"
  551. v-model="conn.radioList[inddd].radioDefault"
  552. :label="connn.label"
  553. @change="()=>changeCheckbox(ind, index, indd, 'checkbox', inddd)"
  554. :key="inddd"
  555. >{{connn.label}}</el-checkbox>
  556. </div>
  557. </div>
  558. </div>
  559. </div>
  560. </div>
  561. </div>
  562. <div class="project3Left" v-if="item.selectValue === isDoingSelectList[4].type">
  563. <span class="project3LeftName">
  564. <span style="color: #f00" v-if="item.isReq && item.level === 1">*</span>
  565. {{item.inputValue}}
  566. </span>
  567. <div class="radioChild">
  568. <el-checkbox
  569. v-for="(con,ind) in item.radioList"
  570. v-model="item.radioList[ind].radioDefault"
  571. @change="()=>changeCheckbox(ind, index)"
  572. :key="ind"
  573. >{{con.label}}</el-checkbox>
  574. <div v-for="(con,ind) in item.radioList.filter(con=>con.radioDefault)" :key="ind">
  575. <div v-for="(conn,indd) in con.child" :key="indd">
  576. <div class="project3Left" v-if="conn.selectValue === isDoingSelectList[1].type">
  577. <span class="project3LeftName">{{conn.inputValue}}</span>
  578. <div class="project3LeftDes">
  579. <el-input
  580. :placeholder="conn.inputPlaceholderValue"
  581. v-model="conn.inputDefaultValue"
  582. size="small"
  583. ></el-input>
  584. <span class="project3LeftDepart">{{conn.depart}}</span>
  585. </div>
  586. </div>
  587. <div class="project3Left" v-if="conn.selectValue === isDoingSelectList[2].type">
  588. <span class="project3LeftName">{{conn.inputValue}}</span>
  589. <el-input
  590. :placeholder="conn.inputPlaceholderValue"
  591. v-model="conn.inputDefaultValue"
  592. type="textarea"
  593. :rows="2"
  594. size="small"
  595. ></el-input>
  596. </div>
  597. <div class="project3Left" v-if="conn.selectValue === isDoingSelectList[3].type">
  598. <span class="project3LeftName">{{conn.inputValue}}</span>
  599. <div>
  600. <el-radio-group
  601. v-model="conn.radioListValue"
  602. @input="()=>onChangeRadioListValue(ind, index, indd)"
  603. >
  604. <el-radio
  605. v-for="(connn,inddd) in conn.radioList"
  606. :key="inddd"
  607. :label="connn.label"
  608. >{{connn.label}}</el-radio>
  609. </el-radio-group>
  610. </div>
  611. </div>
  612. <div class="project3Left" v-if="conn.selectValue === isDoingSelectList[4].type">
  613. <span class="project3LeftName">{{conn.inputValue}}</span>
  614. <div>
  615. <el-checkbox
  616. v-for="(connn,inddd) in conn.radioList"
  617. :key="inddd"
  618. v-model="conn.radioList[inddd].radioDefault"
  619. :label="connn.label"
  620. @change="()=>changeCheckbox(ind, index, indd, 'checkbox', inddd)"
  621. >{{connn.label}}</el-checkbox>
  622. </div>
  623. </div>
  624. </div>
  625. </div>
  626. </div>
  627. </div>
  628. <div class="project3Left" v-if="item.selectValue === isDoingSelectList[5].type">
  629. <span class="project3LeftName">
  630. <span style="color: #f00" v-if="item.isReq && item.level === 1">*</span>
  631. {{item.inputValue}}
  632. </span>
  633. <div style="flex-grow: 1">
  634. <div>
  635. <el-checkbox
  636. v-for="(con,ind) in item.radioList"
  637. :key="ind"
  638. v-model="item.radioList[ind].radioDefault"
  639. @change="()=>changeCheckbox(ind, index, null, item)"
  640. >{{con.label}}</el-checkbox>
  641. </div>
  642. <el-select
  643. v-model="item.fillValues"
  644. multiple
  645. :placeholder="item.inputPlaceholderValue"
  646. size="small"
  647. popper-class="hiddenPopup"
  648. @remove-tag="()=>removeTag(index, item)"
  649. @change="()=>changeTagValue(index,item)"
  650. allow-create
  651. filterable
  652. default-first-option
  653. >
  654. <el-option
  655. v-for="ele in item.radioList"
  656. :key="ele.label"
  657. :label="ele.label"
  658. :value="ele.label"
  659. ></el-option>
  660. </el-select>
  661. </div>
  662. </div>
  663. <div class="project3Left" v-if="item.selectValue === 'upload'">
  664. <span class="project3LeftName">{{item.label}}</span>
  665. <div class="imgs">
  666. <div v-for="(con,ind) in imageUrl" :key="ind" class="imgsLi">
  667. <el-image
  668. :preview-src-list="imageUrl"
  669. style="width:100px;height:100px"
  670. :src="con"
  671. class="avatar"
  672. />
  673. <i class="el-icon-error" @click="()=>deleteImgList(ind)"></i>
  674. </div>
  675. <el-upload
  676. v-if="item.selectValue === 'upload'"
  677. class="avatar-uploader"
  678. action="https://jsonplaceholder.typicode.com/posts/"
  679. :show-file-list="false"
  680. :on-success="handleAvatarSuccess"
  681. :before-upload="beforeAvatarUpload"
  682. >
  683. <i class="el-icon-plus avatar-uploader-icon"></i>
  684. <div class="el-upload__tip" slot="tip">支持上传jpg/png/jpeg格式文件</div>
  685. </el-upload>
  686. </div>
  687. </div>
  688. </div>
  689. </div>
  690. <div class="action">
  691. <el-dropdown
  692. @command="(v) => add(v, index, item)"
  693. v-if="!item.isDoing && item.selectValue !== 'upload'"
  694. trigger="click"
  695. >
  696. <span class="add">新建</span>
  697. <el-dropdown-menu slot="dropdown">
  698. <el-dropdown-item command="inner">新增下一级项目</el-dropdown-item>
  699. <el-dropdown-item command="before" v-if="item.level !== 1">在该项目前新增同级项目</el-dropdown-item>
  700. <el-dropdown-item command="after" v-if="item.level !== 1">在该项目后新增同级项目</el-dropdown-item>
  701. </el-dropdown-menu>
  702. </el-dropdown>
  703. <span v-if="!item.isDoing && item.selectValue !== 'upload'" @click="()=>edit(index)">编辑</span>
  704. <span
  705. v-if="!item.isDoing && item.selectValue !== 'upload'"
  706. @click="()=>item.level !== 1 && deleteLine(index)"
  707. :class="item.level === 1 ? 'disabled' : ''"
  708. >删除</span>
  709. <span
  710. v-if="item.isDoing && item.selectValue !== 'upload'"
  711. @click="()=>save(item, index)"
  712. >保存</span>
  713. <span
  714. v-if="item.isDoing && item.selectValue !== 'upload'"
  715. @click="()=>cancel(index, item)"
  716. >取消</span>
  717. </div>
  718. </li>
  719. </ul>
  720. <el-dialog
  721. top="5vh"
  722. title="病历模版"
  723. :visible.sync="dialogVisible"
  724. width="1000px"
  725. :before-close="handleClose"
  726. >
  727. <div class="priview-body">
  728. <PriviewEdit :editListF="editList"></PriviewEdit>
  729. </div>
  730. </el-dialog>
  731. <el-dialog title="预览提示" :visible.sync="dialogVisibleConfirm" width="30%">
  732. <span>当前有未保存数据,是否继续预览,预览后未保存数据将清空</span>
  733. <span slot="footer" class="dialog-footer">
  734. <el-button @click="dialogVisibleConfirm = false">取 消</el-button>
  735. <el-button type="primary" @click="onChangeDialogVisibleConfirm">继 续</el-button>
  736. </span>
  737. </el-dialog>
  738. <!-- <div class="btns">
  739. <el-button type="primary" @click="saveAll" size="small">提交</el-button>
  740. <el-button type="primary" @click="seeAll" size="small">预览</el-button>
  741. </div>-->
  742. </div>
  743. </template>
  744. <script>
  745. import pageHeader from "@/components/Header.vue";
  746. import PriviewEdit from "./PriviewEdit.vue";
  747. import { fileUpload } from "@/api/upload.js";
  748. import { Message, Popover, Dropdown } from "element-ui";
  749. export default {
  750. components: {
  751. pageHeader,
  752. Message,
  753. Popover,
  754. Dropdown,
  755. PriviewEdit
  756. },
  757. created() {
  758. // this.getUserInfo()
  759. },
  760. data() {
  761. return {
  762. editList: [
  763. {
  764. label: "主诉",
  765. isReq: true,
  766. type: "textarea",
  767. level: 1,
  768. id: "1",
  769. child: [],
  770. selectValue: "textarea",
  771. inputValue: "主诉",
  772. inputDefaultValue: "",
  773. inputPlaceholderValue: "",
  774. radioList: [
  775. {
  776. label: "",
  777. radioDefault: false,
  778. child: []
  779. }
  780. ],
  781. radioListValue: "",
  782. fillValues: []
  783. },
  784. {
  785. label: "现病史",
  786. isReq: false,
  787. type: "textarea",
  788. level: 1,
  789. id: "2",
  790. child: [],
  791. selectValue: "textarea",
  792. inputValue: "现病史",
  793. inputDefaultValue: "",
  794. inputPlaceholderValue: "",
  795. radioList: [
  796. {
  797. label: "",
  798. radioDefault: false,
  799. child: []
  800. }
  801. ],
  802. radioListValue: "",
  803. fillValues: []
  804. },
  805. {
  806. label: "既往史",
  807. isReq: false,
  808. type: "textarea",
  809. level: 1,
  810. id: "3",
  811. child: [],
  812. selectValue: "textarea",
  813. inputValue: "既往史",
  814. inputDefaultValue: "",
  815. inputPlaceholderValue: "",
  816. radioList: [
  817. {
  818. label: "",
  819. radioDefault: false,
  820. child: []
  821. }
  822. ],
  823. radioListValue: "",
  824. fillValues: []
  825. },
  826. {
  827. label: "中医四诊",
  828. isReq: false,
  829. type: "textarea",
  830. level: 1,
  831. id: "4",
  832. child: [],
  833. selectValue: "textarea",
  834. inputValue: "中医四诊",
  835. inputDefaultValue: "",
  836. inputPlaceholderValue: "",
  837. radioList: [
  838. {
  839. label: "",
  840. radioDefault: false,
  841. child: []
  842. }
  843. ],
  844. radioListValue: "",
  845. fillValues: []
  846. },
  847. {
  848. label: "体格检查",
  849. isReq: false,
  850. type: "textarea",
  851. level: 1,
  852. id: "5",
  853. child: [],
  854. selectValue: "textarea",
  855. inputValue: "体格检查",
  856. inputDefaultValue: "",
  857. inputPlaceholderValue: "",
  858. radioList: [
  859. {
  860. label: "",
  861. radioDefault: false,
  862. child: []
  863. }
  864. ],
  865. radioListValue: "",
  866. fillValues: []
  867. },
  868. {
  869. label: "辅助检查",
  870. isReq: false,
  871. type: "textarea",
  872. level: 1,
  873. id: "6",
  874. child: [],
  875. selectValue: "textarea",
  876. inputValue: "辅助检查",
  877. inputDefaultValue: "",
  878. inputPlaceholderValue: "",
  879. radioList: [
  880. {
  881. label: "",
  882. radioDefault: false,
  883. child: []
  884. }
  885. ],
  886. radioListValue: "",
  887. fillValues: []
  888. },
  889. {
  890. label: "报告上传",
  891. isReq: false,
  892. type: "upload",
  893. level: 1,
  894. id: "7",
  895. child: [],
  896. selectValue: "upload",
  897. inputValue: "",
  898. inputDefaultValue: "",
  899. inputPlaceholderValue: "",
  900. radioList: [
  901. {
  902. label: "",
  903. radioDefault: false,
  904. child: []
  905. }
  906. ],
  907. radioListValue: "",
  908. fillValues: []
  909. }
  910. ],
  911. // 模板
  912. editListInit: [
  913. {
  914. label: "主诉",
  915. isReq: true,
  916. type: "textarea",
  917. level: 1,
  918. id: "1",
  919. child: [],
  920. selectValue: "textarea",
  921. inputValue: "主诉",
  922. inputDefaultValue: "",
  923. inputPlaceholderValue: "",
  924. radioList: [
  925. {
  926. label: "",
  927. radioDefault: false,
  928. child: []
  929. }
  930. ],
  931. radioListValue: "",
  932. fillValues: []
  933. },
  934. {
  935. label: "现病史",
  936. isReq: false,
  937. type: "textarea",
  938. level: 1,
  939. id: "2",
  940. child: [],
  941. selectValue: "textarea",
  942. inputValue: "现病史",
  943. inputDefaultValue: "",
  944. inputPlaceholderValue: "",
  945. radioList: [
  946. {
  947. label: "",
  948. radioDefault: false,
  949. child: []
  950. }
  951. ],
  952. radioListValue: "",
  953. fillValues: []
  954. },
  955. {
  956. label: "既往史",
  957. isReq: false,
  958. type: "textarea",
  959. level: 1,
  960. id: "3",
  961. child: [],
  962. selectValue: "textarea",
  963. inputValue: "既往史",
  964. inputDefaultValue: "",
  965. inputPlaceholderValue: "",
  966. radioList: [
  967. {
  968. label: "",
  969. radioDefault: false,
  970. child: []
  971. }
  972. ],
  973. radioListValue: "",
  974. fillValues: []
  975. },
  976. {
  977. label: "中医四诊",
  978. isReq: false,
  979. type: "textarea",
  980. level: 1,
  981. id: "4",
  982. child: [],
  983. selectValue: "textarea",
  984. inputValue: "中医四诊",
  985. inputDefaultValue: "",
  986. inputPlaceholderValue: "",
  987. radioList: [
  988. {
  989. label: "",
  990. radioDefault: false,
  991. child: []
  992. }
  993. ],
  994. radioListValue: "",
  995. fillValues: []
  996. },
  997. {
  998. label: "体格检查",
  999. isReq: false,
  1000. type: "textarea",
  1001. level: 1,
  1002. id: "5",
  1003. child: [],
  1004. selectValue: "textarea",
  1005. inputValue: "体格检查",
  1006. inputDefaultValue: "",
  1007. inputPlaceholderValue: "",
  1008. radioList: [
  1009. {
  1010. label: "",
  1011. radioDefault: false,
  1012. child: []
  1013. }
  1014. ],
  1015. radioListValue: "",
  1016. fillValues: []
  1017. },
  1018. {
  1019. label: "辅助检查",
  1020. isReq: false,
  1021. type: "textarea",
  1022. level: 1,
  1023. id: "6",
  1024. child: [],
  1025. selectValue: "textarea",
  1026. inputValue: "辅助检查",
  1027. inputDefaultValue: "",
  1028. inputPlaceholderValue: "",
  1029. radioList: [
  1030. {
  1031. label: "",
  1032. radioDefault: false,
  1033. child: []
  1034. }
  1035. ],
  1036. radioListValue: "",
  1037. fillValues: []
  1038. },
  1039. {
  1040. label: "报告上传",
  1041. isReq: false,
  1042. type: "upload",
  1043. level: 1,
  1044. id: "7",
  1045. child: [],
  1046. selectValue: "upload",
  1047. inputValue: "",
  1048. inputDefaultValue: "",
  1049. inputPlaceholderValue: "",
  1050. radioList: [
  1051. {
  1052. label: "",
  1053. radioDefault: false,
  1054. child: []
  1055. }
  1056. ],
  1057. radioListValue: "",
  1058. fillValues: []
  1059. }
  1060. ],
  1061. isDoingSelectList: [
  1062. {
  1063. label: "标题",
  1064. type: "subject"
  1065. },
  1066. {
  1067. label: "单行文本",
  1068. type: "input"
  1069. },
  1070. {
  1071. label: "多行文本",
  1072. type: "textarea"
  1073. },
  1074. {
  1075. label: "单选",
  1076. type: "radio"
  1077. },
  1078. {
  1079. label: "多选",
  1080. type: "checkbox"
  1081. },
  1082. {
  1083. label: "选项填入输入框",
  1084. type: "fill"
  1085. }
  1086. ],
  1087. commonParams: {
  1088. inputValue: "",
  1089. selectValue: "",
  1090. radioList: [
  1091. {
  1092. label: "",
  1093. radioDefault: false,
  1094. child: []
  1095. }
  1096. ],
  1097. radioListValue: "",
  1098. fillValues: []
  1099. },
  1100. dialogVisible: false,
  1101. dialogVisibleConfirm: false,
  1102. imageUrl: []
  1103. };
  1104. },
  1105. methods: {
  1106. async fileUpload(data) {
  1107. let res = await fileUpload(data);
  1108. if (res.ResultCode == 0) {
  1109. this.$message({
  1110. type: "success",
  1111. message: "上传成功",
  1112. showClose: true
  1113. });
  1114. this.imageUrl.push(
  1115. process.env.VUE_APP_UPLOAD + "file/" + res.ResultInfo
  1116. );
  1117. }
  1118. },
  1119. handleAvatarSuccess(res, file) {
  1120. this.imageUrl = URL.createObjectURL(file.raw);
  1121. },
  1122. beforeAvatarUpload(file) {
  1123. console.log(file, "file文件");
  1124. if (
  1125. file.type === "image/jpg" ||
  1126. file.type === "image/png" ||
  1127. file.type === "image/jpeg"
  1128. ) {
  1129. let formData = new FormData();
  1130. formData.append("file", file);
  1131. this.fileUpload(formData);
  1132. } else {
  1133. this.$message.error("文件类型有误");
  1134. }
  1135. return false;
  1136. },
  1137. deleteImgList(ind) {
  1138. this.imageUrl.splice(ind, 1);
  1139. },
  1140. add(type, index, item) {
  1141. const arr = {
  1142. inputValue: "",
  1143. selectValue: "",
  1144. radioList: [
  1145. {
  1146. label: "",
  1147. radioDefault: false,
  1148. child: []
  1149. }
  1150. ],
  1151. radioListValue: "",
  1152. fillValues: []
  1153. };
  1154. const { id, level, father, countId } = item;
  1155. const callback = v => {
  1156. let count = 0;
  1157. let countTemplate = 0;
  1158. this.editList.forEach(ele => {
  1159. if (ele.father === v) {
  1160. count += 1;
  1161. ele.id = `${v}-${count}`;
  1162. ele.countId = count;
  1163. }
  1164. });
  1165. this.editListInit.forEach(ele => {
  1166. if (ele.father === v) {
  1167. countTemplate += 1;
  1168. ele.id = `${v}-${countTemplate}`;
  1169. ele.countId = countTemplate;
  1170. }
  1171. });
  1172. };
  1173. if (type === "inner") {
  1174. this.editList.splice(index + 1, 0, {
  1175. isDoing: true,
  1176. level: level + 1,
  1177. father: id,
  1178. id: `${id}-1`,
  1179. countId: 1,
  1180. ...arr
  1181. });
  1182. this.editListInit.splice(index + 1, 0, {
  1183. isDoing: true,
  1184. level: level + 1,
  1185. father: id,
  1186. id: `${id}-1`,
  1187. countId: 1,
  1188. ...arr
  1189. });
  1190. callback(id);
  1191. } else if (type === "before") {
  1192. this.editList.splice(index, 0, {
  1193. isDoing: true,
  1194. level: level,
  1195. father,
  1196. id: `${father}-${countId}`,
  1197. countId,
  1198. ...arr
  1199. });
  1200. this.editListInit.splice(index, 0, {
  1201. isDoing: true,
  1202. level: level,
  1203. father,
  1204. id: `${father}-${countId}`,
  1205. countId,
  1206. ...arr
  1207. });
  1208. callback(father);
  1209. } else {
  1210. this.editList.splice(index + 1, 0, {
  1211. isDoing: true,
  1212. level: level,
  1213. father,
  1214. id: `${father}-${countId + 1}`,
  1215. countId: countId + 1,
  1216. ...arr
  1217. });
  1218. this.editListInit.splice(index + 1, 0, {
  1219. isDoing: true,
  1220. level: level,
  1221. father,
  1222. id: `${father}-${countId + 1}`,
  1223. countId: countId + 1,
  1224. ...arr
  1225. });
  1226. callback(father);
  1227. }
  1228. },
  1229. getInitFrom(index, arr) {
  1230. // 从表象获取模版
  1231. const arrNew = [...this.editListInit];
  1232. arrNew.forEach((ele, ind) => {
  1233. if (ind === index) {
  1234. // ele = this.editList[index]
  1235. ele.fillValues = arr[index].fillValues || [];
  1236. ele.inputDefaultValue = arr[index].inputDefaultValue;
  1237. ele.inputPlaceholderValue = arr[index].inputPlaceholderValue;
  1238. ele.inputValue = arr[index].inputValue;
  1239. ele.radioList = JSON.parse(
  1240. JSON.stringify(arr[index].radioList || [])
  1241. );
  1242. ele.radioListValue = arr[index].radioListValue || "";
  1243. ele.isReq = arr[index].isReq;
  1244. ele.selectValue = arr[index].selectValue;
  1245. ele.isEditing = arr[index].isEditing;
  1246. ele.isDoing = arr[index].isDoing;
  1247. }
  1248. });
  1249. this.editListInit = arrNew;
  1250. },
  1251. getFromInit(index, arr) {
  1252. // 从模版获取表象
  1253. const arrNew = [...this.editList];
  1254. arrNew.forEach((ele, ind) => {
  1255. if (ind === index) {
  1256. ele.fillValues = arr[index].fillValues || [];
  1257. ele.inputDefaultValue = arr[index].inputDefaultValue;
  1258. ele.inputPlaceholderValue = arr[index].inputPlaceholderValue;
  1259. ele.inputValue = arr[index].inputValue;
  1260. ele.radioList = JSON.parse(
  1261. JSON.stringify(arr[index].radioList || [])
  1262. );
  1263. ele.radioListValue = arr[index].radioListValue || "";
  1264. ele.isReq = arr[index].isReq;
  1265. ele.selectValue = arr[index].selectValue;
  1266. ele.isEditing = true;
  1267. ele.isDoing = true;
  1268. }
  1269. });
  1270. this.editList = arrNew;
  1271. },
  1272. save(v, index) {
  1273. if (!v.inputValue || v.inputValue.trim() === "") {
  1274. this.$message.error("项目名称不能为空");
  1275. return;
  1276. } else if (!v.selectValue || v.selectValue.trim() === "") {
  1277. this.$message.error("备选项形式不能为空");
  1278. return;
  1279. } else if (
  1280. v.selectValue === "radio" ||
  1281. v.selectValue === "checkbox" ||
  1282. v.selectValue === "fill"
  1283. ) {
  1284. let flag = false;
  1285. let flagChild = false;
  1286. v.radioList.forEach(ele => {
  1287. if (ele.label.trim() === "") {
  1288. flag = true;
  1289. }
  1290. if (ele.child) {
  1291. ele.child.forEach(con => {
  1292. if (
  1293. !con.inputValue ||
  1294. con.inputValue.trim() === "" ||
  1295. !con.selectValue ||
  1296. con.selectValue.trim() === ""
  1297. ) {
  1298. flagChild = true;
  1299. }
  1300. if (
  1301. con.selectValue === "radio" ||
  1302. con.selectValue === "checkbox"
  1303. ) {
  1304. con.radioList.forEach(conn => {
  1305. if (conn.label.trim() === "") {
  1306. flagChild = true;
  1307. }
  1308. });
  1309. }
  1310. });
  1311. }
  1312. });
  1313. if (flag) {
  1314. this.$message.error("备选项不能为空");
  1315. return;
  1316. }
  1317. if (flagChild) {
  1318. this.$message.error("子备选项不能为空");
  1319. return;
  1320. }
  1321. }
  1322. const arr = JSON.parse(JSON.stringify([...this.editList]));
  1323. arr.forEach(ele => {
  1324. if (ele.id === v.id) {
  1325. ele.isDoing = false;
  1326. ele.isEditing = false;
  1327. if (v.selectValue === "radio") {
  1328. ele.radioListValue =
  1329. ele.radioList.filter(con => con.radioDefault === "1").length > 0
  1330. ? ele.radioList.filter(con => con.radioDefault === "1")[0].label
  1331. : "";
  1332. ele.radioList.forEach(con => {
  1333. if (con.child && con.child.length > 0) {
  1334. con.child.forEach(conn => {
  1335. if (conn.selectValue === "radio") {
  1336. conn.radioListValue =
  1337. conn.radioList.filter(con => con.radioDefault === "1")
  1338. .length > 0
  1339. ? conn.radioList.filter(
  1340. con => con.radioDefault === "1"
  1341. )[0].label
  1342. : "";
  1343. }
  1344. });
  1345. }
  1346. });
  1347. }
  1348. if (v.selectValue === "checkbox") {
  1349. ele.radioList.forEach(con => {
  1350. if (con.child && con.child.length > 0) {
  1351. con.child.forEach(conn => {
  1352. if (conn.selectValue === "radio") {
  1353. conn.radioListValue =
  1354. conn.radioList.filter(con => con.radioDefault === "1")
  1355. .length > 0
  1356. ? conn.radioList.filter(
  1357. con => con.radioDefault === "1"
  1358. )[0].label
  1359. : "";
  1360. }
  1361. });
  1362. }
  1363. });
  1364. }
  1365. if (v.selectValue === "fill") {
  1366. ele.fillValues = ele.radioList
  1367. .filter(ele => ele.radioDefault)
  1368. .map(ele => ele.label);
  1369. }
  1370. }
  1371. });
  1372. // 赋值模板
  1373. this.getInitFrom(index, arr);
  1374. this.editList = arr;
  1375. },
  1376. cancel(index, item) {
  1377. if (item.isEditing) {
  1378. const arr = JSON.parse(JSON.stringify([...this.editListInit]));
  1379. const arrOld = JSON.parse(JSON.stringify([...this.editList]));
  1380. arrOld.forEach((ele, ind) => {
  1381. if (ind === index) {
  1382. ele.fillValues = arr[index].fillValues || [];
  1383. ele.inputDefaultValue = arr[index].inputDefaultValue;
  1384. ele.inputPlaceholderValue = arr[index].inputPlaceholderValue;
  1385. ele.inputValue = arr[index].inputValue;
  1386. ele.radioList = JSON.parse(
  1387. JSON.stringify(arr[index].radioList || [])
  1388. );
  1389. ele.radioListValue = arr[index].radioListValue || "";
  1390. ele.isReq = arr[index].isReq;
  1391. ele.selectValue = arr[index].selectValue;
  1392. ele.isEditing = false;
  1393. ele.isDoing = false;
  1394. }
  1395. });
  1396. this.editList = [...arrOld];
  1397. } else {
  1398. this.editList.splice(index, 1);
  1399. this.editListInit.splice(index, 1);
  1400. }
  1401. },
  1402. deleteLine(index) {
  1403. this.editList.splice(index, 1);
  1404. this.editListInit.splice(index, 1);
  1405. },
  1406. edit(index) {
  1407. // 赋值表面模板
  1408. const arr = JSON.parse(JSON.stringify([...this.editListInit]));
  1409. this.getFromInit(index, arr);
  1410. },
  1411. onChangeDownTemplate(index, end, endMore) {
  1412. const deleteList = this.editListInit.filter((ele, ind) =>
  1413. endMore === 0 ? ind >= end : ind >= end && ind < endMore
  1414. ); // 需要前置的项
  1415. const arr = [];
  1416. this.editListInit.forEach((ele, ind) => {
  1417. if (ind < end || (endMore !== 0 && ind >= endMore)) {
  1418. arr.push(ele);
  1419. }
  1420. });
  1421. arr.splice(index, 0, ...deleteList);
  1422. this.editListInit = arr;
  1423. },
  1424. down(index, item) {
  1425. let end = 0;
  1426. this.editList.forEach((ele, ind) => {
  1427. if (
  1428. ind > index &&
  1429. ele.level === item.level &&
  1430. end === 0 &&
  1431. ele.father === item.father
  1432. ) {
  1433. end = ind;
  1434. }
  1435. });
  1436. let endMore = 0;
  1437. this.editList.forEach((ele, ind) => {
  1438. if (
  1439. ind > end &&
  1440. ele.level === item.level &&
  1441. endMore === 0 &&
  1442. ele.father === item.father
  1443. ) {
  1444. endMore = ind;
  1445. }
  1446. });
  1447. if (endMore === 0) {
  1448. this.editList.forEach((ele, ind) => {
  1449. if (ind > end && endMore === 0 && ele.level < item.level) {
  1450. endMore = ind;
  1451. }
  1452. });
  1453. }
  1454. const deleteList = this.editList.filter((ele, ind) =>
  1455. endMore === 0 ? ind >= end : ind >= end && ind < endMore
  1456. ); // 需要前置的项
  1457. const arr = [];
  1458. this.editList.forEach((ele, ind) => {
  1459. if (ind < end || (endMore !== 0 && ind >= endMore)) {
  1460. arr.push(ele);
  1461. }
  1462. });
  1463. arr.splice(index, 0, ...deleteList);
  1464. this.editList = arr;
  1465. this.onChangeDownTemplate(index, end, endMore);
  1466. },
  1467. onChangeUpTemplate(index, end, endMore) {
  1468. const deleteList = this.editListInit.filter((ele, ind) =>
  1469. endMore === 0 ? ind >= index : ind >= index && ind < endMore
  1470. ); // 需要前置的项
  1471. const arr = [];
  1472. this.editListInit.forEach((ele, ind) => {
  1473. if (ind < index || (endMore !== 0 && ind >= endMore)) {
  1474. arr.push(ele);
  1475. }
  1476. });
  1477. arr.splice(end, 0, ...deleteList);
  1478. this.editListInit = arr;
  1479. },
  1480. up(index, item) {
  1481. let end = 0;
  1482. this.editList.forEach((ele, ind) => {
  1483. if (
  1484. ind < index &&
  1485. ele.level === item.level &&
  1486. ele.father === item.father
  1487. ) {
  1488. end = ind;
  1489. }
  1490. });
  1491. let endMore = 0;
  1492. this.editList.forEach((ele, ind) => {
  1493. if (
  1494. ind > index &&
  1495. ele.level === item.level &&
  1496. endMore === 0 &&
  1497. ele.father === item.father
  1498. ) {
  1499. endMore = ind;
  1500. }
  1501. });
  1502. if (endMore === 0) {
  1503. this.editList.forEach((ele, ind) => {
  1504. if (ind > index && endMore === 0 && ele.level < item.level) {
  1505. endMore = ind;
  1506. }
  1507. });
  1508. }
  1509. const deleteList = this.editList.filter((ele, ind) =>
  1510. endMore === 0 ? ind >= index : ind >= index && ind < endMore
  1511. ); // 需要前置的项
  1512. const arr = [];
  1513. this.editList.forEach((ele, ind) => {
  1514. if (ind < index || (endMore !== 0 && ind >= endMore)) {
  1515. arr.push(ele);
  1516. }
  1517. });
  1518. arr.splice(end, 0, ...deleteList);
  1519. this.editList = arr;
  1520. this.onChangeUpTemplate(index, end, endMore);
  1521. },
  1522. radioAdd(ind, index, indd, type, inddd) {
  1523. const commonParams = {
  1524. label: "",
  1525. child: [],
  1526. radioDefault: type === "checkbox" ? false : "",
  1527. radioList: [
  1528. {
  1529. label: "",
  1530. radioDefault: false,
  1531. child: []
  1532. }
  1533. ],
  1534. radioListValue: ""
  1535. };
  1536. if (inddd || inddd === 0) {
  1537. this.editList.forEach((ele, indx) => {
  1538. if (indx === index) {
  1539. ele.radioList.forEach((con, indxx) => {
  1540. if (indxx === ind) {
  1541. con.child.forEach((conn, indxxx) => {
  1542. if (indxxx === indd) {
  1543. conn.radioList.splice(inddd + 1, 0, {
  1544. ...commonParams
  1545. });
  1546. }
  1547. });
  1548. }
  1549. });
  1550. }
  1551. });
  1552. } else if (indd || indd === 0) {
  1553. this.editList.forEach((ele, indx) => {
  1554. if (indx === index) {
  1555. ele.radioList.forEach((con, indxx) => {
  1556. if (indxx === ind) {
  1557. con.child.splice(indd + 1, 0, {
  1558. ...commonParams
  1559. });
  1560. }
  1561. });
  1562. }
  1563. });
  1564. } else {
  1565. this.editList.forEach((ele, indx) => {
  1566. if (indx === index) {
  1567. ele.radioList.splice(ind + 1, 0, {
  1568. ...commonParams
  1569. });
  1570. }
  1571. });
  1572. }
  1573. },
  1574. radioAddChild(ind, index) {
  1575. this.editList.forEach((ele, indx) => {
  1576. if (indx === index) {
  1577. ele.radioList.forEach((con, indd) => {
  1578. if (indd === ind) {
  1579. // const arr = {...this.commonParams}
  1580. con.child.unshift({
  1581. inputValue: "",
  1582. selectValue: "",
  1583. radioList: [
  1584. {
  1585. label: "",
  1586. radioDefault: false,
  1587. child: []
  1588. }
  1589. ],
  1590. fillValues: []
  1591. });
  1592. }
  1593. });
  1594. }
  1595. });
  1596. },
  1597. radioDelete(ind, index, indd, inddd) {
  1598. if (inddd || inddd === 0) {
  1599. this.editList.forEach((ele, indx) => {
  1600. if (indx === index) {
  1601. ele.radioList.forEach((con, indxx) => {
  1602. if (indxx === ind) {
  1603. con.child.forEach((conn, indxxx) => {
  1604. if (indxxx === indd) {
  1605. conn.radioList.splice(inddd, 1);
  1606. }
  1607. });
  1608. }
  1609. });
  1610. }
  1611. });
  1612. } else if (indd || indd === 0) {
  1613. this.editList.forEach((ele, indx) => {
  1614. if (indx === index) {
  1615. ele.radioList.forEach((con, indxx) => {
  1616. if (indxx === ind) {
  1617. con.child.splice(indd, 1);
  1618. }
  1619. });
  1620. }
  1621. });
  1622. } else {
  1623. this.editList.forEach((ele, indx) => {
  1624. if (indx === index) {
  1625. ele.radioList.splice(ind, 1);
  1626. }
  1627. });
  1628. }
  1629. },
  1630. radioDefaultSelect(ind, index, indd, inddd) {
  1631. if (inddd || inddd === 0) {
  1632. this.editList.forEach((ele, indx) => {
  1633. if (indx === index) {
  1634. ele.radioList.forEach((con, indxx) => {
  1635. if (indxx === ind) {
  1636. con.child.forEach((conn, indxxx) => {
  1637. if (indxxx === indd) {
  1638. conn.radioList.forEach((connn, indxxxx) => {
  1639. if (indxxxx !== inddd) {
  1640. connn.radioDefault = "";
  1641. }
  1642. });
  1643. }
  1644. });
  1645. }
  1646. });
  1647. }
  1648. });
  1649. } else {
  1650. this.editList.forEach((ele, indx) => {
  1651. if (indx === index) {
  1652. ele.radioList.forEach((con, inde) => {
  1653. if (inde !== ind) {
  1654. con.radioDefault = "";
  1655. }
  1656. });
  1657. }
  1658. });
  1659. }
  1660. },
  1661. changeCheckbox(ind, index, indd, item, inddd) {
  1662. const arr = JSON.parse(JSON.stringify([...this.editList]));
  1663. if (indd || indd === 0) {
  1664. const flag = this.editList
  1665. .filter((ele, indx) => indx === index)[0]
  1666. .radioList.filter((ele, indx) => indx === ind)[0]
  1667. .child.filter((ele, indx) => indx === indd)[0]
  1668. .radioList.filter((ele, indxx) => indxx === inddd)[0]
  1669. .radioDefaultOther;
  1670. arr.forEach((ele, indx) => {
  1671. if (indx === index) {
  1672. ele.radioList.forEach((con, indxx) => {
  1673. if (indxx === ind) {
  1674. con.child.forEach((conn, indxxx) => {
  1675. conn.radioList.forEach((connn, indxxxx) => {
  1676. if (indxxxx !== inddd && flag) {
  1677. connn.radioDefault = false;
  1678. } else if (indxxxx !== inddd && !flag) {
  1679. connn.radioDefaultOther
  1680. ? (connn.radioDefault = false)
  1681. : null;
  1682. }
  1683. });
  1684. });
  1685. }
  1686. });
  1687. }
  1688. });
  1689. this.editList = arr;
  1690. } else {
  1691. const flag = this.editList
  1692. .filter((ele, indx) => indx === index)[0]
  1693. .radioList.filter((ele, indx) => indx === ind)[0].radioDefaultOther;
  1694. arr.forEach((ele, indx) => {
  1695. if (indx === index) {
  1696. ele.radioList.forEach((con, indxx) => {
  1697. if (indxx !== ind && flag) {
  1698. con.radioDefault = false;
  1699. } else if (indxx !== ind && !flag) {
  1700. con.radioDefaultOther ? (con.radioDefault = false) : null;
  1701. }
  1702. });
  1703. }
  1704. });
  1705. if (item && item.selectValue === "fill") {
  1706. arr.forEach((ele, indx) => {
  1707. if (indx === index) {
  1708. let labels = ele.radioList.map(elee => {
  1709. return elee.label;
  1710. });
  1711. let valuesSave = JSON.parse(JSON.stringify(ele.fillValues));
  1712. let inputArr = valuesSave.filter(ele1 => {
  1713. return !labels.includes(ele1) ? ele1 : "";
  1714. });
  1715. let arr = ele.radioList
  1716. .filter(ele => ele.radioDefault)
  1717. .map(ele => ele.label);
  1718. let arr1 = new Set([...arr, ...inputArr]);
  1719. ele.fillValues = Array.from(arr1);
  1720. }
  1721. });
  1722. }
  1723. this.editList = arr;
  1724. }
  1725. },
  1726. changeCheckboxOther(v, ind, index, indd, inddd) {
  1727. if (!v) {
  1728. return;
  1729. }
  1730. this.changeCheckbox(ind, index, indd, null, inddd);
  1731. },
  1732. onChangeRadioListValue(ind, index, indd) {
  1733. const arr = JSON.parse(JSON.stringify([...this.editList]));
  1734. if (indd || indd === 0) {
  1735. const radioListValue = this.editList
  1736. .filter((ele, indx) => indx === index)[0]
  1737. .radioList.filter((ele, indx) => indx === ind)[0]
  1738. .child.filter((ele, indx) => indx === indd)[0].radioListValue;
  1739. arr.forEach((ele, indx) => {
  1740. if (indx === index) {
  1741. ele.radioList.forEach((con, indxx) => {
  1742. if (indxx === ind) {
  1743. con.child.forEach((conn, indxxx) => {
  1744. if (indxxx === indd) {
  1745. conn.radioList.forEach(connn => {
  1746. if (radioListValue === connn.label) {
  1747. connn.radioDefault = "1";
  1748. } else {
  1749. connn.radioDefault = "";
  1750. }
  1751. });
  1752. }
  1753. });
  1754. }
  1755. });
  1756. }
  1757. });
  1758. this.editList = arr;
  1759. } else {
  1760. const radioListValue = this.editList.filter(
  1761. (ele, indx) => indx === index
  1762. )[0].radioListValue;
  1763. arr.forEach((ele, indx) => {
  1764. if (indx === index) {
  1765. ele.radioList.forEach((con, indxx) => {
  1766. if (radioListValue === con.label) {
  1767. con.radioDefault = "1";
  1768. } else {
  1769. con.radioDefault = "";
  1770. }
  1771. });
  1772. }
  1773. });
  1774. this.editList = arr;
  1775. }
  1776. },
  1777. removeTag(index, item) {
  1778. this.editList.forEach((ele, ind) => {
  1779. if (ind === index) {
  1780. ele.radioList.forEach(con => {
  1781. if (item.fillValues.includes(con.label)) {
  1782. con.radioDefault = true;
  1783. } else {
  1784. con.radioDefault = false;
  1785. }
  1786. });
  1787. }
  1788. });
  1789. },
  1790. changeTagValue(index, item) {
  1791. this.editList.forEach((ele, ind) => {
  1792. if (ind === index) {
  1793. ele.radioList.forEach(con => {
  1794. if (item.fillValues.includes(con.label)) {
  1795. con.radioDefault = true;
  1796. } else {
  1797. con.radioDefault = false;
  1798. }
  1799. });
  1800. }
  1801. });
  1802. },
  1803. isHasDown(index, item) {
  1804. if (item.level === 1) return false;
  1805. let endMore = -1;
  1806. this.editList.forEach((ele, ind) => {
  1807. if (
  1808. ind > index &&
  1809. ele.level === item.level &&
  1810. ele.father === item.father
  1811. ) {
  1812. endMore = ind;
  1813. }
  1814. });
  1815. return endMore !== -1;
  1816. },
  1817. isHasUp(index, item) {
  1818. if (item.level === 1) return false;
  1819. let end = -1;
  1820. this.editList.forEach((ele, ind) => {
  1821. if (
  1822. ind < index &&
  1823. ele.level === item.level &&
  1824. ele.father === item.father
  1825. ) {
  1826. end = ind;
  1827. }
  1828. });
  1829. return end !== -1;
  1830. },
  1831. getLeftWidth(level) {
  1832. return (level - 1) * 40 + "px";
  1833. },
  1834. saveAll() {
  1835. this.$message.success(`提交信息:${JSON.stringify(this.editListInit)}`);
  1836. },
  1837. onChangeDialogVisibleConfirm() {
  1838. this.dialogVisibleConfirm = false;
  1839. this.editList = JSON.parse(JSON.stringify([...this.editListInit]));
  1840. const arr = [];
  1841. this.editList.forEach(ele => {
  1842. if (!ele.isDoing || (ele.isDoing && ele.isEditing)) {
  1843. arr.push(ele);
  1844. }
  1845. });
  1846. this.editList = JSON.parse(JSON.stringify([...arr]));
  1847. this.editListInit = JSON.parse(JSON.stringify([...arr]));
  1848. this.dialogVisible = true;
  1849. },
  1850. seeAll() {
  1851. let flag = false;
  1852. this.editList.forEach(ele => {
  1853. if (ele.isDoing) {
  1854. flag = true;
  1855. }
  1856. });
  1857. this.imageUrl = [];
  1858. if (flag) {
  1859. this.dialogVisibleConfirm = true;
  1860. } else {
  1861. this.editList = JSON.parse(JSON.stringify([...this.editListInit]));
  1862. const arr = [];
  1863. this.editList.forEach(ele => {
  1864. if (!ele.isDoing || (ele.isDoing && ele.isEditing)) {
  1865. arr.push(ele);
  1866. }
  1867. });
  1868. this.editList = arr;
  1869. this.dialogVisible = true;
  1870. }
  1871. },
  1872. handleClose() {
  1873. this.dialogVisible = false;
  1874. }
  1875. }
  1876. };
  1877. </script>
  1878. <style lang="scss" scoped>
  1879. .priview-body {
  1880. }
  1881. .page-index ::v-deep .el-dialog {
  1882. margin: 0 auto;
  1883. height: 90vh;
  1884. overflow: auto;
  1885. }
  1886. .page-index ::v-deep .el-dialog__header {
  1887. padding: 10px;
  1888. }
  1889. .page-index ::v-deep .el-dialog__body {
  1890. padding: 10px 10px;
  1891. height: 90%;
  1892. overflow: auto;
  1893. box-sizing: border-box;
  1894. }
  1895. .page-index {
  1896. width: 1200px;
  1897. line-height: 32px;
  1898. background-color: #fff;
  1899. margin: auto;
  1900. > ul {
  1901. > li {
  1902. display: flex;
  1903. padding: 10px;
  1904. > div {
  1905. margin: 0 5px;
  1906. }
  1907. .ind {
  1908. width: 40px;
  1909. text-align: center;
  1910. }
  1911. .level {
  1912. width: 40px;
  1913. text-align: center;
  1914. }
  1915. .order {
  1916. width: 40px;
  1917. text-align: center;
  1918. i {
  1919. cursor: pointer;
  1920. }
  1921. }
  1922. .isReq {
  1923. width: 40px;
  1924. text-align: center;
  1925. }
  1926. .project {
  1927. flex-grow: 1;
  1928. display: flex;
  1929. .project1 {
  1930. display: inline-flex;
  1931. width: 100%;
  1932. .projectLabel {
  1933. width: 70px;
  1934. text-align: right;
  1935. padding-right: 10px;
  1936. font-weight: bold;
  1937. }
  1938. .projectType {
  1939. flex-grow: 1;
  1940. }
  1941. }
  1942. .project2 {
  1943. width: 100%;
  1944. .project2Left {
  1945. display: flex;
  1946. margin-bottom: 5px;
  1947. .project2LeftName {
  1948. width: 100px;
  1949. text-align: right;
  1950. padding-right: 10px;
  1951. }
  1952. .radioAdd {
  1953. margin-left: 10px;
  1954. cursor: pointer;
  1955. &:hover {
  1956. color: #5386f6;
  1957. }
  1958. }
  1959. .radioAddChild {
  1960. margin-left: 10px;
  1961. cursor: pointer;
  1962. &:hover {
  1963. color: #5386f6;
  1964. }
  1965. }
  1966. .radioDelete {
  1967. margin-left: 10px;
  1968. cursor: pointer;
  1969. &:hover {
  1970. color: #5386f6;
  1971. }
  1972. }
  1973. .bei {
  1974. display: flex;
  1975. .el-checkbox {
  1976. margin-left: 5px;
  1977. }
  1978. }
  1979. .childBei {
  1980. margin-top: 5px;
  1981. margin-left: 80px;
  1982. border: 1px solid #ccc;
  1983. .el-checkbox {
  1984. margin-left: 5px;
  1985. }
  1986. .project2LeftName {
  1987. width: 105px;
  1988. }
  1989. }
  1990. .el-input {
  1991. width: 200px;
  1992. }
  1993. .el-select {
  1994. width: 200px;
  1995. }
  1996. .el-checkbox {
  1997. display: inline-flex;
  1998. align-items: center;
  1999. margin-right: 5px;
  2000. }
  2001. .el-radio {
  2002. margin: 0 5px;
  2003. align-items: center;
  2004. display: inline-flex;
  2005. }
  2006. }
  2007. }
  2008. .project3 {
  2009. width: 100%;
  2010. .project3Left {
  2011. display: flex;
  2012. .project3LeftName {
  2013. flex-shrink: 0;
  2014. width: 100px;
  2015. text-align: right;
  2016. padding-right: 10px;
  2017. }
  2018. .radioChild {
  2019. flex-grow: 1;
  2020. .project3LeftName {
  2021. width: auto;
  2022. }
  2023. .project3Left {
  2024. margin: 3px 0;
  2025. }
  2026. }
  2027. .project3LeftDes {
  2028. flex-grow: 1;
  2029. display: flex;
  2030. // .el-input {
  2031. // width: 200px;
  2032. // }
  2033. // .el-textarea {
  2034. // width: 200px;
  2035. // }
  2036. }
  2037. .project3LeftDepart {
  2038. flex-shrink: 0;
  2039. margin-left: 3px;
  2040. }
  2041. .el-radio-group {
  2042. display: inline-flex;
  2043. align-items: center;
  2044. .el-radio {
  2045. margin-left: 10px;
  2046. margin-right: 0;
  2047. }
  2048. }
  2049. .el-checkbox {
  2050. margin-left: 0;
  2051. margin-right: 10px;
  2052. }
  2053. .el-select {
  2054. width: 100%;
  2055. }
  2056. }
  2057. }
  2058. }
  2059. .action {
  2060. width: 130px;
  2061. span {
  2062. margin: 0 5px;
  2063. cursor: pointer;
  2064. &:hover {
  2065. color: #5386f6;
  2066. }
  2067. }
  2068. .add {
  2069. color: #2c3e50;
  2070. font-size: 16px;
  2071. }
  2072. }
  2073. }
  2074. }
  2075. .disabled {
  2076. color: #c0c4cc;
  2077. cursor: not-allowed !important;
  2078. &:hover {
  2079. color: #c0c4cc !important;
  2080. }
  2081. }
  2082. .btns {
  2083. text-align: center;
  2084. margin: 20px 0;
  2085. }
  2086. }
  2087. </style>
  2088. <style lang="scss">
  2089. .hiddenPopup {
  2090. display: none;
  2091. }
  2092. .project3Left .el-input__suffix {
  2093. display: none !important;
  2094. }
  2095. .preview {
  2096. width: 100% !important;
  2097. .projectLabel {
  2098. width: unset !important;
  2099. }
  2100. .project3LeftName {
  2101. width: unset !important;
  2102. }
  2103. }
  2104. .avatar-uploader .el-upload {
  2105. border: 1px dashed #d9d9d9;
  2106. border-radius: 6px;
  2107. cursor: pointer;
  2108. position: relative;
  2109. overflow: hidden;
  2110. }
  2111. .avatar-uploader .el-upload:hover {
  2112. border-color: #409eff;
  2113. }
  2114. .avatar-uploader-icon {
  2115. font-size: 28px;
  2116. color: #8c939d;
  2117. width: 100px;
  2118. height: 100px;
  2119. line-height: 100px !important;
  2120. text-align: center;
  2121. }
  2122. .avatar-uploader .el-upload__tip {
  2123. margin-top: 0;
  2124. }
  2125. .avatar {
  2126. width: 100px;
  2127. height: 100px;
  2128. display: block;
  2129. }
  2130. .imgs {
  2131. display: flex;
  2132. }
  2133. .imgsLi {
  2134. border: 1px dashed #d9d9d9;
  2135. border-radius: 6px;
  2136. position: relative;
  2137. width: 100px;
  2138. height: 100px;
  2139. margin-right: 10px;
  2140. }
  2141. .el-icon-error {
  2142. cursor: pointer;
  2143. position: absolute;
  2144. right: -8px;
  2145. top: -8px;
  2146. }
  2147. </style>