index.vue 39 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087
  1. <template>
  2. <fullscreen :fullscreen.sync="fullscreen" class="container">
  3. <div class="container">
  4. <div class="main-box container-box">
  5. <input type="hidden" id="excelId" />
  6. <div class="inner-left" style="overflow: hidden">
  7. <!-- <div class="button-list">-->
  8. <!-- <el-button type="primary" @click="showExcel = true" plain>excel</el-button>-->
  9. <!-- <el-button type="primary" @click="showExcel = false" plain>不excel</el-button>-->
  10. <!-- </div>-->
  11. <div style="margin: 10px 0">
  12. <el-input placeholder="请输入内容" v-model="filterText" class="input-with-select" clearable
  13. @change="() => { if (!filterText) { searchMenu(); } }">
  14. <el-button slot="append" @click="searchMenu" icon="el-icon-search"></el-button>
  15. </el-input>
  16. </div>
  17. <div v-loading="loading" style="height: calc(100% - 100px);overflow-y: scroll;overflow-x: scroll">
  18. <el-tree ref="tree" class="tree-line" :expand-on-click-node="false" :auto-expand-parent="true"
  19. :default-expand-all="true" :default-checked-keys="checkedMenu" :data="menuList"
  20. @check="checkChange" @node-click="nodeClick" :filter-node-method="filterNode"
  21. node-key="functionCode" style="width: 300px">
  22. <span class="custom-tree-node" slot-scope="{ node }">
  23. <span>
  24. <span v-if="node.data.type == 4" style="color: #009cff"
  25. class="iconfont icon-wenjianjia"></span>
  26. <span v-else style="color: #fdb441" class="iconfont icon-wenjian"></span>
  27. <span
  28. :style="node.data.hasOwnProperty('parent') ? 'font-size:14px;padding-left:5px' : 'font-size:12px;padding-left:5px'">{{
  29. node.data.functionName
  30. }}</span>
  31. </span>
  32. </span>
  33. </el-tree>
  34. </div>
  35. <div class="tree-action"></div>
  36. </div>
  37. <div class="inner-right">
  38. <div style="overflow: hidden;" v-if="showExcel == false">
  39. <toolList @iconCli='iconCli' :tooltit='tooltit' style="margin: 10px"></toolList>
  40. <div style="margin-top: 20px;float: left;" class="bigbtns">
  41. <el-button style="margin-left: 20px;" class="btn-check" size="medium" type="primary"
  42. @click="addNewStatus = true">新建
  43. </el-button>
  44. <input style="margin-left:30px" id="upload-file" name="file" type="file" @change="handleUpload">
  45. </div>
  46. <div style="margin-top: 20px;float: right;margin-right: 20px" class="bigbtns"
  47. v-if="selectionSize != 0">
  48. <el-button style="margin-left: 5px;" class="btn-check" size="small" type="primary"
  49. @click="delExcel()">删除
  50. </el-button>
  51. <el-button style="margin-left: 5px;" class="btn-check" size="small" type="primary"
  52. @click="cancelSelection()">取消
  53. </el-button>
  54. <el-button style="margin-left: 5px;" class="btn-check" size="small" type="primary"
  55. @click="moveStatus = true">移动到
  56. </el-button>
  57. </div>
  58. </div>
  59. <div class="tabbox" v-if="showExcel == false">
  60. <div id="selectionList" style="height: 30px">
  61. <span v-if="selectionSize != 0">已选{{ selectionSize }}项</span>
  62. </div>
  63. <el-table height="calc(100% - 60px)" class="com-table" ref="multipleTable" :data="tableData"
  64. tooltip-effect="dark" size="small" border style="width: 100%" v-loading="loading"
  65. @selection-change="handleSelectionChange">
  66. <el-table-column type="selection" width="45"></el-table-column>
  67. <el-table-column prop="fileName" label="名称">
  68. </el-table-column>
  69. <el-table-column prop="opTime" label="创建时间">
  70. </el-table-column>
  71. <el-table-column prop="addUserDept" label="创建科室">
  72. </el-table-column>
  73. <el-table-column prop="addUserName" label="创建人">
  74. </el-table-column>
  75. <el-table-column prop="shareEditStatus" label="权限状态">
  76. <template slot-scope="scope">
  77. <span v-if="scope.row.editStatus == 0">开</span>
  78. <span v-if="scope.row.editStatus == 1">关</span>
  79. </template>
  80. </el-table-column>
  81. <el-table-column label="操作" width="180px" align="center" fixed="right">
  82. <template slot-scope="scope">
  83. <el-button size="mini" type="primary" @click="moveToEdit(scope.row)"
  84. :disabled="scope.row.shareEditStatus == 1">编辑
  85. </el-button>
  86. </template>
  87. </el-table-column>
  88. </el-table>
  89. <el-pagination class="pageBox" @current-change="currchange" layout="prev, pager, next"
  90. background :total="total">
  91. </el-pagination>
  92. </div>
  93. <div class="container" id="container" v-else>
  94. <fullscreen :fullscreen.sync="excelFullScreen" class="container">
  95. <iframe id="excelIframe" height="100%" width="100%"
  96. src="/static/views/onlineShareExcel.html" frameborder="0"></iframe>
  97. </fullscreen>
  98. </div>
  99. </div>
  100. </div>
  101. <el-dialog :title="'新建'" :visible.sync="addNewStatus" width="450px" :destroy-on-close="true"
  102. :modal-append-to-body="false" :close-on-click-modal="false">
  103. <div>
  104. <!-- <el-button type="primary" @click="addExcel()" plain class="iconfont icon-wenjian">在线文档</el-button>-->
  105. <!-- <el-button type="primary" @click="addFolderStatus = true" plain class="iconfont icon-wenjianjia">文件夹</el-button>-->
  106. <div style="padding-bottom: 30px;display:flex">
  107. <div style="width: 85px;display: inline-block;cursor: pointer" @click="addExcel()">
  108. <span class="iconfont icon-wenjian" style="font-size: 80px;color: dodgerblue"></span>
  109. <p style="margin-left: 20px;margin-top: 10px">在线文档</p>
  110. </div>
  111. <div style="width: 85px;display: inline-block;margin-left: 70px;cursor: pointer">
  112. <span class="iconfont icon-excel" style="font-size: 80px;color: dodgerblue"></span>
  113. <input id="upload-file" name="file" type="file" @change="handleUpload">
  114. </div>
  115. <div style="width: 85px;display: inline-block;margin-left: 70px;cursor: pointer"
  116. @click="addFolderStatus = true">
  117. <span class="iconfont icon-wenjianjia" style="font-size: 80px;color: dodgerblue"></span>
  118. <p style="margin-left: 20px;margin-top: 10px">文件夹</p>
  119. </div>
  120. </div>
  121. </div>
  122. </el-dialog>
  123. <el-dialog :title="'新增文件夹'" :visible.sync="addFolderStatus" width="50%" :destroy-on-close="true"
  124. :modal-append-to-body="false" :close-on-click-modal="false">
  125. <div v-loading="loading">
  126. <el-form :model="infolist" ref="infolist">
  127. <div class="online">
  128. <el-form-item prop="name">
  129. <span>文件夹名称</span>
  130. <el-input v-model="infolist.name" placeholder="文件夹名称"
  131. :disabled="disableStatus"></el-input>
  132. </el-form-item>
  133. </div>
  134. </el-form>
  135. <div slot="footer" class="dialog-footer myfooter">
  136. <el-button type="primary" @click="addNewFolder()">确 定</el-button>
  137. <el-button @click="addFolderStatus = false">取 消</el-button>
  138. </div>
  139. </div>
  140. </el-dialog>
  141. <el-dialog :title="'分享选项'" :visible.sync="shareStatus" width="550px" :destroy-on-close="true"
  142. :modal-append-to-body="false" :close-on-click-modal="false">
  143. <div style="margin-left: 30px;padding-bottom: 20px" v-loading='shareLoading'>
  144. <el-button type="primary" @click="processExcelShare(1)" plain>仅我可编辑</el-button>
  145. <el-button type="primary" @click="openOADialog(2)" plain>部门内所有人可编辑</el-button>
  146. <el-button type="primary" @click="checkexa = true" plain>指定人可编辑</el-button>
  147. </div>
  148. </el-dialog>
  149. <el-dialog title="选择填报人" :visible.sync="checkexa" width="50%" :destroy-on-close="true"
  150. :modal-append-to-body="false" :close-on-click-modal="false" v-loading="shareLoading">
  151. <div>
  152. <el-form :model="exaList" ref="addInfoList">
  153. <el-form-item prop="processUserId" class="info-line online">
  154. <span style="width: 80px;margin-right: 20px">审批人员</span>
  155. <deptTreeUserNew class="tree" @treeCheck="treeCheckonly" :defaultList="defaultList"
  156. :type="depttype" :closeList="closeList"></deptTreeUserNew>
  157. <div class="tree treeUser">
  158. <p v-for="(item, index) in treeList" :key="index">{{ item.receiveName }}
  159. <i @click="deletes(item, index)" class="el-icon-error"></i>
  160. </p>
  161. </div>
  162. </el-form-item>
  163. </el-form>
  164. <div slot="footer" style="text-align: right;padding-bottom: 20px">
  165. <el-button type="primary" @click="checkProcessUser(3)">确 定</el-button>
  166. <el-button @click="checkexa = false">取 消</el-button>
  167. </div>
  168. </div>
  169. </el-dialog>
  170. <el-dialog title="移动到" :visible.sync="moveStatus" width="500px" :destroy-on-close="true"
  171. :modal-append-to-body="false" :close-on-click-modal="false">
  172. <div>
  173. <el-tree ref="tree" class="tree-line" :expand-on-click-node="false" :auto-expand-parent="true"
  174. :default-expand-all="true" :default-checked-keys="checkedMenu" :data="moveMenuList"
  175. @check="checkChange" @node-click="folderNodeClick" node-key="functionCode"
  176. @expand-on-click-node="false">
  177. <span class="custom-tree-node" slot-scope="{ node }">
  178. <span>
  179. <span v-if="node.data.type == 4" style="color: #009cff"
  180. class="iconfont icon-wenjianjia"></span>
  181. <span v-else style="color: #fdb441" class="iconfont icon-wenjian"></span>
  182. <span
  183. :style="node.data.hasOwnProperty('parent') ? 'font-size:14px;padding-left:5px' : 'font-size:12px;padding-left:5px'">{{
  184. node.data.functionName
  185. }}</span>
  186. </span>
  187. </span>
  188. </el-tree>
  189. <div slot="footer" style="text-align: right;padding-bottom: 20px">
  190. <el-button type="primary" @click="addFolderStatus = true" style="margin-right: 150px">+新建文件夹
  191. </el-button>
  192. <el-button type="primary" @click="moveExcel()">确 定</el-button>
  193. <el-button @click="moveStatus = false">取 消</el-button>
  194. </div>
  195. </div>
  196. </el-dialog>
  197. <myMessage :messTit='messTit' @closeMessage="processDel" :centerDialogVisible="delVisible"
  198. v-if="delVisible"></myMessage>
  199. <myMessageRadio :messTit='oaTitle' @closeMessage="processOa" :centerDialogVisible="oaVisible"
  200. v-if="oaVisible" yesBtnName="是" noBtnName="否" ok-btn-name="提交"></myMessageRadio>
  201. </div>
  202. </fullscreen>
  203. </template>
  204. <script>
  205. import LuckyExcel from "luckyexcel";
  206. import pForm from "../../../components/p-form";
  207. import toolList from "../../../components/toolList";
  208. import myMessage from "../../../components/myMessage.vue";
  209. import myMessageNew from "../../../components/myMessageNew.vue";
  210. import myMessageRadio from "../../../components/myMessageRadio.vue";
  211. import deptTreeUserNew from "../../../components/deptTreeUserNew.vue"
  212. import {ajaxJson} from '../../../../public/static/js/util'
  213. export default {
  214. components: {
  215. pForm,
  216. toolList,
  217. myMessage,
  218. myMessageNew,
  219. myMessageRadio,
  220. deptTreeUserNew,
  221. },
  222. data() {
  223. return {
  224. fullscreen: false,
  225. filterText: "", // tree搜索value
  226. actionName: "", // 当前选择节点名称
  227. menuList: [], // tree数据源
  228. checkedMenu: [], // 选中节点的functionCode
  229. checkedNodes: [], // 选中节点的node值
  230. roleData: "", // 某一条数据
  231. showExcel: false,
  232. tableData: [],
  233. loading: false,
  234. total: 0,
  235. pageSize: 1,
  236. addNewStatus: false,
  237. tooltit: '在线文档-文件管理',
  238. addFolderStatus: false,
  239. addExcelStatus: false,
  240. infolist: {},
  241. disableStatus: false,
  242. nowFolder: {},
  243. selectionList: [],
  244. selectionSize: 0,
  245. delVisible: false,
  246. messTit: '',
  247. shareStatus: false,
  248. excelJson: '',
  249. editFrom: '',
  250. editTo: '',
  251. editStatus: '',
  252. excelName: '',
  253. excelId: '',
  254. checkexa: false,
  255. exaList: {},
  256. //审批人用到的
  257. treeListonly: {},
  258. defaultList: [],
  259. treeList: [],
  260. closeList: false,
  261. depttype: 0,
  262. shareType: '',
  263. oaVisible: false,
  264. oaTitle: '',
  265. oaType: '',
  266. moveStatus: false,
  267. //移动文件夹tree相关
  268. nowMoveFolder: {},
  269. shareLoading: false,
  270. woNo: '',
  271. moveMenuList: [],
  272. addShareType: 0,
  273. excelFullScreen: false,
  274. }
  275. },
  276. methods: {
  277. //外部导入
  278. addExport(e) {
  279. this.$http({
  280. url: '/market/cOnlineExcel/addExcel',
  281. method: "post",
  282. headers: {
  283. "Content-Type": "application/json",
  284. },
  285. data: {
  286. folderId: '',
  287. },
  288. }).then((res) => {
  289. console.log(res);
  290. res.data.desc
  291. this.startUpload(e, res.data.desc)
  292. });
  293. },
  294. startUpload(e, res) {
  295. let _this = this;
  296. let files = e.target.files;
  297. if (files == null || files.length == 0) {
  298. window.top.$vm.$message({
  299. message: '没有文件导入',
  300. type: 'info'
  301. })
  302. return;
  303. }
  304. let name = files[0].name;
  305. let suffixArr = name.split("."),
  306. suffix = suffixArr[suffixArr.length - 1];
  307. if (suffix != "xlsx") {
  308. window.top.$vm.$message({
  309. message: '目前只支持xlsx文件的导入',
  310. type: 'info'
  311. })
  312. return;
  313. }
  314. // 解析文件
  315. LuckyExcel.transformExcelToLucky(files[0], function (exportJson, luckysheetfile) {
  316. if (exportJson.sheets == null || exportJson.sheets.length == 0) {
  317. window.top.$vm.$message({
  318. message: '无法读取excel文件的内容,当前不支持xls文件',
  319. type: 'info'
  320. })
  321. return;
  322. }
  323. let exceljson = JSON.stringify(exportJson)
  324. _this.$util.ajaxJson("正在导入中", "http://192.168.2.124:7777/sheet/excel/importFile", { exceldata: exceljson, id: res }, function (res) {
  325. // console.log('[ res ] >', res)
  326. _this.addNewStatus = false;
  327. document.getElementById('excelId').setAttribute("value", res.id);
  328. _this.showExcel = true;
  329. });
  330. }
  331. );
  332. console.log(e); //文件
  333. console.log(res);//excel id
  334. },
  335. handleUpload(e) {
  336. this.addExport(e)
  337. },
  338. processWoNo() {
  339. console.log(this.woNo);
  340. var _this = this;
  341. this.$http({
  342. url: '/market/cOnlineExcel/processWoNo',
  343. method: "post",
  344. headers: {
  345. "Content-Type": "application/json",
  346. },
  347. data: {
  348. id: _this.woNo,
  349. },
  350. }).then((res) => {
  351. if (res.data.result === 1) {
  352. if (res.data.result != 'WONOEMPTY') {
  353. _this.$message({
  354. message: res.data.desc,
  355. type: 'error'
  356. });
  357. }
  358. } else {
  359. _this.$message({
  360. message: '请填写完毕后点击“保存”按钮',
  361. type: 'success'
  362. });
  363. var id = res.data.desc;
  364. //放入id,切换到excel模式
  365. document.getElementById('excelId').setAttribute("value", id);
  366. _this.showExcel = true;
  367. console.log(_this.showExcel);
  368. }
  369. });
  370. },
  371. moveExcel() {
  372. var _this = this;
  373. var folderId = "";
  374. if (this.nowFolder.type == '4') {
  375. folderId = this.nowFolder.functionCode;
  376. }
  377. var arr = [];
  378. this.selectionList.map((o) => {
  379. arr.push(o.id);
  380. });
  381. this.$http({
  382. url: '/market/cOnlineExcel/moveExcel',
  383. method: "post",
  384. headers: {
  385. "Content-Type": "application/json",
  386. },
  387. data: {
  388. moveIds: arr,
  389. moveFolderId: folderId
  390. },
  391. }).then((res) => {
  392. if (res.data.result === 1) {
  393. _this.$message({
  394. message: res.data.desc,
  395. type: 'error'
  396. });
  397. } else {
  398. _this.$message({
  399. message: res.data.desc,
  400. type: 'success'
  401. });
  402. _this.moveStatus = false;
  403. _this.tooltit = '在线文档-' + _this.nowFolder.functionName;
  404. _this.getList({}, this.pageSize);
  405. }
  406. });
  407. },
  408. // 点击树节点事件
  409. folderNodeClick(a, b, c, d) {
  410. this.nowFolder = a;
  411. },
  412. //检查是否选了填报人
  413. checkProcessUser(v) {
  414. let _this = this;
  415. if (_this.treeList.length == 0) {
  416. _this.$message({
  417. message: '请选择填报人',
  418. type: 'error'
  419. });
  420. } else {
  421. _this.openOADialog(v);
  422. }
  423. },
  424. //判断是否提交oa待办
  425. processOa(v) {
  426. console.log(v);
  427. if (v == 1) {
  428. this.oaType = 1;
  429. this.processExcelShare(this.shareType);
  430. } else if (v == 2) {
  431. this.oaType = 0;
  432. this.processExcelShare(this.shareType);
  433. }
  434. this.oaVisible = false;
  435. },
  436. //打开oa待办选项框
  437. openOADialog(shareType) {
  438. this.shareType = shareType;
  439. this.oaTitle = '是否要推送OA待办?';
  440. this.oaVisible = true;
  441. },
  442. //提交分享
  443. processExcelShare(shareType) {
  444. var deptList = [];
  445. var _this = this;
  446. _this.shareLoading = true;
  447. if (shareType == 3) {
  448. this.treeList.map((o) => {
  449. deptList.push(o.receiveNo);
  450. });
  451. }
  452. if (shareType == 1) {
  453. _this.shareType = 1;
  454. }
  455. console.log(deptList);
  456. console.log('oa:' + this.oaType);
  457. console.log('share:' + shareType);
  458. //提交
  459. var url = '/market/cOnlineExcel/saveExcelShare';
  460. if (this.addShareType == '2') {
  461. url = '/market/cOnlineExcel/reShare';
  462. }
  463. this.$http({
  464. url: url,
  465. method: "post",
  466. headers: {
  467. "Content-Type": "application/json",
  468. },
  469. data: {
  470. data: _this.excelJson,
  471. id: _this.excelId,
  472. editConStart: _this.editFrom,
  473. editConEnd: _this.editTo,
  474. excelName: _this.excelName,
  475. editStatus: _this.editStatus,
  476. deptIds: deptList,
  477. oaType: _this.oaType,
  478. shareType: _this.shareType
  479. },
  480. }).then((res) => {
  481. _this.shareLoading = false;
  482. if (res.data.result === 1) {
  483. _this.$message({
  484. message: res.data.desc,
  485. type: 'error'
  486. });
  487. } else {
  488. _this.$message({
  489. message: '分享成功',
  490. type: 'success'
  491. });
  492. _this.oaVisible = false;
  493. _this.checkexa = false;
  494. _this.shareStatus = false;
  495. _this.showExcel = false;
  496. _this.getList({}, this.pageSize);
  497. }
  498. });
  499. },
  500. //删除填报人
  501. deletes(val, index) {
  502. this.treeList.splice(index, 1);
  503. this.closeList = this.treeList;
  504. },
  505. treeCheckonly(v) {
  506. this.treeList = v;
  507. },
  508. //从excel页面调用来打开分享框
  509. shareExcel(excelJson, editFrom, editTo, editStatus, excelName, excelId, type) {
  510. console.log(excelJson, editFrom, editTo, editStatus, excelName, excelId, type);
  511. this.excelJson = excelJson;
  512. this.editFrom = editFrom;
  513. this.editTo = editTo;
  514. this.editStatus = editStatus;
  515. this.excelName = excelName;
  516. this.excelId = excelId;
  517. this.addShareType = type;
  518. this.shareStatus = true;
  519. },
  520. //从excel页面调用来关闭excel
  521. closeExcel() {
  522. this.showExcel = false;
  523. this.getList({}, this.pageSize);
  524. },
  525. //打开excel
  526. moveToEdit(row) {
  527. //放入id,切换到excel模式
  528. document.getElementById('excelId').setAttribute("value", row.id);
  529. this.showExcel = true;
  530. },
  531. //新建excel
  532. addExcel() {
  533. var _this = this;
  534. var folderId = "";
  535. if (this.nowFolder.type == '4') {
  536. folderId = this.nowFolder.functionCode;
  537. }
  538. this.$http({
  539. url: '/market/cOnlineExcel/addExcel',
  540. method: "post",
  541. headers: {
  542. "Content-Type": "application/json",
  543. },
  544. data: {
  545. folderId: folderId,
  546. },
  547. }).then((res) => {
  548. console.log(res);
  549. if (res.data.result === 1) {
  550. _this.$message({
  551. message: res.data.desc,
  552. type: 'error'
  553. });
  554. } else {
  555. _this.$message({
  556. message: '成功',
  557. type: 'success'
  558. });
  559. var id = res.data.desc;
  560. _this.addNewStatus = false;
  561. //放入id,切换到excel模式
  562. document.getElementById('excelId').setAttribute("value", id);
  563. _this.showExcel = true;
  564. }
  565. });
  566. },
  567. //处理删除
  568. processDel(v) {
  569. this.delVisible = false;
  570. if (v === 1) {
  571. console.log(this.selectionList);
  572. var arr = [];
  573. this.selectionList.map((o) => {
  574. arr.push(o.id);
  575. });
  576. let _this = this;
  577. //整理list并且执行删除
  578. this.$http({
  579. url: "/market/cOnlineExcel/delExcel",
  580. method: "post",
  581. headers: {
  582. "Content-Type": "application/json",
  583. },
  584. data: {
  585. delIds: arr
  586. },
  587. }).then((res) => {
  588. if (res.data.result === 1) {
  589. _this.$message({
  590. message: res.data.desc,
  591. type: 'error'
  592. });
  593. } else {
  594. _this.$message({
  595. message: '删除成功',
  596. type: 'success'
  597. });
  598. _this.getList({}, this.pageSize);
  599. }
  600. });
  601. }
  602. },
  603. //删除确认框
  604. delExcel() {
  605. this.delVisible = true;
  606. this.messTit = '该文件删除后将无法找回,确认删除吗?';
  607. },
  608. handleSelectionChange(val) {
  609. this.selectionList = val;
  610. this.selectionSize = val.length;
  611. console.log(this.selectionSize);
  612. },
  613. cancelSelection() {
  614. this.selectionList = [];
  615. this.selectionSize = 0;
  616. this.$refs.multipleTable.clearSelection();
  617. },
  618. getList(v, n) {
  619. var queryListType = "1";
  620. var queryFolderId = "";
  621. if (this.nowFolder.type) {
  622. queryListType = this.nowFolder.type;
  623. queryFolderId = this.nowFolder.functionCode;
  624. }
  625. this.pageSize = n;
  626. this.loading = true;
  627. this.tableData = [];
  628. let _this = this;
  629. this.$http({
  630. url: "/market/cOnlineExcel/getExcelList",
  631. method: "post",
  632. headers: {
  633. "Content-Type": "application/json",
  634. "page": '{"pageNo":"' + n + '","pageSize":"10"}'
  635. },
  636. data: {
  637. queryListType: queryListType,
  638. queryFolderId: queryFolderId
  639. },
  640. }).then((res) => {
  641. this.tableData = res.data.data;
  642. this.total = res.data.totalRecord;
  643. this.loading = false;
  644. });
  645. },
  646. addNewFolder() {
  647. console.log(this.nowFolder);
  648. var _this = this;
  649. if (!_this.infolist.name) {
  650. _this.$message({
  651. message: '文件夹名称不能为空',
  652. type: 'error'
  653. });
  654. return;
  655. }
  656. var upFolderId = '';
  657. if (this.nowFolder.type == "4") {
  658. upFolderId = this.nowFolder.functionCode;
  659. }
  660. this.$http({
  661. url: '/market/cOnlineExcel/addNewFolder',
  662. method: "post",
  663. headers: {
  664. "Content-Type": "application/json",
  665. },
  666. data: {
  667. name: _this.infolist.name,
  668. upFolderId: upFolderId
  669. },
  670. }).then((res) => {
  671. if (res.data.result === 1) {
  672. _this.$message({
  673. message: res.data.desc,
  674. type: 'error'
  675. });
  676. } else {
  677. _this.$message({
  678. message: '成功',
  679. type: 'success'
  680. });
  681. _this.getTreeData();
  682. _this.addFolderStatus = false;
  683. _this.addNewStatus = false;
  684. _this.infolist = {};
  685. }
  686. });
  687. },
  688. //功能栏
  689. iconCli(v) {
  690. if (v === 1) {
  691. this.getList(this.params, this.pageSize);
  692. }
  693. if (v === 2) {
  694. this.fullscreen = !this.fullscreen
  695. }
  696. },
  697. testExcel() {
  698. document.getElementById("excelIframe").src = "";
  699. },
  700. // 搜索按钮事件
  701. searchMenu() {
  702. this.$refs.tree.filter(this.filterText);
  703. },
  704. // 树形图 复选框监听事件
  705. checkChange(a, b, c, d) {
  706. this.checkedNodes = b.checkedNodes;
  707. },
  708. // 点击树节点事件
  709. nodeClick(a, b, c, d) {
  710. console.log(a);
  711. this.showExcel = false;
  712. this.nowFolder = a;
  713. this.tooltit = '在线文档-' + a.functionName;
  714. this.getList({}, 1);
  715. },
  716. // tree过滤方法
  717. filterNode(value, data) {
  718. if (!value) return true;
  719. return data.functionName.indexOf(value) !== -1;
  720. },
  721. // 分页
  722. currchange(v) {
  723. this.pageSize = v;
  724. this.getList({}, this.pageSize);
  725. },
  726. getTreeData(data) {
  727. this.loading = true;
  728. this.$http({
  729. url: "/market/cOnlineExcel/getFolderList",
  730. method: "post",
  731. headers: {
  732. "Content-Type": "application/json",
  733. },
  734. data: data,
  735. }).then((res) => {
  736. this.formatterData(res.data);
  737. });
  738. },
  739. // 格式化树形图数据
  740. formatterData(data) {
  741. var arr = [];
  742. var _this = this;
  743. data.map((o) => {
  744. var obj1 = {};
  745. if (o.systemflag !== "1") {
  746. if (o.parentCode) {
  747. var cvTag = o.parentCode == "Top";
  748. } else {
  749. cvTag = false;
  750. }
  751. if (cvTag) {
  752. //判断是否是第一层
  753. obj1 = o;
  754. obj1.icon = o.icon || "layui-icon layui-icon-ok-circle";
  755. obj1.target = "_self";
  756. obj1.checked = o.checked;
  757. obj1.parent = "1";
  758. obj1.children = menuSon(o.functionCode);
  759. arr.push(obj1);
  760. }
  761. }
  762. });
  763. function menuSon(id) {
  764. var arr1 = [];
  765. data.map((o) => {
  766. var obj1 = {};
  767. var myId = o.functionCode;
  768. if (o.parentCode == id) {
  769. //找到是父亲的儿子数据
  770. obj1 = o;
  771. obj1.target = "_self";
  772. var tag = sonIs(myId); //判断是否有儿子
  773. if (tag) {
  774. //有儿子
  775. obj1.children = menuSon(myId); //调用孙生成节点函数
  776. } else {
  777. obj1.children = "";
  778. }
  779. arr1.push(obj1);
  780. }
  781. });
  782. return arr1;
  783. }
  784. function sonIs(id) {
  785. //查找是否有儿子
  786. var tag = false;
  787. data.map((o) => {
  788. if (o.parentCode == id) {
  789. tag = true;
  790. }
  791. });
  792. return tag;
  793. }
  794. this.menuList = arr;
  795. //复制一份给移动文件夹用
  796. this.moveMenuList = [];
  797. arr.map((o) => {
  798. if (o.type == '4') {
  799. this.moveMenuList.push(o);
  800. }
  801. })
  802. this.menuStatus = true;
  803. this.loading = false;
  804. },
  805. getUrlKey(name) {
  806. return (
  807. decodeURIComponent(
  808. (new RegExp("[?|&]" + name + "=" + "([^&;]+?)(&|#|;|$)").exec(
  809. location.href
  810. ) || [, ""])[1].replace(/\+/g, "%20")
  811. ) || null
  812. );
  813. },
  814. processFullScreen() {
  815. this.excelFullScreen = !this.excelFullScreen;
  816. }
  817. },
  818. mounted() {
  819. this.woNo = this.getUrlKey("id")//获取地址栏参数
  820. console.log(this.woNo);
  821. if (this.woNo != null) {
  822. this.processWoNo();
  823. }
  824. // this.woNo = this.$route.query.woNo
  825. // if (this.woNo != null) {
  826. // this.processWoNo();
  827. // } else {
  828. //
  829. // }
  830. this.getList({}, 1);
  831. this.getTreeData();
  832. },
  833. created() {
  834. window['fullScreen'] = (rp) => {
  835. this.processFullScreen(rp);
  836. }
  837. window['backToExcelList'] = (rp) => {
  838. this.closeExcel(rp);
  839. }
  840. //方法里写了字母含义
  841. window['shareExcel'] = (a, b, c, d, e, f, g) => {
  842. this.shareExcel(a, b, c, d, e, f, g);
  843. }
  844. },
  845. name: "index"
  846. }
  847. </script>
  848. <style lang="scss" scoped>
  849. .container {
  850. background-color: #f0f2f5;
  851. .el-col {
  852. background-color: white;
  853. padding: 0 20px;
  854. }
  855. .container-box {
  856. padding: 0;
  857. margin-top: 0;
  858. height: 100%;
  859. }
  860. .main-box {
  861. overflow: hidden;
  862. display: flex;
  863. >div {
  864. background-color: white;
  865. }
  866. .inner-left {
  867. width: 20%;
  868. padding: 0 20px;
  869. .canel-style {
  870. color: #1890ff;
  871. cursor: pointer;
  872. padding-left: 10px;
  873. }
  874. }
  875. .inner-right {
  876. width: 80%;
  877. margin-left: 1%;
  878. }
  879. }
  880. }
  881. .el-button+.el-button {
  882. margin-left: 20px;
  883. }
  884. .button-list {
  885. padding: 30px 0 10px 0;
  886. }
  887. .choice-style {
  888. background: rgb(255, 255, 255);
  889. }
  890. .tree-action {
  891. bottom: 0;
  892. width: 100%;
  893. // border-top: 1px solid #e8e8e8;
  894. padding: 10px 16px;
  895. text-align: left;
  896. left: 0;
  897. background: #fff;
  898. border-radius: 0 0 2px 2px;
  899. }
  900. .tree-line {
  901. .el-tree-node__content {
  902. padding-left: 0 !important;
  903. }
  904. .el-tree-node__expand-icon.is-leaf {
  905. display: none !important;
  906. }
  907. .el-tree-node {
  908. position: relative;
  909. padding-left: 16px; // 缩进量
  910. }
  911. .el-tree-node__children {
  912. padding-left: 16px; // 缩进量
  913. }
  914. // 竖线
  915. .el-tree-node::before {
  916. content: "";
  917. height: 100%;
  918. width: 1px;
  919. position: absolute;
  920. left: -3px;
  921. top: -17px;
  922. border-width: 1px;
  923. border-left: 1px dashed #52627c;
  924. }
  925. // 当前层最后一个节点的竖线高度固定
  926. .el-tree-node:last-child::before {
  927. height: 38px; // 可以自己调节到合适数值
  928. }
  929. // 横线
  930. .el-tree-node::after {
  931. content: "";
  932. width: 24px;
  933. height: 20px;
  934. position: absolute;
  935. left: -3px;
  936. top: 20px;
  937. border-width: 1px;
  938. border-top: 1px dashed #52627c;
  939. }
  940. // 去掉最顶层的虚线,放最下面样式才不会被上面的覆盖了
  941. &>.el-tree-node::after {
  942. border-top: none;
  943. }
  944. &>.el-tree-node::before {
  945. border-left: none;
  946. }
  947. // 展开关闭的icon
  948. .el-tree-node__expand-icon {
  949. font-size: 16px;
  950. // 叶子节点(无子节点)
  951. &.is-leaf {
  952. color: transparent;
  953. // display: none; // 也可以去掉
  954. }
  955. }
  956. }
  957. .ant-alert-info {
  958. background-color: #e6f7ff;
  959. border: 1px solid #91d5ff;
  960. }
  961. .ant-alert {
  962. box-sizing: border-box;
  963. margin: 0;
  964. padding: 0;
  965. color: rgb(0, 0, 0);
  966. font-size: 14px;
  967. font-variant: tabular-nums;
  968. line-height: 1.5;
  969. list-style: none;
  970. font-feature-settings: "tnum";
  971. position: relative;
  972. padding: 8px 15px 8px 37px;
  973. word-wrap: break-word;
  974. border-radius: 4px;
  975. }
  976. .containerr {
  977. background: #fff;
  978. height: calc(100vh);
  979. width: calc(100vw);
  980. position: fixed;
  981. left: 0;
  982. top: 0;
  983. overflow: hidden;
  984. }
  985. .tabbox {
  986. margin: 15px;
  987. }
  988. .online {
  989. width: 100%;
  990. .el-select {
  991. width: calc(100% - 100px);
  992. }
  993. span {
  994. vertical-align: top;
  995. }
  996. .el-textarea {
  997. width: calc(100% - 100px);
  998. }
  999. .tree {
  1000. width: calc(50% - 60px);
  1001. display: inline-block;
  1002. margin-right: 20px;
  1003. height: 300px;
  1004. overflow-y: scroll;
  1005. .el-icon-error {
  1006. float: right;
  1007. font-size: 20px;
  1008. margin-top: 9px;
  1009. cursor: pointer;
  1010. }
  1011. }
  1012. .treeUser {
  1013. margin: 0;
  1014. border: 1px solid #ddd;
  1015. p {
  1016. background: #f4f4f4;
  1017. padding: 0 20px;
  1018. margin-bottom: 5px;
  1019. }
  1020. }
  1021. .treeUserb {
  1022. width: calc(100% - 100px);
  1023. border: 1px solid #ddd;
  1024. background: #f4f4f4;
  1025. border-radius: 3px;
  1026. height: auto;
  1027. overflow: hidden;
  1028. p {
  1029. display: inline-block;
  1030. padding: 0 20px;
  1031. margin-bottom: 5px;
  1032. }
  1033. }
  1034. }
  1035. </style>