| | |
| | | :table-loading="loading" |
| | | :data="data" |
| | | :page.sync="page" |
| | | :permission="permissionList" |
| | | :before-open="beforeOpen" |
| | | :permission="permissionList" |
| | | v-model="form" |
| | | ref="crud" |
| | | @row-del="rowDel" |
| | |
| | | @refresh-change="refreshChange" |
| | | @on-load="onLoad"> |
| | | <template slot="menuLeft"> |
| | | <el-button type="primary" |
| | | <el-button v-if="hasUpload" type="primary" |
| | | size="small" |
| | | plain |
| | | icon="el-icon-upload2" |
| | | @click="handleUpload">上 传 |
| | | </el-button> |
| | | <el-button type="primary" |
| | | <el-button v-if="hasEdit" type="primary" |
| | | size="small" |
| | | plain |
| | | icon="el-icon-edit" |
| | | @click="handleEdit">修 改 |
| | | </el-button> |
| | | <el-button type="danger" |
| | | <el-button v-if="hasDownload" type="primary" |
| | | size="small" |
| | | icon="el-icon-download" |
| | | plain |
| | | @click="handleDownload">下 载 |
| | | </el-button> |
| | | <el-button v-if="hasDel" type="danger" |
| | | size="small" |
| | | icon="el-icon-delete" |
| | | plain |
| | |
| | | </el-button> |
| | | </template> |
| | | <template slot-scope="scope" slot="menu"> |
| | | <el-button type="text" |
| | | <el-button v-if="hasDownload" type="text" |
| | | icon="el-icon-download" |
| | | size="small" |
| | | @click="handleDownload(scope.row)">下载 |
| | |
| | | import {getList, getFile,upload,update, remove,download} from "@/api/resource/file"; |
| | | import {mapGetters} from "vuex"; |
| | | import {dateFormat} from "@/util/date"; |
| | | import {validatenull} from "@/util/validate"; |
| | | |
| | | export default { |
| | | props: ["options","visible"], |
| | |
| | | }, |
| | | attachBox: false, |
| | | selectionList: [], |
| | | hasUpload:validatenull(this.options.hasUpload) ? true :this.options.hasUpload, |
| | | hasEdit:validatenull(this.options.hasEdit) ? true :this.options.hasEdit, |
| | | hasDel:validatenull(this.options.hasDel) ? true :this.options.hasDel, |
| | | hasDownload:validatenull(this.options.hasDownload) ? true :this.options.hasDownload, |
| | | option: { |
| | | height: 'auto', |
| | | height:(this.options.tableHeight?this.options.tableHeight:'auto'), |
| | | calcHeight: 30, |
| | | tip: false, |
| | | searchShow: true, |
| | |
| | | date: "date", |
| | | refer: "refer", |
| | | }, |
| | | data: [{ |
| | | btmname: "fileobject", |
| | | createTime: "2023-06-14 16:08:50.002", |
| | | creator: "1", |
| | | fileDocClassify: "undefined", |
| | | fileDocClassifyName: null, |
| | | fileExtension: "png", |
| | | filePath: "VolumnFactoryService:/f87a4c92-ce6e-458b-aad0-0c76bd5eeb35\\54120082-76aa-4092-abbf-b13cb40606c5", |
| | | fileSize: 858, |
| | | id: "assignRole", |
| | | name: "assignRole", |
| | | nameOid: "9FF4C05D-4EFA-F00B-0080-5ABB50257D4E", |
| | | oid: "54120082-76aa-4092-abbf-b13cb40606c5", |
| | | ownBtmname: "wupin", |
| | | ownbizOid: "6EF696C3-CD87-0E7C-1EA1-8DE3913A95C9", |
| | | owner: "1", |
| | | secretGrade: null, |
| | | secretGradeText: null |
| | | }], |
| | | data: [], |
| | | attachForm: {}, |
| | | attachOption: { |
| | | submitBtn: false, |
| | |
| | | }; |
| | | }, |
| | | computed: { |
| | | ...mapGetters(["permission"]), |
| | | ...mapGetters([ "permission"]), |
| | | permissionList() { |
| | | return { |
| | | addBtn: false, |
| | | editBtn: false, |
| | | viewBtn: false, |
| | | delBtn: this.vaildData(this.permission.attach_delete, false) |
| | | delBtn: this.vaildData(this.permission.attach_delete, false), |
| | | editBtn: false |
| | | }; |
| | | }, |
| | | oids() { |
| | |
| | | return oids.join(","); |
| | | } |
| | | }, |
| | | mounted() { |
| | | created() { |
| | | this.setFormItem(); |
| | | this.setParams() |
| | | }, |
| | | mounted() { |
| | | |
| | | }, |
| | | methods: { |
| | | setFormItem(){ |
| | |
| | | } |
| | | return []; |
| | | }, |
| | | setParams(){ |
| | | setParams() { |
| | | var queryMap = { |
| | | currentButtonKey:'VIEW', |
| | | ownbizOid:this.options.ownbizOid, |
| | | ownbizBtm:this.options.ownbizBtm |
| | | currentButtonKey: 'VIEW', |
| | | ownbizOid: this.options.ownbizOid, |
| | | ownbizBtm: this.options.ownbizBtm, |
| | | fileDocClassify: this.options.fileDocClassify, |
| | | fileDocClassifyName: this.options.fileDocClassifyName |
| | | }; |
| | | if(this.options.where){ |
| | | Object.assign(queryMap,this.options.where); |
| | | if (this.options.where) { |
| | | Object.assign(queryMap, this.options.where); |
| | | } |
| | | this.params=queryMap; |
| | | this.params = queryMap; |
| | | |
| | | if (!this.options.pageObject) { |
| | | this.options.pageObject = { |
| | | limit: 10, |
| | | page: 1 |
| | | }; |
| | | } |
| | | this.page.pageSize = this.options.pageObject.limit; |
| | | this.page.currentPage = this.options.pageObject.page; |
| | | }, |
| | | handleUpload() { |
| | | this.attachOption.column[1].data.fileOid=''; |
| | |
| | | }, |
| | | handleEdit() { |
| | | if(this.selectionList.length==0){ |
| | | this.$message.error('请选择需要修改的文件') |
| | | this.$message.warning('请选择需要修改的文件') |
| | | return false; |
| | | }else if(this.selectionList.length>1){ |
| | | this.$message.error('请选择一条数据') |
| | | this.$message.warning('请选择一条数据') |
| | | return false; |
| | | } |
| | | this.attachOption.column[1].data.fileOid=this.oids; |
| | |
| | | }, |
| | | handleDownload(row) { |
| | | //window.open(`${row.link}`); |
| | | download(row.oid) |
| | | if(row && row.oid){ |
| | | download(row.oid) |
| | | }else{ |
| | | if (this.selectionList.length === 0) { |
| | | this.$message.warning("请选择至少一条数据"); |
| | | return; |
| | | } |
| | | download(this.oids); |
| | | } |
| | | }, |
| | | rowDel(row) { |
| | | this.$confirm("确定将选择文件删除?", { |
| | |
| | | getList(page.currentPage, page.pageSize, Object.assign(params,this.params, query,this.query)).then(res => { |
| | | const data = res.data.data; |
| | | this.page.total = data.total; |
| | | this.data = data.records; |
| | | if(data && data.records.length>0 && this.options.fileDocClassifyCombox){ |
| | | this.data = data.records.map(item => { |
| | | if(validatenull(item.fileDocClassifyName)&& !validatenull(item.fileDocClassify)){ |
| | | item.fileDocClassifyName = this.options.fileDocClassifyCombox[item.fileDocClassify] || ''; |
| | | } |
| | | return { |
| | | ...item |
| | | } |
| | | }) |
| | | } |
| | | //this.data = data.records; |
| | | this.loading = false; |
| | | this.selectionClear(); |
| | | }).catch(error=>{ |
| | | this.$message.error(error); |
| | | this.loading = false; |
| | | }); |
| | | } |
| | | } |