index.vue 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787
  1. <template>
  2. <div class="app-container">
  3. <div class="app-btn">
  4. <div class="btn-l">
  5. <el-button :disabled="isDisableAdd" class="filter-item" type="primary" icon="el-icon-edit" @click="form_add">新增</el-button>
  6. <el-upload
  7. style="display: inline-block;margin-left: 10px;"
  8. :headers="headers"
  9. :data="uploadData"
  10. :action="uploadExcelUrl"
  11. :show-file-list="false"
  12. :before-upload="beforeImportExcel"
  13. :on-success="handleImportExcelSuccess"
  14. :on-error="handleImportExcelErro"
  15. >
  16. <el-button v-if="true" v-waves :disabled="isDisableImport" class="filter-item" type="warning" icon="el-icon-upload2">上传</el-button>
  17. </el-upload>
  18. <!-- <el-button class="filter-item" :disabled="isDisableDownload" style="margin-left: 10px;" type="success" icon="el-icon-edit" @click="handleDownloadFolder">下载</el-button> -->
  19. <!-- 文件夹批量删除 -->
  20. <el-button v-if="isFolderDelate" class="filter-item" :disabled="isDisableDelate" style="margin-left: 10px;" type="danger" icon="el-icon-delete" @click="handleFolderDelate">删除</el-button>
  21. <!-- 多文件下载 -->
  22. <el-button v-if="isFileDownload" class="filter-item" style="margin-left: 10px;" type="success" icon="el-icon-download" @click="handleFileDownload">下载</el-button>
  23. <!-- 多文件删除 -->
  24. <el-button v-if="isFileDelate" class="filter-item" style="margin-left: 10px;" type="danger" icon="el-icon-delete" @click="handleFileDelate">删除</el-button>
  25. </div>
  26. <div v-if="isFilter1" class="btn-r">
  27. <el-input v-model="getdataListAllParm.parammaps.docname" placeholder="文件名称" style="width: 140px;" class="filter-item" />
  28. <el-button v-if="isFilter1" class="filter-item" type="primary" icon="el-icon-search" @click="form_search">搜索</el-button>
  29. </div>
  30. <div v-if="isFilter2" class="btn-r">
  31. <el-input v-model="getdataListParmDetail.parammaps.docname" placeholder="文件名称" style="width: 140px;" class="filter-item" />
  32. <el-button class="filter-item" type="primary" icon="el-icon-search" @click="form_search2">搜索</el-button>
  33. </div>
  34. </div>
  35. <!-- 文件夹列表 -->
  36. <div v-if="fileList" class="app-list">
  37. <div v-for="(item, index) in list" :key="index" :body-style="{ padding: '5px' }" class="contentCard">
  38. <div class="contentCard-img">
  39. <svg-icon :icon-class="'file1'" class="contentCard-icon" @click="handlFile(item)" />
  40. <el-checkbox v-model="item.checkeds" name="type" class="contentCard-checkbox" />
  41. </div>
  42. <div class="contentCard-title">
  43. <span v-if="item.isDirectName" class="contentCard-title-name" @click="form_edit(item)">{{ item.direct }}</span>
  44. <input v-if="item.isDirectInput" id="direct" v-model="item.direct" class="contentCard-title-input" type="text" @blur="blurName(item)">
  45. </div>
  46. </div>
  47. </div>
  48. <!-- 文件详情列表 -->
  49. <div v-if="detailList" class="app-detailList">
  50. <div class="title">
  51. <a class="all-file" @click="goBack">全部文件</a>
  52. <span>&gt;{{ temp.direct }}</span>
  53. </div>
  54. <el-table
  55. v-loading="listLoadingDetail"
  56. element-loading-text="给我一点时间"
  57. :data="listDetail"
  58. border
  59. fit
  60. highlight-current-row
  61. style="width: 100%;"
  62. class="elTable table-fixed"
  63. @selection-change="handleSelectionChange"
  64. >
  65. <el-table-column type="selection" width="55" />
  66. <el-table-column label="序号" align="center" type="index" width="50px">
  67. <template slot-scope="scope">
  68. <span>{{ scope.$index + (pageNumDetail-1) * pageSizeDetail + 1 }}</span>
  69. </template>
  70. </el-table-column>
  71. <el-table-column label="文档名称" align="center">
  72. <template slot-scope="scope">
  73. <span>{{ scope.row.docname }}</span>
  74. </template>
  75. </el-table-column>
  76. <el-table-column label="文件大小" width="140px" align="center">
  77. <template slot-scope="scope">
  78. <span>{{ scope.row.fileSize }}</span>
  79. </template>
  80. </el-table-column>
  81. <el-table-column label="上传时间" min-width="80px" align="center">
  82. <template slot-scope="scope">
  83. <span>{{ scope.row.dtime }}</span>
  84. </template>
  85. </el-table-column>
  86. <el-table-column label="操作" align="center" width="300" class-name="small-padding fixed-width" fixed="right">
  87. <template slot-scope="{row}">
  88. <el-button type="success" size="mini" @click="handleDownloadRow(row)">下载</el-button>
  89. <el-button type="danger" size="mini" @click="handleDelateRow(row)">删除</el-button>
  90. </template>
  91. </el-table-column>
  92. </el-table>
  93. <pagination v-show="totalDetail>0" :total="totalDetail" :page.sync="getdataListParmDetail.offset" :limit.sync="getdataListParmDetail.pagecount" @pagination="getListDetail" />
  94. </div>
  95. <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible" :close-on-click-modal="false" width="50%">
  96. <div class="app-content">
  97. <el-form
  98. ref="createTemp"
  99. :rules="rules"
  100. :model="createTemp"
  101. label-position="right"
  102. label-width="115px"
  103. style="width: 50%;margin:0 auto 30px"
  104. >
  105. <el-row>
  106. <el-col :span="24">
  107. <el-form-item label="文件名称:" prop="direct">
  108. <el-input ref="direct" v-model="createTemp.direct" placeholder="请输入文件名称" />
  109. </el-form-item>
  110. </el-col>
  111. </el-row>
  112. </el-form>
  113. <div slot="footer" class="dialog-footer" style="right:30px;position:absolute;bottom:5px">
  114. <el-button type="primary" :disabled="isokDisable" @click="dialogStatus==='create'?add_dialog_save():add_dialog_save()">保存并关闭</el-button>
  115. <el-button @click="dialogFormVisible = false; getList()">取消并关闭</el-button>
  116. </div>
  117. </div>
  118. </el-dialog>
  119. </div>
  120. </template>
  121. <script>
  122. import { GetDataByName, PostDataByName, failproccess, ExecDataByConfig } from '@/api/common'
  123. import { getToken } from '@/utils/auth'
  124. import waves from '@/directive/waves' // waves directive
  125. import Pagination from '@/components/Pagination' // secondary package based on el-pagination
  126. import axios from 'axios'
  127. import { MessageBox } from 'element-ui'
  128. export default {
  129. name: 'File',
  130. components: { Pagination },
  131. directives: { waves },
  132. data() {
  133. return {
  134. isDisableAdd: false,
  135. isDisableImport: true,
  136. // isDisableDownload: true,
  137. isDisableDelate: false,
  138. isokDisable: false,
  139. isDirectName: true,
  140. isDirectInput: false,
  141. isFilter1: true,
  142. isFilter2: false,
  143. rules: {
  144. direct: [{ required: true, message: '必填', trigger: 'blur' }]
  145. },
  146. checkeds: [],
  147. getdataListParm: {
  148. name: 'getDirectorylist',
  149. parammaps: {}
  150. },
  151. list: [],
  152. total: 0,
  153. pageNum: '',
  154. pageSize: '',
  155. listLoading: true,
  156. textMap: {
  157. create: '新增'
  158. },
  159. dialogFormVisible: false,
  160. dialogStatus: '',
  161. createTemp: {
  162. direct: ''
  163. },
  164. requestParam: {},
  165. fileList: true,
  166. detailList: false,
  167. listDetail: [],
  168. listLoadingDetail: false,
  169. totalDetail: 0,
  170. getdataListParmDetail: {
  171. name: 'getFilelist',
  172. page: 1,
  173. offset: 1,
  174. pagecount: 10,
  175. returntype: 'Map',
  176. parammaps: {
  177. id: '',
  178. docname: ''
  179. }
  180. },
  181. getdataListAllParm: {
  182. name: 'searchFileList',
  183. page: 1,
  184. offset: 1,
  185. pagecount: 10,
  186. returntype: 'Map',
  187. parammaps: {
  188. docname: ''
  189. }
  190. },
  191. temp: {},
  192. postDataPramas: {},
  193. isFolderDelate: true,
  194. isFileDownload: false,
  195. isFileDelate: false,
  196. selectionList: []
  197. }
  198. },
  199. computed: {
  200. // 设置请求头
  201. headers() {
  202. return {
  203. optname: 'insertcustomdoc',
  204. id: 1,
  205. token: getToken()
  206. }
  207. },
  208. uploadData() {
  209. return {
  210. // name: 'importOilcard',
  211. // importParams: '文档名称,文件大小,上传时间',
  212. // sheetname: 'SheetJS'
  213. }
  214. },
  215. uploadExcelUrl() {
  216. // process.env.VUE_APP_BASE_API是服务器的路径,也是axios的基本路径
  217. return process.env.VUE_APP_BASE_API + 'authdata/upload' + '/' + this.temp.id + '/' + this.temp.direct
  218. }
  219. },
  220. created() {
  221. this.getList()
  222. },
  223. methods: {
  224. getList() {
  225. this.listLoading = true
  226. GetDataByName(this.getdataListParm).then(response => {
  227. console.log('list数据', response.data.list)
  228. if (response.data.list.length > 0) {
  229. for (var i = 0; i < response.data.list.length; i++) {
  230. if (response.data.list[i].checkeds == 'false') {
  231. response.data.list[i].checkeds = false
  232. response.data.list[i].isDirectName = true
  233. response.data.list[i].isDirectInput = false
  234. }
  235. }
  236. }
  237. this.list = response.data.list
  238. this.pageNum = response.data.pageNum
  239. this.pageSize = response.data.pageSize
  240. if (response.data.total) {
  241. this.total = response.data.total
  242. }
  243. setTimeout(() => {
  244. this.listLoading = false
  245. }, 100)
  246. })
  247. },
  248. form_search() {
  249. // 隐藏文件夹,显示文件
  250. this.fileList = false
  251. this.detailList = true
  252. console.log('点击了全局搜索')
  253. this.listLoadingDetail = true
  254. this.getdataListAllParm.offset = 1
  255. GetDataByName(this.getdataListAllParm).then(response => {
  256. console.log('list数据', response.data.list)
  257. this.listDetail = response.data.list
  258. this.pageNumDetail = response.data.pageNum
  259. this.pageSizeDetail = response.data.pageSize
  260. if (response.data.total) {
  261. this.totalDetail = response.data.total
  262. }
  263. setTimeout(() => {
  264. this.listLoadingDetail = false
  265. }, 100)
  266. })
  267. },
  268. form_search2() {
  269. console.log('点击了局部搜索')
  270. this.getdataListParmDetail.offset = 1
  271. this.getListDetail()
  272. },
  273. resetCreateTemp() {
  274. this.createTemp.direct = ''
  275. },
  276. // 新建文件
  277. form_add() {
  278. this.resetCreateTemp()
  279. this.dialogStatus = 'create'
  280. this.dialogFormVisible = true
  281. },
  282. add_dialog_save() {
  283. this.isokDisable = true
  284. setTimeout(() => {
  285. this.isokDisable = false
  286. }, 1000)
  287. this.$refs['createTemp'].validate(valid => {
  288. if (valid) {
  289. this.requestParam.name = 'insertDirectory'
  290. this.requestParam.parammaps = {}
  291. this.requestParam.parammaps.direct = this.createTemp.direct
  292. PostDataByName(this.requestParam).then(response => {
  293. console.log('新增保存发送参数', this.requestParam)
  294. if (response.msg !== 'fail') {
  295. this.dialogFormVisible = false
  296. this.getList()
  297. this.$notify({
  298. title: '成功',
  299. message: '新增成功',
  300. type: 'success',
  301. duration: 2000
  302. })
  303. } else {
  304. failproccess(response, this.$notify)
  305. }
  306. })
  307. }
  308. })
  309. },
  310. // 点击文件名进行更新
  311. form_edit(item) {
  312. console.log('点击标题得到数据', item)
  313. for (var i = 0; i < this.list.length; i++) {
  314. if (this.list[i].id === item.id) {
  315. this.list[i].isDirectName = false
  316. this.list[i].isDirectInput = true
  317. }
  318. }
  319. this.$nextTick(() => {
  320. document.getElementById('direct').focus()
  321. })
  322. },
  323. blurName(item) {
  324. console.log('失去焦点得到的值', item)
  325. item.isDirectName = true
  326. item.isDirectInput = false
  327. this.requestParam.name = 'updateDirectory'
  328. this.requestParam.parammaps = {}
  329. this.requestParam.parammaps.id = item.id
  330. this.requestParam.parammaps.direct = item.direct
  331. PostDataByName(this.requestParam).then(response => {
  332. console.log('修改保存发送参数', this.requestParam)
  333. if (response.msg !== 'fail') {
  334. this.dialogFormVisible = false
  335. this.getList()
  336. this.$notify({
  337. title: '成功',
  338. message: '修改成功',
  339. type: 'success',
  340. duration: 2000
  341. })
  342. } else {
  343. failproccess(response, this.$notify)
  344. }
  345. })
  346. },
  347. // 点击文件夹
  348. handlFile(item) {
  349. // 隐藏多文件夹上传
  350. this.isFolderDelate = false
  351. // 隐藏多文件导出
  352. this.isFileDownload = true
  353. // 隐藏多文件删除
  354. this.isFileDelate = true
  355. console.log('点击了文件', item)
  356. this.temp = item
  357. this.fileList = false
  358. this.detailList = true
  359. this.isDisableAdd = true
  360. this.isDisableImport = false
  361. // this.isDisableDownload = false
  362. // this.isDisableDelate = false
  363. // 搜索1隐藏,搜索2显示
  364. this.isFilter1 = false
  365. this.isFilter2 = true
  366. this.getdataListParmDetail.parammaps.id = item.id
  367. this.getListDetail()
  368. },
  369. // 文件详情
  370. getListDetail() {
  371. this.listLoadingDetail = true
  372. GetDataByName(this.getdataListParmDetail).then(response => {
  373. console.log('list数据', response.data.list)
  374. console.log(response.data.pageNum, response.data.pageSize)
  375. if (response.data.list !== null || response.data !== null) {
  376. this.listDetail = response.data.list
  377. this.pageNumDetail = response.data.pageNum
  378. this.pageSizeDetail = response.data.pageSize
  379. if (response.data.total) {
  380. this.totalDetail = response.data.total
  381. }
  382. } else {
  383. this.listDetail = []
  384. }
  385. setTimeout(() => {
  386. this.listLoadingDetail = false
  387. }, 100)
  388. })
  389. },
  390. // 回到全部文件
  391. goBack() {
  392. this.fileList = true
  393. this.detailList = false
  394. this.isDisableAdd = false
  395. this.isDisableImport = true
  396. // this.isDisableDownload = false
  397. // this.isDisableDelate = false
  398. // 搜索1显示,搜索2隐藏
  399. this.isFilter1 = true
  400. this.isFilter2 = false
  401. // 文件夹批量删除
  402. this.isFolderDelate = true
  403. // 多文件导出
  404. this.isFileDownload = false
  405. // 多文件删除
  406. this.isFileDelate = false
  407. },
  408. // 多文件夹删除
  409. handleFolderDelate() {
  410. if (this.list.length > 0) {
  411. this.checkeds = []
  412. for (var i = 0; i < this.list.length; i++) {
  413. if (this.list[i].checkeds == true) {
  414. this.checkeds.push({ id: this.list[i].id })
  415. }
  416. }
  417. console.log(this.checkeds)
  418. if (this.checkeds.length > 0) {
  419. MessageBox.confirm('确认删除以下选中文件?', {
  420. confirmButtonText: '确认',
  421. cancelButtonText: '取消',
  422. type: 'warning'
  423. }).then(() => {
  424. this.postDataPramas.common = { 'returnmap': '0' }
  425. this.postDataPramas.data = []
  426. this.postDataPramas.data[0] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.checkeds }}
  427. this.postDataPramas.data[0].children = []
  428. this.postDataPramas.data[0].children[0] = { 'name': 'deleteDirectory', 'type': 'e', 'parammaps': {
  429. id: '@insertSpotList.id'
  430. }}
  431. ExecDataByConfig(this.postDataPramas).then(response => {
  432. console.log('删除保存发送参数', this.postDataPramas)
  433. if (response.msg === 'fail') {
  434. this.$notify({
  435. title: '删除失败',
  436. message: response.data,
  437. type: 'warning',
  438. duration: 2000
  439. })
  440. } else {
  441. this.dialogFormVisible = false
  442. this.getList()
  443. this.$notify({
  444. title: '',
  445. message: '删除成功',
  446. type: 'success',
  447. duration: 2000
  448. })
  449. }
  450. })
  451. }).catch(() => {
  452. this.$message({
  453. type: 'info',
  454. message: '已取消删除'
  455. })
  456. })
  457. } else {
  458. this.$message({
  459. type: 'warning',
  460. message: '请选择要删出的文件夹'
  461. })
  462. }
  463. } else {
  464. this.$message({
  465. type: 'warning',
  466. message: '无文件要删除'
  467. })
  468. }
  469. },
  470. // 文件上传
  471. beforeImportExcel(file) {
  472. const isLt100M = file.size / 1024 / 1024 < 100
  473. if (!isLt100M) {
  474. this.$message.error('上传文件大小不能超过 100MB!')
  475. }
  476. return isLt100M
  477. },
  478. // 文件上传成功
  479. handleImportExcelSuccess(res, file) {
  480. if (res.execresult.RowsAffected > 0) {
  481. this.$message({
  482. title: '成功',
  483. message: '上传成功',
  484. type: 'success',
  485. duration: 2000
  486. })
  487. this.getListDetail()
  488. } else {
  489. this.$notify({
  490. title: '失败',
  491. message: '上传失败或文件名重复',
  492. type: 'danger',
  493. duration: 2000
  494. })
  495. }
  496. },
  497. // 文件上传失败
  498. handleImportExcelErro(err, file, fileList) {
  499. console.log(err.message)
  500. this.$message.error(err.message)
  501. // const message = new RegExp('不支持的文件类型')
  502. // if (message.test(err.message)) {
  503. // this.$message.error('不支持的文件类型')
  504. // }
  505. },
  506. // 下载文件
  507. handleDownloadFolder() {
  508. console.log('点击了文件夹下载-接口待对', this.checkeds)
  509. this.checkeds = []
  510. for (var i = 0; i < this.list.length; i++) {
  511. if (this.list[i].checkeds == true) {
  512. console.log(this.list[i])
  513. this.checkeds.push(this.list[i].id)
  514. }
  515. }
  516. console.log(this.checkeds)
  517. if (this.checkeds.length > 0) {
  518. } else {
  519. console.log('请选择文件夹')
  520. }
  521. },
  522. // 多文件下载
  523. handleFileDownload() {
  524. if (this.listDetail.length > 0) {
  525. if (this.selectionList.length > 0) {
  526. console.log(this.selectionList)
  527. for (let i = 0; i < this.selectionList.length; i++) {
  528. const url = process.env.VUE_APP_BASE_API + 'authdata/downloadfile' + '/' + this.selectionList[i].id// 请求下载文件的地址
  529. axios.get(url, {
  530. headers: {
  531. token: getToken(),
  532. optname: 'insertcustomdoc'
  533. },
  534. responseType: 'blob'
  535. }).then(res => {
  536. if (!res) return
  537. const blob = new Blob([res.data], {
  538. type: 'application/octet-stream;charset=utf-8'
  539. })
  540. const url = window.URL.createObjectURL(blob)
  541. const aLink = document.createElement('a')
  542. aLink.style.display = 'none'
  543. aLink.href = url
  544. const docname = this.selectionList[i].docname
  545. aLink.setAttribute('download', docname) // 下载的文件
  546. document.body.appendChild(aLink)
  547. aLink.click()
  548. document.body.removeChild(aLink)
  549. window.URL.revokeObjectURL(url)
  550. }).catch(error => {
  551. this.$message.error(error)
  552. })
  553. }
  554. } else {
  555. this.$message({
  556. type: 'warning',
  557. message: '请选择要下载的文件'
  558. })
  559. }
  560. } else {
  561. this.$message({
  562. type: 'warning',
  563. message: '无文件要下载'
  564. })
  565. }
  566. },
  567. // 多文件删除
  568. handleFileDelate() {
  569. if (this.listDetail.length > 0) {
  570. if (this.selectionList.length > 0) {
  571. console.log(this.selectionList)
  572. MessageBox.confirm('确认删除此信息?', {
  573. confirmButtonText: '确认',
  574. cancelButtonText: '取消',
  575. type: 'warning'
  576. }).then(() => {
  577. for (let i = 0; i < this.selectionList.length; i++) {
  578. const url = process.env.VUE_APP_BASE_API + 'authdata/removefile' + '/' + this.selectionList[i].id
  579. const token = getToken()
  580. axios.defaults.headers.common['Authorization'] = token
  581. axios.defaults.headers.common['token'] = token
  582. axios.post(url, {}).then(res => {
  583. console.log(res)
  584. if (res.data.msg == 'ok') {
  585. this.$message({
  586. title: '成功',
  587. message: '删除成功',
  588. type: 'success',
  589. duration: 2000
  590. })
  591. this.getListDetail()
  592. } else {
  593. this.$notify({
  594. title: '失败',
  595. message: '删除失败',
  596. type: 'danger',
  597. duration: 2000
  598. })
  599. }
  600. }).catch(error => {
  601. this.$message.error(error)
  602. })
  603. }
  604. })
  605. } else {
  606. this.$message({
  607. type: 'warning',
  608. message: '请选择要下载的文件'
  609. })
  610. }
  611. } else {
  612. this.$message({
  613. type: 'warning',
  614. message: '无文件要下载'
  615. })
  616. }
  617. },
  618. // 行内下载
  619. handleDownloadRow(row) {
  620. console.log('行内下载')
  621. const url = process.env.VUE_APP_BASE_API + 'authdata/downloadfile' + '/' + row.id// 请求下载文件的地址
  622. axios.get(url, {
  623. headers: {
  624. token: getToken(),
  625. optname: 'insertcustomdoc'
  626. },
  627. responseType: 'blob'
  628. }).then(res => {
  629. if (!res) return
  630. const blob = new Blob([res.data], {
  631. type: 'application/octet-stream;charset=utf-8'
  632. })
  633. const url = window.URL.createObjectURL(blob)
  634. const aLink = document.createElement('a')
  635. aLink.style.display = 'none'
  636. aLink.href = url
  637. console.log(row.docname)
  638. const docname = row.docname
  639. aLink.setAttribute('download', docname) // 下载的文件
  640. document.body.appendChild(aLink)
  641. aLink.click()
  642. document.body.removeChild(aLink)
  643. window.URL.revokeObjectURL(url)
  644. }).catch(error => {
  645. this.$message.error(error)
  646. })
  647. },
  648. // 行内删除
  649. handleDelateRow(row) {
  650. const url = process.env.VUE_APP_BASE_API + 'authdata/removefile' + '/' + row.id
  651. const token = getToken()
  652. axios.defaults.headers.common['Authorization'] = token
  653. axios.defaults.headers.common['token'] = token
  654. axios.post(url, {}).then(res => {
  655. console.log(res)
  656. if (res.data.msg == 'ok') {
  657. this.$message({
  658. title: '成功',
  659. message: '删除成功',
  660. type: 'success',
  661. duration: 2000
  662. })
  663. this.getListDetail()
  664. } else {
  665. this.$notify({
  666. title: '失败',
  667. message: '删除失败',
  668. type: 'danger',
  669. duration: 2000
  670. })
  671. }
  672. }).catch(error => {
  673. this.$message.error(error)
  674. })
  675. },
  676. handleSelectionChange(val) {
  677. console.log(val)
  678. this.selectionList = val
  679. }
  680. }
  681. }
  682. </script>
  683. <style lang="scss" scoped>
  684. .time {
  685. font-size: 13px;
  686. color: #999;
  687. }
  688. .bottom {
  689. margin-top: 13px;
  690. line-height: 12px;
  691. }
  692. .button {
  693. padding: 0;
  694. float: right;
  695. }
  696. .image {
  697. width: 100%;
  698. display: block;
  699. }
  700. .clearfix:before,
  701. .clearfix:after {
  702. display: table;
  703. content: "";
  704. }
  705. .clearfix:after {
  706. clear: both
  707. }
  708. .app-btn{
  709. height: 50px;
  710. .btn-l{float: left;}
  711. .btn-r{
  712. float: right;
  713. }
  714. }
  715. .content{
  716. clear: both
  717. }
  718. .el-input input{
  719. width: 100px !important;
  720. height: 20px !important;
  721. }
  722. .contentCard{
  723. width: 10%;
  724. height: 150px;
  725. float: left;
  726. .contentCard-img{
  727. width: 10%;
  728. height: 100px;
  729. position: relative;
  730. left: 0;
  731. right: 0;
  732. margin: 0 auto;
  733. .contentCard-icon{
  734. position:absolute;
  735. width:100px;
  736. height:100px;
  737. left: 50%;
  738. margin-left: -50px;
  739. top: 50%;
  740. margin-top: -50px;
  741. }
  742. .contentCard-checkbox{
  743. position:absolute;
  744. right:-35px;
  745. bottom:10px;
  746. }
  747. }
  748. .contentCard-title{
  749. width:100px;
  750. margin:0 auto;
  751. text-align:center;
  752. line-height:20px;
  753. .contentCard-title-name{
  754. text-align: center;
  755. }
  756. .contentCard-title-input{
  757. width: 100px;
  758. outline:medium;
  759. border:none;
  760. border: 1px solid #DCDFE6;
  761. color: #606266;
  762. }
  763. }
  764. }
  765. .app-detailList{
  766. .title{
  767. height: 50px;
  768. line-height: 50px;
  769. .all-file{
  770. font-weight: 700;
  771. }
  772. }
  773. }
  774. </style>