archivetree.vue 58 KB

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