Merge pull request #2942 from dataease/dev

dev merge
This commit is contained in:
王嘉豪 2022-08-25 14:50:37 +08:00 committed by GitHub
commit 5885be9664
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
23 changed files with 59 additions and 35 deletions

View File

@ -81,6 +81,7 @@ import { mapState } from 'vuex'
import EditBar from '@/components/canvas/components/Editor/EditBar' import EditBar from '@/components/canvas/components/Editor/EditBar'
import MobileCheckBar from '@/components/canvas/components/Editor/MobileCheckBar' import MobileCheckBar from '@/components/canvas/components/Editor/MobileCheckBar'
import { hexColorToRGBA } from '@/views/chart/chart/util' import { hexColorToRGBA } from '@/views/chart/chart/util'
import {imgUrlTrans} from "@/components/canvas/utils/utils";
export default { export default {
replace: true, replace: true,
@ -594,7 +595,7 @@ export default {
style['border-radius'] = (this.element.commonBackground.borderRadius || 0) + 'px' style['border-radius'] = (this.element.commonBackground.borderRadius || 0) + 'px'
if (this.element.commonBackground.enable) { if (this.element.commonBackground.enable) {
if (this.element.commonBackground.backgroundType === 'outerImage' && typeof this.element.commonBackground.outerImage === 'string') { if (this.element.commonBackground.backgroundType === 'outerImage' && typeof this.element.commonBackground.outerImage === 'string') {
style['background'] = `url(${this.element.commonBackground.outerImage}) no-repeat ${colorRGBA}` style['background'] = `url(${imgUrlTrans(this.element.commonBackground.outerImage)}) no-repeat ${colorRGBA}`
} else { } else {
style['background-color'] = colorRGBA style['background-color'] = colorRGBA
} }

View File

@ -58,6 +58,7 @@ import EditBar from '@/components/canvas/components/Editor/EditBar'
import MobileCheckBar from '@/components/canvas/components/Editor/MobileCheckBar' import MobileCheckBar from '@/components/canvas/components/Editor/MobileCheckBar'
import CloseBar from '@/components/canvas/components/Editor/CloseBar' import CloseBar from '@/components/canvas/components/Editor/CloseBar'
import { hexColorToRGBA } from '@/views/chart/chart/util' import { hexColorToRGBA } from '@/views/chart/chart/util'
import {imgUrlTrans} from "@/components/canvas/utils/utils";
export default { export default {
components: { CloseBar, MobileCheckBar, DeOutWidget, EditBar }, components: { CloseBar, MobileCheckBar, DeOutWidget, EditBar },
@ -155,9 +156,9 @@ export default {
if (this.config.commonBackground.enable) { if (this.config.commonBackground.enable) {
if (this.screenShot && this.config.commonBackground.backgroundType === 'innerImage' && typeof this.config.commonBackground.innerImage === 'string') { if (this.screenShot && this.config.commonBackground.backgroundType === 'innerImage' && typeof this.config.commonBackground.innerImage === 'string') {
let innerImage = this.config.commonBackground.innerImage.replace('svg', 'png') let innerImage = this.config.commonBackground.innerImage.replace('svg', 'png')
style['background'] = `url(${innerImage}) no-repeat ${colorRGBA}` style['background'] = `url(${imgUrlTrans(innerImage)}) no-repeat ${colorRGBA}`
} else if (this.config.commonBackground.backgroundType === 'outerImage' && typeof this.config.commonBackground.outerImage === 'string') { } else if (this.config.commonBackground.backgroundType === 'outerImage' && typeof this.config.commonBackground.outerImage === 'string') {
style['background'] = `url(${this.config.commonBackground.outerImage}) no-repeat ${colorRGBA}` style['background'] = `url(${imgUrlTrans(this.config.commonBackground.outerImage)}) no-repeat ${colorRGBA}`
} else { } else {
style['background-color'] = colorRGBA style['background-color'] = colorRGBA
} }

View File

@ -75,7 +75,7 @@ import { mapState } from 'vuex'
import ComponentWrapper from './ComponentWrapper' import ComponentWrapper from './ComponentWrapper'
import { changeStyleWithScale } from '@/components/canvas/utils/translate' import { changeStyleWithScale } from '@/components/canvas/utils/translate'
import { uuid } from 'vue-uuid' import { uuid } from 'vue-uuid'
import { deepCopy } from '@/components/canvas/utils/utils' import {deepCopy, imgUrlTrans} from '@/components/canvas/utils/utils'
import eventBus from '@/components/canvas/utils/eventBus' import eventBus from '@/components/canvas/utils/eventBus'
import elementResizeDetectorMaker from 'element-resize-detector' import elementResizeDetectorMaker from 'element-resize-detector'
import UserViewDialog from '@/components/canvas/custom-component/UserViewDialog' import UserViewDialog from '@/components/canvas/custom-component/UserViewDialog'
@ -231,7 +231,7 @@ export default {
if (this.canvasStyleData.openCommonStyle) { if (this.canvasStyleData.openCommonStyle) {
if (this.canvasStyleData.panel.backgroundType === 'image' && this.canvasStyleData.panel.imageUrl) { if (this.canvasStyleData.panel.backgroundType === 'image' && this.canvasStyleData.panel.imageUrl) {
style = { style = {
background: `url(${this.canvasStyleData.panel.imageUrl}) no-repeat`, background: `url(${imgUrlTrans(this.canvasStyleData.panel.imageUrl)}) no-repeat`,
...style ...style
} }
} else if (this.canvasStyleData.panel.backgroundType === 'color') { } else if (this.canvasStyleData.panel.backgroundType === 'color') {

View File

@ -46,7 +46,7 @@ import { mapState } from 'vuex'
import ComponentWrapper from './ComponentWrapper' import ComponentWrapper from './ComponentWrapper'
import { changeStyleWithScale } from '@/components/canvas/utils/translate' import { changeStyleWithScale } from '@/components/canvas/utils/translate'
import { uuid } from 'vue-uuid' import { uuid } from 'vue-uuid'
import { deepCopy } from '@/components/canvas/utils/utils' import {deepCopy, imgUrlTrans} from '@/components/canvas/utils/utils'
import eventBus from '@/components/canvas/utils/eventBus' import eventBus from '@/components/canvas/utils/eventBus'
import elementResizeDetectorMaker from 'element-resize-detector' import elementResizeDetectorMaker from 'element-resize-detector'
import UserViewDialog from '@/components/canvas/custom-component/UserViewDialog' import UserViewDialog from '@/components/canvas/custom-component/UserViewDialog'
@ -113,7 +113,7 @@ export default {
if (this.canvasStyleData.openCommonStyle) { if (this.canvasStyleData.openCommonStyle) {
if (this.canvasStyleData.panel.backgroundType === 'image' && this.canvasStyleData.panel.imageUrl) { if (this.canvasStyleData.panel.backgroundType === 'image' && this.canvasStyleData.panel.imageUrl) {
style = { style = {
background: `url(${this.canvasStyleData.panel.imageUrl}) no-repeat`, background: `url(${imgUrlTrans(this.canvasStyleData.panel.imageUrl)}) no-repeat`,
...style ...style
} }
} else if (this.canvasStyleData.panel.backgroundType === 'color') { } else if (this.canvasStyleData.panel.backgroundType === 'color') {

View File

@ -189,7 +189,7 @@ import DeDrag from '@/components/DeDrag'
// eslint-disable-next-line no-unused-vars // eslint-disable-next-line no-unused-vars
import { getStyle, getComponentRotatedStyle } from '@/components/canvas/utils/style' import { getStyle, getComponentRotatedStyle } from '@/components/canvas/utils/style'
import { _$ } from '@/components/canvas/utils/utils' import {_$, imgUrlTrans} from '@/components/canvas/utils/utils'
import ContextMenu from './ContextMenu' import ContextMenu from './ContextMenu'
import MarkLine from './MarkLine' import MarkLine from './MarkLine'
import Area from './Area' import Area from './Area'
@ -968,7 +968,7 @@ export default {
if (this.canvasStyleData.openCommonStyle) { if (this.canvasStyleData.openCommonStyle) {
if (this.canvasStyleData.panel.backgroundType === 'image' && this.canvasStyleData.panel.imageUrl) { if (this.canvasStyleData.panel.backgroundType === 'image' && this.canvasStyleData.panel.imageUrl) {
style = { style = {
background: `url(${this.canvasStyleData.panel.imageUrl}) no-repeat`, background: `url(${imgUrlTrans(this.canvasStyleData.panel.imageUrl)}) no-repeat`,
...style ...style
} }
} else if (this.canvasStyleData.panel.backgroundType === 'color') { } else if (this.canvasStyleData.panel.backgroundType === 'color') {

View File

@ -42,7 +42,7 @@ import LabelNormalText from '@/views/chart/components/normal/LabelNormalText'
import { exportDetails, innerExportDetails } from '@/api/panel/panel' import { exportDetails, innerExportDetails } from '@/api/panel/panel'
import html2canvas from 'html2canvasde' import html2canvas from 'html2canvasde'
import { hexColorToRGBA } from '@/views/chart/chart/util' import { hexColorToRGBA } from '@/views/chart/chart/util'
import { deepCopy, exportImg } from '@/components/canvas/utils/utils' import {deepCopy, exportImg, imgUrlTrans} from '@/components/canvas/utils/utils'
import { getLinkToken, getToken } from '@/utils/auth' import { getLinkToken, getToken } from '@/utils/auth'
export default { export default {
name: 'UserViewDialog', name: 'UserViewDialog',
@ -84,7 +84,7 @@ export default {
if (this.canvasStyleData.openCommonStyle) { if (this.canvasStyleData.openCommonStyle) {
if (this.canvasStyleData.panel.backgroundType === 'image' && this.canvasStyleData.panel.imageUrl) { if (this.canvasStyleData.panel.backgroundType === 'image' && this.canvasStyleData.panel.imageUrl) {
style = { style = {
background: `url(${this.canvasStyleData.panel.imageUrl}) no-repeat`, background: `url(${imgUrlTrans(this.canvasStyleData.panel.imageUrl)}) no-repeat`,
...style ...style
} }
} else if (this.canvasStyleData.panel.backgroundType === 'color') { } else if (this.canvasStyleData.panel.backgroundType === 'color') {
@ -125,9 +125,9 @@ export default {
if (this.element.commonBackground.enable) { if (this.element.commonBackground.enable) {
if (this.screenShot && this.element.commonBackground.backgroundType === 'innerImage' && typeof this.element.commonBackground.innerImage === 'string') { if (this.screenShot && this.element.commonBackground.backgroundType === 'innerImage' && typeof this.element.commonBackground.innerImage === 'string') {
let innerImage = this.element.commonBackground.innerImage.replace('svg', 'png') let innerImage = this.element.commonBackground.innerImage.replace('svg', 'png')
style['background'] = `url(${innerImage}) no-repeat ${colorRGBA}` style['background'] = `url(${imgUrlTrans(innerImage)}) no-repeat ${colorRGBA}`
} else if (this.element.commonBackground.backgroundType === 'outerImage' && typeof this.element.commonBackground.outerImage === 'string') { } else if (this.element.commonBackground.backgroundType === 'outerImage' && typeof this.element.commonBackground.outerImage === 'string') {
style['background'] = `url(${this.element.commonBackground.outerImage}) no-repeat ${colorRGBA}` style['background'] = `url(${imgUrlTrans(this.element.commonBackground.outerImage)}) no-repeat ${colorRGBA}`
} else { } else {
style['background-color'] = colorRGBA style['background-color'] = colorRGBA
} }

View File

@ -34,7 +34,7 @@ import DeContainer from '@/components/dataease/DeContainer'
import LabelNormalText from '@/views/chart/components/normal/LabelNormalText' import LabelNormalText from '@/views/chart/components/normal/LabelNormalText'
import ChartComponentS2 from '@/views/chart/components/ChartComponentS2' import ChartComponentS2 from '@/views/chart/components/ChartComponentS2'
import PluginCom from '@/views/system/plugin/PluginCom' import PluginCom from '@/views/system/plugin/PluginCom'
import { deepCopy } from '@/components/canvas/utils/utils' import {deepCopy, imgUrlTrans} from '@/components/canvas/utils/utils'
import {hexColorToRGBA} from "@/views/chart/chart/util"; import {hexColorToRGBA} from "@/views/chart/chart/util";
export default { export default {
name: 'UserViewMobileDialog', name: 'UserViewMobileDialog',
@ -66,7 +66,7 @@ export default {
if (this.canvasStyleData.openCommonStyle) { if (this.canvasStyleData.openCommonStyle) {
if (this.canvasStyleData.panel.backgroundType === 'image' && this.canvasStyleData.panel.imageUrl) { if (this.canvasStyleData.panel.backgroundType === 'image' && this.canvasStyleData.panel.imageUrl) {
style = { style = {
background: `url(${this.canvasStyleData.panel.imageUrl}) no-repeat`, background: `url(${imgUrlTrans(this.canvasStyleData.panel.imageUrl)}) no-repeat`,
...style ...style
} }
} else if (this.canvasStyleData.panel.backgroundType === 'color') { } else if (this.canvasStyleData.panel.backgroundType === 'color') {
@ -107,9 +107,9 @@ export default {
if (this.element.commonBackground.enable) { if (this.element.commonBackground.enable) {
if (this.screenShot && this.element.commonBackground.backgroundType === 'innerImage' && typeof this.element.commonBackground.innerImage === 'string') { if (this.screenShot && this.element.commonBackground.backgroundType === 'innerImage' && typeof this.element.commonBackground.innerImage === 'string') {
let innerImage = this.element.commonBackground.innerImage.replace('svg', 'png') let innerImage = this.element.commonBackground.innerImage.replace('svg', 'png')
style['background'] = `url(${innerImage}) no-repeat ${colorRGBA}` style['background'] = `url(${imgUrlTrans(innerImage)}) no-repeat ${colorRGBA}`
} else if (this.element.commonBackground.backgroundType === 'outerImage' && typeof this.element.commonBackground.outerImage === 'string') { } else if (this.element.commonBackground.backgroundType === 'outerImage' && typeof this.element.commonBackground.outerImage === 'string') {
style['background'] = `url(${this.element.commonBackground.outerImage}) no-repeat ${colorRGBA}` style['background'] = `url(${imgUrlTrans(this.element.commonBackground.outerImage)}) no-repeat ${colorRGBA}`
} else { } else {
style['background-color'] = colorRGBA style['background-color'] = colorRGBA
} }

View File

@ -216,3 +216,12 @@ export function colorReverse(OldColorValue) {
const str = '000000' + (0xFFFFFF - OldColorValue).toString(16) const str = '000000' + (0xFFFFFF - OldColorValue).toString(16)
return '#' + str.substring(str.length - 6, str.length) return '#' + str.substring(str.length - 6, str.length)
} }
export function imgUrlTrans(url) {
if(url && url.indexOf('static-resource') > -1){
return process.env.VUE_APP_BASE_API + url.replace('/static-resource','static-resource')
}else {
return url
}
}

View File

@ -1671,7 +1671,7 @@ export default {
template_preview: '预览模板', template_preview: '预览模板',
apply: '应用', apply: '应用',
apply_this_template: '应用此模板', apply_this_template: '应用此模板',
market_network_tips: '查看模板市场模板需要服务器与模板市场(https://dataease.io/templates)通,请检查网络...', market_network_tips: '查看模板市场模板需要服务器与模板市场(https://dataease.io/templates)通,请检查网络...',
enter_name_tips: '请输入仪表板名称', enter_name_tips: '请输入仪表板名称',
name: '名称', name: '名称',
apply_template: '应用模板', apply_template: '应用模板',

View File

@ -1679,7 +1679,7 @@ export default {
template_preview: '预览模板', template_preview: '预览模板',
apply: '应用', apply: '应用',
apply_this_template: '应用此模板', apply_this_template: '应用此模板',
market_network_tips: '查看模板市场模板需要服务器与模板市场(https://dataease.io/templates)通,请检查网络...', market_network_tips: '查看模板市场模板需要服务器与模板市场(https://dataease.io/templates)通,请检查网络...',
enter_name_tips: '请输入仪表板名称', enter_name_tips: '请输入仪表板名称',
name: '名称', name: '名称',
apply_template: '应用模板', apply_template: '应用模板',

View File

@ -17,6 +17,7 @@
<script> <script>
import { mapState } from 'vuex' import { mapState } from 'vuex'
import {imgUrlTrans} from "@/components/canvas/utils/utils";
export default { export default {
name: 'BackgroundItem', name: 'BackgroundItem',
@ -38,7 +39,7 @@ export default {
classBackground() { classBackground() {
if (this.template.url) { if (this.template.url) {
return { return {
background: `url(${this.template.url}) no-repeat`, background: `url(${imgUrlTrans(this.template.url)}) no-repeat`,
'background-size': `100% 100%` 'background-size': `100% 100%`
} }
} else { } else {

View File

@ -261,6 +261,7 @@ import 'codemirror/keymap/emacs.js'
import 'codemirror/addon/hint/show-hint.css' import 'codemirror/addon/hint/show-hint.css'
import 'codemirror/addon/hint/sql-hint' import 'codemirror/addon/hint/sql-hint'
import 'codemirror/addon/hint/show-hint' import 'codemirror/addon/hint/show-hint'
import {imgUrlTrans} from "@/components/canvas/utils/utils";
export default { export default {
components: { codemirror, draggable }, components: { codemirror, draggable },
@ -327,7 +328,7 @@ export default {
classBackground() { classBackground() {
if (this.importTemplateInfo.snapshot) { if (this.importTemplateInfo.snapshot) {
return { return {
background: `url(${this.importTemplateInfo.snapshot}) no-repeat` background: `url(${imgUrlTrans(this.importTemplateInfo.snapshot)}) no-repeat`
} }
} else { } else {
return {} return {}

View File

@ -133,6 +133,7 @@ import { chartTransStr2Object } from '@/views/panel/panel'
import { mapState } from 'vuex' import { mapState } from 'vuex'
import bus from '@/utils/bus' import bus from '@/utils/bus'
import { saveOrUpdateSubject } from '@/api/panel/panel' import { saveOrUpdateSubject } from '@/api/panel/panel'
import {imgUrlTrans} from "@/components/canvas/utils/utils";
export default { export default {
name: 'StyleTemplateItem', name: 'StyleTemplateItem',
@ -159,7 +160,7 @@ export default {
style = { style = {
width: '100%', width: '100%',
height: '100%', height: '100%',
background: `url(${this.subjectItemDetails.panel.imageUrl}) no-repeat`, background: `url(${imgUrlTrans(this.subjectItemDetails.panel.imageUrl)}) no-repeat`,
'background-size': '100% 100% !important' 'background-size': '100% 100% !important'
} }
} else { } else {

View File

@ -56,6 +56,7 @@
<script> <script>
import { chartTransStr2Object } from '@/views/panel/panel' import { chartTransStr2Object } from '@/views/panel/panel'
import {imgUrlTrans} from "@/components/canvas/utils/utils";
export default { export default {
name: 'StyleTemplateItem', name: 'StyleTemplateItem',
props: { props: {
@ -84,7 +85,7 @@ export default {
style = { style = {
width: '100%', width: '100%',
height: '100%', height: '100%',
background: `url(${this.subjectItemDetails.panel.imageUrl}) no-repeat` background: `url(${imgUrlTrans(this.subjectItemDetails.panel.imageUrl)}) no-repeat`
} }
} else { } else {
style = { style = {

View File

@ -75,6 +75,7 @@ import { mapState } from 'vuex'
import bus from '@/utils/bus' import bus from '@/utils/bus'
import { saveOrUpdateSubject } from '@/api/panel/panel' import { saveOrUpdateSubject } from '@/api/panel/panel'
import { resetViewCacheCallBack } from '@/api/chart/chart' import { resetViewCacheCallBack } from '@/api/chart/chart'
import {imgUrlTrans} from "@/components/canvas/utils/utils";
export default { export default {
name: 'StyleTemplateItem', name: 'StyleTemplateItem',
@ -103,7 +104,7 @@ export default {
style = { style = {
width: '100%', width: '100%',
height: '100%', height: '100%',
background: `url(${this.subjectItemDetails.panel.imageUrl}) no-repeat`, background: `url(${imgUrlTrans(this.subjectItemDetails.panel.imageUrl)}) no-repeat`,
'background-size': '100% 100% !important' 'background-size': '100% 100% !important'
} }
} else { } else {

View File

@ -56,6 +56,7 @@
<script> <script>
import { chartTransStr2Object } from '@/views/panel/panel' import { chartTransStr2Object } from '@/views/panel/panel'
import {imgUrlTrans} from "@/components/canvas/utils/utils";
export default { export default {
name: 'StyleTemplateItem', name: 'StyleTemplateItem',
props: { props: {
@ -84,7 +85,7 @@ export default {
style = { style = {
width: '100%', width: '100%',
height: '100%', height: '100%',
background: `url(${this.subjectItemDetails.panel.imageUrl}) no-repeat` background: `url(${imgUrlTrans(this.subjectItemDetails.panel.imageUrl)}) no-repeat`
} }
} else { } else {
style = { style = {

View File

@ -36,6 +36,7 @@ import MobileCheckBar from '@/components/canvas/components/Editor/MobileCheckBar
import { getStyle } from '@/components/canvas/utils/style' import { getStyle } from '@/components/canvas/utils/style'
import DeOutWidget from '@/components/dataease/DeOutWidget' import DeOutWidget from '@/components/dataease/DeOutWidget'
import { hexColorToRGBA } from '@/views/chart/chart/util' import { hexColorToRGBA } from '@/views/chart/chart/util'
import {imgUrlTrans} from "@/components/canvas/utils/utils";
export default { export default {
name: 'ComponentWaitItem', name: 'ComponentWaitItem',
@ -82,7 +83,7 @@ export default {
} }
if (this.config.commonBackground.enable) { if (this.config.commonBackground.enable) {
if (this.config.commonBackground.backgroundType === 'outerImage' && typeof this.config.commonBackground.outerImage === 'string') { if (this.config.commonBackground.backgroundType === 'outerImage' && typeof this.config.commonBackground.outerImage === 'string') {
style['background'] = `url(${this.config.commonBackground.outerImage}) no-repeat ${colorRGBA}` style['background'] = `url(${imgUrlTrans(this.config.commonBackground.outerImage)}) no-repeat ${colorRGBA}`
} else { } else {
style['background-color'] = colorRGBA style['background-color'] = colorRGBA
} }

View File

@ -387,7 +387,7 @@ import FilterGroup from '../filter'
import SubjectSetting from '../SubjectSetting' import SubjectSetting from '../SubjectSetting'
import bus from '@/utils/bus' import bus from '@/utils/bus'
import Editor from '@/components/canvas/components/Editor/index' import Editor from '@/components/canvas/components/Editor/index'
import { deepCopy, matrixBaseChange } from '@/components/canvas/utils/utils' import {deepCopy, imgUrlTrans, matrixBaseChange} from '@/components/canvas/utils/utils'
import componentList, { import componentList, {
BASE_MOBILE_STYLE, BASE_MOBILE_STYLE,
COMMON_BACKGROUND, COMMON_BACKGROUND,
@ -581,7 +581,7 @@ export default {
if (this.canvasStyleData.openCommonStyle) { if (this.canvasStyleData.openCommonStyle) {
if (this.canvasStyleData.panel.backgroundType === 'image' && typeof (this.canvasStyleData.panel.imageUrl) === 'string') { if (this.canvasStyleData.panel.backgroundType === 'image' && typeof (this.canvasStyleData.panel.imageUrl) === 'string') {
style = { style = {
background: `url(${this.canvasStyleData.panel.imageUrl}) no-repeat` background: `url(${imgUrlTrans(this.canvasStyleData.panel.imageUrl)}) no-repeat`
} }
} else if (this.canvasStyleData.panel.backgroundType === 'color') { } else if (this.canvasStyleData.panel.backgroundType === 'color') {
style = { style = {
@ -603,7 +603,7 @@ export default {
if (this.canvasStyleData.openCommonStyle) { if (this.canvasStyleData.openCommonStyle) {
if (this.canvasStyleData.panel.backgroundType === 'image' && typeof (this.canvasStyleData.panel.imageUrl) === 'string') { if (this.canvasStyleData.panel.backgroundType === 'image' && typeof (this.canvasStyleData.panel.imageUrl) === 'string') {
style = { style = {
background: `url(${this.canvasStyleData.panel.imageUrl}) no-repeat`, background: `url(${imgUrlTrans(this.canvasStyleData.panel.imageUrl)}) no-repeat`,
...style ...style
} }
} else if (this.canvasStyleData.panel.backgroundType === 'color') { } else if (this.canvasStyleData.panel.backgroundType === 'color') {

View File

@ -34,6 +34,7 @@ export default {
if (this.componentName === 'PanelEdit') { if (this.componentName === 'PanelEdit') {
next(false) next(false)
if (confirm(this.$t('panel.edit_leave_tips'))) { if (confirm(this.$t('panel.edit_leave_tips'))) {
bus.$emit('PanelSwitchComponent', { name: 'PanelMain' })
next() next()
} }
} else { } else {

View File

@ -35,7 +35,7 @@
import { panelSave, panelUpdate } from '@/api/panel/panel' import { panelSave, panelUpdate } from '@/api/panel/panel'
import { showTemplateList } from '@/api/system/template' import { showTemplateList } from '@/api/system/template'
import TemplateAllList from './TemplateAllList' import TemplateAllList from './TemplateAllList'
import { deepCopy } from '@/components/canvas/utils/utils' import {deepCopy, imgUrlTrans} from '@/components/canvas/utils/utils'
export default { export default {
components: { TemplateAllList }, components: { TemplateAllList },
@ -68,7 +68,7 @@ export default {
classBackground() { classBackground() {
if (this.importTemplateInfo.snapshot) { if (this.importTemplateInfo.snapshot) {
return { return {
background: `url(${this.importTemplateInfo.snapshot}) no-repeat` background: `url(${imgUrlTrans(this.importTemplateInfo.snapshot)}) no-repeat`
} }
} else { } else {
return {} return {}

View File

@ -46,6 +46,7 @@
import { save, nameCheck } from "@/api/system/template"; import { save, nameCheck } from "@/api/system/template";
import msgCfm from "@/components/msgCfm/index"; import msgCfm from "@/components/msgCfm/index";
import { find } from "@/api/system/template"; import { find } from "@/api/system/template";
import {imgUrlTrans} from "@/components/canvas/utils/utils";
export default { export default {
mixins: [msgCfm], mixins: [msgCfm],
@ -86,7 +87,7 @@ export default {
classBackground() { classBackground() {
if (this.importTemplateInfo.snapshot) { if (this.importTemplateInfo.snapshot) {
return { return {
background: `url(${this.importTemplateInfo.snapshot}) no-repeat`, background: `url(${imgUrlTrans(this.importTemplateInfo.snapshot)}) no-repeat`,
}; };
} else { } else {
return {}; return {};

View File

@ -14,6 +14,8 @@
</template> </template>
<script> <script>
import {imgUrlTrans} from "@/components/canvas/utils/utils";
export default { export default {
name: 'TemplateMarketItem', name: 'TemplateMarketItem',
props: { props: {
@ -39,7 +41,7 @@ export default {
return { return {
width: this.width + 'px', width: this.width + 'px',
height: this.width * 0.58 + 'px', height: this.width * 0.58 + 'px',
background: `url(${this.thumbnailUrl}) no-repeat`, background: `url(${imgUrlTrans(this.thumbnailUrl)}) no-repeat`,
'background-size': `100% 100%` 'background-size': `100% 100%`
} }
}, },

View File

@ -14,6 +14,8 @@
</template> </template>
<script> <script>
import {imgUrlTrans} from "@/components/canvas/utils/utils";
export default { export default {
name: 'TemplateMarketPreviewItem', name: 'TemplateMarketPreviewItem',
props: { props: {
@ -39,7 +41,7 @@ export default {
computed: { computed: {
classBackground() { classBackground() {
return { return {
background: `url(${this.thumbnailUrl}) no-repeat`, background: `url(${imgUrlTrans(this.thumbnailUrl)}) no-repeat`,
'background-size': `100% 100%` 'background-size': `100% 100%`
} }
}, },