archivetree.vue 63 KB

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