index.vue 37 KB

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