index.vue 37 KB

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