archivetreeRule.vue 54 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652
  1. <template>
  2. <basic-container
  3. ref="container"
  4. style="height:100%;"
  5. >
  6. <el-row
  7. :gutter="20"
  8. :style="{'height':heights-80+'px','overflow': 'hidden'}"
  9. >
  10. <el-col
  11. :span="12"
  12. class='marleft20'
  13. >
  14. <el-tabs v-model="activeName" @tab-click="handleClick">
  15. <el-tab-pane label="竣工档案目录" name="first">
  16. <div>
  17. <!-- <h2>归档目录树</h2> -->
  18. <el-input
  19. placeholder="输入关键字进行过滤"
  20. clearable
  21. v-model="filterText"
  22. >
  23. </el-input>
  24. <div class="scrollClass" style="height:721px">
  25. <el-scrollbar style="height:100%">
  26. <el-tree
  27. style="box-sizing: border-box;"
  28. v-show="!filterText"
  29. ref="trees1"
  30. :props="props"
  31. :load="loadNode"
  32. node-key="id"
  33. lazy >
  34. <span
  35. class=" flexStar"
  36. slot-scope="{ node, data }"
  37. @mouseover="mouseOver(data)"
  38. @mouseleave="mouseLeave(data)"
  39. >
  40. <span style="text-overflow: ellipsis;width:101%;">{{ data.title }}</span>
  41. <span
  42. class="marleft10"
  43. v-show="data.moreShow"
  44. >
  45. <i
  46. @click.stop='addtree(data,node)'
  47. class="el-icon-circle-plus-outline"
  48. style="fontSize:18px;"
  49. v-if="data.isStorageNode!=1"
  50. ></i>
  51. <i
  52. @click.stop='edittree(data,node)'
  53. class="el-icon-edit-outline marleft5"
  54. style="fontSize:18px;"
  55. v-if="node.level!=1"
  56. ></i>
  57. <i
  58. @click.stop='deletetree(node)'
  59. class="el-icon-delete marleft5"
  60. style="fontSize:18px;"
  61. v-if="node.level!=1"
  62. ></i>
  63. <i
  64. @click.stop='paixuMD(data)'
  65. class="el-icon-sort marleft5"
  66. style="fontSize:18px;"
  67. v-if="node.level!=1"
  68. ></i>
  69. </span>
  70. </span>
  71. </el-tree>
  72. <el-tree
  73. v-show="filterText"
  74. :default-expanded-keys='defaultExpanded'
  75. :props="props"
  76. :data="data"
  77. node-key="id"
  78. ref="trees2"
  79. :default-expand-all="true"
  80. :filter-node-method="filterNode"
  81. >
  82. <span
  83. class=" flexStar"
  84. slot-scope="{ node, data }"
  85. @mouseover="mouseOver(data)"
  86. @mouseleave="mouseLeave(data)"
  87. style="box-sizing: border-box;width:120%;"
  88. >
  89. <span style="text-overflow: ellipsis;">{{ data.title }}</span>
  90. <span
  91. class="marleft10"
  92. v-show="data.moreShow"
  93. >
  94. <i
  95. @click.stop='addtree(data,node)'
  96. class="el-icon-circle-plus-outline"
  97. style="fontSize:18px;"
  98. v-if="data.isStorageNode!=1"
  99. ></i>
  100. <i
  101. @click.stop='edittree(data,node)'
  102. class="el-icon-edit-outline marleft5"
  103. style="fontSize:18px;"
  104. v-if="node.level!=1"
  105. ></i>
  106. <i
  107. @click.stop='deletetree(node)'
  108. class="el-icon-delete marleft5"
  109. style="fontSize:18px;"
  110. v-if="node.level!=1"
  111. ></i>
  112. <i
  113. @click.stop='paixuMD(data)'
  114. class="el-icon-sort marleft5"
  115. style="fontSize:18px;"
  116. v-if="node.level!=1"
  117. ></i>
  118. </span>
  119. </span>
  120. </el-tree>
  121. </el-scrollbar>
  122. </div>
  123. </div>
  124. </el-tab-pane>
  125. <el-tab-pane label="文书档案目录" name="second">
  126. <div>
  127. <!-- <h2>归档目录树</h2> -->
  128. <el-input
  129. placeholder="输入关键字进行过滤"
  130. clearable
  131. v-model="filterText"
  132. >
  133. </el-input>
  134. <div class="scrollClass" style="height:721px">
  135. <el-scrollbar style="height:100%">
  136. <el-tree
  137. style="box-sizing: border-box;"
  138. v-show="!filterText"
  139. ref="trees1"
  140. :props="props"
  141. :load="loadNode"
  142. node-key="id"
  143. lazy >
  144. <span
  145. class=" flexStar"
  146. slot-scope="{ node, data }"
  147. @mouseover="mouseOver(data)"
  148. @mouseleave="mouseLeave(data)"
  149. >
  150. <span style="text-overflow: ellipsis;">{{ data.title }}</span>
  151. <span
  152. class="marleft10"
  153. v-show="data.moreShow"
  154. >
  155. <i
  156. @click.stop='addtree(data,node)'
  157. class="el-icon-circle-plus-outline"
  158. style="fontSize:18px;"
  159. v-if="data.isStorageNode!=1"
  160. ></i>
  161. <i
  162. @click.stop='edittree(data,node)'
  163. class="el-icon-edit-outline marleft5"
  164. style="fontSize:18px;"
  165. v-if="node.level!=1"
  166. ></i>
  167. <i
  168. @click.stop='deletetree(node)'
  169. class="el-icon-delete marleft5"
  170. style="fontSize:18px;"
  171. v-if="node.level!=1"
  172. ></i>
  173. <i
  174. @click.stop='paixuMD(data)'
  175. class="el-icon-sort marleft5"
  176. style="fontSize:18px;"
  177. v-if="node.level!=1"
  178. ></i>
  179. </span>
  180. </span>
  181. </el-tree>
  182. <el-tree
  183. v-show="filterText"
  184. :default-expanded-keys='defaultExpanded'
  185. :props="props"
  186. :data="data"
  187. node-key="id"
  188. ref="trees2"
  189. :default-expand-all="true"
  190. :filter-node-method="filterNode"
  191. >
  192. <span
  193. class=" flexStar"
  194. slot-scope="{ node, data }"
  195. @mouseover="mouseOver(data)"
  196. @mouseleave="mouseLeave(data)"
  197. style="box-sizing:border-box;width:101%;"
  198. >
  199. <span style="text-overflow: ellipsis;">{{ data.title }}</span>
  200. <span
  201. class="marleft10"
  202. v-show="data.moreShow"
  203. >
  204. <i
  205. @click.stop='addtree(data,node)'
  206. class="el-icon-circle-plus-outline"
  207. style="fontSize:18px;"
  208. v-if="data.isStorageNode!=1"
  209. ></i>
  210. <i
  211. @click.stop='edittree(data,node)'
  212. class="el-icon-edit-outline marleft5"
  213. style="fontSize:18px;"
  214. v-if="node.level!=1"
  215. ></i>
  216. <i
  217. @click.stop='deletetree(node)'
  218. class="el-icon-delete marleft5"
  219. style="fontSize:18px;"
  220. v-if="node.level!=1"
  221. ></i>
  222. <i
  223. @click.stop='paixuMD(data)'
  224. class="el-icon-sort marleft5"
  225. style="fontSize:18px;"
  226. v-if="node.level!=1"
  227. ></i>
  228. </span>
  229. </span>
  230. </el-tree>
  231. </el-scrollbar>
  232. </div>
  233. </div>
  234. </el-tab-pane>
  235. </el-tabs>
  236. </el-col>
  237. <el-col
  238. :span="9"
  239. style="padding-top:30px;"
  240. >
  241. <!-- <h3>上传文件入口显示配置</h3> -->
  242. <!--
  243. <div
  244. class="peizhi"
  245. :style="{'height':heights-210+'px','overflow': 'hidden'}"
  246. >
  247. <el-button type="primary" @click="handleentrybtn">立卷规则</el-button>
  248. <el-button type="info" @click="handlerulebtn">工程文件入口配置</el-button>
  249. <el-button type="warning" v-if="!isentryTree" @click="savebtn">保存设置</el-button>
  250. <div class="flexEnd" v-if="isentryTree">
  251. <i
  252. @click="rightPushTree"
  253. class="el-icon-plus"
  254. style="backgroundColor:#2A97DF;color:#fff;fontSize:20px;cursor: pointer;"
  255. ></i>
  256. </div>
  257. <div class="scrollClass" v-if="isentryTree" style="height:721px">
  258. <el-scrollbar style="height:100%">
  259. <el-tree
  260. :props="Rightprops"
  261. :data="rightData"
  262. node-key="id"
  263. ref="tree"
  264. class="filter-tree"
  265. >
  266. </el-tree>
  267. </el-scrollbar>
  268. </div>
  269. <div v-if="!isentryTree" style="margin-top:20px">
  270. <el-checkbox-group v-model="checkList">
  271. <el-checkbox label="设置为最高并卷层级"></el-checkbox>
  272. <el-checkbox label="设置为分类并卷层级"></el-checkbox>
  273. <el-checkbox label="设置为单独并卷层级"></el-checkbox>
  274. </el-checkbox-group>
  275. <div style="margin-top:20px;border:1px solid #e5e5e5;padding:20px">
  276. <div style="display: flex;justify-content: space-between;">
  277. <el-select v-model="publictreevalue" clearable placeholder="请选择公有质检化分树" style=" width:45%;">
  278. <el-option
  279. v-for="item in publictreeoptions"
  280. :key="item.value"
  281. :label="item.label"
  282. :value="item.value">
  283. </el-option>
  284. </el-select>
  285. <el-select v-model="testtreevalue" clearable placeholder="请选择公有试验化分树" style=" width: 45%;">
  286. <el-option
  287. v-for="item in testtreeoptions"
  288. :key="item.value"
  289. :label="item.label"
  290. :value="item.value">
  291. </el-option>
  292. </el-select>
  293. </div>
  294. <el-input
  295. placeholder="输入关键字进行过滤"
  296. v-model="rulefilterText"
  297. style="margin-top:20px"
  298. >
  299. </el-input>
  300. <div class="scrollClass" style="height:521px ;">
  301. <el-scrollbar style="height:100%">
  302. <el-tree
  303. class="filter-tree"
  304. :data="rightData"
  305. :props="Rightprops"
  306. default-expand-all
  307. :filter-node-method="rulefilterNode"
  308. ref="ruletree">
  309. </el-tree>
  310. </el-scrollbar>
  311. </div>
  312. </div>
  313. </div>
  314. </div> -->
  315. <div class="peizhi" :style="{'height':heights-210+'px','overflow': 'hidden'}">
  316. <el-tabs v-model="activetabName" @tab-click="handletabClick">
  317. <el-tab-pane label="立卷规则" name="second">
  318. <el-row style="margin-bottom:15px">
  319. <el-button type="primary" plain @click="setHigh">设置为最高并卷层级</el-button>
  320. <el-button type="primary" plain @click="setType">设置为分类卷并卷</el-button>
  321. <el-button type="primary" plain @click="setAlone">设置为独立组卷</el-button>
  322. </el-row>
  323. <div style="display: flex;justify-content: space-between;">
  324. <el-select v-model="publictreevalue" clearable placeholder="请选择公有质检化分树" style=" margin-bottom:15px; width:45%;">
  325. <el-option
  326. v-for="item in publictreeoptions"
  327. :key="item.value"
  328. :label="item.label"
  329. :value="item.value">
  330. </el-option>
  331. </el-select>
  332. <el-select v-model="testtreevalue" clearable placeholder="请选择公有试验化分树" style=" width: 45%;">
  333. <el-option
  334. v-for="item in testtreeoptions"
  335. :key="item.value"
  336. :label="item.label"
  337. :value="item.value">
  338. </el-option>
  339. </el-select>
  340. </div>
  341. </el-tab-pane>
  342. <el-tab-pane label="工程文件入口配置" name="first"></el-tab-pane>
  343. </el-tabs>
  344. <div class="scrollClass" v-if="activetabName==='second'" style="height:721px">
  345. <el-scrollbar style="height:100%">
  346. <el-tree
  347. :props="Rightprops"
  348. :data="rightData"
  349. node-key="id"
  350. ref="tree"
  351. class="filter-tree"
  352. show-checkbox
  353. @check-change="handleCheckChange"
  354. >
  355. <div class="custom-tree-node" slot-scope="{ node, data }" @mouseover="mouseOver(data)"
  356. @mouseleave="mouseLeave(data)">
  357. <span>{{ node.label }}</span>
  358. <span class="marleft10"
  359. v-show="data.moreShow">
  360. <el-button
  361. type="text"
  362. size="mini"
  363. @click.stop="() => viewConfig(data)">
  364. 查看配置
  365. </el-button>
  366. </span>
  367. </div>
  368. </el-tree>
  369. </el-scrollbar>
  370. </div>
  371. <div class="flexEnd" v-if="isentryTree">
  372. <i
  373. @click="rightPushTree"
  374. class="el-icon-plus"
  375. style="backgroundColor:#2A97DF;color:#fff;fontSize:20px;cursor: pointer;"
  376. ></i>
  377. </div>
  378. <div class="scrollClass" v-if="isentryTree" style="height:721px">
  379. <el-scrollbar style="height:100%">
  380. <el-tree
  381. :props="Rightprops"
  382. :data="rightData"
  383. node-key="id"
  384. ref="tree"
  385. class="filter-tree"
  386. >
  387. </el-tree>
  388. </el-scrollbar>
  389. </div>
  390. </div>
  391. </el-col>
  392. </el-row>
  393. <!-- 新增编辑 -->
  394. <el-dialog
  395. :title="form.id?'编辑':'新增'"
  396. :visible.sync="treeTap"
  397. width="700px"
  398. :modal-append-to-body="false"
  399. @close="treeClose"
  400. >
  401. <div>
  402. <el-form
  403. ref="form"
  404. :model="form"
  405. label-width="120px"
  406. :rules="rules"
  407. >
  408. <el-form-item
  409. label="节点名称"
  410. prop="nodeName"
  411. >
  412. <el-input
  413. v-model="form.nodeName"
  414. style="width:400px;"
  415. ></el-input>
  416. </el-form-item>
  417. <el-form-item
  418. label="岗位类型"
  419. prop="postType"
  420. >
  421. <el-select
  422. v-model="form.postType"
  423. placeholder="请选择岗位"
  424. style="width:400px;"
  425. >
  426. <el-option
  427. v-for="item in JobTypeList"
  428. :key="item.id"
  429. :label="item.title"
  430. :value="item.id"
  431. ></el-option>
  432. </el-select>
  433. </el-form-item>
  434. <el-form-item
  435. label="节点类型"
  436. prop="nodeType"
  437. >
  438. <el-select
  439. :disabled='form.id!=""'
  440. v-model="form.nodeType"
  441. placeholder="请选择节点"
  442. style="width:400px;"
  443. >
  444. <el-option
  445. v-for="item in nodeTypeList"
  446. :key="item.value"
  447. :label="item.label"
  448. :value="item.value"
  449. ></el-option>
  450. </el-select>
  451. </el-form-item>
  452. <el-form-item
  453. label="工程类型"
  454. prop="projectType"
  455. >
  456. <el-select
  457. v-model="form.projectType"
  458. placeholder="工程类型"
  459. style="width:400px;"
  460. >
  461. <el-option
  462. v-for="item in projectTypeList"
  463. :key="item.value"
  464. :label="item.label"
  465. :value="item.value"
  466. ></el-option>
  467. </el-select>
  468. </el-form-item>
  469. <el-form-item
  470. label="储存类型"
  471. prop="storageType"
  472. v-if="form.nodeType==1"
  473. >
  474. <el-select
  475. v-model="form.storageType"
  476. style="width:400px;"
  477. placeholder="请选择"
  478. >
  479. <el-option
  480. v-for="item in storageTypeList"
  481. :key="item.value"
  482. :label="item.label"
  483. :value="item.value"
  484. ></el-option>
  485. </el-select>
  486. </el-form-item>
  487. <template v-if="form.nodeType==2">
  488. <el-form-item
  489. label="是否存储节点"
  490. prop="isStorageNode"
  491. >
  492. <el-select
  493. :disabled='form.id!=""'
  494. v-model="form.isStorageNode"
  495. style="width:400px;"
  496. >
  497. <el-option
  498. v-for="item in storageNodeList"
  499. :key="item.value"
  500. :label="item.label"
  501. :value="item.value"
  502. ></el-option>
  503. </el-select>
  504. </el-form-item>
  505. <template v-if="form.isStorageNode==1">
  506. <el-form-item
  507. label="储存类型"
  508. prop="storageType"
  509. >
  510. <el-select
  511. v-model="form.storageType"
  512. style="width:400px;"
  513. placeholder="请选择"
  514. >
  515. <el-option
  516. v-for="item in storageTypeList"
  517. :key="item.value"
  518. :label="item.label"
  519. :value="item.value"
  520. ></el-option>
  521. </el-select>
  522. </el-form-item>
  523. <el-form-item
  524. label="是否竣工图"
  525. prop="isBuiltDrawing"
  526. >
  527. <el-select
  528. v-model="form.isBuiltDrawing"
  529. style="width:400px;"
  530. >
  531. <el-option
  532. v-for="item in builtDrawingList"
  533. :key="item.value"
  534. :label="item.label"
  535. :value="item.value"
  536. ></el-option>
  537. </el-select>
  538. </el-form-item>
  539. <el-form-item
  540. label="是否接口节点"
  541. prop="isInterfaceNode"
  542. >
  543. <el-select
  544. v-model="form.isInterfaceNode"
  545. style="width:400px;"
  546. >
  547. <el-option
  548. v-for="item in interfaceNodeList"
  549. :key="item.value"
  550. :label="item.label"
  551. :value="item.value"
  552. ></el-option>
  553. </el-select>
  554. </el-form-item>
  555. <template v-if="form.isInterfaceNode==1">
  556. <el-form-item label="选择接口类型">
  557. <el-select
  558. v-model="form.interfaceType"
  559. style="width:400px;"
  560. >
  561. <el-option
  562. v-for="item in interfaceTypeList"
  563. :key="item.value"
  564. :label="item.label"
  565. :value="item.value"
  566. ></el-option>
  567. </el-select>
  568. </el-form-item>
  569. </template>
  570. </template>
  571. </template>
  572. <!-- 数字化文件上传 -->
  573. <template v-if="form.nodeType==1">
  574. <el-form-item
  575. label="关联类型"
  576. prop="associationType"
  577. >
  578. <el-select
  579. v-model="form.associationType"
  580. style="width:400px;"
  581. placeholder="请选择"
  582. >
  583. <el-option
  584. v-for="item in associationTypeList"
  585. :key="item.value"
  586. :label="item.label"
  587. :value="item.value"
  588. ></el-option>
  589. </el-select>
  590. </el-form-item>
  591. <template v-if="form.associationType==1">
  592. <el-form-item
  593. label="业内资料类型"
  594. prop="majorDataType"
  595. >
  596. <el-checkbox-group v-model="form.majorDataType">
  597. <el-checkbox
  598. v-for="item in majorDataTypeList"
  599. :key="item.dictKey"
  600. :label="item.dictKey"
  601. name="type"
  602. >{{item.dictValue}}</el-checkbox>
  603. </el-checkbox-group>
  604. </el-form-item>
  605. <el-form-item
  606. label="显示层级"
  607. prop="displayHierarchy"
  608. >
  609. <el-select
  610. v-model="form.displayHierarchy"
  611. style="width:400px;"
  612. placeholder="请选择"
  613. >
  614. <el-option
  615. v-for="item in displayHierarchyList"
  616. :key="item.dictKey"
  617. :label="item.dictValue"
  618. :value="item.dictKey"
  619. ></el-option>
  620. </el-select>
  621. </el-form-item>
  622. </template>
  623. <template v-if="form.associationType==2">
  624. <el-form-item
  625. label="文件类型"
  626. prop="fileType"
  627. >
  628. <el-checkbox-group v-model="form.fileType">
  629. <el-checkbox
  630. v-for="item in fileTypeList"
  631. :key="item.value"
  632. :label="item.label"
  633. >{{item.label}}</el-checkbox>
  634. </el-checkbox-group>
  635. </el-form-item>
  636. </template>
  637. </template>
  638. </el-form>
  639. </div>
  640. <span
  641. slot="footer"
  642. class="dialog-footer"
  643. >
  644. <el-button @click="treeTap=false">取 消</el-button>
  645. <el-button
  646. type="primary"
  647. @click="saveTree"
  648. >保 存</el-button>
  649. </span>
  650. </el-dialog>
  651. <!-- 右侧树 -->
  652. <el-dialog
  653. title="上传文件入口显示配置"
  654. :visible.sync="pushfileTap"
  655. :modal-append-to-body='false'
  656. width="800px"
  657. @close="pushFileClose"
  658. >
  659. <div>
  660. <el-tree
  661. :props="dialogProps"
  662. show-checkbox
  663. :data="dialogData"
  664. node-key="id"
  665. accordion
  666. ref="trees"
  667. class="filter-tree"
  668. >
  669. </el-tree>
  670. </div>
  671. <span
  672. slot="footer"
  673. class="dialog-footer"
  674. >
  675. <el-button @click="pushfileTap = false">取 消</el-button>
  676. <el-button
  677. type="primary"
  678. @click="saveFile"
  679. >确 定</el-button>
  680. </span>
  681. </el-dialog>
  682. <!-- wbs树排序弹框 -->
  683. <el-dialog
  684. title="调整排序"
  685. :visible="sortTag"
  686. width="50%"
  687. append-to-body
  688. >
  689. <ManualSorting
  690. v-if="sortTag2"
  691. @bianhua='bianhua()'
  692. :sort='sort'
  693. />
  694. <span
  695. slot="footer"
  696. class="dialog-footer"
  697. >
  698. <el-button @click="sortTag=false,sortTag2=false">取 消</el-button>
  699. <el-button
  700. type="primary"
  701. @click="editSort()"
  702. >确 定</el-button>
  703. </span>
  704. </el-dialog>
  705. <!-- 设置最高层级 -->
  706. <el-dialog
  707. title="设置最高并卷层级"
  708. :visible.sync="highVisible"
  709. width="50%"
  710. append-to-body
  711. >
  712. <el-checkbox-group v-model="checkList">
  713. <el-checkbox label="复选框 A" style="margin-bottom:10px"></el-checkbox><br/>
  714. <el-checkbox label="复选框 B" style="margin-bottom:10px"></el-checkbox><br/>
  715. <el-checkbox label="复选框 C" style="margin-bottom:10px"></el-checkbox><br/>
  716. </el-checkbox-group>
  717. <span
  718. slot="footer"
  719. class="dialog-footer"
  720. >
  721. <el-button @click="highVisible=false,highVisible=false">取 消</el-button>
  722. <el-button
  723. type="primary"
  724. @click="editSort()"
  725. >确 定</el-button>
  726. </span>
  727. </el-dialog>
  728. <!-- 查看配置 -->
  729. <el-dialog
  730. title="设置最高并卷层级"
  731. :visible.sync="configVisible"
  732. width="50%"
  733. append-to-body
  734. >
  735. <el-tabs v-model="configactiveName" @tab-click="confighandleClick">
  736. <el-tab-pane label="最高层级配置" name="first"></el-tab-pane>
  737. <el-tab-pane label="分类并卷配置" name="second"></el-tab-pane>
  738. <el-tab-pane label="独立组卷配置" name="third"></el-tab-pane>
  739. </el-tabs>
  740. <el-checkbox-group v-model="checkList">
  741. <el-checkbox label="复选框 A" style="margin-bottom:10px"></el-checkbox><br/>
  742. <el-checkbox label="复选框 B" style="margin-bottom:10px"></el-checkbox><br/>
  743. <el-checkbox label="复选框 C" style="margin-bottom:10px"></el-checkbox><br/>
  744. </el-checkbox-group>
  745. <span
  746. slot="footer"
  747. class="dialog-footer"
  748. >
  749. <el-button @click="configVisible=false,configVisible=false">取 消</el-button>
  750. <el-button
  751. type="primary"
  752. @click="editSort()"
  753. >确 定</el-button>
  754. </span>
  755. </el-dialog>
  756. </basic-container>
  757. </template>
  758. <script>
  759. import ManualSorting from '@/components/WbsTree/ManualSorting'
  760. import { lazyTree, dictionary, remove, archiveTreeSave, archiveTreeUpdate, archiveTreeDetail, archiveTreetree, submitDisplayConfigTree, getSameGradeNode, submitArchiveTreeSort } from "@/api/manager/archivetreecontract";
  761. import { getToken } from '@/util/auth';
  762. import { roletree } from "@/api/system/role.js";
  763. // import logoVue from '../../page/index/logo.vue';
  764. export default {
  765. components: {
  766. ManualSorting,
  767. },
  768. data () {
  769. return {
  770. publictreeoptions: [{//公有质检话分数
  771. value: '选项1',
  772. label: '公有质检划分树1'
  773. }, {
  774. value: '选项2',
  775. label: '公有质检划分树2'
  776. }, {
  777. value: '选项3',
  778. label: '公有质检划分树3'
  779. }],
  780. publictreevalue:'',
  781. testtreeoptions: [{//公有质检话分数
  782. value: '选项1',
  783. label: '公有试验划分树1'
  784. }, {
  785. value: '选项2',
  786. label: '公有试验划分树2'
  787. }, {
  788. value: '选项3',
  789. label: '公有试验划分树3'
  790. }],
  791. testtreevalue:'',
  792. activeName: 'second',
  793. activetabName:'second',
  794. configactiveName:'second',
  795. isentryTree:true,
  796. checkList:[],
  797. //#region 左侧树
  798. defaultExpanded: [],//默认选中的节点
  799. filterText: '',//筛选条件
  800. rulefilterText:'',
  801. treeNode: {},
  802. nodeNames: '',
  803. token: '',
  804. props: {
  805. label: 'title',
  806. children: 'children',
  807. isLeaf: 'hasChildren'
  808. },
  809. data: [],//树节点枚举值
  810. //#endregion
  811. //#region 新增编辑节点弹框
  812. treeTap: false,
  813. form: {
  814. id: '',//新增还是编辑
  815. parentId: '', //上级节点id
  816. nodeName: "", //节点名称
  817. nodeType: '', // 节点类型 2 = 数字化上传文件
  818. postType: '', //岗位类型
  819. isStorageNode: '', //是否为存储节点
  820. isBuiltDrawing: '', //竣工图
  821. isInterfaceNode: '', //是否接口节点
  822. interfaceType: '', //选择接口类型
  823. associationType: '', //关联类型
  824. majorDataType: [], //内业资料类型
  825. displayHierarchy: '', //显示层级
  826. projectType:'',//工程类型
  827. storageType:'',//储存类型
  828. fileType:[],//文件类型
  829. },
  830. rules: {
  831. nodeName: [{ required: true, message: '请输入节点名称', trigger: 'blur' }],
  832. postType: [{ required: true, message: '请选择岗位类型', trigger: 'change' }],
  833. nodeType: [{ required: true, message: '请选择节点类型', trigger: 'change' }],
  834. isStorageNode: [{ required: true, message: '请选择存储节点', trigger: 'change' }],
  835. isBuiltDrawing: [{ required: true, message: '请选择竣工图', trigger: 'change' }],
  836. isInterfaceNode: [{ required: true, message: '请选择接口节点', trigger: 'change' }],
  837. interfaceType: [{ required: true, message: '请选择接口类型', trigger: 'change' }],
  838. associationType: [{ required: true, message: '请选择关联类型', trigger: 'change' }],
  839. majorDataType: [{ required: true, message: '请选择业内资料类型', trigger: 'change' }],
  840. displayHierarchy: [{ required: true, message: '请选择显示层级', trigger: 'change' }],
  841. projectType: [{ required: true, message: '请选择工程类型', trigger: 'change' }],
  842. storageType: [{ required: true, message: '请选择储存类型', trigger: 'change' }],
  843. fileType: [{ required: true, message: '请选择文件类型', trigger: 'change' }],
  844. },
  845. JobTypeList: [],//岗位类型枚举
  846. nodeTypeList: [
  847. {
  848. label: '关联电子原生文件',
  849. value: 1
  850. }, {
  851. label: '数字化上传文件',
  852. value: 2
  853. },
  854. ],//节点类型枚举
  855. projectTypeList:[
  856. {
  857. label: '水利水电工程',
  858. value: 1
  859. }, {
  860. label: '公路工程',
  861. value: 2
  862. }, {
  863. label: '全部',
  864. value: 3
  865. },
  866. ],//工程类型枚举
  867. storageTypeList:[
  868. {
  869. label: '普通',
  870. value: 1
  871. },{
  872. label: '竣工图',
  873. value: 2
  874. },{
  875. label: '计量',
  876. value: 3
  877. },{
  878. label: '质检',
  879. value: 4
  880. },{
  881. label: '声像',
  882. value: 5
  883. },{
  884. label: '隐蔽',
  885. value: 6
  886. },{
  887. label: '原材试验',
  888. value: 7
  889. },{
  890. label: '管理文件',
  891. value: 8
  892. },{
  893. label: '变更令',
  894. value: 9
  895. },
  896. ],//储存类型枚举
  897. storageNodeList: [{
  898. label: '是',
  899. value: 1
  900. }, {
  901. label: '否',
  902. value: 2
  903. },],//存储节点枚举
  904. builtDrawingList: [{
  905. label: '是',
  906. value: 1
  907. }, {
  908. label: '否',
  909. value: 2
  910. },],//竣工图枚举
  911. interfaceNodeList: [{
  912. label: '是',
  913. value: 1
  914. }, {
  915. label: '否',
  916. value: 2
  917. },],//接口节点枚举
  918. interfaceTypeList: [
  919. {
  920. label: '试验接口',
  921. value: 1
  922. }, {
  923. label: '计量接口',
  924. value: 2
  925. },
  926. ],//选择接口类型枚举
  927. associationTypeList: [{
  928. label: '质检资料',
  929. value: 1
  930. },
  931. {
  932. label: '试验资料',
  933. value: 2
  934. },
  935. {
  936. label: '影像资料',
  937. value: 3
  938. },
  939. {
  940. label: '台账资料',
  941. value: 4
  942. },{
  943. label: '首件资料',
  944. value: 5
  945. },{
  946. label: '日志文件',
  947. value: 6
  948. },
  949. ],//
  950. fileTypeList:[
  951. {
  952. label: '配合比',
  953. value: 1
  954. },
  955. {
  956. label: '原材',
  957. value: 2
  958. },{
  959. label: '汇总',
  960. value: 3
  961. },{
  962. label: '设备',
  963. value: 4
  964. },{
  965. label: '外委(第三方)',
  966. value: 5
  967. },
  968. ],
  969. majorDataTypeList: [],//
  970. displayHierarchyList: [],//
  971. //#endregion
  972. //#region 右侧树节点
  973. pushfileTap: false,//开关
  974. Rightprops: {
  975. label: 'title'
  976. },
  977. rightData: [],
  978. //#endregion
  979. //#region 右侧树弹框
  980. dialogProps: {
  981. label: 'title'
  982. },
  983. dialogData: [],
  984. checkXuan: [],
  985. //#endregion
  986. heights: '',
  987. sortTag2: false,
  988. sortTag: false,
  989. sort: [],
  990. ruledata: [{
  991. id: 1,
  992. label: '一级 1',
  993. children: [{
  994. id: 4,
  995. label: '二级 1-1',
  996. children: [{
  997. id: 9,
  998. label: '三级 1-1-1'
  999. }, {
  1000. id: 10,
  1001. label: '三级 1-1-2'
  1002. }]
  1003. }]
  1004. }, {
  1005. id: 2,
  1006. label: '一级 2',
  1007. children: [{
  1008. id: 5,
  1009. label: '二级 2-1'
  1010. }, {
  1011. id: 6,
  1012. label: '二级 2-2'
  1013. }]
  1014. }, {
  1015. id: 3,
  1016. label: '一级 3',
  1017. children: [{
  1018. id: 7,
  1019. label: '二级 3-1'
  1020. }, {
  1021. id: 8,
  1022. label: '二级 3-2'
  1023. }]
  1024. }],
  1025. ruledefaultProps: {
  1026. children: 'children',
  1027. label: 'label'
  1028. },
  1029. highVisible:false,
  1030. configVisible:false,
  1031. projectId:'',
  1032. }
  1033. },
  1034. methods: {
  1035. //切换tabs
  1036. handleClick(tab, event) {
  1037. console.log(tab, event);
  1038. },
  1039. handletabClick(tab, event) {
  1040. console.log(tab, event);
  1041. },
  1042. confighandleClick(tab, event) {
  1043. console.log(tab, event);
  1044. },
  1045. setHigh(){
  1046. this.highVisible=true
  1047. console.log('设置最高');
  1048. },
  1049. setType(){
  1050. console.log('设置类型');
  1051. },
  1052. setAlone(){
  1053. console.log('设置独立');
  1054. },
  1055. viewConfig(data){
  1056. console.log(data,'查看配置');
  1057. this.configVisible=true
  1058. },
  1059. handleCheckChange(data, checked, indeterminate) {
  1060. console.log(data, checked, indeterminate);
  1061. },
  1062. handleentrybtn(){
  1063. console.log(this.entrybtn,'entrybtn');
  1064. this.isentryTree=false;
  1065. },
  1066. handlerulebtn(){
  1067. this.isentryTree=true;
  1068. console.log(this.rulebtn,'rulebtn');
  1069. },
  1070. savebtn(){
  1071. this.isentryTree=true;
  1072. },
  1073. paixuMD (data) {
  1074. this.sortTag = true
  1075. this.sortTag2 = true
  1076. this.curTreeData = data;
  1077. this.findWbsTreeSameLevel(data.id)
  1078. },
  1079. async findWbsTreeSameLevel (parentId) {//查询当前节点的同级节点
  1080. const { data: res } = await getSameGradeNode({ id: parentId })
  1081. //console.log(res);
  1082. if (res.code === 200) {
  1083. this.sort = res.data
  1084. }
  1085. },
  1086. bianhua () {
  1087. this.sortTag2 = false
  1088. this.$nextTick(() => {
  1089. this.sortTag2 = true
  1090. })
  1091. },
  1092. editSort () {//修改排序
  1093. let sortArr = this.sort, newArr = []
  1094. for (let i = 0; i < sortArr.length; i++) {
  1095. newArr.push({
  1096. id: sortArr[i].id,
  1097. nodeName: sortArr[i].nodeName
  1098. })
  1099. }
  1100. this.wbsTreeSort(newArr)
  1101. },
  1102. async wbsTreeSort (newArr) {//修改排序
  1103. const { data: res } = await submitArchiveTreeSort(newArr)
  1104. //console.log(res);
  1105. if (res.code == 200) {
  1106. this.sortTag = false
  1107. this.sortTag2 = false
  1108. //刷新页面
  1109. window.location.reload()
  1110. }
  1111. },
  1112. //#region 左侧树方法
  1113. async loadNode (node, resolve) {
  1114. console.log(node);
  1115. if (node.level === 0) {
  1116. let ks = await this.lazyTree(0)
  1117. if (ks.length) {
  1118. resolve(ks)
  1119. } else {
  1120. this.archiveTreeInit()
  1121. }
  1122. } else {
  1123. resolve(await this.lazyTree(node.data.id))
  1124. }
  1125. },
  1126. async archiveTreeInit () {//添加根节点
  1127. const { data: res } = await archiveTreeInit()
  1128. console.log(res);
  1129. if (res.code == 200 && res.msg == '操作成功') {
  1130. res.data.forEach(val => {
  1131. val.hasChildren = !val.hasChildren
  1132. });
  1133. return res.data
  1134. } else if (res.code == 200 && res.msg == "未查询到信息") {
  1135. return []
  1136. }
  1137. },
  1138. async lazyTree (parentId) {//树节点懒加载
  1139. const { data: res } = await lazyTree({
  1140. parentId,
  1141. token: this.token,
  1142. projectId:this.projectId
  1143. })
  1144. console.log(res);
  1145. if (res.code == 200 && res.msg == '操作成功') {
  1146. res.data.forEach(val => {
  1147. val.hasChildren = !val.hasChildren
  1148. });
  1149. return res.data
  1150. } else if (res.code == 200 && res.msg == "未查询到信息") {
  1151. return []
  1152. }
  1153. },
  1154. mouseLeave (data) {
  1155. if (data.moreShow) {
  1156. this.$set(data, 'moreShow', false)
  1157. }
  1158. },
  1159. mouseOver (data) {
  1160. if (!data.moreShow) {
  1161. this.$set(data, 'moreShow', true)
  1162. }
  1163. },
  1164. addtree (data, node) {//添加树
  1165. console.log(data);
  1166. if (this.JobTypeList.length == 0) {
  1167. this.roletree()
  1168. }
  1169. if (this.majorDataTypeList.length == 0) {
  1170. this.major_data_type()//内业资料类型
  1171. }
  1172. if (this.displayHierarchyList.length == 0) {
  1173. this.display_hierarchy()//显示层级
  1174. }
  1175. this.form.postType = data.postType
  1176. this.form.id = ''
  1177. this.form.parentId = data.id
  1178. if (this.filterText) {
  1179. this.defaultExpanded = [data.id]
  1180. }
  1181. this.treeTap = true
  1182. },
  1183. async edittree (data) {//编辑树
  1184. if (this.JobTypeList.length == 0) {
  1185. this.roletree()
  1186. }
  1187. if (this.majorDataTypeList.length == 0) {
  1188. this.major_data_type()//内业资料类型
  1189. }
  1190. if (this.displayHierarchyList.length == 0) {
  1191. this.display_hierarchy()//显示层级
  1192. }
  1193. await this.archiveTreeDetail(data)
  1194. this.form.id = data.id
  1195. this.form.parentId = ''
  1196. this.treeNode = data
  1197. this.treeTap = true
  1198. },
  1199. deletetree (node) {//删除树
  1200. console.log(node);
  1201. let _that = this
  1202. this.$confirm('是否删除此数据', '提示', {
  1203. distinguishCancelAndClose: true,
  1204. confirmButtonText: '确认',
  1205. cancelButtonText: '取消'
  1206. })
  1207. .then(() => {
  1208. this.remove(node.data.id).then(()=>{
  1209. _that.$refs.trees1.remove(node) //删除界面上的节点
  1210. }).catch(()=>{
  1211. })
  1212. })
  1213. .catch(() => {
  1214. });
  1215. },
  1216. async remove (id) {//删除接口
  1217. const { data: res } = await remove({ id })
  1218. console.log(res);
  1219. if (res.code == 200) {
  1220. this.$message({
  1221. type: 'success',
  1222. message: '删除成功'
  1223. })
  1224. }
  1225. },
  1226. async archiveTreeDetail (data) {//详情接口
  1227. console.log(data);
  1228. const { data: res } = await archiveTreeDetail({ id: data.id })
  1229. console.log(res);
  1230. if (res.code == 200) {
  1231. this.form.nodeName = res.data.fullName //节点名称
  1232. this.form.nodeType = res.data.nodeType // 节点类型 2 = 数字化上传文件
  1233. this.form.postType = res.data.postType //岗位类型
  1234. this.form.isStorageNode = res.data.isStorageNode //是否为存储节点
  1235. this.form.isBuiltDrawing = res.data.isBuiltDrawing //竣工图
  1236. this.form.isInterfaceNode = res.data.isInterfaceNode //是否接口节点
  1237. this.form.interfaceType = res.data.interfaceType //选择接口类型
  1238. this.form.associationType = res.data.associationType //关联类型
  1239. this.form.majorDataType = res.data.majorDataType.split(',') //内业资料类型
  1240. this.form.displayHierarchy = res.data.displayHierarchy //显示层级
  1241. this.form.projectType = res.data.projectType //工程类型
  1242. this.form.storageType = res.data.storageType //储存类型
  1243. if(Array.isArray(res.data.fileType)){
  1244. this.form.fileType = res.data.fileType //文件类型
  1245. }else{
  1246. this.form.fileType = [];
  1247. }
  1248. }
  1249. },
  1250. async archiveTreetree4 () {//全加载左侧树
  1251. const { data: res } = await archiveTreetree({
  1252. token: this.token,
  1253. projectId:this.projectId
  1254. })
  1255. console.log(res);
  1256. if (res.code == 200 && res.msg == "操作成功") {
  1257. this.data = res.data
  1258. }
  1259. },
  1260. filterNode (value,data,node) {//筛选条件
  1261. if (!value) return true;
  1262. return data.title.indexOf(value) !== -1;
  1263. },
  1264. rulefilterNode (value,data,node) {//筛选条件
  1265. if (!value) return true;
  1266. return data.title.indexOf(value) !== -1;
  1267. },
  1268. //判断节点是否匹配
  1269. getReturnNode(node,_array,value){
  1270. let isPass = node.data && node.data.title && node.data.title.indexOf(value) !== -1;
  1271. isPass?_array.push(isPass):'';
  1272. //判断节点是否是父节点
  1273. if(!isPass && node.level!=1 && node.parent){
  1274. this.getReturnNode(node.parent,_array,value);
  1275. }
  1276. },
  1277. //#endregion
  1278. //#region 新增编辑节点弹框
  1279. treeClose () {//弹框关闭事件
  1280. this.form = {
  1281. parentId: '', //上级节点id
  1282. nodeName: "", //节点名称
  1283. nodeType: '', // 节点类型 2 = 数字化上传文件
  1284. postType: '', //岗位类型
  1285. isStorageNode: '', //是否为存储节点
  1286. isBuiltDrawing: '', //竣工图
  1287. isInterfaceNode: '', //是否接口节点
  1288. interfaceType: '', //选择接口类型
  1289. associationType: '', //关联类型
  1290. majorDataType: [], //内业资料类型
  1291. displayHierarchy: '', //显示层级
  1292. projectType:'',//工程类型
  1293. storageType:'',//储存类型
  1294. fileType:[],//文件类型
  1295. }
  1296. this.$refs.form.resetFields();
  1297. this.form.id = ''
  1298. this.treeTap = false
  1299. },
  1300. async roletree () {//岗位类型枚举
  1301. const { data: res } = await roletree()
  1302. console.log(res);
  1303. if (res.code == 200) {
  1304. this.JobTypeList = res.data
  1305. }
  1306. },
  1307. async major_data_type () {//内业资料类型
  1308. const { data: res } = await dictionary({ code: 'major_data_type' })
  1309. console.log(res);
  1310. if (res.code == 200) {
  1311. this.majorDataTypeList = res.data
  1312. }
  1313. },
  1314. async display_hierarchy () {//显示层级
  1315. const { data: res } = await dictionary({ code: 'display_hierarchy' })
  1316. console.log(res);
  1317. if (res.code == 200) {
  1318. this.displayHierarchyList = res.data
  1319. }
  1320. },
  1321. saveTree () {//保存按钮
  1322. this.$refs.form.validate(val => {
  1323. if (val) {
  1324. if (this.form.nodeType == 2) {
  1325. if (this.form.isStorageNode == 1) {
  1326. if (this.form.isInterfaceNode == 1) {
  1327. this.baocun({
  1328. id: this.form.id,
  1329. parentId: this.form.parentId, //上级节点id
  1330. nodeName: this.form.nodeName, //节点名称
  1331. nodeType: this.form.nodeType, // 节点类型
  1332. postType: this.form.postType, //岗位类型
  1333. isStorageNode: this.form.isStorageNode, //是否为存储节点
  1334. isBuiltDrawing: this.form.isBuiltDrawing, //竣工图
  1335. isInterfaceNode: this.form.isInterfaceNode, //是否接口节点
  1336. interfaceType: this.form.interfaceType, //选择接口类型
  1337. projectType:this.form.projectType, //工程类型
  1338. storageType:this.form.storageType, //储存类型
  1339. })
  1340. } else {
  1341. this.baocun({
  1342. id: this.form.id,
  1343. parentId: this.form.parentId, //上级节点id
  1344. nodeName: this.form.nodeName, //节点名称
  1345. nodeType: this.form.nodeType, // 节点类型
  1346. postType: this.form.postType, //岗位类型
  1347. isStorageNode: this.form.isStorageNode, //是否为存储节点
  1348. isBuiltDrawing: this.form.isBuiltDrawing, //竣工图
  1349. isInterfaceNode: this.form.isInterfaceNode, //是否接口节点
  1350. projectType:this.form.projectType, //工程类型
  1351. storageType:this.form.storageType, //储存类型
  1352. })
  1353. }
  1354. } else {
  1355. this.baocun({
  1356. id: this.form.id,
  1357. parentId: this.form.parentId, //上级节点id
  1358. nodeName: this.form.nodeName, //节点名称
  1359. nodeType: this.form.nodeType, // 节点类型
  1360. postType: this.form.postType, //岗位类型
  1361. isStorageNode: this.form.isStorageNode, //是否为存储节点
  1362. projectType:this.form.projectType, //工程类型
  1363. })
  1364. }
  1365. } else if (this.form.nodeType == 1) {
  1366. if (this.form.associationType == 1) {
  1367. this.baocun({
  1368. id: this.form.id,
  1369. parentId: this.form.parentId, //上级节点id
  1370. nodeName: this.form.nodeName, //节点名称
  1371. nodeType: this.form.nodeType, // 节点类型
  1372. postType: this.form.postType, //岗位类型
  1373. associationType: this.form.associationType, //关联类型
  1374. majorDataType: this.form.majorDataType, //内业资料类型
  1375. displayHierarchy: this.form.displayHierarchy, //显示层级
  1376. projectType:this.form.projectType, //工程类型
  1377. storageType:this.form.storageType, //储存类型
  1378. })
  1379. } else if(this.form.associationType == 2){
  1380. //试验资料
  1381. this.baocun({
  1382. id: this.form.id,
  1383. parentId: this.form.parentId, //上级节点id
  1384. nodeName: this.form.nodeName, //节点名称
  1385. nodeType: this.form.nodeType, // 节点类型
  1386. postType: this.form.postType, //岗位类型
  1387. associationType: this.form.associationType, //关联类型
  1388. fileType:this.form.fileType,//文件类型
  1389. projectType:this.form.projectType, //工程类型
  1390. storageType:this.form.storageType, //储存类型
  1391. })
  1392. }else {
  1393. this.baocun({
  1394. id: this.form.id,
  1395. parentId: this.form.parentId, //上级节点id
  1396. nodeName: this.form.nodeName, //节点名称
  1397. nodeType: this.form.nodeType, // 节点类型
  1398. postType: this.form.postType, //岗位类型
  1399. associationType: this.form.associationType, //关联类型
  1400. projectType:this.form.projectType, //工程类型
  1401. storageType:this.form.storageType, //储存类型
  1402. })
  1403. }
  1404. }
  1405. }
  1406. })
  1407. },
  1408. async baocun (da) {
  1409. if (da.majorDataType) {
  1410. if (da.majorDataType.length > 0) {
  1411. let das = ''
  1412. da.majorDataType.forEach((val, key) => {
  1413. das += val
  1414. if (da.majorDataType.length - 1 != key) {
  1415. das += ','
  1416. }
  1417. })
  1418. da.majorDataType = das
  1419. }
  1420. }
  1421. if (this.form.id) {
  1422. await this.archiveTreeUpdate(da)
  1423. } else {
  1424. await this.archiveTreeSave(da)
  1425. }
  1426. if (this.filterText) {
  1427. this.archiveTreetree4()
  1428. }
  1429. },
  1430. async archiveTreeSave (da) {//新增
  1431. console.log(da);
  1432. const { data: res } = await archiveTreeSave(da)
  1433. console.log(res);
  1434. if (res.code == 200) {
  1435. this.$message({
  1436. type: 'success',
  1437. message: '新增成功'
  1438. })
  1439. this.treeTap = false
  1440. let das = await this.lazyTree(da.parentId)
  1441. this.$refs.trees1.updateKeyChildren(da.parentId, das)
  1442. let node = this.$refs.trees1.getNode(da.parentId);
  1443. node.isLeaf = false;
  1444. node.isLeafByUser = false;
  1445. }
  1446. },
  1447. async archiveTreeUpdate (da) {//编辑
  1448. const { data: res } = await archiveTreeUpdate(da)
  1449. console.log(res);
  1450. if (res.code == 200) {
  1451. this.$message({
  1452. type: 'success',
  1453. message: '编辑成功'
  1454. })
  1455. this.treeTap = false
  1456. this.treeNode.title = da.nodeName
  1457. this.treeNode.postType = da.postType
  1458. }
  1459. },
  1460. //#endregion
  1461. //#region 右侧树节点
  1462. async rightPushTree () {//右侧节点树
  1463. this.checkXuan = []
  1464. await this.archiveTreetree2({
  1465. token: this.token,
  1466. nodeType: 2,
  1467. })
  1468. this.pushfileTap = true
  1469. await this.saixuan(this.dialogData)
  1470. console.log(this.checkXuan);
  1471. this.$refs.trees.setCheckedKeys(this.checkXuan);
  1472. },
  1473. // 赛选
  1474. saixuan (da) {//赛选
  1475. if (da.length > 0) {
  1476. let tag = true
  1477. da.forEach(val => {
  1478. if (val.isDisplayTree == 1 && val.hasChildren) {
  1479. let ks = this.saixuan(val.children)
  1480. if (ks) {
  1481. this.checkXuan.push(val.id)
  1482. }
  1483. } else if (val.isDisplayTree == 1 && !val.hasChildren) {
  1484. this.checkXuan.push(val.id)
  1485. } else {
  1486. tag = false
  1487. }
  1488. })
  1489. return tag
  1490. }
  1491. },
  1492. pushFileClose () {//弹框关闭事件
  1493. this.checkXuan = []
  1494. },
  1495. async archiveTreetree (da) {//右侧树全加载接口
  1496. da = Object.assign(da,{projectId:this.projectId})
  1497. const { data: res } = await archiveTreetree(da)
  1498. console.log(res);
  1499. if (res.code == 200 && res.msg == "操作成功") {
  1500. this.rightData = res.data
  1501. }
  1502. },
  1503. //#endregion
  1504. //#region 右侧树弹框
  1505. async submitDisplayConfigTree (ids) {//保存接口
  1506. const { data: res } = await submitDisplayConfigTree({ ids })
  1507. console.log(res);
  1508. if (res.code == 200) {
  1509. this.$message({
  1510. type: 'success',
  1511. message: '设置成功'
  1512. })
  1513. this.archiveTreetree({
  1514. token: this.token,
  1515. disPlayTree: 1,
  1516. nodeType: 2,
  1517. })
  1518. this.pushfileTap = false
  1519. }
  1520. },
  1521. async archiveTreetree2 (da) {//右侧树全加载接口
  1522. da = Object.assign(da,{projectId:this.projectId})
  1523. //console.log(da,'ddddddda')
  1524. const { data: res } = await archiveTreetree(da)
  1525. console.log(res);
  1526. if (res.code == 200 && res.msg == "操作成功") {
  1527. this.dialogData = res.data
  1528. }
  1529. },
  1530. saveFile () {//保存按钮
  1531. let zi = this.$refs.trees.getCheckedKeys() //返回选中子节点的key
  1532. let fu = this.$refs.trees.getHalfCheckedKeys()//返回选中子节点的父节点的key
  1533. let arr = [...zi, ...fu]
  1534. if (arr.length > 0) {
  1535. let ids = ''
  1536. arr.forEach((val, key) => {
  1537. ids += val
  1538. if (key != arr.length - 1) {
  1539. ids += ','
  1540. }
  1541. })
  1542. this.submitDisplayConfigTree(ids)
  1543. } else {
  1544. this.$message({
  1545. type: 'error',
  1546. message: '请先设置配置文件'
  1547. })
  1548. }
  1549. },
  1550. //#endregion
  1551. },
  1552. watch: {
  1553. filterText (val) {
  1554. this.$refs.trees2.filter(val);
  1555. },
  1556. rulefilterText(val) {
  1557. this.$refs.ruletree.filter(val);
  1558. }
  1559. },
  1560. created () {
  1561. this.token = 'bearer ' + getToken()
  1562. this.projectId = this.$route.query.projectId;
  1563. this.archiveTreetree({
  1564. token: this.token,
  1565. disPlayTree: 1,
  1566. nodeType: 2,
  1567. })
  1568. this.archiveTreetree4()//全加载左侧树
  1569. },
  1570. mounted () {
  1571. this.heights = this.$refs.container.$el.offsetHeight;
  1572. }
  1573. }
  1574. </script>
  1575. <style lang="scss" scoped>
  1576. .peizhi {
  1577. border: 1px solid #e5e5e5;
  1578. border-radius: 5px;
  1579. padding: 15px 10px;
  1580. }
  1581. .btnground{
  1582. background-color: #e5e5e5;
  1583. }
  1584. .el-tree .el-tree-node__content{
  1585. display: block !important;
  1586. }
  1587. /deep/ .el-tree .el-tree-node__children{
  1588. overflow: visible!important;
  1589. }
  1590. </style>