| | |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { |
| | | getListPicture, |
| | |
| | | tupian(formData) |
| | | .then(response => { |
| | | console.log('成功了', response); |
| | | if (response.code === 200 && response.base64) { |
| | | if (response.code === 200) { |
| | | this.$message.success('图片上传成功!'); |
| | | const index = this.tableList.findIndex(item => item.proId === proId); |
| | | if (index !== -1) { |
| | | // 保存 base64 图像用于显示 |
| | | if (response.base64) { |
| | | const base64Image = `data:image/${fileExtension};base64,${response.base64}`; |
| | | this.$set(this.tableList[index], 'imageUrl', base64Image); |
| | | } |
| | | // 保存返回的 url |
| | | if (response.url) { |
| | | this.$set(this.tableList[index], 'url', response.url); |
| | | } |
| | | } |
| | | } else { |
| | | this.$message.error('图片上传失败!'); |
| | |
| | | let tjNumber = val; |
| | | this.loading = true; |
| | | getYxJcXx(tjNumber).then((res) => { |
| | | this.tableList = res.data; |
| | | this.tableList = res.data.map(item => { |
| | | // 如果 imageUrl 存在且是纯 Base64 字符串,添加 data:image 前缀 |
| | | if (item.imageUrl && !item.imageUrl.startsWith('data:image')) { |
| | | // 假设图片类型为 png,如果接口提供类型,可以替换为动态值 |
| | | item.imageUrl = `data:image/png;base64,${item.imageUrl}`; |
| | | } |
| | | return item; |
| | | }); |
| | | this.loading = false; |
| | | this.$nextTick(() => { |
| | | const headerCheckbox = this.$refs.mu.$el.querySelector( |
| | |
| | | const proId = this.selectedRow.proId; |
| | | const jcsj = this.form.proResult || " "; |
| | | const jcjl = this.form.conclusion || " "; |
| | | const url = this.selectedRow.url || ""; // 获取 url,如果不存在则为空字符串 |
| | | |
| | | addYxJcXx({ |
| | | proId: proId, |
| | | tjNumber: this.selectedTjNumber, |
| | | jcsj: jcsj, |
| | | jcjl: jcjl, |
| | | url: url // 添加 url 参数 |
| | | }) |
| | | .then((response) => { |
| | | this.form.proResult = ""; |