IndividualView.vue 32 KB

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