index.vue 37 KB

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