tree.vue 228 KB

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