archivetreeRule.vue 64 KB

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