tree.vue 207 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626
  1. <template>
  2. <div style="height: 100%">
  3. <basic-container v-show="showType == 1">
  4. <el-row class="titlerow">
  5. <el-col>
  6. <div style="position: relative">
  7. <span style="float: left; margin-top: 15px; color: white">{{
  8. projectName
  9. }}</span>
  10. <el-button
  11. size="medium"
  12. icon="el-icon-help"
  13. style="margin-right: 10px"
  14. @click="fileTitleHandle"
  15. >文件题名(全局)
  16. </el-button>
  17. <el-dropdown style="margin-right: 10px" @command ="handleBasicClick" v-if="wbsType == 2">
  18. <el-button size="medium">
  19. 基础数据管理<i class="el-icon-arrow-down el-icon--right"></i>
  20. </el-button>
  21. <el-dropdown-menu slot="dropdown">
  22. <el-dropdown-item command="code">编号管理</el-dropdown-item>
  23. <el-dropdown-item command="rule">规范参数配置</el-dropdown-item>
  24. </el-dropdown-menu>
  25. </el-dropdown>
  26. <!-- 同步按钮 -->
  27. <el-button
  28. size="medium"
  29. style="margin-right: 10px"
  30. @click="proSyncbtn"
  31. >项目数据同步
  32. </el-button>
  33. <el-button
  34. size="medium"
  35. icon="el-icon-s-grid"
  36. @click="eleFormulaHandle"
  37. v-if="leftType == 5"
  38. >表单设置
  39. </el-button>
  40. <el-button
  41. size="medium"
  42. icon="el-icon-s-grid"
  43. @click="eleHandle"
  44. v-else
  45. >元素设置
  46. </el-button>
  47. <el-button size="medium" icon="el-icon-help" @click="nodeInfoHandle"
  48. >节点参数设置
  49. </el-button>
  50. <el-button
  51. style="margin-top: 10px"
  52. size="medium"
  53. icon="el-icon-price-tag"
  54. @click="independent"
  55. >独立表单库
  56. </el-button>
  57. <el-button
  58. style="margin-top: 10px"
  59. size="medium"
  60. icon="el-icon-time"
  61. @click="archiveTimeClick"
  62. >归档文件时间设置
  63. </el-button>
  64. </div>
  65. </el-col>
  66. </el-row>
  67. <el-row :gutter="20" style="padding: 10px;height: calc(100vh - 200px);">
  68. <el-col :span="8" style="height: 100%">
  69. <div class="h-100p flex flex-d-c">
  70. 工程节点信息
  71. <div
  72. class="flex"
  73. style="align-items: center; justify-content: space-between;margin-top: 10px;margin-bottom: 10px"
  74. >
  75. <div style="flex:1;margin-right: 5px;">
  76. <el-input placeholder="请输入" v-model="filterText" class="w-100p" size="mini" v-if="isNodeType" clearable>
  77. <el-select v-model="searchType" slot="prepend" placeholder="请选择" v-if="isNodeType" style="width: 70px">
  78. <el-option label="节点" value="1"></el-option>
  79. <el-option label="表名" value="2"></el-option>
  80. </el-select>
  81. </el-input>
  82. <el-input placeholder="请输入" v-model="filterText1" class="w-100p" size="mini" v-else clearable>
  83. </el-input>
  84. </div>
  85. <el-button type="primary" @click="searchTreeClick" v-if="isNodeType" size="mini"
  86. >搜索</el-button
  87. >
  88. <el-button type="primary" @click="searchTreeClick1" v-else size="mini"
  89. >搜索</el-button
  90. >
  91. <el-tooltip content="查询工序节点无内业资料类型" placement="top">
  92. <el-button type="success" @click="filterSearchClick" v-if="isNodeType&&!filterByType" size="mini">筛选</el-button>
  93. <el-button type="success" @click="filterSearchClickCancel" v-else size="mini">取消筛选</el-button>
  94. </el-tooltip>
  95. <el-button
  96. v-if="isNodeType"
  97. style="margin-right: 10px"
  98. size="mini"
  99. icon="el-icon-set-up"
  100. @click="changeType(false)"
  101. type="primary"
  102. >切换表单
  103. </el-button>
  104. <el-button
  105. v-else
  106. style="margin-right: 10px"
  107. size="mini"
  108. icon="el-icon-set-up"
  109. @click="changeType(true)"
  110. type="warning"
  111. >切换节点
  112. </el-button>
  113. </div>
  114. <div class="flex1 ov-hidden" v-if=isNodeType>
  115. <el-scrollbar class="h-100p" v-if="isShowTree">
  116. <div v-loading="treeLoad">
  117. <el-tree
  118. class="filter-tree"
  119. lazy
  120. :load="loadNode"
  121. @node-click="getNodeDetail"
  122. :props="defaultProps"
  123. :expand-on-click-node="false"
  124. highlight-current
  125. node-key="id"
  126. ref="tree"
  127. :default-expanded-keys="defaultExpandedKeys"
  128. v-show="!isSearch"
  129. >
  130. <span
  131. class="custom-tree-node"
  132. :class="data.moreShow ? 'show' : ''"
  133. slot-scope="{ node, data }"
  134. @mouseleave="mouseout(data)"
  135. >
  136. <div class="pd-r-20">
  137. {{ node.label }}
  138. <div class="normal-black">
  139. <div>
  140. <el-link :underline="false">
  141. <i
  142. class="el-icon-menu"
  143. @click.stop="showMenu($event, data, node)"
  144. v-if="node.level != 1"
  145. ></i>
  146. </el-link>
  147. <!-- 因右键自定义菜单事件需要获取当前点击的位置,所以此处绑定动态样式来控制菜单实时跟踪鼠标右键点击位置 -->
  148. <ul
  149. v-show="menuvisible"
  150. :style="{
  151. left: menuleft + 'px',
  152. top: menutop + 'px',
  153. }"
  154. class="contextmenu"
  155. >
  156. <li
  157. v-for="item in menusData"
  158. :key="item"
  159. @click="menuClick($event, item, data,node)"
  160. >
  161. <i :class="item.icon"></i>
  162. <el-tooltip
  163. class="item"
  164. effect="light"
  165. :content="item.content"
  166. placement="right-start"
  167. >
  168. <span>{{ item.label }}</span>
  169. </el-tooltip>
  170. </li>
  171. </ul>
  172. </div>
  173. </div>
  174. </div>
  175. </span>
  176. </el-tree>
  177. <el-tree
  178. :load="searchtreeLoad"
  179. :data="searchTreeData"
  180. @node-click="getNodeDetail"
  181. :props="defaultProps"
  182. :expand-on-click-node="false"
  183. highlight-current
  184. node-key="id"
  185. v-show="isSearch"
  186. default-expand-all
  187. >
  188. <span
  189. class="custom-tree-node"
  190. :class="data.moreShow ? 'show' : ''"
  191. slot-scope="{ node, data }"
  192. @mouseleave="mouseout(data)"
  193. >
  194. <div class="pd-r-20">
  195. {{ node.label }}
  196. <div class="normal-black">
  197. <div>
  198. <el-link :underline="false">
  199. <i
  200. class="el-icon-menu"
  201. @click="showMenu($event, data, node)"
  202. v-if="node.level != 1"
  203. ></i>
  204. </el-link>
  205. <ul
  206. v-show="menuvisible"
  207. :style="{
  208. left: menuleft + 'px',
  209. top: menutop + 'px',
  210. }"
  211. class="contextmenu"
  212. >
  213. <li
  214. v-for="item in menusData"
  215. :key="item"
  216. @click="menuClick($event, item, data,node)"
  217. >
  218. <i :class="item.icon"></i>{{ item.label }}
  219. </li>
  220. </ul>
  221. </div>
  222. </div>
  223. </div>
  224. </span>
  225. </el-tree>
  226. </div>
  227. </el-scrollbar>
  228. </div>
  229. <div v-else class="flex1 ov-hidden">
  230. <el-scrollbar >
  231. <el-tree
  232. :default-expanded-keys="defaultExpandedKeysType"
  233. ref="treeByType"
  234. class="filter-tree"
  235. lazy
  236. :load="loadNodeByType"
  237. :props="defaultPropsByType"
  238. :expand-on-click-node="false"
  239. highlight-current
  240. node-key="id"
  241. @node-click="getNodeDetailByType"
  242. @node-expand="handleNodeExpand"
  243. @node-collapse="handleNodeCollapse"
  244. >
  245. <span class="custom-tree-node" slot-scope="{ node, data }">
  246. <div class="pd-r-20">
  247. {{ node.label }}
  248. </div>
  249. </span>
  250. </el-tree>
  251. </el-scrollbar>
  252. </div>
  253. </div>
  254. </el-col>
  255. <el-col :span="16" class="h-100p flex flex-d-c">
  256. <template v-if="leftType == 5">
  257. <div class="mg-b-10" v-if='isNodeType'>节点信息</div>
  258. <div v-if="isNodeType">
  259. <el-table :data="tableData" border style="width: 100%" v-if="wbsType!==2">
  260. <el-table-column
  261. align="center"
  262. prop="nodeName"
  263. label="当前节点"
  264. ></el-table-column>
  265. <el-table-column
  266. align="center"
  267. prop="nodeType"
  268. :formatter="formatCat"
  269. label="节点类型"
  270. width="180"
  271. ></el-table-column>
  272. <el-table-column
  273. align="center"
  274. prop="majorDataType"
  275. :formatter="formMajorType"
  276. label="内业资料类型"
  277. ></el-table-column>
  278. <el-table-column
  279. align="center"
  280. prop="isAddConceal"
  281. label="新增时是否隐藏"
  282. >
  283. <template slot-scope="scope">{{ scope.row.isAddConceal ===1?'是':'否' }}</template>
  284. </el-table-column>
  285. <el-table-column
  286. align="center"
  287. prop="updateUserName"
  288. label="修改人"
  289. ></el-table-column>
  290. <el-table-column
  291. align="center"
  292. prop="updateTime"
  293. label="修改时间"
  294. ></el-table-column>
  295. <el-table-column label="操作" width="150" >
  296. <template slot-scope="scope">
  297. <el-link
  298. size="mini"
  299. type="primary"
  300. class="mg-r-10"
  301. @click="editNodeHandle"
  302. >编辑
  303. </el-link>
  304. <el-link
  305. size="mini"
  306. type="primary"
  307. >节点编辑台账
  308. </el-link>
  309. </template>
  310. </el-table-column>
  311. </el-table>
  312. <el-table :data="tableData" border style="width: 100%" v-else>
  313. <el-table-column
  314. align="center"
  315. prop="nodeName"
  316. label="当前节点"
  317. ></el-table-column>
  318. <el-table-column
  319. align="center"
  320. prop="nodeType"
  321. :formatter="formatCat"
  322. label="节点类型"
  323. width="180"
  324. ></el-table-column>
  325. <el-table-column
  326. align="center"
  327. prop="uniqueCode"
  328. label="参数掩码"
  329. ></el-table-column>
  330. <el-table-column
  331. <el-table-column label="操作" width="150" >
  332. <template slot-scope="scope">
  333. <el-link
  334. size="mini"
  335. type="primary"
  336. class="mg-r-10"
  337. @click="editNodeHandle"
  338. >编辑
  339. </el-link>
  340. <el-link
  341. size="mini"
  342. type="primary"
  343. >节点编辑台账
  344. </el-link>
  345. </template>
  346. </el-table-column>
  347. </el-table>
  348. </div>
  349. <div class="flex jc-sb">
  350. <p>
  351. <span>当前项目信息表</span>
  352. <el-button
  353. type="text"
  354. style="margin-left: 10px"
  355. icon="el-icon-edit-outline"
  356. class="text-icon"
  357. @click="editEditElementForm()"
  358. ></el-button>
  359. <el-button
  360. v-if="isNodeType"
  361. type="text"
  362. icon="el-icon-sort"
  363. class="text-icon"
  364. @click="privateTableSort()"
  365. ></el-button>
  366. </p>
  367. <div class="mg-t-10"></div>
  368. </div>
  369. <div style="flex: 1; position: relative; height: calc(100vh - 260px);overflow-y: auto;" v-loading="tableListByTypeLoad">
  370. <!-- 施工方分类 -->
  371. <template v-if="isNodeType">
  372. <template v-if="tableListByType.length > 0">
  373. <div class="category-section" v-for="(item, index) in tableListByType" :key="index">
  374. <div class="category-header">{{item.title}}</div>
  375. <el-table
  376. :data="item.list"
  377. border
  378. style="width: 100%"
  379. >
  380. <el-table-column
  381. align="center"
  382. prop="tableName"
  383. label="表单名称"
  384. ></el-table-column>
  385. <el-table-column
  386. v-if="leftType===5"
  387. align="center"
  388. prop="elementTotal"
  389. width="80"
  390. label="字段总量"
  391. ></el-table-column>
  392. <el-table-column
  393. align="center"
  394. prop="tableType"
  395. :formatter="formatTableType"
  396. label="表单类型"
  397. ></el-table-column>
  398. <el-table-column
  399. align="center"
  400. prop="fillRate"
  401. label="填报率"
  402. ></el-table-column>
  403. <el-table-column
  404. label="是否关联清表"
  405. prop="isLinkTable"
  406. align="center"
  407. v-if="leftType===4"
  408. >
  409. <template slot-scope="scope">
  410. <span v-if="scope.row.isLinkTable == 2">是</span>
  411. <span v-else>否</span>
  412. </template>
  413. </el-table-column>
  414. <el-table-column
  415. align="center"
  416. prop="tableOwner"
  417. :formatter="formatOwner"
  418. label="所属方"
  419. ></el-table-column>
  420. <el-table-column label="操作" align="center" width="500" v-if="leftType == 4">
  421. <template slot-scope="scope">
  422. <el-link type="primary" @click="Associationlist(scope)"
  423. >关联清表
  424. </el-link>
  425. <el-link
  426. class="mg-l-10"
  427. type="primary"
  428. :disabled="
  429. scope.row.excelId == -1 || scope.row.excelId == null
  430. "
  431. @click="
  432. rightClick(
  433. scope.row.pkeyId,
  434. scope.row.excelId,
  435. scope.row.id,
  436. scope.row.initTableName,
  437. scope.row.initTableId
  438. )
  439. "
  440. >编辑元素
  441. </el-link>
  442. <el-link
  443. class="mg-l-10"
  444. type="primary"
  445. :disabled="
  446. scope.row.excelId == -1 || scope.row.excelId == null
  447. "
  448. @click="adjustExcel(scope.row.pkeyId, scope.row.excelId)"
  449. >调整表单
  450. </el-link>
  451. <el-link
  452. class="mg-l-10"
  453. type="primary"
  454. @click="handleEditFormula(scope.$index, scope.row)"
  455. >编辑元素公式
  456. </el-link>
  457. <el-link
  458. class="mg-l-10"
  459. type="danger"
  460. @click="handleDelete(scope.$index, scope.row)"
  461. >删除表单
  462. </el-link>
  463. </template>
  464. </el-table-column>
  465. <el-table-column label="操作" align="center" width="500" v-if="leftType == 5">
  466. <template slot-scope="scope">
  467. <el-button
  468. size="mini"
  469. @click="handlePreview(scope.$index, scope.row)"
  470. >预览
  471. </el-button>
  472. <el-button
  473. size="mini"
  474. @click="handleEdit(scope.$index, scope.row)"
  475. >编辑
  476. </el-button>
  477. <el-button
  478. size="mini"
  479. type="success"
  480. v-throttle="3000"
  481. v-show="scope.row.status == 0"
  482. @click="hideMD(scope.row)"
  483. >取消隐藏
  484. </el-button>
  485. <el-button
  486. size="mini"
  487. type="primary"
  488. v-throttle="3000"
  489. v-show="scope.row.status == 1"
  490. @click="hideMD(scope.row)"
  491. >隐藏表单
  492. </el-button>
  493. <el-button
  494. v-if="isNodeType"
  495. size="mini"
  496. type="danger"
  497. @click="handleDelete(scope.$index, scope.row)"
  498. >删除
  499. </el-button>
  500. </template>
  501. </el-table-column>
  502. </el-table>
  503. </div>
  504. </template>
  505. <el-empty description="暂无数据" v-else ></el-empty>
  506. </template>
  507. <template v-else>
  508. <el-table
  509. :data="formData"
  510. border
  511. height="100%"
  512. style="width: 100%; position: absolute"
  513. >
  514. <el-table-column
  515. align="center"
  516. prop="tableName"
  517. label="表单名称"
  518. ></el-table-column>
  519. <el-table-column
  520. align="center"
  521. prop="tableType"
  522. :formatter="formatTableType"
  523. label="表单类型"
  524. ></el-table-column>
  525. <el-table-column
  526. align="center"
  527. prop="fillRate"
  528. label="填报率"
  529. ></el-table-column>
  530. <el-table-column
  531. label="是否关联清表"
  532. prop="isLinkTable"
  533. align="center"
  534. >
  535. <template slot-scope="scope">
  536. <span v-if="scope.row.isLinkTable == 2">是</span>
  537. <span v-else>否</span>
  538. </template>
  539. </el-table-column>
  540. <el-table-column
  541. align="center"
  542. prop="tableOwner"
  543. :formatter="formatOwner"
  544. label="所属方"
  545. ></el-table-column>
  546. <el-table-column label="操作" align="center" width="250">
  547. <template slot-scope="scope">
  548. <el-link type="primary" @click="Associationlist(scope)"
  549. >关联清表
  550. </el-link>
  551. <el-link
  552. class="mg-l-10"
  553. type="primary"
  554. :disabled="
  555. scope.row.excelId == -1 || scope.row.excelId == null
  556. "
  557. @click="
  558. rightClick(
  559. scope.row.pkeyId,
  560. scope.row.excelId,
  561. scope.row.id,
  562. scope.row.initTableName,
  563. scope.row.initTableId
  564. )
  565. "
  566. >编辑元素
  567. </el-link>
  568. <el-link
  569. class="mg-l-10"
  570. type="primary"
  571. :disabled="
  572. scope.row.excelId == -1 || scope.row.excelId == null
  573. "
  574. @click="adjustExcel(scope.row.pkeyId, scope.row.excelId)"
  575. >调整表单
  576. </el-link>
  577. </template>
  578. </el-table-column>
  579. </el-table>
  580. </template>
  581. </div>
  582. </template>
  583. <template v-if="leftType == 4&&isNodeType" >
  584. <div style="flex: 1; position: relative; height: calc(100vh - 260px);overflow-y: auto;">
  585. <!-- 施工方分类 -->
  586. <template v-if="tableListByType.length > 0">
  587. <div class="category-section" v-for="(item, index) in tableListByType" :key="index">
  588. <div class="category-header">{{item.title}}</div>
  589. <el-table
  590. :data="item.list"
  591. border
  592. style="width: 100%"
  593. >
  594. <el-table-column
  595. align="center"
  596. prop="tableName"
  597. label="表单名称"
  598. ></el-table-column>
  599. <el-table-column
  600. v-if="leftType===5"
  601. align="center"
  602. prop="elementTotal"
  603. width="80"
  604. label="字段总量"
  605. ></el-table-column>
  606. <el-table-column
  607. align="center"
  608. prop="tableType"
  609. :formatter="formatTableType"
  610. label="表单类型"
  611. ></el-table-column>
  612. <el-table-column
  613. align="center"
  614. prop="fillRate"
  615. label="填报率"
  616. ></el-table-column>
  617. <el-table-column
  618. label="是否关联清表"
  619. prop="isLinkTable"
  620. align="center"
  621. v-if="leftType===4"
  622. >
  623. <template slot-scope="scope">
  624. <span v-if="scope.row.isLinkTable == 2">是</span>
  625. <span v-else>否</span>
  626. </template>
  627. </el-table-column>
  628. <el-table-column
  629. align="center"
  630. prop="tableOwner"
  631. :formatter="formatOwner"
  632. label="所属方"
  633. ></el-table-column>
  634. <el-table-column label="操作" align="center" width="500" v-if="leftType == 4">
  635. <template slot-scope="scope">
  636. <el-link type="primary" @click="Associationlist(scope)"
  637. >关联清表
  638. </el-link>
  639. <el-link
  640. class="mg-l-10"
  641. type="primary"
  642. :disabled="
  643. scope.row.excelId == -1 || scope.row.excelId == null
  644. "
  645. @click="
  646. rightClick(
  647. scope.row.pkeyId,
  648. scope.row.excelId,
  649. scope.row.id,
  650. scope.row.initTableName,
  651. scope.row.initTableId
  652. )
  653. "
  654. >编辑元素
  655. </el-link>
  656. <el-link
  657. class="mg-l-10"
  658. type="primary"
  659. :disabled="
  660. scope.row.excelId == -1 || scope.row.excelId == null
  661. "
  662. @click="adjustExcel(scope.row.pkeyId, scope.row.excelId)"
  663. >调整表单
  664. </el-link>
  665. <el-link
  666. class="mg-l-10"
  667. type="primary"
  668. @click="handleEditFormula(scope.$index, scope.row)"
  669. >编辑元素公式
  670. </el-link>
  671. <el-dropdown @command="handleCommand($event,scope.row)" v-if="isNodeType">
  672. <el-button type="text" class="mg-l-10">
  673. 表单同步<i class="el-icon-arrow-down el-icon--right"></i>
  674. </el-button>
  675. <el-dropdown-menu slot="dropdown">
  676. <el-dropdown-item command="a">同步到项目下所有表单</el-dropdown-item>
  677. <el-dropdown-item command="b">同步其他表单配置</el-dropdown-item>
  678. </el-dropdown-menu>
  679. </el-dropdown>
  680. <el-link
  681. class="mg-l-10"
  682. type="danger"
  683. @click="handleDelete(scope.$index, scope.row)"
  684. >删除表单
  685. </el-link>
  686. </template>
  687. </el-table-column>
  688. <el-table-column label="操作" align="center" width="500" v-if="leftType == 5">
  689. <template slot-scope="scope">
  690. <el-button
  691. size="mini"
  692. @click="handlePreview(scope.$index, scope.row)"
  693. >预览
  694. </el-button>
  695. <el-button
  696. size="mini"
  697. @click="handleEdit(scope.$index, scope.row)"
  698. >编辑
  699. </el-button>
  700. <el-button
  701. size="mini"
  702. type="success"
  703. v-throttle="3000"
  704. v-show="scope.row.status == 0"
  705. @click="hideMD(scope.row)"
  706. >取消隐藏
  707. </el-button>
  708. <el-button
  709. size="mini"
  710. type="primary"
  711. v-throttle="3000"
  712. v-show="scope.row.status == 1"
  713. @click="hideMD(scope.row)"
  714. >隐藏表单
  715. </el-button>
  716. <el-button
  717. v-if="isNodeType"
  718. size="mini"
  719. type="danger"
  720. @click="handleDelete(scope.$index, scope.row)"
  721. >删除
  722. </el-button>
  723. </template>
  724. </el-table-column>
  725. </el-table>
  726. </div>
  727. </template>
  728. <el-empty description="暂无数据" v-else></el-empty>
  729. </div>
  730. </template>
  731. </el-col>
  732. </el-row>
  733. </basic-container>
  734. <el-row class="h-100p" v-show="showType == 2">
  735. <el-col :span="6" class="h-100p">
  736. <basic-container>
  737. <el-scrollbar class="h-100p">
  738. <el-tree
  739. class="filter-tree"
  740. lazy
  741. :data="typeTreeData"
  742. :load="typeTreeLoadNode"
  743. @node-click="getTypeTreeDetail"
  744. :props="defaultProps"
  745. :expand-on-click-node="false"
  746. highlight-current
  747. node-key="id"
  748. >
  749. </el-tree>
  750. </el-scrollbar>
  751. </basic-container>
  752. </el-col>
  753. <el-col :span="18" class="h-100p">
  754. <basic-container>
  755. <div class="flex h-100p flex-d-c">
  756. <div style="flex: 1; position: relative">
  757. <el-table
  758. :data="formData"
  759. border
  760. height="100%"
  761. style="width: 100%; position: absolute"
  762. >
  763. <el-table-column
  764. align="center"
  765. prop="tableName"
  766. label="表单名称"
  767. ></el-table-column>
  768. <el-table-column
  769. align="center"
  770. prop="tableType"
  771. :formatter="formatTableType"
  772. label="表单类型"
  773. ></el-table-column>
  774. <el-table-column
  775. align="center"
  776. prop="fillRate"
  777. label="填报率"
  778. ></el-table-column>
  779. <el-table-column
  780. label="是否关联清表"
  781. prop="isLinkTable"
  782. align="center"
  783. >
  784. <template slot-scope="scope">
  785. <span v-if="scope.row.isLinkTable == 2">是</span>
  786. <span v-else>否</span>
  787. </template>
  788. </el-table-column>
  789. <el-table-column
  790. align="center"
  791. prop="tableOwner"
  792. :formatter="formatOwner"
  793. label="所属方"
  794. ></el-table-column>
  795. <el-table-column label="操作" align="center">
  796. <template slot-scope="scope">
  797. <el-link type="primary" @click="Associationlist(scope)"
  798. >关联清表
  799. </el-link>
  800. <el-link
  801. class="mg-l-10"
  802. type="primary"
  803. :disabled="
  804. scope.row.excelId == -1 || scope.row.excelId == null
  805. "
  806. @click="
  807. rightClick(
  808. scope.row.pkeyId,
  809. scope.row.excelId,
  810. scope.row.id,
  811. scope.row.initTableName,
  812. scope.row.initTableId
  813. )
  814. "
  815. >编辑元素
  816. </el-link>
  817. <el-link
  818. class="mg-l-10"
  819. type="primary"
  820. :disabled="
  821. scope.row.excelId == -1 || scope.row.excelId == null
  822. "
  823. @click="adjustExcel(scope.row.pkeyId, scope.row.excelId)"
  824. >调整表单
  825. </el-link>
  826. <el-link
  827. class="mg-l-10"
  828. type="primary"
  829. @click="handleEditFormula(scope.$index, scope.row)"
  830. >编辑元素公式
  831. </el-link>
  832. <el-link
  833. class="mg-l-10"
  834. type="danger"
  835. @click="handleDelete(scope.$index, scope.row)"
  836. >删除表单
  837. </el-link>
  838. </template>
  839. </el-table-column>
  840. </el-table>
  841. </div>
  842. <div class="mg-t-10 flex jc-sb">
  843. <div></div>
  844. <el-button size="medium" @click="showType = 1"
  845. >返回WBS树
  846. </el-button>
  847. </div>
  848. </div>
  849. </basic-container>
  850. </el-col>
  851. </el-row>
  852. <!-- 编辑元素表单信息 -->
  853. <el-dialog
  854. title="编辑元素表单信息"
  855. :visible.sync="editElementFormTag"
  856. width="60%"
  857. :modal-append-to-body="false"
  858. >
  859. <div>
  860. <el-table :data="formDatass" border style="width: 100%">
  861. <el-table-column prop="tableName" label="表名">
  862. <template slot-scope="scope">
  863. <el-input
  864. v-model="scope.row.tableName"
  865. placeholder="请输入表名称"
  866. ></el-input>
  867. </template>
  868. </el-table-column>
  869. <el-table-column prop="tableType" label="表类型">
  870. <template slot-scope="scope">
  871. <el-select v-model="scope.row.tableType" placeholder="请选择">
  872. <el-option
  873. v-for="(item, key) in tableTypelist"
  874. :key="key"
  875. :label="item.dictValue"
  876. :value="item.dictKey"
  877. >
  878. </el-option>
  879. </el-select>
  880. </template>
  881. </el-table-column>
  882. <el-table-column prop="tableOwner" label="所属方">
  883. <template slot-scope="scope">
  884. <el-select v-model="scope.row.tableOwner" placeholder="请选择">
  885. <el-option
  886. v-for="(item, key) in ownerTypeList"
  887. :key="key"
  888. :label="item.dictValue"
  889. :value="item.dictKey"
  890. >
  891. </el-option>
  892. </el-select>
  893. </template>
  894. </el-table-column>
  895. <el-table-column prop="fillRate" label="填报率">
  896. <template slot-scope="scope">
  897. <el-input
  898. v-model="scope.row.fillRate"
  899. placeholder="请输入填报率"
  900. ></el-input>
  901. </template>
  902. </el-table-column>
  903. <el-table-column prop="nodeType" label="节点类型" v-if="wbsType == 5">
  904. <template slot-scope="scope">
  905. <el-select v-model="scope.row.nodeType" placeholder="请选择" >
  906. <el-option
  907. v-for="item in nodeTypelist"
  908. :key="item.id"
  909. :label="item.dictValue"
  910. :value="item.dictKey"
  911. ></el-option>
  912. </el-select>
  913. </template>
  914. </el-table-column>
  915. </el-table>
  916. </div>
  917. <span slot="footer" class="dialog-footer">
  918. <el-button @click="editElementFormTag = false">取 消</el-button>
  919. <el-button
  920. type="primary"
  921. @click="editeditElementFormMF()"
  922. :loading="editeditElementFormMFLoading"
  923. >确 定</el-button
  924. >
  925. </span>
  926. </el-dialog>
  927. <!-- 调整表单模板 -->
  928. <div v-if="excelHtml" class="excelHtml">
  929. <dynamicExcel
  930. @remove="removeExcel"
  931. v-if="excelHtml"
  932. :pkeyId="GLExcelFrom.id"
  933. :excelId="GLExcelFrom.excelId"
  934. />
  935. </div>
  936. <el-dialog
  937. title="调整排序"
  938. :visible.sync="sortTag"
  939. width="50%"
  940. append-to-body
  941. >
  942. <ManualSorting v-if="sortTag2" @bianhua="bianhua()" :sort="sort" />
  943. <span slot="footer" class="dialog-footer">
  944. <el-button @click="(sortTag = false), (sortTag2 = false)"
  945. >取 消</el-button
  946. >
  947. <el-button type="primary" @click="editSort()" v-loading="sureSortload"
  948. >确 定</el-button
  949. >
  950. </span>
  951. </el-dialog>
  952. <!-- 元素表排序 -->
  953. <tableSortByType
  954. ref="tableSortRef"
  955. title="表单排序"
  956. :sortProLoad="sortProLoad"
  957. @confirm="editPrivateSort"
  958. />
  959. <!-- 关联清表 -->
  960. <el-dialog
  961. title="关联清表"
  962. class="excelBox"
  963. :visible.sync="GLExcel"
  964. width="500px"
  965. modal-append-to-body
  966. append-to-body
  967. @close="GLExcelMD"
  968. >
  969. <div>
  970. <el-select
  971. style="width: 400px"
  972. v-model="GLExcelFrom.name"
  973. placeholder="请选择"
  974. @change="changetherr()"
  975. >
  976. <el-option
  977. v-for="(item, key) in GLExcelData"
  978. :key="key"
  979. :label="item.name"
  980. :value="item.id"
  981. >
  982. </el-option>
  983. </el-select>
  984. <el-scrollbar style="margin-top: 20px; height: 50vh">
  985. <el-input
  986. style="width: 400px"
  987. v-model.trim="GLExcelFrom.search"
  988. placeholder="请输入需要选择的内容"
  989. ></el-input>
  990. <el-tree
  991. :filter-node-method="filterNode222"
  992. ref="tree"
  993. class="filter-tree"
  994. style="margin-top: 10px"
  995. :props="GLExcelProps"
  996. :data="exceldata"
  997. node-key="id"
  998. accordion
  999. show-checkbox
  1000. @check="checkchange"
  1001. v-loading="GLExcelLoading"
  1002. >
  1003. </el-tree>
  1004. </el-scrollbar>
  1005. </div>
  1006. <span
  1007. slot="footer"
  1008. class="dialog-footer"
  1009. style="display: flex; justify-content: center; align-items: center"
  1010. >
  1011. <el-button @click="GLExcelMD()">取 消</el-button>
  1012. <el-button
  1013. style="margin-left: 30px"
  1014. type="primary"
  1015. v-throttle="2000"
  1016. @click="saveLinkTab()"
  1017. >确 定</el-button
  1018. >
  1019. </span>
  1020. </el-dialog>
  1021. <!-- 节点详情 -->
  1022. <el-dialog
  1023. :title="dialogTitle"
  1024. :visible.sync="dialogVisible"
  1025. width="50%"
  1026. append-to-body
  1027. :close-on-click-modal="false"
  1028. @closed="saveNodeLoading = false"
  1029. >
  1030. <el-form
  1031. ref="nodeDetail"
  1032. :model="nodeDetail"
  1033. :rules="rules"
  1034. label-width="140px"
  1035. >
  1036. <el-form-item label="节点名称" prop="nodeName">
  1037. <div class="flex">
  1038. <el-input v-model="nodeDetail.nodeName"></el-input>
  1039. <el-button class="mg-l-10" type="primary" @click="aliasShow"
  1040. >添加别名
  1041. </el-button>
  1042. </div>
  1043. </el-form-item>
  1044. <el-form-item label="上级节点">
  1045. <el-input v-model="nodeDetail.parentName" disabled></el-input>
  1046. </el-form-item>
  1047. <el-form-item label="节点类型" prop="nodeType">
  1048. <el-select
  1049. v-model="nodeDetail.nodeType"
  1050. placeholder="请选择"
  1051. class="w-100p"
  1052. @change="nodeTypeChange"
  1053. clearable
  1054. >
  1055. <el-option
  1056. v-for="item in nodeTypelist"
  1057. :key="item.id"
  1058. :label="item.dictValue"
  1059. :value="item.dictKey"
  1060. ></el-option>
  1061. </el-select>
  1062. </el-form-item>
  1063. <el-form-item label="划分编号" v-if="wbsType !== 2 && wbsType !== 5">
  1064. <el-input v-model="nodeDetail.partitionCode"></el-input>
  1065. </el-form-item>
  1066. <!-- <el-form-item label="唯一编码" v-if="wbsType !== 5">
  1067. <el-input v-model="nodeDetail.uniqueCode"></el-input>
  1068. </el-form-item> -->
  1069. <el-form-item label="参数掩码" v-if="wbsType !== 5">
  1070. <el-input v-model="nodeDetail.uniqueCode" placeholder="可填写分部评定权值/试验编号配置"></el-input>
  1071. </el-form-item>
  1072. <template v-if="nodeDetail.nodeType == 6">
  1073. <el-form-item label="含附件类型" >
  1074. <el-select
  1075. v-model="nodeDetail.tableFileType"
  1076. placeholder="请选择"
  1077. class="w-100p"
  1078. clearable
  1079. multiple
  1080. >
  1081. <el-option
  1082. v-for="item in tableFileTypeList"
  1083. :key="item.id"
  1084. :label="item.dictValue"
  1085. :value="item.dictKey"
  1086. ></el-option>
  1087. </el-select>
  1088. </el-form-item>
  1089. <el-form-item label="是否有混凝土">
  1090. <el-radio-group v-model="nodeDetail.isConcrete" size="small">
  1091. <el-radio :label="0" border>无</el-radio>
  1092. <el-radio :label="1" border>有</el-radio>
  1093. </el-radio-group>
  1094. </el-form-item>
  1095. <el-form-item label="是否试验节点">
  1096. <el-radio-group v-model="nodeDetail.isExpernode" size="small">
  1097. <el-radio :label="0" border>否</el-radio>
  1098. <el-radio :label="1" border>是</el-radio>
  1099. </el-radio-group>
  1100. </el-form-item>
  1101. </template>
  1102. <el-form-item
  1103. label="内业资料类型"
  1104. prop="majorDataType"
  1105. v-if="wbsType !== 2 && wbsType !== 5"
  1106. >
  1107. <el-select
  1108. v-model="nodeDetail.majorDataType"
  1109. placeholder="请选择"
  1110. class="w-100p"
  1111. clearable
  1112. >
  1113. <el-option
  1114. v-for="item in majorDataTypeList"
  1115. :key="item.id"
  1116. :label="item.dictValue"
  1117. :value="item.dictKey"
  1118. ></el-option>
  1119. </el-select>
  1120. </el-form-item>
  1121. <el-form-item label="标准分类">
  1122. <el-select
  1123. v-model="nodeDetail.className"
  1124. placeholder="请选择"
  1125. class="w-100p"
  1126. @change="changeStandType"
  1127. clearable
  1128. >
  1129. <el-option
  1130. v-for="item in standardTypeOptions"
  1131. :key="item.id"
  1132. :label="item.dictValue"
  1133. :value="item.dictKey"
  1134. ></el-option>
  1135. </el-select>
  1136. </el-form-item>
  1137. <el-form-item label="单元名称">
  1138. <el-select
  1139. v-model="nodeDetail.unitName"
  1140. placeholder="请选择"
  1141. class="w-100p"
  1142. clearable
  1143. >
  1144. <el-option
  1145. v-for="item in unitOptions"
  1146. :key="item.id"
  1147. :label="item.dictValue"
  1148. :value="item.dictKey"
  1149. ></el-option>
  1150. </el-select>
  1151. </el-form-item>
  1152. <el-form-item
  1153. label="是否新增中隐藏"
  1154. prop="isAddConceal"
  1155. v-if="wbsType !== 2 && wbsType !== 5"
  1156. >
  1157. <el-radio-group v-model="nodeDetail.isAddConceal" size="small">
  1158. <el-radio :label="1" border>是</el-radio>
  1159. <el-radio :label="0" border>否</el-radio>
  1160. </el-radio-group>
  1161. </el-form-item>
  1162. <el-form-item
  1163. label="勾选相关联试验"
  1164. prop="mixRatioTestIds"
  1165. v-if="wbsType === 2 && nodeDetail.nodeType === 53"
  1166. >
  1167. <div
  1168. style="position: relative; height: 300px; border: 1px solid #dddfe6"
  1169. >
  1170. <el-scrollbar class="h-100p">
  1171. <div v-loading="testTreeLoad">
  1172. <el-tree
  1173. class="filter-tree"
  1174. :data="testTreeData"
  1175. :props="defaultProps"
  1176. :expand-on-click-node="false"
  1177. highlight-current
  1178. node-key="id"
  1179. ref="treeall"
  1180. show-checkbox
  1181. :default-checked-keys="mixRatioTestIds"
  1182. @check="TestTreeCheckChange"
  1183. />
  1184. </div>
  1185. </el-scrollbar>
  1186. </div>
  1187. </el-form-item>
  1188. </el-form>
  1189. <span slot="footer" class="dialog-footer">
  1190. <el-button @click="dialogVisible = false">取 消</el-button>
  1191. <el-button type="primary" @click="saveNode" :loading="saveNodeLoading"
  1192. >确 定</el-button
  1193. >
  1194. </span>
  1195. </el-dialog>
  1196. <!-- 创建新的元素表 -->
  1197. <el-dialog
  1198. title="创建新的元素表"
  1199. :visible.sync="eleVisible"
  1200. width="80%"
  1201. append-to-body
  1202. :close-on-click-modal="false"
  1203. >
  1204. <el-form
  1205. ref="eleDialog"
  1206. :model="eleForm"
  1207. :rules="eleRules"
  1208. label-width="110px"
  1209. >
  1210. <el-form-item label="表名" prop="nodeName">
  1211. <el-input v-model="eleForm.nodeName"></el-input>
  1212. </el-form-item>
  1213. <el-row>
  1214. <el-col :span="12">
  1215. <el-form-item label="表类型" prop="tableType">
  1216. <el-select
  1217. v-model="eleForm.tableType"
  1218. placeholder="请选择"
  1219. class="w-100p"
  1220. >
  1221. <el-option
  1222. v-for="item in tableTypelist"
  1223. :key="item.id"
  1224. :label="item.dictValue"
  1225. :value="item.dictKey"
  1226. ></el-option>
  1227. </el-select>
  1228. </el-form-item>
  1229. </el-col>
  1230. <el-col :span="12">
  1231. <el-form-item label="所属方" prop="tableOwner">
  1232. <el-select
  1233. v-model="eleForm.tableOwner"
  1234. placeholder="请选择"
  1235. class="w-100p"
  1236. >
  1237. <el-option
  1238. v-for="item in ownerTypeList"
  1239. :key="item.id"
  1240. :label="item.dictValue"
  1241. :value="item.dictKey"
  1242. ></el-option>
  1243. </el-select>
  1244. </el-form-item>
  1245. </el-col>
  1246. </el-row>
  1247. </el-form>
  1248. <div class="flex jc-sb">
  1249. <div></div>
  1250. <div>
  1251. <el-link type="primary" @click="importVisible = true"
  1252. >快捷导入
  1253. </el-link>
  1254. <el-link type="primary" class="mg-l-20" @click="downloadTmp"
  1255. >下载导入模版
  1256. </el-link>
  1257. </div>
  1258. </div>
  1259. <div class="border-grey">
  1260. <p class="font-c-warning">编辑元素信息(请谨慎操作)</p>
  1261. <el-table
  1262. :data="eleForm.elementList"
  1263. border
  1264. style="width: 100%"
  1265. height="400px"
  1266. >
  1267. <el-table-column
  1268. align="center"
  1269. type="index"
  1270. width="50"
  1271. ></el-table-column>
  1272. <el-table-column align="center" prop="eName" label="字段名称">
  1273. <template slot-scope="scope">
  1274. <el-input
  1275. v-model="scope.row.eName"
  1276. size="small"
  1277. placeholder="请输入内容"
  1278. ></el-input>
  1279. </template>
  1280. </el-table-column>
  1281. <el-table-column
  1282. align="center"
  1283. prop="eType"
  1284. label="数据类型"
  1285. width="120"
  1286. >
  1287. <template slot-scope="scope">
  1288. <el-select
  1289. v-model="scope.row.eType"
  1290. size="small"
  1291. placeholder="请选择"
  1292. >
  1293. <el-option
  1294. v-for="item in dataTypeList"
  1295. :key="item.id"
  1296. :label="item.dictValue"
  1297. :value="item.dictKey"
  1298. ></el-option>
  1299. </el-select>
  1300. </template>
  1301. </el-table-column>
  1302. <el-table-column
  1303. align="center"
  1304. prop="eLength"
  1305. label="长度"
  1306. width="120"
  1307. >
  1308. <template slot-scope="scope">
  1309. <el-input
  1310. v-model="scope.row.eLength"
  1311. size="small"
  1312. placeholder="请输入内容"
  1313. :disabled="scope.row.eType == 4"
  1314. ></el-input>
  1315. </template>
  1316. </el-table-column>
  1317. <el-table-column
  1318. align="center"
  1319. prop="eAllowDeviation"
  1320. label="允许偏差值"
  1321. >
  1322. <template slot-scope="scope">
  1323. <div class="flex">
  1324. <el-select
  1325. v-model="scope.row.allow"
  1326. size="small"
  1327. placeholder="请选择"
  1328. style="width: 120px"
  1329. >
  1330. <el-option :key="1" label="≥" value="≥"></el-option>
  1331. <el-option :key="2" label="≤" value="≤"></el-option>
  1332. <el-option :key="3" label="±" value="±"></el-option>
  1333. <el-option :key="4" label="【】" value="【】"></el-option>
  1334. </el-select>
  1335. <el-input
  1336. v-model="scope.row.deviation"
  1337. size="small"
  1338. placeholder="请输入内容"
  1339. ></el-input>
  1340. </div>
  1341. </template>
  1342. </el-table-column>
  1343. <el-table-column
  1344. align="center"
  1345. prop="eInspectionMethod"
  1346. label="检查方法和频率"
  1347. >
  1348. <template slot-scope="scope">
  1349. <el-input
  1350. v-model="scope.row.eInspectionMethod"
  1351. size="small"
  1352. placeholder="请输入内容"
  1353. ></el-input>
  1354. </template>
  1355. </el-table-column>
  1356. <el-table-column align="center" label="操作" width="80">
  1357. <template slot="header">
  1358. <el-button
  1359. @click="addEleRow(eleForm.elementList)"
  1360. type="text"
  1361. icon="el-icon-circle-plus-outline"
  1362. class="text-icon"
  1363. ></el-button>
  1364. </template>
  1365. <template slot-scope="scope">
  1366. <el-button
  1367. icon="el-icon-remove-outline"
  1368. type="text"
  1369. @click="delEleRow(scope.$index, eleForm.elementList)"
  1370. class="text-icon text-icon-danger"
  1371. ></el-button>
  1372. </template>
  1373. </el-table-column>
  1374. </el-table>
  1375. </div>
  1376. <span slot="footer" class="dialog-footer">
  1377. <el-button @click="eleVisible = false">取 消</el-button>
  1378. <el-button type="primary" @click="saveFormAndElementHandle"
  1379. >保 存</el-button
  1380. >
  1381. </span>
  1382. </el-dialog>
  1383. <!-- 模板导入 -->
  1384. <el-dialog
  1385. title="模版导入"
  1386. :visible.sync="importVisible"
  1387. width="50%"
  1388. append-to-body
  1389. :close-on-click-modal="false"
  1390. >
  1391. <p>
  1392. 提示:必须按照系统要求的模版格式上传,否则系统识别无效
  1393. <el-link type="primary" @click="downloadTmp">下载导入模版</el-link>
  1394. </p>
  1395. <div>
  1396. <el-button size="small" type="primary" @click="fileClick2"
  1397. >本地上传
  1398. </el-button>
  1399. <input
  1400. @change="tmpImport"
  1401. type="file"
  1402. hidden
  1403. ref="file2"
  1404. accept=".xls, .xlsx"
  1405. />
  1406. </div>
  1407. <el-table :data="tempList" border style="width: 100%">
  1408. <el-table-column align="center" prop="eName" label="字段信息">
  1409. </el-table-column>
  1410. <el-table-column
  1411. align="center"
  1412. prop="eType"
  1413. label="数据类型"
  1414. width="120"
  1415. >
  1416. </el-table-column>
  1417. <el-table-column align="center" prop="eLength" label="长度" width="120">
  1418. </el-table-column>
  1419. <el-table-column
  1420. align="center"
  1421. prop="eAllowDeviation"
  1422. label="允许偏差值"
  1423. >
  1424. </el-table-column>
  1425. <el-table-column
  1426. align="center"
  1427. prop="eInspectionMethod"
  1428. label="检查方法和频率"
  1429. >
  1430. </el-table-column>
  1431. </el-table>
  1432. <span slot="footer" class="dialog-footer">
  1433. <el-button @click="importVisible = false">取 消</el-button>
  1434. <el-button type="primary" @click="importHandle">确 定</el-button>
  1435. </span>
  1436. </el-dialog>
  1437. <!-- 预览元素 -->
  1438. <el-dialog
  1439. :title="(curEleTable.tableName ? curEleTable.tableName : '') + ''"
  1440. :visible.sync="editEleVisible"
  1441. width="80%"
  1442. append-to-body
  1443. :close-on-click-modal="false"
  1444. >
  1445. <!-- <p class="font-c-warning">编辑元素信息(请谨慎操作)</p> -->
  1446. <el-table :data="editEleList" border style="width: 100%" height="400px">
  1447. <el-table-column
  1448. align="center"
  1449. type="index"
  1450. width="50"
  1451. ></el-table-column>
  1452. <el-table-column align="center" prop="eName" label="字段信息">
  1453. </el-table-column>
  1454. <el-table-column
  1455. align="center"
  1456. prop="eType"
  1457. label="数据类型"
  1458. width="120"
  1459. :formatter="eTypeFormatter"
  1460. >
  1461. </el-table-column>
  1462. <el-table-column align="center" prop="eLength" label="长度" width="120">
  1463. </el-table-column>
  1464. <el-table-column
  1465. align="center"
  1466. prop="eAllowDeviation"
  1467. label="允许偏差值"
  1468. >
  1469. </el-table-column>
  1470. <el-table-column
  1471. align="center"
  1472. prop="eInspectionMethod"
  1473. label="检查方法和频率"
  1474. >
  1475. </el-table-column>
  1476. </el-table>
  1477. <span slot="footer" class="dialog-footer">
  1478. <el-button @click="editEleVisible = false">取 消</el-button>
  1479. <!-- <el-button
  1480. type="primary"
  1481. @click="saveEles"
  1482. >确 定</el-button> -->
  1483. </span>
  1484. </el-dialog>
  1485. <!-- 元素公式 -->
  1486. <el-dialog
  1487. :title="
  1488. (curEleTable.tableName ? curEleTable.tableName : '') + ' 元素公式'
  1489. "
  1490. :visible.sync="editEleFormulaVisible"
  1491. width="800px"
  1492. append-to-body
  1493. :close-on-click-modal="false"
  1494. >
  1495. <div class="flex mg-b-10">
  1496. <el-input
  1497. v-model="formulaInput"
  1498. placeholder="请输入名称"
  1499. size="samll"
  1500. clearable
  1501. @clear="searchFormulaName"
  1502. ></el-input>
  1503. <el-button type="info" class="mg-l-10" @click="searchFormulaName"
  1504. >搜索
  1505. </el-button>
  1506. </div>
  1507. <el-table
  1508. :data="editEleListFilter"
  1509. border
  1510. style="width: 100%"
  1511. height="400px"
  1512. >
  1513. <el-table-column align="center" prop="eName" label="字段信息">
  1514. </el-table-column>
  1515. <el-table-column align="center" label="操作" width="200">
  1516. <template slot-scope="scope">
  1517. <el-link
  1518. :type="scope.row.globalFormula == 1 ? 'warning' : 'primary'"
  1519. @click="toFormulaEdit(scope.row, 10)"
  1520. >全局公式
  1521. </el-link>
  1522. <el-link
  1523. v-show="scope.row.hasPartFormula"
  1524. class="mg-l-10"
  1525. :type="scope.row.isSaveFormula == 1 ? 'warning' : 'primary'"
  1526. @click="toFormulaEdit(scope.row, 20)"
  1527. >节点公式
  1528. </el-link>
  1529. <!-- <el-link
  1530. class="mg-l-10"
  1531. type="danger"
  1532. @click="delEleRowHandle(scope.$index,editEleListFilter)"
  1533. >删除</el-link> -->
  1534. </template>
  1535. </el-table-column>
  1536. </el-table>
  1537. </el-dialog>
  1538. <!-- 导入划分 -->
  1539. <el-dialog
  1540. title="导入划分"
  1541. :visible.sync="importTemplateVisible"
  1542. width="800px"
  1543. append-to-body
  1544. :close-on-click-modal="false"
  1545. >
  1546. <div v-loading="importLoading">
  1547. <div>
  1548. <el-link type="primary" @click="handleDownload">下载导入模版</el-link>
  1549. </div>
  1550. <div class="mg-t-20">
  1551. <el-button type="primary" @click="fileClick">选择文件</el-button>
  1552. <span v-if="upFile" class="mg-l-20">{{ upFile.name }}</span>
  1553. <input
  1554. @change="fileChange"
  1555. type="file"
  1556. hidden
  1557. ref="file"
  1558. accept=".xls, .xlsx"
  1559. />
  1560. </div>
  1561. <div v-if="!upFile">当前还未选择文件,请选择需要导入的文件</div>
  1562. </div>
  1563. <span slot="footer" class="dialog-footer">
  1564. <el-button @click="importTemplateVisible = false">取 消</el-button>
  1565. <el-button
  1566. type="primary"
  1567. @click="importTemplateHandle"
  1568. :loading="importLoading"
  1569. >导 入</el-button
  1570. >
  1571. </span>
  1572. </el-dialog>
  1573. <!-- 节点参数 -->
  1574. <el-dialog
  1575. title="节点参数"
  1576. :visible.sync="nodeInfoVisible"
  1577. width="800px"
  1578. append-to-body
  1579. class="jiedian"
  1580. :close-on-click-modal="false"
  1581. :show-close="false"
  1582. @close="closenodeInfoVisible"
  1583. >
  1584. <div>
  1585. <el-button
  1586. type="text"
  1587. icon="el-icon-s-operation"
  1588. class="right-btn"
  1589. @click="setNodeParameters()"
  1590. ></el-button>
  1591. <div class="flexEnd">
  1592. <i
  1593. class="el-icon-circle-plus marbottom10"
  1594. @click="addNodeInfoTable()"
  1595. style="font-size: 24px; color: rgb(37, 193, 99); cursor: pointer"
  1596. ></i>
  1597. <i
  1598. class="el-icon-refresh-right marbottom10"
  1599. @click="refreshnfoTable()"
  1600. style="font-size: 24px; color: rgb(37, 193, 99); cursor: pointer"
  1601. ></i>
  1602. </div>
  1603. <el-table
  1604. :data="nodeInfoTable"
  1605. border
  1606. style="width: 100%"
  1607. height="400"
  1608. v-loading="nodeInfoTableLoad"
  1609. >
  1610. <el-table-column align="center" prop="name" label="参数名称">
  1611. <template slot-scope="scope">
  1612. <el-select
  1613. v-model="scope.row.k"
  1614. placeholder="请选择"
  1615. class="w-100p"
  1616. >
  1617. <el-option
  1618. v-for="item in namelist"
  1619. :key="item.k"
  1620. :label="item.name"
  1621. :value="item.k"
  1622. ></el-option>
  1623. </el-select>
  1624. </template>
  1625. </el-table-column>
  1626. <el-table-column align="center" prop="value" label="参数值设置">
  1627. <template slot-scope="scope">
  1628. <el-input v-model="scope.row.v"></el-input>
  1629. </template>
  1630. </el-table-column>
  1631. <el-table-column align="center" prop="describe" label="描述">
  1632. <template slot-scope="scope">
  1633. <el-input v-model="scope.row.remark"></el-input>
  1634. </template>
  1635. </el-table-column>
  1636. <el-table-column label="操作" width="120" align="center">
  1637. <template slot-scope="scope">
  1638. <el-button
  1639. type="text"
  1640. size="small"
  1641. class="text-icon-primary"
  1642. @click="linkEle(scope.row)"
  1643. >关联元素
  1644. </el-button>
  1645. <el-button
  1646. type="text"
  1647. size="small"
  1648. class="text-icon-danger"
  1649. @click="delNodeInfoss(scope.$index, scope.row)"
  1650. >删除
  1651. </el-button>
  1652. </template>
  1653. </el-table-column>
  1654. </el-table>
  1655. </div>
  1656. <span slot="footer" class="dialog-footer">
  1657. <el-button @click="nodeInfoVisible = false">取 消</el-button>
  1658. <el-button
  1659. type="primary"
  1660. @click="nodeInfoSave()"
  1661. :loading="nodeInfoSaveload"
  1662. >保 存</el-button
  1663. >
  1664. </span>
  1665. </el-dialog>
  1666. <!-- 设置参数名称 -->
  1667. <el-dialog
  1668. title="设置参数名称"
  1669. :visible.sync="infoNameVisible"
  1670. width="800px"
  1671. append-to-body
  1672. class="jiedian"
  1673. :close-on-click-modal="false"
  1674. >
  1675. <div>
  1676. <div class="flexEnd">
  1677. <i
  1678. class="el-icon-circle-plus marbottom10"
  1679. @click="setParameterName()"
  1680. style="font-size: 24px; color: rgb(37, 193, 99); cursor: pointer"
  1681. ></i>
  1682. </div>
  1683. <el-table :data="namelists" border style="width: 100%" height="400">
  1684. <el-table-column align="center" prop="name" label="参数名称">
  1685. <template slot-scope="scope">
  1686. <el-input v-model="scope.row.name"></el-input>
  1687. </template>
  1688. </el-table-column>
  1689. <el-table-column align="center" prop="key" label="参数值KEY">
  1690. <template slot-scope="scope">
  1691. <el-input v-model="scope.row.k"></el-input>
  1692. </template>
  1693. </el-table-column>
  1694. <el-table-column align="center" prop="describe" label="描述">
  1695. <template slot-scope="scope">
  1696. <el-input v-model="scope.row.remark"></el-input>
  1697. </template>
  1698. </el-table-column>
  1699. <el-table-column label="操作" width="120" align="center">
  1700. <template slot-scope="scope">
  1701. <el-button
  1702. type="text"
  1703. size="small"
  1704. class="text-icon-danger"
  1705. @click="delNodeInfo(scope.$index, scope.row)"
  1706. >删除
  1707. </el-button>
  1708. </template>
  1709. </el-table-column>
  1710. </el-table>
  1711. </div>
  1712. <span slot="footer" class="dialog-footer">
  1713. <el-button @click="addParameterName()">保 存</el-button>
  1714. <el-button @click="closeParameter()">关 闭</el-button>
  1715. </span>
  1716. </el-dialog>
  1717. <el-dialog
  1718. title="别名"
  1719. :visible.sync="aliasVisible"
  1720. width="600px"
  1721. append-to-body
  1722. :close-on-click-modal="false"
  1723. >
  1724. <div>
  1725. <div class="flex">
  1726. <el-input
  1727. v-model="aliasInput"
  1728. placeholder="请输入节点别名"
  1729. ></el-input>
  1730. <el-button class="mg-l-20" type="primary" @click="addAlias"
  1731. >添加
  1732. </el-button>
  1733. </div>
  1734. <div class="flex" style="flex-wrap: wrap">
  1735. <div class="mg-t-10" v-for="(tag, index) in aliasArr" :key="index">
  1736. <el-tag closable @close="delAlias(index)">
  1737. {{ tag }}
  1738. </el-tag>
  1739. <span v-if="index != aliasArr.length - 1">、</span>
  1740. </div>
  1741. </div>
  1742. </div>
  1743. <span slot="footer" class="dialog-footer">
  1744. <el-button @click="aliasVisible = false">取 消</el-button>
  1745. <el-button type="primary" @click="saveAliasHandle">确 定</el-button>
  1746. </span>
  1747. </el-dialog>
  1748. <!-- 节点公式 -->
  1749. <el-dialog
  1750. :title="
  1751. (curEleTable.tableName ? curEleTable.tableName : '') +
  1752. ' 元素公式(元素库)'
  1753. "
  1754. :visible.sync="formulaCompVisible"
  1755. fullscreen
  1756. append-to-body
  1757. class="full-dialog"
  1758. @close="closeformulaComp"
  1759. >
  1760. <FormulaEdit
  1761. :istableType="!isNodeType"
  1762. :fromcurNode="curTreeData"
  1763. :projectid="projectid"
  1764. :wbsid="id"
  1765. :nodeid="curTreeData.id"
  1766. :eleid="formulaCurRow.id"
  1767. :globaltype="formulaCurRow.globaltype"
  1768. :iswbstype="0"
  1769. @hideDialog="formulaCompVisible = false"
  1770. v-if="formulaCompVisible"
  1771. ></FormulaEdit>
  1772. </el-dialog>
  1773. <!-- 全局公式 -->
  1774. <el-dialog
  1775. title=""
  1776. :visible.sync="formulaCompVisible1"
  1777. fullscreen
  1778. append-to-body
  1779. class="full-dialog"
  1780. @close="closeformulaComp1"
  1781. >
  1782. <FormulaEditone
  1783. :wbsid="id"
  1784. :nodeid="curTreeData.id"
  1785. :eleid="formulaCurRow.id"
  1786. :elementType="formulaCurRow.elementType"
  1787. :projectid="projectid"
  1788. :tableType="istableType"
  1789. :globaltype="formulaCurRow.globaltype"
  1790. @hideDialog="formulaCompVisible1 = false"
  1791. :fromcurNode="curEleTable"
  1792. :iswbstype="0"
  1793. v-if="formulaCompVisible1"
  1794. >
  1795. </FormulaEditone>
  1796. </el-dialog>
  1797. <!-- 编辑元素 -->
  1798. <el-dialog
  1799. title=" "
  1800. :visible.sync="editElementVisible"
  1801. fullscreen
  1802. append-to-body
  1803. class="full-dialog"
  1804. >
  1805. <EditElement
  1806. :editElementQuery="curTreeData"
  1807. :pkeyId="editElementQuery.pkeyId"
  1808. :excelId="editElementQuery.excelId"
  1809. :id="editElementQuery.id"
  1810. :initTableName="editElementQuery.initTableName"
  1811. :pid="editElementQuery.pid"
  1812. :wbsid="editElementQuery.wbsid"
  1813. :initTableId="editElementQuery.initTableId"
  1814. :nodeid="editElementQuery.nodeid"
  1815. @hideDialog="hideEditElementVisible"
  1816. @adjustExcel="adjustExcel"
  1817. v-if="editElementVisible"
  1818. ></EditElement>
  1819. </el-dialog>
  1820. <el-dialog
  1821. title="节点参数设置-关联元素"
  1822. :visible.sync="linkEleVisible"
  1823. width="800px"
  1824. append-to-body
  1825. class="jiedian"
  1826. :close-on-click-modal="false"
  1827. >
  1828. <div>
  1829. <el-table
  1830. :data="linkEleTableList"
  1831. border
  1832. style="width: 100%"
  1833. height="400"
  1834. >
  1835. <el-table-column align="center" prop="tableName" label="元素表名">
  1836. </el-table-column>
  1837. <el-table-column
  1838. align="center"
  1839. prop="elementName"
  1840. label="关联元素字段"
  1841. >
  1842. </el-table-column>
  1843. <el-table-column label="操作" width="160" align="center">
  1844. <template slot-scope="scope">
  1845. <el-button
  1846. v-if="!scope.row.mappingId"
  1847. type="text"
  1848. size="small"
  1849. class="text-icon-primary"
  1850. @click="tolinkEle(scope.row)"
  1851. >选择元素
  1852. </el-button>
  1853. <el-button
  1854. v-if="!!scope.row.mappingId"
  1855. type="text"
  1856. size="small"
  1857. class="text-icon-danger"
  1858. @click="delLink(scope.row)"
  1859. >删除关联
  1860. </el-button>
  1861. </template>
  1862. </el-table-column>
  1863. </el-table>
  1864. </div>
  1865. <span slot="footer" class="dialog-footer">
  1866. <!-- <el-button @click="saveLinks">保 存</el-button> -->
  1867. <el-button @click="linkEleVisible = false">关 闭</el-button>
  1868. </span>
  1869. </el-dialog>
  1870. <el-dialog
  1871. title="选择关联元素"
  1872. :visible.sync="linkCheckVisible"
  1873. width="600px"
  1874. append-to-body
  1875. class="jiedian"
  1876. :close-on-click-modal="false"
  1877. >
  1878. <div>
  1879. <div class="flex mg-b-20">
  1880. <el-input
  1881. v-model="linkEleKey"
  1882. placeholder="请输入元素关键字搜索"
  1883. ></el-input>
  1884. <el-link class="mg-l-20" :underline="false">
  1885. <i
  1886. class="el-icon-search"
  1887. style="font-size: 20px"
  1888. @click="searchEle"
  1889. ></i>
  1890. </el-link>
  1891. </div>
  1892. <el-table :data="linkEleList" border style="width: 100%" height="400">
  1893. <el-table-column align="center" prop="eName" label="元素名">
  1894. </el-table-column>
  1895. <el-table-column label="操作" width="55">
  1896. <template slot-scope="scope">
  1897. <el-checkbox
  1898. v-model="scope.row.checked"
  1899. @change="(value) => linkEleCheck(value, scope.$index)"
  1900. ></el-checkbox>
  1901. </template>
  1902. </el-table-column>
  1903. </el-table>
  1904. </div>
  1905. <span slot="footer" class="dialog-footer">
  1906. <el-button @click="saveLinkEle">保 存</el-button>
  1907. <el-button @click="linkCheckVisible = false">关 闭</el-button>
  1908. </span>
  1909. </el-dialog>
  1910. <!-- 关联节点 -->
  1911. <el-dialog
  1912. title="关联节点"
  1913. :visible="isLinkNodes"
  1914. append-to-body
  1915. center
  1916. destroy-on-close
  1917. custom-class="hc-link-nodes-dialog"
  1918. @close="linkNodesClose"
  1919. >
  1920. <el-tree
  1921. ref="tree2"
  1922. class="hc-link-nodes-tree"
  1923. lazy
  1924. :load="loadNode"
  1925. :props="defaultProps"
  1926. show-checkbox
  1927. check-strictly
  1928. :default-checked-keys="checkedLinkNodesKeys"
  1929. highlight-current
  1930. node-key="primaryKeyId"
  1931. />
  1932. <span slot="footer" class="dialog-footer">
  1933. <el-button @click="linkNodesClose">取 消</el-button>
  1934. <el-button
  1935. type="primary"
  1936. @click="linkNodesSave"
  1937. v-loading="linkNodesLoad"
  1938. >确 定</el-button
  1939. >
  1940. </span>
  1941. </el-dialog>
  1942. <!-- 编辑 -->
  1943. <el-dialog
  1944. :title="(curEleTable.tableName ? curEleTable.tableName : '') + ''"
  1945. :visible.sync="editDialogShow"
  1946. width="80%"
  1947. append-to-body
  1948. :close-on-click-modal="false"
  1949. >
  1950. <p class="font-c-warning">编辑元素信息(请谨慎操作)</p>
  1951. <div style="display: flex; margin-bottom: 10px">
  1952. <el-input
  1953. placeholder="请输入你想编辑的元素名称"
  1954. v-model="searchinput"
  1955. :size="size"
  1956. clearable
  1957. @clear="clearsearchinput"
  1958. >
  1959. </el-input>
  1960. <el-button
  1961. type="primary"
  1962. icon="el-icon-search"
  1963. size="small"
  1964. @click="searchinputChange"
  1965. >搜索</el-button
  1966. >
  1967. </div>
  1968. <el-table
  1969. :data="editTable"
  1970. border
  1971. style="width: 100%"
  1972. height="400px"
  1973. v-loading="editEleTableloading"
  1974. >
  1975. <el-table-column
  1976. align="center"
  1977. type="index"
  1978. width="50"
  1979. ></el-table-column>
  1980. <el-table-column align="center" prop="eName" label="元素名称">
  1981. <template slot="header">
  1982. <i class="required"></i>
  1983. <span>元素名称</span>
  1984. </template>
  1985. <template slot-scope="scope">
  1986. <el-input
  1987. v-model="scope.row.eName"
  1988. size="small"
  1989. placeholder="请输入内容"
  1990. ></el-input>
  1991. </template>
  1992. </el-table-column>
  1993. <el-table-column align="center" prop="dynamicDict" label="动态字典">
  1994. <template slot="header">
  1995. <span>动态字典</span>
  1996. </template>
  1997. <template slot-scope="scope">
  1998. <el-select
  1999. v-model="scope.row.dynamicDict"
  2000. filterable
  2001. size="small"
  2002. placeholder="请选择"
  2003. >
  2004. <el-option
  2005. v-for="item in dynamicDictList"
  2006. :key="item.id"
  2007. :label="item.dictValue"
  2008. :value="item.dictKey"
  2009. ></el-option>
  2010. </el-select>
  2011. </template>
  2012. </el-table-column>
  2013. </el-table>
  2014. <span slot="footer" class="dialog-footer">
  2015. <el-button @click="editDialogShow = false">取 消</el-button>
  2016. <el-button type="primary" @click="saveEles" :loading="saveLoading"
  2017. >确 定</el-button
  2018. >
  2019. </span>
  2020. </el-dialog>
  2021. <!-- 文件题名全局配置 -->
  2022. <el-dialog
  2023. title="文件题名全局配置"
  2024. :visible.sync="fileTitleVisible"
  2025. width="60%"
  2026. append-to-body
  2027. :close-on-click-modal="false"
  2028. >
  2029. <div class="flexEnd">
  2030. <i
  2031. class="el-icon-circle-plus "
  2032. style="font-size: 24px; color: rgb(37, 193, 99); cursor: pointer"
  2033. @click="addRow"
  2034. ></i>
  2035. <i
  2036. class="el-icon-refresh "
  2037. style="font-size: 24px; color: rgb(37, 193, 99); cursor: pointer"
  2038. @click="refreshRow"
  2039. ></i>
  2040. </div>
  2041. <el-table
  2042. :data="fileTableData"
  2043. style="width: 100%;height: 500px;"
  2044. align="center"
  2045. v-loading="fileTableLoading"
  2046. >
  2047. <el-table-column
  2048. label="文件题名规则"
  2049. prop="roleNameVal">
  2050. <template #default="scope">
  2051. <el-select
  2052. :id="selectDiv"
  2053. v-if="scope.row.isEdit"
  2054. v-model="scope.row.ruleName"
  2055. multiple
  2056. placeholder="请选择"
  2057. style="width: 240px"
  2058. @change="changeRoleName($event,scope.row,scope.index)"
  2059. >
  2060. <el-option
  2061. v-for="item in nodeTypelist1"
  2062. :key="item.id"
  2063. :label="item.dictValue"
  2064. :value="item.dictKey"
  2065. ></el-option>
  2066. </el-select>
  2067. <span v-else>
  2068. <el-tag v-for="(item,index) in scope.row.roleNameVal" style="margin-right: 2px;" :key="index">{{ item }}</el-tag>
  2069. </span>
  2070. </template>
  2071. </el-table-column>
  2072. <el-table-column
  2073. label="文件题名范围"
  2074. prop="ruleSizeVal"
  2075. >
  2076. <template #default="scope">
  2077. <div v-if="isShowSize">
  2078. <span v-if="scope.row.type===1" :class="{'orange': scope.row.isEdit}" @click="chooseFile(scope.$index, scope.row)">所有节点</span>
  2079. <div v-else>
  2080. <el-link type="warning" @click="chooseFile(scope.$index, scope.row)" v-if="!scope.row.ruleSizeVal">选择题名范围</el-link>
  2081. <span v-else @click="chooseFile(scope.$index, scope.row)" :class="{'orange': scope.row.isEdit}">{{ scope.row.ruleSizeVal }}</span>
  2082. </div>
  2083. </div>
  2084. </template>
  2085. </el-table-column>
  2086. <el-table-column
  2087. label="操作"
  2088. width="150px"
  2089. >
  2090. <template slot-scope="scope">
  2091. <el-link
  2092. v-if="!scope.row.isEdit"
  2093. type="primary"
  2094. class="mg-r-10"
  2095. @click="editRow(scope.$index, scope.row)">编辑</el-link>
  2096. <el-link
  2097. v-else
  2098. type="primary"
  2099. class="mg-r-10"
  2100. @click="saveRow(scope.$index, scope.row)">保存</el-link>
  2101. <el-link
  2102. @click="delRow(scope.$index, scope.row)"
  2103. type="danger"
  2104. >删除</el-link>
  2105. </template>
  2106. </el-table-column>
  2107. </el-table>
  2108. <template #footer>
  2109. <div class="dialog-footer">
  2110. <el-button @click="fileTitleVisible=false">取消</el-button>
  2111. <el-button type="primary" @click="batchsaveFileSize" :loading="saveFileLoading">
  2112. 保存
  2113. </el-button>
  2114. </div>
  2115. </template>
  2116. </el-dialog>
  2117. <!-- 选择题名范围i -->
  2118. <el-dialog
  2119. :visible.sync="chooseFileVisible"
  2120. title="选择题名范围"
  2121. width="500"
  2122. align-center
  2123. append-to-body
  2124. >
  2125. <el-form label-position="left" label-width="80px" :model="fileTitleModel" :rules="fileTitleRules" ref="fileTitleRef">
  2126. <el-form-item label="题名范围" prop="type">
  2127. <el-radio v-model="fileTitleModel.type" :label="1" @input="changeRadio">所有节点</el-radio><br/>
  2128. <el-radio v-model="fileTitleModel.type" :label="2" @input="changeRadio">部分节点</el-radio>
  2129. <div v-if="fileTitleModel.type==2" class="warning-text">请选择节点</div>
  2130. <el-scrollbar class="h-100p" style="height: 400px;" v-if="fileTitleModel.type==2" v-loading="fileTreeLoading">
  2131. <el-tree
  2132. :data="fileTreeData"
  2133. :props="filedefaultProps"
  2134. :expand-on-click-node="false"
  2135. highlight-current
  2136. node-key="id"
  2137. show-checkbox
  2138. @check="checkFileSize"
  2139. :default-checked-keys="deCheckTreeKeys"
  2140. >
  2141. </el-tree>
  2142. </el-scrollbar>
  2143. </el-form-item>
  2144. </el-form>
  2145. <template #footer>
  2146. <div class="dialog-footer">
  2147. <el-button @click="chooseFileVisible=false">取消</el-button>
  2148. <el-button type="primary" @click="saveFileSize">
  2149. 保存
  2150. </el-button>
  2151. </div>
  2152. </template>
  2153. </el-dialog>
  2154. <!-- 项目数据同步 -->
  2155. <el-dialog
  2156. :visible.sync="proSyncTag"
  2157. width="80%"
  2158. append-to-body
  2159. @close=closeProSyncTag
  2160. >
  2161. <span slot="title" class="dialog-title">
  2162. <div class="dialog-title-text">项目数据同步</div>
  2163. <span class="dialog-title-tip">重新同步项目下所有配置,不保留独有配置,慎重同步!!!</span>
  2164. </span>
  2165. <div class="sync-container">
  2166. <el-card class="box-card-1" :style="{ width: isShowLeft ? '40%' : '0%' }">
  2167. <el-scrollbar style="height: 100%;">
  2168. <div v-loading="treeLoad">
  2169. <el-tree
  2170. class="filter-tree"
  2171. lazy
  2172. :load="loadNode"
  2173. show-checkbox
  2174. :props="defaultProps"
  2175. :expand-on-click-node="false"
  2176. highlight-current
  2177. node-key="primaryKeyId"
  2178. @check="handleCheckChange"
  2179. @check-change="handleCheckChange1"
  2180. ref="syncProTree"
  2181. >
  2182. </el-tree>
  2183. </div>
  2184. </el-scrollbar>
  2185. </el-card>
  2186. <el-card class="box-card-2">
  2187. <el-form ref="syncForm" :model="syncForm" label-position="top">
  2188. <el-form-item label="同步范围" v-if="!isShowTable">
  2189. <el-radio-group v-model="syncForm.range">
  2190. <el-radio
  2191. v-for="item in rangeOptions"
  2192. :key="item.id"
  2193. :label="item.dictKey"
  2194. >{{ item.dictValue}}</el-radio>
  2195. </el-radio-group>
  2196. </el-form-item>
  2197. <el-form-item label="同步类型" prop="type">
  2198. <el-checkbox :indeterminate="isIndeterminate" v-model="checkAll" @change="handleCheckAllChange">全选</el-checkbox>
  2199. <div style="margin: 15px 0;"></div>
  2200. <el-checkbox-group v-model="syncForm.type" @change="handleCheckedTypeChange">
  2201. <el-checkbox v-for="item in typeOptions" :label="item.dictKey" :key="item.id">{{ item.dictValue}}</el-checkbox>
  2202. </el-checkbox-group>
  2203. </el-form-item>
  2204. <!-- <el-form-item label="选择同步范围(节点状态)" prop="contractRange" v-if="syncForm.range==='2'">
  2205. <el-checkbox-group v-model="syncForm.contractRange">
  2206. <el-checkbox label="全选" name="1"></el-checkbox>
  2207. <el-checkbox v-for="(item,index) in checkIdList" :label="item.dictKey" :key="item.id">{{ item.dictValue}}</el-checkbox>
  2208. </el-checkbox-group>
  2209. </el-form-item> -->
  2210. <el-form-item label="选择同步范围(节点状态)" prop="contractRange" v-if="syncForm.range==='2'">
  2211. <el-checkbox :indeterminate="isIndeterminate1" v-model="checkAll1" @change="handleCheckAllChange1">全选</el-checkbox>
  2212. <div style="margin: 15px 0;"></div>
  2213. <el-checkbox-group v-model="syncForm.contractRange" @change="handleCheckedTypeChange1">
  2214. <el-checkbox v-for="item in checkIdList" :label="item.dictKey" :key="item.id">{{ item.dictValue}}</el-checkbox>
  2215. </el-checkbox-group>
  2216. </el-form-item>
  2217. <el-form-item label="选择同步源" prop="templateId" v-else>
  2218. <el-select v-model="syncForm.templateId" placeholder="请选择同步源" style="width: 100%;" size="small" @change="changeTemplateId">
  2219. <el-option
  2220. v-for="item in templateIdList"
  2221. :key="item.id"
  2222. :label="item.name"
  2223. :value="item.id">
  2224. </el-option>
  2225. </el-select>
  2226. </el-form-item>
  2227. </el-form>
  2228. <div class="table-box" v-if="isShowTable">
  2229. <h4 style="margin-left: 4px;">表单预览</h4>
  2230. <el-table
  2231. size="small"
  2232. ref="proTable"
  2233. :data="preTableData"
  2234. stripe
  2235. style="width: 100%"
  2236. max-height="300"
  2237. @selection-change="handleSelectionChange"
  2238. >
  2239. <el-table-column
  2240. type="selection"
  2241. width="55">
  2242. </el-table-column>
  2243. <el-table-column
  2244. prop="tableName"
  2245. label="表单名称"
  2246. width="180">
  2247. </el-table-column>
  2248. <el-table-column
  2249. prop="tableType"
  2250. :formatter="formatTableType"
  2251. label="表单类型"
  2252. width="180">
  2253. </el-table-column>
  2254. <el-table-column
  2255. prop="tableOwner"
  2256. :formatter="formatOwner"
  2257. label="所属方">
  2258. </el-table-column>
  2259. </el-table>
  2260. </div>
  2261. </el-card>
  2262. </div>
  2263. <span slot="footer" class="dialog-footer">
  2264. <el-button @click="closeProSyncTag">取 消</el-button>
  2265. <el-button type="primary" @click="saveProTag" :loading="saveProTagLoading">确 定</el-button>
  2266. </span>
  2267. </el-dialog>
  2268. <!-- 同步队列 -->
  2269. <el-dialog
  2270. title="同步队列"
  2271. :visible.sync="syncListDialog"
  2272. width="30%"
  2273. append-to-body
  2274. :close-on-click-modal="false"
  2275. @close="closeSyncListTag"
  2276. >
  2277. <div class="content-box" v-loading="refreshLoading||refreshLoading1">
  2278. <el-image
  2279. style="width: 100px; height: 100px"
  2280. :src="require('@/assets/loader.svg')"
  2281. fit="contain"></el-image>
  2282. <div class="mt-14">同步中</div>
  2283. <div class="mt-14">
  2284. 同步数量{{ syncListData.nodeNum }} 剩余数量{{ syncListData.nodeNumEnd }}
  2285. </div>
  2286. <div class="mt-14">
  2287. <el-button type="primary" @click="syncListDialog=false">好的,我已知晓</el-button>
  2288. </div>
  2289. <div class="mt-14">
  2290. <el-link type="primary" @click="refreshData" v-loading="refreshLoading" v-if="!isAdd">刷新数据</el-link>
  2291. <el-link type="primary" @click="refreshData1" v-loading="refreshLoading1" v-else>刷新数据</el-link>
  2292. </div>
  2293. </div>
  2294. </el-dialog>
  2295. <!-- 同步表单其他配置 -->
  2296. <el-dialog
  2297. title="同步表单其他配置"
  2298. :visible.sync="syncTableDialog"
  2299. width="70%"
  2300. append-to-body
  2301. :close-on-click-modal="false"
  2302. >
  2303. <div class="sync-container">
  2304. <el-card class="box-card-1" :style="{ width: isShowLeft ? '40%' : '0%' }">
  2305. <el-scrollbar style="height: 100%;">
  2306. <div >
  2307. <el-tree
  2308. class="filter-tree"
  2309. lazy
  2310. :load="loadNode"
  2311. @node-click="handleNodeClick"
  2312. :default-expanded-keys="defaultExpandedKeys"
  2313. :props="defaultProps"
  2314. :expand-on-click-node="false"
  2315. highlight-current
  2316. node-key="primaryKeyId"
  2317. >
  2318. </el-tree>
  2319. </div>
  2320. </el-scrollbar>
  2321. </el-card>
  2322. <el-card class="box-card-2">
  2323. <div class="table-box">
  2324. <h4 style="margin-left: 4px;">表单预览</h4>
  2325. <el-table
  2326. size="small"
  2327. ref="proTable1"
  2328. :data="preTableData1"
  2329. stripe
  2330. style="width: 100%"
  2331. max-height="300"
  2332. @selection-change="handleSelectionChange1"
  2333. >
  2334. <el-table-column
  2335. type="selection"
  2336. width="55">
  2337. </el-table-column>
  2338. <el-table-column
  2339. prop="tableName"
  2340. label="表单名称"
  2341. width="180">
  2342. </el-table-column>
  2343. <el-table-column
  2344. prop="tableType"
  2345. :formatter="formatTableType"
  2346. label="表单类型"
  2347. width="180">
  2348. </el-table-column>
  2349. <el-table-column
  2350. prop="tableOwner"
  2351. :formatter="formatOwner"
  2352. label="所属方">
  2353. </el-table-column>
  2354. </el-table>
  2355. </div>
  2356. </el-card>
  2357. </div>
  2358. <span slot="footer" class="dialog-footer">
  2359. <el-button @click="syncTableDialog = false">取 消</el-button>
  2360. <el-button type="primary" @click="saveTableSync" :loading="saveTableSyncLoad">确 定</el-button>
  2361. </span>
  2362. </el-dialog>
  2363. <!-- 编号设置弹窗 -->
  2364. <CodeSet ref="codeSetRef" ></CodeSet>
  2365. <!-- 筛选弹窗 -->
  2366. <el-dialog
  2367. title="筛选"
  2368. :visible.sync="filterDialog"
  2369. width="25%"
  2370. append-to-body
  2371. :close-on-click-modal="false"
  2372. @close="handleCancel"
  2373. class="project-dialog"
  2374. >
  2375. <div class="filter-dialog">
  2376. <el-form ref="filterForm" :model="filterForm" label-width="120px">
  2377. <el-form-item label="节点类型">
  2378. <el-select v-model="filterForm.nodeType" placeholder="请选择节点类型" clearable>
  2379. <el-option
  2380. v-for="item in nodeTypelist"
  2381. :key="item.dictKey"
  2382. :label="item.dictValue"
  2383. :value="item.dictKey"
  2384. />
  2385. </el-select>
  2386. </el-form-item>
  2387. <template v-if="wbsType!==2">
  2388. <el-form-item label="内业资料类型">
  2389. <el-select v-model="filterForm.majorDataType" placeholder="请选择内业资料类型" clearable>
  2390. <el-option
  2391. v-for="item in majorDataTypeList"
  2392. :key="item.dictKey"
  2393. :label="item.dictValue"
  2394. :value="item.dictKey"
  2395. />
  2396. </el-select>
  2397. </el-form-item>
  2398. <el-form-item label="标准分类">
  2399. <el-select v-model="filterForm.className" placeholder="请选择标准分类" clearable>
  2400. <el-option
  2401. v-for="item in standardTypeOptions"
  2402. :key="item.value"
  2403. :label="item.dictValue"
  2404. :value="item.dictKey"
  2405. />
  2406. </el-select>
  2407. </el-form-item>
  2408. <el-form-item label="单元名称">
  2409. <el-select v-model="filterForm.unitName" placeholder="请选择单元名称" clearable>
  2410. <el-option
  2411. v-for="item in unitOptions"
  2412. :key="item.value"
  2413. :label="item.label"
  2414. :value="item.value"
  2415. />
  2416. </el-select>
  2417. </el-form-item>
  2418. <el-form-item
  2419. label="是否新增中隐藏"
  2420. >
  2421. <el-radio-group v-model="filterForm.isAddConceal" size="small">
  2422. <el-radio :label="1" border>是</el-radio>
  2423. <el-radio :label="0" border>否</el-radio>
  2424. </el-radio-group>
  2425. </el-form-item>
  2426. </template>
  2427. <template v-else>
  2428. <el-form-item label="参数掩码">
  2429. <el-input
  2430. v-model="filterForm.uniqueCode"
  2431. size="small"
  2432. placeholder="请输入内容"
  2433. ></el-input>
  2434. </el-form-item>
  2435. </template>
  2436. </el-form>
  2437. <div slot="footer" class="dialog-footer">
  2438. <el-button @click="handleCancel" size="small">取 消</el-button>
  2439. <el-button type="primary" @click="handleConfirm" size="small">筛 选</el-button>
  2440. </div>
  2441. </div>
  2442. </el-dialog>
  2443. </div>
  2444. </template>
  2445. <script>
  2446. import ManualSorting from "@/components/WbsTree/ManualSorting";
  2447. import dynamicExcel from "./treeTemplate/dynamicExcel.vue";
  2448. import FormulaEdit from "@/views/formula/edit.vue";
  2449. import FormulaEditone from "@/views/formula/edit1.vue";
  2450. import EditElement from "@/views/manager/projectinfo/editElement/editElement.vue";
  2451. import CodeSet from "./codeSet.vue";
  2452. import {
  2453. saveFormAndElement,
  2454. selectFormElements,
  2455. importWbsTree,
  2456. findWbsTreePrivateSameLevel,
  2457. wbsTreePrivateSort,
  2458. parameters,
  2459. saveOrUpdateBatch,
  2460. keymap,
  2461. updateBatchNodeTableInfo2,
  2462. updateStatus,
  2463. getParamElements,
  2464. specifiedParamElements,
  2465. delParamElements,
  2466. selectPrivateFormElements,
  2467. syncCurrentFormInProject,
  2468. getQueryValueByType,
  2469. getQueryValueByNodeType,
  2470. getTreeByType,
  2471. } from "@/api/manager/wbstree";
  2472. import {
  2473. saveElement,
  2474. remove as removeElement,
  2475. updateBatchElements,
  2476. getTemplate,
  2477. importWbsElement,
  2478. } from "@/api/manager/wbsformelement";
  2479. import {
  2480. getLazytree,
  2481. getDetail,
  2482. update,
  2483. findNodeTableByCondition as selectByNodeTable,
  2484. removeTableByCondition as removeTableById,
  2485. removePrivateTreeNode,
  2486. wbsTreePrivateTableSort,
  2487. privateSubmitFullName,
  2488. syncNodeParam,
  2489. syncProjecteVisa,
  2490. syncNodeTable,
  2491. syncNodeinfo,
  2492. tabTypeLazyTree,
  2493. syncContractTabSort,
  2494. linkNodeTree,
  2495. getLinekNodeTreelist,getNameRule,getTitleRange,saveOrUpdateNameRule,deletedNameRule,delTabInfoAll,getGroupNodeTables
  2496. } from "@/api/manager/wbsprivate";
  2497. import { findProjectTree as getAlltree } from "@/api/manager/projectinfo";
  2498. import { refrehPram } from "@/api/manager/wbstree";
  2499. import { getList as getAttchFromOriginalName } from "@/api/resource/attach";
  2500. import { getDictionary, getChildList } from "@/api/system/dict";
  2501. import { mapGetters } from "vuex";
  2502. import {
  2503. getList,
  2504. tabLazytreeAll,
  2505. saveLinkTab,
  2506. getExcelHtml,
  2507. } from "@/api/exctab/excelmodel";
  2508. import { getStore, setStore } from "@/util/store";
  2509. import { getTempProject,addSync,getNodeStatus,getById } from "@/api/manager/ledger";
  2510. import { selectByNodeTable as findNodeTableByCondition1 } from "@/api/manager/wbstree";
  2511. import { getDictionaryBiz } from "@/api/other";
  2512. import tableSortByType from './tableSortByType'
  2513. export default {
  2514. data() {
  2515. var checkMajorDataType = (rule, value, callback) => {
  2516. //console.log(this.nodeDetail.nodeType)
  2517. //console.log(this.nodeDetail.majorDataType)
  2518. if (this.nodeDetail.nodeType == 6) {
  2519. if (!this.nodeDetail.majorDataType) {
  2520. callback(new Error("工序节点必须选择内业资料类型"));
  2521. }
  2522. }
  2523. callback();
  2524. };
  2525. return {
  2526. isNodeType:true,
  2527. filterByType: false,
  2528. isRestoringSelection: false,
  2529. expandedKeysType: [],
  2530. defaultExpandedKeysType: [],
  2531. currentNodeKey: null, // 保存当前选中的节点key
  2532. fromcurNode: {},
  2533. formDatass: [],
  2534. editElementFormTag: false,
  2535. editeditElementFormMFLoading: false,
  2536. jiedianId: "",
  2537. //#region
  2538. sortTag: false,
  2539. sortTag2: false,
  2540. sureSortload: false,
  2541. surePrivateSortload: false,
  2542. sort: [],
  2543. //#endregion
  2544. //#region 关联清表
  2545. loading: false,
  2546. GLExcel: false,
  2547. GLExcelFrom: {
  2548. id: "",
  2549. name: "",
  2550. search: "", //搜素框舒服的值
  2551. ids: "",
  2552. excelId: "",
  2553. initTableName: "",
  2554. initTableId: "",
  2555. },
  2556. GLExcelData: [], //
  2557. GLExcelProps: {
  2558. label: "name",
  2559. children: "children",
  2560. disabled: "hasChildren",
  2561. isLeaf: function (data) {
  2562. let tag = false;
  2563. if (!data.hasChildren) {
  2564. tag = true;
  2565. }
  2566. if (data.isExistForm == 1) {
  2567. tag = true;
  2568. }
  2569. return tag;
  2570. },
  2571. },
  2572. exceldata: [], //清表模板
  2573. GLExcelLoading: false,
  2574. //#endregion
  2575. //#region 调整表单
  2576. adjustmentExcel: "",
  2577. excelHtml: false,
  2578. //#endregion
  2579. //#region
  2580. id: "",
  2581. projectid: "",
  2582. filterText: "",
  2583. filterText1: "",
  2584. isShowTree1:true,
  2585. treeData: [],
  2586. searchType: "1",
  2587. isSearch: false,
  2588. searchTreeData: [],
  2589. searchtreeLoad: false,
  2590. treeLoad: false,
  2591. isShowTree: true,
  2592. menuShow: false,
  2593. defaultProps: {
  2594. children: "children",
  2595. label: "title",
  2596. isLeaf: function (data) {
  2597. //console.log(data, !data.hasChildren, data.isExistForm);
  2598. let tag = false;
  2599. if (!data.hasChildren) {
  2600. tag = true;
  2601. }
  2602. /*if (data.isExistForm == 1) {
  2603. tag = true;
  2604. }*/
  2605. if (data.nodeType >= 6 && data.nodeType <= 13) {
  2606. tag = true;
  2607. }
  2608. //中间交工。开工报告、质量评定)
  2609. if (
  2610. data.majorDataType == 1 ||
  2611. data.majorDataType == 2 ||
  2612. data.majorDataType == 3
  2613. ) {
  2614. tag = true;
  2615. }
  2616. return tag;
  2617. // return !data.hasChildren || (data.isExistForm == 1);
  2618. },
  2619. },
  2620. defaultPropsByType:{
  2621. children: 'children',
  2622. label: 'title',
  2623. isLeaf:function (data) {
  2624. return !data.hasChildren
  2625. }
  2626. },
  2627. leftType: 5,
  2628. curTreeData: {},
  2629. curTreeNode: {},
  2630. tableData: [],
  2631. nodeDetail: {},
  2632. formData: [],
  2633. editType: 1,
  2634. dialogVisible: false,
  2635. saveNodeLoading: false,
  2636. nodeTypelist1: [],
  2637. majorDataTypeList: [],
  2638. rules: {
  2639. nodeName: [
  2640. { required: true, message: "请输入节点名称", trigger: "blur" },
  2641. ],
  2642. nodeType: [
  2643. { required: true, message: "请选择节点类型", trigger: "change" },
  2644. ],
  2645. majorDataType: [{ validator: checkMajorDataType, trigger: "change" }],
  2646. isAddConceal: [
  2647. {
  2648. required: true,
  2649. message: "请选择是否新增中隐藏",
  2650. trigger: "change",
  2651. },
  2652. ],
  2653. },
  2654. eleVisible: false,
  2655. tableTypelist: [],
  2656. dataTypeList: [],
  2657. ownerTypeList: [],
  2658. eleForm: {
  2659. elementList: [],
  2660. },
  2661. eleRules: {
  2662. nodeName: [
  2663. { required: true, message: "请输入表名称", trigger: "blur" },
  2664. ],
  2665. tableType: [
  2666. { required: true, message: "请选择表类型", trigger: "change" },
  2667. ],
  2668. tableOwner: [
  2669. { required: true, message: "请选择所属方", trigger: "change" },
  2670. ],
  2671. },
  2672. importVisible: false,
  2673. tempList: [],
  2674. curEleTable: {},
  2675. istableType: true,
  2676. editEleVisible: false,
  2677. editEleList: [],
  2678. eleReg: /(≥|≤|±|【】)?([^≥≤±【】]*)/,
  2679. editEleFormulaVisible: false,
  2680. isMeter: false,
  2681. formulaInput: "",
  2682. editEleListFilter: [],
  2683. editEleListAll: [],
  2684. tableFileTypeList:[],
  2685. importTemplateVisible: false,
  2686. fileUrl: "",
  2687. upFile: null,
  2688. importLoading: false,
  2689. nodeInfoVisible: false,
  2690. nodeInfoTable: [],
  2691. nodeInfoTableLoad: false,
  2692. namelist: [],
  2693. namelists: [],
  2694. delids: [],
  2695. infoNameVisible: false,
  2696. excelSortTag: false,
  2697. excelSortTag2: false,
  2698. tableSortList: [],
  2699. sortTableList: [],
  2700. sortProLoad:false,
  2701. //#endregion
  2702. defaultExpandedKeys: [],
  2703. expandName: this.$route.fullPath,
  2704. aliasVisible: false, //别名
  2705. aliasInput: "",
  2706. aliasArr: [],
  2707. formulaCompVisible: false, //公式弹框
  2708. formulaCompVisible1: false,
  2709. formulaCurRow: {}, //当前元素
  2710. editElementVisible: false, //编辑元素弹框
  2711. editElementQuery: {
  2712. pkeyId: "",
  2713. excelId: "",
  2714. id: "",
  2715. initTableName: "",
  2716. initTableId: "",
  2717. pid: "",
  2718. wbsid: "",
  2719. nodeid: "",
  2720. }, //传参
  2721. syncBtnLoad: false,
  2722. syncElectricLoad: false,
  2723. showType: 1,
  2724. typeTreeData: [],
  2725. testTreeLoad: false,
  2726. testTreeData: [],
  2727. mixRatioTestIds: [],
  2728. //节点参数,关联元素
  2729. curParam: {}, //当前节点参数
  2730. linkEleVisible: false,
  2731. linkEleTableList: [], //元素表数组
  2732. curLinkEleTable: {}, //当前元素表
  2733. linkCheckVisible: false, //关联弹框
  2734. linkEleList: [], //元素数组
  2735. linkEleKey: "", //搜索关键字
  2736. menusData: [
  2737. // {icon: 'el-icon-s-promotion', label: '新增节点', key: "add"},
  2738. {
  2739. icon: "el-icon-s-promotion",
  2740. label: "编辑节点",
  2741. key: "edit",
  2742. content: "编辑节点",
  2743. },
  2744. {
  2745. icon: "el-icon-upload",
  2746. label: "后管数据同步",
  2747. key: "sync1",
  2748. content: "后管数据同步",
  2749. },
  2750. {
  2751. icon: "el-icon-upload",
  2752. label: "同步到合同段",
  2753. key: "sync3",
  2754. content: "同步到合同段",
  2755. },
  2756. {
  2757. icon: "el-icon-sort",
  2758. label: "调整排序",
  2759. key: "sort",
  2760. content: "调整排序",
  2761. },
  2762. {
  2763. icon: "el-icon-s-promotion",
  2764. label: "删除节点",
  2765. key: "del",
  2766. content: "删除节点",
  2767. },
  2768. ], //树组件操作菜单
  2769. menuvisible: false,
  2770. menuleft: 20,
  2771. menutop: 0,
  2772. //同步菜单按钮
  2773. menuoptions: [
  2774. {
  2775. value: "jdSync",
  2776. label: "节点参数同步",
  2777. load: false,
  2778. },
  2779. {
  2780. value: "dqSync",
  2781. label: "电签同步",
  2782. load: false,
  2783. },
  2784. {
  2785. value: "gsSync",
  2786. label: "公式同步",
  2787. load: false,
  2788. },
  2789. // {
  2790. // value: "zdSync",
  2791. // label: "字典同步",
  2792. // load: false,
  2793. // },
  2794. ],
  2795. menuvalue: "",
  2796. isshowSyncbtn: false,
  2797. projectName: "",
  2798. nodeInfoSaveload: false,
  2799. handlesyncLoad: false, //表单同步
  2800. isLinkNodes: false,
  2801. linkNodesLoad: false,
  2802. checkedLinkNodesKeys: [],
  2803. rowPkeyId: "",
  2804. nodesCheck: [],
  2805. standardTypeOptions: [], //标准分类
  2806. unitOptions: [], //单位名称
  2807. editDialogShow: false, //编辑元素
  2808. searchinput: "",
  2809. editTable: [],
  2810. editEleTableloading: false,
  2811. dynamicDictList: [],
  2812. saveLoading: false,
  2813. fileTitleVisible:false,
  2814. deCheckTreeKeys:[],
  2815. fileTableData:[
  2816. ],
  2817. fileTitleRef:null,
  2818. fileTitleModel:{
  2819. type:'',
  2820. },
  2821. fileTreeLoading:false,
  2822. fileTreeData:[],
  2823. filedefaultProps:{
  2824. children: 'children',
  2825. label: 'nodeName',
  2826. disabled:function (data) {
  2827. return data.status===11 ;
  2828. },
  2829. },
  2830. fileTitleRules:{
  2831. type: [
  2832. { required: true, message: '请选择题名范围', trigger: 'blur' },
  2833. ],
  2834. },
  2835. fileTableLoading:false,
  2836. chooseFileVisible:false,
  2837. chooseFileRow: {},
  2838. chooseFileIndex: -1,
  2839. isShowSize:true,
  2840. selectDiv:Math.random(),
  2841. saveFileLoading:false,
  2842. proSyncTag:false,
  2843. rangeOptions:[],
  2844. typeOptions:[],
  2845. checkAll: false,
  2846. checkAll1: false,
  2847. isIndeterminate: false,
  2848. isIndeterminate1: false,
  2849. syncForm:{
  2850. range:'',
  2851. rangeName:'',
  2852. type:[],
  2853. typeName:'',
  2854. templateId:'',
  2855. templateName:'',
  2856. contractRange:[],
  2857. contractRangeName:'',
  2858. formIds:''
  2859. },
  2860. preTableData:[],
  2861. multipleSelection: [],
  2862. checkIdList:[
  2863. ],
  2864. isShowLeft:false,
  2865. isShowTable:false,
  2866. templateIdList:[],//同步源
  2867. saveProTagLoading:false,
  2868. syncTableDialog:false,
  2869. preTableData1:[],
  2870. formIds:'',
  2871. saveTableSyncLoad:false,
  2872. checkRow:null,
  2873. syncListDialog:false,
  2874. refreshLoading:false,
  2875. syncListData:{
  2876. nodeNum:'',//同步节点数量
  2877. nodeNumEnd:''//已同步数量
  2878. },
  2879. isAdd:'',
  2880. refreshLoading1:false,
  2881. codeDialog:false,
  2882. codeSetRef: null,
  2883. typeTem:'',
  2884. isShowTree1:true,
  2885. cachedNodes: new Map(), // 缓存已加载的节点数据
  2886. filterDialog:false,
  2887. filterForm: {
  2888. nodeType: '',
  2889. majorDataType: '',
  2890. className: '',
  2891. unitName: '',
  2892. isAddConceal:''
  2893. },
  2894. tableListByType:[],
  2895. tableListByTypeLoad:false
  2896. };
  2897. },
  2898. computed: {
  2899. ...mapGetters(["userInfo"]),
  2900. },
  2901. created() {
  2902. this.init();
  2903. // 尝试恢复之前选中的节点
  2904. // // 尝试恢复之前的状态
  2905. // this.restoreTreeState();
  2906. // 从本地存储恢复展开的keys
  2907. // const savedExpandedKeys = JSON.parse(localStorage.getItem('treeExpandedKeys') || '[]');
  2908. // this.defaultExpandedKeysType = savedExpandedKeys;
  2909. },
  2910. methods: {
  2911. //#region
  2912. changeType(val){
  2913. console.log(val,'val');
  2914. this.isNodeType=val
  2915. this.formData=[]
  2916. localStorage.setItem('isNodeType',val);
  2917. this.filterText1=''
  2918. },
  2919. init() {
  2920. //this.id = this.$route.query.wbsid;
  2921. //this.projectid = this.$route.query.pid;
  2922. const { wbsid, pid, type } = this.$route.query;
  2923. this.id = wbsid;
  2924. this.projectid = pid;
  2925. this.wbsType = type ? Number(type) : 1;
  2926. this.getNodeTypelistData()
  2927. this.getNodeTypelist();
  2928. this.getTableTypelist();
  2929. this.getDataTypelist();
  2930. this.getOwnerTypelist();
  2931. this.getStandardTypeOptions();
  2932. this.getMajorDataTypeList();
  2933. this.getTableFileTypeList();
  2934. this.defaultExpandedKeys = getStore({ name: this.expandName });
  2935. this.projectName = this.$route.query.projectName;
  2936. },
  2937. loadNode(node, resolve) {
  2938. let pid = 0;
  2939. if (node.level != 0) {
  2940. pid = node.data.id;
  2941. }
  2942. const type = this.wbsType;
  2943. getLazytree(this.id, pid, this.userInfo.tenant_id, this.projectid, {
  2944. wbsType: type,
  2945. }).then((res) => {
  2946. let arr = [];
  2947. if (Array.isArray(res.data.data)) {
  2948. arr = res.data.data;
  2949. }
  2950. return resolve(arr);
  2951. });
  2952. },
  2953. // 在 loadNodeByType 中恢复选中状态
  2954. loadNodeByType(node, resolve) {
  2955. // 如果有缓存且不是根节点,直接返回缓存
  2956. if (node.level !== 0 && this.cachedNodes.has(node.data.id)) {
  2957. return resolve(this.cachedNodes.get(node.data.id));
  2958. }
  2959. let pid = 12345678910;
  2960. if (node.level != 0) {
  2961. pid = node.data.id;
  2962. }
  2963. getTreeByType({
  2964. parentId: pid,
  2965. projectId: this.projectid,
  2966. current: 1,
  2967. size: 1000,
  2968. titleName: this.filterText1
  2969. }).then((res) => {
  2970. let arr = [];
  2971. if (Array.isArray(res.data.data['records'])) {
  2972. arr = res.data.data['records'];
  2973. }
  2974. resolve(arr);
  2975. // 恢复选中状态
  2976. this.$nextTick(() => {
  2977. if (this.currentNodeKey) {
  2978. this.$refs.treeByType.setCurrentKey(this.currentNodeKey);
  2979. }
  2980. });
  2981. }).catch(error => {
  2982. console.error('加载树节点失败:', error);
  2983. resolve([]);
  2984. });
  2985. },
  2986. saveTreeState() {
  2987. const tree = this.$refs.treeByType;
  2988. if (!tree) return;
  2989. // 保存当前选中节点
  2990. this.currentNodeKey = tree.getCurrentKey();
  2991. // 保存所有展开节点
  2992. this.defaultExpandedKeysType = [];
  2993. const traverse = (node) => {
  2994. if (node.expanded && node.data) {
  2995. this.defaultExpandedKeysType.push(node.data.id);
  2996. }
  2997. if (node.childNodes) {
  2998. node.childNodes.forEach(traverse);
  2999. }
  3000. };
  3001. traverse(tree.store.root);
  3002. },
  3003. // 节点展开时保存状态
  3004. handleNodeExpand(data) {
  3005. if (!this.defaultExpandedKeysType.includes(data.id)) {
  3006. this.defaultExpandedKeysType.push(data.id);
  3007. }
  3008. },
  3009. // 节点折叠时更新状态
  3010. handleNodeCollapse(data) {
  3011. const index = this.defaultExpandedKeysType.indexOf(data.id);
  3012. if (index > -1) {
  3013. this.defaultExpandedKeysType.splice(index, 1);
  3014. }
  3015. },
  3016. getNodeDetail(data, node) {
  3017. console.log("getNodeDetail", data);
  3018. let parentName = "";
  3019. if (node.parent.data) {
  3020. parentName = node.parent.data.title;
  3021. }
  3022. this.curTreeData = data;
  3023. this.curTreeNode = node;
  3024. this.curTreeData.parentName = parentName;
  3025. getDetail(data.id, this.id, this.projectid).then((res) => {
  3026. res.data.data.parentName = parentName;
  3027. let tableObj=res.data.data;
  3028. tableObj.primaryKeyId=data.primaryKeyId
  3029. this.tableData = [res.data.data];
  3030. this.nodeDetail = Object.assign({}, res.data.data);
  3031. const { tableFileType } = this.nodeDetail;
  3032. this.nodeDetail.tableFileType = tableFileType&&tableFileType.length>0 ? tableFileType.split(",") : [];
  3033. });
  3034. this.updateNodeTable();
  3035. // this.nodeTypeChange(data.nodeType)
  3036. //获取节点展开路径
  3037. this.getExpandedKeys(node);
  3038. },
  3039. getNodeDetailByType(data, node) {
  3040. console.log(data, 'data');
  3041. // 保存当前选中的节点
  3042. this.currentNodeKey = data.id;
  3043. this.curTreeData = data;
  3044. this.curTreeNode = node;
  3045. data.tableName = data.title;
  3046. this.formData = [data];
  3047. // 只存储node对象中的必要信息,避免循环引用
  3048. const nodeInfo = {
  3049. id: node.data.id,
  3050. label: node.label,
  3051. level: node.level,
  3052. isLeaf: node.isLeaf,
  3053. expanded: node.expanded,
  3054. // 其他你需要的属性
  3055. };
  3056. localStorage.setItem('lastDataNode', JSON.stringify(nodeInfo));
  3057. },
  3058. saveNode() {
  3059. const type = this.wbsType;
  3060. this.$refs["nodeDetail"].validate((valid) => {
  3061. if (valid) {
  3062. if (type === 2 && this.nodeDetail.nodeType === 53) {
  3063. if (mixRatioTestIds) {
  3064. if (this.editType == 1) {
  3065. this.addNode();
  3066. } else if (this.editType == 2) {
  3067. this.updateNode();
  3068. }
  3069. } else {
  3070. this.$message({
  3071. type: "error",
  3072. message: "请先选择节点",
  3073. });
  3074. return false;
  3075. }
  3076. } else {
  3077. if (this.editType == 1) {
  3078. this.addNode();
  3079. } else if (this.editType == 2) {
  3080. this.updateNode();
  3081. }
  3082. }
  3083. } else {
  3084. console.log("error submit!!");
  3085. return false;
  3086. }
  3087. });
  3088. },
  3089. addNode() {
  3090. this.saveNodeLoading = true;
  3091. const { tableFileType } = this.nodeDetail;
  3092. this.nodeDetail.tableFileType = tableFileType&&tableFileType.length>0 ? tableFileType.join(",") : "";
  3093. update(this.nodeDetail).then(() => {
  3094. this.updateTreeNewNode();
  3095. this.dialogVisible = false;
  3096. this.$message({
  3097. type: "success",
  3098. message: "新增成功!",
  3099. });
  3100. });
  3101. },
  3102. updateNode() {
  3103. const { tableFileType } = this.nodeDetail;
  3104. this.nodeDetail.tableFileType = tableFileType&&tableFileType.length>0 ? tableFileType.join(",") : "";
  3105. update(this.nodeDetail).then(() => {
  3106. let node = this.tableData[0];
  3107. node.nodeName = this.nodeDetail.nodeName;
  3108. node.nodeType = this.nodeDetail.nodeType;
  3109. this.curTreeData.title = this.nodeDetail.nodeName;
  3110. this.dialogVisible = false;
  3111. this.$message({
  3112. type: "success",
  3113. message: "修改成功!",
  3114. });
  3115. });
  3116. this.getNodeDetail(this.curTreeData, this.curTreeNode);
  3117. },
  3118. toSplit(val) {
  3119. return val ? String(val).split(",") : "";
  3120. },
  3121. setLeftType(type, data, node) {
  3122. this.jiedianId = data.id;
  3123. this.getNodeTypelistData()
  3124. if (type == 4 || type == 5) {
  3125. this.leftType = type;
  3126. }
  3127. this.curTreeData = data;
  3128. this.curTreeNode = node;
  3129. this.$refs.tree.setCurrentKey(data.id);
  3130. if (type == 1 || type == 2) {
  3131. this.getMajorDataTypeList();
  3132. this.dialogVisible = true;
  3133. this.editType = type;
  3134. }
  3135. getDetail(data.id, this.id, this.projectid).then((res) => {
  3136. let parentName = "";
  3137. if (node.parent.data) {
  3138. parentName = node.parent.data.title;
  3139. }
  3140. res.data.data.parentName = parentName;
  3141. this.tableData = [res.data.data];
  3142. if (type == 1) {
  3143. this.nodeDetail = {
  3144. parentId: res.data.data.id,
  3145. parentName: parentName,
  3146. projectId: res.data.data.projectId,
  3147. };
  3148. } else {
  3149. this.nodeDetail = Object.assign({}, res.data.data);
  3150. this.mixRatioTestIds = this.toSplit(res.data.data.mixRatioTestIds);
  3151. }
  3152. this.nodeDetail.type = 1; // '1'节点 '2'表单
  3153. this.nodeDetail.wbsId = this.id;
  3154. this.nodeDetail.tenantId = this.userInfo.tenant_id;
  3155. this.changeStandType(this.nodeDetail.className);
  3156. });
  3157. if (this.leftType == 4) {
  3158. selectByNodeTable(data.id, this.projectid, this.id).then((res) => {
  3159. if (res.data.data.length) {
  3160. this.formData = res.data.data;
  3161. } else {
  3162. this.formData = [];
  3163. }
  3164. });
  3165. }
  3166. //获取节点展开路径
  3167. this.getExpandedKeys(node);
  3168. },
  3169. showFormElement() {
  3170. if (!this.nodeDetail.id) {
  3171. this.$message({
  3172. type: "warning",
  3173. message: "请先选择在哪个节点下创建表",
  3174. });
  3175. return;
  3176. }
  3177. this.eleVisible = true;
  3178. },
  3179. addEleRow(list) {
  3180. list.push({});
  3181. },
  3182. delEleRow(index, list) {
  3183. list.splice(index, 1);
  3184. },
  3185. saveFormAndElementHandle() {
  3186. this.$refs["eleDialog"].validate((valid) => {
  3187. if (valid) {
  3188. this.eleForm.wbsId = this.id;
  3189. this.eleForm.tenantId = this.userInfo.tenant_id;
  3190. this.eleForm.nodeType = -1;
  3191. this.eleForm.type = 2; // '1'节点 '2'表单
  3192. this.eleForm.parentId = this.nodeDetail.id;
  3193. this.eleForm.elementList.forEach((element) => {
  3194. element.eAllowDeviation =
  3195. (element.allow ? element.allow : "") +
  3196. (element.deviation ? element.deviation : "");
  3197. if (element.eType == 4) {
  3198. element.eLength = 0;
  3199. }
  3200. });
  3201. saveFormAndElement(this.eleForm).then(() => {
  3202. //console.log(res)
  3203. this.updateTreeNewNode();
  3204. this.updateNodeTable();
  3205. this.eleVisible = false;
  3206. this.$message({
  3207. type: "success",
  3208. message: "新增成功!",
  3209. });
  3210. });
  3211. } else {
  3212. console.log("error submit!!");
  3213. return false;
  3214. }
  3215. });
  3216. },
  3217. updateTreeNewNode() {
  3218. getLazytree(
  3219. this.id,
  3220. this.nodeDetail.parentId,
  3221. this.userInfo.tenant_id,
  3222. this.projectid
  3223. ).then((res) => {
  3224. this.$refs.tree.updateKeyChildren(
  3225. this.nodeDetail.parentId,
  3226. res.data.data
  3227. );
  3228. });
  3229. },
  3230. updateNodeTable() {
  3231. if(this.isNodeType){
  3232. this.tableListByTypeLoad=true
  3233. getGroupNodeTables(
  3234. {
  3235. parentId: this.curTreeData.id,
  3236. projectId: this.projectid,
  3237. wbsId: this.id
  3238. }
  3239. ).then(
  3240. (res) => {
  3241. this.tableListByTypeLoad=false
  3242. if (res.data.data && res.data.data.length) {
  3243. this.tableListByType = res.data.data;
  3244. // this.formData = res.data.data;
  3245. // this.formData.forEach((ele) => {
  3246. // ele.nodeType = Number(ele.nodeType);
  3247. // });
  3248. } else {
  3249. this.tableListByType = [];
  3250. }
  3251. }
  3252. );
  3253. }else{
  3254. console.log(8888888);
  3255. this.reloadEntireTree();
  3256. }
  3257. },
  3258. async reloadEntireTree() {
  3259. this.isNodeType = false;
  3260. // 1. 获取树组件引用和当前选中节点
  3261. const tree = this.$refs.treeByType;
  3262. if (!tree) return;
  3263. const currentKey = tree.getCurrentKey();
  3264. const currentPath = [];
  3265. // 2. 收集当前选中节点的路径和所有展开节点
  3266. const allExpandedNodes = [];
  3267. const traverseTree = (node) => {
  3268. if (node.expanded && node.level > 0) {
  3269. allExpandedNodes.push({
  3270. id: node.data.id,
  3271. node: node
  3272. });
  3273. }
  3274. if (node.childNodes) {
  3275. node.childNodes.forEach(traverseTree);
  3276. }
  3277. };
  3278. traverseTree(tree.store.root);
  3279. // 3. 获取选中节点的完整路径
  3280. if (currentKey) {
  3281. const currentNode = tree.getNode(currentKey);
  3282. if (currentNode) {
  3283. let parent = currentNode.parent;
  3284. while (parent && parent.level > 0) {
  3285. currentPath.unshift(parent.data.id);
  3286. parent = parent.parent;
  3287. }
  3288. currentPath.push(currentKey); // 包含当前节点本身
  3289. }
  3290. }
  3291. // 4. 清空缓存
  3292. this.cachedNodes.clear();
  3293. // 5. 强制重新加载当前路径上的所有节点
  3294. for (const nodeId of currentPath) {
  3295. const node = tree.getNode(nodeId);
  3296. if (node) {
  3297. node.loaded = false; // 标记为需要重新加载
  3298. // 从缓存中移除
  3299. this.cachedNodes.delete(nodeId);
  3300. }
  3301. }
  3302. // 6. 关闭所有非当前路径的展开节点
  3303. allExpandedNodes.forEach(({id, node}) => {
  3304. if (!currentPath.includes(id)) {
  3305. node.expanded = false;
  3306. node.loaded = false; // 标记为需要重新加载
  3307. this.cachedNodes.delete(id);
  3308. }
  3309. });
  3310. // 7. 重新加载根节点
  3311. const rootNode = tree.store.root;
  3312. const rootId = rootNode.childNodes[0].data.id || 'root';
  3313. await this.$nextTick();
  3314. tree.updateKeyChildren(rootId, []);
  3315. const root = tree.getNode(rootId);
  3316. if (root) {
  3317. root.loaded = false;
  3318. root.expand();
  3319. }
  3320. // 8. 等待树重新加载完成
  3321. await new Promise(resolve => {
  3322. const checkLoaded = () => {
  3323. if (root.loaded) {
  3324. resolve();
  3325. } else {
  3326. setTimeout(checkLoaded, 50);
  3327. }
  3328. };
  3329. checkLoaded();
  3330. });
  3331. // 9. 重新展开当前路径
  3332. this.defaultExpandedKeysType = [...currentPath];
  3333. for (const nodeId of currentPath) {
  3334. const node = tree.getNode(nodeId);
  3335. if (node && !node.expanded) {
  3336. node.expand();
  3337. // 等待节点加载
  3338. await new Promise(resolve => {
  3339. const checkNodeLoaded = () => {
  3340. if (node.loaded) {
  3341. resolve();
  3342. } else {
  3343. setTimeout(checkNodeLoaded, 50);
  3344. }
  3345. };
  3346. checkNodeLoaded();
  3347. });
  3348. }
  3349. }
  3350. // 10. 恢复选中状态
  3351. if (currentKey) {
  3352. // 检查节点是否仍然存在
  3353. const currentNode = tree.getNode(currentKey);
  3354. if (currentNode) {
  3355. tree.setCurrentKey(currentKey);
  3356. this.currentNodeData = currentNode.data;
  3357. this.formData = [{
  3358. ...this.currentNodeData,
  3359. tableName: this.currentNodeData.title
  3360. }];
  3361. } else {
  3362. // 节点已被删除
  3363. this.currentNodeKey = null;
  3364. this.currentNodeData = null;
  3365. this.formData = [];
  3366. // this.$message.warning('当前选中节点已被删除');
  3367. }
  3368. }
  3369. },
  3370. // 关闭所有非路径上的展开节点
  3371. closeOtherExpandedNodes(tree, keepOpenPath) {
  3372. const closeNodes = (node) => {
  3373. if (node.expanded && node.level > 0) {
  3374. const nodeId = node.data.id;
  3375. // 如果节点不在需要保持展开的路径中,则关闭它
  3376. if (!keepOpenPath.includes(nodeId)) {
  3377. node.expanded = false;
  3378. }
  3379. }
  3380. if (node.childNodes) {
  3381. node.childNodes.forEach(closeNodes);
  3382. }
  3383. };
  3384. // 从根节点开始遍历
  3385. closeNodes(tree.store.root);
  3386. },
  3387. deleNode(data, node) {
  3388. let pid = data.primaryKeyId ? data.primaryKeyId : data.pKeyId;
  3389. this.$confirm(
  3390. "此操作将删除节点【" + data.title + "】, 是否继续?",
  3391. "提示",
  3392. {
  3393. confirmButtonText: "确定",
  3394. cancelButtonText: "取消",
  3395. type: "warning",
  3396. }
  3397. )
  3398. .then(() => {
  3399. removePrivateTreeNode(pid).then(() => {
  3400. this.$refs.tree.remove(node);
  3401. this.$message({
  3402. type: "success",
  3403. message: "删除成功!",
  3404. });
  3405. });
  3406. })
  3407. .catch(() => {});
  3408. },
  3409. // 重新加载整棵树
  3410. importHandle() {},
  3411. handlePreview(index, row) {
  3412. this.curEleTable = row;
  3413. if(!this.curEleTable.initTableId){
  3414. this.$message({ type: "warning", message: '请先关联清表' })
  3415. return
  3416. }
  3417. selectPrivateFormElements(this.curEleTable.initTableId).then((res) => {
  3418. res.data.data.forEach((element) => {
  3419. this.eleReg.exec(element.eAllowDeviation);
  3420. element.allow = RegExp.$1 ? RegExp.$1 : "";
  3421. element.deviation = RegExp.$2 ? RegExp.$2 : "";
  3422. });
  3423. this.editEleList = res.data.data;
  3424. });
  3425. this.editEleVisible = true;
  3426. },
  3427. //关联节点
  3428. handleLinkNodes(index, row) {
  3429. this.rowPkeyId = row.pkeyId;
  3430. this.linkNodesLoad = false;
  3431. this.isLinkNodes = true;
  3432. getLinekNodeTreelist(row.pkeyId)
  3433. .then(({ data }) => {
  3434. const res = data.data;
  3435. if (res instanceof Array) {
  3436. this.checkedLinkNodesKeys = res;
  3437. } else {
  3438. this.checkedLinkNodesKeys = [];
  3439. }
  3440. })
  3441. .catch(() => {
  3442. this.checkedLinkNodesKeys = [];
  3443. });
  3444. },
  3445. //确定关联
  3446. linkNodesSave() {
  3447. const keys = this.$refs.tree2.getCheckedKeys();
  3448. // if (keys.length <= 0) {
  3449. // this.$message({
  3450. // type: "warning",
  3451. // message: "请先勾选节点",
  3452. // });
  3453. // return;
  3454. // }
  3455. const pkeyId = this.rowPkeyId;
  3456. this.linkNodesLoad = true;
  3457. linkNodeTree(keys.length >0?keys.join(","):'', pkeyId)
  3458. .then(() => {
  3459. this.$message({
  3460. type: "success",
  3461. message: "关联成功!",
  3462. });
  3463. this.linkNodesLoad = false;
  3464. this.linkNodesClose();
  3465. })
  3466. .catch(() => {
  3467. this.linkNodesLoad = false;
  3468. });
  3469. },
  3470. //关闭关联弹窗
  3471. linkNodesClose() {
  3472. this.isLinkNodes = false;
  3473. this.linkNodesLoad = false;
  3474. this.checkedLinkNodesKeys = [];
  3475. this.nodesCheck = [];
  3476. this.rowPkeyId = "";
  3477. },
  3478. handleDelete(index, row) {
  3479. this.$confirm("是否删除 " + row.tableName + " ?", "删除元素表", {
  3480. distinguishCancelAndClose: true,
  3481. confirmButtonText: "删除",
  3482. cancelButtonText: "取消",
  3483. }).then(() => {
  3484. if(this.isNodeType){
  3485. removeTableById(row.id, this.projectid, this.id).then(() => {
  3486. this.formData.splice(index, 1);
  3487. this.$message({
  3488. type: "success",
  3489. message: "删除成功!",
  3490. });
  3491. });
  3492. }else{
  3493. delTabInfoAll(row.pkeyId).then(() => {
  3494. this.formData.splice(index, 1);
  3495. this.$message({
  3496. type: "success",
  3497. message: "删除成功!",
  3498. });
  3499. });
  3500. }
  3501. });
  3502. },
  3503. async hideMD(row) {
  3504. //隐藏按钮
  3505. const code = await this.updateStatus(row.pkeyId, row.status);
  3506. if (code == 200) {
  3507. if (row.status == 0) {
  3508. row.status = 1;
  3509. } else {
  3510. row.status = 0;
  3511. }
  3512. }
  3513. },
  3514. async updateStatus(pKeyId, status) {
  3515. //隐藏功能激活
  3516. const { data: res } = await updateStatus({ pKeyId });
  3517. if (res.code == 200) {
  3518. this.$message({
  3519. type: "success",
  3520. message: status == 1 ? "隐藏成功" : "激活成功",
  3521. });
  3522. }
  3523. return res.code;
  3524. },
  3525. handleEditFormula(index, row) {
  3526. this.curEleTable = row;
  3527. selectFormElements(this.curEleTable.pkeyId, { type: 0 }).then((res) => {
  3528. this.editEleListFilter = res.data.data;
  3529. this.editEleListAll = [].concat(this.editEleListFilter);
  3530. });
  3531. this.editEleFormulaVisible = true;
  3532. },
  3533. //表单同步
  3534. handlesync(index, row) {
  3535. },
  3536. //搜索 筛选
  3537. searchFormulaName() {
  3538. this.editEleListFilter = this.editEleListAll.filter((ele) => {
  3539. return ele.eName.indexOf(this.formulaInput) > -1;
  3540. });
  3541. },
  3542. saveNewEle(row) {
  3543. row.eAllowDeviation =
  3544. (row.allow ? row.allow : "") + (row.deviation ? row.deviation : "");
  3545. row.fId = this.curEleTable.initTableId;
  3546. row.initTableName = this.curEleTable.initTableName;
  3547. if (row.eType == 4) {
  3548. row.eLength = 0;
  3549. }
  3550. saveElement(row).then((res) => {
  3551. if (res.data.data) {
  3552. this.$set(row, "id", res.data.data.id);
  3553. this.$set(row, "ekey", res.data.data.ekey);
  3554. this.$message({
  3555. type: "success",
  3556. message: "保存成功!",
  3557. });
  3558. }
  3559. });
  3560. },
  3561. delEleRowHandle(index, list) {
  3562. let row = list[index];
  3563. if (row.id) {
  3564. //有id需要请求删除
  3565. this.$confirm("是否确认删除?", "删除元素", {
  3566. distinguishCancelAndClose: true,
  3567. confirmButtonText: "删除",
  3568. cancelButtonText: "取消",
  3569. }).then(() => {
  3570. removeElement(row.id, this.curEleTable.initTableName, row.ekey).then(
  3571. () => {
  3572. list.splice(index, 1);
  3573. }
  3574. );
  3575. });
  3576. } else {
  3577. list.splice(index, 1);
  3578. }
  3579. },
  3580. nodeTypeChange(val) {
  3581. console.log(333333333);
  3582. if (val === 53) {
  3583. // if (this.testTreeData.length > 0) {
  3584. // return;
  3585. // }
  3586. this.testTreeLoad = true;
  3587. // getAlltreeTrial(this.projectid, this.id, this.curTreeData.primaryKeyId).then((res) => {
  3588. // this.testTreeLoad = false;
  3589. // console.log(res.data.data,'data');
  3590. // let trialdata=res.data.data
  3591. // if(trialdata&&trialdata.allTree){
  3592. // this.testTreeData = trialdata.allTree[0];
  3593. // if(trialdata.allStatusIds.length>0){
  3594. // //设置勾选相关联试验全选
  3595. // this.mixRatioTestIds =trialdata.allStatusIds[0];
  3596. // }
  3597. // }
  3598. // });
  3599. let pid = this.curTreeData.primaryKeyId
  3600. ? this.curTreeData.primaryKeyId
  3601. : this.curTreeData.pKeyId;
  3602. getAlltree(this.projectid, this.id, pid).then((res) => {
  3603. this.testTreeLoad = false;
  3604. console.log(res.data.data, "data");
  3605. this.testTreeData = res.data.data;
  3606. });
  3607. }
  3608. },
  3609. //根据逗号联合
  3610. toJoin(arr) {
  3611. return arr ? arr.join() : "";
  3612. },
  3613. TestTreeCheckChange(_, { checkedKeys, halfCheckedKeys }) {
  3614. // const newarr = [...checkedKeys, ...halfCheckedKeys];
  3615. const newarr = [...checkedKeys];
  3616. this.nodeDetail.mixRatioTestIds = this.toJoin(newarr);
  3617. },
  3618. // filterChange() {
  3619. // if (this.treeData.length > 0) {
  3620. // this.$refs.treeall.filter(this.filterText);
  3621. // return;
  3622. // }
  3623. // this.treeLoad = true;
  3624. // getAlltree(this.projectid, this.id).then((res) => {
  3625. // this.treeLoad = false;
  3626. // this.treeData = res.data.data;
  3627. // console.log(res.data.data,'res.data.data');
  3628. // this.$nextTick(() => {
  3629. // this.$refs.treeall.filter(this.filterText);
  3630. // });
  3631. // });
  3632. // },
  3633. //搜索树
  3634. //搜索树
  3635. searchTreeClick() {
  3636. if (this.filterText.length > 0) {
  3637. this.isSearch = true;
  3638. this.searchtreeLoad = true;
  3639. getQueryValueByType({
  3640. queryValue: this.filterText,
  3641. type: this.searchType,
  3642. wbsId: this.id,
  3643. projectId: this.projectid,
  3644. }).then((res) => {
  3645. let arr = [];
  3646. if (Array.isArray(res.data.data)) {
  3647. arr = res.data.data;
  3648. this.searchTreeData = arr;
  3649. } else {
  3650. this.searchTreeData = [];
  3651. }
  3652. });
  3653. } else {
  3654. this.isSearch = false;
  3655. }
  3656. this.searchtreeLoad = false;
  3657. },
  3658. searchTreeClick1() {
  3659. if(!this.curTreeData.hasChildren){
  3660. this.$message.warning('请先选择一个父节点');
  3661. return;
  3662. }
  3663. // if (!this.filterText1.trim()) {
  3664. // this.$message.warning('请输入搜索内容');
  3665. // return;
  3666. // }
  3667. // 保存当前状态
  3668. // 保存当前状态
  3669. this.saveTreeState();
  3670. // 清空缓存
  3671. this.cachedNodes.clear();
  3672. // 重新加载选中节点及其子节点
  3673. this.reloadSelectedNode();
  3674. },
  3675. // 清空搜索
  3676. clearSearch1() {
  3677. this.filterText1 = '';
  3678. this.searchTreeClick1();
  3679. },
  3680. // 重新加载选中节点
  3681. async reloadSelectedNode() {
  3682. const tree = this.$refs.treeByType;
  3683. if (!tree || !this.currentNodeKey) return;
  3684. // 获取当前节点
  3685. const currentNode = tree.getNode(this.currentNodeKey);
  3686. if (!currentNode) return;
  3687. // 标记为未加载,强制重新加载
  3688. currentNode.loaded = false;
  3689. currentNode.expand(); // 这会触发loadNodeByType
  3690. // 恢复状态
  3691. await this.$nextTick();
  3692. tree.setCurrentKey(this.currentNodeKey);
  3693. },
  3694. // 重新加载树
  3695. reloadTree() {
  3696. const tree = this.$refs.treeByType;
  3697. if (!tree) return;
  3698. // 清空根节点
  3699. const rootNode = tree.store.root;
  3700. const rootId = rootNode.childNodes[0].data.id || 'root';
  3701. tree.updateKeyChildren(rootId, []);
  3702. // 强制重新加载根节点
  3703. const root = tree.getNode(rootId);
  3704. if (root) {
  3705. root.loaded = false;
  3706. root.expand();
  3707. }
  3708. // 恢复状态
  3709. this.$nextTick(() => {
  3710. if (this.currentNodeKey) {
  3711. tree.setCurrentKey(this.currentNodeKey);
  3712. }
  3713. });
  3714. },
  3715. // 刷新树数据
  3716. filterSearchClick(){
  3717. this.filterDialog=true;
  3718. },
  3719. filterSearchClickCancel(){
  3720. this.filterByType=false
  3721. this.searchTreeClick()
  3722. },
  3723. handleCancel() {
  3724. this.filterByType=false
  3725. this.filterDialog = false;
  3726. },
  3727. handleConfirm() {
  3728. this.isSearch = true;
  3729. this.searchtreeLoad = true;
  3730. getQueryValueByNodeType({
  3731. ...this.filterForm,
  3732. queryValue: this.filterText,
  3733. wbsId: this.id,
  3734. projectId: this.projectid,
  3735. }).then((res) => {
  3736. this.filterByType=true
  3737. let arr = [];
  3738. if (Array.isArray(res.data.data)) {
  3739. arr = res.data.data;
  3740. this.searchTreeData = arr;
  3741. } else {
  3742. this.searchTreeData = [];
  3743. }
  3744. });
  3745. this.searchtreeLoad = false;
  3746. this.filterDialog = false;
  3747. },
  3748. clearSearch() {
  3749. this.isSearch = false;
  3750. },
  3751. importTemplate(data) {
  3752. this.importTemplateVisible = true;
  3753. this.curTreeData = data;
  3754. if (!this.fileUrl) {
  3755. getAttchFromOriginalName(1, 20, {
  3756. originalName: "WBS划分模板.xls",
  3757. }).then((res) => {
  3758. if (res.data.data.records.length) {
  3759. this.fileUrl = res.data.data.records[0].link;
  3760. } else {
  3761. this.fileUrl = "";
  3762. }
  3763. });
  3764. }
  3765. },
  3766. importTemplateHandle() {
  3767. if (!this.upFile) {
  3768. this.$message({
  3769. type: "warning",
  3770. message: "请先选择文件再进行导入",
  3771. });
  3772. return;
  3773. }
  3774. let forms = new FormData();
  3775. forms.append("excelFile", this.upFile);
  3776. let wbsTreeFu = {
  3777. wbsId: this.id,
  3778. parentId: this.curTreeData.id,
  3779. // ancestors:'0,'+this.curTreeData.id,
  3780. };
  3781. let json = JSON.stringify(wbsTreeFu);
  3782. let blob = new Blob([json], { type: "application/json" });
  3783. forms.append("wbsTreeFu", blob);
  3784. this.importLoading = true;
  3785. importWbsTree(forms)
  3786. .then(() => {
  3787. //this.$router.go(0)
  3788. let node = this.$refs.tree.getNode(this.curTreeData.id);
  3789. node.isLeaf = false;
  3790. this.importTemplateVisible = false;
  3791. this.upFile = null;
  3792. })
  3793. .finally(() => {
  3794. this.importLoading = false;
  3795. });
  3796. },
  3797. handleDownload() {
  3798. if (this.fileUrl) {
  3799. window.open(this.fileUrl);
  3800. } else {
  3801. this.$message({
  3802. type: "warning",
  3803. message: "请先在附件管理上传【WBS划分模板.xls】文件",
  3804. });
  3805. }
  3806. },
  3807. fileClick() {
  3808. this.$refs.file.click();
  3809. },
  3810. fileChange(e) {
  3811. const file = e.target.files[0];
  3812. if (!file) {
  3813. // 如果用户没有选择图片,只是点了文件上传这个按钮
  3814. return;
  3815. }
  3816. //console.log(file)
  3817. this.upFile = file;
  3818. },
  3819. editNodeInfo(index, row) {
  3820. this.$set(row, "isEdit", true);
  3821. },
  3822. saveNodeInfoHandle(index, row) {
  3823. row.isEdit = false;
  3824. },
  3825. downloadTmp() {
  3826. getTemplate().then((res) => {
  3827. //console.log(res)
  3828. let blob = new Blob([res.data], {
  3829. type: "application/vnd.ms-excel",
  3830. });
  3831. //console.log(blob)
  3832. let filename = Date.parse(new Date()) + ".xls";
  3833. if (window.navigator.msSaveOrOpenBlob) {
  3834. // 兼容IE10
  3835. window.navigator.msSaveBlob(blob, filename);
  3836. } else {
  3837. // 兼容chrome/firefox
  3838. let aTag = document.createElement("a");
  3839. aTag.download = Date.parse(new Date()) + ".xls";
  3840. aTag.href = window.URL.createObjectURL(blob);
  3841. aTag.click();
  3842. URL.revokeObjectURL(aTag.href);
  3843. }
  3844. });
  3845. },
  3846. fileClick2() {
  3847. this.$refs.file2.click();
  3848. },
  3849. tmpImport(e) {
  3850. const file = e.target.files[0];
  3851. const formData = new FormData();
  3852. formData.append("file", file);
  3853. //console.log(file.name)
  3854. importWbsElement(formData)
  3855. .then((res) => {
  3856. res.data.data.forEach((element) => {
  3857. element.eName = element.elementName;
  3858. element.eLength = element.elementLength;
  3859. element.eType = Number(element.elementType);
  3860. element.eAllowDeviation = element.elementAllowDeviation;
  3861. element.eInspectionMethod = element.elementInspectionMethod;
  3862. this.eleReg.exec(element.eAllowDeviation);
  3863. // console.log(RegExp.$1)
  3864. // console.log(RegExp.$2)
  3865. element.allow = RegExp.$1 ? RegExp.$1 : "";
  3866. element.deviation = RegExp.$2 ? RegExp.$2 : "";
  3867. });
  3868. this.eleForm.elementList = res.data.data;
  3869. this.importVisible = false;
  3870. })
  3871. .finally(() => {
  3872. e.target.value = "";
  3873. });
  3874. },
  3875. visiblechange(value, data) {
  3876. this.$set(data, "moreShow", value);
  3877. },
  3878. bianhua2() {
  3879. this.excelSortTag2 = false;
  3880. this.$nextTick(() => {
  3881. this.excelSortTag2 = true;
  3882. });
  3883. },
  3884. //私有树的元素表修改排序
  3885. privateTableSort() {
  3886. if (!this.curTreeData.id) {
  3887. this.$message({
  3888. type: "warning",
  3889. message: "请先选择需要排序的节点",
  3890. });
  3891. return;
  3892. }
  3893. this.tableSortList = this.formData.map((form, index) => {
  3894. return {
  3895. sort: index + 1,
  3896. nodeName: form.tableName,
  3897. pkeyId: form.pkeyId,
  3898. };
  3899. });
  3900. // this.excelSortTag = true;
  3901. // this.excelSortTag2 = true;
  3902. this.sortTableList = JSON.parse(JSON.stringify(this.tableListByType));
  3903. this.$nextTick(() => {
  3904. this.$refs.tableSortRef.show(this.sortTableList);
  3905. });
  3906. },
  3907. editPrivateSort(listArr) {
  3908. console.log(listArr,'list');
  3909. let finalList=[]
  3910. listArr.forEach(item=>{
  3911. finalList.push(...item.list)
  3912. })
  3913. this.sortProLoad = true;
  3914. wbsTreePrivateTableSort(finalList).then(() => {
  3915. this.sortProLoad = false;
  3916. this.$message({
  3917. type: "success",
  3918. message: "排序成功!",
  3919. });
  3920. this.updateNodeTable();
  3921. }).finally(()=>{
  3922. this.sortProLoad = false;
  3923. });
  3924. },
  3925. //解析元素数据类型
  3926. eTypeFormatter(row) {
  3927. let text = "";
  3928. for (let i = 0; i < this.dataTypeList.length; i++) {
  3929. if (this.dataTypeList[i].dictKey == row.eType) {
  3930. text = this.dataTypeList[i].dictValue;
  3931. break;
  3932. }
  3933. }
  3934. return text;
  3935. },
  3936. //跳转到公式配置页面
  3937. toFormulaEdit(row, type) {
  3938. this.curEleTable.hasPartFormula = row.hasPartFormula;
  3939. this.formulaCurRow = row;
  3940. this.formulaCurRow.globaltype = type;
  3941. if (type === 10) {
  3942. this.formulaCompVisible1 = true;
  3943. this.formulaCurRow.elementType = false;
  3944. this.istableType = true;
  3945. } else {
  3946. this.formulaCompVisible = true;
  3947. }
  3948. },
  3949. //关闭公式弹窗
  3950. closeformulaComp() {
  3951. console.log("关闭");
  3952. selectFormElements(this.curEleTable.pkeyId, { type: 0 }).then((res) => {
  3953. this.editEleListFilter = res.data.data;
  3954. this.editEleListAll = [].concat(this.editEleListFilter);
  3955. });
  3956. },
  3957. //关闭公式弹窗
  3958. closeformulaComp1() {
  3959. console.log("关闭");
  3960. selectFormElements(this.curEleTable.pkeyId, { type: 0 }).then((res) => {
  3961. this.editEleListFilter = res.data.data;
  3962. this.editEleListAll = [].concat(this.editEleListFilter);
  3963. });
  3964. },
  3965. getNodeTypelist() {
  3966. let code = "name_rule";
  3967. getDictionary({
  3968. code,
  3969. }).then((res) => {
  3970. this.nodeTypelist1 = res.data.data;
  3971. });
  3972. },
  3973. getNodeTypelistData() {
  3974. const type = this.wbsType;
  3975. let code = "";
  3976. if (type === 5) {
  3977. code = "lar_node_type"; //征拆
  3978. } else if (type === 2) {
  3979. code = "trial_node_type"; //试验
  3980. } else if (type === 3) {
  3981. code = "meter_node_type"; //计量
  3982. } else {
  3983. {
  3984. code = "wbs_node_type"; //质检
  3985. }
  3986. }
  3987. getDictionary({
  3988. code,
  3989. }).then((res) => {
  3990. this.nodeTypelist = res.data.data;
  3991. res.data.data.forEach((element) => {
  3992. element.dictKey = Number(element.dictKey);
  3993. });
  3994. this.nodeTypelist = res.data.data;
  3995. });
  3996. },
  3997. getMajorDataTypeList() {
  3998. // if (this.majorDataTypeList.length > 1) {
  3999. // return;
  4000. // }
  4001. getDictionary({
  4002. code: "major_data_type",
  4003. }).then((res) => {
  4004. res.data.data.forEach((element) => {
  4005. element.dictKey = Number(element.dictKey);
  4006. });
  4007. // this.majorDataTypeList = res.data.data;
  4008. this.majorDataTypeList = res.data.data.filter(
  4009. (item) => item.dictKey != 0
  4010. );
  4011. });
  4012. },
  4013. getTableFileTypeList(){
  4014. if (this.tableFileTypeList.length > 1) {
  4015. return;
  4016. }
  4017. getDictionaryBiz({
  4018. code: "table_file_type",
  4019. }).then((res) => {
  4020. res.data.data.forEach((element) => {
  4021. element.dictKey =element.dictKey
  4022. });
  4023. this.tableFileTypeList = res.data.data;
  4024. });
  4025. },
  4026. getTableTypelist() {
  4027. const type = this.wbsType;
  4028. if (this.tableTypelist.length > 1) {
  4029. return;
  4030. }
  4031. let code = "";
  4032. if (type === 5) {
  4033. code = "table_type"; //征拆
  4034. } else if (type === 2) {
  4035. code = "trial_table_type"; //试验
  4036. } else {
  4037. code = "table_type"; //质检
  4038. }
  4039. getDictionary({
  4040. // code: "table_type",
  4041. // code: type === 2 ? "trial_table_type" : "table_type",
  4042. code,
  4043. }).then((res) => {
  4044. res.data.data.forEach((element) => {
  4045. element.dictKey = Number(element.dictKey);
  4046. });
  4047. this.tableTypelist = res.data.data;
  4048. });
  4049. },
  4050. getDataTypelist() {
  4051. if (this.dataTypeList.length > 1) {
  4052. return;
  4053. }
  4054. getDictionary({
  4055. code: "data_type",
  4056. }).then((res) => {
  4057. res.data.data.forEach((element) => {
  4058. element.dictKey = Number(element.dictKey);
  4059. });
  4060. this.dataTypeList = res.data.data;
  4061. });
  4062. },
  4063. getOwnerTypelist() {
  4064. if (this.ownerTypeList.length > 1) {
  4065. return;
  4066. }
  4067. getDictionary({
  4068. code: "owner_type",
  4069. }).then((res) => {
  4070. res.data.data.forEach((element) => {
  4071. element.dictKey = Number(element.dictKey);
  4072. });
  4073. this.ownerTypeList = res.data.data;
  4074. });
  4075. },
  4076. getStandardTypeOptions() {
  4077. getDictionary({
  4078. code: "classification",
  4079. }).then((res) => {
  4080. res.data.data.forEach((element) => {
  4081. element.dictKey = Number(element.dictKey);
  4082. });
  4083. // 定义要过滤的 dictKey 值
  4084. const targetKeys = [1, 2, 3, 4, 5];
  4085. // 过滤数组
  4086. const filteredOptions = res.data.data.filter((item) =>
  4087. targetKeys.includes(item.dictKey)
  4088. );
  4089. this.standardTypeOptions = filteredOptions;
  4090. });
  4091. },
  4092. changeStandType(val) {
  4093. let parentId = "";
  4094. this.standardTypeOptions.forEach((item) => {
  4095. if (item.dictKey == val) {
  4096. parentId = item.id; // 找到匹配项,提取 parentId
  4097. }
  4098. });
  4099. getChildList(1, 10000, parentId).then((res) => {
  4100. res.data.data.forEach((element) => {
  4101. element.dictKey = Number(element.dictKey);
  4102. });
  4103. this.unitOptions = res.data.data;
  4104. this.unitOptions = this.unitOptions.filter(
  4105. (item) => item.dictKey != -1
  4106. );
  4107. });
  4108. },
  4109. formatCat(row, column, cellValue) {
  4110. for (let i = 0; i < this.nodeTypelist.length; i++) {
  4111. if (this.nodeTypelist[i].dictKey == cellValue) {
  4112. return this.nodeTypelist[i].dictValue;
  4113. }
  4114. }
  4115. return cellValue;
  4116. //console.log(cellValue)
  4117. },
  4118. formatTableType(row, column, cellValue) {
  4119. for (let i = 0; i < this.tableTypelist.length; i++) {
  4120. if (this.tableTypelist[i].dictKey == cellValue) {
  4121. return this.tableTypelist[i].dictValue;
  4122. }
  4123. }
  4124. return cellValue;
  4125. //console.log(cellValue)
  4126. },
  4127. formatOwner(row, column, cellValue) {
  4128. for (let i = 0; i < this.ownerTypeList.length; i++) {
  4129. if (this.ownerTypeList[i].dictKey == cellValue) {
  4130. return this.ownerTypeList[i].dictValue;
  4131. }
  4132. }
  4133. return cellValue;
  4134. //console.log(cellValue)
  4135. },
  4136. formatdataType(row, column, cellValue) {
  4137. for (let i = 0; i < this.dataTypeList.length; i++) {
  4138. if (this.dataTypeList[i].dictKey == cellValue) {
  4139. return this.dataTypeList[i].dictValue;
  4140. }
  4141. }
  4142. return cellValue;
  4143. },
  4144. formMajorType(row, column, cellValue) {
  4145. for (let i = 0; i < this.majorDataTypeList.length; i++) {
  4146. if (this.majorDataTypeList[i].dictKey == cellValue) {
  4147. return this.majorDataTypeList[i].dictValue;
  4148. }
  4149. }
  4150. return cellValue;
  4151. },
  4152. // filterNode(value, data) {
  4153. // if (!value) return true;
  4154. // return data.title.indexOf(value) !== -1;
  4155. // },
  4156. getReturnNode(node, _array, value) {
  4157. let isPass =
  4158. node.data && node.data.title && node.data.title.indexOf(value) !== -1;
  4159. isPass ? _array.push(isPass) : "";
  4160. if (!isPass && node.level != 1 && node.parent) {
  4161. this.getReturnNode(node.parent, _array, value);
  4162. }
  4163. },
  4164. filterNode(value, data, node) {
  4165. if (!value) {
  4166. return true;
  4167. }
  4168. let level = node.level;
  4169. let _array = []; //这里使用数组存储 只是为了存储值。
  4170. this.getReturnNode(node, _array, value);
  4171. let result = false;
  4172. _array.forEach((item) => {
  4173. result = result || item;
  4174. });
  4175. return result;
  4176. },
  4177. //#endregion
  4178. //#region wbs私有树排序
  4179. async sortpai(data) {
  4180. console.log(data);
  4181. await this.findWbsTreePrivateSameLevel({
  4182. parentId: data.parentId,
  4183. projectId: this.projectid,
  4184. wbsId: this.id,
  4185. });
  4186. this.sortTag = true;
  4187. this.sortTag2 = true;
  4188. },
  4189. editSort() {
  4190. this.wbsTreePrivateSort();
  4191. },
  4192. bianhua() {
  4193. this.sortTag2 = false;
  4194. this.$nextTick(() => {
  4195. this.sortTag2 = true;
  4196. });
  4197. },
  4198. async wbsTreePrivateSort() {
  4199. this.sureSortload = true;
  4200. //wbs私有树节点手动排序
  4201. const { data: res } = await wbsTreePrivateSort(this.sort);
  4202. console.log(res);
  4203. if (res.code == 200) {
  4204. this.sortTag = false;
  4205. this.sortTag2 = false;
  4206. this.$message({
  4207. type: "success",
  4208. message: "排序成功!",
  4209. });
  4210. this.sureSortload = false;
  4211. this.isShowTree = false;
  4212. setTimeout(() => {
  4213. this.isShowTree = true;
  4214. }, 100);
  4215. // window.location.reload();
  4216. // this.getLazytreessss();
  4217. }
  4218. },
  4219. async findWbsTreePrivateSameLevel(da) {
  4220. //wbs私有树同级节点接口
  4221. const { data: res } = await findWbsTreePrivateSameLevel(da);
  4222. if (res.code == 200) {
  4223. this.sort = res.data;
  4224. }
  4225. },
  4226. async getLazytreessss() {
  4227. const type = this.wbsType;
  4228. const { data: res } = await getLazytree(
  4229. this.id,
  4230. 0,
  4231. this.userInfo.tenant_id,
  4232. this.projectid,
  4233. { wbsType: type }
  4234. );
  4235. console.log(res);
  4236. if (res.code == 200) {
  4237. this.treeData = res.data;
  4238. }
  4239. },
  4240. //#endregion
  4241. //#region 关联清表
  4242. async getList(da) {
  4243. //获取清表模板信息
  4244. const { data: res } = await getList(da);
  4245. console.log(res);
  4246. if (res.code === 200 && res.msg === "操作成功") {
  4247. this.GLExcelData = res.data.records;
  4248. }
  4249. },
  4250. async tabLazytreeAll() {
  4251. //清表树信息
  4252. this.GLExcelLoading = true;
  4253. const { data: res } = await tabLazytreeAll({
  4254. modeId: this.GLExcelFrom.name,
  4255. name: this.GLExcelFrom.search,
  4256. });
  4257. this.GLExcelLoading = false;
  4258. console.log(res);
  4259. if (res.code === 200 && res.msg === "操作成功") {
  4260. this.exceldata = res.data;
  4261. }
  4262. },
  4263. Associationlist(scope) {
  4264. //关联清表点击事件
  4265. console.log(scope.row);
  4266. this.GLExcel = true;
  4267. this.getList({
  4268. current: 1,
  4269. size: 100000,
  4270. parentId: 0,
  4271. });
  4272. this.GLExcelFrom.name = scope.row.modeId;
  4273. setTimeout(() => {
  4274. this.$refs.tree.setCheckedKeys([scope.row.excelId]);
  4275. }, 2000);
  4276. this.GLExcelFrom.initTableId = scope.row.initTableId;
  4277. this.GLExcelFrom.id = scope.row.pkeyId;
  4278. this.GLExcelFrom.excelId = scope.row.excelId;
  4279. this.GLExcelFrom.ids = scope.row.id;
  4280. this.GLExcelFrom.initTableName = scope.row.initTableName;
  4281. this.GLExcelFrom.pkeyId = scope.row.pkeyId;
  4282. },
  4283. changetherr() {
  4284. //清表类型选择框change事件
  4285. if (this.GLExcelFrom.name != "") {
  4286. this.GLExcelFrom.search = "";
  4287. this.tabLazytreeAll();
  4288. }
  4289. },
  4290. GLExcelMD() {
  4291. //弹框关闭事件
  4292. this.GLExcelFrom.name = "";
  4293. this.GLExcelFrom.search = "";
  4294. this.GLExcelFrom.id = "";
  4295. this.exceldata = [];
  4296. this.$refs.tree.setCheckedKeys([]);
  4297. this.GLExcel = false;
  4298. },
  4299. checkchange(data) {
  4300. //节点选中回调
  4301. if (this.$refs.tree.getCheckedNodes().length === 0) {
  4302. this.$refs.tree.setCheckedKeys([]);
  4303. } else if (this.$refs.tree.getCheckedNodes().length >= 1) {
  4304. this.$refs.tree.setCheckedKeys([data.id]);
  4305. }
  4306. },
  4307. async saveLinkTab() {
  4308. // 保存按钮
  4309. let checkNodes = this.$refs.tree.getCheckedNodes();
  4310. if (checkNodes.length > 0) {
  4311. let node = checkNodes[checkNodes.length - 1];
  4312. if (node.fileType != 3) {
  4313. this.$message({
  4314. type: "warning",
  4315. message: "请先上传Excel表",
  4316. });
  4317. return;
  4318. }
  4319. try {
  4320. const { data: res } = await saveLinkTab({
  4321. exceTabId: node.id,
  4322. tabId: this.GLExcelFrom.id,
  4323. updateAll:this.isNodeType? false:true,
  4324. });
  4325. if (res.code === 200) {
  4326. this.$message({
  4327. type: "success",
  4328. message: "关联清表成功",
  4329. });
  4330. // 保存原始的pkeyId
  4331. const originalPkeyId = this.GLExcelFrom.pkeyId;
  4332. if (this.isNodeType) {
  4333. // 加载节点类型的数据
  4334. const response = await selectByNodeTable(this.curTreeData.id, this.projectid, this.id);
  4335. if (response.data.data && response.data.data.length) {
  4336. this.formData = response.data.data;
  4337. // 查找并更新initTableId
  4338. const matchedItem = this.formData.find(ele => ele.pkeyId === originalPkeyId);
  4339. if (matchedItem) {
  4340. this.GLExcelFrom.initTableId = matchedItem.initTableId;
  4341. }
  4342. // 调用rightClick方法
  4343. this.rightClick(
  4344. this.GLExcelFrom.id,
  4345. this.GLExcelFrom.excelId,
  4346. this.GLExcelFrom.ids,
  4347. this.GLExcelFrom.initTableName,
  4348. this.GLExcelFrom.initTableId
  4349. );
  4350. } else {
  4351. this.formData = [];
  4352. }
  4353. } else {
  4354. // 非节点类型,重新加载整个树
  4355. await this.reloadEntireTree();
  4356. }
  4357. this.GLExcel = false;
  4358. }
  4359. } catch (error) {
  4360. console.error("关联清表失败:", error);
  4361. this.$message({
  4362. type: "error",
  4363. message: "关联清表失败",
  4364. });
  4365. }
  4366. } else {
  4367. this.$message({
  4368. type: "warning",
  4369. message: "请先设置清表",
  4370. });
  4371. }
  4372. },
  4373. getReturnNode2(node, _array, value) {
  4374. let isPass =
  4375. node.data && node.data.name && node.data.name.indexOf(value) !== -1;
  4376. isPass ? _array.push(isPass) : "";
  4377. if (!isPass && node.level != 1 && node.parent) {
  4378. this.getReturnNode2(node.parent, _array, value);
  4379. }
  4380. },
  4381. filterNode222(value, data, node) {
  4382. if (!value) {
  4383. return true;
  4384. }
  4385. let level = node.level;
  4386. let _array = []; //这里使用数组存储 只是为了存储值。
  4387. this.getReturnNode2(node, _array, value);
  4388. let result = false;
  4389. _array.forEach((item) => {
  4390. result = result || item;
  4391. });
  4392. return result;
  4393. },
  4394. //#endregion
  4395. //#region 节点参数
  4396. nodeInfo(data) {
  4397. //节点参数按钮
  4398. this.keymap();
  4399. //console.log(data)
  4400. let pid = data.primaryKeyId ? data.primaryKeyId : data.pKeyId;
  4401. this.jiedianId = pid;
  4402. this.parameters(pid);
  4403. this.nodeInfoVisible = true;
  4404. },
  4405. closenodeInfoVisible() {
  4406. this.nodeInfoTable = [];
  4407. this.nodeInfoVisible = false;
  4408. },
  4409. addNodeInfoTable() {
  4410. //添加节点参数数据
  4411. this.nodeInfoTable.unshift({
  4412. k: "",
  4413. v: "",
  4414. remark: "",
  4415. nodeId: this.jiedianId,
  4416. type: 1,
  4417. });
  4418. console.log(this.nodeInfoTable);
  4419. },
  4420. refreshnfoTable() {
  4421. //刷新表格
  4422. let prams = {
  4423. nodeId: this.jiedianId,
  4424. type: 1,
  4425. projectId: this.projectid,
  4426. };
  4427. this.nodeInfoTableLoad = true;
  4428. refrehPram(prams).then((res) => {
  4429. this.nodeInfoTableLoad = false;
  4430. if (res.data.code == 200) {
  4431. this.$message.success("刷新成功");
  4432. }
  4433. });
  4434. },
  4435. delNodeInfo(key, obj) {
  4436. this.delids.push(obj.id);
  4437. //设置参数名称中的删除按钮
  4438. this.namelists.splice(key, 1);
  4439. },
  4440. delNodeInfoss(key, obj) {
  4441. this.delids.push(obj.id);
  4442. //节点参数
  4443. this.nodeInfoTable.splice(key, 1);
  4444. },
  4445. setNodeParameters() {
  4446. //打开设置节点参数弹框按钮
  4447. this.infoNameVisible = true;
  4448. this.namelists = [...this.namelist];
  4449. },
  4450. async setParameterName() {
  4451. //设置参数名称中添加节点参数按钮
  4452. // wbsId: this.jiedianId
  4453. this.namelists.unshift({
  4454. name: "",
  4455. remark: "",
  4456. k: "",
  4457. type: 0,
  4458. nodeId: this.jiedianId,
  4459. });
  4460. },
  4461. async nodeInfoSave() {
  4462. //节点参数弹框保存按钮
  4463. if (this.nodeInfoTable) {
  4464. // if (this.nodeInfoTable.length == 0) {
  4465. // await this.saveOrUpdateBatch({projectId:this.projectid,nodeId:this.jiedianId,type:1,delIds:this.delids,wps:[
  4466. // {
  4467. // nodeId: this.jiedianId,
  4468. // type: -1,
  4469. // },
  4470. // ]});
  4471. // this.nodeInfoVisible = false;
  4472. // this.delIds=[];
  4473. // this.$message({
  4474. // type: "success",
  4475. // message: "保存参数节点成功!",
  4476. // });
  4477. // return;
  4478. // }
  4479. console.log(this.namelist);
  4480. let tag = true;
  4481. this.nodeInfoTable.forEach((val) => {
  4482. if (!val.k | !val.v) {
  4483. return (tag = false);
  4484. }
  4485. //if (!val.name) {
  4486. for (let i = 0; i < this.namelist.length; i++) {
  4487. if (this.namelist[i].k == val.k) {
  4488. val.name = this.namelist[i].name;
  4489. return;
  4490. }
  4491. }
  4492. //}
  4493. });
  4494. if (tag) {
  4495. this.nodeInfoSaveload = true;
  4496. await this.saveOrUpdateBatch({
  4497. scopeType: 10,
  4498. projectId: this.projectid,
  4499. nodeId: this.jiedianId,
  4500. wps: this.nodeInfoTable,
  4501. type: 1,
  4502. delIds: this.delids,
  4503. });
  4504. this.delIds = [];
  4505. this.$message({
  4506. type: "success",
  4507. message: "设置参数节点成功!",
  4508. });
  4509. this.nodeInfoSaveload = false;
  4510. this.parameters(this.jiedianId);
  4511. // this.nodeInfoVisible = false;
  4512. } else {
  4513. this.$message({
  4514. type: "error",
  4515. message: "请填写所有的参数名称和参数值!",
  4516. });
  4517. }
  4518. } else {
  4519. this.$message({
  4520. type: "error",
  4521. message: "请先设置参数节点!",
  4522. });
  4523. }
  4524. },
  4525. async addParameterName() {
  4526. //设置参数名称中的保存按钮
  4527. if (this.namelists.length) {
  4528. let tag = true;
  4529. this.namelists.forEach((val) => {
  4530. if (!val.name || !val.k) {
  4531. return (tag = false);
  4532. }
  4533. });
  4534. if (tag) {
  4535. await this.saveOrUpdateBatch({
  4536. scopeType: 10,
  4537. projectId: this.projectid,
  4538. nodeId: this.jiedianId,
  4539. wps: this.namelists,
  4540. type: 0,
  4541. delIds: this.delids,
  4542. }); //保存设置参数
  4543. this.infoNameVisible = false;
  4544. this.delIds = [];
  4545. this.keymap();
  4546. } else {
  4547. this.$message({
  4548. type: "error",
  4549. message: "请填写所有的参数名称和参数值KEY!",
  4550. });
  4551. }
  4552. } else {
  4553. this.$message({
  4554. type: "warning",
  4555. message: "请先添加参数",
  4556. });
  4557. }
  4558. },
  4559. closeParameter() {
  4560. //设置参数名称,关闭按钮
  4561. this.namelists = [];
  4562. this.infoNameVisible = false;
  4563. },
  4564. async parameters(wbsId) {
  4565. //获取接待你参数列表
  4566. const { data: res } = await parameters({ wbsId });
  4567. console.log(res);
  4568. if (res.code == 200) {
  4569. if (Array.isArray(res.data)) {
  4570. this.nodeInfoTable = res.data;
  4571. }
  4572. }
  4573. },
  4574. async saveOrUpdateBatch(da) {
  4575. //保存
  4576. const { data: res } = await saveOrUpdateBatch(da);
  4577. this.delids = [];
  4578. console.log(res);
  4579. },
  4580. async keymap() {
  4581. //节点参数枚举
  4582. const { data: res } = await keymap();
  4583. console.log(res);
  4584. if (res.code == 200) {
  4585. this.namelist = res.data;
  4586. }
  4587. },
  4588. //#endregion
  4589. //#region 调整表单
  4590. adjustExcel(pkeyId, excelId) {
  4591. //调整表单
  4592. this.GLExcelFrom.id = pkeyId;
  4593. this.GLExcelFrom.excelId = excelId;
  4594. this.getExcelHtml(pkeyId);
  4595. },
  4596. async getExcelHtml(pkeyId) {
  4597. const { data: res } = await getExcelHtml({ pkeyId });
  4598. console.log(res);
  4599. if (res.code === 200) {
  4600. localStorage.setItem("excelHtml", res.data);
  4601. this.adjustmentExcel = res.data;
  4602. this.excelHtml = true;
  4603. }
  4604. },
  4605. removeExcel() {
  4606. this.excelHtml = false;
  4607. },
  4608. //#endregion
  4609. //#region 编辑元素
  4610. async rightClick(pkeyId, excelId, id, initTableName, initTableId) {
  4611. await this.getExcelHtml2(pkeyId);
  4612. this.editElementQuery.pkeyId = pkeyId;
  4613. this.editElementQuery.excelId = excelId;
  4614. this.editElementQuery.id = id;
  4615. this.editElementQuery.initTableName = initTableName;
  4616. this.editElementQuery.initTableId = initTableId;
  4617. this.editElementQuery.pid = this.$route.query.pid;
  4618. this.editElementQuery.wbsid = this.$route.query.wbsid;
  4619. this.editElementQuery.nodeid = this.curTreeData.id;
  4620. this.editElementVisible = true;
  4621. },
  4622. hideEditElementVisible() {
  4623. this.editElementVisible = false;
  4624. // this.updateNodeTable();
  4625. if(this.isNodeType){
  4626. this.updateNodeTable();
  4627. }
  4628. },
  4629. async getExcelHtml2(pkeyId) {
  4630. const { data: res } = await getExcelHtml({ pkeyId });
  4631. console.log(res);
  4632. if (res.code === 200) {
  4633. localStorage.setItem("editElement", res.data);
  4634. }
  4635. },
  4636. //#endregion
  4637. //#region 元素表单信息
  4638. editEditElementForm() {
  4639. //标记元素
  4640. if (this.formData.length) {
  4641. let da = [];
  4642. this.formDatass = [...this.formData];
  4643. this.formDatass.forEach((val) => {
  4644. da.push({
  4645. tableType: val.tableType - 0,
  4646. tableOwner: val.tableOwner - 0,
  4647. pkeyId: val.pkeyId,
  4648. tableName: val.tableName,
  4649. fillRate: val.fillRate,
  4650. nodeType: val.nodeType - 0,
  4651. });
  4652. });
  4653. this.formDatass = da;
  4654. this.editElementFormTag = true;
  4655. }else{
  4656. this.$message({
  4657. type: "warning",
  4658. message: "当前列表无数据!",
  4659. });
  4660. }
  4661. },
  4662. editeditElementFormMF() {
  4663. //保存按钮
  4664. let da = [];
  4665. let tag = true;
  4666. this.formDatass.forEach((val) => {
  4667. if (!val.tableName || !val.tableType || !val.tableOwner) {
  4668. tag = false;
  4669. return;
  4670. } else {
  4671. da.push({
  4672. pkeyId: val.pkeyId,
  4673. nodeName: val.tableName,
  4674. tableType: val.tableType,
  4675. tableOwner: val.tableOwner,
  4676. fillRate: val.fillRate,
  4677. nodeType: val.nodeType,
  4678. });
  4679. }
  4680. });
  4681. if (tag) {
  4682. this.updateBatchNodeTableInfo2(da);
  4683. } else {
  4684. this.$message({
  4685. type: "success",
  4686. message: "请填写完整元素表单的所有信息!",
  4687. });
  4688. }
  4689. },
  4690. async updateBatchNodeTableInfo2(da) {
  4691. this.editeditElementFormMFLoading = true;
  4692. //共有编辑元素
  4693. const { data: res } = await updateBatchNodeTableInfo2(da);
  4694. if (res.code == 200) {
  4695. this.editElementFormTag = false;
  4696. this.updateNodeTable();
  4697. this.editeditElementFormMFLoading = false;
  4698. }
  4699. this.editeditElementFormMFLoading = false;
  4700. },
  4701. //#endregion
  4702. //获取节点展开路径
  4703. getExpandedKeys(node) {
  4704. //console.log(node)
  4705. let expandedKeys = [];
  4706. while (node.parent) {
  4707. expandedKeys.push(node.data.id);
  4708. node = node.parent;
  4709. }
  4710. setStore({
  4711. name: this.expandName,
  4712. content: expandedKeys,
  4713. type: true, //sessionStorage
  4714. });
  4715. //console.log(expandedKeys)
  4716. },
  4717. //触发节点参数
  4718. nodeInfoHandle() {
  4719. if (!this.curTreeData.id) {
  4720. this.$message({
  4721. type: "warning",
  4722. message: "请先选择节点",
  4723. });
  4724. return;
  4725. }
  4726. this.nodeInfo(this.curTreeData);
  4727. },
  4728. eleFormulaHandle() {
  4729. if (!this.curTreeData.id || !this.curTreeNode.id) {
  4730. this.$message({
  4731. type: "warning",
  4732. message: "请先选择节点",
  4733. });
  4734. return;
  4735. }
  4736. this.setLeftType(4, this.curTreeData, this.curTreeNode);
  4737. // this.showType = 2;
  4738. },
  4739. editNodeHandle() {
  4740. console.log(this.curTreeData, "this.curTreeData.id ");
  4741. if (!this.curTreeData.id || !this.curTreeNode.id) {
  4742. this.$message({
  4743. type: "warning",
  4744. message: "请先选择节点",
  4745. });
  4746. return;
  4747. }
  4748. this.mixRatioTestIds = [];
  4749. // this.nodeTypeChange(53);
  4750. this.nodeTypeChange(this.curTreeData.nodeType);
  4751. this.dialogTitle = "编辑节点";
  4752. this.setLeftType(2, this.curTreeData, this.curTreeNode);
  4753. },
  4754. addNodeHandle() {
  4755. if (!this.curTreeData.id || !this.curTreeNode.id) {
  4756. this.$message({
  4757. type: "warning",
  4758. message: "请先选择节点",
  4759. });
  4760. return;
  4761. }
  4762. this.mixRatioTestIds = [];
  4763. // this.nodeTypeChange(53);
  4764. this.nodeTypeChange(this.curTreeData.nodeType);
  4765. this.dialogTitle = "新增节点";
  4766. this.setLeftType(1, this.curTreeData, this.curTreeNode);
  4767. },
  4768. copyNodeHandle() {
  4769. if (!this.curTreeData.id || !this.curTreeNode.id) {
  4770. this.$message({
  4771. type: "warning",
  4772. message: "请先选择节点",
  4773. });
  4774. return;
  4775. }
  4776. },
  4777. delNodeHandle() {
  4778. if (!this.curTreeData.id || !this.curTreeNode.id) {
  4779. this.$message({
  4780. type: "warning",
  4781. message: "请先选择节点",
  4782. });
  4783. return;
  4784. }
  4785. if (this.curTreeNode.level == 1) {
  4786. this.$message({
  4787. type: "warning",
  4788. message: "当前节点无法删除",
  4789. });
  4790. return;
  4791. }
  4792. this.deleNode(this.curTreeData, this.curTreeNode);
  4793. },
  4794. eleHandle() {
  4795. if (!this.curTreeData.id || !this.curTreeNode.id) {
  4796. this.$message({
  4797. type: "warning",
  4798. message: "请先选择节点",
  4799. });
  4800. return;
  4801. }
  4802. this.setLeftType(5, this.curTreeData, this.curTreeNode);
  4803. },
  4804. syncInfoHandle(item) {
  4805. if (this.curTreeData.primaryKeyId || this.curTreeData.pKeyId) {
  4806. this.$confirm("是否同步节点参数?", "提示", {
  4807. confirmButtonText: "确定",
  4808. cancelButtonText: "取消",
  4809. type: "warning",
  4810. }).then(() => {
  4811. this.syncBtnLoad = true;
  4812. this.menuoptions.forEach((ele) => {
  4813. if (item.value == ele.value) {
  4814. ele.load = true;
  4815. }
  4816. });
  4817. let pid = this.curTreeData.primaryKeyId
  4818. ? this.curTreeData.primaryKeyId
  4819. : this.curTreeData.pKeyId;
  4820. syncNodeParam(this.projectid, pid)
  4821. .then(() => {
  4822. this.$message({
  4823. type: "success",
  4824. message: "同步成功!",
  4825. });
  4826. })
  4827. .finally(() => {
  4828. this.syncBtnLoad = false;
  4829. this.menuoptions.forEach((ele) => {
  4830. if (item.value == ele.value) {
  4831. ele.load = false;
  4832. }
  4833. });
  4834. });
  4835. });
  4836. } else {
  4837. this.$message.warning("请先选择左侧节点");
  4838. }
  4839. },
  4840. //显示别名弹窗
  4841. aliasShow() {
  4842. this.aliasVisible = true;
  4843. if (this.nodeDetail.fullName) {
  4844. this.aliasArr = this.nodeDetail.fullName.split(",");
  4845. } else {
  4846. this.aliasArr = [];
  4847. }
  4848. this.aliasInput = "";
  4849. },
  4850. addAlias() {
  4851. if (this.aliasInput) {
  4852. this.aliasArr.push(this.aliasInput);
  4853. this.aliasInput = "";
  4854. }
  4855. },
  4856. delAlias(index) {
  4857. this.aliasArr.splice(index, 1);
  4858. },
  4859. saveAliasHandle() {
  4860. this.nodeDetail.fullName = this.aliasArr.join(",");
  4861. if (this.editType == 1) {
  4862. //新增
  4863. this.aliasVisible = false;
  4864. } else if (this.editType == 2) {
  4865. //编辑 私有
  4866. privateSubmitFullName(
  4867. this.nodeDetail.pKeyId,
  4868. this.nodeDetail.fullName
  4869. ).then(() => {
  4870. this.$message({
  4871. type: "success",
  4872. message: "保存成功",
  4873. });
  4874. this.aliasVisible = false;
  4875. });
  4876. }
  4877. },
  4878. async syncNodeTableHandle(data) {
  4879. this.isAdd=''
  4880. console.log('后管数据同步',data);
  4881. this.curTreeData=data
  4882. this.isShowLeft=false
  4883. // await this.getNodeStatusData()
  4884. if(this.syncListDialog){
  4885. return
  4886. }
  4887. this.syncForm.range='1'
  4888. this.proSyncTag=true
  4889. if(this.$refs.syncProTree){
  4890. this.$refs.syncProTree.setCheckedKeys([])
  4891. }
  4892. if(this.$refs.proTable){
  4893. this.$refs.proTable.clearSelection()
  4894. }
  4895. this.isShowTable=true
  4896. this.getTypeOptions()
  4897. this.getRangeOptions()
  4898. this.getCheckIdList()
  4899. let pid=data.primaryKeyId?data.primaryKeyId:data.pKeyId
  4900. this.getTempProjectList(pid)
  4901. },
  4902. syncProjectHandle(data) {
  4903. this.$confirm("是否同步节点【" + data.title + "】到合同段?", "提示", {
  4904. confirmButtonText: "确定",
  4905. cancelButtonText: "取消",
  4906. type: "warning",
  4907. }).then(() => {
  4908. let notify = this.$notify({
  4909. title: "提示",
  4910. message: "节点数据同步中...",
  4911. duration: 0,
  4912. });
  4913. let pid = data.primaryKeyId ? data.primaryKeyId : data.pKeyId;
  4914. syncNodeinfo(pid)
  4915. .then(() => {
  4916. this.updateNodeTable();
  4917. this.$message({
  4918. type: "success",
  4919. message: "同步成功",
  4920. });
  4921. })
  4922. .catch(() => {
  4923. this.$message({
  4924. type: "error",
  4925. message: "同步失败",
  4926. });
  4927. })
  4928. .finally(() => {
  4929. notify.close();
  4930. });
  4931. });
  4932. },
  4933. //同步元素表单排序到合同段
  4934. async syncSortHandle(data) {
  4935. console.log('同步到合同');
  4936. this.isShowLeft=false
  4937. this.curTreeData=data
  4938. if(this.syncListDialog){
  4939. return
  4940. }
  4941. // await this.getNodeStatusData()
  4942. this.syncForm.range='2'
  4943. this.proSyncTag=true
  4944. this.isShowTable=true
  4945. this.getTypeOptions()
  4946. this.getRangeOptions()
  4947. this.getCheckIdList()
  4948. selectByNodeTable(data.id, this.projectid, this.id).then((res) => {
  4949. if (res.data.data.length>0) {
  4950. this.preTableData = res.data.data;
  4951. } else {
  4952. this.preTableData = [];
  4953. }
  4954. });
  4955. },
  4956. typeTreeLoadNode(node, resolve) {
  4957. let pid = 0;
  4958. if (node.level != 0) {
  4959. pid = node.data.id;
  4960. }
  4961. tabTypeLazyTree(pid, this.projectid).then((res) => {
  4962. let arr = [];
  4963. if (Array.isArray(res.data.data)) {
  4964. arr = res.data.data;
  4965. }
  4966. return resolve(arr);
  4967. });
  4968. },
  4969. getTypeTreeDetail() {},
  4970. independent() {
  4971. this.$router.push({
  4972. path: "/project/independent",
  4973. query: {
  4974. pid: this.projectid,
  4975. wbsid: this.$route.query.wbsid,
  4976. wbsType: this.wbsType,
  4977. },
  4978. });
  4979. },
  4980. archiveTimeClick() {
  4981. this.$router.push({
  4982. path: "/project/archiveTime",
  4983. query: { pid: this.projectid, wbsid: this.$route.query.wbsid },
  4984. });
  4985. },
  4986. syncElectric(item) {
  4987. if (this.curTreeData.primaryKeyId || this.curTreeData.pKeyId) {
  4988. console.log("同步电签默认信息");
  4989. this.$confirm("是否同步电签默认信息?", "提示", {
  4990. confirmButtonText: "确定",
  4991. cancelButtonText: "取消",
  4992. type: "warning",
  4993. }).then(() => {
  4994. this.syncElectricLoad = true;
  4995. this.menuoptions.forEach((ele) => {
  4996. if (item.value == ele.value) {
  4997. ele.load = true;
  4998. }
  4999. });
  5000. let pid = this.curTreeData.primaryKeyId
  5001. ? this.curTreeData.primaryKeyId
  5002. : this.curTreeData.pKeyId;
  5003. syncProjecteVisa(this.projectid, pid)
  5004. .then(() => {
  5005. this.$message({
  5006. type: "success",
  5007. message: "同步成功!",
  5008. });
  5009. })
  5010. .finally(() => {
  5011. this.syncElectricLoad = false;
  5012. this.menuoptions.forEach((ele) => {
  5013. if (item.value == ele.value) {
  5014. ele.load = false;
  5015. }
  5016. });
  5017. });
  5018. });
  5019. } else {
  5020. this.$message.warning("请先选择左侧节点");
  5021. }
  5022. },
  5023. //节点参数 关联元素
  5024. linkEle(row) {
  5025. console.log(row, "row");
  5026. if (!row.id) {
  5027. this.$message.warning("请先保存数据,再点击关联元素");
  5028. } else {
  5029. this.linkEleVisible = true;
  5030. this.curParam = row;
  5031. getParamElements({
  5032. nodeId: this.curTreeData.id,
  5033. projectId: this.projectid,
  5034. paramId: row.id,
  5035. scopeType: 10,
  5036. }).then((res) => {
  5037. if (res.data.data.length) {
  5038. this.linkEleTableList = res.data.data;
  5039. } else {
  5040. this.linkEleTableList = [];
  5041. }
  5042. });
  5043. }
  5044. },
  5045. //关联元素弹框
  5046. tolinkEle(row) {
  5047. this.curLinkEleTable = row;
  5048. this.linkCheckVisible = true;
  5049. let pid = this.curTreeData.primaryKeyId
  5050. ? this.curTreeData.primaryKeyId
  5051. : this.curTreeData.pKeyId;
  5052. selectFormElements(row.id, { type: 3, nodeId: pid }).then((res) => {
  5053. res.data.data.forEach((ele) => {
  5054. ele.checked = false;
  5055. ele.show = true;
  5056. });
  5057. this.linkEleList = res.data.data;
  5058. this.linkEleListAll = [].concat(this.linkEleList);
  5059. });
  5060. },
  5061. //删除关联
  5062. delLink(data) {
  5063. this.$confirm("删除关联, 是否继续?", "提示", {
  5064. confirmButtonText: "确定",
  5065. cancelButtonText: "取消",
  5066. type: "warning",
  5067. })
  5068. .then(() => {
  5069. console.log(data);
  5070. delParamElements(data).then(() => {
  5071. this.$message({
  5072. type: "success",
  5073. message: "删除成功!",
  5074. });
  5075. getParamElements({
  5076. nodeId: this.curTreeData.id,
  5077. projectId: this.projectid,
  5078. paramId: this.curParam.id,
  5079. scopeType: 10,
  5080. }).then((res) => {
  5081. if (res.data.data.length) {
  5082. this.linkEleTableList = res.data.data;
  5083. } else {
  5084. this.linkEleTableList = [];
  5085. }
  5086. });
  5087. });
  5088. })
  5089. .catch(() => {});
  5090. },
  5091. //筛选元素
  5092. searchEle() {
  5093. this.linkEleList = this.linkEleListAll.filter((ele) => {
  5094. return ele.eName.indexOf(this.linkEleKey) > -1;
  5095. });
  5096. },
  5097. linkEleCheck(value, index) {
  5098. //console.log(value)
  5099. if (value) {
  5100. this.linkEleList.forEach((ele, i) => {
  5101. if (i != index) {
  5102. ele.checked = false;
  5103. }
  5104. });
  5105. }
  5106. },
  5107. //关联元素
  5108. saveLinkEle() {
  5109. let target = {};
  5110. this.linkEleList.forEach((e) => {
  5111. if (e.checked == true) {
  5112. target = { elementId: e.id, paramId: this.curParam.id };
  5113. }
  5114. });
  5115. if (JSON.stringify(target) !== "{}") {
  5116. specifiedParamElements(target).then((data) => {
  5117. this.linkCheckVisible = false;
  5118. getParamElements({
  5119. nodeId: this.curTreeData.id,
  5120. projectId: this.projectid,
  5121. paramId: this.curParam.id,
  5122. scopeType: 10,
  5123. }).then((res) => {
  5124. if (res.data.data.length) {
  5125. this.linkEleTableList = res.data.data;
  5126. } else {
  5127. this.linkEleTableList = [];
  5128. }
  5129. });
  5130. });
  5131. } else {
  5132. this.$message.warning("请先选择关联元素");
  5133. }
  5134. },
  5135. //树形控件菜单相关方法
  5136. mouseout() {
  5137. this.menuvisible = false;
  5138. },
  5139. //展示菜单
  5140. showMenu(e, data, node) {
  5141. e.preventDefault();
  5142. console.log(e, "e");
  5143. var x = e.pageX; //这个应该是相对于整个浏览器页面的x坐标,左上角为坐标原点(0,0)
  5144. var y = e.pageY; //这个应该是相对于整个浏览器页面的y坐标,左上角为坐标原点(0,0)
  5145. this.menutop = y;
  5146. this.menuleft = x;
  5147. this.menuvisible = true;
  5148. },
  5149. menuClick(e, item, data,node) {
  5150. this.curTreeData = data; //当前节点数据
  5151. this.curTreeNode = node; //当前节点数据
  5152. e.preventDefault();
  5153. if (item.key === "sort") {
  5154. this.sortpai(data);
  5155. } else if (item.key === "sync1") {
  5156. this.syncNodeTableHandle(data);
  5157. } //
  5158. else if (item.key === "sync3") {
  5159. this.syncSortHandle(data);
  5160. } else if (item.key === "add") {
  5161. this.addNodeHandle();
  5162. } else if (item.key === "edit") {
  5163. this.editNodeHandle();
  5164. } else if (item.key === "del") {
  5165. this.delNodeHandle();
  5166. } else if (item.value === "jdSync") {
  5167. this.syncInfoHandle(item);
  5168. } else if (item.value === "gsSync") {
  5169. this.$message({
  5170. type: "info",
  5171. message: "暂无相关接口!",
  5172. });
  5173. } else if (item.value === "dqSync") {
  5174. this.syncElectric(item);
  5175. }
  5176. },
  5177. //展示数据同步下拉框
  5178. showSyncbtn() {
  5179. this.isshowSyncbtn = !this.isshowSyncbtn;
  5180. },
  5181. getDictTypelist() {
  5182. if (this.dynamicDictList.length > 1) {
  5183. return;
  5184. }
  5185. getDictionary({
  5186. code: "land_field_dict",
  5187. }).then((res) => {
  5188. res.data.data.forEach((element) => {
  5189. element.dictKey = Number(element.dictKey);
  5190. });
  5191. this.dynamicDictList = res.data.data;
  5192. const filteredList = this.dynamicDictList.filter(
  5193. (item) => item.dictKey === 600 || item.dictKey === 0
  5194. );
  5195. this.dynamicDictList = filteredList;
  5196. });
  5197. },
  5198. getSelectFormElements(id) {
  5199. this.editEleTableloading = true;
  5200. let finalId=this.isNodeType?this.curEleTable.pkeyId:this.curEleTable.id
  5201. selectFormElements(finalId, {
  5202. type: 0,
  5203. search: this.searchinput,
  5204. }).then((res) => {
  5205. this.editEleTableloading = false;
  5206. this.editTable = res.data.data;
  5207. });
  5208. },
  5209. //编辑
  5210. handleEdit(index, row) {
  5211. this.curEleTable = row;
  5212. this.getSelectFormElements();
  5213. this.editDialogShow = true;
  5214. this.getDictTypelist();
  5215. },
  5216. //编辑元素信息(请谨慎操作)
  5217. clearsearchinput() {
  5218. this.getSelectFormElements();
  5219. },
  5220. searchinputChange() {
  5221. this.getSelectFormElements();
  5222. },
  5223. saveEles() {
  5224. if (this.editTable.length > 0) {
  5225. console.log( this.curEleTable,' this.curEleTable');
  5226. this.saveLoading = true;
  5227. updateBatchElements(
  5228. this.editTable,
  5229. this.curEleTable.initTableName
  5230. ).then(() => {
  5231. this.saveLoading = false;
  5232. this.editDialogShow = false;
  5233. this.updateNodeTable();
  5234. this.$message({
  5235. type: "success",
  5236. message: "保存成功!",
  5237. });
  5238. });
  5239. } else {
  5240. this.editDialogShow = false;
  5241. this.updateNodeTable();
  5242. this.$message({
  5243. type: "success",
  5244. message: "保存成功!",
  5245. });
  5246. }
  5247. },
  5248. //文件题名(全局按钮)
  5249. fileTitleHandle(){
  5250. this.getFileTableData()
  5251. this.fileTitleVisible = true;
  5252. },
  5253. changeRadio(val){
  5254. console.log(val,'val');
  5255. const fileItem = this.fileTableData[this.chooseFileIndex];
  5256. this.$set(fileItem, 'type', val);
  5257. },
  5258. //获取文件题名规则
  5259. getFileTableData(){
  5260. this.fileTableLoading=true
  5261. getNameRule(
  5262. { projectId:this.projectid}
  5263. ).then((res) => {
  5264. this.fileTableLoading=false
  5265. if(res.data.data){
  5266. this.fileTableData = res.data.data;
  5267. this.fileTableData.forEach((element) => {
  5268. element.roleNameVal = element.nameRule.split(",");
  5269. element.ruleName=element.nameVaule.split("-")
  5270. if(element.type===2){
  5271. const list=element.list
  5272. let arr=[]
  5273. let arrId=[]
  5274. list.forEach((ele) => {
  5275. arr.push(ele.nodeName)
  5276. arrId.push(ele.nodeId)
  5277. });
  5278. element.ruleSizeVal = arr.join('、');
  5279. element.ruleSizeValId=arrId
  5280. }else{
  5281. element.ruleSizeVal=''
  5282. element.ruleSizeValId=''
  5283. }
  5284. });
  5285. }else{
  5286. this.fileTableData =[]
  5287. }
  5288. });
  5289. },
  5290. //获取文件题名范围
  5291. getTitleRangeData(row){
  5292. this.fileTreeLoading=true
  5293. getTitleRange(
  5294. { projectId:this.projectid,
  5295. nameId:row.nameId,
  5296. wbsType:this.wbsType
  5297. }
  5298. ).then((res) => {
  5299. this.fileTreeLoading=false
  5300. if(res.data.data){
  5301. this.fileTreeData = res.data.data;
  5302. // this.deCheckTreeKeys = this.fileTreeData.filter(node => node.status === 11).map(node => node.id);
  5303. }else{
  5304. this.fileTreeData =[]
  5305. }
  5306. });
  5307. },
  5308. //选择题名范围
  5309. chooseFile(index,row){
  5310. const {ruleName}=row
  5311. if(ruleName&&ruleName.length>0){
  5312. this.chooseFileVisible = true;
  5313. this.chooseFileIndex= index;
  5314. this.deCheckTreeKeys=row.ruleSizeValId
  5315. this.getTitleRangeData(row)
  5316. }else{
  5317. this.$message.warning('请先选择文件题名规则');
  5318. }
  5319. },
  5320. checkFileSize(data,{checkedNodes,checkedKeys}){
  5321. let checkedTitles = checkedNodes.map(node => node.nodeName).join('、');
  5322. this.fileTableData[this.chooseFileIndex].isEdit1=false
  5323. const fileItem = this.fileTableData[this.chooseFileIndex];
  5324. this.$set(fileItem, 'ruleSizeVal', checkedTitles);
  5325. this.$set(fileItem, 'ruleSizeValId', checkedKeys);
  5326. this.deCheckTreeKeys=checkedKeys
  5327. },
  5328. getCheckedNodes (treeData, checkedKeys) {
  5329. let result = []
  5330. treeData.forEach(node => {
  5331. if (checkedKeys&&checkedKeys.includes(node.id)) {
  5332. result.push(node)
  5333. }
  5334. if (node.children) {
  5335. result = result.concat(getCheckedNodes(node.children, checkedKeys))
  5336. }
  5337. })
  5338. return result
  5339. },
  5340. saveFileSize(){
  5341. // const checkedNodes = this.getCheckedNodes(this.fileTreeData, this.deCheckTreeKeys).filter(node => node.status !== 11)
  5342. const checkedNodes = this.getCheckedNodes(this.fileTreeData, this.deCheckTreeKeys)
  5343. this.fileTableData[this.chooseFileIndex].ruleSizeValId = checkedNodes.map(node => node.id)
  5344. this.fileTableData[this.chooseFileIndex].ruleSizeVal = checkedNodes.map(node => node.nodeName).join('、')
  5345. this.chooseFileVisible = false;
  5346. this.isShowSize=false
  5347. setTimeout(()=>{
  5348. this.isShowSize=true
  5349. },100)
  5350. },
  5351. editRow(index,row){
  5352. console.log(row,'row');
  5353. this.$set(row, "isEdit", true);
  5354. this.$set(row, "isEdit1", true);
  5355. this.fileTitleModel.type=row.type
  5356. },
  5357. //保存文件题名
  5358. saveRow(index,row){
  5359. if(row.ruleName.length<1){
  5360. this.$message.warning('请选择文件题名规则')
  5361. return
  5362. }
  5363. if(!row.type){
  5364. this.$message.warning('请选择文件题名范围')
  5365. return
  5366. }
  5367. this.$set(row, "isEdit", false);
  5368. this.$set(row, "isEdit1", false)
  5369. const ruleName=row.ruleName.join('-')
  5370. let ruleSizeVal=''
  5371. if(row.type==1){
  5372. ruleSizeVal=''
  5373. }else{
  5374. ruleSizeVal=row.ruleSizeValId.join(',')
  5375. }
  5376. let nameRuleDtos={
  5377. nameId:row.nameId,
  5378. nameRule:ruleName,
  5379. nodeId:ruleSizeVal,
  5380. projectId:this.projectid,
  5381. type:this.fileTitleModel.type
  5382. }
  5383. saveOrUpdateNameRule(
  5384. [nameRuleDtos]
  5385. ).then((res) => {
  5386. if(res.data.code==200){
  5387. this.$message.success(res.data.msg)
  5388. this.getFileTableData()
  5389. }else{
  5390. this.$message.error(res.data.msg)
  5391. }
  5392. });
  5393. },
  5394. changeRoleName(data,row){
  5395. const originalData=this.nodeTypelist
  5396. const dictKeyToDictValueMap = originalData.reduce((acc, item) => {
  5397. acc[item.dictKey] = item.dictValue;
  5398. return acc;
  5399. }, {});
  5400. const result = data.map(dictKey => dictKeyToDictValueMap[dictKey]);
  5401. this.$set(row, "roleNameVal", result);
  5402. this.selectDiv=Math.random()
  5403. },
  5404. addRow(){
  5405. this.fileTableData.unshift({isEdit:true,isEdit1:true,})
  5406. this.fileTitleModel.type=''
  5407. },
  5408. refreshRow(){
  5409. this.getFileTableData()
  5410. },
  5411. delRow(index,row){
  5412. if(!row.nameId){
  5413. this.fileTableData.splice(index,1)
  5414. }else{
  5415. this.$confirm("确定将选择数据删除?", {
  5416. confirmButtonText: "确定",
  5417. cancelButtonText: "取消",
  5418. type: "warning"
  5419. })
  5420. .then(() => {
  5421. return deletedNameRule(
  5422. {nameId:row.nameId}
  5423. ).then((res) => {
  5424. if(res.data.code==200){
  5425. this.$message.success(res.data.msg)
  5426. this.getFileTableData()
  5427. }else{
  5428. this.$message.error(res.data.msg)
  5429. }
  5430. });
  5431. });
  5432. }
  5433. },
  5434. batchsaveFileSize(){
  5435. let isCansave=true
  5436. let saveArr=[]
  5437. this.fileTableData.forEach((ele)=>{
  5438. if(ele.ruleName.length<1||!ele.type){
  5439. this.$message.warning('请先完善相关信息')
  5440. isCansave=false
  5441. return
  5442. }
  5443. let ruleSizeVal=''
  5444. if(ele.type==1){
  5445. ruleSizeVal=''
  5446. }else{
  5447. ruleSizeVal=ele.ruleSizeValId.join(',')
  5448. }
  5449. const ruleName=ele.ruleName.join('-')
  5450. saveArr.push({
  5451. nameId:ele.nameId||'',
  5452. nameRule:ruleName,
  5453. nodeId:ruleSizeVal,
  5454. projectId:this.projectid,
  5455. type:ele.type
  5456. })
  5457. })
  5458. if(!isCansave){
  5459. return
  5460. }
  5461. this.saveFileLoading=true
  5462. saveOrUpdateNameRule(
  5463. saveArr
  5464. ).then((res) => {
  5465. this.saveFileLoading=false
  5466. if(res.data.code==200){
  5467. this.$message.success(res.data.msg)
  5468. this.getFileTableData()
  5469. }else{
  5470. this.$message.error(res.data.msg)
  5471. }
  5472. });
  5473. },
  5474. async proSyncbtn(){
  5475. console.log('项目数据同步');
  5476. this.isAdd=''
  5477. this.getTypeOptions()
  5478. this.getRangeOptions()
  5479. this.getCheckIdList()
  5480. this.proSyncTag=true
  5481. if(this.$refs.syncProTree){
  5482. this.$refs.syncProTree.setCheckedKeys([])
  5483. }
  5484. if(this.$refs.proTable){
  5485. this.$refs.proTable.clearSelection()
  5486. }
  5487. this.isShowLeft=true
  5488. this.isShowTable=false
  5489. },
  5490. getRangeOptions(){
  5491. getDictionary({
  5492. code: "wbs_snyc_range",
  5493. }).then((res) => {
  5494. this.rangeOptions = res.data.data;
  5495. });
  5496. },
  5497. getTypeOptions(){
  5498. getDictionary({
  5499. code: "wbs_sync_type",
  5500. }).then((res) => {
  5501. this.typeOptions = res.data.data;
  5502. });
  5503. },
  5504. handleCheckChange1(data){
  5505. getNodeStatus({ id:data.primaryKeyId}).then((res) => {
  5506. if(res.data.code==200){
  5507. if(res.data.data){
  5508. this.$message.success('该节点有同步任务,请取消选择')
  5509. }
  5510. }else{
  5511. this.$message.error(res.data.msg)
  5512. }
  5513. });
  5514. },
  5515. async handleCheckChange(_,{checkedKeys,halfCheckedNodes}) {
  5516. let ids=checkedKeys && checkedKeys.length ? checkedKeys.join(',') : ''
  5517. // await this.getNodeStatusData()
  5518. this.getTempProjectList(ids)
  5519. },
  5520. async getTempProjectList(ids){
  5521. if(ids.length>0){
  5522. //分页获取证书列表数据
  5523. const { data: res } = await getTempProject({
  5524. nodeIds:ids
  5525. });
  5526. if (res.code == 200) {
  5527. this.templateIdList = res.data;
  5528. }
  5529. }
  5530. },
  5531. async changeTemplateId(val){
  5532. if(!this.isShowTable){
  5533. return
  5534. }
  5535. let type=''
  5536. let projectId=''
  5537. let wbsId=''
  5538. for (let index = 0; index < this.templateIdList.length; index++) {
  5539. const elemet = this.templateIdList[index];
  5540. if(elemet.id==val){
  5541. type = elemet.type;
  5542. this.typeTem=elemet.type
  5543. projectId=elemet.id
  5544. wbsId=elemet.wbsId
  5545. break
  5546. }
  5547. }
  5548. if(type===2){
  5549. selectByNodeTable(this.curTreeData.id, projectId, wbsId).then((res) => {
  5550. if (res.data.data&&res.data.data.length > 0) {
  5551. this.preTableData = res.data.data;
  5552. } else {
  5553. this.preTableData = [];
  5554. }
  5555. });
  5556. }else{
  5557. const { data: res } = await findNodeTableByCondition1( this.curTreeData.id )
  5558. if (res.code === 200) {
  5559. console.log(Array.isArray(res.data));
  5560. if (Array.isArray(res.data)) {
  5561. this.preTableData = res.data
  5562. } else {
  5563. this.preTableData = []
  5564. }
  5565. }
  5566. }
  5567. },
  5568. async getCheckIdList(){
  5569. let code=this.wbsType!==1?'wbs_sync_contract_range':'wbs_sync_contract_quality'
  5570. getDictionary({
  5571. code: code,
  5572. }).then((res) => {
  5573. this.checkIdList = res.data.data;
  5574. });
  5575. },
  5576. closeProSyncTag(){
  5577. this.proSyncTag=false
  5578. this.syncForm={
  5579. range:'',
  5580. rangeName:'',
  5581. type:[],
  5582. typeName:'',
  5583. templateId:'',
  5584. templateName:'',
  5585. contractRange:[],
  5586. contractRangeName:'',
  5587. nodeId:'',
  5588. formIds:''};
  5589. this.preTableData=[]
  5590. this.isShowLeft=false
  5591. },
  5592. async saveProTag(){
  5593. this.syncForm.projectId=this.projectid
  5594. if(this.isShowLeft){
  5595. let ids=this.$refs.syncProTree.getCheckedKeys()
  5596. this.syncForm.nodeId=ids.join(',')
  5597. if(this.syncForm.nodeId===''){
  5598. this.$message.warning('请选择节点')
  5599. return
  5600. }
  5601. }else{
  5602. this.syncForm.nodeId=this.curTreeData.primaryKeyId
  5603. }
  5604. // await this.getNodeStatusData()
  5605. if(this.syncListDialog){
  5606. return
  5607. }
  5608. if(this.syncForm.rangeName==''){
  5609. for (let index = 0; index < this.rangeOptions.length; index++) {
  5610. const element =this. rangeOptions[index];
  5611. if(element.dictKey==this.syncForm.range){
  5612. this.syncForm.rangeName=element.dictValue
  5613. break
  5614. }
  5615. }
  5616. }
  5617. console.log(this.syncForm.range,'this.syncForm.range=');
  5618. if(this.syncForm.range===''){
  5619. this.$message.warning('请选择同步范围')
  5620. return
  5621. }
  5622. this.saveProTagLoading=true
  5623. addSync({
  5624. ...this.syncForm,
  5625. type:this.syncForm.type.join(','),
  5626. contractRange:this.syncForm.contractRange.join(',')
  5627. }
  5628. ).then((res) => {
  5629. console.log(res,'res');
  5630. this.saveProTagLoading=false
  5631. if(res.data.code==200){
  5632. this.$message.success(res.data.msg)
  5633. //this.getNodeStatusData()
  5634. console.log(res.data,'res.data');
  5635. this.syncListData.nodeNum=res.data.data.nodeNum
  5636. this.syncListData.nodeNumEnd=res.data.data.nodeNumEnd
  5637. if(this.isShowLeft){
  5638. this.isAdd=res.data.data.id
  5639. }else{
  5640. this.isAdd=''
  5641. }
  5642. this.syncListDialog=true
  5643. this.closeProSyncTag()
  5644. }else{
  5645. this.$message.error(res.data.msg)
  5646. this.saveProTagLoading=false
  5647. }
  5648. })
  5649. .finally(() => {
  5650. this.saveProTagLoading = false;
  5651. });
  5652. },
  5653. closeSyncListTag(){
  5654. this.syncListDialog=false;
  5655. this.updateNodeTable()
  5656. },
  5657. handleCheckAllChange(val) {
  5658. this.syncForm.type = val ? this.typeOptions.map(item => item.dictKey) : [];
  5659. this.isIndeterminate = false;
  5660. },
  5661. handleCheckAllChange1(val) {
  5662. this.syncForm.contractRange = val ? this.checkIdList.map(item => item.dictKey) : [];
  5663. this.isIndeterminate1 = false;
  5664. },
  5665. handleCheckedTypeChange(value){
  5666. let checkedCount = value.length;
  5667. this.checkAll = checkedCount === this.typeOptions.length;
  5668. this.isIndeterminate = checkedCount > 0 && checkedCount < this.typeOptions.length;
  5669. },
  5670. handleCheckedTypeChange1(value){
  5671. let checkedCount = value.length;
  5672. this.checkAll1 = checkedCount === this.checkIdList.length;
  5673. this.isIndeterminate1 = checkedCount > 0 && checkedCount < this.checkIdList.length;
  5674. },
  5675. handleSelectionChange(val) {
  5676. let arr = []
  5677. if(val.length>0){
  5678. if(this.syncForm.range==='2'){
  5679. for (let index = 0; index < val.length; index++) {
  5680. let i = val[index];
  5681. arr.push(i.pkeyId)
  5682. }
  5683. this.syncForm.formIds=arr.join(',')
  5684. }else{
  5685. for (let index = 0; index < val.length; index++) {
  5686. let i = val[index];
  5687. if( this.typeTem===2){
  5688. arr.push(i.pkeyId)
  5689. }else{
  5690. arr.push(i.id)
  5691. }
  5692. }
  5693. console.log(arr,'arr');
  5694. this.syncForm.formIds=arr.join(',')
  5695. }
  5696. }
  5697. },
  5698. async handleCommand(command,row){
  5699. // await this.getNodeStatusData()
  5700. if(this.syncListDialog){
  5701. return
  5702. }
  5703. this.checkRow=row
  5704. if(command==='a'){
  5705. this.$confirm("当前表单配置将同步到项目下所有相同表单,请谨慎同步!!!!!!", "表单同步提醒", {
  5706. distinguishCancelAndClose: true,
  5707. confirmButtonText: "确定",
  5708. cancelButtonText: "取消",
  5709. }).then(() => {
  5710. addSync({
  5711. projectId:this.projectid,
  5712. range:'3',
  5713. nodeId:row.pkeyId,
  5714. nodeName:this.curTreeData.title,
  5715. }
  5716. ).then((res) => {
  5717. if(res.data.code==200){
  5718. this.$message.success(res.data.msg)
  5719. }else{
  5720. this.$message.error(res.data.msg)
  5721. }
  5722. })
  5723. });
  5724. }else if(command==='b'){
  5725. this.syncTableDialog=true
  5726. this.isShowLeft=true
  5727. if(this.$refs.proTable1){
  5728. this.$refs.proTable1.clearSelection()
  5729. }
  5730. }
  5731. },
  5732. saveTableSync(){
  5733. this.saveTableSyncLoad=true
  5734. addSync({
  5735. projectId:this.projectid,
  5736. range:'4',
  5737. nodeId:this.checkRow.pkeyId,
  5738. nodeName:this.curTreeData.title,
  5739. formIds:this.formIds,
  5740. }
  5741. ).then((res) => {
  5742. this.saveTableSyncLoad=false
  5743. if(res.data.code==200){
  5744. this.$message.success(res.data.msg)
  5745. this.syncTableDialog=false
  5746. this.$refs.proTable1.clearSelection()
  5747. this.updateNodeTable()
  5748. }else{
  5749. this.$message.error(res.data.msg)
  5750. }
  5751. })
  5752. this.saveTableSyncLoad=false
  5753. },
  5754. handleNodeClick(data) {
  5755. selectByNodeTable(data.id, this.projectid, this.id).then((res) => {
  5756. if (res.data.data.length) {
  5757. this.preTableData1 = res.data.data;
  5758. } else {
  5759. this.preTableData1 = [];
  5760. }
  5761. });
  5762. },
  5763. handleSelectionChange1(val) {
  5764. if (val.length > 1) {
  5765. // 如果选择了多个,只保留最后一个
  5766. this.$nextTick(() => {
  5767. this.$refs.proTable1.clearSelection();
  5768. this.$refs.proTable1.toggleRowSelection(val.pop());
  5769. });
  5770. }
  5771. if(val.length>0){
  5772. this.formIds=val[0].pkeyId
  5773. }else{
  5774. this.formIds=''
  5775. }
  5776. },
  5777. async refreshData(){
  5778. this.refreshLoading=true
  5779. getNodeStatus({ id:this.curTreeData.primaryKeyId}).then((res) => {
  5780. this.refreshLoading=false
  5781. if(res.data.code==200){
  5782. if(res.data.data){
  5783. this.syncListData.nodeNum=res.data.data.nodeNum
  5784. this.syncListData.nodeNumEnd=res.data.data.nodeNumEnd
  5785. }else{
  5786. this.syncListData={
  5787. nodeNum:'',//同步节点数量
  5788. nodeNumEnd:''//已同步数量
  5789. }
  5790. }
  5791. }else{
  5792. this.syncListData={
  5793. nodeNum:'',//同步节点数量
  5794. nodeNumEnd:''//已同步数量
  5795. }
  5796. this.$message.error(res.data.msg)
  5797. }
  5798. }).finally(() => {
  5799. this.refreshLoading = false;
  5800. });
  5801. },
  5802. refreshData1(){
  5803. console.log('shuax');
  5804. this.refreshLoading1=true
  5805. getById({ id:this.isAdd}).then((res) => {
  5806. this.refreshLoading1=false
  5807. if(res.data.code==200){
  5808. if(res.data.data){
  5809. this.syncListData.nodeNum=res.data.data.nodeNum
  5810. this.syncListData.nodeNumEnd=res.data.data.nodeNumEnd
  5811. }else{
  5812. this.syncListData={
  5813. nodeNum:'',//同步节点数量
  5814. nodeNumEnd:''//已同步数量
  5815. }
  5816. }
  5817. }else{
  5818. this.syncListData={
  5819. nodeNum:'',//同步节点数量
  5820. nodeNumEnd:''//已同步数量
  5821. }
  5822. this.$message.error(res.data.msg)
  5823. }
  5824. });
  5825. },
  5826. getNodeStatusData(){
  5827. let ids=''
  5828. if(this.isShowLeft){
  5829. ids=this.$refs.syncProTree.getCheckedKeys()
  5830. ids=ids.join(',')
  5831. }
  5832. else{
  5833. ids=this.curTreeData.primaryKeyId
  5834. }
  5835. getNodeStatus({ id:ids}).then((res) => {
  5836. if(res.data.code==200){
  5837. if(res.data.data){
  5838. this.syncListData.nodeNum=res.data.data.nodeNum
  5839. this.syncListData.nodeNumEnd=res.data.data.nodeNumEnd
  5840. this.syncListDialog=true
  5841. }else{
  5842. this.syncListData={
  5843. nodeNum:'',//同步节点数量
  5844. nodeNumEnd:''//已同步数量
  5845. }
  5846. this.syncListDialog=false
  5847. }
  5848. }else{
  5849. this.syncListDialog=false
  5850. this.syncListData={
  5851. nodeNum:'',//同步节点数量
  5852. nodeNumEnd:''//已同步数量
  5853. }
  5854. this.$message.error(res.data.msg)
  5855. }
  5856. });
  5857. },
  5858. //基础数据管理
  5859. handleBasicClick(command) {
  5860. if (command === "code") {
  5861. this.codeDialog = true;
  5862. this.$refs.codeSetRef.show(this.projectid)
  5863. }else if(command === "rule") {
  5864. this.$router.push({
  5865. path: "/rule/manager",
  5866. query: {
  5867. id: this.id,
  5868. parentId:this.nodeDetail.parentId,
  5869. tenant_id: this.userInfo.tenant_id,
  5870. projectid: this.projectid,
  5871. },
  5872. });
  5873. }
  5874. },
  5875. //表单配置
  5876. handleCommandRow(command,row){
  5877. if(command=='a'){
  5878. this. rightClick( row.pkeyId,row.excelId, row.id,row.initTableName, row.initTableId)
  5879. }else if(command=='b'){
  5880. this.adjustExcel(row.pkeyId, row.excelId)
  5881. }else if(command=='c'){
  5882. this.handleEditFormula(0, row)
  5883. }
  5884. }
  5885. },
  5886. watch: {
  5887. "GLExcelFrom.search"(val) {
  5888. console.log(val);
  5889. if (this.exceldata) {
  5890. this.$refs.tree.filter(val);
  5891. }
  5892. },
  5893. 'syncForm.contractRange': {
  5894. handler(newVal) {
  5895. if (newVal && newVal.length) {
  5896. const selectedValues = newVal.map(key => {
  5897. const item = this.checkIdList.find(item => item.dictKey === key);
  5898. return item ? item.dictValue : key;
  5899. });
  5900. this.syncForm.contractRangeName = selectedValues.join(',');
  5901. } else {
  5902. this.syncForm.contractRangeName = '';
  5903. }
  5904. },
  5905. immediate: true
  5906. },
  5907. 'syncForm.templateId': {
  5908. handler(newVal) {
  5909. if (newVal && newVal.length) {
  5910. for (let index = 0; index < this.templateIdList.length; index++) {
  5911. const elemet = this.templateIdList[index];
  5912. if(elemet.id==newVal){
  5913. this.syncForm.templateName = elemet.name;
  5914. break
  5915. }
  5916. }
  5917. } else {
  5918. this.syncForm.rangeName = '';
  5919. }
  5920. },
  5921. immediate: true
  5922. },
  5923. 'syncForm.type': {
  5924. handler(newVal) {
  5925. if (newVal && newVal.length) {
  5926. const selectedValues = newVal.map(key => {
  5927. const item = this.typeOptions.find(item => item.dictKey === key);
  5928. return item ? item.dictValue : key;
  5929. });
  5930. this.syncForm.typeName = selectedValues.join(',');
  5931. } else {
  5932. this.syncForm.typeName = '';
  5933. }
  5934. },
  5935. immediate: true
  5936. },
  5937. 'syncForm.range': {
  5938. handler(newVal) {
  5939. console.log(newVal,'newVal');
  5940. if (newVal && newVal.length) {
  5941. for (let index = 0; index < this.rangeOptions.length; index++) {
  5942. const elemet = this.rangeOptions[index];
  5943. if(elemet.dictKey==newVal){
  5944. this.syncForm.rangeName = elemet.dictValue;
  5945. break
  5946. }
  5947. }
  5948. } else {
  5949. this.syncForm.rangeName = '';
  5950. }
  5951. },
  5952. immediate: true
  5953. },
  5954. },
  5955. components: {
  5956. dynamicExcel,
  5957. ManualSorting,
  5958. FormulaEdit,
  5959. EditElement,
  5960. FormulaEditone,
  5961. CodeSet,
  5962. tableSortByType
  5963. },
  5964. };
  5965. </script>
  5966. <style scoped lang="scss">
  5967. .font-s-12 ::v-deep .iconfont {
  5968. font-size: 12px;
  5969. }
  5970. .el-popper[x-placement^="bottom"] {
  5971. margin-top: -6px;
  5972. }
  5973. .right-btn {
  5974. position: absolute;
  5975. right: 20px;
  5976. top: 10px;
  5977. font-size: 20px;
  5978. }
  5979. .custom-tree-node {
  5980. .normal-black {
  5981. display: none;
  5982. }
  5983. &:hover {
  5984. .normal-black {
  5985. display: inline-block;
  5986. }
  5987. }
  5988. &.show .normal-black {
  5989. display: inline-block;
  5990. }
  5991. }
  5992. .excelBox {
  5993. ::v-deep .el-dialog__body {
  5994. padding: 20px;
  5995. }
  5996. }
  5997. //调整表单样式
  5998. .excelHtml {
  5999. position: absolute;
  6000. z-index: 999999;
  6001. top: 50px;
  6002. left: 0px;
  6003. width: 100%;
  6004. height: 100%;
  6005. }
  6006. .jiedian {
  6007. ::v-deep .el-dialog__body {
  6008. padding: 10px 20px !important;
  6009. }
  6010. }
  6011. .filter-tree {
  6012. min-width: 100%;
  6013. display: inline-block;
  6014. }
  6015. .full-dialog {
  6016. ::v-deep .el-dialog__body {
  6017. padding-bottom: 0;
  6018. padding-top: 0;
  6019. }
  6020. ::v-deep .basic-container {
  6021. height: calc(100vh - 60px);
  6022. }
  6023. }
  6024. .my-basic-con {
  6025. padding: 6px 6px;
  6026. }
  6027. // 树形控件菜单样式
  6028. .contextmenu {
  6029. margin: 0;
  6030. background: #fff;
  6031. z-index: 1000;
  6032. position: fixed; //关键样式设置固定定位
  6033. list-style-type: none;
  6034. padding: 5px 0;
  6035. border-radius: 4px;
  6036. font-size: 12px;
  6037. font-weight: 400;
  6038. color: #333;
  6039. box-shadow: 2px 2px 3px 0 rgba(0, 0, 0, 0.3);
  6040. }
  6041. .contextmenu li {
  6042. margin: 0;
  6043. padding: 7px 16px;
  6044. cursor: pointer;
  6045. }
  6046. .contextmenu li:hover {
  6047. background: #eee;
  6048. }
  6049. .selectBtn {
  6050. position: absolute;
  6051. top: 50px;
  6052. right: 585px;
  6053. z-index: 1000;
  6054. width: 140px;
  6055. text-align: left;
  6056. }
  6057. .titlerow {
  6058. // float: right;
  6059. background-color: rgba(31, 34, 41, 0.8);
  6060. // width:104%;
  6061. padding-left: 10px;
  6062. padding-right: 10px;
  6063. text-align: right;
  6064. margin-top: -20px;
  6065. margin-left: -20px;
  6066. margin-right: -20px;
  6067. }
  6068. .dialog-title{
  6069. display: flex;
  6070. }
  6071. .dialog-title-text{
  6072. flex: 0.4;
  6073. padding-left: 10px;
  6074. }
  6075. .dialog-title-tip{
  6076. flex: 0.6;
  6077. // position: absolute;
  6078. color:rgba(255, 125, 67, 1);
  6079. padding-left: 40px;
  6080. // right: 60px;
  6081. }
  6082. .sync-container{
  6083. margin-top: -30px;
  6084. display: flex;
  6085. height: 570px;
  6086. .box-card-1{
  6087. margin-right: 10px;
  6088. height: 100%;
  6089. overflow-y: auto;
  6090. }
  6091. .box-card-2{
  6092. flex: 1;
  6093. height: 100%;
  6094. overflow-y: auto;
  6095. .el-form-item {
  6096. border: 1px solid #dcdfe6;
  6097. padding: 0 10px 10px 10px;
  6098. border-radius: 4px;
  6099. font-weight: bold;
  6100. .el-form-item__label {
  6101. font-weight: bold;
  6102. padding-bottom: 0px;
  6103. }
  6104. .el-form--label-top .el-form-item__label{
  6105. padding: 0px !important;
  6106. }
  6107. }
  6108. }
  6109. }
  6110. .content-box{
  6111. display: flex;
  6112. flex-direction: column;
  6113. justify-content: center;
  6114. align-items: center;
  6115. font-weight: bolder;
  6116. .mt-14{
  6117. margin-top: 14px;
  6118. }
  6119. }
  6120. </style>
  6121. <style lang="scss">
  6122. .el-dialog.hc-link-nodes-dialog {
  6123. width: 500px;
  6124. margin-top: 50px !important;
  6125. height: calc(100% - 100px);
  6126. .el-dialog__body {
  6127. height: calc(100% - 154px);
  6128. border-top: 1px solid #eee;
  6129. border-bottom: 1px solid #eee;
  6130. padding: 14px;
  6131. overflow: auto;
  6132. }
  6133. }
  6134. .el-tree.hc-link-nodes-tree .el-tree-node .el-tree-node__content {
  6135. .el-checkbox {
  6136. display: none;
  6137. }
  6138. .is-leaf + .el-checkbox {
  6139. display: inline-block;
  6140. }
  6141. }
  6142. .warning-text{
  6143. color: orange;
  6144. font-weight: bold;
  6145. }
  6146. .orange {
  6147. color: orange;
  6148. }
  6149. .box-card-2{
  6150. .el-form-item {
  6151. .el-form-item__content {
  6152. line-height: 10px !important;
  6153. margin-top: -10px !important;
  6154. }
  6155. }
  6156. }
  6157. .category-section {
  6158. margin-bottom: 20px;
  6159. }
  6160. .category-header {
  6161. padding: 12px 20px;
  6162. background-color: #E8E8E8;
  6163. margin: 15px 0;
  6164. font-weight: bold;
  6165. font-size: 16px;
  6166. }
  6167. .el-dropdown-link{
  6168. cursor: pointer;
  6169. color: #409EFF;
  6170. margin-left: 8px;
  6171. }
  6172. .project-dialog {
  6173. .el-dialog__body {
  6174. color: black;
  6175. padding: 10px 20px 20px 20px !important;
  6176. }
  6177. .el-dialog__header {
  6178. border-bottom: 1px solid #e6e6e6;
  6179. }
  6180. .dialog-footer{
  6181. padding-top: 15px;
  6182. text-align: center;
  6183. border-top: #e6e6e6 solid 1px;
  6184. }
  6185. }
  6186. </style>