PublicView.vue 31 KB

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