refactor: 样式设置缩略图增加分类部署读取方式
This commit is contained in:
parent
d86a9b46f1
commit
193423bb98
@ -132,7 +132,7 @@
|
||||
import { queryBackground } from '@/api/background/background'
|
||||
import BackgroundItem from '@/views/background/BackgroundItem'
|
||||
import { mapState } from 'vuex'
|
||||
import { deepCopy } from '@/components/canvas/utils/utils'
|
||||
import {deepCopy, imgUrlTrans} from '@/components/canvas/utils/utils'
|
||||
import { COLOR_PANEL } from '@/views/chart/chart/chart'
|
||||
import { uploadFileResult } from '@/api/staticResource/staticResource'
|
||||
import { COMMON_BACKGROUND_NONE } from '@/components/canvas/custom-component/component-list'
|
||||
@ -171,7 +171,7 @@ export default {
|
||||
methods: {
|
||||
init() {
|
||||
if (this.curComponent && this.curComponent.commonBackground && this.curComponent.commonBackground.outerImage && typeof (this.curComponent.commonBackground.outerImage) === 'string') {
|
||||
this.fileList.push({ url: this.curComponent.commonBackground.outerImage })
|
||||
this.fileList.push({ url: imgUrlTrans(this.curComponent.commonBackground.outerImage) })
|
||||
}
|
||||
this.backgroundOrigin = deepCopy(this.curComponent.commonBackground ? this.curComponent.commonBackground : COMMON_BACKGROUND_NONE)
|
||||
this.queryBackground()
|
||||
|
||||
@ -52,6 +52,8 @@ import { mapState } from 'vuex'
|
||||
import { deepCopy } from '@/components/canvas/utils/utils'
|
||||
import { COLOR_PANEL } from '@/views/chart/chart/chart'
|
||||
import { uploadFileResult } from '@/api/staticResource/staticResource'
|
||||
import {imgUrlTrans} from "@/components/canvas/utils/utils";
|
||||
|
||||
|
||||
export default {
|
||||
name: 'BackgroundSelector',
|
||||
@ -77,7 +79,7 @@ export default {
|
||||
// 初始化赋值
|
||||
this.panel = this.canvasStyleData.panel
|
||||
if (this.panel.imageUrl && typeof (this.panel.imageUrl) === 'string') {
|
||||
this.fileList.push({ url: this.panel.imageUrl })
|
||||
this.fileList.push({ url: imgUrlTrans(this.panel.imageUrl) })
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@ -111,7 +113,7 @@ export default {
|
||||
uploadFileResult(file.file, (fileUrl) => {
|
||||
_this.$store.commit('canvasChange')
|
||||
_this.panel.imageUrl = fileUrl
|
||||
_this.fileList = [{ url: this.panel.imageUrl }]
|
||||
_this.fileList = [{ url: imgUrlTrans(this.panel.imageUrl) }]
|
||||
_this.commitStyle()
|
||||
})
|
||||
},
|
||||
|
||||
Loading…
Reference in New Issue
Block a user