tree.vue 89 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055
  1. <template>
  2. <div style="height:100%">
  3. <basic-container v-show="showType == 1">
  4. <el-row :gutter="20" class="h-100p">
  5. <el-col :span="10" class="h-100p">
  6. <div class="h-100p flex flex-d-c">
  7. <p>工程节点信息</p>
  8. <div class="flex">
  9. <el-input
  10. placeholder="输入关键字进行过滤"
  11. v-model="filterText"
  12. @input="filterChange"
  13. clearable
  14. ></el-input>
  15. <!-- <el-button type="info" class="mg-l-20">导入划分</el-button> -->
  16. </div>
  17. <div class="flex1 ov-hidden">
  18. <el-scrollbar class="h-100p">
  19. <div v-loading="treeLoad">
  20. <el-tree
  21. v-show="!filterText"
  22. class="filter-tree"
  23. lazy
  24. :data="treeData"
  25. :load="loadNode"
  26. @node-click="getNodeDetail"
  27. :props="defaultProps"
  28. :expand-on-click-node="false"
  29. highlight-current
  30. node-key="id"
  31. ref="tree"
  32. :default-expanded-keys="defaultExpandedKeys"
  33. >
  34. <span
  35. class="custom-tree-node"
  36. :class="data.moreShow?'show':''"
  37. slot-scope="{ node, data }"
  38. >
  39. <!--@mouseover="mouseover(data)" @mouseleave="mouseout(data)"-->
  40. <span class="pd-r-20">
  41. {{ node.label }}
  42. <span class="normal-black">
  43. <el-link :underline="false">
  44. <i class="el-icon-sort" @click="sortpai(data,node)" v-if="node.level != 1" title="调整排序"></i>
  45. </el-link>
  46. <el-link :underline="false">
  47. <i class="el-icon-upload" style="margin-left:2px;" @click="syncNodeTableHandle(data,node)" title="同步元素表单"></i>
  48. </el-link>
  49. </span>
  50. <!-- <el-dropdown
  51. @click="command=>{setLeftType(command,data)}"
  52. @visible-change="visiblechange($event,data)"
  53. >
  54. <el-button
  55. type="text"
  56. icon="el-icon-more"
  57. class="normal-black"
  58. >
  59. </el-button>
  60. <el-dropdown-menu slot="dropdown">
  61. <el-dropdown-item
  62. @click.native="setLeftType(2,data,node)"
  63. icon="el-icon-edit"
  64. >编辑节点</el-dropdown-item>
  65. <el-dropdown-item
  66. @click.native="setLeftType(3,data,node)"
  67. icon="el-icon-document-copy"
  68. >复制节点</el-dropdown-item>
  69. <el-dropdown-item
  70. @click.native="deleNode(data,node)"
  71. icon="el-icon-close"
  72. v-if="node.level !=1"
  73. >删除节点</el-dropdown-item>
  74. <el-dropdown-item
  75. @click.native="setLeftType(4,data,node)"
  76. icon="iconfont hcicon-danganziliao-biaogetianxie"
  77. class="font-s-12"
  78. >元素公式</el-dropdown-item>
  79. <el-dropdown-item
  80. @click.native="setLeftType(5,data,node)"
  81. icon="el-icon-coin"
  82. >元素设置</el-dropdown-item>
  83. <el-dropdown-item
  84. @click.native="nodeInfo(data,node)"
  85. icon="el-icon-help"
  86. >节点参数</el-dropdown-item>
  87. <el-dropdown-item
  88. @click.native="importTemplate(data,node)"
  89. v-if="node.level == 2"
  90. icon="el-icon-upload"
  91. >导入划分</el-dropdown-item>
  92. <el-dropdown-item
  93. v-if="data.parentId!=0"
  94. @click.native="sortpai(data,node)"
  95. icon="el-icon-sort"
  96. >调整排序</el-dropdown-item>
  97. </el-dropdown-menu>
  98. </el-dropdown> -->
  99. </span>
  100. </span>
  101. </el-tree>
  102. <el-tree
  103. v-show="filterText"
  104. class="filter-tree"
  105. :data="treeData"
  106. @node-click="getNodeDetail"
  107. :props="defaultProps"
  108. :expand-on-click-node="false"
  109. highlight-current
  110. node-key="id"
  111. :filter-node-method="filterNode"
  112. ref="treeall"
  113. >
  114. <span
  115. class="custom-tree-node"
  116. slot-scope="{ node, data }"
  117. :class="data.moreShow?'show':''"
  118. >
  119. <span class="pd-r-20">
  120. {{ node.label }}
  121. <span class="normal-black">
  122. <el-link :underline="false">
  123. <i class="el-icon-sort" @click="sortpai(data,node)" v-if="node.level != 1" title="调整排序"></i>
  124. </el-link>
  125. <el-link :underline="false">
  126. <i class="el-icon-upload" style="margin-left:2px;" @click="syncNodeTableHandle(data,node)" title="同步元素表单"></i>
  127. </el-link>
  128. </span>
  129. <!-- <el-dropdown
  130. @click="command=>{setLeftType(command,data)}"
  131. @visible-change="visiblechange($event,data)"
  132. >
  133. <el-button
  134. type="text"
  135. icon="el-icon-more"
  136. class="normal-black"
  137. >
  138. </el-button>
  139. <el-dropdown-menu slot="dropdown">
  140. <el-dropdown-item
  141. @click.native="setLeftType(2,data,node)"
  142. icon="el-icon-edit"
  143. >编辑节点</el-dropdown-item>
  144. <el-dropdown-item
  145. @click.native="setLeftType(3,data,node)"
  146. icon="el-icon-document-copy"
  147. >复制节点</el-dropdown-item>
  148. <el-dropdown-item
  149. @click.native="deleNode(data,node)"
  150. icon="el-icon-close"
  151. v-if="node.level !=1"
  152. >删除节点</el-dropdown-item>
  153. <el-dropdown-item
  154. @click.native="setLeftType(4,data,node)"
  155. icon="iconfont hcicon-danganziliao-biaogetianxie"
  156. class="font-s-12"
  157. >元素公式</el-dropdown-item>
  158. <el-dropdown-item
  159. @click.native="setLeftType(5,data,node)"
  160. icon="el-icon-coin"
  161. >元素设置</el-dropdown-item>
  162. <el-dropdown-item
  163. @click.native="nodeInfo(data)"
  164. icon="el-icon-help"
  165. >节点参数</el-dropdown-item>
  166. <el-dropdown-item
  167. @click.native="importTemplate(data,node)"
  168. v-if="node.level == 2"
  169. icon="el-icon-upload"
  170. >导入划分</el-dropdown-item>
  171. </el-dropdown-menu>
  172. </el-dropdown> -->
  173. </span>
  174. </span>
  175. </el-tree>
  176. </div>
  177. </el-scrollbar>
  178. </div>
  179. </div>
  180. </el-col>
  181. <el-col :span="14" class="h-100p flex flex-d-c">
  182. <div class="mg-b-10">
  183. <el-button type="primary" size="medium" icon="el-icon-edit-outline" @click="editNodeHandle">编辑当前节点</el-button>
  184. <el-button type="primary" size="medium" icon="el-icon-document-copy" @click="copyNodeHandle">复制当前节点</el-button>
  185. <el-button type="warning" size="medium" icon="el-icon-delete" @click="delNodeHandle">删除当前节点</el-button>
  186. <el-button class="el-btn-purple" type="primary" size="medium" icon="el-icon-s-grid" @click="eleFormulaHandle" v-if="leftType==5">表单设置</el-button>
  187. <el-button class="el-btn-purple" type="primary" size="medium" icon="el-icon-s-grid" @click="eleHandle" v-else>元素设置</el-button>
  188. <el-button class="el-btn-purple" type="primary" size="medium" icon="el-icon-help" @click="nodeInfoHandle">节点参数设置</el-button>
  189. <el-button class="el-btn-purple" type="primary" size="medium" icon="el-icon-upload" :loading="syncBtnLoad" @click="syncInfoHandle">同步节点参数</el-button>
  190. </div>
  191. <template v-if="leftType==5">
  192. <div class="mg-b-10">节点信息</div>
  193. <div>
  194. <el-table
  195. :data="tableData"
  196. border
  197. style="width: 100%"
  198. >
  199. <el-table-column
  200. align="center"
  201. prop="nodeName"
  202. label="当前节点"
  203. ></el-table-column>
  204. <el-table-column
  205. align="center"
  206. prop="nodeType"
  207. :formatter="formatCat"
  208. label="节点类型"
  209. width="180"
  210. ></el-table-column>
  211. <el-table-column
  212. align="center"
  213. prop="parentName"
  214. label="上级节点"
  215. ></el-table-column>
  216. </el-table>
  217. </div>
  218. <div class="flex jc-sb">
  219. <p>
  220. <span>当前项目信息表</span>
  221. <!-- <el-button
  222. @click="showFormElement"
  223. type="text"
  224. icon="el-icon-circle-plus-outline"
  225. class="text-icon mg-l-10"
  226. ></el-button>
  227. <el-button
  228. type="text"
  229. icon="el-icon-document-copy"
  230. class="text-icon"
  231. ></el-button> -->
  232. <el-button
  233. type="text"
  234. style="margin-left:10px;"
  235. icon="el-icon-edit-outline"
  236. class="text-icon"
  237. @click="editEditElementForm()"
  238. ></el-button>
  239. <el-button
  240. type="text"
  241. icon="el-icon-sort"
  242. class="text-icon"
  243. @click="privateTableSort()"
  244. ></el-button>
  245. </p>
  246. <div class="mg-t-10">
  247. </div>
  248. </div>
  249. <div style="flex: 1;position: relative;">
  250. <el-table
  251. :data="formData"
  252. border height="100%"
  253. style="width: 100%;position: absolute;"
  254. >
  255. <el-table-column
  256. align="center"
  257. prop="tableName"
  258. label="表单名称"
  259. ></el-table-column>
  260. <el-table-column
  261. align="center"
  262. prop="elementTotal"
  263. width="80"
  264. label="字段总量"
  265. ></el-table-column>
  266. <el-table-column
  267. align="center"
  268. prop="fillRate"
  269. width="100"
  270. label="填报率"
  271. ></el-table-column>
  272. <el-table-column
  273. align="center"
  274. prop="tableType"
  275. :formatter="formatTableType"
  276. width="100"
  277. label="表单类型"
  278. ></el-table-column>
  279. <el-table-column
  280. align="center"
  281. prop="tableOwner"
  282. :formatter="formatOwner"
  283. label="所属方"
  284. ></el-table-column>
  285. <el-table-column
  286. label="操作"
  287. width="240"
  288. >
  289. <template slot-scope="scope">
  290. <el-button
  291. size="mini"
  292. @click="handleEdit(scope.$index, scope.row)"
  293. >预览</el-button>
  294. <el-button
  295. size="mini"
  296. type="primary"
  297. v-throttle='3000'
  298. v-show="scope.row.status==0"
  299. @click="hideMD(scope.row)"
  300. >取消隐藏</el-button>
  301. <el-button
  302. size="mini"
  303. type="primary"
  304. v-throttle='3000'
  305. v-show="scope.row.status==1"
  306. @click="hideMD(scope.row)"
  307. >隐藏表单</el-button>
  308. <el-button
  309. size="mini"
  310. type="danger"
  311. @click="handleDelete(scope.$index, scope.row)"
  312. >删除</el-button>
  313. </template>
  314. </el-table-column>
  315. </el-table>
  316. </div>
  317. </template>
  318. <template v-if="leftType==4">
  319. <div style="flex: 1;position: relative;">
  320. <el-table
  321. :data="formData"
  322. border height="100%"
  323. style="width: 100%;position: absolute;"
  324. >
  325. <el-table-column
  326. align="center"
  327. prop="tableName"
  328. label="表单名称"
  329. ></el-table-column>
  330. <el-table-column
  331. align="center"
  332. prop="tableType"
  333. :formatter="formatTableType"
  334. label="表单类型"
  335. ></el-table-column>
  336. <el-table-column
  337. align="center"
  338. prop="fillRate"
  339. label="填报率"
  340. ></el-table-column>
  341. <el-table-column
  342. label="是否关联清表"
  343. prop="isLinkTable"
  344. align="center"
  345. >
  346. <template slot-scope="scope">
  347. <span v-if="scope.row.isLinkTable == 2">是</span>
  348. <span v-else>否</span>
  349. </template>
  350. </el-table-column>
  351. <el-table-column
  352. align="center"
  353. prop="tableOwner"
  354. :formatter="formatOwner"
  355. label="所属方"
  356. ></el-table-column>
  357. <el-table-column
  358. label="操作"
  359. width="400"
  360. align="center"
  361. >
  362. <template slot-scope="scope">
  363. <el-link
  364. type="primary"
  365. @click="Associationlist(scope)"
  366. >关联清表</el-link>
  367. <el-link
  368. class="mg-l-10"
  369. type="primary"
  370. :disabled='scope.row.excelId==-1'
  371. @click="rightClick(scope.row.pkeyId,scope.row.excelId,scope.row.id,scope.row.initTableName)"
  372. >编辑元素</el-link>
  373. <el-link
  374. class="mg-l-10"
  375. type="primary"
  376. :disabled='scope.row.excelId==-1'
  377. @click="adjustExcel(scope.row.pkeyId,scope.row.excelId)"
  378. >调整表单</el-link>
  379. <el-link
  380. class="mg-l-10"
  381. type="primary"
  382. @click="handleEditFormula(scope.$index, scope.row)"
  383. >编辑元素公式</el-link>
  384. <el-link
  385. class="mg-l-10"
  386. type="danger"
  387. @click="handleDelete(scope.$index, scope.row)"
  388. >删除表单</el-link>
  389. </template>
  390. </el-table-column>
  391. </el-table>
  392. </div>
  393. </template>
  394. </el-col>
  395. </el-row>
  396. </basic-container>
  397. <el-row class="h-100p" v-show="showType == 2">
  398. <el-col :span="6" class="h-100p">
  399. <basic-container>
  400. <el-scrollbar class="h-100p">
  401. <el-tree
  402. class="filter-tree"
  403. lazy
  404. :data="typeTreeData"
  405. :load="typeTreeLoadNode"
  406. @node-click="getTypeTreeDetail"
  407. :props="defaultProps"
  408. :expand-on-click-node="false"
  409. highlight-current
  410. node-key="id"
  411. >
  412. </el-tree>
  413. </el-scrollbar>
  414. </basic-container>
  415. </el-col>
  416. <el-col :span="18" class="h-100p">
  417. <basic-container>
  418. <div class="flex h-100p flex-d-c">
  419. <div style="flex: 1;position: relative;">
  420. <el-table
  421. :data="formData"
  422. border height="100%"
  423. style="width: 100%;position: absolute;"
  424. >
  425. <el-table-column
  426. align="center"
  427. prop="tableName"
  428. label="表单名称"
  429. ></el-table-column>
  430. <el-table-column
  431. align="center"
  432. prop="tableType"
  433. :formatter="formatTableType"
  434. label="表单类型"
  435. ></el-table-column>
  436. <el-table-column
  437. align="center"
  438. prop="fillRate"
  439. label="填报率"
  440. ></el-table-column>
  441. <el-table-column
  442. label="是否关联清表"
  443. prop="isLinkTable"
  444. align="center"
  445. >
  446. <template slot-scope="scope">
  447. <span v-if="scope.row.isLinkTable == 2">是</span>
  448. <span v-else>否</span>
  449. </template>
  450. </el-table-column>
  451. <el-table-column
  452. align="center"
  453. prop="tableOwner"
  454. :formatter="formatOwner"
  455. label="所属方"
  456. ></el-table-column>
  457. <el-table-column
  458. label="操作"
  459. width="400"
  460. align="center"
  461. >
  462. <template slot-scope="scope">
  463. <el-link
  464. type="primary"
  465. @click="Associationlist(scope)"
  466. >关联清表</el-link>
  467. <el-link
  468. class="mg-l-10"
  469. type="primary"
  470. :disabled='scope.row.excelId==-1'
  471. @click="rightClick(scope.row.pkeyId,scope.row.excelId,scope.row.id,scope.row.initTableName)"
  472. >编辑元素</el-link>
  473. <el-link
  474. class="mg-l-10"
  475. type="primary"
  476. :disabled='scope.row.excelId==-1'
  477. @click="adjustExcel(scope.row.pkeyId,scope.row.excelId)"
  478. >调整表单</el-link>
  479. <el-link
  480. class="mg-l-10"
  481. type="primary"
  482. @click="handleEditFormula(scope.$index, scope.row)"
  483. >编辑元素公式</el-link>
  484. <el-link
  485. class="mg-l-10"
  486. type="danger"
  487. @click="handleDelete(scope.$index, scope.row)"
  488. >删除表单</el-link>
  489. </template>
  490. </el-table-column>
  491. </el-table>
  492. </div>
  493. <div class="mg-t-10 flex jc-sb">
  494. <div></div>
  495. <el-button size="medium" @click="showType = 1">返回WBS树</el-button>
  496. </div>
  497. </div>
  498. </basic-container>
  499. </el-col>
  500. </el-row>
  501. <!-- 编辑元素表单信息 -->
  502. <el-dialog
  503. title="编辑元素表单信息"
  504. :visible.sync="editElementFormTag"
  505. width="60%"
  506. :modal-append-to-body="false"
  507. >
  508. <div>
  509. <el-table
  510. :data="formDatass"
  511. border
  512. style="width: 100%"
  513. >
  514. <el-table-column
  515. prop="tableName"
  516. label="表名"
  517. >
  518. <template slot-scope="scope">
  519. <el-input
  520. v-model="scope.row.tableName"
  521. placeholder="请输入表名称"
  522. ></el-input>
  523. </template>
  524. </el-table-column>
  525. <el-table-column
  526. prop="tableType"
  527. label="表类型"
  528. >
  529. <template slot-scope="scope">
  530. <el-select
  531. v-model="scope.row.tableType"
  532. placeholder="请选择"
  533. >
  534. <el-option
  535. v-for="(item,key) in tableTypelist"
  536. :key="key"
  537. :label="item.dictValue"
  538. :value="item.dictKey"
  539. >
  540. </el-option>
  541. </el-select>
  542. </template>
  543. </el-table-column>
  544. <el-table-column
  545. prop="tableOwner"
  546. label="所属方"
  547. >
  548. <template slot-scope="scope">
  549. <el-select
  550. v-model="scope.row.tableOwner"
  551. placeholder="请选择"
  552. >
  553. <el-option
  554. v-for="(item,key) in ownerTypeList"
  555. :key="key"
  556. :label="item.dictValue"
  557. :value="item.dictKey"
  558. >
  559. </el-option>
  560. </el-select>
  561. </template>
  562. </el-table-column>
  563. <el-table-column
  564. prop="fillRate"
  565. label="填报率"
  566. >
  567. <template slot-scope="scope">
  568. <el-input
  569. v-model="scope.row.fillRate"
  570. placeholder="请输入填报率"
  571. ></el-input>
  572. </template>
  573. </el-table-column>
  574. </el-table>
  575. </div>
  576. <span
  577. slot="footer"
  578. class="dialog-footer"
  579. >
  580. <el-button @click="editElementFormTag = false">取 消</el-button>
  581. <el-button
  582. type="primary"
  583. @click="editeditElementFormMF()"
  584. >确 定</el-button>
  585. </span>
  586. </el-dialog>
  587. <!-- 调整表单模板 -->
  588. <div
  589. v-if="excelHtml"
  590. class="excelHtml"
  591. >
  592. <dynamicExcel
  593. @remove="removeExcel"
  594. v-if="excelHtml"
  595. :pkeyId='GLExcelFrom.id'
  596. />
  597. </div>
  598. <!-- 私有wbs树排序弹框 -->
  599. <el-dialog
  600. title="调整排序"
  601. :visible="sortTag"
  602. width="50%"
  603. append-to-body
  604. >
  605. <ManualSorting
  606. v-if="sortTag2"
  607. @bianhua='bianhua()'
  608. :sort='sort'
  609. />
  610. <span
  611. slot="footer"
  612. class="dialog-footer"
  613. >
  614. <el-button @click="sortTag=false,sortTag2=false">取 消</el-button>
  615. <el-button
  616. type="primary"
  617. @click="editSort()"
  618. >确 定</el-button>
  619. </span>
  620. </el-dialog>
  621. <!-- 元素表排序 -->
  622. <el-dialog
  623. title="调整排序"
  624. :visible="excelSortTag"
  625. width="50%"
  626. append-to-body
  627. >
  628. <ManualSorting
  629. v-if="excelSortTag2"
  630. @bianhua='bianhua2()'
  631. :sort='tableSortList'
  632. />
  633. <span
  634. slot="footer"
  635. class="dialog-footer"
  636. >
  637. <el-button @click="excelSortTag=false">取 消</el-button>
  638. <el-button
  639. type="primary"
  640. @click="editPrivateSort()"
  641. >确 定</el-button>
  642. </span>
  643. </el-dialog>
  644. <!-- 关联清表 -->
  645. <el-dialog
  646. title="关联清表"
  647. class="excelBox"
  648. :visible.sync="GLExcel"
  649. width="500px"
  650. modal-append-to-body
  651. append-to-body
  652. @close="GLExcelMD"
  653. >
  654. <div>
  655. <el-select
  656. style="width:400px;"
  657. v-model="GLExcelFrom.name"
  658. placeholder="请选择"
  659. @change="changetherr()"
  660. >
  661. <el-option
  662. v-for="(item,key) in GLExcelData"
  663. :key="key"
  664. :label="item.name"
  665. :value="item.id"
  666. >
  667. </el-option>
  668. </el-select>
  669. <el-scrollbar style="margin-top:20px;height:50vh;">
  670. <el-input
  671. style="width:400px;"
  672. v-model.trim="GLExcelFrom.search"
  673. placeholder="请输入需要选择的内容"
  674. ></el-input>
  675. <el-tree
  676. :filter-node-method="filterNode222"
  677. ref="tree"
  678. class="filter-tree"
  679. style="margin-top:10px;"
  680. :props="GLExcelProps"
  681. :data="exceldata"
  682. node-key="id"
  683. accordion
  684. show-checkbox
  685. @check="checkchange"
  686. >
  687. </el-tree>
  688. </el-scrollbar>
  689. </div>
  690. <span
  691. slot="footer"
  692. class="dialog-footer"
  693. style="display: flex;justify-content: center;align-items: center;"
  694. >
  695. <el-button @click="GLExcelMD()">取 消</el-button>
  696. <el-button
  697. style="margin-left:30px;"
  698. type="primary"
  699. v-throttle='2000'
  700. @click="saveLinkTab()"
  701. >确 定</el-button>
  702. </span>
  703. </el-dialog>
  704. <el-dialog
  705. :title="dialogTitle"
  706. :visible.sync="dialogVisible"
  707. width="50%"
  708. append-to-body
  709. :close-on-click-modal="false"
  710. @closed="saveNodeLoading = false"
  711. >
  712. <el-form
  713. ref="nodeDetail"
  714. :model="nodeDetail"
  715. :rules="rules"
  716. label-width="110px"
  717. >
  718. <el-form-item
  719. label="节点名称"
  720. prop="nodeName"
  721. >
  722. <div class="flex">
  723. <el-input v-model="nodeDetail.nodeName"></el-input>
  724. <el-button class="mg-l-10" type="primary" @click="aliasShow">添加别名</el-button>
  725. </div>
  726. </el-form-item>
  727. <el-form-item label="上级节点">
  728. <el-input
  729. v-model="nodeDetail.parentName"
  730. ></el-input>
  731. </el-form-item>
  732. <el-form-item
  733. label="节点类型"
  734. prop="nodeType"
  735. >
  736. <el-select
  737. v-model="nodeDetail.nodeType"
  738. disabled
  739. placeholder="请选择"
  740. class="w-100p"
  741. >
  742. <el-option
  743. v-for="item in nodeTypelist"
  744. :key="item.id"
  745. :label="item.dictValue"
  746. :value="item.dictKey"
  747. ></el-option>
  748. </el-select>
  749. </el-form-item>
  750. <el-form-item label="划分编号">
  751. <el-input v-model="nodeDetail.partitionCode"></el-input>
  752. </el-form-item>
  753. <el-form-item label="唯一编码">
  754. <el-input v-model="nodeDetail.uniqueCode"></el-input>
  755. </el-form-item>
  756. <template v-if="nodeDetail.nodeType == 6">
  757. <el-form-item label="是否有混凝土">
  758. <el-radio-group
  759. v-model="nodeDetail.isConcrete"
  760. size="small"
  761. >
  762. <el-radio
  763. :label="0"
  764. border
  765. >无</el-radio>
  766. <el-radio
  767. :label="1"
  768. border
  769. >有</el-radio>
  770. </el-radio-group>
  771. </el-form-item>
  772. <el-form-item label="是否试验节点">
  773. <el-radio-group
  774. v-model="nodeDetail.isExpernode"
  775. size="small"
  776. >
  777. <el-radio
  778. :label="0"
  779. border
  780. >否</el-radio>
  781. <el-radio
  782. :label="1"
  783. border
  784. >是</el-radio>
  785. </el-radio-group>
  786. </el-form-item>
  787. </template>
  788. <el-form-item label="内业资料类型" prop="majorDataType">
  789. <el-select
  790. v-model="nodeDetail.majorDataType"
  791. disabled
  792. placeholder="请选择"
  793. class="w-100p"
  794. >
  795. <el-option
  796. v-for="item in majorDataTypeList"
  797. :key="item.id"
  798. :label="item.dictValue"
  799. :value="item.dictKey"
  800. ></el-option>
  801. </el-select>
  802. </el-form-item>
  803. </el-form>
  804. <span
  805. slot="footer"
  806. class="dialog-footer"
  807. >
  808. <el-button @click="dialogVisible = false">取 消</el-button>
  809. <el-button
  810. type="primary"
  811. @click="saveNode"
  812. :loading="saveNodeLoading"
  813. >确 定</el-button>
  814. </span>
  815. </el-dialog>
  816. <el-dialog
  817. title="创建新的元素表"
  818. :visible.sync="eleVisible"
  819. width="80%"
  820. append-to-body
  821. :close-on-click-modal="false"
  822. >
  823. <el-form
  824. ref="eleDialog"
  825. :model="eleForm"
  826. :rules="eleRules"
  827. label-width="110px"
  828. >
  829. <el-form-item
  830. label="表名"
  831. prop="nodeName"
  832. >
  833. <el-input v-model="eleForm.nodeName"></el-input>
  834. </el-form-item>
  835. <el-row>
  836. <el-col :span="12">
  837. <el-form-item
  838. label="表类型"
  839. prop="tableType"
  840. >
  841. <el-select
  842. v-model="eleForm.tableType"
  843. placeholder="请选择"
  844. class="w-100p"
  845. >
  846. <el-option
  847. v-for="item in tableTypelist"
  848. :key="item.id"
  849. :label="item.dictValue"
  850. :value="item.dictKey"
  851. ></el-option>
  852. </el-select>
  853. </el-form-item>
  854. </el-col>
  855. <el-col :span="12">
  856. <el-form-item
  857. label="所属方"
  858. prop="tableOwner"
  859. >
  860. <el-select
  861. v-model="eleForm.tableOwner"
  862. placeholder="请选择"
  863. class="w-100p"
  864. >
  865. <el-option
  866. v-for="item in ownerTypeList"
  867. :key="item.id"
  868. :label="item.dictValue"
  869. :value="item.dictKey"
  870. ></el-option>
  871. </el-select>
  872. </el-form-item>
  873. </el-col>
  874. </el-row>
  875. </el-form>
  876. <div class="flex jc-sb">
  877. <div></div>
  878. <div>
  879. <el-link
  880. type="primary"
  881. @click="importVisible = true"
  882. >快捷导入</el-link>
  883. <el-link
  884. type="primary"
  885. class="mg-l-20"
  886. @click="downloadTmp"
  887. >下载导入模版</el-link>
  888. </div>
  889. </div>
  890. <div class="border-grey">
  891. <p class="font-c-warning">编辑元素信息(请谨慎操作)</p>
  892. <el-table
  893. :data="eleForm.elementList"
  894. border
  895. style="width: 100%"
  896. height="400px"
  897. >
  898. <el-table-column
  899. align="center"
  900. type="index"
  901. width="50"
  902. ></el-table-column>
  903. <el-table-column
  904. align="center"
  905. prop="eName"
  906. label="字段名称"
  907. >
  908. <template slot-scope="scope">
  909. <el-input
  910. v-model="scope.row.eName"
  911. size="small"
  912. placeholder="请输入内容"
  913. ></el-input>
  914. </template>
  915. </el-table-column>
  916. <el-table-column
  917. align="center"
  918. prop="eType"
  919. label="数据类型"
  920. width="120"
  921. >
  922. <template slot-scope="scope">
  923. <el-select
  924. v-model="scope.row.eType"
  925. size="small"
  926. placeholder="请选择"
  927. >
  928. <el-option
  929. v-for="item in dataTypeList"
  930. :key="item.id"
  931. :label="item.dictValue"
  932. :value="item.dictKey"
  933. ></el-option>
  934. </el-select>
  935. </template>
  936. </el-table-column>
  937. <el-table-column
  938. align="center"
  939. prop="eLength"
  940. label="长度"
  941. width="120"
  942. >
  943. <template slot-scope="scope">
  944. <el-input
  945. v-model="scope.row.eLength"
  946. size="small"
  947. placeholder="请输入内容"
  948. :disabled="scope.row.eType == 4"
  949. ></el-input>
  950. </template>
  951. </el-table-column>
  952. <el-table-column
  953. align="center"
  954. prop="eAllowDeviation"
  955. label="允许偏差值"
  956. >
  957. <template slot-scope="scope">
  958. <div class="flex">
  959. <el-select
  960. v-model="scope.row.allow"
  961. size="small"
  962. placeholder="请选择"
  963. style="width:120px"
  964. >
  965. <el-option
  966. :key="1"
  967. label="≥"
  968. value="≥"
  969. ></el-option>
  970. <el-option
  971. :key="2"
  972. label="≤"
  973. value="≤"
  974. ></el-option>
  975. <el-option
  976. :key="3"
  977. label="±"
  978. value="±"
  979. ></el-option>
  980. <el-option
  981. :key="4"
  982. label="【】"
  983. value="【】"
  984. ></el-option>
  985. </el-select>
  986. <el-input
  987. v-model="scope.row.deviation"
  988. size="small"
  989. placeholder="请输入内容"
  990. ></el-input>
  991. </div>
  992. </template>
  993. </el-table-column>
  994. <el-table-column
  995. align="center"
  996. prop="eInspectionMethod"
  997. label="检查方法和频率"
  998. >
  999. <template slot-scope="scope">
  1000. <el-input
  1001. v-model="scope.row.eInspectionMethod"
  1002. size="small"
  1003. placeholder="请输入内容"
  1004. ></el-input>
  1005. </template>
  1006. </el-table-column>
  1007. <el-table-column
  1008. align="center"
  1009. label="操作"
  1010. width="80"
  1011. >
  1012. <template slot="header">
  1013. <el-button
  1014. @click="addEleRow(eleForm.elementList)"
  1015. type="text"
  1016. icon="el-icon-circle-plus-outline"
  1017. class="text-icon"
  1018. ></el-button>
  1019. </template>
  1020. <template slot-scope="scope">
  1021. <el-button
  1022. icon="el-icon-remove-outline"
  1023. type="text"
  1024. @click="delEleRow(scope.$index,eleForm.elementList)"
  1025. class="text-icon text-icon-danger"
  1026. ></el-button>
  1027. </template>
  1028. </el-table-column>
  1029. </el-table>
  1030. </div>
  1031. <span
  1032. slot="footer"
  1033. class="dialog-footer"
  1034. >
  1035. <el-button @click="eleVisible = false">取 消</el-button>
  1036. <el-button
  1037. type="primary"
  1038. @click="saveFormAndElementHandle"
  1039. >保 存</el-button>
  1040. </span>
  1041. </el-dialog>
  1042. <el-dialog
  1043. title="模版导入"
  1044. :visible.sync="importVisible"
  1045. width="50%"
  1046. append-to-body
  1047. :close-on-click-modal="false"
  1048. >
  1049. <p>提示:必须按照系统要求的模版格式上传,否则系统识别无效 <el-link
  1050. type="primary"
  1051. @click="downloadTmp"
  1052. >下载导入模版</el-link>
  1053. </p>
  1054. <div>
  1055. <el-button
  1056. size="small"
  1057. type="primary"
  1058. @click="fileClick2"
  1059. >本地上传</el-button>
  1060. <input
  1061. @change="tmpImport"
  1062. type="file"
  1063. hidden
  1064. ref="file2"
  1065. accept=".xls, .xlsx"
  1066. >
  1067. </div>
  1068. <el-table
  1069. :data="tempList"
  1070. border
  1071. style="width: 100%"
  1072. >
  1073. <el-table-column
  1074. align="center"
  1075. prop="eName"
  1076. label="字段信息"
  1077. >
  1078. </el-table-column>
  1079. <el-table-column
  1080. align="center"
  1081. prop="eType"
  1082. label="数据类型"
  1083. width="120"
  1084. >
  1085. </el-table-column>
  1086. <el-table-column
  1087. align="center"
  1088. prop="eLength"
  1089. label="长度"
  1090. width="120"
  1091. >
  1092. </el-table-column>
  1093. <el-table-column
  1094. align="center"
  1095. prop="eAllowDeviation"
  1096. label="允许偏差值"
  1097. >
  1098. </el-table-column>
  1099. <el-table-column
  1100. align="center"
  1101. prop="eInspectionMethod"
  1102. label="检查方法和频率"
  1103. >
  1104. </el-table-column>
  1105. </el-table>
  1106. <span
  1107. slot="footer"
  1108. class="dialog-footer"
  1109. >
  1110. <el-button @click="importVisible = false">取 消</el-button>
  1111. <el-button
  1112. type="primary"
  1113. @click="importHandle"
  1114. >确 定</el-button>
  1115. </span>
  1116. </el-dialog>
  1117. <el-dialog
  1118. :title="(curEleTable.tableName?curEleTable.tableName:'')+''"
  1119. :visible.sync="editEleVisible"
  1120. width="80%"
  1121. append-to-body
  1122. :close-on-click-modal="false"
  1123. >
  1124. <!-- <p class="font-c-warning">编辑元素信息(请谨慎操作)</p> -->
  1125. <el-table
  1126. :data="editEleList"
  1127. border
  1128. style="width: 100%"
  1129. height="400px"
  1130. >
  1131. <el-table-column
  1132. align="center"
  1133. type="index"
  1134. width="50"
  1135. ></el-table-column>
  1136. <el-table-column
  1137. align="center"
  1138. prop="eName"
  1139. label="字段信息"
  1140. >
  1141. </el-table-column>
  1142. <el-table-column
  1143. align="center"
  1144. prop="eType"
  1145. label="数据类型"
  1146. width="120"
  1147. :formatter="eTypeFormatter"
  1148. >
  1149. </el-table-column>
  1150. <el-table-column
  1151. align="center"
  1152. prop="eLength"
  1153. label="长度"
  1154. width="120"
  1155. >
  1156. </el-table-column>
  1157. <el-table-column
  1158. align="center"
  1159. prop="eAllowDeviation"
  1160. label="允许偏差值"
  1161. >
  1162. </el-table-column>
  1163. <el-table-column
  1164. align="center"
  1165. prop="eInspectionMethod"
  1166. label="检查方法和频率"
  1167. >
  1168. </el-table-column>
  1169. </el-table>
  1170. <span
  1171. slot="footer"
  1172. class="dialog-footer"
  1173. >
  1174. <el-button @click="editEleVisible = false">取 消</el-button>
  1175. <!-- <el-button
  1176. type="primary"
  1177. @click="saveEles"
  1178. >确 定</el-button> -->
  1179. </span>
  1180. </el-dialog>
  1181. <el-dialog
  1182. title="元素公式"
  1183. :visible.sync="editEleFormulaVisible"
  1184. width="800px"
  1185. append-to-body
  1186. :close-on-click-modal="false"
  1187. >
  1188. <div class="flex mg-b-10">
  1189. <el-input
  1190. v-model="formulaInput"
  1191. placeholder="请输入名称"
  1192. size="samll" clearable @clear="searchFormulaName"
  1193. ></el-input>
  1194. <el-button type="info" class="mg-l-10" @click="searchFormulaName">搜索</el-button>
  1195. </div>
  1196. <el-table
  1197. :data="editEleListFilter"
  1198. border
  1199. style="width: 100%"
  1200. height="400px"
  1201. >
  1202. <el-table-column
  1203. align="center"
  1204. prop="eName"
  1205. label="字段信息"
  1206. >
  1207. </el-table-column>
  1208. <el-table-column
  1209. align="center"
  1210. label="操作"
  1211. width="200"
  1212. >
  1213. <template slot-scope="scope">
  1214. <el-link
  1215. :type="scope.row.isSaveFormula == 1?'warning':'primary'"
  1216. @click="toFormulaEdit(scope.row)"
  1217. >公式配置</el-link>
  1218. <!-- <el-link
  1219. class="mg-l-10"
  1220. type="danger"
  1221. @click="delEleRowHandle(scope.$index,editEleListFilter)"
  1222. >删除</el-link> -->
  1223. </template>
  1224. </el-table-column>
  1225. </el-table>
  1226. </el-dialog>
  1227. <el-dialog
  1228. title="导入划分"
  1229. :visible.sync="importTemplateVisible"
  1230. width="800px"
  1231. append-to-body
  1232. :close-on-click-modal="false"
  1233. >
  1234. <div v-loading="importLoading">
  1235. <div>
  1236. <el-link
  1237. type="primary"
  1238. @click="handleDownload"
  1239. >下载导入模版</el-link>
  1240. </div>
  1241. <div class="mg-t-20">
  1242. <el-button
  1243. type="primary"
  1244. @click="fileClick"
  1245. >选择文件</el-button>
  1246. <span
  1247. v-if="upFile"
  1248. class="mg-l-20"
  1249. >{{upFile.name}}</span>
  1250. <input
  1251. @change="fileChange"
  1252. type="file"
  1253. hidden
  1254. ref="file"
  1255. accept=".xls, .xlsx"
  1256. >
  1257. </div>
  1258. <div v-if="!upFile">当前还未选择文件,请选择需要导入的文件</div>
  1259. </div>
  1260. <span
  1261. slot="footer"
  1262. class="dialog-footer"
  1263. >
  1264. <el-button @click="importTemplateVisible = false">取 消</el-button>
  1265. <el-button
  1266. type="primary"
  1267. @click="importTemplateHandle"
  1268. :loading="importLoading"
  1269. >导 入</el-button>
  1270. </span>
  1271. </el-dialog>
  1272. <el-dialog
  1273. title="节点参数"
  1274. :visible.sync="nodeInfoVisible"
  1275. width="800px"
  1276. append-to-body
  1277. class="jiedian"
  1278. :close-on-click-modal="false"
  1279. :show-close="false"
  1280. >
  1281. <div>
  1282. <el-button
  1283. type="text"
  1284. icon="el-icon-s-operation"
  1285. class="right-btn"
  1286. @click="setNodeParameters()"
  1287. ></el-button>
  1288. <div class="flexEnd">
  1289. <i
  1290. class="el-icon-circle-plus marbottom10"
  1291. @click="addNodeInfoTable()"
  1292. style="font-size:24px;color:rgb(37, 193, 99);cursor: pointer;"
  1293. ></i>
  1294. </div>
  1295. <el-table
  1296. :data="nodeInfoTable"
  1297. border
  1298. style="width: 100%"
  1299. height="400"
  1300. >
  1301. <el-table-column
  1302. align="center"
  1303. prop="name"
  1304. label="参数名称"
  1305. >
  1306. <template slot-scope="scope">
  1307. <el-select
  1308. v-model="scope.row.k"
  1309. placeholder="请选择"
  1310. class="w-100p"
  1311. >
  1312. <el-option
  1313. v-for="item in namelist"
  1314. :key="item.k"
  1315. :label="item.name"
  1316. :value="item.k"
  1317. ></el-option>
  1318. </el-select>
  1319. </template>
  1320. </el-table-column>
  1321. <el-table-column
  1322. align="center"
  1323. prop="value"
  1324. label="参数值设置"
  1325. >
  1326. <template slot-scope="scope">
  1327. <el-input v-model="scope.row.v"></el-input>
  1328. </template>
  1329. </el-table-column>
  1330. <el-table-column
  1331. align="center"
  1332. prop="describe"
  1333. label="描述"
  1334. >
  1335. <template slot-scope="scope">
  1336. <el-input v-model="scope.row.remark"></el-input>
  1337. </template>
  1338. </el-table-column>
  1339. <el-table-column
  1340. label="操作"
  1341. width="120"
  1342. align="center"
  1343. >
  1344. <template slot-scope="scope">
  1345. <el-button
  1346. type="text"
  1347. size="small"
  1348. class="text-icon-danger"
  1349. @click="delNodeInfoss(scope.$index)"
  1350. >删除</el-button>
  1351. </template>
  1352. </el-table-column>
  1353. </el-table>
  1354. </div>
  1355. <span
  1356. slot="footer"
  1357. class="dialog-footer"
  1358. >
  1359. <el-button @click="nodeInfoVisible = false">取 消</el-button>
  1360. <el-button
  1361. type="primary"
  1362. @click="nodeInfoSave()"
  1363. >保 存</el-button>
  1364. </span>
  1365. </el-dialog>
  1366. <!-- 设置参数名称 -->
  1367. <el-dialog
  1368. title="设置参数名称"
  1369. :visible.sync="infoNameVisible"
  1370. width="800px"
  1371. append-to-body
  1372. class="jiedian"
  1373. :close-on-click-modal="false"
  1374. >
  1375. <div>
  1376. <div class="flexEnd">
  1377. <i
  1378. class="el-icon-circle-plus marbottom10"
  1379. @click="setParameterName()"
  1380. style="font-size:24px;color:rgb(37, 193, 99);cursor: pointer;"
  1381. ></i>
  1382. </div>
  1383. <el-table
  1384. :data="namelists"
  1385. border
  1386. style="width: 100%"
  1387. height="400"
  1388. >
  1389. <el-table-column
  1390. align="center"
  1391. prop="name"
  1392. label="参数名称"
  1393. >
  1394. <template slot-scope="scope">
  1395. <el-input v-model="scope.row.name"></el-input>
  1396. </template>
  1397. </el-table-column>
  1398. <el-table-column
  1399. align="center"
  1400. prop="key"
  1401. label="参数值KEY"
  1402. >
  1403. <template slot-scope="scope">
  1404. <el-input v-model="scope.row.k"></el-input>
  1405. </template>
  1406. </el-table-column>
  1407. <el-table-column
  1408. align="center"
  1409. prop="describe"
  1410. label="描述"
  1411. >
  1412. <template slot-scope="scope">
  1413. <el-input v-model="scope.row.remark"></el-input>
  1414. </template>
  1415. </el-table-column>
  1416. <el-table-column
  1417. label="操作"
  1418. width="120"
  1419. align="center"
  1420. >
  1421. <template slot-scope="scope">
  1422. <el-button
  1423. type="text"
  1424. size="small"
  1425. class="text-icon-danger"
  1426. @click="delNodeInfo(scope.$index)"
  1427. >删除</el-button>
  1428. </template>
  1429. </el-table-column>
  1430. </el-table>
  1431. </div>
  1432. <span
  1433. slot="footer"
  1434. class="dialog-footer"
  1435. >
  1436. <el-button @click="addParameterName()">保 存</el-button>
  1437. <el-button @click="closeParameter()">关 闭</el-button>
  1438. </span>
  1439. </el-dialog>
  1440. <el-dialog
  1441. title="别名"
  1442. :visible.sync="aliasVisible"
  1443. width="600px"
  1444. append-to-body
  1445. :close-on-click-modal="false"
  1446. >
  1447. <div>
  1448. <div class="flex">
  1449. <el-input v-model="aliasInput" placeholder="请输入节点别名"></el-input>
  1450. <el-button class="mg-l-20" type="primary" @click="addAlias">添加</el-button>
  1451. </div>
  1452. <div class="flex" style="flex-wrap:wrap">
  1453. <div class="mg-t-10" v-for="(tag,index) in aliasArr" :key="index">
  1454. <el-tag closable @close="delAlias(index)">
  1455. {{tag}}
  1456. </el-tag>
  1457. <span v-if="index != aliasArr.length-1">、</span>
  1458. </div>
  1459. </div>
  1460. </div>
  1461. <span
  1462. slot="footer"
  1463. class="dialog-footer"
  1464. >
  1465. <el-button @click="aliasVisible = false">取 消</el-button>
  1466. <el-button type="primary" @click="saveAliasHandle">确 定</el-button>
  1467. </span>
  1468. </el-dialog>
  1469. <!-- 公式 -->
  1470. <el-dialog title="元素公式" :visible.sync="formulaCompVisible" fullscreen append-to-body class="full-dialog">
  1471. <FormulaEdit :wbsid="id" :nodeid="curTreeData.id" :eleid="formulaCurRow.id" :projectid="projectid" @hideDialog="formulaCompVisible = false" v-if="formulaCompVisible"></FormulaEdit>
  1472. </el-dialog>
  1473. <!-- 编辑元素 -->
  1474. <el-dialog title=" " :visible.sync="editElementVisible" fullscreen append-to-body class="full-dialog">
  1475. <EditElement :pkeyId="editElementQuery.pkeyId" :excelId="editElementQuery.excelId" :id="editElementQuery.id" :initTableName="editElementQuery.initTableName" :pid="editElementQuery.pid" :wbsid="editElementQuery.wbsid" :nodeid="editElementQuery.nodeid" @hideDialog="editElementVisible = false" v-if="editElementVisible"></EditElement>
  1476. </el-dialog>
  1477. </div>
  1478. </template>
  1479. <script>
  1480. import ManualSorting from '@/components/WbsTree/ManualSorting'
  1481. import dynamicExcel from "./treeTemplate/dynamicExcel.vue";
  1482. import FormulaEdit from '@/views/formula/edit.vue'
  1483. import EditElement from '@/views/manager/projectinfo/editElement/editElement.vue'
  1484. import {
  1485. saveFormAndElement, selectFormElements,
  1486. importWbsTree, findWbsTreePrivateSameLevel, wbsTreePrivateSort, parameters, saveOrUpdateBatch, keymap, updateBatchNodeTableInfo2, updateStatus
  1487. } from "@/api/manager/wbstree";
  1488. import {
  1489. saveElement, remove as removeElement, updateBatchElements, getTemplate,
  1490. importWbsElement
  1491. } from "@/api/manager/wbsformelement";
  1492. import { getLazytree, getDetail, update, findNodeTableByCondition as selectByNodeTable, removeTableByCondition as removeTableById, removePrivateTreeNode, wbsTreePrivateTableSort ,privateSubmitFullName,syncNodeParam,syncNodeTable,tabTypeLazyTree} from "@/api/manager/wbsprivate";
  1493. import { findProjectTree as getAlltree } from "@/api/manager/projectinfo";
  1494. import { getList as getAttchFromOriginalName } from "@/api/resource/attach";
  1495. import { getDictionary } from "@/api/system/dict";
  1496. import { mapGetters } from "vuex";
  1497. import { getList, tabLazytreeAll, saveLinkTab, getExcelHtml } from '@/api/exctab/excelmodel'
  1498. import {getStore,setStore} from '@/util/store'
  1499. export default {
  1500. data () {
  1501. var checkMajorDataType = (rule, value, callback) => {
  1502. //console.log(this.nodeDetail.nodeType)
  1503. //console.log(this.nodeDetail.majorDataType)
  1504. if(this.nodeDetail.nodeType == 6){
  1505. if(!this.nodeDetail.majorDataType){
  1506. callback(new Error('工序节点必须选择内业资料类型'));
  1507. }
  1508. }
  1509. callback();
  1510. };
  1511. return {
  1512. formDatass: [],
  1513. editElementFormTag: false,
  1514. jiedianId: '',
  1515. //#region
  1516. sortTag: false,
  1517. sortTag2: false,
  1518. sortArray: [],
  1519. //#endregion
  1520. //#region 关联清表
  1521. loading: false,
  1522. GLExcel: false,
  1523. GLExcelFrom: {
  1524. id: "",
  1525. name: '',
  1526. search: '',//搜素框舒服的值
  1527. ids: '',
  1528. excelId: '',
  1529. initTableName: '',
  1530. },
  1531. GLExcelData: [],//
  1532. GLExcelProps: {
  1533. label: 'name',
  1534. children: 'children',
  1535. disabled: 'hasChildren',
  1536. isLeaf: function (data) {
  1537. let tag = false
  1538. if (!data.hasChildren) {
  1539. tag = true
  1540. }
  1541. if (data.isExistForm == 1) {
  1542. tag = true
  1543. }
  1544. return tag
  1545. },
  1546. },
  1547. exceldata: [],//清表模板
  1548. //#endregion
  1549. //#region 调整表单
  1550. adjustmentExcel: '',
  1551. excelHtml: false,
  1552. //#endregion
  1553. //#region
  1554. id: '',
  1555. projectid: '',
  1556. filterText: '',
  1557. treeData: [],
  1558. treeLoad: false,
  1559. menuShow: false,
  1560. defaultProps: {
  1561. children: 'children',
  1562. label: 'title',
  1563. isLeaf: function (data) {
  1564. //console.log(data, !data.hasChildren, data.isExistForm);
  1565. let tag = false
  1566. if (!data.hasChildren) {
  1567. tag = true
  1568. }
  1569. if (data.isExistForm == 1) {
  1570. tag = true
  1571. }
  1572. if (data.nodeType >= 6 && data.nodeType <= 13) {
  1573. tag = true
  1574. }
  1575. //中间交工。开工报告、质量评定)
  1576. if(data.majorDataType == 1 || data.majorDataType == 2 || data.majorDataType == 3){
  1577. tag = true
  1578. }
  1579. return tag
  1580. // return !data.hasChildren || (data.isExistForm == 1);
  1581. },
  1582. },
  1583. leftType: 5,
  1584. curTreeData: {},
  1585. curTreeNode: {},
  1586. tableData: [],
  1587. nodeDetail: {},
  1588. formData: [],
  1589. editType: 1,
  1590. dialogVisible: false,
  1591. saveNodeLoading: false,
  1592. nodeTypelist: [],
  1593. majorDataTypeList: [],
  1594. rules: {
  1595. nodeName: [
  1596. { required: true, message: '请输入节点名称', trigger: 'blur' },
  1597. ],
  1598. nodeType: [
  1599. { required: true, message: '请选择节点类型', trigger: 'change' }
  1600. ],
  1601. majorDataType:[
  1602. { validator: checkMajorDataType, trigger: 'change' }
  1603. ]
  1604. },
  1605. eleVisible: false,
  1606. tableTypelist: [],
  1607. dataTypeList: [],
  1608. ownerTypeList: [],
  1609. eleForm: {
  1610. elementList: [],
  1611. },
  1612. eleRules: {
  1613. nodeName: [
  1614. { required: true, message: '请输入表名称', trigger: 'blur' },
  1615. ],
  1616. tableType: [
  1617. { required: true, message: '请选择表类型', trigger: 'change' }
  1618. ],
  1619. tableOwner: [
  1620. { required: true, message: '请选择所属方', trigger: 'change' }
  1621. ],
  1622. },
  1623. importVisible: false,
  1624. tempList: [],
  1625. curEleTable: {},
  1626. editEleVisible: false,
  1627. editEleList: [],
  1628. eleReg: /(≥|≤|±|【】)?([^≥≤±【】]*)/,
  1629. editEleFormulaVisible: false,
  1630. formulaInput: '',
  1631. editEleListFilter:[],
  1632. editEleListAll:[],
  1633. importTemplateVisible: false,
  1634. fileUrl: '',
  1635. upFile: null,
  1636. importLoading: false,
  1637. nodeInfoVisible: false,
  1638. nodeInfoTable: [],
  1639. namelist: [],
  1640. namelists: [],
  1641. infoNameVisible: false,
  1642. excelSortTag: false,
  1643. excelSortTag2: false,
  1644. tableSortList: [],
  1645. //#endregion
  1646. defaultExpandedKeys:[],
  1647. expandName:this.$route.fullPath,
  1648. aliasVisible:false,//别名
  1649. aliasInput:'',
  1650. aliasArr:[],
  1651. formulaCompVisible:false,//公式弹框
  1652. formulaCurRow:{},//当前元素
  1653. editElementVisible:false,//编辑元素弹框
  1654. editElementQuery:{
  1655. pkeyId: '',
  1656. excelId: '',
  1657. id: '',
  1658. initTableName:'',
  1659. pid: '',
  1660. wbsid: '',
  1661. nodeid: '',
  1662. },//传参
  1663. syncBtnLoad:false,
  1664. showType:1,
  1665. typeTreeData:[],
  1666. };
  1667. },
  1668. computed: {
  1669. ...mapGetters(["userInfo"]),
  1670. dialogTitle: function () {
  1671. let text = '节点';
  1672. if (this.leftType == 1) {
  1673. text = '新增' + text;
  1674. } else if (this.leftType == 2) {
  1675. text = '编辑' + text;
  1676. }
  1677. return text;
  1678. },
  1679. },
  1680. created () {
  1681. this.init();
  1682. //console.log(this.userInfo)
  1683. },
  1684. methods: {
  1685. //#region
  1686. init () {
  1687. this.id = this.$route.query.wbsid;
  1688. this.projectid = this.$route.query.pid;
  1689. this.getNodeTypelist();
  1690. this.getTableTypelist();
  1691. this.getDataTypelist();
  1692. this.getOwnerTypelist();
  1693. this.defaultExpandedKeys = getStore({name:this.expandName});
  1694. },
  1695. loadNode (node, resolve) {
  1696. let pid = 0;
  1697. if (node.level != 0) {
  1698. pid = node.data.id
  1699. }
  1700. getLazytree(this.id, pid, this.userInfo.tenant_id, this.projectid).then((res) => {
  1701. let arr = [];
  1702. if (Array.isArray(res.data.data)) {
  1703. arr = res.data.data;
  1704. }
  1705. return resolve(arr);
  1706. })
  1707. },
  1708. getNodeDetail (data, node) {
  1709. let parentName = '';
  1710. if (node.parent.data) {
  1711. parentName = node.parent.data.title;
  1712. }
  1713. this.curTreeData = data;
  1714. this.curTreeNode = node;
  1715. this.curTreeData.parentName = parentName;
  1716. getDetail(data.id, this.id, this.projectid).then((res) => {
  1717. res.data.data.parentName = parentName;
  1718. this.tableData = [res.data.data];
  1719. this.nodeDetail = Object.assign({}, res.data.data);
  1720. })
  1721. this.updateNodeTable();
  1722. //获取节点展开路径
  1723. this.getExpandedKeys(node);
  1724. },
  1725. saveNode () {
  1726. this.$refs['nodeDetail'].validate((valid) => {
  1727. if (valid) {
  1728. if (this.editType == 1) {
  1729. this.addNode();
  1730. } else if (this.editType == 2) {
  1731. this.updateNode();
  1732. }
  1733. } else {
  1734. console.log('error submit!!');
  1735. return false;
  1736. }
  1737. });
  1738. },
  1739. addNode () {
  1740. this.saveNodeLoading = true;
  1741. update(this.nodeDetail).then(() => {
  1742. this.updateTreeNewNode();
  1743. this.dialogVisible = false;
  1744. this.$message({
  1745. type: "success",
  1746. message: "新增成功!"
  1747. });
  1748. })
  1749. },
  1750. updateNode () {
  1751. update(this.nodeDetail).then(() => {
  1752. let node = this.tableData[0];
  1753. node.nodeName = this.nodeDetail.nodeName;
  1754. node.nodeType = this.nodeDetail.nodeType;
  1755. this.curTreeData.title = this.nodeDetail.nodeName;
  1756. this.dialogVisible = false;
  1757. this.$message({
  1758. type: "success",
  1759. message: "修改成功!"
  1760. });
  1761. })
  1762. },
  1763. setLeftType (type, data, node) {
  1764. this.jiedianId = data.id
  1765. if (type == 4 || type == 5) {
  1766. this.leftType = type;
  1767. }
  1768. this.curTreeData = data;
  1769. this.curTreeNode = node;
  1770. this.$refs.tree.setCurrentKey(data.id);
  1771. if (type == 1 || type == 2) {
  1772. this.getMajorDataTypeList();
  1773. this.dialogVisible = true;
  1774. this.editType = type;
  1775. }
  1776. getDetail(data.id, this.id, this.projectid).then((res) => {
  1777. let parentName = '';
  1778. if (node.parent.data) {
  1779. parentName = node.parent.data.title;
  1780. }
  1781. res.data.data.parentName = parentName;
  1782. this.tableData = [res.data.data];
  1783. if (type == 1) {
  1784. this.nodeDetail = {
  1785. parentId: res.data.data.id,
  1786. parentName: parentName,
  1787. projectId: res.data.data.projectId
  1788. };
  1789. } else {
  1790. this.nodeDetail = Object.assign({}, res.data.data);
  1791. }
  1792. this.nodeDetail.type = 1;// '1'节点 '2'表单
  1793. this.nodeDetail.wbsId = this.id;
  1794. this.nodeDetail.tenantId = this.userInfo.tenant_id
  1795. })
  1796. if (this.leftType == 4) {
  1797. selectByNodeTable(data.id, this.projectid, this.id).then((res) => {
  1798. if (res.data.data.length) {
  1799. this.formData = res.data.data;
  1800. } else {
  1801. this.formData = [];
  1802. }
  1803. })
  1804. }
  1805. //获取节点展开路径
  1806. this.getExpandedKeys(node);
  1807. },
  1808. showFormElement () {
  1809. if (!this.nodeDetail.id) {
  1810. this.$message({
  1811. type: "warning",
  1812. message: "请先选择在哪个节点下创建表"
  1813. });
  1814. return;
  1815. }
  1816. this.eleVisible = true;
  1817. },
  1818. addEleRow (list) {
  1819. list.push({});
  1820. },
  1821. delEleRow (index, list) {
  1822. list.splice(index, 1);
  1823. },
  1824. saveFormAndElementHandle () {
  1825. this.$refs['eleDialog'].validate((valid) => {
  1826. if (valid) {
  1827. this.eleForm.wbsId = this.id;
  1828. this.eleForm.tenantId = this.userInfo.tenant_id;
  1829. this.eleForm.nodeType = -1;
  1830. this.eleForm.type = 2;// '1'节点 '2'表单
  1831. this.eleForm.parentId = this.nodeDetail.id;
  1832. this.eleForm.elementList.forEach((element) => {
  1833. element.eAllowDeviation = (element.allow ? element.allow : '') + (element.deviation ? element.deviation : '');
  1834. if (element.eType == 4) {
  1835. element.eLength = 0;
  1836. }
  1837. })
  1838. saveFormAndElement(this.eleForm).then(() => {
  1839. //console.log(res)
  1840. this.updateTreeNewNode();
  1841. this.updateNodeTable();
  1842. this.eleVisible = false;
  1843. this.$message({
  1844. type: "success",
  1845. message: "新增成功!"
  1846. });
  1847. })
  1848. } else {
  1849. console.log('error submit!!');
  1850. return false;
  1851. }
  1852. });
  1853. },
  1854. updateTreeNewNode () {
  1855. getLazytree(this.id, this.nodeDetail.parentId, this.userInfo.tenant_id, this.projectid).then((res) => {
  1856. this.$refs.tree.updateKeyChildren(this.nodeDetail.parentId, res.data.data)
  1857. })
  1858. },
  1859. updateNodeTable () {
  1860. selectByNodeTable(this.curTreeData.id, this.projectid, this.id).then((res) => {
  1861. if (res.data.data.length) {
  1862. this.formData = res.data.data;
  1863. } else {
  1864. this.formData = [];
  1865. }
  1866. })
  1867. },
  1868. deleNode (data, node) {
  1869. this.$confirm('此操作将删除节点【' + data.title + '】, 是否继续?', '提示', {
  1870. confirmButtonText: '确定',
  1871. cancelButtonText: '取消',
  1872. type: 'warning'
  1873. }).then(() => {
  1874. removePrivateTreeNode(data.primaryKeyId).then(() => {
  1875. this.$refs.tree.remove(node);
  1876. this.$message({
  1877. type: "success",
  1878. message: "删除成功!"
  1879. });
  1880. })
  1881. }).catch(() => {
  1882. });
  1883. },
  1884. importHandle () {
  1885. },
  1886. handleEdit (index, row) {
  1887. this.curEleTable = row;
  1888. selectFormElements(this.curEleTable.id).then((res) => {
  1889. res.data.data.forEach((element) => {
  1890. this.eleReg.exec(element.eAllowDeviation);
  1891. // console.log(RegExp.$1)
  1892. // console.log(RegExp.$2)
  1893. element.allow = RegExp.$1 ? RegExp.$1 : '';
  1894. element.deviation = RegExp.$2 ? RegExp.$2 : '';
  1895. })
  1896. this.editEleList = res.data.data;
  1897. })
  1898. this.editEleVisible = true;
  1899. },
  1900. handleDelete (index, row) {
  1901. this.$confirm('是否删除 ' + row.tableName + ' ?', '删除元素表', {
  1902. distinguishCancelAndClose: true,
  1903. confirmButtonText: '删除',
  1904. cancelButtonText: '取消'
  1905. }).then(() => {
  1906. removeTableById(row.id, this.projectid, this.id).then(() => {
  1907. this.formData.splice(index, 1);
  1908. this.$message({
  1909. type: "success",
  1910. message: "删除成功!"
  1911. });
  1912. })
  1913. })
  1914. },
  1915. async hideMD (row) {//隐藏按钮
  1916. const code = await this.updateStatus(row.pkeyId, row.status)
  1917. if (code == 200) {
  1918. if (row.status == 0) {
  1919. row.status = 1
  1920. } else {
  1921. row.status = 0
  1922. }
  1923. }
  1924. },
  1925. async updateStatus (pKeyId, status) {//隐藏功能激活
  1926. const { data: res } = await updateStatus({ pKeyId })
  1927. if (res.code == 200) {
  1928. this.$message({
  1929. type: 'success',
  1930. message: status == 1 ? '隐藏成功' : '激活成功'
  1931. })
  1932. }
  1933. return res.code
  1934. },
  1935. handleEditFormula (index, row) {
  1936. this.curEleTable = row;
  1937. selectFormElements(this.curEleTable.id).then((res) => {
  1938. this.editEleListFilter = res.data.data;
  1939. this.editEleListAll = [].concat(this.editEleListFilter);
  1940. })
  1941. this.editEleFormulaVisible = true;
  1942. },
  1943. //搜索 筛选
  1944. searchFormulaName(){
  1945. this.editEleListFilter = this.editEleListAll.filter((ele)=>{
  1946. return ele.eName.indexOf(this.formulaInput) > -1;
  1947. })
  1948. },
  1949. saveNewEle (row) {
  1950. row.eAllowDeviation = (row.allow ? row.allow : '') + (row.deviation ? row.deviation : '');
  1951. row.fId = this.curEleTable.id;
  1952. row.initTableName = this.curEleTable.initTableName;
  1953. if (row.eType == 4) {
  1954. row.eLength = 0;
  1955. }
  1956. saveElement(row).then((res) => {
  1957. if (res.data.data) {
  1958. this.$set(row, 'id', res.data.data.id);
  1959. this.$set(row, 'ekey', res.data.data.ekey);
  1960. this.$message({
  1961. type: "success",
  1962. message: "保存成功!"
  1963. });
  1964. }
  1965. })
  1966. },
  1967. delEleRowHandle (index, list) {
  1968. let row = list[index];
  1969. if (row.id) {
  1970. //有id需要请求删除
  1971. this.$confirm('是否确认删除?', '删除元素', {
  1972. distinguishCancelAndClose: true,
  1973. confirmButtonText: '删除',
  1974. cancelButtonText: '取消'
  1975. }).then(() => {
  1976. removeElement(row.id, this.curEleTable.initTableName, row.ekey).then(() => {
  1977. list.splice(index, 1);
  1978. })
  1979. })
  1980. } else {
  1981. list.splice(index, 1);
  1982. }
  1983. },
  1984. saveEles () {
  1985. for (let i = 0; i < this.editEleList.length; i++) {
  1986. if (!this.editEleList[i].id) {
  1987. this.$message({
  1988. type: "warning",
  1989. message: "请先将新增的元素点击保存"
  1990. });
  1991. return;
  1992. }
  1993. }
  1994. if (this.editEleList.length > 0) {
  1995. this.editEleList.forEach((element) => {
  1996. element.eAllowDeviation = (element.allow ? element.allow : '') + (element.deviation ? element.deviation : '');
  1997. if (element.eType == 4) {
  1998. element.eLength = 0;
  1999. }
  2000. })
  2001. updateBatchElements(this.editEleList, this.curEleTable.initTableName).then(() => {
  2002. this.editEleVisible = false;
  2003. this.updateNodeTable();
  2004. this.$message({
  2005. type: "success",
  2006. message: "保存成功!"
  2007. });
  2008. })
  2009. } else {
  2010. this.editEleVisible = false;
  2011. this.updateNodeTable();
  2012. this.$message({
  2013. type: "success",
  2014. message: "保存成功!"
  2015. });
  2016. }
  2017. },
  2018. filterChange () {
  2019. //console.log(this.$refs)
  2020. //debugger
  2021. if (this.treeData.length > 0) {
  2022. this.$refs.treeall.filter(this.filterText);
  2023. return;
  2024. }
  2025. this.treeLoad = true;
  2026. getAlltree(this.projectid, this.id).then((res) => {
  2027. this.treeLoad = false;
  2028. this.treeData = res.data.data;
  2029. this.$nextTick(() => {
  2030. this.$refs.treeall.filter(this.filterText);
  2031. })
  2032. })
  2033. },
  2034. importTemplate (data) {
  2035. this.importTemplateVisible = true;
  2036. this.curTreeData = data;
  2037. if (!this.fileUrl) {
  2038. getAttchFromOriginalName(1, 20, {
  2039. originalName: 'WBS划分模板.xls'
  2040. }).then((res) => {
  2041. if (res.data.data.records.length) {
  2042. this.fileUrl = res.data.data.records[0].link;
  2043. } else {
  2044. this.fileUrl = '';
  2045. }
  2046. })
  2047. }
  2048. },
  2049. importTemplateHandle () {
  2050. if (!this.upFile) {
  2051. this.$message({
  2052. type: "warning",
  2053. message: "请先选择文件再进行导入"
  2054. });
  2055. return;
  2056. }
  2057. let forms = new FormData();
  2058. forms.append('excelFile', this.upFile);
  2059. let wbsTreeFu = {
  2060. wbsId: this.id,
  2061. parentId: this.curTreeData.id,
  2062. // ancestors:'0,'+this.curTreeData.id,
  2063. }
  2064. let json = JSON.stringify(wbsTreeFu);
  2065. let blob = new Blob([json], { type: 'application/json' })
  2066. forms.append('wbsTreeFu', blob);
  2067. this.importLoading = true;
  2068. importWbsTree(forms).then(() => {
  2069. //this.$router.go(0)
  2070. let node = this.$refs.tree.getNode(this.curTreeData.id);
  2071. node.isLeaf = false;
  2072. this.importTemplateVisible = false;
  2073. this.upFile = null;
  2074. }).finally(() => {
  2075. this.importLoading = false;
  2076. })
  2077. },
  2078. handleDownload () {
  2079. if (this.fileUrl) {
  2080. window.open(this.fileUrl);
  2081. } else {
  2082. this.$message({
  2083. type: "warning",
  2084. message: "请先在附件管理上传【WBS划分模板.xls】文件"
  2085. });
  2086. }
  2087. },
  2088. fileClick () {
  2089. this.$refs.file.click();
  2090. },
  2091. fileChange (e) {
  2092. const file = e.target.files[0]
  2093. if (!file) {
  2094. // 如果用户没有选择图片,只是点了文件上传这个按钮
  2095. return
  2096. }
  2097. //console.log(file)
  2098. this.upFile = file;
  2099. },
  2100. editNodeInfo (index, row) {
  2101. this.$set(row, 'isEdit', true);
  2102. },
  2103. saveNodeInfoHandle (index, row) {
  2104. row.isEdit = false;
  2105. },
  2106. downloadTmp () {
  2107. getTemplate().then((res) => {
  2108. //console.log(res)
  2109. let blob = new Blob([res.data], {
  2110. type: 'application/vnd.ms-excel'
  2111. });
  2112. //console.log(blob)
  2113. let filename = Date.parse(new Date()) + '.xls';
  2114. if (window.navigator.msSaveOrOpenBlob) {
  2115. // 兼容IE10
  2116. window.navigator.msSaveBlob(blob, filename);
  2117. } else {
  2118. // 兼容chrome/firefox
  2119. let aTag = document.createElement('a');
  2120. aTag.download = Date.parse(new Date()) + '.xls';
  2121. aTag.href = window.URL.createObjectURL(blob);
  2122. aTag.click();
  2123. URL.revokeObjectURL(aTag.href);
  2124. }
  2125. })
  2126. },
  2127. fileClick2 () {
  2128. this.$refs.file2.click();
  2129. },
  2130. tmpImport (e) {
  2131. const file = e.target.files[0];
  2132. const formData = new FormData();
  2133. formData.append('file', file);
  2134. //console.log(file.name)
  2135. importWbsElement(formData).then((res) => {
  2136. res.data.data.forEach((element) => {
  2137. element.eName = element.elementName;
  2138. element.eLength = element.elementLength;
  2139. element.eType = Number(element.elementType);
  2140. element.eAllowDeviation = element.elementAllowDeviation;
  2141. element.eInspectionMethod = element.elementInspectionMethod;
  2142. this.eleReg.exec(element.eAllowDeviation);
  2143. // console.log(RegExp.$1)
  2144. // console.log(RegExp.$2)
  2145. element.allow = RegExp.$1 ? RegExp.$1 : '';
  2146. element.deviation = RegExp.$2 ? RegExp.$2 : '';
  2147. })
  2148. this.eleForm.elementList = res.data.data;
  2149. this.importVisible = false;
  2150. }).finally(() => {
  2151. e.target.value = '';
  2152. })
  2153. },
  2154. visiblechange (value, data) {
  2155. this.$set(data, 'moreShow', value)
  2156. },
  2157. bianhua2 () {
  2158. this.excelSortTag2 = false
  2159. this.$nextTick(() => {
  2160. this.excelSortTag2 = true
  2161. })
  2162. },
  2163. //私有树的元素表修改排序
  2164. privateTableSort () {
  2165. if (!this.curTreeData.id) {
  2166. this.$message({
  2167. type: "warning",
  2168. message: "请先选择需要排序的节点"
  2169. })
  2170. return;
  2171. }
  2172. this.tableSortList = this.formData.map((form, index) => {
  2173. return {
  2174. sort: index + 1,
  2175. nodeName: form.tableName,
  2176. pkeyId: form.pkeyId,
  2177. }
  2178. })
  2179. this.excelSortTag = true
  2180. this.excelSortTag2 = true
  2181. },
  2182. editPrivateSort () {
  2183. wbsTreePrivateTableSort(this.tableSortList).then(() => {
  2184. this.updateNodeTable();
  2185. this.$message({
  2186. type: "success",
  2187. message: "排序成功!"
  2188. });
  2189. this.excelSortTag = false;
  2190. this.excelSortTag2 = false;
  2191. })
  2192. },
  2193. //解析元素数据类型
  2194. eTypeFormatter (row) {
  2195. let text = '';
  2196. for (let i = 0; i < this.dataTypeList.length; i++) {
  2197. if (this.dataTypeList[i].dictKey == row.eType) {
  2198. text = this.dataTypeList[i].dictValue;
  2199. break;
  2200. }
  2201. }
  2202. return text;
  2203. },
  2204. //跳转到公式配置页面
  2205. toFormulaEdit (row) {
  2206. // this.$router.push({
  2207. // path: '/formula/edit',
  2208. // query: {
  2209. // wbsid: this.id,
  2210. // eleid: row.id,
  2211. // nodeid:this.curTreeData.id,
  2212. // projectid:this.projectid
  2213. // }
  2214. // });
  2215. this.formulaCurRow = row;
  2216. this.formulaCompVisible = true;
  2217. },
  2218. getNodeTypelist () {
  2219. if (this.nodeTypelist.length > 1) {
  2220. return;
  2221. }
  2222. getDictionary({
  2223. code: 'wbs_node_type'
  2224. }).then((res) => {
  2225. res.data.data.forEach(element => {
  2226. element.dictKey = Number(element.dictKey)
  2227. });
  2228. this.nodeTypelist = res.data.data;
  2229. })
  2230. },
  2231. getMajorDataTypeList () {
  2232. if (this.majorDataTypeList.length > 1) {
  2233. return;
  2234. }
  2235. getDictionary({
  2236. code: 'major_data_type'
  2237. }).then((res) => {
  2238. res.data.data.forEach(element => {
  2239. element.dictKey = Number(element.dictKey)
  2240. });
  2241. this.majorDataTypeList = res.data.data;
  2242. })
  2243. },
  2244. getTableTypelist () {
  2245. if (this.tableTypelist.length > 1) {
  2246. return;
  2247. }
  2248. getDictionary({
  2249. code: 'table_type'
  2250. }).then((res) => {
  2251. res.data.data.forEach(element => {
  2252. element.dictKey = Number(element.dictKey)
  2253. });
  2254. this.tableTypelist = res.data.data;
  2255. })
  2256. },
  2257. getDataTypelist () {
  2258. if (this.dataTypeList.length > 1) {
  2259. return;
  2260. }
  2261. getDictionary({
  2262. code: 'data_type'
  2263. }).then((res) => {
  2264. res.data.data.forEach(element => {
  2265. element.dictKey = Number(element.dictKey)
  2266. });
  2267. this.dataTypeList = res.data.data;
  2268. })
  2269. },
  2270. getOwnerTypelist () {
  2271. if (this.ownerTypeList.length > 1) {
  2272. return;
  2273. }
  2274. getDictionary({
  2275. code: 'owner_type'
  2276. }).then((res) => {
  2277. res.data.data.forEach(element => {
  2278. element.dictKey = Number(element.dictKey)
  2279. });
  2280. this.ownerTypeList = res.data.data;
  2281. })
  2282. },
  2283. formatCat (row, column, cellValue) {
  2284. for (let i = 0; i < this.nodeTypelist.length; i++) {
  2285. if (this.nodeTypelist[i].dictKey == cellValue) {
  2286. return this.nodeTypelist[i].dictValue
  2287. }
  2288. }
  2289. return cellValue;
  2290. //console.log(cellValue)
  2291. },
  2292. formatTableType (row, column, cellValue) {
  2293. for (let i = 0; i < this.tableTypelist.length; i++) {
  2294. if (this.tableTypelist[i].dictKey == cellValue) {
  2295. return this.tableTypelist[i].dictValue
  2296. }
  2297. }
  2298. return cellValue;
  2299. //console.log(cellValue)
  2300. },
  2301. formatOwner (row, column, cellValue) {
  2302. for (let i = 0; i < this.ownerTypeList.length; i++) {
  2303. if (this.ownerTypeList[i].dictKey == cellValue) {
  2304. return this.ownerTypeList[i].dictValue
  2305. }
  2306. }
  2307. return cellValue;
  2308. //console.log(cellValue)
  2309. },
  2310. formatdataType (row, column, cellValue) {
  2311. for (let i = 0; i < this.dataTypeList.length; i++) {
  2312. if (this.dataTypeList[i].dictKey == cellValue) {
  2313. return this.dataTypeList[i].dictValue
  2314. }
  2315. }
  2316. return cellValue;
  2317. },
  2318. filterNode (value, data) {
  2319. if (!value) return true;
  2320. return data.title.indexOf(value) !== -1;
  2321. },
  2322. //#endregion
  2323. //#region wbs私有树排序
  2324. async sortpai (data) {
  2325. console.log(data);
  2326. await this.findWbsTreePrivateSameLevel({
  2327. parentId: data.parentId,
  2328. projectId: this.projectid,
  2329. wbsId: this.id
  2330. })
  2331. this.sortTag = true
  2332. this.sortTag2 = true
  2333. },
  2334. editSort () {
  2335. this.wbsTreePrivateSort()
  2336. },
  2337. bianhua () {
  2338. this.sortTag2 = false
  2339. this.$nextTick(() => {
  2340. this.sortTag2 = true
  2341. })
  2342. },
  2343. async wbsTreePrivateSort () {//wbs私有树节点手动排序
  2344. const { data: res } = await wbsTreePrivateSort(this.sort)
  2345. console.log(res);
  2346. if (res.code == 200) {
  2347. this.sortTag = false
  2348. this.sortTag2 = false
  2349. this.getLazytreessss()
  2350. }
  2351. },
  2352. async findWbsTreePrivateSameLevel (da) {//wbs私有树同级节点接口
  2353. const { data: res } = await findWbsTreePrivateSameLevel(da)
  2354. console.log(res);
  2355. if (res.code == 200) {
  2356. this.sort = res.data
  2357. }
  2358. },
  2359. async getLazytreessss () {
  2360. const { data: res } = await getLazytree(this.id, 0, this.userInfo.tenant_id, this.projectid)
  2361. console.log(res);
  2362. if (res.code == 200) {
  2363. this.treeData = res.data
  2364. }
  2365. },
  2366. //#endregion
  2367. //#region 关联清表
  2368. async getList (da) {//获取清表模板信息
  2369. const { data: res } = await getList(da)
  2370. console.log(res);
  2371. if (res.code === 200 && res.msg === '操作成功') {
  2372. this.GLExcelData = res.data.records
  2373. }
  2374. },
  2375. async tabLazytreeAll () {//清表树信息
  2376. const { data: res } = await tabLazytreeAll({
  2377. modeId: this.GLExcelFrom.name,
  2378. name: this.GLExcelFrom.search,
  2379. })
  2380. console.log(res);
  2381. if (res.code === 200 && res.msg === '操作成功') {
  2382. this.exceldata = res.data
  2383. }
  2384. },
  2385. Associationlist (scope) {//关联清表点击事件
  2386. console.log(scope.row);
  2387. this.GLExcel = true
  2388. this.getList({
  2389. current: 1,
  2390. size: 100000,
  2391. parentId: 0,
  2392. })
  2393. this.GLExcelFrom.name = scope.row.modeId
  2394. setTimeout(() => {
  2395. this.$refs.tree.setCheckedKeys([scope.row.excelId])
  2396. }, 2000)
  2397. this.GLExcelFrom.id = scope.row.pkeyId
  2398. this.GLExcelFrom.excelId = scope.row.excelId
  2399. this.GLExcelFrom.ids = scope.row.id
  2400. this.GLExcelFrom.initTableName = scope.row.initTableName
  2401. },
  2402. changetherr () {//清表类型选择框change事件
  2403. if (this.GLExcelFrom.name != "") {
  2404. this.GLExcelFrom.search = ''
  2405. this.tabLazytreeAll()
  2406. }
  2407. },
  2408. GLExcelMD () {//弹框关闭事件
  2409. this.GLExcelFrom.name = ""
  2410. this.GLExcelFrom.search = ''
  2411. this.GLExcelFrom.id = ''
  2412. this.exceldata = []
  2413. this.$refs.tree.setCheckedKeys([])
  2414. this.GLExcel = false
  2415. },
  2416. checkchange (data) {//节点选中回调
  2417. if (this.$refs.tree.getCheckedNodes().length === 0) {
  2418. this.$refs.tree.setCheckedKeys([])
  2419. } else if (this.$refs.tree.getCheckedNodes().length >= 1) {
  2420. this.$refs.tree.setCheckedKeys([data.id])
  2421. }
  2422. },
  2423. async saveLinkTab () {//保存按钮
  2424. let checkNodes = this.$refs.tree.getCheckedNodes();
  2425. if (checkNodes.length > 0) {
  2426. let node = checkNodes[checkNodes.length - 1];
  2427. if(node.fileType != 3){
  2428. this.$message({
  2429. type: "warning",
  2430. message: "请先上传Excel表"
  2431. });
  2432. return;
  2433. }
  2434. const { data: res } = await saveLinkTab({
  2435. exceTabId: node.id,
  2436. tabId: this.GLExcelFrom.id,
  2437. })
  2438. console.log(res);
  2439. if (res.code === 200) {
  2440. this.$message({
  2441. type: 'success',
  2442. message: '关联清表成功',
  2443. })
  2444. this.GLExcel = false
  2445. this.rightClick(this.GLExcelFrom.id, this.GLExcelFrom.excelId, this.GLExcelFrom.ids, this.GLExcelFrom.initTableName,)
  2446. }
  2447. } else {
  2448. this.$message({
  2449. type: 'warning',
  2450. message: '请先设置清表',
  2451. })
  2452. }
  2453. },
  2454. filterNode222 (value, data) {
  2455. if (!value) return true;
  2456. return data.name.indexOf(value) !== -1;
  2457. },
  2458. //#endregion
  2459. //#region 节点参数
  2460. nodeInfo (data) {//节点参数按钮
  2461. this.keymap()
  2462. //console.log(data)
  2463. this.jiedianId = data.primaryKeyId
  2464. this.parameters(data.primaryKeyId)
  2465. this.nodeInfoVisible = true;
  2466. },
  2467. addNodeInfoTable () {//添加节点参数数据
  2468. this.nodeInfoTable.unshift({ k: '', v: '', remark: '', wbsId: this.jiedianId, type: 1 })
  2469. },
  2470. delNodeInfo (key) {//设置参数名称中的删除按钮
  2471. this.namelists.splice(key, 1)
  2472. },
  2473. delNodeInfoss (key) {//节点参数
  2474. this.nodeInfoTable.splice(key, 1)
  2475. },
  2476. setNodeParameters () {//打开设置节点参数弹框按钮
  2477. this.infoNameVisible = true
  2478. this.namelists = [...this.namelist]
  2479. },
  2480. async setParameterName () {//设置参数名称中添加节点参数按钮
  2481. // wbsId: this.jiedianId
  2482. this.namelists.unshift({ name: '', remark: '', k: '', type: 0, })
  2483. },
  2484. async nodeInfoSave () {//节点参数弹框保存按钮
  2485. if (this.nodeInfoTable) {
  2486. if(this.nodeInfoTable.length == 0){
  2487. await this.saveOrUpdateBatch([{
  2488. "wbsId": this.id,
  2489. "type": -1,
  2490. }])
  2491. this.nodeInfoVisible = false
  2492. this.$message({
  2493. type: "success",
  2494. message: "保存参数节点成功!"
  2495. })
  2496. return;
  2497. }
  2498. let tag = true
  2499. this.nodeInfoTable.forEach(val => {
  2500. if (!val.k | !val.v) {
  2501. return tag = false
  2502. }
  2503. if(!val.name){
  2504. for (let i = 0; i < this.namelist.length; i++) {
  2505. if(this.namelist[i].k == val.k){
  2506. val.name = this.namelist[i].name;
  2507. return;
  2508. }
  2509. }
  2510. }
  2511. })
  2512. if (tag) {
  2513. await this.saveOrUpdateBatch(this.nodeInfoTable)
  2514. this.nodeInfoVisible = false
  2515. this.$message({
  2516. type: "success",
  2517. message: "设置参数节点成功!"
  2518. })
  2519. } else {
  2520. this.$message({
  2521. type: "error",
  2522. message: "请填写所有的参数名称和参数值!"
  2523. })
  2524. }
  2525. } else {
  2526. this.$message({
  2527. type: "error",
  2528. message: "请先设置参数节点!"
  2529. })
  2530. }
  2531. },
  2532. async addParameterName () {//设置参数名称中的保存按钮
  2533. if (this.namelists.length) {
  2534. let tag = true
  2535. this.namelists.forEach(val => {
  2536. if (!val.name || !val.k) {
  2537. return tag = false
  2538. }
  2539. })
  2540. if (tag) {
  2541. await this.saveOrUpdateBatch(this.namelists) //保存设置参数
  2542. this.infoNameVisible = false
  2543. this.keymap()
  2544. } else {
  2545. this.$message({
  2546. type: "error",
  2547. message: "请填写所有的参数名称和参数值KEY!"
  2548. })
  2549. }
  2550. } else {
  2551. this.$message({
  2552. type: "warning",
  2553. message: "请先添加参数"
  2554. })
  2555. }
  2556. },
  2557. closeParameter () {//设置参数名称,关闭按钮
  2558. this.namelists = []
  2559. this.infoNameVisible = false
  2560. },
  2561. async parameters (wbsId) {//获取接待你参数列表
  2562. const { data: res } = await parameters({ wbsId })
  2563. console.log(res);
  2564. if (res.code == 200) {
  2565. this.nodeInfoTable = res.data
  2566. }
  2567. },
  2568. async saveOrUpdateBatch (da) {//保存
  2569. const { data: res } = await saveOrUpdateBatch(da)
  2570. console.log(res);
  2571. },
  2572. async keymap () {//节点参数枚举
  2573. const { data: res } = await keymap()
  2574. console.log(res);
  2575. if (res.code == 200) {
  2576. this.namelist = res.data
  2577. }
  2578. },
  2579. //#endregion
  2580. //#region 调整表单
  2581. adjustExcel (pkeyId, excelId) {//调整表单
  2582. this.GLExcelFrom.id = pkeyId
  2583. this.getExcelHtml(pkeyId)
  2584. },
  2585. async getExcelHtml (pkeyId) {
  2586. const { data: res } = await getExcelHtml({ pkeyId })
  2587. console.log(res);
  2588. if (res.code === 200) {
  2589. localStorage.setItem('excelHtml', res.data)
  2590. this.adjustmentExcel = res.data
  2591. this.excelHtml = true
  2592. }
  2593. },
  2594. removeExcel () {
  2595. this.excelHtml = false
  2596. },
  2597. //#endregion
  2598. //#region 编辑元素
  2599. async rightClick (pkeyId, excelId, id, initTableName) {
  2600. await this.getExcelHtml2(pkeyId)
  2601. // this.$router.push({
  2602. // path: '/project/editElement',
  2603. // query: {
  2604. // pkeyId: pkeyId,
  2605. // excelId: excelId,
  2606. // id: id,
  2607. // initTableName,
  2608. // pid: this.$route.query.pid,
  2609. // wbsid: this.$route.query.wbsid,
  2610. // nodeid:this.curTreeData.id,
  2611. // }
  2612. // })
  2613. this.editElementQuery.pkeyId = pkeyId;
  2614. this.editElementQuery.excelId = excelId;
  2615. this.editElementQuery.id = id;
  2616. this.editElementQuery.initTableName = initTableName;
  2617. this.editElementQuery.pid = this.$route.query.pid;
  2618. this.editElementQuery.wbsid = this.$route.query.wbsid;
  2619. this.editElementQuery.nodeid = this.curTreeData.id;
  2620. this.editElementVisible = true;
  2621. },
  2622. async getExcelHtml2 (pkeyId) {
  2623. const { data: res } = await getExcelHtml({ pkeyId })
  2624. console.log(res);
  2625. if (res.code === 200) {
  2626. localStorage.setItem('editElement', res.data)
  2627. }
  2628. },
  2629. //#endregion
  2630. //#region 元素表单信息
  2631. editEditElementForm () {//标记元素
  2632. if (this.formData.length) {
  2633. let da = []
  2634. this.formDatass = [...this.formData]
  2635. this.formDatass.forEach(val => {
  2636. da.push({
  2637. tableType: val.tableType - 0,
  2638. tableOwner: val.tableOwner - 0,
  2639. pkeyId: val.pkeyId,
  2640. tableName: val.tableName,
  2641. fillRate: val.fillRate,
  2642. })
  2643. })
  2644. this.formDatass = da
  2645. this.editElementFormTag = true
  2646. }
  2647. },
  2648. editeditElementFormMF () {//保存按钮
  2649. let da = []
  2650. let tag = true
  2651. this.formDatass.forEach(val => {
  2652. if (!val.tableName || !val.tableType || !val.tableOwner) {
  2653. tag = false
  2654. return
  2655. } else {
  2656. da.push({
  2657. pkeyId: val.pkeyId,
  2658. nodeName: val.tableName,
  2659. tableType: val.tableType,
  2660. tableOwner: val.tableOwner,
  2661. fillRate: val.fillRate,
  2662. })
  2663. }
  2664. })
  2665. if (tag) {
  2666. this.updateBatchNodeTableInfo2(da)
  2667. } else {
  2668. this.$message({
  2669. type: 'success',
  2670. message: '请填写完整元素表单的所有信息!',
  2671. })
  2672. }
  2673. },
  2674. async updateBatchNodeTableInfo2 (da) {//共有编辑元素
  2675. const { data: res } = await updateBatchNodeTableInfo2(da)
  2676. console.log(res);
  2677. if (res.code == 200) {
  2678. this.editElementFormTag = false
  2679. this.updateNodeTable()
  2680. }
  2681. },
  2682. //#endregion
  2683. //获取节点展开路径
  2684. getExpandedKeys(node){
  2685. //console.log(node)
  2686. let expandedKeys = [];
  2687. while(node.parent){
  2688. expandedKeys.push(node.data.id);
  2689. node = node.parent;
  2690. }
  2691. setStore({
  2692. name:this.expandName,
  2693. content:expandedKeys,
  2694. type:true//sessionStorage
  2695. })
  2696. //console.log(expandedKeys)
  2697. },
  2698. //触发节点参数
  2699. nodeInfoHandle(){
  2700. if(!this.curTreeData.id){
  2701. this.$message({
  2702. type: "warning",
  2703. message: "请先选择节点"
  2704. })
  2705. return;
  2706. }
  2707. this.nodeInfo(this.curTreeData)
  2708. },
  2709. eleFormulaHandle(){
  2710. if(!this.curTreeData.id || !this.curTreeNode.id){
  2711. this.$message({
  2712. type: "warning",
  2713. message: "请先选择节点"
  2714. })
  2715. return;
  2716. }
  2717. this.setLeftType(4,this.curTreeData,this.curTreeNode);
  2718. // this.showType = 2;
  2719. },
  2720. editNodeHandle(){
  2721. if(!this.curTreeData.id || !this.curTreeNode.id){
  2722. this.$message({
  2723. type: "warning",
  2724. message: "请先选择节点"
  2725. })
  2726. return;
  2727. }
  2728. this.setLeftType(2,this.curTreeData,this.curTreeNode)
  2729. },
  2730. copyNodeHandle(){
  2731. if(!this.curTreeData.id || !this.curTreeNode.id){
  2732. this.$message({
  2733. type: "warning",
  2734. message: "请先选择节点"
  2735. })
  2736. return;
  2737. }
  2738. },
  2739. delNodeHandle(){
  2740. if(!this.curTreeData.id || !this.curTreeNode.id){
  2741. this.$message({
  2742. type: "warning",
  2743. message: "请先选择节点"
  2744. })
  2745. return;
  2746. }
  2747. if(this.curTreeNode.level == 1){
  2748. this.$message({
  2749. type: "warning",
  2750. message: "当前节点无法删除"
  2751. })
  2752. return;
  2753. }
  2754. this.deleNode(this.curTreeData,this.curTreeNode)
  2755. },
  2756. eleHandle(){
  2757. if(!this.curTreeData.id || !this.curTreeNode.id){
  2758. this.$message({
  2759. type: "warning",
  2760. message: "请先选择节点"
  2761. })
  2762. return;
  2763. }
  2764. this.setLeftType(5,this.curTreeData,this.curTreeNode);
  2765. },
  2766. syncInfoHandle(){
  2767. this.$confirm('是否同步节点参数?', '提示', {
  2768. confirmButtonText: '确定',
  2769. cancelButtonText: '取消',
  2770. type: 'warning'
  2771. }).then(() => {
  2772. this.syncBtnLoad = true;
  2773. syncNodeParam(this.projectid).then(() => {
  2774. this.$message({
  2775. type: "success",
  2776. message: "同步成功!"
  2777. });
  2778. }).finally(()=>{
  2779. this.syncBtnLoad = false;
  2780. })
  2781. })
  2782. },
  2783. //显示别名弹窗
  2784. aliasShow(){
  2785. this.aliasVisible = true;
  2786. if(this.nodeDetail.fullName){
  2787. this.aliasArr = this.nodeDetail.fullName.split(',');
  2788. }else{
  2789. this.aliasArr = [];
  2790. }
  2791. this.aliasInput = '';
  2792. },
  2793. addAlias(){
  2794. if(this.aliasInput){
  2795. this.aliasArr.push(this.aliasInput);
  2796. this.aliasInput = '';
  2797. }
  2798. },
  2799. delAlias(index){
  2800. this.aliasArr.splice(index,1);
  2801. },
  2802. saveAliasHandle(){
  2803. this.nodeDetail.fullName = this.aliasArr.join(',');
  2804. if (this.editType == 1) {
  2805. //新增
  2806. this.aliasVisible = false;
  2807. } else if (this.editType == 2) {
  2808. //编辑 私有
  2809. privateSubmitFullName(
  2810. this.nodeDetail.pKeyId,this.nodeDetail.fullName
  2811. ).then(()=>{
  2812. this.$message({
  2813. type: 'success',
  2814. message: '保存成功',
  2815. })
  2816. this.aliasVisible = false;
  2817. })
  2818. }
  2819. },
  2820. syncNodeTableHandle(data){
  2821. this.$confirm('是否同步节点【'+data.title+'】?', '提示', {
  2822. confirmButtonText: '确定',
  2823. cancelButtonText: '取消',
  2824. type: 'warning'
  2825. }).then(() => {
  2826. let notify = this.$notify({
  2827. title: '提示',
  2828. message: '节点数据同步中...',
  2829. duration: 0
  2830. });
  2831. syncNodeTable(data.primaryKeyId).then(()=>{
  2832. this.$message({
  2833. type: 'success',
  2834. message: '同步成功',
  2835. })
  2836. }).catch(()=>{
  2837. this.$message({
  2838. type: "error",
  2839. message: "同步失败"
  2840. })
  2841. }).finally(()=>{
  2842. notify.close();
  2843. })
  2844. })
  2845. },
  2846. typeTreeLoadNode (node, resolve) {
  2847. let pid = 0;
  2848. if (node.level != 0) {
  2849. pid = node.data.id
  2850. }
  2851. tabTypeLazyTree(pid,this.projectid).then((res) => {
  2852. let arr = [];
  2853. if (Array.isArray(res.data.data)) {
  2854. arr = res.data.data;
  2855. }
  2856. return resolve(arr);
  2857. })
  2858. },
  2859. getTypeTreeDetail(){
  2860. },
  2861. },
  2862. watch: {
  2863. 'GLExcelFrom.search' (val) {
  2864. console.log(val);
  2865. if (this.exceldata) {
  2866. this.$refs.tree.filter(val);
  2867. }
  2868. }
  2869. },
  2870. components: {
  2871. dynamicExcel,
  2872. ManualSorting,
  2873. FormulaEdit,
  2874. EditElement
  2875. },
  2876. };
  2877. </script>
  2878. <style scoped lang="scss">
  2879. .font-s-12 /deep/ .iconfont {
  2880. font-size: 12px;
  2881. }
  2882. .el-popper[x-placement^="bottom"] {
  2883. margin-top: -6px;
  2884. }
  2885. .right-btn {
  2886. position: absolute;
  2887. right: 20px;
  2888. top: 10px;
  2889. font-size: 20px;
  2890. }
  2891. .custom-tree-node {
  2892. .normal-black {
  2893. display: none;
  2894. }
  2895. &:hover {
  2896. .normal-black {
  2897. display: inline-block;
  2898. }
  2899. }
  2900. &.show .normal-black {
  2901. display: inline-block;
  2902. }
  2903. }
  2904. .excelBox {
  2905. /deep/.el-dialog__body {
  2906. padding: 20px;
  2907. }
  2908. }
  2909. //调整表单样式
  2910. .excelHtml {
  2911. position: absolute;
  2912. z-index: 999999;
  2913. top: 50px;
  2914. left: 0px;
  2915. width: 100%;
  2916. height: 100%;
  2917. }
  2918. .jiedian {
  2919. /deep/.el-dialog__body {
  2920. padding: 10px 20px !important;
  2921. }
  2922. }
  2923. .filter-tree {
  2924. min-width: 100%;
  2925. display: inline-block;
  2926. }
  2927. .full-dialog{
  2928. /deep/ .el-dialog__body{
  2929. padding-bottom: 0;
  2930. padding-top: 0;
  2931. }
  2932. /deep/ .basic-container{
  2933. height: calc(100vh - 60px);
  2934. }
  2935. }
  2936. .my-basic-con {
  2937. padding: 6px 6px;
  2938. }
  2939. </style>