tree.vue 89 KB

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