PartView.vue 33 KB

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