forked from github/dataease
feat: 晚上公共链接
This commit is contained in:
parent
5327d5170b
commit
46ff744b65
@ -48,3 +48,10 @@ export function loadGenerate(resourceId) {
|
||||
method: 'post'
|
||||
})
|
||||
}
|
||||
|
||||
export function loadResource(resourceId) {
|
||||
return request({
|
||||
url: 'panel/group/findOne/' + resourceId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
<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, {
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
<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" />
|
||||
|
@ -1,19 +1,54 @@
|
||||
<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',
|
||||
data() {
|
||||
return {
|
||||
|
||||
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>
|
||||
|
Loading…
Reference in New Issue
Block a user