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 = []
// 设置中文字体
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

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

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

Loading…
Cancel
Save