| | |
| | | :before-open="beforeOpen" |
| | | v-model="form" |
| | | ref="crud" |
| | | @row-click="rowClick" |
| | | @row-del="rowDel" |
| | | @search-change="searchChange" |
| | | @search-reset="searchReset" |
| | |
| | | @refresh-change="refreshChange" |
| | | @on-load="onLoad"> |
| | | <template slot="menuLeft"> |
| | | <el-button type="primary" |
| | | size="small" |
| | | plain |
| | | icon="el-icon-upload2" |
| | | @click="handleUpload">上 传 |
| | | </el-button> |
| | | <el-button type="danger" |
| | | size="small" |
| | | icon="el-icon-delete" |
| | | plain |
| | | @click="handleDelete">删 除 |
| | | </el-button> |
| | | <!-- <el-button type="primary"--> |
| | | <!-- size="small"--> |
| | | <!-- plain--> |
| | | <!-- icon="el-icon-upload2"--> |
| | | <!-- @click="handleUpload">上 传--> |
| | | <!-- </el-button>--> |
| | | <!-- <el-button type="danger"--> |
| | | <!-- size="small"--> |
| | | <!-- icon="el-icon-delete"--> |
| | | <!-- plain--> |
| | | <!-- @click="handleDelete">删 除--> |
| | | <!-- </el-button>--> |
| | | </template> |
| | | <template slot-scope="scope" slot="menu"> |
| | | <el-button type="text" |
| | |
| | | <script> |
| | | import {getList, getDetail, remove} from "@/api/resource/attach"; |
| | | import {mapGetters} from "vuex"; |
| | | import ElImageViewer from 'element-ui/packages/image/src/image-viewer' |
| | | |
| | | export default { |
| | | components: { ElImageViewer }, |
| | | data() { |
| | | return { |
| | | form: {}, |
| | | query: {}, |
| | | loading: true, |
| | | imgUrl: '', |
| | | showViewer: false, // 显示查看器 |
| | | page: { |
| | | pageSize: 10, |
| | | currentPage: 1, |
| | |
| | | tip: false, |
| | | searchShow: true, |
| | | searchMenuSpan: 6, |
| | | headerAlign: 'center', |
| | | border: true, |
| | | index: true, |
| | | viewBtn: true, |
| | |
| | | label: "类型", |
| | | prop: "type", |
| | | addDisplay: false, |
| | | width: 80, |
| | | type: "select", |
| | | dicData: [ |
| | | { |
| | |
| | | propsHttp: { |
| | | res: 'data' |
| | | }, |
| | | action: "/api/blade-resource/oss/endpoint/put-file-attach?deptid=" |
| | | action: "/api/blade-resource/oss/endpoint/put-file-attach?deptid=" |
| | | } |
| | | ] |
| | | } |
| | | }; |
| | | }, |
| | | created() { |
| | | var flag = false,i=0,ind=null |
| | | this.$store.state.tags.tagList.forEach((item,index)=>{ |
| | | if(item.label=="附件上传"){ |
| | | if(flag==false){ |
| | | ind=index |
| | | flag=true |
| | | var flag = false, i = 0, ind = null |
| | | this.$store.state.tags.tagList.forEach((item, index) => { |
| | | if (item.label == "附件上传") { |
| | | if (flag == false) { |
| | | ind = index |
| | | flag = true |
| | | } |
| | | i++ |
| | | } |
| | | }) |
| | | if(i>1){ |
| | | this.$store.state.tags.tagList.splice(ind,1) |
| | | if (i > 1) { |
| | | this.$store.state.tags.tagList.splice(ind, 1) |
| | | |
| | | } |
| | | var deptid = this.$route.query.deptid; |
| | |
| | | } |
| | | }, |
| | | methods: { |
| | | rowClick(row) { |
| | | var that = this; |
| | | that.imgUrl = row.link |
| | | this.showViewer = true |
| | | }, |
| | | handleUpload() { |
| | | this.attachBox = true; |
| | | }, |
| | |
| | | }, |
| | | onLoad(page, params = {}) { |
| | | this.loading = true; |
| | | getList(page.currentPage, page.pageSize, Object.assign(params, this.query),this.$route.query.deptid,this.$route.query.type).then(res => { |
| | | getList(page.currentPage, page.pageSize, Object.assign(params, this.query), this.$route.query.deptid, this.$route.query.type).then(res => { |
| | | const data = res.data.data; |
| | | this.page.total = data.total; |
| | | this.data = data.records; |
| | | this.loading = false; |
| | | this.selectionClear(); |
| | | }); |
| | | } |
| | | }, |
| | | } |
| | | }; |
| | | </script> |