PartView.vue 35 KB

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