portal vue 프런트엔드 시각화 portal 구현(一)
하나.초판 데모 데모 프레젠테이션
둘.프로젝트 구조
바로 데모가 전시한 이 장난감은 하나의 화포로 비개발자가 디자인을 할 수 있게 한다
,
script
방식으로 동적 주입하는 것이다. 이것은 new Vue
의 시기 문제와 관련이 있다.전역 구성 요소만 가능하기 때문에 js를 불러와서 UI인터페이스 카드를 잠시 끄는 문제에 관련된다. 두 번째 방안은 vue-cli3이 제공하는 단일 파일 패키지, 비동기적인script 도입이다. 그러나 양식이라는 부분은 해결해야 한다. 나중에 다시 생각해 보자provide
inject
사용하지 않음vuex
.
const patams = {
mamDataType: 1, //
mamHidden: true, //
mamDataValue: '', //
mamRefreshTime: 0, //
mamDataProcessing: '', //
mamMethod: 'post', //
mamApi: 'http://' //
}
export default [
{
name: ' ',
key: '',
icon: 'demo',
type: 'k-histogram',
options: {
width: 300,
height: 200,
x: 10,
y: 10,
...patams,
mamCategory: true,
title: {
text: '',
subtext: '',
textAlign: 'left',
textStyle: {
color: '#333333',
fontSize: 16
},
subtextStyle: {
color: '#666666',
fontSize: 12
}
},
grid: {
width: 'auto',
height: 'auto'
},
backgroundColor: 'rgba(255, 255, 255, .6)',
color: ['#3296fa'],
xAxis: {
type: 'category',
data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri']
},
yAxis: {
type: 'value'
},
series: [{
data: [120, 200, 150, 80, 70],
type: 'bar'
}]
}
}
]
디자이너 왼쪽 구성 요소 목록
import componentsData from '@/config/components'
import componentItem from '@/components/ComponentItem/index'
import uuid from 'node-uuid'
export default {
name: 'ComponentLibrary',
components: {
componentItem
},
data() {
return {
componentsData
}
},
methods: {
handleEnd(evt) {
// key
this.componentsData[evt.oldIndex].key = uuid.v1()
}
}
}
스테이지 캔버스
import draggable from './mixin/draggable'
import resize from './mixin/resize'
export default {
name: 'StageCanvas',
inject: ['app'],
mixins: [draggable, resize],
data() {
return {
componentList: [],
vLine: [],
hLine: [],
enableNativeDrag: false,
activeComponent: {} //
}
}
}
속성 구성 패널
import ConfigTab from './modules/ConfigTab'
import DataTab from './modules/DataTab'
import FormatTab from './modules/FormatTab'
export default {
name: 'AttrConfiguration',
components: {
ConfigTab,
DataTab,
FormatTab
},
inject: ['app'],
data() {
return {
activeName: 'first'
}
}
}
원통형 다이어그램 구성 요소
export default {
name: 'Histogram',
props: {
options: {
type: Object,
default: () => {}
},
domId: {
type: String,
default: ''
}
},
data() {
return {
chart: null
}
},
watch: {
options: {
handler(data) {
let xAxis = {}
let yAxis = {}
if (data.mamCategory) {
yAxis = { type: 'category', data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri'] }
xAxis = { type: 'value' }
} else {
xAxis = { type: 'category', data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri'] }
yAxis = { type: 'value' }
}
const options = {
...data,
xAxis,
yAxis
}
this.chart.resize()
this.chart.setOption(options)
},
deep: true
}
},
mounted() {
this.$nextTick(() => {
this.chart = window.echarts.init(document.getElementById(this.domId))
this.chart.setOption(this.options)
})
}
}
App.vue
import Layout from '@/components/layout/index'
export default {
name: 'App',
provide() {
return {
app: this
}
},
components: {
Layout
},
data() {
return {
attrData: {
options: {}
}
}
},
methods: {
//
setAttrData(data) {
this.attrData = Object.assign({}, data)
}
}
}
2.2 렌더러npm 패키지
2.3 백그라운드 관리
포털 템플릿, 권한 등 일련의 관리를 위한
구체적인 기능은 아직 탐색 중이며 후속으로 업데이트하고 있다.
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
Fastapi websocket 및 vue 3(Composition API)1부: FastAPI virtualenv 만들기(선택 사항) FastAPI 및 필요한 모든 것을 다음과 같이 설치하십시오. 생성main.py 파일 및 실행 - 브라우저에서 이 링크 열기http://127.0.0.1:...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.