| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213 |
- <template>
- <div class="page-index">
- <ul>
- <li>
- <div class="ind">序号</div>
- <div class="level">层次</div>
- <div class="order">顺序</div>
- <div class="isReq">必填</div>
- <div class="project" style="justify-content: center">项目</div>
- <div class="action" style="text-align: center">操作</div>
- </li>
- <li v-for="(item,index) in editList" :key="index">
- <div class="ind">{{index+1}}</div>
- <div class="level">{{item.level}}</div>
- <div class="order">
- <i class="el-icon-bottom" v-if="isHasDown(index, item)" @click="()=>down(index, item)"></i>
- <i class="el-icon-top" v-if="isHasUp(index, item)" @click="()=>up(index, item)"></i>
- </div>
- <div class="isReq">
- <i class="el-icon-check" v-if="item.isReq"></i>
- </div>
- <div class="project">
- <div class="project1" v-if="!item.isDoing && item.level === -1">
- <div class="projectLabel">
- <span style="color: #f00" v-if="item.isReq">*</span>
- <span>{{item.label}}</span>
- </div>
- <div class="projectType">
- <el-input
- type="textarea"
- :rows="2"
- v-model="item.inputDefaultValue"
- :placeholder="item.inputPlaceholderValue"
- size="small"
- v-if="item.selectValue !== 'upload'"
- ></el-input>
- </div>
- </div>
- <div class="project2" v-if="item.isDoing">
- <div class="project2Left">
- <div class="project2LeftName">
- <span style="color: #f00">*</span>
- <span>项目名称</span>
- </div>
- <el-input
- placeholder
- v-model="item.inputValue"
- size="small"
- :disabled="item.level === 1"
- ></el-input>
- </div>
- <div class="project2Left">
- <div class="project2LeftName">
- <span style="color: #f00">*</span>
- <span>备选项形式</span>
- </div>
- <el-select placeholder="请选择" v-model="item.selectValue" size="small">
- <el-option
- v-for="con in isDoingSelectList"
- :key="con.type"
- :label="con.label"
- :value="con.type"
- ></el-option>
- </el-select>
- </div>
- <div class="project2Left" v-if="item.selectValue !== 'subject' && item.selectValue">
- <div class="project2LeftName">
- <span>是否必填</span>
- </div>
- <el-checkbox v-model="item.isReq">必填</el-checkbox>
- </div>
- <div
- class="project2Left"
- v-if="item.selectValue === 'input' || item.selectValue === 'textarea'"
- >
- <div class="project2LeftName">
- <span>默认值</span>
- </div>
- <el-input placeholder v-model="item.inputDefaultValue" size="small"></el-input>
- </div>
- <div
- class="project2Left"
- v-if="item.selectValue === 'input' || item.selectValue === 'textarea' || item.selectValue === 'fill'"
- >
- <div class="project2LeftName">
- <span>提示语</span>
- </div>
- <el-input placeholder v-model="item.inputPlaceholderValue" size="small"></el-input>
- </div>
- <div class="project2Left" v-if="item.selectValue === 'input'">
- <div class="project2LeftName">
- <span>单位</span>
- </div>
- <el-input placeholder v-model="item.depart" size="small"></el-input>
- </div>
- <div v-if="item.selectValue === 'radio'">
- <div
- class="project2Left"
- style="flex-direction: column;"
- v-for="(con,ind) in item.radioList"
- :key="ind"
- >
- <div style="display: flex;">
- <div class="project2LeftName">
- <span style="color: #f00">*</span>
- <span>备选项</span>
- </div>
- <el-input placeholder v-model="item.radioList[ind].label" size="small"></el-input>
- <el-radio
- @input="()=>radioDefaultSelect(ind, index)"
- v-model="item.radioList[ind].radioDefault"
- label="1"
- >默认</el-radio>
- <span class="radioAdd" @click="()=>radioAdd(ind, index)">添加</span>
- <span
- class="radioDelete"
- @click="()=>item.radioList.length!==1 && radioDelete(ind, index)"
- :class="item.radioList.length===1 ? 'disabled' : ''"
- >删除</span>
- <span class="radioAddChild" @click="()=>radioAddChild(ind, index)">添加子备选项</span>
- </div>
- <div class="childBei" v-for="(conn,indd) in con.child" :key="indd">
- <div style="display: flex;">
- <div class="project2LeftName">
- <span style="color: #f00">*</span>
- <span>子备选项</span>
- </div>
- <div>
- <span class="radioAdd" @click="()=>radioAdd(ind, index, indd)">添加</span>
- <span class="radioDelete" @click="()=>radioDelete(ind, index, indd)">删除</span>
- </div>
- </div>
- <div class="project2LeftCon">
- <div class="project2Left">
- <div class="project2LeftName">
- <span style="color: #f00">*</span>
- <span>子项目名称</span>
- </div>
- <el-input placeholder v-model="con.child[indd].inputValue" size="small"></el-input>
- </div>
- <div class="project2Left">
- <div class="project2LeftName">
- <span style="color: #f00">*</span>
- <span>子备选项形式</span>
- </div>
- <el-select
- placeholder="请选择"
- v-model="con.child[indd].selectValue"
- size="small"
- >
- <el-option
- v-for="con in isDoingSelectList.slice(1, 5)"
- :key="con.type"
- :label="con.label"
- :value="con.type"
- ></el-option>
- </el-select>
- </div>
- <div
- class="project2Left"
- v-if="conn.selectValue !== 'subject' && conn.selectValue"
- >
- <div class="project2LeftName">
- <span>是否必填</span>
- </div>
- <el-checkbox v-model="conn.isReq">必填</el-checkbox>
- </div>
- <div
- class="project2Left"
- v-if="conn.selectValue === 'input' || conn.selectValue === 'textarea'"
- >
- <div class="project2LeftName">
- <span>默认值</span>
- </div>
- <el-input placeholder v-model="conn.inputDefaultValue" size="small"></el-input>
- </div>
- <div
- class="project2Left"
- v-if="conn.selectValue === 'input' || conn.selectValue === 'textarea'"
- >
- <div class="project2LeftName">
- <span>提示语</span>
- </div>
- <el-input placeholder v-model="conn.inputPlaceholderValue" size="small"></el-input>
- </div>
- <div class="project2Left" v-if="conn.selectValue === 'input'">
- <div class="project2LeftName">
- <span>单位</span>
- </div>
- <el-input placeholder v-model="conn.depart" size="small"></el-input>
- </div>
- <div v-if="conn.selectValue === 'radio'">
- <div
- class="project2Left"
- style="flex-direction: column;"
- v-for="(connn,inddd) in conn.radioList"
- :key="inddd"
- >
- <div style="display: flex;">
- <div class="project2LeftName">
- <span style="color: #f00">*</span>
- <span>备选项</span>
- </div>
- <el-input placeholder v-model="conn.radioList[inddd].label" size="small"></el-input>
- <el-radio
- @input="()=>radioDefaultSelect(ind, index, indd, inddd)"
- v-model="conn.radioList[inddd].radioDefault"
- label="1"
- >默认</el-radio>
- <span
- class="radioAdd"
- @click="()=>radioAdd(ind, index, indd, conn.selectValue, inddd)"
- >添加</span>
- <span
- class="radioDelete"
- @click="()=>conn.radioList.length!==1 && radioDelete(ind, index, indd, inddd)"
- :class="conn.radioList.length===1 ? 'disabled' : ''"
- >删除</span>
- </div>
- </div>
- </div>
- <div v-if="conn.selectValue === 'checkbox'">
- <div
- class="project2Left"
- style="flex-direction: column;"
- v-for="(connn,inddd) in conn.radioList"
- :key="inddd"
- >
- <div style="display: flex;">
- <div class="project2LeftName">
- <span style="color: #f00">*</span>
- <span>备选项</span>
- </div>
- <el-input placeholder v-model="conn.radioList[inddd].label" size="small"></el-input>
- <el-checkbox
- @change="()=>changeCheckbox(ind, index, indd, 'checkbox', inddd)"
- v-model="conn.radioList[inddd].radioDefault"
- >默认</el-checkbox>
- <el-checkbox
- @change="()=>changeCheckboxOther(item.radioList[ind].radioDefault, ind, index, indd, inddd)"
- v-model="conn.radioList[inddd].radioDefaultOther"
- >与其他项互斥</el-checkbox>
- <span
- class="radioAdd"
- @click="()=>radioAdd(ind, index, indd, 'checkbox', inddd)"
- >添加</span>
- <span
- class="radioDelete"
- @click="()=>conn.radioList.length!==1 && radioDelete(ind, index, indd, inddd)"
- :class="conn.radioList.length===1 ? 'disabled' : ''"
- >删除</span>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div v-if="item.selectValue === 'checkbox'">
- <div
- class="project2Left"
- style="flex-direction: column;"
- v-for="(con,ind) in item.radioList"
- :key="ind"
- >
- <div class="bei">
- <div class="project2LeftName">
- <span style="color: #f00">*</span>
- <span>备选项</span>
- </div>
- <el-input placeholder v-model="item.radioList[ind].label" size="small"></el-input>
- <el-checkbox
- @change="()=>changeCheckbox(ind, index)"
- v-model="item.radioList[ind].radioDefault"
- >默认</el-checkbox>
- <el-checkbox
- @change="()=>changeCheckboxOther(item.radioList[ind].radioDefault, ind, index)"
- v-model="item.radioList[ind].radioDefaultOther"
- >与其他项互斥</el-checkbox>
- <span class="radioAdd" @click="()=>radioAdd(ind, index, null, 'checkbox')">添加</span>
- <span
- class="radioDelete"
- @click="()=>item.radioList.length!==1 && radioDelete(ind, index)"
- :class="item.radioList.length===1 ? 'disabled' : ''"
- >删除</span>
- <span class="radioAddChild" @click="()=>radioAddChild(ind, index)">添加子备选项</span>
- </div>
- <div class="childBei" v-for="(conn,indd) in con.child" :key="indd">
- <div style="display: flex;">
- <div class="project2LeftName">
- <span style="color: #f00">*</span>
- <span>子备选项</span>
- </div>
- <div>
- <span class="radioAdd" @click="()=>radioAdd(ind, index, indd)">添加</span>
- <span class="radioDelete" @click="()=>radioDelete(ind, index, indd)">删除</span>
- </div>
- </div>
- <div class="project2LeftCon">
- <div class="project2Left">
- <div class="project2LeftName">
- <span style="color: #f00">*</span>
- <span>子项目名称</span>
- </div>
- <el-input placeholder v-model="con.child[indd].inputValue" size="small"></el-input>
- </div>
- <div class="project2Left">
- <div class="project2LeftName">
- <span style="color: #f00">*</span>
- <span>子备选项形式</span>
- </div>
- <el-select
- placeholder="请选择"
- v-model="con.child[indd].selectValue"
- size="small"
- >
- <el-option
- v-for="con in isDoingSelectList.slice(1, 5)"
- :key="con.type"
- :label="con.label"
- :value="con.type"
- ></el-option>
- </el-select>
- </div>
- <div
- class="project2Left"
- v-if="conn.selectValue !== 'subject' && conn.selectValue"
- >
- <div class="project2LeftName">
- <span>是否必填</span>
- </div>
- <el-checkbox v-model="conn.isReq">必填</el-checkbox>
- </div>
- <div
- class="project2Left"
- v-if="conn.selectValue === 'input' || conn.selectValue === 'textarea'"
- >
- <div class="project2LeftName">
- <span>默认值</span>
- </div>
- <el-input placeholder v-model="conn.inputDefaultValue" size="small"></el-input>
- </div>
- <div
- class="project2Left"
- v-if="conn.selectValue === 'input' || conn.selectValue === 'textarea'"
- >
- <div class="project2LeftName">
- <span>提示语</span>
- </div>
- <el-input placeholder v-model="conn.inputPlaceholderValue" size="small"></el-input>
- </div>
- <div class="project2Left" v-if="conn.selectValue === 'input'">
- <div class="project2LeftName">
- <span>单位</span>
- </div>
- <el-input placeholder v-model="conn.depart" size="small"></el-input>
- </div>
- <div v-if="conn.selectValue === 'radio'">
- <div
- class="project2Left"
- style="flex-direction: column;"
- v-for="(connn,inddd) in conn.radioList"
- :key="inddd"
- >
- <div style="display: flex;">
- <div class="project2LeftName">
- <span style="color: #f00">*</span>
- <span>备选项</span>
- </div>
- <el-input placeholder v-model="conn.radioList[inddd].label" size="small"></el-input>
- <el-radio
- @input="()=>radioDefaultSelect(ind, index, indd, inddd)"
- v-model="conn.radioList[inddd].radioDefault"
- label="1"
- >默认</el-radio>
- <span
- class="radioAdd"
- @click="()=>radioAdd(ind, index, indd, conn.selectValue, inddd)"
- >添加</span>
- <span
- class="radioDelete"
- @click="()=>conn.radioList.length!==1 && radioDelete(ind, index, indd, inddd)"
- :class="conn.radioList.length===1 ? 'disabled' : ''"
- >删除</span>
- </div>
- </div>
- </div>
- <div v-if="conn.selectValue === 'checkbox'">
- <div
- class="project2Left"
- style="flex-direction: column;"
- v-for="(connn,inddd) in conn.radioList"
- :key="inddd"
- >
- <div style="display: flex;">
- <div class="project2LeftName">
- <span style="color: #f00">*</span>
- <span>备选项</span>
- </div>
- <el-input placeholder v-model="conn.radioList[inddd].label" size="small"></el-input>
- <el-checkbox
- @change="()=>changeCheckbox(ind, index, indd, 'checkbox', inddd)"
- v-model="conn.radioList[inddd].radioDefault"
- >默认</el-checkbox>
- <el-checkbox
- @change="()=>changeCheckboxOther(item.radioList[ind].radioDefault, ind, index, indd, inddd)"
- v-model="conn.radioList[inddd].radioDefaultOther"
- >与其他项互斥</el-checkbox>
- <span
- class="radioAdd"
- @click="()=>radioAdd(ind, index, indd, 'checkbox', inddd)"
- >添加</span>
- <span
- class="radioDelete"
- @click="()=>conn.radioList.length!==1 && radioDelete(ind, index, indd, inddd)"
- :class="conn.radioList.length===1 ? 'disabled' : ''"
- >删除</span>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div v-if="item.selectValue === 'fill'">
- <div
- class="project2Left"
- style="flex-direction: column;"
- v-for="(con,ind) in item.radioList"
- :key="ind"
- >
- <div class="bei">
- <div class="project2LeftName">
- <span style="color: #f00">*</span>
- <span>备选项</span>
- </div>
- <el-input placeholder v-model="item.radioList[ind].label" size="small"></el-input>
- <el-checkbox
- @change="()=>changeCheckbox(ind, index)"
- v-model="item.radioList[ind].radioDefault"
- >默认</el-checkbox>
- <el-checkbox
- @change="()=>changeCheckboxOther(item.radioList[ind].radioDefault, ind, index)"
- v-model="item.radioList[ind].radioDefaultOther"
- >与其他项互斥</el-checkbox>
- <span class="radioAdd" @click="()=>radioAdd(ind, index, null, 'checkbox')">添加</span>
- <span
- class="radioDelete"
- @click="()=>item.radioList.length!==1 && radioDelete(ind, index)"
- :class="item.radioList.length===1 ? 'disabled' : ''"
- >删除</span>
- </div>
- </div>
- </div>
- </div>
- <div class="project3" v-if="!item.isDoing">
- <div class="project3Left" v-if="item.selectValue === isDoingSelectList[0].type">
- <span class="project3LeftName">
- <span style="color: #f00" v-if="item.isReq && item.level === 1">*</span>
- {{item.inputValue}}
- </span>
- </div>
- <div class="project3Left" v-if="item.selectValue === isDoingSelectList[1].type">
- <span class="project3LeftName">
- <span style="color: #f00" v-if="item.isReq && item.level === 1">*</span>
- {{item.inputValue}}
- </span>
- <div class="project3LeftDes">
- <el-input
- :placeholder="item.inputPlaceholderValue"
- v-model="item.inputDefaultValue"
- size="small"
- ></el-input>
- <span class="project3LeftDepart">{{item.depart}}</span>
- </div>
- </div>
- <div class="project3Left" v-if="item.selectValue === isDoingSelectList[2].type">
- <span class="project3LeftName">
- <span style="color: #f00" v-if="item.isReq && item.level === 1">*</span>
- {{item.inputValue}}
- </span>
- <el-input
- :placeholder="item.inputPlaceholderValue"
- v-model="item.inputDefaultValue"
- type="textarea"
- :rows="2"
- size="small"
- ></el-input>
- </div>
- <div class="project3Left" v-if="item.selectValue === isDoingSelectList[3].type">
- <span class="project3LeftName">
- <span style="color: #f00" v-if="item.isReq && item.level === 1">*</span>
- {{item.inputValue}}
- </span>
- <div class="radioChild">
- <el-radio-group
- v-model="item.radioListValue"
- @input="()=>onChangeRadioListValue(ind, index)"
- >
- <el-radio
- v-for="(con,ind) in item.radioList"
- :key="ind"
- :label="con.label"
- >{{con.label}}</el-radio>
- </el-radio-group>
- <div v-for="(con,ind) in item.radioList.filter(con=>con.radioDefault)" :key="ind">
- <div v-for="(conn,indd) in con.child" :key="indd">
- <div class="project3Left" v-if="conn.selectValue === isDoingSelectList[1].type">
- <span class="project3LeftName">{{conn.inputValue}}</span>
- <div class="project3LeftDes">
- <el-input
- :placeholder="conn.inputPlaceholderValue"
- v-model="conn.inputDefaultValue"
- size="small"
- ></el-input>
- <span class="project3LeftDepart">{{conn.depart}}</span>
- </div>
- </div>
- <div class="project3Left" v-if="conn.selectValue === isDoingSelectList[2].type">
- <span class="project3LeftName">{{conn.inputValue}}</span>
- <div class="project3LeftDes">
- <el-input
- :placeholder="conn.inputPlaceholderValue"
- v-model="conn.inputDefaultValue"
- type="textarea"
- :rows="2"
- size="small"
- ></el-input>
- </div>
- </div>
- <div class="project3Left" v-if="conn.selectValue === isDoingSelectList[3].type">
- <span class="project3LeftName">{{conn.inputValue}}</span>
- <div>
- <el-radio-group
- v-model="conn.radioListValue"
- @input="()=>onChangeRadioListValue(ind, index, indd)"
- >
- <el-radio
- v-for="(connn,inddd) in conn.radioList"
- :key="inddd"
- :label="connn.label"
- >{{connn.label}}</el-radio>
- </el-radio-group>
- </div>
- </div>
- <div class="project3Left" v-if="conn.selectValue === isDoingSelectList[4].type">
- <span class="project3LeftName">{{conn.inputValue}}</span>
- <div>
- <el-checkbox
- v-for="(connn,inddd) in conn.radioList"
- v-model="conn.radioList[inddd].radioDefault"
- :label="connn.label"
- @change="()=>changeCheckbox(ind, index, indd, 'checkbox', inddd)"
- :key="inddd"
- >{{connn.label}}</el-checkbox>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="project3Left" v-if="item.selectValue === isDoingSelectList[4].type">
- <span class="project3LeftName">
- <span style="color: #f00" v-if="item.isReq && item.level === 1">*</span>
- {{item.inputValue}}
- </span>
- <div class="radioChild">
- <el-checkbox
- v-for="(con,ind) in item.radioList"
- v-model="item.radioList[ind].radioDefault"
- @change="()=>changeCheckbox(ind, index)"
- :key="ind"
- >{{con.label}}</el-checkbox>
- <div v-for="(con,ind) in item.radioList.filter(con=>con.radioDefault)" :key="ind">
- <div v-for="(conn,indd) in con.child" :key="indd">
- <div class="project3Left" v-if="conn.selectValue === isDoingSelectList[1].type">
- <span class="project3LeftName">{{conn.inputValue}}</span>
- <div class="project3LeftDes">
- <el-input
- :placeholder="conn.inputPlaceholderValue"
- v-model="conn.inputDefaultValue"
- size="small"
- ></el-input>
- <span class="project3LeftDepart">{{conn.depart}}</span>
- </div>
- </div>
- <div class="project3Left" v-if="conn.selectValue === isDoingSelectList[2].type">
- <span class="project3LeftName">{{conn.inputValue}}</span>
- <el-input
- :placeholder="conn.inputPlaceholderValue"
- v-model="conn.inputDefaultValue"
- type="textarea"
- :rows="2"
- size="small"
- ></el-input>
- </div>
- <div class="project3Left" v-if="conn.selectValue === isDoingSelectList[3].type">
- <span class="project3LeftName">{{conn.inputValue}}</span>
- <div>
- <el-radio-group
- v-model="conn.radioListValue"
- @input="()=>onChangeRadioListValue(ind, index, indd)"
- >
- <el-radio
- v-for="(connn,inddd) in conn.radioList"
- :key="inddd"
- :label="connn.label"
- >{{connn.label}}</el-radio>
- </el-radio-group>
- </div>
- </div>
- <div class="project3Left" v-if="conn.selectValue === isDoingSelectList[4].type">
- <span class="project3LeftName">{{conn.inputValue}}</span>
- <div>
- <el-checkbox
- v-for="(connn,inddd) in conn.radioList"
- :key="inddd"
- v-model="conn.radioList[inddd].radioDefault"
- :label="connn.label"
- @change="()=>changeCheckbox(ind, index, indd, 'checkbox', inddd)"
- >{{connn.label}}</el-checkbox>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="project3Left" v-if="item.selectValue === isDoingSelectList[5].type">
- <span class="project3LeftName">
- <span style="color: #f00" v-if="item.isReq && item.level === 1">*</span>
- {{item.inputValue}}
- </span>
- <div style="flex-grow: 1">
- <div>
- <el-checkbox
- v-for="(con,ind) in item.radioList"
- :key="ind"
- v-model="item.radioList[ind].radioDefault"
- @change="()=>changeCheckbox(ind, index, null, item)"
- >{{con.label}}</el-checkbox>
- </div>
- <el-select
- v-model="item.fillValues"
- multiple
- :placeholder="item.inputPlaceholderValue"
- size="small"
- popper-class="hiddenPopup"
- @remove-tag="()=>removeTag(index, item)"
- @change="()=>changeTagValue(index,item)"
- allow-create
- filterable
- default-first-option
- >
- <el-option
- v-for="ele in item.radioList"
- :key="ele.label"
- :label="ele.label"
- :value="ele.label"
- ></el-option>
- </el-select>
- </div>
- </div>
- <div class="project3Left" v-if="item.selectValue === 'upload'">
- <span class="project3LeftName">{{item.label}}</span>
- <div class="imgs">
- <div v-for="(con,ind) in imageUrl" :key="ind" class="imgsLi">
- <el-image
- :preview-src-list="imageUrl"
- style="width:100px;height:100px"
- :src="con"
- class="avatar"
- />
- <i class="el-icon-error" @click="()=>deleteImgList(ind)"></i>
- </div>
- <el-upload
- v-if="item.selectValue === 'upload'"
- class="avatar-uploader"
- action="https://jsonplaceholder.typicode.com/posts/"
- :show-file-list="false"
- :on-success="handleAvatarSuccess"
- :before-upload="beforeAvatarUpload"
- >
- <i class="el-icon-plus avatar-uploader-icon"></i>
- <div class="el-upload__tip" slot="tip">支持上传jpg/png/jpeg格式文件</div>
- </el-upload>
- </div>
- </div>
- </div>
- </div>
- <div class="action">
- <el-dropdown
- @command="(v) => add(v, index, item)"
- v-if="!item.isDoing && item.selectValue !== 'upload'"
- trigger="click"
- >
- <span class="add">新建</span>
- <el-dropdown-menu slot="dropdown">
- <el-dropdown-item command="inner">新增下一级项目</el-dropdown-item>
- <el-dropdown-item command="before" v-if="item.level !== 1">在该项目前新增同级项目</el-dropdown-item>
- <el-dropdown-item command="after" v-if="item.level !== 1">在该项目后新增同级项目</el-dropdown-item>
- </el-dropdown-menu>
- </el-dropdown>
- <span v-if="!item.isDoing && item.selectValue !== 'upload'" @click="()=>edit(index)">编辑</span>
- <span
- v-if="!item.isDoing && item.selectValue !== 'upload'"
- @click="()=>item.level !== 1 && deleteLine(index)"
- :class="item.level === 1 ? 'disabled' : ''"
- >删除</span>
- <span
- v-if="item.isDoing && item.selectValue !== 'upload'"
- @click="()=>save(item, index)"
- >保存</span>
- <span
- v-if="item.isDoing && item.selectValue !== 'upload'"
- @click="()=>cancel(index, item)"
- >取消</span>
- </div>
- </li>
- </ul>
- <el-dialog
- top="5vh"
- title="病历模版"
- :visible.sync="dialogVisible"
- width="1000px"
- :before-close="handleClose"
- >
- <div class="priview-body">
- <PriviewEdit :editListF="editList"></PriviewEdit>
- </div>
- </el-dialog>
- <el-dialog title="预览提示" :visible.sync="dialogVisibleConfirm" width="30%">
- <span>当前有未保存数据,是否继续预览,预览后未保存数据将清空</span>
- <span slot="footer" class="dialog-footer">
- <el-button @click="dialogVisibleConfirm = false">取 消</el-button>
- <el-button type="primary" @click="onChangeDialogVisibleConfirm">继 续</el-button>
- </span>
- </el-dialog>
- <!-- <div class="btns">
- <el-button type="primary" @click="saveAll" size="small">提交</el-button>
- <el-button type="primary" @click="seeAll" size="small">预览</el-button>
- </div>-->
- </div>
- </template>
- <script>
- import pageHeader from "@/components/Header.vue";
- import PriviewEdit from "./PriviewEdit.vue";
- import { fileUpload } from "@/api/upload.js";
- import { Message, Popover, Dropdown } from "element-ui";
- export default {
- components: {
- pageHeader,
- Message,
- Popover,
- Dropdown,
- PriviewEdit
- },
- created() {
- // this.getUserInfo()
- },
- data() {
- return {
- editList: [
- {
- label: "主诉",
- isReq: true,
- type: "textarea",
- level: 1,
- id: "1",
- child: [],
- selectValue: "textarea",
- inputValue: "主诉",
- inputDefaultValue: "",
- inputPlaceholderValue: "",
- radioList: [
- {
- label: "",
- radioDefault: false,
- child: []
- }
- ],
- radioListValue: "",
- fillValues: []
- },
- {
- label: "现病史",
- isReq: false,
- type: "textarea",
- level: 1,
- id: "2",
- child: [],
- selectValue: "textarea",
- inputValue: "现病史",
- inputDefaultValue: "",
- inputPlaceholderValue: "",
- radioList: [
- {
- label: "",
- radioDefault: false,
- child: []
- }
- ],
- radioListValue: "",
- fillValues: []
- },
- {
- label: "既往史",
- isReq: false,
- type: "textarea",
- level: 1,
- id: "3",
- child: [],
- selectValue: "textarea",
- inputValue: "既往史",
- inputDefaultValue: "",
- inputPlaceholderValue: "",
- radioList: [
- {
- label: "",
- radioDefault: false,
- child: []
- }
- ],
- radioListValue: "",
- fillValues: []
- },
- {
- label: "中医四诊",
- isReq: false,
- type: "textarea",
- level: 1,
- id: "4",
- child: [],
- selectValue: "textarea",
- inputValue: "中医四诊",
- inputDefaultValue: "",
- inputPlaceholderValue: "",
- radioList: [
- {
- label: "",
- radioDefault: false,
- child: []
- }
- ],
- radioListValue: "",
- fillValues: []
- },
- {
- label: "体格检查",
- isReq: false,
- type: "textarea",
- level: 1,
- id: "5",
- child: [],
- selectValue: "textarea",
- inputValue: "体格检查",
- inputDefaultValue: "",
- inputPlaceholderValue: "",
- radioList: [
- {
- label: "",
- radioDefault: false,
- child: []
- }
- ],
- radioListValue: "",
- fillValues: []
- },
- {
- label: "辅助检查",
- isReq: false,
- type: "textarea",
- level: 1,
- id: "6",
- child: [],
- selectValue: "textarea",
- inputValue: "辅助检查",
- inputDefaultValue: "",
- inputPlaceholderValue: "",
- radioList: [
- {
- label: "",
- radioDefault: false,
- child: []
- }
- ],
- radioListValue: "",
- fillValues: []
- },
- {
- label: "报告上传",
- isReq: false,
- type: "upload",
- level: 1,
- id: "7",
- child: [],
- selectValue: "upload",
- inputValue: "",
- inputDefaultValue: "",
- inputPlaceholderValue: "",
- radioList: [
- {
- label: "",
- radioDefault: false,
- child: []
- }
- ],
- radioListValue: "",
- fillValues: []
- }
- ],
- // 模板
- editListInit: [
- {
- label: "主诉",
- isReq: true,
- type: "textarea",
- level: 1,
- id: "1",
- child: [],
- selectValue: "textarea",
- inputValue: "主诉",
- inputDefaultValue: "",
- inputPlaceholderValue: "",
- radioList: [
- {
- label: "",
- radioDefault: false,
- child: []
- }
- ],
- radioListValue: "",
- fillValues: []
- },
- {
- label: "现病史",
- isReq: false,
- type: "textarea",
- level: 1,
- id: "2",
- child: [],
- selectValue: "textarea",
- inputValue: "现病史",
- inputDefaultValue: "",
- inputPlaceholderValue: "",
- radioList: [
- {
- label: "",
- radioDefault: false,
- child: []
- }
- ],
- radioListValue: "",
- fillValues: []
- },
- {
- label: "既往史",
- isReq: false,
- type: "textarea",
- level: 1,
- id: "3",
- child: [],
- selectValue: "textarea",
- inputValue: "既往史",
- inputDefaultValue: "",
- inputPlaceholderValue: "",
- radioList: [
- {
- label: "",
- radioDefault: false,
- child: []
- }
- ],
- radioListValue: "",
- fillValues: []
- },
- {
- label: "中医四诊",
- isReq: false,
- type: "textarea",
- level: 1,
- id: "4",
- child: [],
- selectValue: "textarea",
- inputValue: "中医四诊",
- inputDefaultValue: "",
- inputPlaceholderValue: "",
- radioList: [
- {
- label: "",
- radioDefault: false,
- child: []
- }
- ],
- radioListValue: "",
- fillValues: []
- },
- {
- label: "体格检查",
- isReq: false,
- type: "textarea",
- level: 1,
- id: "5",
- child: [],
- selectValue: "textarea",
- inputValue: "体格检查",
- inputDefaultValue: "",
- inputPlaceholderValue: "",
- radioList: [
- {
- label: "",
- radioDefault: false,
- child: []
- }
- ],
- radioListValue: "",
- fillValues: []
- },
- {
- label: "辅助检查",
- isReq: false,
- type: "textarea",
- level: 1,
- id: "6",
- child: [],
- selectValue: "textarea",
- inputValue: "辅助检查",
- inputDefaultValue: "",
- inputPlaceholderValue: "",
- radioList: [
- {
- label: "",
- radioDefault: false,
- child: []
- }
- ],
- radioListValue: "",
- fillValues: []
- },
- {
- label: "报告上传",
- isReq: false,
- type: "upload",
- level: 1,
- id: "7",
- child: [],
- selectValue: "upload",
- inputValue: "",
- inputDefaultValue: "",
- inputPlaceholderValue: "",
- radioList: [
- {
- label: "",
- radioDefault: false,
- child: []
- }
- ],
- radioListValue: "",
- fillValues: []
- }
- ],
- isDoingSelectList: [
- {
- label: "标题",
- type: "subject"
- },
- {
- label: "单行文本",
- type: "input"
- },
- {
- label: "多行文本",
- type: "textarea"
- },
- {
- label: "单选",
- type: "radio"
- },
- {
- label: "多选",
- type: "checkbox"
- },
- {
- label: "选项填入输入框",
- type: "fill"
- }
- ],
- commonParams: {
- inputValue: "",
- selectValue: "",
- radioList: [
- {
- label: "",
- radioDefault: false,
- child: []
- }
- ],
- radioListValue: "",
- fillValues: []
- },
- dialogVisible: false,
- dialogVisibleConfirm: false,
- imageUrl: []
- };
- },
- methods: {
- async fileUpload(data) {
- let res = await fileUpload(data);
- if (res.ResultCode == 0) {
- this.$message({
- type: "success",
- message: "上传成功",
- showClose: true
- });
- this.imageUrl.push(
- process.env.VUE_APP_UPLOAD + "file/" + res.ResultInfo
- );
- }
- },
- handleAvatarSuccess(res, file) {
- this.imageUrl = URL.createObjectURL(file.raw);
- },
- beforeAvatarUpload(file) {
- console.log(file, "file文件");
- if (
- file.type === "image/jpg" ||
- file.type === "image/png" ||
- file.type === "image/jpeg"
- ) {
- let formData = new FormData();
- formData.append("file", file);
- this.fileUpload(formData);
- } else {
- this.$message.error("文件类型有误");
- }
- return false;
- },
- deleteImgList(ind) {
- this.imageUrl.splice(ind, 1);
- },
- add(type, index, item) {
- const arr = {
- inputValue: "",
- selectValue: "",
- radioList: [
- {
- label: "",
- radioDefault: false,
- child: []
- }
- ],
- radioListValue: "",
- fillValues: []
- };
- const { id, level, father, countId } = item;
- const callback = v => {
- let count = 0;
- let countTemplate = 0;
- this.editList.forEach(ele => {
- if (ele.father === v) {
- count += 1;
- ele.id = `${v}-${count}`;
- ele.countId = count;
- }
- });
- this.editListInit.forEach(ele => {
- if (ele.father === v) {
- countTemplate += 1;
- ele.id = `${v}-${countTemplate}`;
- ele.countId = countTemplate;
- }
- });
- };
- if (type === "inner") {
- this.editList.splice(index + 1, 0, {
- isDoing: true,
- level: level + 1,
- father: id,
- id: `${id}-1`,
- countId: 1,
- ...arr
- });
- this.editListInit.splice(index + 1, 0, {
- isDoing: true,
- level: level + 1,
- father: id,
- id: `${id}-1`,
- countId: 1,
- ...arr
- });
- callback(id);
- } else if (type === "before") {
- this.editList.splice(index, 0, {
- isDoing: true,
- level: level,
- father,
- id: `${father}-${countId}`,
- countId,
- ...arr
- });
- this.editListInit.splice(index, 0, {
- isDoing: true,
- level: level,
- father,
- id: `${father}-${countId}`,
- countId,
- ...arr
- });
- callback(father);
- } else {
- this.editList.splice(index + 1, 0, {
- isDoing: true,
- level: level,
- father,
- id: `${father}-${countId + 1}`,
- countId: countId + 1,
- ...arr
- });
- this.editListInit.splice(index + 1, 0, {
- isDoing: true,
- level: level,
- father,
- id: `${father}-${countId + 1}`,
- countId: countId + 1,
- ...arr
- });
- callback(father);
- }
- },
- getInitFrom(index, arr) {
- // 从表象获取模版
- const arrNew = [...this.editListInit];
- arrNew.forEach((ele, ind) => {
- if (ind === index) {
- // ele = this.editList[index]
- ele.fillValues = arr[index].fillValues || [];
- ele.inputDefaultValue = arr[index].inputDefaultValue;
- ele.inputPlaceholderValue = arr[index].inputPlaceholderValue;
- ele.inputValue = arr[index].inputValue;
- ele.radioList = JSON.parse(
- JSON.stringify(arr[index].radioList || [])
- );
- ele.radioListValue = arr[index].radioListValue || "";
- ele.isReq = arr[index].isReq;
- ele.selectValue = arr[index].selectValue;
- ele.isEditing = arr[index].isEditing;
- ele.isDoing = arr[index].isDoing;
- }
- });
- this.editListInit = arrNew;
- },
- getFromInit(index, arr) {
- // 从模版获取表象
- const arrNew = [...this.editList];
- arrNew.forEach((ele, ind) => {
- if (ind === index) {
- ele.fillValues = arr[index].fillValues || [];
- ele.inputDefaultValue = arr[index].inputDefaultValue;
- ele.inputPlaceholderValue = arr[index].inputPlaceholderValue;
- ele.inputValue = arr[index].inputValue;
- ele.radioList = JSON.parse(
- JSON.stringify(arr[index].radioList || [])
- );
- ele.radioListValue = arr[index].radioListValue || "";
- ele.isReq = arr[index].isReq;
- ele.selectValue = arr[index].selectValue;
- ele.isEditing = true;
- ele.isDoing = true;
- }
- });
- this.editList = arrNew;
- },
- save(v, index) {
- if (!v.inputValue || v.inputValue.trim() === "") {
- this.$message.error("项目名称不能为空");
- return;
- } else if (!v.selectValue || v.selectValue.trim() === "") {
- this.$message.error("备选项形式不能为空");
- return;
- } else if (
- v.selectValue === "radio" ||
- v.selectValue === "checkbox" ||
- v.selectValue === "fill"
- ) {
- let flag = false;
- let flagChild = false;
- v.radioList.forEach(ele => {
- if (ele.label.trim() === "") {
- flag = true;
- }
- if (ele.child) {
- ele.child.forEach(con => {
- if (
- !con.inputValue ||
- con.inputValue.trim() === "" ||
- !con.selectValue ||
- con.selectValue.trim() === ""
- ) {
- flagChild = true;
- }
- if (
- con.selectValue === "radio" ||
- con.selectValue === "checkbox"
- ) {
- con.radioList.forEach(conn => {
- if (conn.label.trim() === "") {
- flagChild = true;
- }
- });
- }
- });
- }
- });
- if (flag) {
- this.$message.error("备选项不能为空");
- return;
- }
- if (flagChild) {
- this.$message.error("子备选项不能为空");
- return;
- }
- }
- const arr = JSON.parse(JSON.stringify([...this.editList]));
- arr.forEach(ele => {
- if (ele.id === v.id) {
- ele.isDoing = false;
- ele.isEditing = false;
- if (v.selectValue === "radio") {
- ele.radioListValue =
- ele.radioList.filter(con => con.radioDefault === "1").length > 0
- ? ele.radioList.filter(con => con.radioDefault === "1")[0].label
- : "";
- ele.radioList.forEach(con => {
- if (con.child && con.child.length > 0) {
- con.child.forEach(conn => {
- if (conn.selectValue === "radio") {
- conn.radioListValue =
- conn.radioList.filter(con => con.radioDefault === "1")
- .length > 0
- ? conn.radioList.filter(
- con => con.radioDefault === "1"
- )[0].label
- : "";
- }
- });
- }
- });
- }
- if (v.selectValue === "checkbox") {
- ele.radioList.forEach(con => {
- if (con.child && con.child.length > 0) {
- con.child.forEach(conn => {
- if (conn.selectValue === "radio") {
- conn.radioListValue =
- conn.radioList.filter(con => con.radioDefault === "1")
- .length > 0
- ? conn.radioList.filter(
- con => con.radioDefault === "1"
- )[0].label
- : "";
- }
- });
- }
- });
- }
- if (v.selectValue === "fill") {
- ele.fillValues = ele.radioList
- .filter(ele => ele.radioDefault)
- .map(ele => ele.label);
- }
- }
- });
- // 赋值模板
- this.getInitFrom(index, arr);
- this.editList = arr;
- },
- cancel(index, item) {
- if (item.isEditing) {
- const arr = JSON.parse(JSON.stringify([...this.editListInit]));
- const arrOld = JSON.parse(JSON.stringify([...this.editList]));
- arrOld.forEach((ele, ind) => {
- if (ind === index) {
- ele.fillValues = arr[index].fillValues || [];
- ele.inputDefaultValue = arr[index].inputDefaultValue;
- ele.inputPlaceholderValue = arr[index].inputPlaceholderValue;
- ele.inputValue = arr[index].inputValue;
- ele.radioList = JSON.parse(
- JSON.stringify(arr[index].radioList || [])
- );
- ele.radioListValue = arr[index].radioListValue || "";
- ele.isReq = arr[index].isReq;
- ele.selectValue = arr[index].selectValue;
- ele.isEditing = false;
- ele.isDoing = false;
- }
- });
- this.editList = [...arrOld];
- } else {
- this.editList.splice(index, 1);
- this.editListInit.splice(index, 1);
- }
- },
- deleteLine(index) {
- this.editList.splice(index, 1);
- this.editListInit.splice(index, 1);
- },
- edit(index) {
- // 赋值表面模板
- const arr = JSON.parse(JSON.stringify([...this.editListInit]));
- this.getFromInit(index, arr);
- },
- onChangeDownTemplate(index, end, endMore) {
- const deleteList = this.editListInit.filter((ele, ind) =>
- endMore === 0 ? ind >= end : ind >= end && ind < endMore
- ); // 需要前置的项
- const arr = [];
- this.editListInit.forEach((ele, ind) => {
- if (ind < end || (endMore !== 0 && ind >= endMore)) {
- arr.push(ele);
- }
- });
- arr.splice(index, 0, ...deleteList);
- this.editListInit = arr;
- },
- down(index, item) {
- let end = 0;
- this.editList.forEach((ele, ind) => {
- if (
- ind > index &&
- ele.level === item.level &&
- end === 0 &&
- ele.father === item.father
- ) {
- end = ind;
- }
- });
- let endMore = 0;
- this.editList.forEach((ele, ind) => {
- if (
- ind > end &&
- ele.level === item.level &&
- endMore === 0 &&
- ele.father === item.father
- ) {
- endMore = ind;
- }
- });
- if (endMore === 0) {
- this.editList.forEach((ele, ind) => {
- if (ind > end && endMore === 0 && ele.level < item.level) {
- endMore = ind;
- }
- });
- }
- const deleteList = this.editList.filter((ele, ind) =>
- endMore === 0 ? ind >= end : ind >= end && ind < endMore
- ); // 需要前置的项
- const arr = [];
- this.editList.forEach((ele, ind) => {
- if (ind < end || (endMore !== 0 && ind >= endMore)) {
- arr.push(ele);
- }
- });
- arr.splice(index, 0, ...deleteList);
- this.editList = arr;
- this.onChangeDownTemplate(index, end, endMore);
- },
- onChangeUpTemplate(index, end, endMore) {
- const deleteList = this.editListInit.filter((ele, ind) =>
- endMore === 0 ? ind >= index : ind >= index && ind < endMore
- ); // 需要前置的项
- const arr = [];
- this.editListInit.forEach((ele, ind) => {
- if (ind < index || (endMore !== 0 && ind >= endMore)) {
- arr.push(ele);
- }
- });
- arr.splice(end, 0, ...deleteList);
- this.editListInit = arr;
- },
- up(index, item) {
- let end = 0;
- this.editList.forEach((ele, ind) => {
- if (
- ind < index &&
- ele.level === item.level &&
- ele.father === item.father
- ) {
- end = ind;
- }
- });
- let endMore = 0;
- this.editList.forEach((ele, ind) => {
- if (
- ind > index &&
- ele.level === item.level &&
- endMore === 0 &&
- ele.father === item.father
- ) {
- endMore = ind;
- }
- });
- if (endMore === 0) {
- this.editList.forEach((ele, ind) => {
- if (ind > index && endMore === 0 && ele.level < item.level) {
- endMore = ind;
- }
- });
- }
- const deleteList = this.editList.filter((ele, ind) =>
- endMore === 0 ? ind >= index : ind >= index && ind < endMore
- ); // 需要前置的项
- const arr = [];
- this.editList.forEach((ele, ind) => {
- if (ind < index || (endMore !== 0 && ind >= endMore)) {
- arr.push(ele);
- }
- });
- arr.splice(end, 0, ...deleteList);
- this.editList = arr;
- this.onChangeUpTemplate(index, end, endMore);
- },
- radioAdd(ind, index, indd, type, inddd) {
- const commonParams = {
- label: "",
- child: [],
- radioDefault: type === "checkbox" ? false : "",
- radioList: [
- {
- label: "",
- radioDefault: false,
- child: []
- }
- ],
- radioListValue: ""
- };
- if (inddd || inddd === 0) {
- this.editList.forEach((ele, indx) => {
- if (indx === index) {
- ele.radioList.forEach((con, indxx) => {
- if (indxx === ind) {
- con.child.forEach((conn, indxxx) => {
- if (indxxx === indd) {
- conn.radioList.splice(inddd + 1, 0, {
- ...commonParams
- });
- }
- });
- }
- });
- }
- });
- } else if (indd || indd === 0) {
- this.editList.forEach((ele, indx) => {
- if (indx === index) {
- ele.radioList.forEach((con, indxx) => {
- if (indxx === ind) {
- con.child.splice(indd + 1, 0, {
- ...commonParams
- });
- }
- });
- }
- });
- } else {
- this.editList.forEach((ele, indx) => {
- if (indx === index) {
- ele.radioList.splice(ind + 1, 0, {
- ...commonParams
- });
- }
- });
- }
- },
- radioAddChild(ind, index) {
- this.editList.forEach((ele, indx) => {
- if (indx === index) {
- ele.radioList.forEach((con, indd) => {
- if (indd === ind) {
- // const arr = {...this.commonParams}
- con.child.unshift({
- inputValue: "",
- selectValue: "",
- radioList: [
- {
- label: "",
- radioDefault: false,
- child: []
- }
- ],
- fillValues: []
- });
- }
- });
- }
- });
- },
- radioDelete(ind, index, indd, inddd) {
- if (inddd || inddd === 0) {
- this.editList.forEach((ele, indx) => {
- if (indx === index) {
- ele.radioList.forEach((con, indxx) => {
- if (indxx === ind) {
- con.child.forEach((conn, indxxx) => {
- if (indxxx === indd) {
- conn.radioList.splice(inddd, 1);
- }
- });
- }
- });
- }
- });
- } else if (indd || indd === 0) {
- this.editList.forEach((ele, indx) => {
- if (indx === index) {
- ele.radioList.forEach((con, indxx) => {
- if (indxx === ind) {
- con.child.splice(indd, 1);
- }
- });
- }
- });
- } else {
- this.editList.forEach((ele, indx) => {
- if (indx === index) {
- ele.radioList.splice(ind, 1);
- }
- });
- }
- },
- radioDefaultSelect(ind, index, indd, inddd) {
- if (inddd || inddd === 0) {
- this.editList.forEach((ele, indx) => {
- if (indx === index) {
- ele.radioList.forEach((con, indxx) => {
- if (indxx === ind) {
- con.child.forEach((conn, indxxx) => {
- if (indxxx === indd) {
- conn.radioList.forEach((connn, indxxxx) => {
- if (indxxxx !== inddd) {
- connn.radioDefault = "";
- }
- });
- }
- });
- }
- });
- }
- });
- } else {
- this.editList.forEach((ele, indx) => {
- if (indx === index) {
- ele.radioList.forEach((con, inde) => {
- if (inde !== ind) {
- con.radioDefault = "";
- }
- });
- }
- });
- }
- },
- changeCheckbox(ind, index, indd, item, inddd) {
- const arr = JSON.parse(JSON.stringify([...this.editList]));
- if (indd || indd === 0) {
- const flag = this.editList
- .filter((ele, indx) => indx === index)[0]
- .radioList.filter((ele, indx) => indx === ind)[0]
- .child.filter((ele, indx) => indx === indd)[0]
- .radioList.filter((ele, indxx) => indxx === inddd)[0]
- .radioDefaultOther;
- arr.forEach((ele, indx) => {
- if (indx === index) {
- ele.radioList.forEach((con, indxx) => {
- if (indxx === ind) {
- con.child.forEach((conn, indxxx) => {
- conn.radioList.forEach((connn, indxxxx) => {
- if (indxxxx !== inddd && flag) {
- connn.radioDefault = false;
- } else if (indxxxx !== inddd && !flag) {
- connn.radioDefaultOther
- ? (connn.radioDefault = false)
- : null;
- }
- });
- });
- }
- });
- }
- });
- this.editList = arr;
- } else {
- const flag = this.editList
- .filter((ele, indx) => indx === index)[0]
- .radioList.filter((ele, indx) => indx === ind)[0].radioDefaultOther;
- arr.forEach((ele, indx) => {
- if (indx === index) {
- ele.radioList.forEach((con, indxx) => {
- if (indxx !== ind && flag) {
- con.radioDefault = false;
- } else if (indxx !== ind && !flag) {
- con.radioDefaultOther ? (con.radioDefault = false) : null;
- }
- });
- }
- });
- if (item && item.selectValue === "fill") {
- arr.forEach((ele, indx) => {
- if (indx === index) {
- let labels = ele.radioList.map(elee => {
- return elee.label;
- });
- let valuesSave = JSON.parse(JSON.stringify(ele.fillValues));
- let inputArr = valuesSave.filter(ele1 => {
- return !labels.includes(ele1) ? ele1 : "";
- });
- let arr = ele.radioList
- .filter(ele => ele.radioDefault)
- .map(ele => ele.label);
- let arr1 = new Set([...arr, ...inputArr]);
- ele.fillValues = Array.from(arr1);
- }
- });
- }
- this.editList = arr;
- }
- },
- changeCheckboxOther(v, ind, index, indd, inddd) {
- if (!v) {
- return;
- }
- this.changeCheckbox(ind, index, indd, null, inddd);
- },
- onChangeRadioListValue(ind, index, indd) {
- const arr = JSON.parse(JSON.stringify([...this.editList]));
- if (indd || indd === 0) {
- const radioListValue = this.editList
- .filter((ele, indx) => indx === index)[0]
- .radioList.filter((ele, indx) => indx === ind)[0]
- .child.filter((ele, indx) => indx === indd)[0].radioListValue;
- arr.forEach((ele, indx) => {
- if (indx === index) {
- ele.radioList.forEach((con, indxx) => {
- if (indxx === ind) {
- con.child.forEach((conn, indxxx) => {
- if (indxxx === indd) {
- conn.radioList.forEach(connn => {
- if (radioListValue === connn.label) {
- connn.radioDefault = "1";
- } else {
- connn.radioDefault = "";
- }
- });
- }
- });
- }
- });
- }
- });
- this.editList = arr;
- } else {
- const radioListValue = this.editList.filter(
- (ele, indx) => indx === index
- )[0].radioListValue;
- arr.forEach((ele, indx) => {
- if (indx === index) {
- ele.radioList.forEach((con, indxx) => {
- if (radioListValue === con.label) {
- con.radioDefault = "1";
- } else {
- con.radioDefault = "";
- }
- });
- }
- });
- this.editList = arr;
- }
- },
- removeTag(index, item) {
- this.editList.forEach((ele, ind) => {
- if (ind === index) {
- ele.radioList.forEach(con => {
- if (item.fillValues.includes(con.label)) {
- con.radioDefault = true;
- } else {
- con.radioDefault = false;
- }
- });
- }
- });
- },
- changeTagValue(index, item) {
- this.editList.forEach((ele, ind) => {
- if (ind === index) {
- ele.radioList.forEach(con => {
- if (item.fillValues.includes(con.label)) {
- con.radioDefault = true;
- } else {
- con.radioDefault = false;
- }
- });
- }
- });
- },
- isHasDown(index, item) {
- if (item.level === 1) return false;
- let endMore = -1;
- this.editList.forEach((ele, ind) => {
- if (
- ind > index &&
- ele.level === item.level &&
- ele.father === item.father
- ) {
- endMore = ind;
- }
- });
- return endMore !== -1;
- },
- isHasUp(index, item) {
- if (item.level === 1) return false;
- let end = -1;
- this.editList.forEach((ele, ind) => {
- if (
- ind < index &&
- ele.level === item.level &&
- ele.father === item.father
- ) {
- end = ind;
- }
- });
- return end !== -1;
- },
- getLeftWidth(level) {
- return (level - 1) * 40 + "px";
- },
- saveAll() {
- this.$message.success(`提交信息:${JSON.stringify(this.editListInit)}`);
- },
- onChangeDialogVisibleConfirm() {
- this.dialogVisibleConfirm = false;
- this.editList = JSON.parse(JSON.stringify([...this.editListInit]));
- const arr = [];
- this.editList.forEach(ele => {
- if (!ele.isDoing || (ele.isDoing && ele.isEditing)) {
- arr.push(ele);
- }
- });
- this.editList = JSON.parse(JSON.stringify([...arr]));
- this.editListInit = JSON.parse(JSON.stringify([...arr]));
- this.dialogVisible = true;
- },
- seeAll() {
- let flag = false;
- this.editList.forEach(ele => {
- if (ele.isDoing) {
- flag = true;
- }
- });
- this.imageUrl = [];
- if (flag) {
- this.dialogVisibleConfirm = true;
- } else {
- this.editList = JSON.parse(JSON.stringify([...this.editListInit]));
- const arr = [];
- this.editList.forEach(ele => {
- if (!ele.isDoing || (ele.isDoing && ele.isEditing)) {
- arr.push(ele);
- }
- });
- this.editList = arr;
- this.dialogVisible = true;
- }
- },
- handleClose() {
- this.dialogVisible = false;
- }
- }
- };
- </script>
- <style lang="scss" scoped>
- .priview-body {
- }
- .page-index ::v-deep .el-dialog {
- margin: 0 auto;
- height: 90vh;
- overflow: auto;
- }
- .page-index ::v-deep .el-dialog__header {
- padding: 10px;
- }
- .page-index ::v-deep .el-dialog__body {
- padding: 10px 10px;
- height: 90%;
- overflow: auto;
- box-sizing: border-box;
- }
- .page-index {
- width: 1200px;
- line-height: 32px;
- background-color: #fff;
- margin: auto;
- > ul {
- > li {
- display: flex;
- padding: 10px;
- > div {
- margin: 0 5px;
- }
- .ind {
- width: 40px;
- text-align: center;
- }
- .level {
- width: 40px;
- text-align: center;
- }
- .order {
- width: 40px;
- text-align: center;
- i {
- cursor: pointer;
- }
- }
- .isReq {
- width: 40px;
- text-align: center;
- }
- .project {
- flex-grow: 1;
- display: flex;
- .project1 {
- display: inline-flex;
- width: 100%;
- .projectLabel {
- width: 70px;
- text-align: right;
- padding-right: 10px;
- font-weight: bold;
- }
- .projectType {
- flex-grow: 1;
- }
- }
- .project2 {
- width: 100%;
- .project2Left {
- display: flex;
- margin-bottom: 5px;
- .project2LeftName {
- width: 100px;
- text-align: right;
- padding-right: 10px;
- }
- .radioAdd {
- margin-left: 10px;
- cursor: pointer;
- &:hover {
- color: #5386f6;
- }
- }
- .radioAddChild {
- margin-left: 10px;
- cursor: pointer;
- &:hover {
- color: #5386f6;
- }
- }
- .radioDelete {
- margin-left: 10px;
- cursor: pointer;
- &:hover {
- color: #5386f6;
- }
- }
- .bei {
- display: flex;
- .el-checkbox {
- margin-left: 5px;
- }
- }
- .childBei {
- margin-top: 5px;
- margin-left: 80px;
- border: 1px solid #ccc;
- .el-checkbox {
- margin-left: 5px;
- }
- .project2LeftName {
- width: 105px;
- }
- }
- .el-input {
- width: 200px;
- }
- .el-select {
- width: 200px;
- }
- .el-checkbox {
- display: inline-flex;
- align-items: center;
- margin-right: 5px;
- }
- .el-radio {
- margin: 0 5px;
- align-items: center;
- display: inline-flex;
- }
- }
- }
- .project3 {
- width: 100%;
- .project3Left {
- display: flex;
- .project3LeftName {
- flex-shrink: 0;
- width: 100px;
- text-align: right;
- padding-right: 10px;
- }
- .radioChild {
- flex-grow: 1;
- .project3LeftName {
- width: auto;
- }
- .project3Left {
- margin: 3px 0;
- }
- }
- .project3LeftDes {
- flex-grow: 1;
- display: flex;
- // .el-input {
- // width: 200px;
- // }
- // .el-textarea {
- // width: 200px;
- // }
- }
- .project3LeftDepart {
- flex-shrink: 0;
- margin-left: 3px;
- }
- .el-radio-group {
- display: inline-flex;
- align-items: center;
- .el-radio {
- margin-left: 10px;
- margin-right: 0;
- }
- }
- .el-checkbox {
- margin-left: 0;
- margin-right: 10px;
- }
- .el-select {
- width: 100%;
- }
- }
- }
- }
- .action {
- width: 130px;
- span {
- margin: 0 5px;
- cursor: pointer;
- &:hover {
- color: #5386f6;
- }
- }
- .add {
- color: #2c3e50;
- font-size: 16px;
- }
- }
- }
- }
- .disabled {
- color: #c0c4cc;
- cursor: not-allowed !important;
- &:hover {
- color: #c0c4cc !important;
- }
- }
- .btns {
- text-align: center;
- margin: 20px 0;
- }
- }
- </style>
- <style lang="scss">
- .hiddenPopup {
- display: none;
- }
- .project3Left .el-input__suffix {
- display: none !important;
- }
- .preview {
- width: 100% !important;
- .projectLabel {
- width: unset !important;
- }
- .project3LeftName {
- width: unset !important;
- }
- }
- .avatar-uploader .el-upload {
- border: 1px dashed #d9d9d9;
- border-radius: 6px;
- cursor: pointer;
- position: relative;
- overflow: hidden;
- }
- .avatar-uploader .el-upload:hover {
- border-color: #409eff;
- }
- .avatar-uploader-icon {
- font-size: 28px;
- color: #8c939d;
- width: 100px;
- height: 100px;
- line-height: 100px !important;
- text-align: center;
- }
- .avatar-uploader .el-upload__tip {
- margin-top: 0;
- }
- .avatar {
- width: 100px;
- height: 100px;
- display: block;
- }
- .imgs {
- display: flex;
- }
- .imgsLi {
- border: 1px dashed #d9d9d9;
- border-radius: 6px;
- position: relative;
- width: 100px;
- height: 100px;
- margin-right: 10px;
- }
- .el-icon-error {
- cursor: pointer;
- position: absolute;
- right: -8px;
- top: -8px;
- }
- </style>
|