tree.vue 235 KB

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