index.vue 50 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292
  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" @node-click="nodeClick" :filter-node-method="filterNode"
  21. node-key="functionCode" style="width: 300px">
  22. <div class="custom-tree-node" slot-scope="{ node }">
  23. <div style="display: flex;align-items: center;">
  24. <div v-if="node.data.type == 4" style="color: #009cff" class="iconfont icon-wenjianjia">
  25. </div>
  26. <div v-else style="color: #fdb441" class="iconfont icon-wenjian"></div>
  27. <div
  28. :style="node.data.hasOwnProperty('parent') ? 'font-size:14px;padding-left:5px' : 'font-size:12px;padding-left:5px'">
  29. {{
  30. node.data.functionName
  31. }}</div>
  32. </div>
  33. </div>
  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;display: flex;" class="bigbtns">
  42. <el-button style="margin:0 20px 0 20px;" class="btn-check" size="medium" type="primary"
  43. @click="addNewStatus = true" icon="el-icon-plus">新建
  44. </el-button>
  45. <div style="height: 100%;">
  46. <myUpload style="" @uploadBack="uploadBack" :fileInfo="fileInfo"
  47. :fileList="fileInfo.fileList" :filenowFolder="nowFolder">
  48. </myUpload>
  49. </div>
  50. <el-button v-if="nowFolder.type == '4'" style="margin:0 20px 0 20px;" type="danger"
  51. icon="el-icon-delete" @click="remove()" size="medium">删除文件夹</el-button>
  52. </div>
  53. <div style="margin-top: 20px;float: right;margin-right: 20px" class="bigbtns"
  54. v-if="selectionSize != 0">
  55. <el-button style="margin-left: 5px;" class="btn-check" size="small" type="primary"
  56. @click="delExcel()">删除
  57. </el-button>
  58. <el-button style="margin-left: 5px;" class="btn-check" size="small" type="primary"
  59. @click="cancelSelection()">取消
  60. </el-button>
  61. <el-button style="margin-left: 5px;" class="btn-check" size="small" type="primary"
  62. @click="moveStatus = true">移动到
  63. </el-button>
  64. </div>
  65. </div>
  66. <div class="tabbox" v-if="showExcel == false">
  67. <div id="selectionList" style="height: 30px">
  68. <span v-if="selectionSize != 0">已选{{ selectionSize }}项</span>
  69. </div>
  70. <el-table height="calc(100% - 60px)" class="com-table" ref="multipleTable" :data="tableData"
  71. tooltip-effect="dark" size="small" border style="width: 100%" v-loading="loading"
  72. @selection-change="handleSelectionChange">
  73. <el-table-column type="selection" width="45"></el-table-column>
  74. <el-table-column prop="fileName" label="名称">
  75. <template slot-scope="scope">
  76. <svg v-if="scope.row.fileType == 'pptx' || scope.row.fileType == 'ppt'"
  77. t="1681371514824" class="icon" viewBox="0 0 1024 1024" version="1.1" p-id="3804"
  78. width="200" height="200">
  79. <path
  80. d="M145.6 0C100.8 0 64 36.8 64 81.6v860.8C64 987.2 100.8 1024 145.6 1024h732.8c44.8 0 81.6-36.8 81.6-81.6V324.8L657.6 0h-512z"
  81. fill="#E34221" p-id="3805"></path>
  82. <path d="M960 326.4v16H755.2s-100.8-20.8-99.2-108.8c0 0 4.8 92.8 97.6 92.8H960z"
  83. fill="#DC3119" p-id="3806"></path>
  84. <path d="M657.6 0v233.6c0 25.6 17.6 92.8 97.6 92.8H960L657.6 0z" fill="#FFFFFF"
  85. opacity=".5" p-id="3807"></path>
  86. <path
  87. d="M304 784h-54.4v67.2c0 6.4-4.8 11.2-11.2 11.2-6.4 0-12.8-4.8-12.8-11.2V686.4c0-9.6 8-17.6 17.6-17.6H304c38.4 0 59.2 25.6 59.2 57.6S340.8 784 304 784z m-3.2-94.4h-51.2v73.6h51.2c22.4 0 38.4-16 38.4-36.8 0-22.4-16-36.8-38.4-36.8zM480 784h-54.4v67.2c0 6.4-4.8 11.2-11.2 11.2-6.4 0-11.2-4.8-11.2-11.2V686.4c0-9.6 6.4-17.6 16-17.6H480c38.4 0 59.2 25.6 59.2 57.6S518.4 784 480 784z m-3.2-94.4h-49.6v73.6h49.6c22.4 0 38.4-16 38.4-36.8 0-22.4-16-36.8-38.4-36.8z m225.6 0h-52.8v161.6c0 6.4-4.8 11.2-11.2 11.2-6.4 0-12.8-4.8-12.8-11.2V689.6h-51.2c-6.4 0-11.2-4.8-11.2-11.2 0-4.8 4.8-9.6 11.2-9.6h128c6.4 0 11.2 4.8 11.2 11.2 0 4.8-4.8 9.6-11.2 9.6z"
  88. fill="#FFFFFF" p-id="3808"></path>
  89. </svg>
  90. <svg v-if="scope.row.fileType == 'docx' || scope.row.fileType == 'doc'"
  91. t="1681371921638" class="icon" viewBox="0 0 1024 1024" version="1.1" p-id="4821"
  92. width="200" height="200">
  93. <path
  94. d="M594.944 0l335.12448 341.31968v563.2c0 65.9968-52.50048 119.48032-117.29408 119.48032H209.54624c-64.7936 0-117.2992-53.5296-117.2992-119.48032V119.48032C92.25216 53.48352 144.75776 0 209.55136 0H594.944z"
  95. fill="#5895FF" p-id="4822"></path>
  96. <path
  97. d="M930.06848 341.31968h-211.9168c-64.74752 0-123.20768-59.48928-123.20768-125.4912V0l335.12448 341.31968z"
  98. fill="#FFFFFF" fill-opacity=".4" p-id="4823"></path>
  99. <path
  100. d="M427.37664 725.31968V768H259.8144v-42.68032h167.56224zM594.944 640v42.68032H259.8144V640H594.944z m0-85.31968v42.63936H259.8144v-42.63936H594.944z m0-85.36064V512H259.8144v-42.68032H594.944z"
  101. fill="#FFFFFF" p-id="4824"></path>
  102. </svg>
  103. <svg v-if="scope.row.fileType == 'xlsx' || scope.row.fileType == 'xls'"
  104. t="1681372014830" class="icon" viewBox="0 0 1024 1024" version="1.1" p-id="5842"
  105. width="200" height="200">
  106. <path d="M745 184.3V1H93v1022.5h836V184.3z" fill="#72DCA2" p-id="5843"></path>
  107. <path d="M928.8 184h-184V0.8" fill="#A9FFCE" p-id="5844"></path>
  108. <path
  109. d="M500.8 476.2l76.6-131h67.7L532.5 537.9 445.7 686H378l122.8-209.8z m-0.7 70.3l-6.6-11-112.7-190.3h67.7L525 474.4l8.9 15.2L650.3 686h-67.7l-82.5-139.5z"
  110. fill="#FCFCFC" p-id="5845"></path>
  111. </svg>
  112. {{ scope.row.fileName }}
  113. </template>
  114. </el-table-column>
  115. <el-table-column prop="opTime" label="创建时间" align="center">
  116. </el-table-column>
  117. <el-table-column prop="addUserDept" label="创建科室" align="center">
  118. </el-table-column>
  119. <el-table-column prop="addUserName" label="创建人" align="center">
  120. </el-table-column>
  121. <el-table-column label="操作" width="200px" align="center" fixed="right">
  122. <template slot-scope="scope">
  123. <el-button type="primary" icon="el-icon-edit" @click="moveToEdit(scope.row)"
  124. size="small" style="height: 50%;">编辑</el-button>
  125. <el-button type="primary" icon="el-icon-share" plain
  126. v-if="scope.row.addUserId == shareadmin" @click="shareBtn(scope.row)" size="small"
  127. style="height: 50%;">分享</el-button>
  128. </template>
  129. </el-table-column>
  130. </el-table>
  131. <el-pagination ref="pagination" class="pageBox" @current-change="currchange"
  132. layout="prev, pager, next" background :total="total">
  133. </el-pagination>
  134. </div>
  135. <div class="container" id="container" v-else>
  136. <fullscreen :fullscreen.sync="excelFullScreen" class="container">
  137. <iframe id="excelIframe" height="100%" width="100%" src="/static/views/onlineShareExcels.html"
  138. frameborder="0"></iframe>
  139. </fullscreen>
  140. </div>
  141. </div>
  142. </div>
  143. <el-dialog :title="'新建'" :visible.sync="addNewDiaStatus" width="50%" :destroy-on-close="true"
  144. :modal-append-to-body="false" :close-on-click-modal="false" v-if="addNewDiaStatus">
  145. <div v-loading="loading">
  146. <el-form :model="form" ref="form">
  147. <div class="online">
  148. <el-form-item prop="fileName">
  149. <span>文档名称</span>
  150. <el-input v-model="form.fileName" placeholder="文档名称" :disabled="disableStatus"></el-input>
  151. </el-form-item>
  152. <el-form-item prop="docType">
  153. <span>文档类型</span>
  154. <el-select v-model="form.docType" placeholder="请选择文档类型" :disabled="disableStatus"
  155. style="width:100% ;">
  156. <el-option label="Word" value="word"></el-option>
  157. <el-option label="Excel" value="cell"></el-option>
  158. <el-option label="PPT" value="slide"></el-option>
  159. </el-select>
  160. </el-form-item>
  161. </div>
  162. </el-form>
  163. <div slot="footer" class="dialog-footer myfooter">
  164. <el-button type="primary" @click="addExcel()">确 定</el-button>
  165. <el-button @click="addNewDiaStatus = false">取 消</el-button>
  166. </div>
  167. </div>
  168. </el-dialog>
  169. <el-dialog :title="'新建'" :visible.sync="addNewStatus" width="450px" :destroy-on-close="true"
  170. :modal-append-to-body="false" :close-on-click-modal="false">
  171. <div>
  172. <div style="padding-bottom: 30px;display:flex">
  173. <div style="width: 85px;display: inline-block;cursor: pointer"
  174. @click="addNewDiaStatus = true; form = {}">
  175. <span class="iconfont icon-wenjian" style="font-size: 80px;color: dodgerblue"></span>
  176. <p style="margin-left: 20px;margin-top: 10px">在线文档</p>
  177. </div>
  178. <div style="width: 85px;display: inline-block;margin-left: 70px;cursor: pointer">
  179. <myUpload style="" @uploadBack=" uploadBack " :fileInfo=" fileInfo2 "
  180. :fileList=" fileInfo2.fileList " :filenowFolder=" nowFolder ">
  181. </myUpload>
  182. </div>
  183. <div style="width: 85px;display: inline-block;margin-left: 70px;cursor: pointer"
  184. @click=" addFolderStatus = true ">
  185. <span class="iconfont icon-wenjianjia" style="font-size: 80px;color: dodgerblue"></span>
  186. <p style="margin-left: 20px;margin-top: 10px">文件夹</p>
  187. </div>
  188. </div>
  189. </div>
  190. </el-dialog>
  191. <el-dialog :title=" '新增文件夹' " :visible.sync=" addFolderStatus " width="50%" :destroy-on-close=" true "
  192. :modal-append-to-body=" false " :close-on-click-modal=" false ">
  193. <div v-loading=" loading ">
  194. <el-form :model=" infolist " ref="infolist">
  195. <div class="online">
  196. <el-form-item prop="name">
  197. <span>文件夹名称</span>
  198. <el-input v-model=" infolist.name " placeholder="文件夹名称"
  199. :disabled=" disableStatus "></el-input>
  200. </el-form-item>
  201. </div>
  202. </el-form>
  203. <div slot="footer" class="dialog-footer myfooter">
  204. <el-button type="primary" @click=" addNewFolder() ">确 定</el-button>
  205. <el-button @click=" addFolderStatus = false ">取 消</el-button>
  206. </div>
  207. </div>
  208. </el-dialog>
  209. <el-dialog :title=" '分享选项' " :visible.sync=" shareStatus " width="450px" :destroy-on-close=" true "
  210. :modal-append-to-body=" false " :close-on-click-modal=" false ">
  211. <div style="margin-left: 30px;padding-bottom: 20px" v-loading=' shareLoading '>
  212. <!-- <el-button type="primary" @click="processExcelShare(1)" plain>仅我可编辑</el-button> -->
  213. <el-button type="primary" @click=" openOADialog(2) " plain>部门内所有人可编辑</el-button>
  214. <el-button type="primary" @click=" checkexa = true " plain>指定人可编辑</el-button>
  215. </div>
  216. </el-dialog>
  217. <el-dialog title="选择填报人" :visible.sync=" checkexa " width="100%" :destroy-on-close=" true "
  218. :modal-append-to-body=" false " :close-on-click-modal=" false " v-loading=" shareLoading ">
  219. <div>
  220. <el-form :model=" exaList " ref="addInfoList">
  221. <el-form-item prop="processUserId" class="info-line online">
  222. <!-- <span style="width: 80px;margin-right: 20px">审批人员</span> -->
  223. <div style="max-height:500px ;">
  224. <!-- <deptTreeUserNew class="tree" @treeCheck="treeCheckonly" :defaultList="defaultList"
  225. :type="depttype" :closeList="closeList"></deptTreeUserNew> -->
  226. <deptTreeOnly @treeCheck=" treeCheckonly " :defaultList=" defaultList " :type=" depttype "
  227. :closeList=" closeList ">
  228. </deptTreeOnly>
  229. </div>
  230. <!-- <div class="tree treeUser">
  231. <p v-for="(item, index) in treeList" :key="index">{{ item.receiveName }}
  232. <i @click="deletes(item, index)" class="el-icon-error"></i>
  233. </p>
  234. </div> -->
  235. </el-form-item>
  236. </el-form>
  237. <div slot="footer" style="text-align: right;padding-bottom: 20px">
  238. <el-button type="primary" @click=" checkProcessUser(3) ">确 定</el-button>
  239. <el-button @click=" checkexa = false ">取 消</el-button>
  240. </div>
  241. </div>
  242. </el-dialog>
  243. <el-dialog title="移动到" :visible.sync=" moveStatus " width="500px" :destroy-on-close=" true "
  244. :modal-append-to-body=" false " :close-on-click-modal=" false ">
  245. <div>
  246. <el-tree ref="tree" class="tree-line" :expand-on-click-node=" false " :auto-expand-parent=" true "
  247. :default-expand-all=" true " :default-checked-keys=" checkedMenu " :data=" moveMenuList "
  248. @check=" checkChange " @node-click=" folderNodeClick " node-key="functionCode"
  249. @expand-on-click-node=" false ">
  250. <span class="custom-tree-node" slot-scope="{ node }">
  251. <span>
  252. <span v-if=" node.data.type == 4 " style="color: #009cff"
  253. class="iconfont icon-wenjianjia"></span>
  254. <span v-else style="color: #fdb441" class="iconfont icon-wenjian"></span>
  255. <span
  256. :style=" node.data.hasOwnProperty('parent') ? 'font-size:14px;padding-left:5px' : 'font-size:12px;padding-left:5px' ">{{
  257. node.data.functionName
  258. }}</span>
  259. </span>
  260. </span>
  261. </el-tree>
  262. <div slot="footer" style="text-align: right;padding-bottom: 20px">
  263. <el-button type="primary" @click=" addFolderStatus = true " style="margin-right: 100px"
  264. icon="el-icon-plus">新建文件夹
  265. </el-button>
  266. <el-button type="primary" @click=" moveExcel() ">确 定</el-button>
  267. <el-button @click=" moveStatus = false ">取 消</el-button>
  268. </div>
  269. </div>
  270. </el-dialog>
  271. <el-dialog :modal=" false " :title=" officetitle " :visible.sync=" officeStatus " style="height:100% ;"
  272. :fullscreen=" true " width="100%" height="100%" center>
  273. <div id="DocEditor" v-if=" officeStatus ">
  274. <onlyoffice-editor editorId="DocEditor" :src=" src " :config=" config " @ready=" onReady " />
  275. </div>
  276. </el-dialog>
  277. <myMessage :messTit=' messTit ' @closeMessage=" processDel " :centerDialogVisible=" delVisible "
  278. v-if=" delVisible ">
  279. </myMessage>
  280. <myMessageRadio :messTit=' oaTitle ' @closeMessage=" processOa " :centerDialogVisible=" oaVisible "
  281. v-if=" oaVisible " yesBtnName="是" noBtnName="否" ok-btn-name="提交"></myMessageRadio>
  282. </div>
  283. </fullscreen>
  284. </template>
  285. <script>
  286. import LuckyExcel from "luckyexcel";
  287. import getConfig from '../../../config/dev'
  288. import pForm from "../../../components/p-form";
  289. import toolList from "../../../components/toolList";
  290. import myMessage from "../../../components/myMessage.vue";
  291. import myMessageNew from "../../../components/myMessageNew.vue";
  292. import myMessageRadio from "../../../components/myMessageRadio.vue";
  293. import deptTreeUserNew from "../../../components/deptTreeUserNew.vue"
  294. import deptTreeOnly from "../../../components/newTree.vue";
  295. import { ajaxJson } from '../../../../public/static/js/util'
  296. import myUpload from '../../../components/uploadOnlineOffice'
  297. export default {
  298. components: {
  299. myUpload,
  300. pForm,
  301. toolList,
  302. myMessage,
  303. myMessageNew,
  304. myMessageRadio,
  305. deptTreeUserNew,
  306. deptTreeOnly,
  307. },
  308. data() {
  309. return {
  310. form: {},
  311. shareadmin: '',
  312. officetitle: '',
  313. officeStatus: false,
  314. addNewDiaStatus: false,
  315. fileInfo: {
  316. limit: 1,
  317. type: 'btn',
  318. typename: '导入',
  319. urlType: 'onlineExcel',
  320. // url: getConfig().OFFICE_URL + '/office/restfile/upload',
  321. url: '/market/cOnlineSyncExcel/upload',
  322. fileList: [],
  323. },
  324. fileInfo2: {
  325. limit: 1,
  326. type: 'btn1',
  327. typename: '在线导入',
  328. urlType: 'onlineExcel',
  329. // url: getConfig().OFFICE_URL + '/office/restfile/upload',
  330. url: '/market/cOnlineSyncExcel/upload',
  331. fileList: [],
  332. },
  333. fullscreen: false,
  334. filterText: "", // tree搜索value
  335. actionName: "", // 当前选择节点名称
  336. menuList: [], // tree数据源
  337. checkedMenu: [], // 选中节点的functionCode
  338. checkedNodes: [], // 选中节点的node值
  339. roleData: "", // 某一条数据
  340. showExcel: false,
  341. tableData: [],
  342. loading: false,
  343. total: 0,
  344. pageSize: 1,
  345. addNewStatus: false,
  346. tooltit: '在线文档-文件管理',
  347. addFolderStatus: false,
  348. addExcelStatus: false,
  349. infolist: {},
  350. disableStatus: false,
  351. nowFolder: {},
  352. selectionList: [],
  353. selectionSize: 0,
  354. delVisible: false,
  355. messTit: '',
  356. shareStatus: false,
  357. excelJson: '',
  358. editFrom: '',
  359. editTo: '',
  360. editStatus: '',
  361. excelName: '',
  362. excelId: '',
  363. checkexa: false,
  364. exaList: {},
  365. //审批人用到的
  366. treeListonly: {},
  367. defaultList: [],
  368. treeList: [],
  369. closeList: false,
  370. depttype: 0,
  371. shareType: '',
  372. oaVisible: false,
  373. oaTitle: '',
  374. oaType: '',
  375. moveStatus: false,
  376. //移动文件夹tree相关
  377. nowMoveFolder: {},
  378. shareLoading: false,
  379. woNo: '',
  380. moveMenuList: [],
  381. addShareType: 0,
  382. excelFullScreen: false,
  383. }
  384. },
  385. methods: {
  386. shareBtn(row) {
  387. this.shareStatus = true;
  388. this.excelId = row.id
  389. // this.addShareType = '2'
  390. },
  391. remove() {
  392. let _this = this
  393. console.log(this.nowFolder);
  394. if (this.tableData.length > 0) {
  395. this.$message({
  396. message: "文件夹中有数据,禁止删除!",
  397. type: "error",
  398. });
  399. } else {
  400. if (this.nowFolder.children == '') {
  401. this.$confirm("即将删除文件夹, 是否删除?", "提示", {
  402. confirmButtonText: "确定",
  403. cancelButtonText: "取消",
  404. type: "warning",
  405. })
  406. .then(() => {
  407. this.$http({
  408. url: '/market/cOnlineSyncExcel/delFolder',
  409. method: "post",
  410. headers: {
  411. "Content-Type": "application/json",
  412. },
  413. data: {
  414. id: this.nowFolder.id,
  415. },
  416. }).then((res) => {
  417. if (res.data.desc == 'success') {
  418. this.$message({
  419. message: '删除成功',
  420. type: 'success'
  421. });
  422. console.log(res);
  423. this.tooltit = '在线文档-文件管理'
  424. this.nowFolder = {}
  425. this.getTreeData();
  426. this.getList({}, 1);
  427. } else {
  428. this.$message({
  429. message: red.data.desc,
  430. type: 'error'
  431. });
  432. }
  433. });
  434. })
  435. .catch(() => { });
  436. } else {
  437. this.$message({
  438. message: "文件夹中存在子文件夹,禁止删除!",
  439. type: "error",
  440. });
  441. }
  442. }
  443. },
  444. uploadBack(e) {
  445. this.form = {};
  446. this.getList({}, 1);
  447. this.addNewStatus = false
  448. },
  449. onReady(editor) {
  450. console.log('[ editor ] >', editor)
  451. },
  452. currentPage(e) {
  453. console.log(e);
  454. let list = e.filter((item, index) =>
  455. item.fileName.includes(this.searchData)
  456. )
  457. this.firstTable.data = list.filter((item, index) =>
  458. index < this.page * this.limit && index >= this.limit * (this.page - 1)
  459. )
  460. },
  461. changeNum(e) {
  462. this.page = e;
  463. this.currentPage(this.dataList)
  464. },
  465. processWoNo() {
  466. console.log(this.woNo);
  467. var _this = this;
  468. this.$http({
  469. url: '/market/cOnlineSyncExcel/processWoNo',
  470. method: "post",
  471. headers: {
  472. "Content-Type": "application/json",
  473. },
  474. data: {
  475. id: _this.woNo,
  476. },
  477. }).then((res) => {
  478. if (res.data.result === 1) {
  479. if (res.data.result != 'WONOEMPTY') {
  480. _this.$message({
  481. message: res.data.desc,
  482. type: 'error'
  483. });
  484. }
  485. } else {
  486. // moveToEdit(e)
  487. // _this.$message({
  488. // message: '请填写完毕后点击“保存”按钮',
  489. // type: 'success'
  490. // });
  491. // var id = res.data.desc;
  492. // //放入id,切换到excel模式
  493. // document.getElementById('excelId').setAttribute("value", id);
  494. // _this.showExcel = true;
  495. // console.log(_this.showExcel);
  496. }
  497. });
  498. this.$http({
  499. url: '/market/cOnlineSyncExcel/getExcleInfoByOaId',
  500. method: "post",
  501. headers: {
  502. "Content-Type": "application/json",
  503. },
  504. data: {
  505. id: _this.woNo,
  506. },
  507. }).then((res) => {
  508. this.moveToEdit(res.data.body)
  509. });
  510. },
  511. moveExcel() {
  512. var _this = this;
  513. var folderId = "";
  514. if (this.nowFolder.type == '4') {
  515. folderId = this.nowFolder.functionCode;
  516. }
  517. var arr = [];
  518. this.selectionList.map((o) => {
  519. arr.push(o.id);
  520. });
  521. this.$http({
  522. url: '/market/cOnlineSyncExcel/moveExcel',
  523. method: "post",
  524. headers: {
  525. "Content-Type": "application/json",
  526. },
  527. data: {
  528. moveIds: arr,
  529. moveFolderId: folderId
  530. },
  531. }).then((res) => {
  532. if (res.data.result === 1) {
  533. _this.$message({
  534. message: res.data.desc,
  535. type: 'error'
  536. });
  537. } else {
  538. _this.$message({
  539. message: res.data.desc,
  540. type: 'success'
  541. });
  542. _this.moveStatus = false;
  543. _this.tooltit = '在线文档-' + _this.nowFolder.functionName;
  544. _this.getList({}, this.pageSize);
  545. }
  546. });
  547. },
  548. // 点击树节点事件
  549. folderNodeClick(a, b, c, d) {
  550. this.nowFolder = a;
  551. },
  552. //检查是否选了填报人
  553. checkProcessUser(v) {
  554. let _this = this;
  555. if (_this.treeList.length == 0) {
  556. _this.$message({
  557. message: '请选择填报人',
  558. type: 'error'
  559. });
  560. } else {
  561. _this.openOADialog(v);
  562. }
  563. },
  564. //判断是否提交oa待办
  565. processOa(v) {
  566. console.log(v);
  567. if (v == 1) {
  568. this.oaType = 1;
  569. this.processExcelShare(this.shareType);
  570. } else if (v == 2) {
  571. this.oaType = 0;
  572. this.processExcelShare(this.shareType);
  573. }
  574. this.oaVisible = false;
  575. },
  576. //打开oa待办选项框
  577. openOADialog(shareType) {
  578. this.shareType = shareType;
  579. this.oaTitle = '是否要推送OA待办?';
  580. this.oaVisible = true;
  581. },
  582. //提交分享
  583. processExcelShare(shareType) {
  584. var deptList = [];
  585. var _this = this;
  586. _this.shareLoading = true;
  587. if (shareType == 3) {
  588. this.treeList.map((o) => {
  589. console.log(o);
  590. deptList.push(o.key);
  591. });
  592. }
  593. if (shareType == 1) {
  594. _this.shareType = 1;
  595. }
  596. console.log(deptList);
  597. console.log('oa:' + this.oaType);
  598. console.log('share:' + shareType);
  599. _this.$http({
  600. url: '/market/cOnlineSyncExcel/reShare',
  601. method: "post",
  602. headers: {
  603. "Content-Type": "application/json",
  604. },
  605. data: {
  606. id: _this.excelId,
  607. deptIds: deptList,
  608. oaType: _this.oaType,
  609. shareType: _this.shareType
  610. },
  611. }).then((res) => {
  612. _this.shareLoading = false;
  613. if (res.data.result === 1) {
  614. _this.$message({
  615. message: res.data.desc,
  616. type: 'error'
  617. });
  618. } else {
  619. _this.$message({
  620. message: '分享成功',
  621. type: 'success'
  622. });
  623. _this.oaVisible = false;
  624. _this.checkexa = false;
  625. _this.shareStatus = false;
  626. _this.showExcel = false;
  627. _this.getList({}, this.pageSize);
  628. }
  629. });
  630. },
  631. //删除填报人
  632. deletes(val, index) {
  633. this.treeList.splice(index, 1);
  634. this.closeList = this.treeList;
  635. },
  636. treeCheckonly(v) {
  637. this.treeList = v;
  638. },
  639. //打开excel
  640. moveToEdit(e) {
  641. this.officetitle = e.fileName
  642. let _this = this;
  643. _this.$util.ajaxJson("正在加载", getConfig().OFFICE_URL + "/office/restfile/edit", {
  644. id: e.id,
  645. edit: true,
  646. userId: JSON.parse(window.sessionStorage.userInfo).loginNo,
  647. userName: JSON.parse(window.sessionStorage.userInfo).loginName
  648. }, function (res) {
  649. let { docType, fileType, id, fileName, downloadUrl, userId, userName, configCallback, api } = res.body
  650. _this.src = api;
  651. let config = {
  652. documentType: docType,
  653. height: '100%',
  654. width: '100%',
  655. document: {
  656. fileType: fileType,
  657. key: id,
  658. title: _this.officetitle,
  659. url: downloadUrl
  660. },
  661. editorConfig: {
  662. user: {
  663. id: userId,
  664. name: userName
  665. },
  666. callbackUrl: decodeURIComponent(configCallback)
  667. }
  668. }
  669. if (res.code == 0) {
  670. _this.config = config;
  671. _this.officeStatus = true;
  672. console.log(this.config);
  673. }
  674. });
  675. },
  676. //新建excel
  677. addExcel() {
  678. var _this = this;
  679. _this.form.folderId = "";
  680. if (this.nowFolder.type == '4') {
  681. _this.form.folderId = this.nowFolder.functionCode;
  682. }
  683. this.$http({
  684. url: '/market/cOnlineSyncExcel/addExcel',
  685. method: "post",
  686. headers: {
  687. "Content-Type": "application/json",
  688. },
  689. data: _this.form,
  690. }).then((res) => {
  691. console.log(res);
  692. if (res.data.result === 1) {
  693. _this.$message({
  694. message: res.data.desc,
  695. type: 'error'
  696. });
  697. } else {
  698. _this.page = 1;
  699. _this.$message.success('新建成功')
  700. // _this.excelId = res.data.desc
  701. // _this.processExcelShare(1)
  702. _this.form = {}
  703. _this.getList({}, 1);
  704. _this.addNewDiaStatus = false;
  705. _this.addNewStatus = false;
  706. }
  707. });
  708. },
  709. //处理删除
  710. processDel(v) {
  711. this.delVisible = false;
  712. if (v === 1) {
  713. console.log(this.selectionList);
  714. var arr = [];
  715. this.selectionList.map((o) => {
  716. arr.push(o.id);
  717. });
  718. let _this = this;
  719. //整理list并且执行删除
  720. this.$http({
  721. url: "/market/cOnlineSyncExcel/delExcel",
  722. method: "post",
  723. headers: {
  724. "Content-Type": "application/json",
  725. },
  726. data: {
  727. delIds: arr
  728. },
  729. }).then((res) => {
  730. if (res.data.result === 1) {
  731. _this.$message({
  732. message: res.data.desc,
  733. type: 'error'
  734. });
  735. } else {
  736. _this.$message({
  737. message: '删除成功',
  738. type: 'success'
  739. });
  740. _this.getList({}, this.pageSize);
  741. }
  742. });
  743. }
  744. },
  745. //删除确认框
  746. delExcel() {
  747. this.delVisible = true;
  748. this.messTit = '该文件删除后将无法找回,确认删除吗?';
  749. },
  750. handleSelectionChange(val) {
  751. this.selectionList = val;
  752. this.selectionSize = val.length;
  753. console.log(this.selectionSize);
  754. },
  755. cancelSelection() {
  756. this.selectionList = [];
  757. this.selectionSize = 0;
  758. this.$refs.multipleTable.clearSelection();
  759. },
  760. getList(v, n) {
  761. var queryListType = "1";
  762. var queryFolderId = "";
  763. if (this.nowFolder.type) {
  764. queryListType = this.nowFolder.type;
  765. queryFolderId = this.nowFolder.functionCode;
  766. }
  767. this.pageSize = n;
  768. this.loading = true;
  769. this.tableData = [];
  770. let _this = this;
  771. this.$http({
  772. url: "/market/cOnlineSyncExcel/getExcelList",
  773. method: "post",
  774. headers: {
  775. "Content-Type": "application/json",
  776. "page": '{"pageNo":"' + n + '","pageSize":"10"}'
  777. },
  778. data: {
  779. queryListType: queryListType,
  780. queryFolderId: queryFolderId
  781. },
  782. }).then((res) => {
  783. this.tableData = res.data.data;
  784. this.tableData.map((item) => {
  785. item.fileType = item.id.split('.')[1]
  786. // console.log(item.id.split('.')[1]);
  787. })
  788. this.total = res.data.totalRecord;
  789. this.loading = false;
  790. });
  791. },
  792. addNewFolder() {
  793. console.log(this.nowFolder);
  794. var _this = this;
  795. if (!_this.infolist.name) {
  796. _this.$message({
  797. message: '文件夹名称不能为空',
  798. type: 'error'
  799. });
  800. return;
  801. }
  802. var upFolderId = '';
  803. if (this.nowFolder.type == "4") {
  804. upFolderId = this.nowFolder.functionCode;
  805. }
  806. this.$http({
  807. url: '/market/cOnlineSyncExcel/addNewFolder',
  808. method: "post",
  809. headers: {
  810. "Content-Type": "application/json",
  811. },
  812. data: {
  813. name: _this.infolist.name,
  814. upFolderId: upFolderId
  815. },
  816. }).then((res) => {
  817. if (res.data.result === 1) {
  818. _this.$message({
  819. message: res.data.desc,
  820. type: 'error'
  821. });
  822. } else {
  823. _this.$message({
  824. message: '成功',
  825. type: 'success'
  826. });
  827. _this.getTreeData();
  828. _this.addFolderStatus = false;
  829. _this.addNewStatus = false;
  830. _this.infolist = {};
  831. }
  832. });
  833. },
  834. //功能栏
  835. iconCli(v) {
  836. if (v === 1) {
  837. this.getList(this.params, this.pageSize);
  838. }
  839. if (v === 2) {
  840. this.fullscreen = !this.fullscreen
  841. }
  842. },
  843. testExcel() {
  844. document.getElementById("excelIframe").src = "";
  845. },
  846. // 搜索按钮事件
  847. searchMenu() {
  848. this.$refs.tree.filter(this.filterText);
  849. },
  850. // 树形图 复选框监听事件
  851. checkChange(a, b, c, d) {
  852. this.checkedNodes = b.checkedNodes;
  853. },
  854. // 点击树节点事件
  855. nodeClick(a, b, c, d) {
  856. console.log(a);
  857. this.showExcel = false;
  858. this.nowFolder = a;
  859. this.tooltit = '在线文档-' + a.functionName;
  860. this.pageSize = 1;
  861. this.$refs.pagination.internalCurrentPage = 1
  862. this.getList({}, 1);
  863. },
  864. // tree过滤方法
  865. filterNode(value, data) {
  866. if (!value) return true;
  867. return data.functionName.indexOf(value) !== -1;
  868. },
  869. // 分页
  870. currchange(v) {
  871. this.pageSize = v;
  872. this.getList({}, this.pageSize);
  873. },
  874. getTreeData(data) {
  875. this.loading = true;
  876. this.$http({
  877. url: "/market/cOnlineSyncExcel/getFolderList",
  878. method: "post",
  879. headers: {
  880. "Content-Type": "application/json",
  881. },
  882. data: data,
  883. }).then((res) => {
  884. this.formatterData(res.data);
  885. });
  886. },
  887. // 格式化树形图数据
  888. formatterData(data) {
  889. var arr = [];
  890. var _this = this;
  891. data.map((o) => {
  892. var obj1 = {};
  893. if (o.systemflag !== "1") {
  894. if (o.parentCode) {
  895. var cvTag = o.parentCode == "Top";
  896. } else {
  897. cvTag = false;
  898. }
  899. if (cvTag) {
  900. //判断是否是第一层
  901. obj1 = o;
  902. obj1.icon = o.icon || "layui-icon layui-icon-ok-circle";
  903. obj1.target = "_self";
  904. obj1.checked = o.checked;
  905. obj1.parent = "1";
  906. obj1.children = menuSon(o.functionCode);
  907. arr.push(obj1);
  908. }
  909. }
  910. });
  911. function menuSon(id) {
  912. var arr1 = [];
  913. data.map((o) => {
  914. var obj1 = {};
  915. var myId = o.functionCode;
  916. if (o.parentCode == id) {
  917. //找到是父亲的儿子数据
  918. obj1 = o;
  919. obj1.target = "_self";
  920. var tag = sonIs(myId); //判断是否有儿子
  921. if (tag) {
  922. //有儿子
  923. obj1.children = menuSon(myId); //调用孙生成节点函数
  924. } else {
  925. obj1.children = "";
  926. }
  927. arr1.push(obj1);
  928. }
  929. });
  930. return arr1;
  931. }
  932. function sonIs(id) {
  933. //查找是否有儿子
  934. var tag = false;
  935. data.map((o) => {
  936. if (o.parentCode == id) {
  937. tag = true;
  938. }
  939. });
  940. return tag;
  941. }
  942. this.menuList = arr;
  943. //复制一份给移动文件夹用
  944. this.moveMenuList = [];
  945. arr.map((o) => {
  946. if (o.type == '4') {
  947. this.moveMenuList.push(o);
  948. }
  949. })
  950. this.menuStatus = true;
  951. this.loading = false;
  952. },
  953. getUrlKey(name) {
  954. return (
  955. decodeURIComponent(
  956. (new RegExp("[?|&]" + name + "=" + "([^&;]+?)(&|#|;|$)").exec(
  957. location.href
  958. ) || [, ""])[1].replace(/\+/g, "%20")
  959. ) || null
  960. );
  961. },
  962. processFullScreen() {
  963. this.excelFullScreen = !this.excelFullScreen;
  964. }
  965. },
  966. mounted() {
  967. this.woNo = this.getUrlKey("id")//获取地址栏参数
  968. console.log(this.woNo);
  969. if (this.woNo != null) {
  970. this.processWoNo();
  971. }
  972. // this.woNo = this.$route.query.woNo
  973. // if (this.woNo != null) {
  974. // this.processWoNo();
  975. // } else {
  976. //
  977. // }
  978. this.getList({}, 1);
  979. this.getTreeData();
  980. this.shareadmin = JSON.parse(window.sessionStorage.getItem('userInfo')).loginNoStr
  981. },
  982. created() {
  983. // window['fullScreen'] = (rp) => {
  984. // this.processFullScreen(rp);
  985. // }
  986. // window['backToExcelList'] = (rp) => {
  987. // this.closeExcel(rp);
  988. // }
  989. // //方法里写了字母含义
  990. // window['shareExcel'] = (a, b, c, d, e, f, g) => {
  991. // this.shareExcel(a, b, c, d, e, f, g);
  992. // }
  993. },
  994. name: "index"
  995. }
  996. </script>
  997. <style lang="scss" scoped>
  998. ::v-deep .treebox {
  999. height: 390px;
  1000. }
  1001. ::v-deep .flex-transfer {
  1002. height: 390px;
  1003. }
  1004. svg {
  1005. width: 20px;
  1006. height: 20px;
  1007. display: inline-block;
  1008. float: left;
  1009. margin-right: 10px;
  1010. }
  1011. #DocEditor {
  1012. height: 100%;
  1013. }
  1014. ::v-deep .el-dialog--center {
  1015. height: 100%;
  1016. margin-top: 10px !important;
  1017. }
  1018. ::v-deep .el-dialog__body {
  1019. height: 100%;
  1020. }
  1021. .custom-tree-node {
  1022. flex: 1;
  1023. display: flex;
  1024. align-items: center;
  1025. justify-content: space-between;
  1026. font-size: 14px;
  1027. padding-right: 8px;
  1028. }
  1029. #upload-file {
  1030. position: absolute;
  1031. width: 70px;
  1032. height: 40px;
  1033. opacity: 0;
  1034. }
  1035. .container {
  1036. background-color: #f0f2f5;
  1037. .el-col {
  1038. background-color: white;
  1039. padding: 0 20px;
  1040. }
  1041. .container-box {
  1042. padding: 0;
  1043. margin-top: 0;
  1044. height: 100%;
  1045. }
  1046. .main-box {
  1047. overflow: hidden;
  1048. display: flex;
  1049. >div {
  1050. background-color: white;
  1051. }
  1052. .inner-left {
  1053. width: 20%;
  1054. padding: 0 20px;
  1055. .canel-style {
  1056. color: #1890ff;
  1057. cursor: pointer;
  1058. padding-left: 10px;
  1059. }
  1060. }
  1061. .inner-right {
  1062. width: 80%;
  1063. margin-left: 1%;
  1064. }
  1065. }
  1066. }
  1067. .el-button+.el-button {
  1068. margin-left: 20px;
  1069. }
  1070. .button-list {
  1071. padding: 30px 0 10px 0;
  1072. }
  1073. .el-button {
  1074. height: 36px;
  1075. }
  1076. .choice-style {
  1077. background: rgb(255, 255, 255);
  1078. }
  1079. .tree-action {
  1080. bottom: 0;
  1081. width: 100%;
  1082. // border-top: 1px solid #e8e8e8;
  1083. padding: 10px 16px;
  1084. text-align: left;
  1085. left: 0;
  1086. background: #fff;
  1087. border-radius: 0 0 2px 2px;
  1088. }
  1089. .tree-line {
  1090. .el-tree-node__content {
  1091. padding-left: 0 !important;
  1092. }
  1093. .el-tree-node__expand-icon.is-leaf {
  1094. display: none !important;
  1095. }
  1096. .el-tree-node {
  1097. position: relative;
  1098. padding-left: 16px; // 缩进量
  1099. }
  1100. .el-tree-node__children {
  1101. padding-left: 16px; // 缩进量
  1102. }
  1103. // 竖线
  1104. .el-tree-node::before {
  1105. content: "";
  1106. height: 100%;
  1107. width: 1px;
  1108. position: absolute;
  1109. left: -3px;
  1110. top: -17px;
  1111. border-width: 1px;
  1112. border-left: 1px dashed #52627c;
  1113. }
  1114. // 当前层最后一个节点的竖线高度固定
  1115. .el-tree-node:last-child::before {
  1116. height: 38px; // 可以自己调节到合适数值
  1117. }
  1118. // 横线
  1119. .el-tree-node::after {
  1120. content: "";
  1121. width: 24px;
  1122. height: 20px;
  1123. position: absolute;
  1124. left: -3px;
  1125. top: 20px;
  1126. border-width: 1px;
  1127. border-top: 1px dashed #52627c;
  1128. }
  1129. // 去掉最顶层的虚线,放最下面样式才不会被上面的覆盖了
  1130. &>.el-tree-node::after {
  1131. border-top: none;
  1132. }
  1133. &>.el-tree-node::before {
  1134. border-left: none;
  1135. }
  1136. // 展开关闭的icon
  1137. .el-tree-node__expand-icon {
  1138. font-size: 16px;
  1139. // 叶子节点(无子节点)
  1140. &.is-leaf {
  1141. color: transparent;
  1142. // display: none; // 也可以去掉
  1143. }
  1144. }
  1145. }
  1146. .ant-alert-info {
  1147. background-color: #e6f7ff;
  1148. border: 1px solid #91d5ff;
  1149. }
  1150. .ant-alert {
  1151. box-sizing: border-box;
  1152. margin: 0;
  1153. padding: 0;
  1154. color: rgb(0, 0, 0);
  1155. font-size: 14px;
  1156. font-variant: tabular-nums;
  1157. line-height: 1.5;
  1158. list-style: none;
  1159. font-feature-settings: "tnum";
  1160. position: relative;
  1161. padding: 8px 15px 8px 37px;
  1162. word-wrap: break-word;
  1163. border-radius: 4px;
  1164. }
  1165. .containerr {
  1166. background: #fff;
  1167. height: calc(100vh);
  1168. width: calc(100vw);
  1169. position: fixed;
  1170. left: 0;
  1171. top: 0;
  1172. overflow: hidden;
  1173. }
  1174. .tabbox {
  1175. margin: 15px;
  1176. }
  1177. .online {
  1178. width: 100%;
  1179. .el-select {
  1180. width: calc(100% - 100px);
  1181. }
  1182. span {
  1183. vertical-align: top;
  1184. }
  1185. .el-textarea {
  1186. width: calc(100% - 100px);
  1187. }
  1188. .tree {
  1189. width: calc(50% - 60px);
  1190. display: inline-block;
  1191. margin-right: 20px;
  1192. height: 300px;
  1193. overflow-y: scroll;
  1194. .el-icon-error {
  1195. float: right;
  1196. font-size: 20px;
  1197. margin-top: 9px;
  1198. cursor: pointer;
  1199. }
  1200. }
  1201. .treeUser {
  1202. margin: 0;
  1203. border: 1px solid #ddd;
  1204. p {
  1205. background: #f4f4f4;
  1206. padding: 0 20px;
  1207. margin-bottom: 5px;
  1208. }
  1209. }
  1210. .treeUserb {
  1211. width: calc(100% - 100px);
  1212. border: 1px solid #ddd;
  1213. background: #f4f4f4;
  1214. border-radius: 3px;
  1215. height: auto;
  1216. overflow: hidden;
  1217. p {
  1218. display: inline-block;
  1219. padding: 0 20px;
  1220. margin-bottom: 5px;
  1221. }
  1222. }
  1223. }
  1224. </style>