index.vue 36 KB

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