tree.vue 233 KB

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