archivetreeRule.vue 62 KB

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