IndividualView.vue 33 KB

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