excelmodel.vue 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868
  1. <template>
  2. <div>
  3. <div class="box flexBetween">
  4. <!-- 左侧树结构 -->
  5. <div
  6. :style="{'width':threessW+'px'}"
  7. ref="rulesss"
  8. >
  9. <div
  10. class="box flexStar"
  11. style="width:100%;backgroundColor:#fff;border-radius:3px;padding:10px 0px 0px 8px;box-sizing: border-box;border: 1px solid #EBEEF5;overflow:hidden;"
  12. >
  13. <!-- 树结构 -->
  14. <el-tree
  15. ref="trees"
  16. :style="{width:'100%',height:heightss-20+'px','box-sizing': 'border-box',overflow:'hidden'}"
  17. :loading="loading"
  18. :load="treeLoad"
  19. lazy
  20. :data="data"
  21. :props="defaultProps"
  22. @node-click="nodeClick"
  23. node-key="id"
  24. :expand-on-click-node="false"
  25. >
  26. <span
  27. class="custom-tree-node"
  28. slot-scope="{ data ,node }"
  29. @mouseover.self="mouseOver(data)"
  30. @mouseleave.self="mouseLeave(data)"
  31. style="box-sizing: border-box;width:100%;"
  32. >
  33. <div>
  34. <span style="text-overflow: ellipsis;width:70%;"> {{ data.name }} </span>
  35. <!-- <span> {{ node}} </span> -->
  36. <!-- 添加 -->
  37. <span v-show="data.moreShow">
  38. <i
  39. class="el-icon-circle-plus-outline marleft10"
  40. @click.stop="addExcel(data)"
  41. v-if="data.fileType!=3"
  42. ></i>
  43. <!-- 编辑 -->
  44. <i
  45. class="el-icon-edit marleft10"
  46. @click.stop="editExcel(data)"
  47. v-if="data.fileType!=1"
  48. ></i>
  49. <!-- 删除 -->
  50. <i
  51. class="el-icon-delete marleft10"
  52. @click.stop="deleteExcelM(data,node)"
  53. v-if="!data.hasChildren&&data.fileType!=1"
  54. ></i>
  55. </span>
  56. </div>
  57. </span>
  58. </el-tree>
  59. <div
  60. style="border-left:8px solid rgba(255,255,255,0);z-index:999;cursor: e-resize;"
  61. @mousedown="mousedown1()"
  62. ></div>
  63. </div>
  64. </div>
  65. <!-- 右侧 -->
  66. <div
  67. class="rightBox box"
  68. style="height: 100%;"
  69. >
  70. <div
  71. style="width:calc(100% - 10px);backgroundColor:#fff;border-radius:3px;padding:10px 10px 0px 8px;box-sizing: border-box;border: 1px solid #EBEEF5;"
  72. class="marleft10"
  73. >
  74. <!-- 上传、删除、下载操作栏 -->
  75. <div
  76. class="rightHeader"
  77. v-show="from.checkd&&from.fileUrl"
  78. >
  79. <div class="excelname">
  80. <div>{{from.extension}}</div>
  81. <i
  82. class="el-icon-success marleft10"
  83. style="color: rgb(0, 168, 112);"
  84. ></i>
  85. </div>
  86. <el-upload
  87. class="marleft10"
  88. :auto-upload="false"
  89. :show-file-list="false"
  90. action="#"
  91. :limit="1"
  92. :file-list='fileList'
  93. accept=".xls,.xlsx"
  94. :on-change="uploadChange"
  95. >
  96. <el-button
  97. type="primary"
  98. size="mini"
  99. >重新上传</el-button>
  100. </el-upload>
  101. <el-link
  102. class="marleft10 colorblue"
  103. @click="delectExcelMS"
  104. >删除</el-link>
  105. <el-link
  106. underline
  107. class="marleft10 colorblue"
  108. style="text-decoration:underline;"
  109. @click="downloadExcel()"
  110. >下载EXCEL</el-link>
  111. </div>
  112. <div
  113. :style="{width:'100%',height:heightss-13 +'px'}"
  114. class="rightHeader"
  115. v-show="from.checkd&&!from.fileUrl"
  116. >
  117. <el-upload
  118. :auto-upload="false"
  119. :show-file-list="false"
  120. action="#"
  121. :limit="1"
  122. :file-list='fileList'
  123. accept=".xls,.xlsx"
  124. :on-change="uploadChange"
  125. >
  126. <el-button
  127. type="primary"
  128. size="mini"
  129. >上传 excel</el-button>
  130. </el-upload>
  131. </div>
  132. <el-empty
  133. :style="{width:'100%',height:heightss-13 +'px'}"
  134. v-show="!from.checkd"
  135. description="该目录为根目录没有EXCEL文件"
  136. ></el-empty>
  137. <div
  138. v-if="from.fileUrl"
  139. :style="{ 'margin-top': '20px', 'height':heightss-60+'px','box-sizing': 'border-box','padding-bottom': '15px',}"
  140. >
  141. <iframe
  142. :src="excelSrc"
  143. width="100%"
  144. height="100%"
  145. ></iframe>
  146. </div>
  147. </div>
  148. </div>
  149. </div>
  150. <!-- 弹出框 -->
  151. <el-dialog
  152. :title="dialogTapType"
  153. class="dialogModel"
  154. :visible.sync="dialogTap"
  155. width="800px"
  156. modal-append-to-body
  157. append-to-body
  158. @close="handleClose"
  159. >
  160. <div class="dialogBox">
  161. <el-form
  162. ref="excelForm"
  163. :model="excelForm"
  164. label-width="80px"
  165. rules="rules"
  166. >
  167. <div style="display: flex;justify-content: space-between;">
  168. <el-form-item
  169. label="清表名称"
  170. style="width: 370px;"
  171. size="small"
  172. prop="nodeName"
  173. >
  174. <el-input v-model="excelForm.nodeName"></el-input>
  175. </el-form-item>
  176. <el-form-item
  177. label="清表类型"
  178. style="width: 370px;"
  179. size="small"
  180. prop="tabType"
  181. >
  182. <el-select
  183. v-model="excelForm.tabType"
  184. style="width:100%;"
  185. placeholder="请选择清表类型"
  186. >
  187. <el-option
  188. v-for="(val,index) in exceltypeData"
  189. :key="index"
  190. :label="val.dictValue"
  191. :value="val.id"
  192. ></el-option>
  193. </el-select>
  194. </el-form-item>
  195. </div>
  196. </el-form>
  197. <div
  198. class="middle"
  199. v-if="wbsmiddle"
  200. >
  201. <div class="left">
  202. <div class="select">
  203. <el-select
  204. placeholder="请选择WBS模板"
  205. style="width: 96%;"
  206. size="small"
  207. @change="wbsmodelchange"
  208. v-model="excelForm.wbsId"
  209. >
  210. <el-option
  211. v-for="(val,index) in wbsmodel"
  212. :key="index"
  213. :label="val.wbsName"
  214. :value="val.id"
  215. ></el-option>
  216. </el-select>
  217. </div>
  218. <div class="leftscroll">
  219. <avue-tree
  220. :loading="loading"
  221. :option="option2"
  222. :data="wbsdata"
  223. @node-click="nodeClickExcel"
  224. >
  225. <span
  226. class="el-tree-node__label"
  227. slot-scope="{ data }"
  228. >
  229. <div>
  230. <span> {{ data.deptName }} </span>
  231. </div>
  232. </span>
  233. </avue-tree>
  234. </div>
  235. </div>
  236. <!-- 右侧关联 -->
  237. <template>
  238. <table
  239. class="right"
  240. width="49%"
  241. bordercolor="#DCDCDC"
  242. border="1px"
  243. >
  244. <thead>
  245. <tr>
  246. <td>表名</td>
  247. <td>操作</td>
  248. </tr>
  249. </thead>
  250. <tbody>
  251. <tr
  252. v-for="(val,index) in tableData"
  253. :key="index"
  254. >
  255. <td style="width:50%;">{{val.tableName}}</td>
  256. <td style="text-align: center;height:30px;">
  257. <el-button
  258. v-if="val.isLinkTable!=2"
  259. type="info"
  260. size="small"
  261. @click="relation(index)"
  262. >关联</el-button>
  263. <el-button
  264. v-if="val.isLinkTable==2"
  265. type="warning"
  266. size="small"
  267. @click="Disassociate(index)"
  268. >取消关联</el-button>
  269. </td>
  270. </tr>
  271. </tbody>
  272. </table>
  273. </template>
  274. </div>
  275. </div>
  276. <div class="btbox">
  277. <el-button
  278. size="mini"
  279. @click="handleClose()"
  280. >取消</el-button>
  281. <el-button
  282. type="info"
  283. style="margin-left: 50px;"
  284. size="mini"
  285. @click="saveExcel()"
  286. >确定</el-button>
  287. </div>
  288. </el-dialog>
  289. </div>
  290. </template>
  291. <script>
  292. import { detailExcel, excelType, tabLazytree, getWbsTypeList, wbstree, selectByNodeTable, Excelmodify, uploadExcel, deleteExcelshu, deleteExcel } from '@/api/exctab/excelmodel'
  293. export default {
  294. data () {
  295. return {
  296. treeNode: {},
  297. //#region 鼠标
  298. leftTRee: '',//左侧树ID
  299. threessW: 400,
  300. //#endregion
  301. heightss: '',//
  302. loading: false,//懒加载
  303. data: [],//清表模板
  304. defaultProps: {
  305. children: "children",
  306. isLeaf: function (data) {
  307. return !data.hasChildren || (data.isExistForm == 1);
  308. },
  309. },
  310. wbsdata: [],//wbs模板
  311. //#region 右侧数据
  312. from: {
  313. checkd: false,//判断是否可以进行上传、重新上传excel
  314. id: '',//清表树ID
  315. extension: '', //文件名称
  316. fileUrl: '',//文件路径
  317. },
  318. fileList: [],//选中的文件
  319. excelSrc: '',//
  320. //#endregion
  321. //#region 弹框
  322. dialogTapType: '',
  323. dialogTap: false,
  324. option2: {
  325. filter: false,
  326. lazy: true,
  327. menu: false,
  328. treeLoad: (async (node, resolve) => {
  329. if (node.data.hasChildren) {
  330. const { data: res } = await wbstree({ parentId: node.data.id, wbsId: this.excelForm.wbsId, wbsType: this.excelForm.wbsType })
  331. console.log(res);
  332. if (res.code === 200) {
  333. if (Array.isArray(res.data)) {
  334. res.data.forEach((val) => {
  335. if (!val.hasChildren) {
  336. val.leaf = true
  337. }
  338. })
  339. }
  340. return resolve(res.data)
  341. }
  342. } else {
  343. return resolve([])
  344. }
  345. }),
  346. },//弹框里面的wbs树
  347. excelForm: {
  348. nodeName: '',//清表名称
  349. tabType: '',//清表类型
  350. id: '',//清表Id,编辑时用
  351. parentId: '',//清表Id,添加时用
  352. wbsId: '',//WBS模板Id
  353. wbsType: '',//WBS模板类型
  354. },
  355. rules: {
  356. nodeName: [
  357. { required: true, message: '请输入清表名称', trigger: 'blur' },
  358. ],
  359. tabType: [
  360. { required: true, message: '请选择清表类型', trigger: 'blur' },
  361. ],
  362. },
  363. wbsform: {
  364. id: '',
  365. wbsType: '',
  366. wbsName: '',
  367. },//wbs树选中的值
  368. tableData: [],//右侧表数据
  369. wbsmiddle: false,//选择wbs模板那块是否有
  370. tableList: [],//进行处理的wbs关联表
  371. exceltypeData: [],//清表类型枚举
  372. wbsmodel: [],//wbs模板名称枚举
  373. //#endregion
  374. }
  375. },
  376. methods: {
  377. //#region 接口
  378. async tabLazytree (parentId, modeId) {//清表树
  379. const { data: res } = await tabLazytree({ parentId, modeId })
  380. console.log(res);
  381. if (res.code === 200) {
  382. return res.data
  383. }
  384. },
  385. async detailExcel (id) {//获取列表信息
  386. const { data: res } = await detailExcel({ id })
  387. console.log(res);
  388. if (res.code === 200) {
  389. this.from.id = res.data.id
  390. this.from.extension = res.data.extension //文件名称
  391. this.from.fileUrl = res.data.fileUrl //文件路径
  392. let routeUrl = res.data.fileUrl
  393. let pSrc = routeUrl + '?r=' + new Date()
  394. this.excelSrc = 'http://view.officeapps.live.com/op/view.aspx?src=' + encodeURIComponent(pSrc)
  395. }
  396. },
  397. async getWbsTypeList () {//清表编辑 wbs 下拉框选择
  398. const { data: res } = await getWbsTypeList({ wbstype: 2 })
  399. console.log(res);
  400. if (res.code === 200) {
  401. this.wbsmodel = res.data
  402. }
  403. },
  404. async excelType () {//清表类型
  405. const { data: res } = await excelType({ code: 'sys_excltab_type' })
  406. console.log(res);
  407. if (res.code === 200) {
  408. this.exceltypeData = res.data
  409. }
  410. },
  411. async wbstree () {//wbs树懒加载
  412. const { data: res } = await wbstree({ parentId: 0, wbsId: this.excelForm.wbsId, wbsType: this.excelForm.wbsType })
  413. console.log(res);
  414. if (res.code === 200) {
  415. res.data.forEach((val) => {
  416. if (!val.hasChildren) {
  417. val.leaf = true
  418. }
  419. })
  420. this.wbsdata = res.data
  421. }
  422. },
  423. async selectByNodeTable (id, wbsType, projectid) {//wbs树获取表
  424. const { data: res } = await selectByNodeTable({ id, wbsType, projectid })
  425. console.log(res);
  426. if (res.code === 200) {
  427. console.log(Array.isArray(res.data));
  428. if (Array.isArray(res.data)) {
  429. this.tableData = res.data
  430. this.tableData.forEach(val => {
  431. val.changeTable = val.isLinkTable
  432. })
  433. } else {
  434. this.tableData = []
  435. }
  436. }
  437. },
  438. async deleteExcelshu (ids) {//删除清表
  439. // console.log(ids);
  440. const { data: res } = await deleteExcelshu(ids)
  441. console.log(res);
  442. if (res.code === 200) {
  443. this.$message({
  444. message: '删除清表树成功',
  445. type: 'success'
  446. });
  447. this.tabLazytree(0, this.$route.params.id)//获取清表树
  448. this.from = {
  449. checkd: false,//判断是否可以进行上传、重新上传excel
  450. id: '',//清表树ID
  451. extension: '', //文件名称
  452. fileUrl: '',//文件路径
  453. }
  454. }
  455. },
  456. async Excelmodify (wbsExclTabParmVO) {//编辑添加清表
  457. console.log(wbsExclTabParmVO, this.treeNode);
  458. const { data: res } = await Excelmodify(wbsExclTabParmVO)
  459. console.log(res);
  460. if (res.code === 200) {
  461. let ids = ''
  462. if (wbsExclTabParmVO.id) {
  463. ids = this.treeNode.parentId
  464. } else {
  465. ids = wbsExclTabParmVO.parentId
  466. }
  467. let das = await this.tabLazytree(ids, this.$route.params.id)//获取清表树
  468. if (wbsExclTabParmVO.id) {
  469. this.treeNode.name = wbsExclTabParmVO.nodeName
  470. } else {
  471. this.$refs.trees.updateKeyChildren(this.treeNode.id, das)
  472. }
  473. let node = this.$refs.trees.getNode(ids);
  474. node.isLeaf = false;
  475. node.isLeafByUser = false;
  476. this.dialogTap = false
  477. }
  478. },
  479. async uploadExcel (data) {//上传清表
  480. const { data: res } = await uploadExcel(data)
  481. console.log(res);
  482. if (res.code === 200) {
  483. this.$message({
  484. message: '上传文件成功',
  485. type: 'success'
  486. })
  487. this.detailExcel(this.from.id)
  488. this.from.checkd = true
  489. }
  490. this.fileList = []
  491. },
  492. async deleteExcel (data) {//删除excel表
  493. const { data: res } = await deleteExcel(data)
  494. if (res.code === 200) {
  495. this.$message({
  496. message: '删除excel表成功',
  497. type: 'success'
  498. })
  499. this.detailExcel(this.from.id)
  500. }
  501. },
  502. //#endregion
  503. //#region 右侧
  504. async uploadChange (file, fileList) {//选中表后触发
  505. console.log(file, fileList);
  506. this.fileList = [file.raw]
  507. let formData = new FormData()
  508. formData.append('file', ...this.fileList)
  509. formData.append('nodeId', this.from.id)
  510. const loading = this.$loading({
  511. lock: true,
  512. text: 'Loading',
  513. spinner: 'el-icon-loading',
  514. background: 'rgba(0, 0, 0, 0.7)'
  515. });
  516. try {
  517. await this.uploadExcel(formData)
  518. loading.close();
  519. } catch (error) {
  520. loading.close();
  521. }
  522. },
  523. delectExcelMS () {//删除excel表点击事件、
  524. let _that = this
  525. this.$confirm('确认删除该文件?', '', {
  526. confirmButtonText: '确定',
  527. cancelButtonText: '取消',
  528. type: 'warning'
  529. }).then(() => {
  530. _that.deleteExcel({ id: _that.from.id, fileUrl: '' })
  531. }).catch(() => {
  532. })
  533. },
  534. downloadExcel () {//下载excel表
  535. window.open(this.from.fileUrl)
  536. },
  537. //#endregion
  538. //#region 外层左侧事件
  539. mouseLeave (data) {
  540. if (data.moreShow) {
  541. this.$set(data, 'moreShow', false)
  542. }
  543. },
  544. mouseOver (data) {
  545. if (!data.moreShow) {
  546. this.$set(data, 'moreShow', true)
  547. }
  548. },
  549. async treeLoad (node, resolve) {
  550. let id = node.data.id
  551. if (node.level == 0) {
  552. id = 0
  553. }
  554. let das = await this.tabLazytree(id, this.$route.params.id)
  555. return resolve(das)
  556. },
  557. nodeClick (data) {//外层树结构
  558. if (data.hasChildren == false || data.fileType == 3) {
  559. this.from.checkd = true
  560. } else {
  561. this.from.checkd = false
  562. }
  563. if (this.from.checkd) {
  564. this.detailExcel(data.id)
  565. } else {
  566. this.from = {
  567. checkd: false,//判断是否可以进行上传、重新上传excel
  568. id: '',//清表树ID
  569. extension: '', //文件名称
  570. fileUrl: '',//文件路径
  571. }
  572. }
  573. },
  574. async editExcel (data) {//编辑
  575. this.dialogTapType = '编辑'
  576. if (data.fileType != 3 && data.hasChildren) {
  577. this.wbsmiddle = false
  578. } else {
  579. this.wbsmiddle = true
  580. this.getWbsTypeList()//wbs模板名称
  581. }
  582. const { data: res } = await detailExcel({ id: data.id })
  583. console.log(res);
  584. if (res.code === 200) {
  585. this.excelForm.id = res.data.id
  586. this.excelForm.nodeName = res.data.name //清表名称
  587. this.excelForm.tabType = res.data.tabType //清表类型
  588. this.treeNode = data
  589. this.dialogTap = true
  590. }
  591. },
  592. async addExcel (data) {//添加
  593. this.dialogTapType = '新增'
  594. console.log(data);
  595. if (data.fileType == 3) {
  596. this.wbsmiddle = false
  597. } else {
  598. this.wbsmiddle = true
  599. this.getWbsTypeList()//wbs模板名称
  600. }
  601. this.excelForm.parentId = data.id
  602. this.treeNode = data
  603. this.dialogTap = true
  604. },
  605. deleteExcelM (data, node) {//删除
  606. console.log(node);
  607. const _that = this
  608. this.$confirm('确定将选择数据删除?', '', {
  609. confirmButtonText: '确定',
  610. cancelButtonText: '取消',
  611. type: 'error'
  612. }).then(async () => {
  613. await _that.deleteExcelshu(data.id)
  614. _that.$refs.trees.remove(node) //删除界面上的节点
  615. }).catch(() => {
  616. });
  617. },
  618. //#endregion
  619. //#region 弹框属性
  620. handleClose () {//关闭弹框触发事件
  621. this.excelForm = {
  622. nodeName: '',//清表名称
  623. tabType: '',//清表类型
  624. id: '',//清表Id,编辑时用
  625. parentId: '',//清表Id,添加时用
  626. wbsId: '',//WBS模板Id
  627. wbsType: '',//WBS模板类型
  628. }
  629. this.wbsform = {
  630. id: '',
  631. wbsType: '',
  632. wbsName: '',
  633. }//wbs树选中的值
  634. this.wbsdata = [] //wbs树数据
  635. this.tableData = []//弹框table数据
  636. this.tableList = []//关联取消关联的数据
  637. this.dialogTap = false
  638. },
  639. wbsmodelchange (val) {//wbs模板change事件
  640. if (val) {
  641. this.wbsmodel.forEach((da) => {
  642. if (da.id == val) {
  643. this.loading = true
  644. window.setTimeout(() => {
  645. this.excelForm.wbsType = da.wbsType
  646. }, 2000)
  647. this.loading = false
  648. }
  649. })
  650. }
  651. this.wbstree()
  652. },
  653. nodeClickExcel (data) {//wbs树点击事件
  654. console.log(data);
  655. this.wbsform.id = data.id
  656. this.wbsform.wbsType = data.type
  657. this.wbsform.wbsName = data.deptName
  658. if (this.tableList == '') {
  659. this.selectByNodeTable(data.id, data.type, this.excelForm.wbsId)
  660. } else {
  661. let tag = true
  662. this.tableList.forEach((val) => {
  663. if (val.id == data.id) {
  664. this.tableData = val.arrs
  665. tag = false
  666. }
  667. })
  668. if (tag) {
  669. this.selectByNodeTable(data.id, data.type, this.excelForm.wbsId)
  670. }
  671. }
  672. },
  673. relation (key) {//关联
  674. this.tableData[key].isLinkTable = 2
  675. let tap = this.tableList.find((val) => {
  676. return val.id == this.wbsform.id
  677. })
  678. if (!tap) {
  679. this.tableList.push({
  680. id: this.wbsform.id,
  681. wbsType: this.wbsform.wbsType,
  682. wbsName: this.wbsform.wbsName,
  683. arrs: this.tableData
  684. })
  685. }
  686. },
  687. Disassociate (key) {//取消关联
  688. this.tableData[key].isLinkTable = 1
  689. const tap = this.tableList.find((val) => {
  690. return val.id == this.wbsform.id
  691. })
  692. if (!tap) {
  693. this.tableList.push({
  694. id: this.wbsform.id,
  695. wbsType: this.wbsform.wbsType,
  696. wbsName: this.wbsform.wbsName,
  697. arrs: this.tableData
  698. })
  699. }
  700. },
  701. saveExcel () {//保存按钮
  702. this.$refs.excelForm.validate(async (valid) => {
  703. if (valid) {
  704. let linkDataInfo = []
  705. if (this.tableList.length > 0) {
  706. this.tableList.forEach(val => {
  707. let linkIds = ''
  708. val.arrs.forEach(da => {
  709. if (da.isLinkTable != da.changeTable) {
  710. linkIds = `${linkIds}${linkIds != '' ? ',' : ''}${da.pkeyId}`
  711. }
  712. })
  713. if (linkIds != '') {
  714. linkDataInfo.push({
  715. id: val.id,
  716. linkIds: linkIds,
  717. wbsName: val.wbsName,
  718. wbsType: val.wbsType
  719. })
  720. }
  721. })
  722. }
  723. if (this.excelForm.parentId && !this.excelForm.id) {
  724. await this.Excelmodify({
  725. nodeName: this.excelForm.nodeName,
  726. tabType: this.excelForm.tabType,
  727. parentId: this.excelForm.parentId,
  728. linkDataInfo: linkDataInfo
  729. })
  730. } else {
  731. await this.Excelmodify({
  732. nodeName: this.excelForm.nodeName,
  733. tabType: this.excelForm.tabType,
  734. id: this.excelForm.id,
  735. linkDataInfo: linkDataInfo
  736. })
  737. }
  738. this.dialogTap = false
  739. }
  740. });
  741. },
  742. //#endregion
  743. //#region 树结构拉事件
  744. mousedown1 () {//鼠标按下事件
  745. document.onmousemove = (va) => {
  746. if (1000 > va.clientX - 240 && va.clientX - 240 > 200) {
  747. this.threessW = va.clientX - 240
  748. }
  749. }
  750. document.onmouseup = () => {
  751. document.onmousemove = null;
  752. document.onmouseup = null;
  753. }
  754. },
  755. //#endregion
  756. },
  757. created () {
  758. this.excelType()//清表类型
  759. },
  760. mounted () {
  761. this.heightss = this.$refs.rulesss.clientHeight
  762. }
  763. }
  764. </script>
  765. <style scoped lang="scss">
  766. .marleft10 {
  767. margin-left: 10px;
  768. }
  769. /deep/.el-tree-node__expand-icon {
  770. font-size: 16px;
  771. }
  772. .colorblue {
  773. color: rgb(0, 82, 217);
  774. }
  775. .box {
  776. height: 800px;
  777. }
  778. .el-scrollbar {
  779. height: 100%;
  780. }
  781. .box .el-scrollbar__wrap {
  782. overflow: scroll;
  783. }
  784. .rightHeader {
  785. display: flex;
  786. justify-content: flex-start;
  787. align-items: top;
  788. font-size: 14px;
  789. background-color: #fff;
  790. .excelname {
  791. box-sizing: border-box;
  792. min-width: 200px;
  793. height: 28px;
  794. border: 1px solid rgb(220, 220, 220);
  795. padding: 0 10px;
  796. border-radius: 3px;
  797. display: flex;
  798. justify-content: space-between;
  799. align-items: center;
  800. }
  801. }
  802. .dialogModel {
  803. .dialogBox {
  804. .middle {
  805. display: flex;
  806. .left {
  807. border: 1px solid rgb(220, 220, 220);
  808. border-radius: 3px;
  809. height: 500px;
  810. width: 49%;
  811. .select {
  812. box-sizing: border-box;
  813. display: flex;
  814. justify-content: center;
  815. padding: 5px 0;
  816. border-bottom: 1px solid #e0e0e0;
  817. }
  818. .leftscroll {
  819. height: 450px;
  820. overflow-y: scroll;
  821. }
  822. }
  823. .right {
  824. height: auto;
  825. height: 60px;
  826. max-height: 500px;
  827. margin-left: 2%;
  828. // height: 500px;
  829. border-radius: 3px;
  830. td {
  831. box-sizing: border-box;
  832. padding: 5px 10px;
  833. height: 30px;
  834. line-height: 30px;
  835. }
  836. }
  837. }
  838. }
  839. .btbox {
  840. margin-top: 20px;
  841. display: flex;
  842. justify-content: center;
  843. }
  844. }
  845. .rightBox {
  846. flex: 1;
  847. }
  848. </style>