archivetreeRule.vue 50 KB

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