sheetList.vue 48 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547
  1. <template>
  2. <div class="dataSheet-container" v-if="showData">
  3. <span
  4. class="slide-icon slide-right"
  5. @click="isSlideLeft = !isSlideLeft"
  6. v-show="isSlideLeft"
  7. >
  8. <i class="el-icon-d-arrow-right"></i>
  9. </span>
  10. <div class="data-sheet-main" id="box">
  11. <div class="main-left left" id="left" v-show="!isSlideLeft">
  12. <div class="datasheet_top">
  13. <el-button v-if="permissionBtn.checkPermissionBtn(permissionBtn.etaTablePermission.etaTable_excel)&&sourceMap[$route.path]===1" type="primary" style="margin-right:20px" @click="goAddSheetHandle"
  14. >{{$t('OnlineExcelPage.add_excel_btn')}}</el-button >
  15. <el-button v-if="permissionBtn.checkPermissionBtn(permissionBtn.etaTablePermission.etaTable_customize_data_sheetAdd)&&sourceMap[$route.path]===2" type="primary" style="margin-right:20px" @click="goAddSheetHandle">{{$t('OnlineExcelPage.add_timeline_table_btn')}}</el-button >
  16. <el-button v-if="permissionBtn.checkPermissionBtn(permissionBtn.etaTablePermission.etaTable_customize_mix_sheetAdd)&&sourceMap[$route.path]===3" type="primary" @click="goAddSheetHandle">{{$t('OnlineExcelPage.add_mixed_table_btn')}}</el-button >
  17. <el-button v-if="permissionBtn.checkPermissionBtn(permissionBtn.etaTablePermission.etaTable_customize_balance_sheetAdd)&&sourceMap[$route.path]===5" type="primary" @click="showAddBalanceTable=true">{{$t('OnlineExcelPage.add_balance_table_btn')}}</el-button >
  18. <el-checkbox
  19. v-if="!showOnlyMeDefault"
  20. v-model="isShowMe"
  21. style="margin-left:20px"
  22. @change="() => { getTreeData();getPublicList() }"
  23. >{{sourceMap[$route.path]===5?$t('BalanceSheet.only_edit'):$t('Chart.only_see_mine')}}</el-checkbox>
  24. </div>
  25. <div class="search-cont">
  26. <el-select
  27. v-model="search_txt"
  28. ref="searchRef"
  29. :filterable="!search_txt"
  30. remote
  31. clearable
  32. :placeholder="$t('OnlineExcelPage.excel_name_ipt')"
  33. style="width: 100%"
  34. :remote-method="searchHandle"
  35. @focus="searchHandle('')"
  36. >
  37. <i slot="prefix" class="el-input__icon el-icon-search"></i>
  38. <el-option
  39. v-for="item in searchOptions"
  40. :key="item.ExcelInfoId"
  41. :label="item.ExcelName"
  42. :value="item.ExcelInfoId"
  43. >
  44. <div>
  45. <img
  46. :src="$icons.lock_ico2"
  47. width="18"
  48. height="18"
  49. style="vertical-align:middle"
  50. v-if="!item.HaveOperaAuth"
  51. />
  52. {{item.ExcelName}}
  53. </div>
  54. </el-option>
  55. </el-select>
  56. </div>
  57. <div class="tree-cont">
  58. <el-tree
  59. ref="treeRef"
  60. class="target_tree"
  61. :data="treeData"
  62. node-key="UniqueCode"
  63. :props="defaultProp"
  64. :allow-drag="canDragHandle"
  65. :allow-drop="canDropHandle"
  66. :current-node-key="select_node"
  67. :default-expanded-keys="defaultShowNodes"
  68. draggable
  69. :expand-on-click-node="false"
  70. check-strictly
  71. :empty-text="$t('Common.no_classify_msg')"
  72. @node-expand="handleNodeExpand"
  73. @node-collapse="handleNodeCollapse"
  74. @current-change="nodeChange"
  75. @node-drop="dropOverHandle"
  76. @node-drag-end="dropMouseLeave"
  77. @node-drag-leave="dropMouseLeave"
  78. @node-drag-enter="dropMouseOver"
  79. >
  80. <span class="custom-tree-node" slot-scope="{ node, data }">
  81. <el-input
  82. ref="editVal"
  83. style="width: 90px"
  84. :placeholder="$t('OnlineExcelPage.please_value_ipt')"
  85. class="label-input"
  86. v-model="new_label"
  87. v-if="data.isEdit&&isSheetBtnShow('classifyOpt_edit')"
  88. @blur="changeValue(data)"
  89. />
  90. <span
  91. @dblclick.stop="editNodeLabel(data)"
  92. v-else
  93. class="text_oneLine node_label"
  94. :style="`width:${
  95. (select_node === data.UniqueCode && node.Nodewidth) || ''
  96. }`"
  97. >
  98. <img
  99. :src="$icons.lock_ico2"
  100. width="18"
  101. height="18"
  102. style="vertical-align:middle"
  103. v-if="!data.HaveOperaAuth&&data.ExcelInfoId"
  104. />
  105. <span>{{ data.ExcelClassifyName }}</span>
  106. </span>
  107. <span
  108. style="display: flex; align-items: center"
  109. v-if="select_node === data.UniqueCode && data.HaveOperaAuth"
  110. >
  111. <img
  112. src="~@/assets/img/data_m/move_ico.png"
  113. alt=""
  114. style="width: 14px; height: 14px; margin-right: 8px"
  115. />
  116. <!-- 添加子 -->
  117. <img
  118. src="~@/assets/img/set_m/add.png"
  119. alt=""
  120. style="width: 14px; height: 14px; margin-right: 8px"
  121. @click.stop="addNode(node,data)"
  122. v-if="!data.ExcelInfoId&&isSheetBtnShow('classifyOpt_edit')&&node.level<3"
  123. />
  124. <img
  125. src="~@/assets/img/set_m/edit.png"
  126. alt=""
  127. style="width: 15px; height: 14px; margin-right: 8px"
  128. @click.stop="editNode(node, data)"
  129. v-if="!data.ExcelInfoId&&isSheetBtnShow('classifyOpt_edit')"
  130. />
  131. <img
  132. slot="reference"
  133. src="~@/assets/img/set_m/del.png"
  134. alt=""
  135. style="width: 14px; height: 14px"
  136. @click.stop="removeNode(node, data)"
  137. v-if="!data.ExcelInfoId&&isSheetBtnShow('classifyOpt_delete')"
  138. />
  139. </span>
  140. </span>
  141. </el-tree>
  142. <div class="noDepart" @click="addLevelOneHandle" v-if="isSheetBtnShow('classifyOpt_edit')">
  143. <img
  144. src="~@/assets/img/set_m/add_ico.png"
  145. alt=""
  146. style="width: 16px; height: 16px; margin-right: 10px"
  147. />
  148. <span>{{$t('OnlineExcelPage.add_category_table_btn')}}</span>
  149. </div>
  150. </div>
  151. <span
  152. class="move-btn resize"
  153. v-drag
  154. id="resize"
  155. @mousemove="dynamicNode && resetNodeStyle(dynamicNode)"
  156. ></span>
  157. <span class="slide-icon slide-left" @click="isSlideLeft = !isSlideLeft">
  158. <i class="el-icon-d-arrow-left"></i>
  159. </span>
  160. </div>
  161. <!-- 平衡表列表 -->
  162. <div
  163. class="main-right"
  164. id="right"
  165. :style="isSlideLeft ? 'width:100%' : 'width:80%'"
  166. v-if="sourceMap[$route.path]===5"
  167. >
  168. <BalanceSheetList
  169. :total="sheet_total"
  170. :list="sheetList"
  171. :finished="!publicHaveMove"
  172. :loading="sheetLoading"
  173. @loadMoreHandle="loadMoreHandle"
  174. @delSheetHandle="delSheetHandle"
  175. @downloadExcel="downloadExcel"
  176. @updateEdit="balanceSheetUpdateEdit"
  177. />
  178. </div>
  179. <div
  180. v-else
  181. class="main-right"
  182. id="right"
  183. :style="isSlideLeft ? 'width:100%' : 'width:80%'"
  184. >
  185. <!-- 表格详情 -->
  186. <div class="sheet-detail-wrapper" v-if="select_id">
  187. <!-- 有权限 -->
  188. <template v-if="sheetDetailInfo.HaveOperaAuth">
  189. <div class="detail-top">
  190. <el-input
  191. ref="sheetEditTitRef"
  192. style="width: 400px"
  193. :placeholder="$t('OnlineExcelPage.please_table_name_ipt')"
  194. class="label-input"
  195. v-model="sheet_title"
  196. v-if="sheetDetailInfo.isEditTit"
  197. @blur="changeValue(sheetDetailInfo, 'edit-tit')"
  198. />
  199. <span
  200. class="sheet-name"
  201. @click="editExcelName(sheetDetailInfo, 'edit-tit')"
  202. v-else
  203. >
  204. {{ sheetDetailInfo.ExcelName }}
  205. <i class="el-icon-edit" v-if="sheetDetailInfo.Source === 1 && onlineExcelEditing" />
  206. </span>
  207. <div class="sheet-anothor-info">
  208. <span class="author">{{$t('OnlineExcelPage.author_info')}}{{ sheetDetailInfo.SysUserRealName }}</span>
  209. <ul class="action-ul">
  210. <li style="color:#999999 ;">{{$t('OnlineExcelPage.recent_save_time_info')}}{{ saveTime }}</li>
  211. <li
  212. class="editsty"
  213. @click="goEditHandle"
  214. v-if="(sheetDetailInfo.Button && sheetDetailInfo.Button.OpButton&&isSheetBtnShow('edit') && (!onlineExcelEditing))"
  215. >
  216. <img src="~@/assets/img/icons/edit_blue_new.png" v-if="!editButtonText"/>
  217. <span>{{ editButtonText?editButtonText:$t('ETable.Btn.edit_btn') }}</span>
  218. </li>
  219. <li
  220. class="editsty"
  221. @click="saveHandle"
  222. v-if="(sheetDetailInfo.Button && sheetDetailInfo.Button.OpButton&&isSheetBtnShow('save') && onlineExcelEditing)"
  223. >
  224. <img src="~@/assets/img/icons/save_blue_new.png"/>
  225. <span>{{$t('ETable.Btn.save_btn')}}</span>
  226. </li>
  227. <template v-if="[2, 3].includes(sheetDetailInfo.Source)">
  228. <li
  229. class="editsty"
  230. @click="refreshSheetEdb"
  231. v-if="sheetDetailInfo.Button.RefreshButton&&isSheetBtnShow('refresh')"
  232. >
  233. <img src="~@/assets/img/icons/refresh_blue_new.png"/>
  234. <span>{{sheetRefreshing?$t('ETable.Btn.refreshing_btn'):$t('ETable.Btn.refresh_btn')}}</span>
  235. </li>
  236. <li
  237. class="editsty"
  238. @click="saveOtherHandle"
  239. v-if="sheetDetailInfo.Button.CopyButton&&isSheetBtnShow('otherSave')"
  240. >
  241. <img src="~@/assets/img/icons/save_as_blue_new.png"/>
  242. <span>{{$t('ETable.Btn.save_as')}}</span>
  243. </li>
  244. </template>
  245. <li v-if="isSheetBtnShow('download')"
  246. class="editsty" @click="downloadExcel(sheetDetailInfo)">
  247. <img src="~@/assets/img/icons/download_blue.png"/>
  248. <span>{{$t('ETable.Btn.download_btn')}}</span>
  249. </li>
  250. <li
  251. class="deletesty"
  252. v-if="(sheetDetailInfo.Button && sheetDetailInfo.Button.DeleteButton
  253. &&isSheetBtnShow('del'))
  254. "
  255. @click="delSheetHandle({cell:sheetDetailInfo, type:'del'})"
  256. >
  257. <img src="~@/assets/img/icons/delete-red.png"/>
  258. <span>{{$t('ETable.Btn.delete_btn')}}</span>
  259. </li>
  260. </ul>
  261. </div>
  262. </div>
  263. <!-- 表格 -->
  264. <div class="sheet-wrap">
  265. <Sheet
  266. ref="sheetRef"
  267. v-if="sheetDetailInfo.Source === 1&&sheetDetailInfo.ExcelInfoId"
  268. :option="{
  269. data: [{
  270. ...JSON.parse(sheetDetailInfo.Content),
  271. scrollTop: 0,
  272. scrollLeft: 0
  273. }]
  274. }"
  275. :sheetInfo="{
  276. ExcelInfoId: sheetDetailInfo.ExcelInfoId,
  277. ExcelName: sheetDetailInfo.ExcelName,
  278. ExcelClassifyId: sheetDetailInfo.ExcelClassifyId,
  279. Source: sheetDetailInfo.Source
  280. }"
  281. :limit="limit"
  282. @updated="autoSaveFun"
  283. />
  284. <!-- 自定义表格 -->
  285. <CustomTable
  286. v-else-if="sheetDetailInfo.Source === 2"
  287. :sheetType="sheetDetailInfo.ExcelType"
  288. :disabled="true"
  289. ref="customTableRef"
  290. />
  291. <MixedTable
  292. v-else-if="sheetDetailInfo.Source === 3"
  293. :disabled="true"
  294. ref="mixedTableRef"
  295. />
  296. <div class="chart-source">
  297. <span
  298. v-if="[2,3].includes(sheetDetailInfo.Source) && sheetDetailInfo.SourcesFrom && JSON.parse(sheetDetailInfo.SourcesFrom).isShow"
  299. :style="`
  300. color: ${JSON.parse(sheetDetailInfo.SourcesFrom).color};
  301. font-size: ${ JSON.parse(sheetDetailInfo.SourcesFrom).fontSize }px;
  302. `"
  303. ><!-- 数据来源 -->{{$t('ETable.Common.source')}}:{{ JSON.parse(sheetDetailInfo.SourcesFrom).text}}</span>
  304. </div>
  305. </div>
  306. </template>
  307. <noDataAuth v-if="sheetDetailInfo.HaveOperaAuth===false" :text="$t('MsgPrompt.no_sheet_auth')"/>
  308. </div>
  309. <!-- 列表 -->
  310. <sheetListWrap
  311. v-else
  312. :total="sheet_total"
  313. :list="sheetList"
  314. @loadMoreHandle="loadMoreHandle"
  315. @detailShowHandle="detailShowHandle"
  316. @delSheetHandle="delSheetHandle"
  317. @downloadExcel="downloadExcel"
  318. ref="sheetListWrap"
  319. />
  320. </div>
  321. </div>
  322. <!-- 分类弹窗 -->
  323. <classify-dia
  324. :isOpenDialog.sync="classifyDia"
  325. :title="dialog_title"
  326. :form="classifyForm"
  327. @successCallback="getTreeData"
  328. />
  329. <!-- 表格另存 -->
  330. <m-dialog
  331. :show.sync="isSaveOther"
  332. width="650px"
  333. :title="$t('ETable.Btn.save_as')"
  334. @close="cancelSaveOther"
  335. >
  336. <div style="padding-left: 80px">
  337. <el-form
  338. ref="formRef"
  339. label-position="left"
  340. hide-required-asterisk
  341. label-width="80px"
  342. :model="saveOtherForm"
  343. :rules="saveOtherFormRule"
  344. >
  345. <el-form-item :label="$t('OnlineExcelPage.excel_name_ipt')" prop="name">
  346. <el-input
  347. v-model="saveOtherForm.name"
  348. style="width: 80%"
  349. :placeholder="$t('OnlineExcelPage.please_table_name_ipt')"
  350. />
  351. </el-form-item>
  352. <el-form-item :label="$t('OnlineExcelPage.table_classification_label')" prop="classify">
  353. <el-cascader
  354. v-model="saveOtherForm.classify"
  355. :options="classifyOptions"
  356. :props="{
  357. label: 'ExcelClassifyName',
  358. value: 'ExcelClassifyId',
  359. children: 'Children',
  360. emitPath: false,
  361. checkStrictly: true,
  362. }"
  363. style="width: 80%"
  364. :placeholder="$t('OnlineExcelPage.select_appropriate_category_lable')"
  365. class="sheet-classify-cascader"
  366. />
  367. </el-form-item>
  368. </el-form>
  369. </div>
  370. <div style="display: flex; justify-content: center; margin-top: 30px">
  371. <el-button
  372. type="primary"
  373. style="margin-right: 60px"
  374. @click="saveCopyOther"
  375. >{{$t('Dialog.confirm_save_btn')}}</el-button
  376. >
  377. <el-button type="primary" plain @click="cancelSaveOther"
  378. >{{$t('Dialog.cancel_btn')}}</el-button
  379. >
  380. </div>
  381. </m-dialog>
  382. <!-- 新增平衡表弹窗 -->
  383. <m-dialog
  384. :show.sync="showAddBalanceTable"
  385. width="650px"
  386. :title="$t('OnlineExcelPage.add_balance_table_btn')"
  387. @close="showAddBalanceTable=false"
  388. >
  389. <el-form
  390. :model="balanceTableForm"
  391. :rules="balanceTableFormRule"
  392. ref="addBalanceForm"
  393. label-width="140px"
  394. class="add-balance-wrap"
  395. >
  396. <el-form-item :label="$t('OnlineExcelPage.excel_name_ipt')" prop="name">
  397. <el-input
  398. v-model="balanceTableForm.name"
  399. :placeholder="$t('OnlineExcelPage.please_table_name_ipt')"
  400. style="width:350px"
  401. ></el-input>
  402. </el-form-item>
  403. <el-form-item :label="$t('SteelChemicalPage.label_edb_classify')" prop="classify">
  404. <el-cascader
  405. v-model="balanceTableForm.classify"
  406. :options="balanceClassifyOpts"
  407. :props="{
  408. label: 'ExcelClassifyName',
  409. value: 'ExcelClassifyId',
  410. children: 'Children',
  411. emitPath: false,
  412. checkStrictly: true,
  413. }"
  414. clearable
  415. :placeholder="$t('OnlineExcelPage.select_table_category')"
  416. style="width:350px"
  417. />
  418. </el-form-item>
  419. </el-form>
  420. <div style="display: flex; justify-content: center; margin-top: 30px">
  421. <el-button
  422. type="primary"
  423. style="margin-right: 60px"
  424. @click="handleConfirmAddBalanceTable"
  425. >{{$t('Dialog.confirm_save_btn')}}</el-button
  426. >
  427. <el-button type="primary" plain @click="showAddBalanceTable=false"
  428. >{{$t('Dialog.cancel_btn')}}</el-button
  429. >
  430. </div>
  431. </m-dialog>
  432. </div>
  433. </template>
  434. <script>
  435. import * as sheetInterface from "@/api/modules/sheetApi.js";
  436. import leftMixin from "./mixins/classifyMixin";
  437. import mDialog from "@/components/mDialog.vue";
  438. import classifyDia from "./components/sheetClassifyDia.vue";
  439. import Sheet from "./components/SheetExcel.vue";
  440. import { getSheetImage } from "./common/option";
  441. import CustomTable from "./components/CustomTable.vue";
  442. import MixedTable from "./components/MixedTable.vue";
  443. import sheetListWrap from "./components/sheetListWrap.vue"
  444. import BalanceSheetList from './components/BalanceSheetList.vue';
  445. export default {
  446. name: "",
  447. components: { mDialog, classifyDia, Sheet, CustomTable, MixedTable,sheetListWrap,BalanceSheetList },
  448. mixins: [leftMixin],
  449. beforeRouteLeave(to,from,next){
  450. if(from.path=='/sheetList'){
  451. this.markFinishStatus()
  452. }
  453. next()
  454. },
  455. computed: {
  456. downExcelFileUrl() {
  457. let url = `${
  458. process.env.VUE_APP_API_ROOT
  459. }/datamanage/excel_info/table/download?${localStorage.getItem("auth")}`;
  460. return url;
  461. },
  462. classifyOptions() {
  463. return this.balanceClassifyOpts;
  464. },
  465. saveOtherFormRule(){
  466. return {
  467. name: [
  468. { required: true, message: this.$t('OnlineExcelPage.table_name_empty_msg') , trigger: "blur" },
  469. ],
  470. classify: [
  471. { required: true, message: this.$t('OnlineExcelPage.cannot_be_empty_table') , trigger: "blur" },
  472. ],
  473. }
  474. },
  475. /* 是否默认只看我的 */
  476. showOnlyMeDefault() {
  477. return ['/sheetTimeList','/sheetMixedList'].includes(this.$route.path)
  478. }
  479. },
  480. data() {
  481. return {
  482. showData: false,
  483. search_txt: "",
  484. searchOptions: [],
  485. isSlideLeft: false, //左侧分类收起
  486. select_node: "", //节点唯一标识code
  487. select_classify: "",
  488. new_label: "", //双击修改的value
  489. treeData: [], //分类数据
  490. defaultShowNodes: [], //展开节点
  491. defaultProp: {
  492. label: "ExcelClassifyName",
  493. children: "Children",
  494. }, //树结构配置项
  495. dynamicNode: null,
  496. /* 分类弹窗 */
  497. dialog_title: "",
  498. classifyDia: false, //
  499. classifyForm: {},
  500. select_id: "", //选中的表格id
  501. sheetDetailInfo: {},
  502. sheet_title: "", //表格标题 双击标题修改时来存储最新值
  503. /* 表格列表 */
  504. publicHaveMove: true, //是否还有列表数据
  505. sheetList: [],
  506. sheet_total: 0,
  507. sheet_page: 1,
  508. sheet_pages_size: this.$route.path==='/sheetBalanceList'?30:16,
  509. sheetLoading:false,
  510. /* 另存为 */
  511. isSaveOther: false,
  512. saveOtherForm: {
  513. name: '',
  514. classify: ''
  515. },
  516. sourceMap: {
  517. '/sheetList': 1,
  518. '/sheetTimeList': 2,
  519. '/sheetMixedList': 3,
  520. '/sheetBalanceList': 5,
  521. },
  522. saveTime:"",
  523. editButtonText:"",
  524. onlineExcelEditing:false,
  525. limit:{
  526. disabled:true
  527. },
  528. autoSaveType:'',//自动保存类型,有的自动保存后需要其他操作
  529. cancelAutoSave:false, //自动保存时延迟的
  530. isShowMe: this.showOnlyMeDefault?true:false,//只看我的
  531. sheetRefreshing:false,//表格刷新状态
  532. showAddBalanceTable:false,//创建平衡表弹窗
  533. balanceTableForm:{
  534. name:'',
  535. classify:''
  536. },
  537. balanceTableFormRule:{
  538. name:[{ required: true, message: '请输入表格名称', trigger: 'blur' },],
  539. classify:[{ required: true, message: '请选择分类', trigger: 'change' },]
  540. },
  541. balanceClassifyOpts:[],//平衡表分类数据
  542. };
  543. },
  544. watch: {
  545. /* 设置动态右侧区域宽度 */
  546. isSlideLeft(newval) {
  547. this.select_id && this.$refs.sheetRef && this.$refs.sheetRef.init();
  548. this.$nextTick(() => {
  549. this.reloadRightWid();
  550. });
  551. },
  552. /* 表格id */
  553. select_id(newval,oldVlue) {
  554. if(newval){
  555. this.sheetDetailInfo = {}
  556. this.getDetailHandle()
  557. }
  558. this.markFinishStatus(oldVlue)
  559. },
  560. select_classify(newval) {
  561. if (this.$refs.sheetListWrap) this.$refs.sheetListWrap.$refs.listRef.scrollTop = 0;
  562. if (newval) {
  563. this.sheet_page = 1;
  564. this.getPublicList();
  565. }
  566. },
  567. /* 搜索关键词 */
  568. search_txt(newval) {
  569. if (newval) {
  570. let search_obj = this.searchOptions.find(
  571. (_) => _.ExcelInfoId === newval
  572. );
  573. let deep_arr = _.cloneDeep(this.treeData);
  574. // 查找图表的分类父级id
  575. let arr = this.findParentNodeHandle(deep_arr, search_obj.UniqueCode)
  576. .slice(1)
  577. .reverse(); // 父的父的父-父的父-父
  578. this.defaultShowNodes = arr;
  579. this.select_node = search_obj.UniqueCode;
  580. this.$refs.treeRef.setCurrentKey(this.select_node);
  581. // 重置筛选状态
  582. this.select_id = newval;
  583. }
  584. },
  585. onlineExcelEditing(value){
  586. // console.log(value);
  587. this.limit.disabled = !value
  588. },
  589. 'sheetDetailInfo.ExcelName':{
  590. handler:function(newValue,oldValue){
  591. if(newValue && oldValue){
  592. this.autoSaveType = 'nameEdit'
  593. this.autoSaveFun()
  594. }
  595. }
  596. }
  597. },
  598. methods: {
  599. // 获取平衡表分类
  600. getBalanceClassifyOpts(){
  601. sheetInterface.excelClassifyOne({ Source: this.sourceMap[this.$route.path] }).then(res => {
  602. if (res.Ret !== 200) return
  603. this.balanceClassifyOpts = res.Data.AllNodes || [];
  604. })
  605. },
  606. //确认新增平衡表
  607. handleConfirmAddBalanceTable(){
  608. this.$refs.addBalanceForm.validate((valid) => {
  609. if (valid) {
  610. let params = {
  611. ExcelName: this.balanceTableForm.name,
  612. ExcelType: 1,
  613. ExcelClassifyId: this.balanceTableForm.classify,
  614. ExcelImage: '',
  615. Source: 5,
  616. TableData: {
  617. CellRelation:"[]",
  618. Data:[]
  619. }
  620. };
  621. sheetInterface.sheetAdd(params).then(res=>{
  622. if(res.Ret===200){
  623. this.$router.push({
  624. path:'/editBalanceSheet',
  625. query:{
  626. id:res.Data.ExcelInfoId
  627. }
  628. })
  629. }
  630. })
  631. }
  632. });
  633. },
  634. // 更新平衡表编辑状态
  635. balanceSheetUpdateEdit(data){
  636. // 找到哪个表格
  637. this.sheetList.forEach(item => {
  638. if(item.ExcelInfoId===data.ExcelInfoId){
  639. item.CanEdit=false
  640. item.Editor=data.Editor
  641. }
  642. });
  643. },
  644. /* 添加表格 */
  645. goAddSheetHandle() {
  646. if (!this.treeData.length) return this.$message.warning(this.$t('OnlineExcelPage.please_table_classification_msg') );
  647. let type = this.sourceMap[this.$route.path];
  648. let path = {
  649. 1: "/addsheet",
  650. 2: "/addCustomSheet",
  651. 3: "/addMixedSheet",
  652. };
  653. this.$router.push({ path: path[type] })
  654. },
  655. /* 获取表格分类 */
  656. getTreeData(params = null) {
  657. sheetInterface.classifyList({
  658. Source: this.sourceMap[this.$route.path],
  659. IsShowMe: this.isShowMe
  660. }).then((res) => {
  661. const { Ret, Data } = res;
  662. if (Ret !== 200) return;
  663. this.showData = true;
  664. this.treeData = Data.AllNodes || [];
  665. this.$nextTick(() => {
  666. /* 新增完成后 处理树展开和选中 */
  667. params && this.selectCurrentNode(params);
  668. });
  669. });
  670. // 更新一下分类把 新增平衡表时要
  671. if([2,3,5].includes(this.sourceMap[this.$route.path])){
  672. this.getBalanceClassifyOpts()
  673. }
  674. },
  675. /* 搜索表格 */
  676. searchHandle(query) {
  677. if (query) {
  678. /* 查找列表 */
  679. sheetInterface.sheetList({
  680. Keyword: query,
  681. CurrentIndex: 1,
  682. PageSize: 10000,
  683. Source: this.sourceMap[this.$route.path]
  684. }).then((res) => {
  685. if (res.Ret !== 200) return;
  686. this.searchOptions = res.Data.List || [];
  687. });
  688. } else {
  689. this.searchOptions = [];
  690. }
  691. },
  692. /* 选中分类变化时 */
  693. nodeChange({ UniqueCode, ExcelInfoId, ExcelClassifyId }, node) {
  694. console.log(this.select_id,ExcelInfoId,'UniqueCode');
  695. // 点击的是平衡表模块的表格直接进入预览页
  696. if(this.sourceMap[this.$route.path]===5&&ExcelInfoId>0){
  697. this.$router.push({
  698. path:'/viewBalanceSheet',
  699. query:{
  700. id:ExcelInfoId
  701. }
  702. })
  703. return
  704. }
  705. this.search_txt = "";
  706. this.select_node = UniqueCode;
  707. this.select_classify = !ExcelInfoId ? ExcelClassifyId : 0;
  708. if (this.select_id !== ExcelInfoId) {
  709. this.select_id = ExcelInfoId || 0;
  710. }
  711. this.resetNodeStyle(node);
  712. this.dynamicNode = node;
  713. },
  714. /* 添加一级目录 */
  715. addLevelOneHandle() {
  716. this.dialog_title = this.$t('ETable.Btn.add_btn') ;
  717. this.classifyForm = {
  718. classify_name: "",
  719. parentClassifyId: 0,
  720. parentName:''
  721. };
  722. this.classifyDia = true;
  723. },
  724. // 递归节点
  725. getNodeParentData(data,arr){
  726. if(data.level===0) return
  727. arr.push({ExcelClassifyName:data.data.ExcelClassifyName,ExcelClassifyId:data.data.ExcelClassifyId})
  728. this.getNodeParentData(data.parent,arr)
  729. return arr
  730. },
  731. /* 添加节点 */
  732. addNode(node,data) {
  733. let arr = []
  734. arr = this.getNodeParentData(node,arr).reverse();
  735. this.dialog_title = this.$t('ETable.Btn.add_btn') ;
  736. /* 编辑目录 */
  737. this.classifyForm = {
  738. classify_name: "",
  739. parentClassifyId: data.ExcelClassifyId,
  740. parentName: arr.map(_=>_.ExcelClassifyName).join('/')
  741. };
  742. this.classifyDia = true;
  743. },
  744. /* 编辑节点 */
  745. editNode(node, { ExcelClassifyName, ExcelClassifyId,ParentId }) {
  746. let arr = []
  747. arr = ParentId ? this.getNodeParentData(node.parent,arr).reverse() : [];
  748. this.dialog_title = this.$t('ETable.Btn.edit_btn');
  749. /* 编辑目录 */
  750. this.classifyForm = {
  751. classify_name: ExcelClassifyName,
  752. classify_id: ExcelClassifyId,
  753. parentClassifyId: ParentId,
  754. parentName: arr.map(_=>_.ExcelClassifyName).join('/')
  755. };
  756. this.classifyDia = true;
  757. },
  758. /* 删除节点校验 */
  759. async removeNode(node, { ExcelClassifyId, ExcelInfoId }) {
  760. const { Data } = await sheetInterface.classifyDelCheck({
  761. ExcelClassifyId,
  762. ExcelInfoId,
  763. });
  764. const { DeleteStatus } = Data;
  765. DeleteStatus === 1
  766. ? this.$confirm(this.$t('OnlineExcelPage.the_tables_no_delete_msg') , this.$t('MsgPrompt.delete_fail_msg') , {
  767. confirmButtonText: this.$t('MsgPrompt.known') ,
  768. showCancelButton: false,
  769. type: "error",
  770. })
  771. : DeleteStatus === 0 && !ExcelInfoId
  772. ? this.$confirm(this.$t('Chart.OptMsg.classify_del_confirm') , this.$t('Confirm.prompt') , {
  773. confirmButtonText: this.$t('Dialog.confirm_btn'),
  774. cancelButtonText: this.$t('Dialog.cancel_btn'),
  775. type: "warning",
  776. }).then(() => {
  777. this.delApi(ExcelClassifyId, ExcelInfoId);
  778. })
  779. : null;
  780. },
  781. /* 删除方法 */
  782. delApi(ExcelClassifyId, ExcelInfoId, type = "") {
  783. sheetInterface
  784. .classifyDel({
  785. ExcelClassifyId,
  786. ExcelInfoId,
  787. Source: this.sourceMap[this.$route.path]
  788. })
  789. .then((res) => {
  790. if (res.Ret !== 200) return;
  791. this.$message.success(res.Msg);
  792. if (!res.Data.ExcelInfoId) this.select_id = "";
  793. //删除表格后自动显示下一张表格
  794. type == "del" && res.Data.ExcelInfoId
  795. ? this.getTreeData({
  796. code: res.Data.UniqueCode,
  797. id: res.Data.ExcelInfoId,
  798. })
  799. : this.getTreeData();
  800. //删除封面
  801. if (type === "del-list") {
  802. let index = this.sheetList.findIndex(
  803. (_) => _.ExcelInfoId === ExcelInfoId
  804. );
  805. this.sheetList.splice(index, 1);
  806. }
  807. });
  808. },
  809. /* 分类成功回调 */
  810. classifyCallback(type) {
  811. this.getTreeData();
  812. if (type === "add") {
  813. //新增分类完成之后,展开父节点显示刚新增的分类,若已展开节点则不做处理
  814. let code = this.add_parent_id;
  815. let flag = this.defaultShowNodes.some((item) => item === code);
  816. // console.log(flag)
  817. !flag && this.defaultShowNodes.push(code);
  818. this.add_parent_id = "";
  819. }
  820. },
  821. /* 展开对应菜单 显示详情 */
  822. detailShowHandle({ UniqueCode, ExcelInfoId }) {
  823. let params = {
  824. code: UniqueCode,
  825. id: ExcelInfoId,
  826. };
  827. this.selectCurrentNode(params);
  828. this.select_classify = 0;
  829. },
  830. /* 下载数据 */
  831. downloadExcel(cell) {
  832. const { Source, FileUrl, ExcelInfoId, ExcelName } = cell;
  833. let value = "";
  834. if (Source === 1) {
  835. value = FileUrl;
  836. this.downLoad(value, ExcelName);
  837. } else if ([2, 3,5].includes(Source)) {
  838. value = `${this.downExcelFileUrl}&ExcelInfoId=${ExcelInfoId}`;
  839. const a = document.createElement("a");
  840. a.href = value;
  841. a.target = "_blank";
  842. a.download = ExcelName;
  843. a.style.display = "none";
  844. document.body.append(a);
  845. a.click();
  846. }
  847. },
  848. downLoad(url, filename) {
  849. this.handleDownloadResource(url,filename)
  850. },
  851. /* 保存表格 */
  852. saveHandle: _.debounce(async function () {
  853. luckysheet.exitEditMode();
  854. //结构类型乱飘 强制定义下
  855. let data = {...luckysheet.getAllSheets()[0],status:Number(luckysheet.getAllSheets()[0].status)}
  856. if (!data.celldata.length) return this.$message.warning(this.$t('OnlineExcelPage.input_content_msg') );
  857. this.loading = this.$loading({
  858. target: ".dataSheet-container",
  859. lock: true,
  860. text: this.$t('MsgPrompt.saveing_msg') + "...",
  861. spinner: "el-icon-loading",
  862. background: "rgba(255, 255, 255, 0.6)",
  863. });
  864. let img = getSheetImage(data);
  865. const form = new FormData();
  866. form.append("Image", img);
  867. const { Data } = await sheetInterface.uploadImg(form);
  868. data.luckysheet_select_save = [];
  869. const { ExcelInfoId, ExcelName, ExcelClassifyId } = this.sheetDetailInfo;
  870. this.cancelAutoSave=true
  871. const res = await sheetInterface.sheetEdit({
  872. ExcelInfoId,
  873. ExcelName,
  874. ExcelClassifyId,
  875. ExcelImage: Data.ResourceUrl,
  876. Content: JSON.stringify(data),
  877. });
  878. this.loading.close();
  879. if (res.Ret !== 200) return;
  880. if(res.Data.Status==1){
  881. this.$message.warning(res.Data.Msg)
  882. this.refreshOnlineExcel()
  883. this.onlineExcelEditing=false
  884. this.editButtonText = `${res.Data.Editor}${this.$t('OnlineExcelPage.editing_msg')}`
  885. return
  886. }
  887. this.$message.success(this.$t('MsgPrompt.saved_msg') );
  888. if(this.autoSaveType == "nameEdit"){
  889. this.getTreeData();
  890. this.autoSaveType=''
  891. }
  892. this.getDetailHandle();
  893. }, 300),
  894. autoSaveFun:_.debounce(async function(){
  895. // console.log("自动保存");
  896. if(!this.onlineExcelEditing || this.cancelAutoSave){
  897. this.cancelAutoSave=false
  898. return
  899. }
  900. //结构类型乱飘 强制定义下
  901. let data = {...luckysheet.getAllSheets()[0],status:Number(luckysheet.getAllSheets()[0].status)}
  902. if (!data.celldata.length) return this.$message.warning(this.$t('OnlineExcelPage.input_content_msg') );
  903. data.luckysheet_select_save = [];
  904. const { ExcelInfoId, ExcelName, ExcelClassifyId } = this.sheetDetailInfo;
  905. const res = await sheetInterface.sheetEdit({
  906. ExcelInfoId,
  907. ExcelName,
  908. ExcelClassifyId,
  909. Content: JSON.stringify(data),
  910. });
  911. if (res.Ret !== 200) return;
  912. if(res.Data.Status==1){
  913. this.$message.warning(res.Data.Msg)
  914. this.refreshOnlineExcel()
  915. this.onlineExcelEditing=false
  916. this.editButtonText = `${res.Data.Editor}${this.$t('OnlineExcelPage.editing_msg') }`
  917. this.autoSaveType=''
  918. return
  919. }
  920. if(this.autoSaveType == "nameEdit"){
  921. this.getTreeData();
  922. this.autoSaveType=''
  923. }
  924. this.saveTime = this.$moment().format('YYYY-MM-DD HH:mm:ss')
  925. },1500),
  926. /* 获取表格列表 */
  927. getPublicList() {
  928. this.sheetLoading=true
  929. sheetInterface.sheetList({
  930. CurrentIndex: this.sheet_page,
  931. PageSize: this.sheet_pages_size,
  932. ExcelClassifyId: this.select_classify || 0,
  933. Source: this.sourceMap[this.$route.path],
  934. IsShowMe: this.isShowMe
  935. }).then((res) => {
  936. this.sheetLoading=false
  937. if (res.Ret !== 200) return;
  938. this.publicHaveMove = res.Data
  939. ? this.sheet_page < res.Data.Paging.Pages
  940. : false;
  941. this.sheetList = res.Data
  942. ? this.sheet_page === 1
  943. ? res.Data.List
  944. : [...this.sheetList, ...res.Data.List]
  945. : [];
  946. this.sheet_total = res.Data ? res.Data.Paging.Totals : 0;
  947. }).catch(()=>{
  948. this.sheetLoading=false
  949. });
  950. },
  951. /* 加载更多 */
  952. loadMoreHandle: _.throttle(function () {
  953. // 平衡表加载下一页
  954. if(this.sourceMap[this.$route.path]==5){
  955. this.sheet_page++;
  956. this.getPublicList();
  957. return
  958. }
  959. let scrollTop = this.$refs.sheetListWrap.$refs.listRef.scrollTop;
  960. let clientHeight = this.$refs.sheetListWrap.$refs.listRef.clientHeight;
  961. let scrollHeight = this.$refs.sheetListWrap.$refs.listRef.scrollHeight;
  962. if (
  963. scrollTop + clientHeight >= scrollHeight - 10 &&
  964. this.publicHaveMove
  965. ) {
  966. this.sheet_page++;
  967. this.getPublicList();
  968. }
  969. }, 300),
  970. /* 获取表格详情 */
  971. getDetailHandle() {
  972. sheetInterface.sheetDetail({
  973. ExcelInfoId: this.select_id,
  974. })
  975. .then((res) => {
  976. if (res.Ret !== 200) return;
  977. this.sheetDetailInfo = res.Data;
  978. this.saveTime = this.$moment(this.sheetDetailInfo.ModifyTime).format('YYYY-MM-DD HH:mm:ss')||''
  979. this.editButtonText = this.sheetDetailInfo.CanEdit?'':`${this.sheetDetailInfo.Editor}${this.$t('OnlineExcelPage.editing_msg')}`
  980. if(!this.sheetDetailInfo.SourcesFrom){
  981. this.sheetDetailInfo.SourcesFrom = this.setDefaultSource(this.sheetDetailInfo.ExcelSource)
  982. }
  983. this.$nextTick(() => {
  984. //sheet组件Mounted已经init一次,再次调用会导致工具栏样式错乱
  985. //this.sheetDetailInfo.Source === 1 && this.$refs.sheetRef.init();
  986. this.sheetDetailInfo.Source === 2 && this.$refs.customTableRef &&
  987. this.$refs.customTableRef.initSheetData(res.Data.TableData);
  988. this.sheetDetailInfo.Source === 3 && this.$refs.mixedTableRef &&
  989. this.$refs.mixedTableRef.initData(res.Data.TableData)
  990. this.sheetDetailInfo.Source === 3 && this.$refs.mixedTableRef && this.$refs.mixedTableRef.getExcelRule(this.select_id);
  991. });
  992. });
  993. },
  994. setDefaultSource(sourceText){
  995. return JSON.stringify({
  996. isShow: true,
  997. text: sourceText,
  998. color: "#606266",
  999. fontSize: 9
  1000. })
  1001. },
  1002. /* 删除表格 */
  1003. delSheetHandle({cell, type = ""}) {
  1004. const { ExcelClassifyId, ExcelInfoId } = cell;
  1005. this.$confirm(this.$t('ETable.Msg.is_del_table_msg') , this.$t('Confirm.prompt') , {
  1006. confirmButtonText: this.$t('Dialog.confirm_btn'),
  1007. cancelButtonText: this.$t('Dialog.cancel_btn'),
  1008. type: "warning",
  1009. })
  1010. .then(() => {
  1011. this.delApi(ExcelClassifyId, ExcelInfoId, type);
  1012. })
  1013. .catch(() => {});
  1014. },
  1015. /* 编辑 */
  1016. goEditHandle() {
  1017. // 标记
  1018. sheetInterface.markSheetEditStatus({ExcelInfoId: this.select_id,Status:1}).then(res=>{
  1019. if(res.Ret != 200) return
  1020. if(res.Data.Status==0){
  1021. let path = {
  1022. 1:"/addsheet",
  1023. 2: "/addCustomSheet",
  1024. 3: "/addMixedSheet",
  1025. };
  1026. if(this.sheetDetailInfo.Source === 1) {
  1027. if(this.editButtonText.indexOf(this.$t('OnlineExcelPage.editing_msg'))!=-1){
  1028. // 编辑中的状态 重新获取最新的详情数据
  1029. this.refreshOnlineExcel()
  1030. }
  1031. this.onlineExcelEditing=true
  1032. }else {
  1033. this.$router.push({
  1034. path: path[this.sheetDetailInfo.Source],
  1035. query: { id: this.sheetDetailInfo.ExcelInfoId },
  1036. });
  1037. }
  1038. }else if(res.Data.Status==1){
  1039. this.editButtonText = `${res.Data.Editor}${this.$t('OnlineExcelPage.editing_msg')}`
  1040. this.$message.warning('当前'+this.editButtonText)
  1041. }
  1042. })
  1043. },
  1044. /* 刷新表格 */
  1045. refreshSheetEdb: _.debounce(async function () {
  1046. if(this.sheetRefreshing) return
  1047. this.sheetRefreshing=true
  1048. const res = await sheetInterface.refreshCustomSheet({
  1049. ExcelInfoId: this.sheetDetailInfo.ExcelInfoId,
  1050. });
  1051. this.sheetRefreshing=false
  1052. if (res.Ret !== 200) return;
  1053. this.$message.success(this.$t('ETable.Msg.refresh_success_msg') );
  1054. this.getDetailHandle();
  1055. }, 300),
  1056. /* 表格另存为 */
  1057. saveOtherHandle() {
  1058. this.saveOtherForm.name = this.sheetDetailInfo.ExcelName + "(1)";
  1059. this.isSaveOther = true;
  1060. },
  1061. cancelSaveOther() {
  1062. this.$refs.formRef.resetFields();
  1063. this.saveOtherForm = {
  1064. name: '',
  1065. classify: ''
  1066. };
  1067. this.isSaveOther = false;
  1068. },
  1069. /* 另存为 */
  1070. async saveCopyOther() {
  1071. await this.$refs.formRef.validate();
  1072. let { classify, name } = this.saveOtherForm;
  1073. const res = await sheetInterface.copyExcel({
  1074. ExcelInfoId: this.sheetDetailInfo.ExcelInfoId,
  1075. ExcelName: name,
  1076. ExcelClassifyId: classify,
  1077. });
  1078. if (res.Ret !== 200) return;
  1079. this.$message.success(this.$t('MsgPrompt.saved_msg') );
  1080. this.cancelSaveOther();
  1081. this.getTreeData();
  1082. if(this.sourceMap[this.$route.path]==5){
  1083. this.sheet_page=1
  1084. this.getPublicList();
  1085. }
  1086. },
  1087. /* 重绘右侧区域宽度 */
  1088. reloadRightWid() {
  1089. let total_wid = $(".data-sheet-main")[0].offsetWidth;
  1090. let left = $("#left")[0].offsetWidth;
  1091. let rigtWid = total_wid - left - 20 + "px";
  1092. $("#right")[0].style.width = rigtWid;
  1093. },
  1094. editExcelName(sheetDetailInfo, type){
  1095. if(!this.onlineExcelEditing) return
  1096. this.editNodeLabel(sheetDetailInfo, type)
  1097. },
  1098. // 标记 编辑完成 退出编辑状态
  1099. markFinishStatus(select_id){
  1100. let id = select_id || this.select_id
  1101. if((!this.onlineExcelEditing) || (!id) || id=='0'){
  1102. this.onlineExcelEditing=false
  1103. return
  1104. }
  1105. sheetInterface.markSheetEditStatus({ExcelInfoId: +id,Status:2}).then(res=>{
  1106. if(res.Ret != 200) return
  1107. })
  1108. this.onlineExcelEditing=false
  1109. },
  1110. unloadMark(){
  1111. if((!this.onlineExcelEditing) || (!this.select_id) || this.select_id=='0'){
  1112. this.onlineExcelEditing=false
  1113. return
  1114. }
  1115. let url = process.env.VUE_APP_API_ROOT + "/datamanage/excel_info/mark"
  1116. let params={ExcelInfoId: this.select_id,Status:2}
  1117. const uuid = localStorage.getItem("uuid") || "";
  1118. fetch(url, {
  1119. method: 'POST',
  1120. headers:{
  1121. Authorization:localStorage.getItem("auth"),
  1122. Uuid:uuid,
  1123. AccessToken:uuid + "--zheshiyigename"
  1124. },
  1125. body:JSON.stringify(params),
  1126. // 保持连接 让请求不会因为页面关闭而中断
  1127. keepalive: true
  1128. });
  1129. },
  1130. // 刷新在线excel详情数据
  1131. refreshOnlineExcel(){
  1132. sheetInterface.sheetDetail({
  1133. ExcelInfoId: this.select_id,
  1134. })
  1135. .then((res) => {
  1136. if (res.Ret !== 200) return;
  1137. this.sheetDetailInfo = res.Data;
  1138. this.saveTime = this.$moment(this.sheetDetailInfo.ModifyTime).format('YYYY-MM-DD HH:mm:ss')||''
  1139. this.$nextTick(() => {
  1140. this.$refs.sheetRef.init();
  1141. });
  1142. });
  1143. }
  1144. },
  1145. mounted() {
  1146. if (this.$route.query.code) {
  1147. this.getTreeData({
  1148. code: this.$route.query.code,
  1149. id: Number(this.$route.query.id),
  1150. });
  1151. } else {
  1152. this.getTreeData();
  1153. this.getPublicList();
  1154. }
  1155. window.addEventListener("resize", this.reloadRightWid);
  1156. if(this.$route.path == '/sheetList'){
  1157. window.addEventListener('beforeunload',this.unloadMark)
  1158. }
  1159. },
  1160. destroyed() {
  1161. window.removeEventListener("resize", this.reloadRightWid);
  1162. if(this.$route.path == '/sheetList'){
  1163. window.removeEventListener('beforeunload',this.unloadMark)
  1164. }
  1165. },
  1166. };
  1167. </script>
  1168. <style lang="scss" scoped>
  1169. * {
  1170. box-sizing: border-box;
  1171. }
  1172. $mini-font: 12px;
  1173. $normal-font: 14px;
  1174. .dataSheet-container {
  1175. .slide-icon {
  1176. padding: 20px 0;
  1177. /* display: block; */
  1178. box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.3);
  1179. border-radius: 5px;
  1180. cursor: pointer;
  1181. position: absolute;
  1182. top: 50%;
  1183. transform: translateY(-50%);
  1184. z-index: 99;
  1185. &:hover {
  1186. background-color: rgba(0, 0, 0, 0.05);
  1187. }
  1188. &.slide-left {
  1189. right: 0;
  1190. }
  1191. &.slide-right {
  1192. left: 0;
  1193. }
  1194. }
  1195. .data-sheet-main {
  1196. display: flex;
  1197. .main-left {
  1198. width: 400px;
  1199. min-width: 300px;
  1200. background: #fff;
  1201. margin-right: 20px;
  1202. border: 1px solid #ececec;
  1203. border-radius: 4px;
  1204. box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.05);
  1205. height: calc(100vh - 120px);
  1206. overflow: hidden;
  1207. position: relative;
  1208. box-sizing: border-box;
  1209. .datasheet_top {
  1210. padding: 20px;
  1211. background: #fff;
  1212. border: 1px solid #ececec;
  1213. box-shadow: 0 3px 6px rgba(0, 0, 0, 0.05);
  1214. margin-bottom: 20px;
  1215. }
  1216. .search-cont {
  1217. padding: 0 20px;
  1218. }
  1219. .tree-cont {
  1220. padding: 30px 20px;
  1221. max-height: calc(100vh - 280px);
  1222. overflow: auto;
  1223. margin-right: 20px;
  1224. }
  1225. .target_tree {
  1226. color: #333;
  1227. .custom-tree-node {
  1228. display: flex !important;
  1229. justify-content: space-between;
  1230. align-items: center;
  1231. display: block;
  1232. flex: 1;
  1233. .node_label {
  1234. margin-right: 2px;
  1235. }
  1236. .el-icon-view {
  1237. color: #409eff;
  1238. font-size: 18px;
  1239. margin-left: 5px;
  1240. }
  1241. }
  1242. }
  1243. .noDepart {
  1244. margin: 60px 0;
  1245. display: flex;
  1246. align-items: center;
  1247. justify-content: center;
  1248. color: #409eff;
  1249. font-size: 16px;
  1250. cursor: pointer;
  1251. }
  1252. .move-btn {
  1253. height: 100%;
  1254. width: 4px;
  1255. /* opacity: 0; */
  1256. position: absolute;
  1257. right: 0px;
  1258. top: 0;
  1259. &:hover {
  1260. cursor: col-resize;
  1261. /* background-color: orange */
  1262. }
  1263. }
  1264. }
  1265. .main-right {
  1266. width: 80%;
  1267. min-width: 800px;
  1268. position: relative;
  1269. height: calc(100vh - 120px);
  1270. display: flex;
  1271. .sheet-detail-wrapper {
  1272. flex: 1;
  1273. border: 1px solid #ececec;
  1274. border-radius: 4px;
  1275. box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.05);
  1276. background: #fff;
  1277. box-sizing: border-box;
  1278. overflow-x: auto;
  1279. display: flex;
  1280. flex-direction: column;
  1281. .detail-top {
  1282. padding: 20px;
  1283. border-bottom: 1px solid #ececec;
  1284. .sheet-name {
  1285. font-size: 18px;
  1286. color: #333333;
  1287. margin-bottom: 6px;
  1288. // cursor: pointer;
  1289. // max-width: 450px;
  1290. // &:hover {
  1291. // text-decoration: underline;
  1292. // }
  1293. }
  1294. .sheet-anothor-info{
  1295. display: flex;
  1296. justify-content: space-between;
  1297. align-items: center;
  1298. white-space: pre;
  1299. .author{
  1300. color: #666666;
  1301. font-size: 16px;
  1302. }
  1303. .action-ul {
  1304. display: flex;
  1305. li {
  1306. margin: 0 10px;
  1307. display: flex;
  1308. align-items: center;
  1309. img{
  1310. height: 16px;
  1311. width: 16px;
  1312. margin-right: 4px;
  1313. }
  1314. }
  1315. }
  1316. }
  1317. }
  1318. .sheet-wrap {
  1319. flex:1;
  1320. position: relative;
  1321. box-sizing: border-box;
  1322. padding: 15px;
  1323. overflow-y: auto;
  1324. display: flex;
  1325. flex-direction: column;
  1326. justify-content: space-between;
  1327. /* min-height: 500px; */
  1328. }
  1329. }
  1330. .sheet-list-cont {
  1331. color: #333;
  1332. .el-card .el-card__header,
  1333. .el-card__body {
  1334. padding: 10px;
  1335. }
  1336. .sheetlist-wrapper {
  1337. margin-top: 10px;
  1338. display: flex;
  1339. flex-wrap: wrap;
  1340. max-height: calc(100vh - 143px);
  1341. overflow: hidden;
  1342. overflow-y: auto;
  1343. .drag-cont {
  1344. width: 100%;
  1345. display: flex;
  1346. flex-wrap: wrap;
  1347. }
  1348. .dragShdow {
  1349. box-shadow: 0 1px 8px rgba(64, 158, 255, 0.8);
  1350. opacity: 0.5;
  1351. }
  1352. .sheet-item {
  1353. .item-top {
  1354. display: flex;
  1355. justify-content: space-between;
  1356. align-items: center;
  1357. font-size: 16px;
  1358. font-weight: 600;
  1359. }
  1360. .chart-img {
  1361. width: 100%;
  1362. /* height: 230px; */
  1363. object-fit: contain !important;
  1364. cursor: pointer;
  1365. }
  1366. .item-bottom {
  1367. margin-top: 10px;
  1368. display: flex;
  1369. justify-content: space-between;
  1370. font-size: 12px;
  1371. color: #666;
  1372. .collected {
  1373. color: #f00;
  1374. cursor: pointer;
  1375. }
  1376. .join_txt {
  1377. color: #409eff;
  1378. cursor: pointer;
  1379. }
  1380. }
  1381. }
  1382. }
  1383. .nodata {
  1384. text-align: center;
  1385. }
  1386. }
  1387. }
  1388. }
  1389. }
  1390. </style>
  1391. <style lang="scss">
  1392. .add-balance-wrap{
  1393. .el-input{
  1394. width: 100%;
  1395. }
  1396. }
  1397. .dataSheet-container {
  1398. .label-input .el-input__inner {
  1399. height: 25px;
  1400. line-height: 25px;
  1401. padding: 0 10px;
  1402. }
  1403. .el-tree__drop-indicator {
  1404. height: 3px;
  1405. background-color: #409eff;
  1406. }
  1407. .el-tree-node__content {
  1408. margin-bottom: 14px !important;
  1409. }
  1410. .el-tree-node__children {
  1411. .el-tree-node {
  1412. /* margin-bottom: 8px !important; */
  1413. margin-bottom: 0px !important;
  1414. padding-left: 18px;
  1415. }
  1416. .el-tree-node__content {
  1417. margin-bottom: 5px !important;
  1418. padding-left: 0 !important;
  1419. }
  1420. }
  1421. .expanded.el-icon-caret-right:before {
  1422. content: url("../../assets/img/set_m/down.png") !important;
  1423. }
  1424. .el-icon-caret-right:before {
  1425. content: url("../../assets/img/set_m/slide.png") !important;
  1426. }
  1427. .el-tree-node__expand-icon.is-leaf.el-icon-caret-right:before {
  1428. content: "" !important;
  1429. }
  1430. .el-tree-node__expand-icon.expanded {
  1431. -webkit-transform: rotate(0deg);
  1432. transform: rotate(0deg);
  1433. }
  1434. .el-tree-node.is-current > .el-tree-node__content {
  1435. background-color: #f0f4ff !important;
  1436. }
  1437. .el-tree-node__content {
  1438. padding-right: 10px !important;
  1439. }
  1440. }
  1441. .sheet-classify-cascader .el-input {
  1442. width: 100%;
  1443. }
  1444. </style>