Browse Source

图片上传bug

master
han\hanst 5 months ago
parent
commit
8d758b3663
  1. 2
      src/utils/zplGenerator.js
  2. 26
      src/views/modules/labelSetting/components/PropertyForm.vue

2
src/utils/zplGenerator.js

@ -115,7 +115,7 @@ export class ZPLGenerator {
const zpl = [] const zpl = []
// 设置中文字体 // 设置中文字体
zpl.push(`^CI28^LH0,^JUS^CWJ,E:SIMSUN.FNT^CFJ,${element.fontSize},${element.fontSize}`)
zpl.push(`^CI28 ^CWJ,E:MSYH.TTF ^CFJ,${element.fontSize}`)
// 基础文本 // 基础文本
const textCommand = element.newline const textCommand = element.newline

26
src/views/modules/labelSetting/components/PropertyForm.vue

@ -129,7 +129,7 @@
<el-button <el-button
type="primary" type="primary"
icon="el-icon-upload" icon="el-icon-upload"
@click="$refs.fileInput.click()"
@click="handleSelectImage"
> >
选择图片 选择图片
</el-button> </el-button>
@ -244,7 +244,26 @@ export default {
components: { components: {
comShowLabelSerialInfo,/*标签内容流水号信息的組件*/ comShowLabelSerialInfo,/*标签内容流水号信息的組件*/
}, },
watch: {
//
'element.id'() {
//
this.$nextTick(() => {
if (this.$refs.fileInput) {
this.$refs.fileInput.value = ''
}
})
}
},
methods: { methods: {
handleSelectImage() {
//
if (this.$refs.fileInput) {
this.$refs.fileInput.value = ''
this.$refs.fileInput.click()
}
},
/*流水号信息的modal*/ /*流水号信息的modal*/
serialInfoModal(row){ serialInfoModal(row){
let rowData = { let rowData = {
@ -270,8 +289,13 @@ export default {
try { try {
const imageData = await this.processImage(file) const imageData = await this.processImage(file)
this.$emit('image-upload', imageData) this.$emit('image-upload', imageData)
// change
event.target.value = ''
} catch (error) { } catch (error) {
this.$message.error('图片处理失败') this.$message.error('图片处理失败')
// 使
event.target.value = ''
} }
}, },

Loading…
Cancel
Save