archivetree.vue 56 KB

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