index.vue 35 KB

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