archivetree.vue 57 KB

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