index.vue 35 KB

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