archivetree.vue 53 KB

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