PublicView.vue 31 KB

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