IndividualView.vue 33 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070
  1. <template>
  2. <div class="containe">
  3. <div class="main">
  4. <div class="app-container">
  5. <el-row :gutter="20">
  6. <!--目录数据-->
  7. <el-col :span="4" :xs="24" class="main-left">
  8. <div class="head-top">个人文档目录</div>
  9. <div class="head-container">
  10. <el-tree :data="dirList" :props="defaultProps" :expand-on-click-node="false" ref="tree" node-key="id"
  11. default-expand-all highlight-current @node-click="handleNodeClick" />
  12. </div>
  13. </el-col>
  14. <!--文件数据-->
  15. <el-col :span="20" :xs="24" class="main-right">
  16. <p>个人文档</p>
  17. <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch"
  18. label-width="68px" class="main-right-top">
  19. <el-form-item label="文件名称" prop="docName">
  20. <el-input v-model="queryParams.docName" placeholder="请输入文件名称" clearable
  21. @keyup.enter.native="handleQuery" />
  22. </el-form-item>
  23. <el-form-item label="文件级别" prop="docLevel">
  24. <el-select v-model="queryParams.docLevel" placeholder="请选择文件级别" @change="handleQuery">
  25. <el-option v-for="item in levelOptions" :key="item.levelId" :label="item.levelName"
  26. :value="item.levelId"></el-option>
  27. </el-select>
  28. </el-form-item>
  29. <el-form-item label="文件年份" prop="createYear">
  30. <el-select v-model="queryParams.createYear" placeholder="请选择文件创建年份" @change="handleQuery">
  31. <el-option v-for="item in yearOptions" :key="item" :label="item" :value="item"></el-option>
  32. </el-select>
  33. <!-- <el-input v-model="queryParams.createYear" placeholder="请输入文件创建年份" clearable
  34. @keyup.enter.native="handleQuery" /> -->
  35. </el-form-item>
  36. <el-form-item label="标签" prop="params">
  37. <el-select v-model="queryParams.params.tagId" placeholder="请输入标签名称" @change="handleQuery"
  38. style="width: 180px">
  39. <el-option v-for="item in tags" :key="item.tagId" :label="item.tagName" :value="item.tagId" />
  40. </el-select>
  41. </el-form-item>
  42. <el-form-item>
  43. <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  44. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery" class="reset1">重置</el-button>
  45. </el-form-item>
  46. </el-form>
  47. <el-row :gutter="10" class="mb8">
  48. <el-col :span="1.5">
  49. <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd">上传</el-button>
  50. </el-col>
  51. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  52. </el-row>
  53. <el-table v-loading="loading" :data="infoList" @selection-change="handleSelectionChange"
  54. class="main-right-table" height="calc(100vh * (630 / 1080))" align="left"
  55. :header-cell-style="{ 'text-align': 'center' }">
  56. <!-- <el-table-column type="selection" width="55" align="center" /> -->
  57. <el-table-column label="文件名称" align="left" prop="docName" />
  58. <el-table-column label="文件大小" align="center" prop="docSize" :formatter="fileSizeData" width="100" />
  59. <el-table-column label="修改时间" align="center" prop="updateTime" />
  60. <el-table-column label="文件级别" align="center" prop="docLevel" :formatter="fileLevelData" width="90" />
  61. <el-table-column label="文件年份" align="center" prop="createYear" width="90" />
  62. <el-table-column label="文件类型" align="center" prop="docType" />
  63. <el-table-column label="标签" align="center" prop="tagName" width="250">
  64. <template slot-scope="scope">
  65. <div v-if="scope.row.tagList != []">
  66. <el-tag v-for="item in scope.row.tagList" :key="item.tagId">
  67. {{ item.tagName }}
  68. </el-tag>
  69. </div>
  70. </template>
  71. </el-table-column>
  72. <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
  73. <template slot-scope="scope">
  74. <el-button size="mini" type="text" icon="el-icon-view"
  75. @click="handlePreview(scope.row)">预览</el-button>
  76. <el-dropdown size="mini">
  77. <el-button size="mini" type="text" icon="el-icon-d-arrow-right">更多</el-button>
  78. <el-dropdown-menu slot="dropdown">
  79. <el-dropdown-item icon="el-icon-view" @click.native="handleShare(scope.row)">分享</el-dropdown-item>
  80. <el-dropdown-item icon="el-icon-view"
  81. @click.native="handleDownload(scope.row)">下载</el-dropdown-item>
  82. <el-dropdown-item icon="el-icon-view"
  83. @click.native="handleEdit(scope.row)">在线编辑</el-dropdown-item>
  84. <el-dropdown-item icon="el-icon-edit"
  85. @click.native="handleUpdate(scope.row)">修改</el-dropdown-item>
  86. <el-dropdown-item icon="el-icon-delete"
  87. @click.native="handleDelete(scope.row)">删除</el-dropdown-item>
  88. </el-dropdown-menu>
  89. </el-dropdown>
  90. </template>
  91. </el-table-column>
  92. </el-table>
  93. <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum"
  94. :limit.sync="queryParams.pageSize" @pagination="getList" />
  95. </el-col>
  96. </el-row>
  97. <!-- 添加或修改文件基本信息对话框 -->
  98. <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body custom-class="el-dialog5">
  99. <el-form ref="form" :model="form" :rules="rules" label-width="80px">
  100. <el-form-item label="" prop="docPath">
  101. <!-- <el-input v-model="form.docPath" placeholder="请输入文件路径" /> -->
  102. <file-upload :residueNum="residueNum" v-model="form.docPath" />
  103. </el-form-item>
  104. <el-form-item label="文件目录" prop="dirId">
  105. <treeselect v-model="form.dirId" :options="dirList" :normalizer="normalizer" placeholder="请选择文件目录" />
  106. </el-form-item>
  107. <el-form-item label="文件名称" prop="docName">
  108. <el-input v-model="form.docName" placeholder="请输入文件名称" />
  109. </el-form-item>
  110. <el-form-item label="文件级别" prop="docLevel">
  111. <el-select v-model="form.docLevel" placeholder="请选择文件级别">
  112. <el-option v-for="item in levelOptions" :key="item.levelId" :label="item.levelName"
  113. :value="item.levelId"></el-option>
  114. </el-select>
  115. </el-form-item>
  116. <el-form-item label="选择标签(最多5个)" prop="tagName" color="red">
  117. <el-tag :key="tag" v-for="tag in dynamicTags" closable :disable-transitions="false"
  118. @close="handleClose(tag)">
  119. {{ tag }}
  120. </el-tag>
  121. <el-input class="input-new-tag" v-if="inputVisible" v-model="inputValue" ref="saveTagInput" size="small"
  122. @keyup.enter.native="handleInputConfirm" @blur="handleInputConfirm" maxlength="5" placeholder="最多输入五个字">
  123. </el-input>
  124. <el-button v-else class="button-new-tag" size="small" @click="showInput">添加标签</el-button>
  125. </el-form-item>
  126. <el-form-item label="文件标签" color="red">
  127. <el-tag v-for="tag in tags" :key="tag.tagName" :type="tag.type" @click="handleInputConfirm1(tag)">
  128. {{ tag.tagName }}
  129. </el-tag>
  130. </el-form-item>
  131. <el-form-item label="文件描述">
  132. <el-input v-model="form.docDesc" type="textarea" placeholder="请输入内容" />
  133. </el-form-item>
  134. </el-form>
  135. <div slot="footer" class="dialog-footer">
  136. <el-button type="primary" @click="submitForm">确 定</el-button>
  137. <el-button @click="cancel">取 消</el-button>
  138. </div>
  139. </el-dialog>
  140. <!-- 预览对话框 -->
  141. <div class="dhk" v-if="preview">
  142. <video :src="vid" controls v-if="vid1"></video>
  143. <audio :src="aud" controls v-if="aud1"></audio>
  144. <div class="image-container" v-if="img1">
  145. <el-image :src="imgg" ref="imageRef" style="max-width: 100%" @mousewheel.prevent="gunlun" />
  146. <el-button-group>
  147. <el-button icon="el-icon-refresh-left" @click="rotate(-90)" title="向左旋转"></el-button>
  148. <el-button icon="el-icon-refresh-right" @click="rotate(90)" title="向右旋转"></el-button>
  149. <el-button icon="el-icon-zoom-in" @click="scale(0.1)" title="放大"></el-button>
  150. <el-button icon="el-icon-zoom-out" @click="scale(-0.1)" title="缩小"></el-button>
  151. </el-button-group>
  152. </div>
  153. <el-button class="gb" icon="el-icon-close" circle @click="gb" />
  154. </div>
  155. </div>
  156. </div>
  157. </div>
  158. </template>
  159. <script>
  160. import "@/styles1/element-ui1.scss";
  161. import {
  162. listTag
  163. } from "@/api/doc/tag.js";
  164. import {
  165. listInfo,
  166. getInfo,
  167. delInfo,
  168. addInfo,
  169. updateInfo,
  170. getYears,
  171. officeType
  172. } from "@/api/doc/info";
  173. import {
  174. listDir,
  175. getDir,
  176. delDir,
  177. addDir,
  178. updateDir,
  179. personalList,
  180. } from "@/api/doc/dir";
  181. import {
  182. listLevel
  183. } from "@/api/doc/level";
  184. import {
  185. getPersonalSpace
  186. } from '@/api/doc/space'
  187. import Treeselect from "@riophae/vue-treeselect";
  188. import "@riophae/vue-treeselect/dist/vue-treeselect.css";
  189. export default {
  190. name: "Info",
  191. components: {
  192. Treeselect,
  193. },
  194. data() {
  195. return {
  196. //预览图片的旋转缩放
  197. scalePercentage: 1,
  198. rotationAngle: 0,
  199. // 预览界面
  200. preview: false,
  201. //视频路径和显示
  202. vid: "",
  203. vid1: false,
  204. //音频路径和显示
  205. aud: "",
  206. aud1: false,
  207. //图片路径和显示
  208. imgg: "",
  209. img1: false,
  210. //标签列表
  211. tags: [
  212. // { name: '十四大', id: 0 },
  213. // { name: '领导讲话', id: 1 },
  214. // { name: '会议精神', id: 2 },
  215. // { name: '党章', id: 3 },
  216. // { name: '212专案', id: 4 }
  217. ],
  218. //选择标签
  219. dynamicTags: [],
  220. inputVisible: false,
  221. inputValue: "",
  222. // 遮罩层
  223. loading: true,
  224. // 选中数组
  225. ids: [],
  226. // 非单个禁用
  227. single: true,
  228. // 非多个禁用
  229. multiple: true,
  230. //文件上传大小限制
  231. residueNum: null,
  232. // 显示搜索条件
  233. showSearch: true,
  234. // 总条数
  235. total: 0,
  236. // 文件基本信息表格数据
  237. infoList: [],
  238. //目录ID
  239. dirId: undefined,
  240. //目录数据
  241. dirList: undefined,
  242. //文件等级数据
  243. levelOptions: [],
  244. yearOptions: [],
  245. // 弹出层标题
  246. title: "",
  247. // 是否显示弹出层
  248. open: false,
  249. // 查询参数
  250. queryParams: {
  251. pageNum: 1,
  252. pageSize: 10,
  253. docName: null,
  254. docLevel: null,
  255. createYear: null,
  256. params: {
  257. tagId: null,
  258. },
  259. },
  260. // 表单参数
  261. form: {},
  262. defaultProps: {
  263. children: "children",
  264. label: "dirName",
  265. id: "dirId",
  266. },
  267. // 表单校验
  268. rules: {
  269. docName: [{
  270. required: true,
  271. message: "文件名称不能为空",
  272. trigger: "blur",
  273. }, ],
  274. dirId: [{
  275. required: true,
  276. message: "文件目录不能为空",
  277. trigger: "blur",
  278. }, ],
  279. docLevel: [{
  280. required: true,
  281. message: "文件级别不能为空",
  282. trigger: "blur",
  283. }, ],
  284. },
  285. };
  286. },
  287. created() {
  288. this.dirTree();
  289. },
  290. watch: {
  291. "form.docPath": function(path, old) {
  292. if (!this.form.docName && path && path.lastIndexOf("/") > -1) {
  293. let name = path.slice(path.lastIndexOf("/") + 1);
  294. this.form.docName = name.split("_")[0];
  295. }
  296. },
  297. },
  298. methods: {
  299. // 滚轮滑动放大缩小
  300. gunlun(e) {
  301. const image = this.$refs.imageRef.$el.querySelector("img");
  302. if (e.deltaY > 0) {
  303. // console.log("鼠标向下滚动,图片缩小");
  304. this.scalePercentage -= 0.1;
  305. image.style.transform = `scale(${this.scalePercentage})`;
  306. } else {
  307. // console.log("鼠标向上滚动,图片放大");
  308. this.scalePercentage += 0.1;
  309. image.style.transform = `scale(${this.scalePercentage})`;
  310. }
  311. },
  312. //预览图片的旋转
  313. rotate(angle) {
  314. this.rotationAngle += angle;
  315. const image = this.$refs.imageRef.$el.querySelector("img");
  316. image.style.transform = `rotate(${this.rotationAngle}deg)`;
  317. console.log(image.style.transform);
  318. },
  319. //预览图片的缩放
  320. scale(delta) {
  321. this.scalePercentage += delta;
  322. const image = this.$refs.imageRef.$el.querySelector("img");
  323. image.style.transform = `scale(${this.scalePercentage})`;
  324. },
  325. // 预览关闭
  326. gb() {
  327. this.preview = false;
  328. },
  329. //选择标签关闭
  330. handleClose(tag) {
  331. this.form.tagList.map((i, index) => {
  332. if (tag == i.tagName) {
  333. this.form.tagList.splice(index, 1);
  334. }
  335. });
  336. this.dynamicTags.splice(this.dynamicTags.indexOf(tag), 1);
  337. },
  338. showInput() {
  339. if (this.dynamicTags.length >= 5) {
  340. this.inputVisible = false;
  341. alert("标签数不允许超过五个")
  342. } else {
  343. this.inputVisible = true;
  344. this.$nextTick((_) => {
  345. this.$refs.saveTagInput.$refs.input.focus();
  346. });
  347. }
  348. },
  349. //固定的标签
  350. handleInputConfirm1(tag) {
  351. if (this.dynamicTags.indexOf(tag.tagName) == -1) {
  352. this.dynamicTags.push(
  353. tag.tagName
  354. );
  355. this.form.tagList.push({
  356. tagId: tag.tagId,
  357. tagName: tag.tagName,
  358. });
  359. }
  360. if (this.dynamicTags.length > 5) {
  361. alert("标签数不允许超过五个")
  362. this.dynamicTags.pop()
  363. };
  364. },
  365. //自定义标签
  366. handleInputConfirm() {
  367. let inputValue = this.inputValue;
  368. // if (inputValue) {
  369. // this.dynamicTags.push(inputValue);
  370. // }
  371. // this.inputVisible = false;
  372. // this.inputValue = "";
  373. // this.form.tagList.push({
  374. // tagName:inputValue,
  375. // });
  376. //查询输入的标签在固定标签里是否存在
  377. var Newtags = this.tags.find((value) => value.tagName == inputValue);
  378. // console.log(a);
  379. //删除标签
  380. if (this.dynamicTags.indexOf(inputValue) != -1) {
  381. this.dynamicTags.pop()
  382. this.form.tagList.pop()
  383. }
  384. if (inputValue) {
  385. this.dynamicTags.push(inputValue);
  386. }
  387. this.inputVisible = false;
  388. this.inputValue = "";
  389. //判断输入的标签在固定标签里是否存在,存在则换成固定标签
  390. if (Newtags) {
  391. this.form.tagList.push({
  392. tagId: Newtags.tagId,
  393. tagName: Newtags.tagName,
  394. });
  395. } else {
  396. this.form.tagList.push({
  397. tagName: inputValue,
  398. });
  399. }
  400. // console.log(this.form);
  401. if (this.dynamicTags.length > 5) {
  402. alert("标签数不允许超过五个")
  403. this.dynamicTags.pop()
  404. };
  405. },
  406. /** 转换目录信息数据结构 */
  407. normalizer(node) {
  408. if (node.children && !node.children.length) {
  409. delete node.children;
  410. }
  411. return {
  412. id: node.dirId,
  413. label: node.dirName,
  414. children: node.children,
  415. };
  416. },
  417. // 节点单击事件
  418. handleNodeClick(data) {
  419. this.dirId = data.dirId;
  420. this.queryParams.dirId = this.dirId;
  421. this.queryParams.searchValue = this.spaceId;
  422. this.handleQuery();
  423. },
  424. //分享
  425. handleShare(row) {
  426. this.$router.push("/home/file/individual/share/user/" + row.docId);
  427. },
  428. /**下载按钮操作*/
  429. handleDownload(row) {
  430. location.href = row.docPath;
  431. },
  432. //预览
  433. handlePreview(row) {
  434. // console.log( this.$route.meta.title);
  435. // row.isEdit = false;
  436. // this.$tab.openPage(
  437. // // "文件[" + row.docName + "]预览",
  438. // document.title = row.docName,
  439. // // window.open("/individual/Pre/user/" + row.docId, '_blank'),
  440. // // row
  441. // );
  442. //图片后缀名
  443. var pictures = ['jpeg', 'tiff', 'raw', 'bmp', 'gif', 'png', 'jpg'];
  444. //音频后缀名
  445. var audios = ['mid', 'mp3', 'wav', 'wma', 'ra', 'ogg', 'flac', 'aac', 'ape'];
  446. //视频后缀名
  447. var videos = ['asf', 'avi', 'mp4', 'ogm', 'ifo', 'mpg', 'mov', 'mpeg', 'mpg', 'vob', 'wmv', 'rm', 'rmvb'];
  448. //判断后缀名
  449. if (videos.some(item => item == row.docType)) {
  450. this.preview = true;
  451. this.vid1 = true;
  452. this.aud1 = false;
  453. this.img1 = false;
  454. this.vid = row.docPath;
  455. } else if (audios.some(item => item == row.docType)) {
  456. this.preview = true;
  457. this.aud1 = true;
  458. this.vid1 = false;
  459. this.img1 = false;
  460. this.aud = row.docPath;
  461. } else if (pictures.some(item => item == row.docType)) {
  462. this.preview = true;
  463. this.aud1 = false;
  464. this.vid1 = false;
  465. this.img1 = true;
  466. this.imgg = row.docPath;
  467. } else if (officeType.some(item => item == row.docType)) {
  468. row.isEdit = false;
  469. this.$tab.openPage(
  470. window.open('/individual/Pre/user/' + row.docId + "?row=" + JSON.stringify(row),
  471. '_blank'),
  472. // window.open("/individual/Pre/user/" + row.docId +"/title/"+ row.docName, '_blank'),
  473. );
  474. // console.log(111);
  475. } else {
  476. this.$modal.msgWarning("该文件不支持预览");
  477. }
  478. // console.log(row.docPath);
  479. // console.log(vid);
  480. },
  481. //在线编辑
  482. handleEdit(row) {
  483. if (!officeType.some(item => item == row.docType)) {
  484. this.$modal.msgWarning("该文件不支持在线编辑");
  485. return false;
  486. }
  487. row.isEdit = true;
  488. this.$tab.openPage(
  489. window.open('/individual/Pre/user/' + row.docId + "?row=" + JSON.stringify(row),
  490. '_blank')
  491. );
  492. },
  493. //先获取左边目录树,拿到目录ID和spaceId才能查询
  494. dirTree() {
  495. this.loading = true;
  496. personalList().then((response) => {
  497. this.dirId = response.data[0].dirId;
  498. this.spaceId = response.data[0].spaceId;
  499. this.dirList = this.handleTree(response.data, "dirId");
  500. this.queryParams.dirId = this.dirId;
  501. this.queryParams.searchValue = this.spaceId;
  502. this.getList();
  503. //获取文件级别数据
  504. listLevel().then((response) => {
  505. this.levelOptions = response.rows;
  506. });
  507. getYears().then((response) => {
  508. this.yearOptions = response.data;
  509. });
  510. this.loading = false;
  511. //标签数据
  512. listTag().then((res) => {
  513. this.tags = res.rows;
  514. });
  515. });
  516. },
  517. /**处理文档级别数据*/
  518. fileLevelData(row, col, value) {
  519. try {
  520. const obj = this.levelOptions.find((item) => item.levelId == value);
  521. return obj.levelName;
  522. } catch (e) {}
  523. },
  524. /**根据文档级别显示数据*/
  525. checkLevel(row, role) {
  526. try {
  527. const obj = this.levelOptions.find(
  528. (item) => item.levelId == row.docLevel
  529. );
  530. if (obj.levelRole.indexOf(role) != -1) {
  531. return true;
  532. } else {
  533. return false;
  534. }
  535. } catch (e) {}
  536. },
  537. /** 查询文件基本信息列表 */
  538. getList() {
  539. this.loading = true;
  540. listInfo(this.queryParams).then((response) => {
  541. this.infoList = response.rows;
  542. this.total = response.total;
  543. this.loading = false;
  544. });
  545. },
  546. // 取消按钮
  547. cancel() {
  548. this.open = false;
  549. this.reset();
  550. },
  551. // 表单重置
  552. reset() {
  553. this.form = {
  554. docId: null,
  555. dirId: this.dirId,
  556. docName: null,
  557. docType: null,
  558. docSize: null,
  559. classifyId: null,
  560. docDesc: null,
  561. docPath: null,
  562. docLevel: null,
  563. allowEdit: null,
  564. docOf: null,
  565. owner: null,
  566. createYear: null,
  567. createBy: null,
  568. createTime: null,
  569. updateBy: null,
  570. updateTime: null,
  571. remark: null,
  572. isDel: null,
  573. searchValue: this.spaceId,
  574. tagList: [],
  575. };
  576. this.resetForm("form");
  577. this.dynamicTags = []
  578. },
  579. /** 搜索按钮操作 */
  580. handleQuery() {
  581. // const para = {
  582. // tagId: queryParams.params.tagId,
  583. // }
  584. // this.queryParams.params = para;
  585. // console.log(this.queryParams);
  586. this.queryParams.pageNum = 1;
  587. this.getList();
  588. },
  589. /** 重置按钮操作 */
  590. resetQuery() {
  591. this.resetForm("queryForm");
  592. this.queryParams.dirId = this.dirId;
  593. this.queryParams.searchValue = this.spaceId;
  594. this.queryParams.params.tagId = null;
  595. this.handleQuery();
  596. },
  597. // 多选框选中数据
  598. handleSelectionChange(selection) {
  599. this.ids = selection.map((item) => item.docId);
  600. this.single = selection.length !== 1;
  601. this.multiple = !selection.length;
  602. },
  603. /** 新增按钮操作 */
  604. handleAdd() {
  605. this.reset();
  606. this.open = true;
  607. this.title = "添加文件基本信息";
  608. getPersonalSpace({}).then(res => {
  609. //容量需先转换成MB
  610. this.residueNum = ((res.data.spaceCap - res.data.usedCap) * 1024).toFixed(2).toString()
  611. console.log(this.residueNum, 'resss')
  612. })
  613. // this.dynamicTags=[];
  614. // console.log(this.dynamicTags);
  615. },
  616. /** 修改按钮操作 */
  617. handleUpdate(row) {
  618. this.reset();
  619. const docId = row.docId || this.ids;
  620. getInfo(docId, row.createYear).then((response) => {
  621. this.form = response.data;
  622. this.open = true;
  623. this.title = "修改文件基本信息";
  624. this.dynamicTags = this.form.tagList.map(item => item.tagName);
  625. this.form.dirId = this.dirList[0].dirId;
  626. });
  627. },
  628. /** 提交按钮 */
  629. submitForm() {
  630. this.$refs["form"].validate((valid) => {
  631. if (valid) {
  632. if (this.form.docId != null) {
  633. updateInfo(this.form).then((response) => {
  634. this.$modal.msgSuccess("修改成功");
  635. this.open = false;
  636. this.getList();
  637. });
  638. } else {
  639. addInfo(this.form).then((response) => {
  640. this.$modal.msgSuccess("新增成功");
  641. this.open = false;
  642. this.getList();
  643. });
  644. }
  645. }
  646. });
  647. // console.log(this.dynamicTags.length);
  648. // console.log(this.form);
  649. // console.log(this.dynamicTags);
  650. },
  651. /** 删除按钮操作 */
  652. handleDelete(row) {
  653. const docIds = row.docId || this.ids;
  654. this.$modal
  655. .confirm('是否确认删除文件名称为"' + row.docName + '"的数据项?')
  656. .then(function() {
  657. return delInfo(docIds);
  658. })
  659. .then(() => {
  660. this.getList();
  661. this.$modal.msgSuccess("删除成功");
  662. })
  663. .catch(() => {});
  664. },
  665. /** 导出按钮操作 */
  666. handleExport() {
  667. this.download(
  668. "doc/info/export", {
  669. ...this.queryParams,
  670. },
  671. `info_${new Date().getTime()}.xlsx`
  672. );
  673. },
  674. /**格式化文件大小数据*/
  675. fileSizeData(row, col, value) {
  676. const KB = 1;
  677. const MB = KB * 1024;
  678. const GB = MB * 1024;
  679. if (value < MB) {
  680. return `${(value / KB).toFixed(2)} KB`;
  681. } else if (value < GB) {
  682. return `${(value / MB).toFixed(2)} MB`;
  683. } else {
  684. return `${(value / GB).toFixed(2)} GB`;
  685. }
  686. },
  687. },
  688. };
  689. </script>
  690. <style scoped lang='scss'>
  691. .containe {
  692. color: #7ea4c8;
  693. font-size: 0.14rem;
  694. font-family: PingFang SC-Medium, PingFang SC;
  695. font-weight: 500;
  696. padding-left: calc(100vw * (20 / 1920));
  697. // .header {
  698. // width: calc(100vw * (300 / 1920));
  699. // height: calc(100vh * (22 / 1080));
  700. // margin-top: calc(100vh * (20 / 1080));
  701. // margin-bottom: calc(100vh * (20 / 1080));
  702. // display: flex;
  703. // align-items: center;
  704. // img {
  705. // width: calc(100vw * (16 / 1920));
  706. // height: calc(100vh * (16 / 1080));
  707. // border: 1px dashed grey;
  708. // margin-left: 3px;
  709. // margin-right: 3px;
  710. // }
  711. // .top1 {
  712. // color: #2e8aecff;
  713. // }
  714. // }
  715. // .title {
  716. // height: calc(100vh * (22 / 1080));
  717. // margin-top: calc(100vh * (20 / 1080));
  718. // margin-bottom: calc(100vh * (20 / 1080));
  719. // color: #ffffffff;
  720. // font-size: 0.16rem;
  721. // font-weight: bold;
  722. // line-height: calc(100vh * (22 / 1080));
  723. // }
  724. .main {
  725. width: calc(100vw * (1876 / 1920));
  726. height: calc(100vh * (930 / 1080));
  727. margin-top: calc(100vh * (35 / 1080));
  728. .app-container {
  729. width: calc(100vw * (1876 / 1920));
  730. height: calc(100vh * (930 / 1080));
  731. padding: 0;
  732. }
  733. .main-left {
  734. width: calc(100vw * (260 / 1920));
  735. height: calc(100vh * (930 / 1080));
  736. margin-right: calc(100vw * (20 / 1920));
  737. margin-left: calc(100vw * (10 / 1920));
  738. background: url(../../../assets/img/Group-609.png);
  739. background-size: calc(100vw * (260 / 1920)) calc(100vh * (930 / 1080));
  740. .head-top {
  741. color: #ffffffff;
  742. font-size: 0.2rem;
  743. padding-left: calc(100vw * (15 / 1920));
  744. padding-top: calc(100vh * (25 / 1080));
  745. }
  746. //左边下拉菜单
  747. .head-container {
  748. margin-top: -5px;
  749. }
  750. }
  751. .main-right {
  752. width: calc(100vw * (1600 / 1920));
  753. height: calc(100vh * (930 / 1080));
  754. background: url(../../../assets/img/Group-610.png);
  755. background-size: calc(100vw * (1600 / 1920)) calc(100vh * (930 / 1080));
  756. p {
  757. color: #ffffffff;
  758. font-size: 0.16rem;
  759. padding-left: calc(100vw * (15 / 1920));
  760. padding-top: calc(100vh * (25 / 1080));
  761. }
  762. .main-right-top {
  763. height: calc(100vh * (60 / 1080));
  764. margin-top: calc(100vw * (25 / 1920));
  765. .reset1 {
  766. color: #2e8aecff;
  767. background: transparent;
  768. border: 1px solid #2e8aecff;
  769. }
  770. }
  771. .mb8 {
  772. margin-top: 20px;
  773. }
  774. .main-right-table {
  775. background: transparent;
  776. color: #7ea4c8ff;
  777. }
  778. //表格底部
  779. .pagination-container {
  780. width: calc(100vw * (1540 / 1920));
  781. height: calc(100vh * (50 / 1080));
  782. background: transparent;
  783. padding: 0 !important;
  784. margin: 0;
  785. margin-left: calc(100vw * (20 / 1920));
  786. margin-top: calc(100vh * (10 / 1080));
  787. }
  788. }
  789. }
  790. //预览弹窗
  791. .dhk {
  792. width: calc(100vw * (1200 / 1920));
  793. height: calc(100vh * (850 / 1080));
  794. // background: salmon;
  795. background: #0F1540FF;
  796. position: absolute;
  797. top: 10%;
  798. left: 20%;
  799. z-index: 99;
  800. display: flex;
  801. justify-content: center;
  802. align-items: center;
  803. .gb {
  804. position: absolute;
  805. top: 0;
  806. right: 0;
  807. }
  808. video {
  809. width: calc(100vw * (1440 / 1920));
  810. height: calc(100vh * (810 / 1080));
  811. }
  812. .el-image {
  813. width: calc(100vw * (960 / 1920));
  814. height: calc(100vh * (720 / 1080));
  815. }
  816. .el-button-group {
  817. position: absolute;
  818. bottom: 0;
  819. left: 35%;
  820. }
  821. }
  822. }
  823. //标签按钮
  824. ::v-deep .el-tag {
  825. color: #df9439ff;
  826. border: 1px solid #ff9839ff;
  827. background: #bba99240;
  828. margin-left: 3px;
  829. margin-bottom: 3px;
  830. height: calc(100vh * (35 / 1080));
  831. line-height: calc(100vh * (35 / 1080));
  832. }
  833. //左边下拉菜单样式
  834. ::v-deep .el-tree {
  835. width: calc(100vw * (200 / 1920));
  836. margin-top: calc(100vh * (30 / 1080));
  837. background: transparent;
  838. color: #7ea4c8ff;
  839. }
  840. ::v-deep .el-tree-node {
  841. width: calc(100vw * (232 / 1920));
  842. }
  843. //悬停时的样式
  844. ::v-deep .el-tree-node__content:hover {
  845. background: #293667ff;
  846. }
  847. //右边顶部字体样式
  848. ::v-deep .el-form-item__label {
  849. color: #2e8aecff;
  850. }
  851. //右边顶部搜索框样式
  852. ::v-deep .el-input__inner {
  853. background-color: transparent;
  854. border: 1px solid #01d1ffff;
  855. color: #ffffffcc;
  856. }
  857. ::v-deep .el-form-item--small .el-form-item__content {
  858. width: calc(100vw * (220 / 1920));
  859. }
  860. //右边顶部标签搜索
  861. ::v-deep .el-select>.el-input {
  862. width: calc(100vw * (180 / 1920));
  863. }
  864. //右边表格线条隐藏
  865. ::v-deep .el-table::before {
  866. height: 0;
  867. }
  868. //table样式
  869. ::v-deep .el-table {
  870. overflow: auto;
  871. }
  872. ::v-deep .el-table th {
  873. background: #016c9aa6;
  874. color: #2e8aec;
  875. }
  876. ::v-deep .el-table tr {
  877. background: transparent;
  878. }
  879. ::v-deep .el-table tbody tr:hover>td {
  880. background-color: #016c9a78 !important;
  881. }
  882. ::v-deep .el-table td.el-table__cell {
  883. border-bottom: 1px solid #006c9aff;
  884. }
  885. ::v-deep .el-table th.el-table__cell.is-leaf {
  886. border-bottom: 1px solid #006c9aff;
  887. }
  888. //搜索刷新按钮颜色
  889. ::v-deep .el-button.is-circle {
  890. background: #006c9aff;
  891. color: white;
  892. }
  893. //按钮的样式
  894. ::v-deep .el-button--primary.is-plain,
  895. .el-button--success.is-plain.is-disabled,
  896. .el-button--danger.is-plain.is-disabled,
  897. .el-button--warning.is-plain,
  898. .el-button--success.is-plain,
  899. .el-button--danger.is-plain {
  900. background-color: #002a5cff;
  901. border: none;
  902. color: #2e8aec;
  903. }
  904. //新增/修改弹窗样式
  905. ::v-deep .el-dialog__title {
  906. color: white;
  907. }
  908. ::v-deep .el-dialog .el-form-item {
  909. margin-top: calc(100vw * (30 / 1920));
  910. }
  911. ::v-deep .el-upload-list__item:hover {
  912. background: #002659ff;
  913. }
  914. //建议框样式
  915. ::v-deep .el-textarea__inner {
  916. background: transparent;
  917. resize: none;
  918. }
  919. //传文件的内容颜色
  920. ::v-deep .el-link.el-link--default {
  921. color: #006c9aff;
  922. }
  923. //上传弹窗位置高度
  924. ::v-deep .el-dialog:not(.is-fullscreen) {
  925. margin-top: 1vh !important;
  926. }
  927. ::v-deep .el-form {
  928. height: calc(100vh * (800 / 1080));
  929. }
  930. //弹窗底部按钮的位置
  931. ::v-deep .el-dialog__footer {
  932. padding: 0;
  933. }
  934. //弹窗关闭按钮
  935. ::v-deep .el-dialog__headerbtn {
  936. top: calc(100vh * (45 / 1080));
  937. right: calc(100vw * (20 / 1920));
  938. font-size: 20px;
  939. }
  940. ::v-deep .el-dialog5 {
  941. width: calc(100vw * (800 / 1920)) !important;
  942. height: calc(100vh * (1050 / 1080)) !important;
  943. background: url(../../../assets/img/Group-585.png);
  944. background-size: calc(100vw * (800 / 1920)) calc(100vh * (1050 / 1080));
  945. //弹窗中间内容
  946. .el-dialog__body {
  947. // width: calc(100vw * (620 / 1920)) ;
  948. height: calc(100vh * (780 / 1080));
  949. margin-top: calc(100vh * (50 / 1080));
  950. margin-bottom: calc(100vh * (20 / 1080));
  951. padding-right: 50px;
  952. overflow: auto;
  953. // background: salmon;
  954. }
  955. .el-dialog__header {
  956. padding-bottom: 0;
  957. }
  958. .el-upload__tip {
  959. font-size: 12px;
  960. color: #006c9aff;
  961. margin-top: 0px;
  962. }
  963. .el-upload-list__item {
  964. margin: 0;
  965. }
  966. .el-tag+.el-tag {
  967. margin-left: 10px;
  968. }
  969. .button-new-tag {
  970. margin-left: 10px;
  971. height: 32px;
  972. line-height: 30px;
  973. padding-top: 0;
  974. padding-bottom: 0;
  975. }
  976. .input-new-tag {
  977. width: 90px;
  978. margin-left: 10px;
  979. vertical-align: bottom;
  980. }
  981. }
  982. </style>