| | |
| | | page: { |
| | | pageSize: 10, |
| | | currentPage: 1, |
| | | total: 0, |
| | | total: 0 |
| | | }, |
| | | attachBox: false, |
| | | selectionList: [], |
| | |
| | | { |
| | | label: "附件名称", |
| | | prop: "originalname", |
| | | overHidden: true, |
| | | overHidden: true |
| | | }, |
| | | { |
| | | label: "附件状态", |
| | | prop: "type", |
| | | width: 110, |
| | | slot: true, |
| | | overHidden: true, |
| | | overHidden: true |
| | | }, |
| | | { |
| | | label: "示范模板", |
| | | prop: "downtemplate", |
| | | width: 110, |
| | | // overHidden: true, |
| | | slot: true, |
| | | }, |
| | | ], |
| | | slot: true |
| | | } |
| | | ] |
| | | }, |
| | | data: [], |
| | | attachForm: {}, |
| | |
| | | span: 12, |
| | | drag: true, |
| | | propsHttp: { |
| | | res: "data", |
| | | res: "data" |
| | | }, |
| | | tip: "支持上传jpg/png/doc/docx/xls/xlsx文件,图片不超过500Kb,文档不超过3Mb", |
| | | tip: |
| | | "支持上传jpg/png/doc/docx/xls/xlsx文件,图片不超过500Kb,文档不超过3Mb", |
| | | action: |
| | | // "/api/blade-resource/oss/endpoint/put-file-attach", |
| | | "/api/blade-resource/oss/endpoint/put-file-attach?deptid=&type=" + |
| | | type + |
| | | "&cardid=" + |
| | | cardid, |
| | | }, |
| | | ], |
| | | cardid |
| | | } |
| | | ] |
| | | }, |
| | | imgSee: false, |
| | | imgUrl: "", |
| | |
| | | saveIds: [], |
| | | saveLinks: [], |
| | | onceIds: "", |
| | | onceLinks: "", |
| | | onceLinks: "" |
| | | }; |
| | | }, |
| | | computed: { |
| | |
| | | addBtn: false, |
| | | editBtn: false, |
| | | viewBtn: false, |
| | | delBtn: this.vaildData(this.permission.attach_delete, false), |
| | | delBtn: this.vaildData(this.permission.attach_delete, false) |
| | | }; |
| | | }, |
| | | ids() { |
| | | let ids = []; |
| | | this.selectionList.forEach((ele) => { |
| | | this.selectionList.forEach(ele => { |
| | | ids.push(ele.id); |
| | | }); |
| | | return ids.join(","); |
| | | }, |
| | | } |
| | | }, |
| | | mounted() { |
| | | // console.log(this.enclosure, "enclosure"); |
| | |
| | | }, |
| | | methods: { |
| | | upData(val) { |
| | | console.log(val); |
| | | this.onceIds = +val.id - 1 + ""; |
| | | // console.log(val); |
| | | this.onceIds = +val.id + ""; |
| | | this.attachBox = true; |
| | | }, |
| | | dowmData(val) { |
| | |
| | | this.attachBox = true; |
| | | }, |
| | | uploadAfter(res, done, loading, column) { |
| | | window.console.log(res.link); |
| | | // window.console.log(res.link); |
| | | var test = /^http:\/\/.*/; |
| | | if (!test.test(res.link)) { |
| | | this.$message.error("上传失败"); |
| | | return; |
| | | } |
| | | this.onceLinks = res.link; |
| | | // console.log(res); |
| | | // return; |
| | | var haveit = null; |
| | | for (let k in this.saveIds) { |
| | | if (this.saveIds[k] == this.onceIds) { |
| | |
| | | this.saveIds.push(this.onceIds); |
| | | this.saveLinks.push(this.onceLinks); |
| | | } |
| | | console.log(this.saveIds); |
| | | console.log(this.saveLinks); |
| | | // console.log(this.saveIds); |
| | | // console.log(this.saveLinks); |
| | | |
| | | // console.log(this.$store.getters.userInfo.Id); |
| | | var params = { |
| | | userid: this.$store.getters.userInfo.Id, |
| | | ptype: this.ptype, |
| | | templateid: this.saveIds.join(","), |
| | | links: this.saveLinks.join(","), |
| | | links: this.saveLinks.join(",") |
| | | }; |
| | | addUseInfor(params).then((res) => { |
| | | // console.log(params); |
| | | // loading(); |
| | | // return; |
| | | addUseInfor(params).then(res => { |
| | | // console.log(res); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | message: "操作成功!" |
| | | }); |
| | | }); |
| | | this.refreshChange(); |
| | |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning", |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return remove(row.id); |
| | |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | message: "操作成功!" |
| | | }); |
| | | }); |
| | | }, |
| | |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning", |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return remove(this.ids); |
| | |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | message: "操作成功!" |
| | | }); |
| | | this.$refs.crud.toggleSelection(); |
| | | }); |
| | | }, |
| | | beforeOpen(done, type) { |
| | | if (["edit", "view"].includes(type)) { |
| | | getDetail(this.form.id).then((res) => { |
| | | getDetail(this.form.id).then(res => { |
| | | this.form = res.data.data; |
| | | }); |
| | | } |
| | |
| | | // console.log(this.$store.getters.userInfo.Id); |
| | | // this.data = this.enclosure; |
| | | params["ptype"] = this.ptype; |
| | | getTemplate(params, 1, 50).then((res) => { |
| | | getTemplate(params, 1, 50).then(res => { |
| | | data = res.data.data.records; |
| | | // console.log(data, "::template"); |
| | | params["userid"] = this.$store.getters.userInfo.Id; |
| | | getUseInfor(params).then((res) => { |
| | | getUseInfor(params).then(res => { |
| | | var userInfo = res.data.data.records; |
| | | // console.log(userInfo, "::userInfo"); |
| | | if (userInfo.length == 0) { |
| | |
| | | this.saveLinks = userInfo[0].links.split(","); |
| | | for (let k in data) { |
| | | for (let i in this.saveIds) { |
| | | if (+data[k].id - 1 == this.saveIds[i]) { |
| | | if (+data[k].id == this.saveIds[i]) { |
| | | data[k]["type"] = 2; |
| | | data[k]["down"] = this.saveLinks[i]; |
| | | } |
| | |
| | | "webp", |
| | | "psd", |
| | | "svg", |
| | | "tiff", |
| | | "tiff" |
| | | ].indexOf(ext.toLowerCase()) == -1 |
| | | ); |
| | | }, |
| | | }, |
| | | } |
| | | } |
| | | }; |
| | | </script> |
| | | |