提交 46ff744b authored 作者: fit2cloud-chenyw's avatar fit2cloud-chenyw

feat: 晚上公共链接

上级 5327d517
......@@ -48,3 +48,10 @@ export function loadGenerate(resourceId) {
method: 'post'
})
}
export function loadResource(resourceId) {
return request({
url: 'panel/group/findOne/' + resourceId,
method: 'get'
})
}
<template>
<div id="link"><router-view />
<div id="link" style="height:100%;"><router-view />
</div>
</template>
<script>
......
......@@ -5,6 +5,9 @@ import store from '../store'
import '@/styles/index.scss' // global css
import i18n from '../lang' // internationalization
import ElementUI from 'element-ui'
import '@/components/canvas/custom-component' // 注册自定义组件
import * as echarts from 'echarts'
Vue.prototype.$echarts = echarts
Vue.config.productionTip = false
Vue.use(ElementUI, {
......
<template>
<div>
<div style="height: 100%;">
<link-error v-if="showIndex===0" :resource-id="resourceId" />
<link-pwd v-if="showIndex===1" :resource-id="resourceId" />
<link-view v-if="showIndex===2" :resource-id="resourceId" />
......
<template>
<div>
我是视图页面
<div style="width: 100%;height: 100%;background-color: #f7f8fa">
<Preview v-if="show" />
</div>
</template>
<script>
import { loadResource } from '@/api/link'
import { uuid } from 'vue-uuid'
import Preview from '@/components/canvas/components/Editor/Preview'
export default {
name: 'LinkView',
components: { Preview },
props: {
resourceId: {
type: String,
default: null
}
},
data() {
return {
show: false
}
},
created() {
this.show = false
this.setPanelInfo()
},
methods: {
setPanelInfo() {
loadResource(this.resourceId).then(res => {
this.$store.commit('setComponentData', this.resetID(JSON.parse(res.data.panelData)))
// this.$store.commit('setComponentData', JSON.parse(res.data.panelData))
this.$store.commit('setCanvasStyle', JSON.parse(res.data.panelStyle))
this.show = true
})
},
resetID(data) {
data.forEach(item => {
item.id = uuid.v1()
})
return data
}
}
}
</script>
<style scoped>
*{
margin: 0;
padding: 0;
}
</style>
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论