index.vue 37 KB

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