archivetreeRule.vue 64 KB

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