archivetreeRule.vue 63 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963
  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. }).catch(()=>{
  1226. })
  1227. })
  1228. .catch(() => {
  1229. });
  1230. },
  1231. async remove (id) {//删除接口
  1232. const { data: res } = await remove({ id })
  1233. console.log(res);
  1234. if (res.code == 200) {
  1235. this.$message({
  1236. type: 'success',
  1237. message: '删除成功'
  1238. })
  1239. }
  1240. },
  1241. async archiveTreeDetail (data) {//详情接口
  1242. console.log(data);
  1243. const { data: res } = await archiveTreeDetail({ id: data.id })
  1244. console.log(res);
  1245. if (res.code == 200) {
  1246. this.form.nodeName = res.data.fullName //节点名称
  1247. this.form.nodeType = res.data.nodeType // 节点类型 2 = 数字化上传文件
  1248. this.form.postType = res.data.postType //岗位类型
  1249. this.form.isStorageNode = res.data.isStorageNode //是否为存储节点
  1250. // this.form.isBuiltDrawing = res.data.isBuiltDrawing //竣工图
  1251. this.form.isInterfaceNode = res.data.isInterfaceNode //是否接口节点
  1252. this.form.interfaceType = res.data.interfaceType //选择接口类型
  1253. this.form.associationType = res.data.associationType //关联类型
  1254. this.form.majorDataType = res.data.majorDataType.split(',') //内业资料类型
  1255. this.form.displayHierarchy = res.data.displayHierarchy //显示层级
  1256. this.form.projectType = res.data.projectType //工程类型
  1257. this.form.storageType = res.data.storageType //储存类型
  1258. if(res.data.expDataType){
  1259. this.form.expDataType = res.data.expDataType.split(',') //文件类型
  1260. }else{
  1261. this.form.expDataType = [];
  1262. }
  1263. }
  1264. },
  1265. async archiveTreetree4 () {//全加载左侧树
  1266. const { data: res } = await archiveTreetree({
  1267. token: this.token,
  1268. projectId:this.projectId
  1269. })
  1270. console.log(res);
  1271. if (res.code == 200 && res.msg == "操作成功") {
  1272. this.data = res.data
  1273. }
  1274. },
  1275. filterNode (value,data,node) {//筛选条件
  1276. if (!value) return true;
  1277. return data.title.indexOf(value) !== -1;
  1278. },
  1279. rulefilterNode (value,data,node) {//筛选条件
  1280. if (!value) return true;
  1281. return data.title.indexOf(value) !== -1;
  1282. },
  1283. //判断节点是否匹配
  1284. getReturnNode(node,_array,value){
  1285. let isPass = node.data && node.data.title && node.data.title.indexOf(value) !== -1;
  1286. isPass?_array.push(isPass):'';
  1287. //判断节点是否是父节点
  1288. if(!isPass && node.level!=1 && node.parent){
  1289. this.getReturnNode(node.parent,_array,value);
  1290. }
  1291. },
  1292. //#endregion
  1293. //#region 新增编辑节点弹框
  1294. treeClose () {//弹框关闭事件
  1295. this.form = {
  1296. parentId: '', //上级节点id
  1297. nodeName: "", //节点名称
  1298. nodeType: '', // 节点类型 2 = 数字化上传文件
  1299. postType: '', //岗位类型
  1300. isStorageNode: '', //是否为存储节点
  1301. // isBuiltDrawing: '', //竣工图
  1302. isInterfaceNode: '', //是否接口节点
  1303. interfaceType: '', //选择接口类型
  1304. associationType: '', //关联类型
  1305. majorDataType: [], //内业资料类型
  1306. displayHierarchy: '', //显示层级
  1307. projectType:'',//工程类型
  1308. storageType:'',//储存类型
  1309. expDataType:[],//文件类型
  1310. }
  1311. this.$refs.form.resetFields();
  1312. this.form.id = ''
  1313. this.treeTap = false
  1314. },
  1315. async roletree () {//岗位类型枚举
  1316. const { data: res } = await roletree()
  1317. console.log(res);
  1318. if (res.code == 200) {
  1319. this.JobTypeList = res.data
  1320. }
  1321. },
  1322. async major_data_type () {//内业资料类型
  1323. const { data: res } = await dictionary({ code: 'major_data_type' })
  1324. console.log(res);
  1325. if (res.code == 200) {
  1326. this.majorDataTypeList = res.data
  1327. }
  1328. },
  1329. async display_hierarchy () {//显示层级
  1330. const { data: res } = await dictionary({ code: 'display_hierarchy' })
  1331. console.log(res);
  1332. if (res.code == 200) {
  1333. this.displayHierarchyList = res.data
  1334. }
  1335. },
  1336. saveTree () {//保存按钮
  1337. this.$refs.form.validate(val => {
  1338. if (val) {
  1339. if (this.form.nodeType == 2) {
  1340. if (this.form.isStorageNode == 1) {
  1341. if (this.form.isInterfaceNode == 1) {
  1342. this.baocun({
  1343. id: this.form.id,
  1344. parentId: this.form.parentId, //上级节点id
  1345. nodeName: this.form.nodeName, //节点名称
  1346. nodeType: this.form.nodeType, // 节点类型
  1347. postType: this.form.postType, //岗位类型
  1348. isStorageNode: this.form.isStorageNode, //是否为存储节点
  1349. // isBuiltDrawing: this.form.isBuiltDrawing, //竣工图
  1350. isInterfaceNode: this.form.isInterfaceNode, //是否接口节点
  1351. interfaceType: this.form.interfaceType, //选择接口类型
  1352. projectType:this.form.projectType, //工程类型
  1353. storageType:this.form.storageType, //储存类型
  1354. projectId:this.projectId,//项目id
  1355. })
  1356. } else {
  1357. this.baocun({
  1358. id: this.form.id,
  1359. parentId: this.form.parentId, //上级节点id
  1360. nodeName: this.form.nodeName, //节点名称
  1361. nodeType: this.form.nodeType, // 节点类型
  1362. postType: this.form.postType, //岗位类型
  1363. isStorageNode: this.form.isStorageNode, //是否为存储节点
  1364. // isBuiltDrawing: this.form.isBuiltDrawing, //竣工图
  1365. isInterfaceNode: this.form.isInterfaceNode, //是否接口节点
  1366. projectType:this.form.projectType, //工程类型
  1367. storageType:this.form.storageType, //储存类型
  1368. projectId:this.projectId,//项目id
  1369. })
  1370. }
  1371. } else {
  1372. this.baocun({
  1373. id: this.form.id,
  1374. parentId: this.form.parentId, //上级节点id
  1375. nodeName: this.form.nodeName, //节点名称
  1376. nodeType: this.form.nodeType, // 节点类型
  1377. postType: this.form.postType, //岗位类型
  1378. isStorageNode: this.form.isStorageNode, //是否为存储节点
  1379. projectType:this.form.projectType, //工程类型
  1380. projectId:this.projectId,//项目id
  1381. })
  1382. }
  1383. } else if (this.form.nodeType == 1) {
  1384. if (this.form.associationType == 1) {
  1385. this.baocun({
  1386. id: this.form.id,
  1387. parentId: this.form.parentId, //上级节点id
  1388. nodeName: this.form.nodeName, //节点名称
  1389. nodeType: this.form.nodeType, // 节点类型
  1390. postType: this.form.postType, //岗位类型
  1391. associationType: this.form.associationType, //关联类型
  1392. majorDataType: this.form.majorDataType, //内业资料类型
  1393. displayHierarchy: this.form.displayHierarchy, //显示层级
  1394. projectType:this.form.projectType, //工程类型
  1395. storageType:this.form.storageType, //储存类型
  1396. projectId:this.projectId,//项目id
  1397. })
  1398. } else if(this.form.associationType == 2){
  1399. //试验资料
  1400. this.baocun({
  1401. id: this.form.id,
  1402. parentId: this.form.parentId, //上级节点id
  1403. nodeName: this.form.nodeName, //节点名称
  1404. nodeType: this.form.nodeType, // 节点类型
  1405. postType: this.form.postType, //岗位类型
  1406. associationType: this.form.associationType, //关联类型
  1407. expDataType:this.form.expDataType.join(','),//文件类型
  1408. projectType:this.form.projectType, //工程类型
  1409. storageType:this.form.storageType, //储存类型
  1410. projectId:this.projectId,//项目id
  1411. })
  1412. }else {
  1413. this.baocun({
  1414. id: this.form.id,
  1415. parentId: this.form.parentId, //上级节点id
  1416. nodeName: this.form.nodeName, //节点名称
  1417. nodeType: this.form.nodeType, // 节点类型
  1418. postType: this.form.postType, //岗位类型
  1419. associationType: this.form.associationType, //关联类型
  1420. projectType:this.form.projectType, //工程类型
  1421. storageType:this.form.storageType, //储存类型
  1422. projectId:this.projectId,//项目id
  1423. })
  1424. }
  1425. }
  1426. }
  1427. })
  1428. if(this.menuKey='edit'){
  1429. //刷新页面
  1430. window.location.reload()
  1431. }
  1432. },
  1433. async baocun (da) {
  1434. if (da.majorDataType) {
  1435. if (da.majorDataType.length > 0) {
  1436. let das = ''
  1437. da.majorDataType.forEach((val, key) => {
  1438. das += val
  1439. if (da.majorDataType.length - 1 != key) {
  1440. das += ','
  1441. }
  1442. })
  1443. da.majorDataType = das
  1444. }
  1445. }
  1446. if (this.form.id) {
  1447. await this.archiveTreeUpdate(da)
  1448. } else {
  1449. await this.archiveTreeSave(da)
  1450. }
  1451. if (this.filterText) {
  1452. this.archiveTreetree4()
  1453. }
  1454. },
  1455. async archiveTreeSave (da) {//新增
  1456. console.log(da);
  1457. const { data: res } = await archiveTreeSave(da)
  1458. console.log(res);
  1459. if (res.code == 200) {
  1460. this.$message({
  1461. type: 'success',
  1462. message: '新增成功'
  1463. })
  1464. this.treeTap = false
  1465. let das = await this.lazyTree(da.parentId)
  1466. this.$refs.trees1.updateKeyChildren(da.parentId, das)
  1467. let node = this.$refs.trees1.getNode(da.parentId);
  1468. node.isLeaf = false;
  1469. node.isLeafByUser = false;
  1470. }
  1471. },
  1472. async archiveTreeUpdate (da) {//编辑
  1473. const { data: res } = await archiveTreeUpdate(da)
  1474. console.log(res);
  1475. if (res.code == 200) {
  1476. this.$message({
  1477. type: 'success',
  1478. message: '编辑成功'
  1479. })
  1480. this.treeTap = false
  1481. this.treeNode.title = da.nodeName
  1482. this.treeNode.postType = da.postType
  1483. }
  1484. },
  1485. //#endregion
  1486. //#region 右侧树节点
  1487. async rightPushTree () {//右侧节点树
  1488. this.checkXuan = []
  1489. await this.archiveTreetree2({
  1490. token: this.token,
  1491. nodeType: 2,
  1492. })
  1493. this.pushfileTap = true
  1494. await this.saixuan(this.dialogData)
  1495. console.log(this.checkXuan);
  1496. this.$refs.trees.setCheckedKeys(this.checkXuan);
  1497. },
  1498. // 赛选
  1499. saixuan (da) {//赛选
  1500. if (da.length > 0) {
  1501. let tag = true
  1502. da.forEach(val => {
  1503. if (val.isDisplayTree == 1 && val.hasChildren) {
  1504. let ks = this.saixuan(val.children)
  1505. if (ks) {
  1506. this.checkXuan.push(val.id)
  1507. }
  1508. } else if (val.isDisplayTree == 1 && !val.hasChildren) {
  1509. this.checkXuan.push(val.id)
  1510. } else {
  1511. tag = false
  1512. }
  1513. })
  1514. return tag
  1515. }
  1516. },
  1517. pushFileClose () {//弹框关闭事件
  1518. this.checkXuan = []
  1519. },
  1520. async archiveTreetree (da) {//右侧树全加载接口
  1521. da = Object.assign(da,{projectId:this.projectId})
  1522. const { data: res } = await archiveTreetree(da)
  1523. console.log(res);
  1524. if (res.code == 200 && res.msg == "操作成功") {
  1525. this.rightData = res.data
  1526. }
  1527. },
  1528. //#endregion
  1529. //#region 右侧树弹框
  1530. async submitDisplayConfigTree (ids) {//保存接口
  1531. const { data: res } = await submitDisplayConfigTree({ ids })
  1532. console.log(res);
  1533. if (res.code == 200) {
  1534. this.$message({
  1535. type: 'success',
  1536. message: '设置成功'
  1537. })
  1538. this.archiveTreetree({
  1539. token: this.token,
  1540. disPlayTree: 1,
  1541. nodeType: 2,
  1542. })
  1543. this.pushfileTap = false
  1544. }
  1545. },
  1546. async archiveTreetree2 (da) {//右侧树全加载接口
  1547. da = Object.assign(da,{projectId:this.projectId})
  1548. //console.log(da,'ddddddda')
  1549. const { data: res } = await archiveTreetree(da)
  1550. console.log(res);
  1551. if (res.code == 200 && res.msg == "操作成功") {
  1552. this.dialogData = res.data
  1553. }
  1554. },
  1555. saveFile () {//保存按钮
  1556. let zi = this.$refs.trees.getCheckedKeys() //返回选中子节点的key
  1557. let fu = this.$refs.trees.getHalfCheckedKeys()//返回选中子节点的父节点的key
  1558. let arr = [...zi, ...fu]
  1559. if (arr.length > 0) {
  1560. let ids = ''
  1561. arr.forEach((val, key) => {
  1562. ids += val
  1563. if (key != arr.length - 1) {
  1564. ids += ','
  1565. }
  1566. })
  1567. this.submitDisplayConfigTree(ids)
  1568. } else {
  1569. this.$message({
  1570. type: 'error',
  1571. message: '请先设置配置文件'
  1572. })
  1573. }
  1574. },
  1575. //#endregion
  1576. async getWbsList(){
  1577. const datas = await Promise.all([
  1578. getWbsList(1),
  1579. getWbsList(2),
  1580. ])
  1581. //console.log(datas,'ressssss');
  1582. this.publictreeoptions = datas[0].data.data;
  1583. this.testtreeoptions = datas[1].data.data;
  1584. },
  1585. synctree(data){
  1586. this.$confirm('是否同步该节点?', '提示', {
  1587. confirmButtonText: '确定',
  1588. cancelButtonText: '取消',
  1589. }).then(() => {
  1590. syncProjectTree({
  1591. id:data.id
  1592. }).then((res)=>{
  1593. if(res.data.code==200){
  1594. this.$message.success(res.data.msg)
  1595. setTimeout(()=>{
  1596. // 刷新页面
  1597. this.$router.go(0)
  1598. },1000)
  1599. }else{
  1600. this.$message.warning(res.data.msg)
  1601. }
  1602. })
  1603. }).catch(() => {
  1604. });
  1605. },
  1606. //获取树节点名字路径
  1607. getTreeNodePath(node,refName){
  1608. let nodeInfo = this.$refs[refName].getNode(node.id);
  1609. //console.log(nodeInfo)
  1610. let pathArr = [];
  1611. while (nodeInfo.parent) {
  1612. pathArr.push(nodeInfo.data.title)
  1613. nodeInfo = nodeInfo.parent
  1614. }
  1615. return pathArr.reverse().join('/');
  1616. },
  1617. async setRecordsHandle(){
  1618. const { data: res } = await saveArchiveAutoRule({
  1619. archiveAutoType:this.archiveAutoType,//最高1 分类2 独立3
  1620. selectNodeIds:this.checkList.join(','),//鼠标选择的节点ID(只要鼠标选择的节点,选择节点的下级子节点那种不要),逗号拼接
  1621. iswbsNode:this.nodesList[0].iswbsNode,//是否是wbs节点
  1622. projectId:this.projectId,// 系统级为0 项目级为项目id
  1623. })
  1624. if (res.code == 200 && res.msg == "操作成功") {
  1625. this.$message({
  1626. type: 'success',
  1627. message: '设置成功'
  1628. })
  1629. this.highVisible = false;
  1630. }
  1631. },
  1632. //立卷树勾选修改
  1633. configCheckChange(data, checks){
  1634. let array = checks.checkedNodes;
  1635. for (let index = 1; index < array.length; index++) {
  1636. const element = array[index];
  1637. if(element.iswbsNode !== array[0].iswbsNode){
  1638. //取消勾选
  1639. this.$refs.configtree.setChecked(data.id,false,false)
  1640. this.$message({
  1641. message: '非wbs节点不能和wbs节点一起设置规则',
  1642. type: 'warning'
  1643. });
  1644. return;
  1645. }
  1646. }
  1647. },
  1648. //立卷规则修改
  1649. async changeConfig(){
  1650. let keys = this.$refs.configtree.getCheckedKeys();
  1651. let nodes = this.$refs.configtree.getCheckedNodes();
  1652. console.log(nodes)
  1653. const { data: res } = await updateArchiveAutoRule({
  1654. archiveAutoType:2,//最高1 分类2 独立3
  1655. archiveAutoGroupId:this.configInfo.data.archiveAutoGroupId,
  1656. selectNodeIds:keys.join(','),//鼠标选择的节点ID(只要鼠标选择的节点,选择节点的下级子节点那种不要),逗号拼接
  1657. iswbsNode:nodes[0].iswbsNode,//是否是wbs节点
  1658. projectId:this.projectId,// 系统级为0 项目级为项目id
  1659. })
  1660. if (res.code == 200 && res.msg == "操作成功") {
  1661. this.$message({
  1662. type: 'success',
  1663. message: '修改成功'
  1664. })
  1665. this.configVisible = false;
  1666. }
  1667. },
  1668. async removeArchive(data){
  1669. this.$confirm('此操作将永久删除配置, 是否继续?', '提示', {
  1670. confirmButtonText: '确定',
  1671. cancelButtonText: '取消',
  1672. type: 'warning'
  1673. }).then(() => {
  1674. removeArchiveAutoRule({
  1675. nodeId:data.id,
  1676. iswbsNode:data.iswbsNode,//是否是wbs节点 flase 不是 true 是 (先false,具体怎么区分后面再看)
  1677. projectId:this.projectId,// 系统级为0 项目级为项目id
  1678. }).then((res)=>{
  1679. //console.log(res)
  1680. if (res.data.code == 200 && res.data.msg == "操作成功") {
  1681. this.$message({
  1682. type: 'success',
  1683. message: '修改成功'
  1684. })
  1685. }
  1686. })
  1687. });
  1688. },
  1689. //树形控件菜单相关方法
  1690. mouseout(){
  1691. this.menuvisible=false
  1692. },
  1693. //展示菜单
  1694. showMenu(e,data,node){
  1695. e.preventDefault();
  1696. console.log(e,'e');
  1697. var x = e.pageX; //这个应该是相对于整个浏览器页面的x坐标,左上角为坐标原点(0,0)
  1698. var y = e.pageY; //这个应该是相对于整个浏览器页面的y坐标,左上角为坐标原点(0,0)
  1699. this.menutop = y;
  1700. this.menuleft = x;
  1701. this.menuvisible=true
  1702. },
  1703. menuClick(e,item,data,node){
  1704. this.menuKey=''
  1705. e.preventDefault();
  1706. if(item.key==='add'){
  1707. if(data.isStorageNode!=1){
  1708. this.addtree(data,node)
  1709. this.menuKey='add'
  1710. }else{
  1711. this.$message.warning('该节点下不允许新增节点')
  1712. }
  1713. }
  1714. else if(item.key==='edit'){
  1715. this.edittree(data,node)
  1716. this.menuKey='edit'
  1717. }
  1718. else if(item.key==='del'){
  1719. this.menuKey='del'
  1720. this.deletetree(data,node)
  1721. }else if(item.key==='copy'){
  1722. this.$message.info('暂无相关接口')
  1723. }
  1724. else if(item.key==='sort'){
  1725. this.menuKey='sort'
  1726. this.paixuMD(data,node)
  1727. }
  1728. else if(item.key==='sync'){
  1729. this.menuKey='sync'
  1730. this.synctree(data,node)
  1731. }
  1732. },
  1733. },
  1734. watch: {
  1735. filterText (val) {
  1736. this.$refs.trees2.filter(val);
  1737. },
  1738. rulefilterText(val) {
  1739. this.$refs.ruletree.filter(val);
  1740. }
  1741. },
  1742. created () {
  1743. this.token = 'bearer ' + getToken()
  1744. this.projectId = this.$route.query.projectId;
  1745. this.archiveTreetree({
  1746. token: this.token,
  1747. //disPlayTree: 1,
  1748. //nodeType: 2,
  1749. })
  1750. this.archiveTreetree4()//全加载左侧树
  1751. this.getWbsList();
  1752. },
  1753. mounted () {
  1754. this.heights = this.$refs.container.$el.offsetHeight;
  1755. },
  1756. filters:{
  1757. ellipsis(value) {
  1758. if (!value) return "";
  1759. if (value.length > 30) {
  1760. return value.slice(0, 30) + "...";
  1761. }
  1762. return value;
  1763. },
  1764. ellipsis1(value) {
  1765. if (!value) return "";
  1766. if (value.length > 25) {
  1767. return value.slice(0, 25) + "...";
  1768. }
  1769. return value;
  1770. },
  1771. },
  1772. }
  1773. </script>
  1774. <style lang="scss" scoped>
  1775. .peizhi {
  1776. border: 1px solid #e5e5e5;
  1777. border-radius: 5px;
  1778. padding: 15px 10px;
  1779. }
  1780. .btnground{
  1781. background-color: #e5e5e5;
  1782. }
  1783. .el-tree .el-tree-node__content{
  1784. display: block !important;
  1785. }
  1786. /deep/ .el-tree .el-tree-node__children{
  1787. overflow: visible!important;
  1788. }
  1789. .config-type-name{
  1790. font-size: 18px;
  1791. }
  1792. .config-allname{
  1793. margin-top: 20px;
  1794. }
  1795. .wraplabel /deep/ .el-checkbox__label {
  1796. display: inline-grid;
  1797. white-space: pre-line;
  1798. word-wrap: break-word;
  1799. overflow: hidden;
  1800. line-height: 20px;
  1801. }
  1802. .treeBox{
  1803. overflow-y: auto;
  1804. width: 100%;
  1805. height: 650px;
  1806. font-size: 14px;
  1807. }
  1808. .treebox .el-tree{
  1809. display: inline-block;
  1810. min-width: 100%;
  1811. font-size: s;
  1812. }
  1813. .contextmenu {
  1814. margin: 0;
  1815. background: #fff;
  1816. z-index: 1000;
  1817. position: fixed; //关键样式设置固定定位
  1818. list-style-type: none;
  1819. padding: 5px 0;
  1820. border-radius: 4px;
  1821. font-size: 12px;
  1822. font-weight: 400;
  1823. color: #333;
  1824. box-shadow: 2px 2px 3px 0 rgba(0, 0, 0, 0.3);
  1825. }
  1826. .contextmenu li {
  1827. margin: 0;
  1828. padding: 7px 16px;
  1829. cursor: pointer;
  1830. }
  1831. .contextmenu li:hover {
  1832. background: #eee;
  1833. }
  1834. </style>