!113 引入datav依赖,丰富了边框组件、装饰组件

Merge pull request !113 from wenqindong/dev-datav
qianlishi 1 year ago committed by Gitee
commit e9e3311bc1
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

@ -13,6 +13,7 @@
},
"dependencies": {
"@ckeditor/ckeditor5-build-decoupled-document": "^23.1.0",
"@jiaminghi/data-view": "^2.10.0",
"@smallwei/avue": "^2.8.23",
"axios": "0.18.0",
"chokidar": "^3.5.2",

@ -22,7 +22,9 @@ import 'echarts/lib/component/tooltip'
//import 'echarts-liquidfill'
// import 'echarts-gl'
Vue.component('v-chart', ECharts)
// 全局引入datav
import dataV from '@jiaminghi/data-view'
Vue.use(dataV)
// anji component
import anjiCrud from '@/components/AnjiPlus/anji-crud/anji-crud'
import anjiSelect from '@/components/AnjiPlus/anji-select'

@ -0,0 +1,74 @@
/**
* author:wenqindong
* date:2023-05-31
*/
let selectOptions = []
for(let i=1;i<14;i++){
selectOptions.push({code: 'dv-border-Box-'+i, name: '样式'+i})
}
export const widgetBorder = {
code: 'widget-border',
type: 'border',
tabName: '样式组件',
label: '边框',
icon: 'icontupian1',
options: {
// 配置
setup: [
{
type: 'el-input-text',
label: '图层名称',
name: 'layerName',
required: false,
placeholder: '',
value: '边框一',
},
{
type: 'el-select',
label: '样式',
name: 'showtype',
required: false,
placeholder: '',
selectOptions: selectOptions,
value: 'dv-border-Box-1'
},
],
// 数据
data: [],
// 坐标
position: [
{
type: 'el-input-number',
label: '左边距',
name: 'left',
required: false,
placeholder: '',
value: 0,
},
{
type: 'el-input-number',
label: '上边距',
name: 'top',
required: false,
placeholder: '',
value: 0,
},
{
type: 'el-input-number',
label: '宽度',
name: 'width',
required: false,
placeholder: '该容器在1920px大屏中的宽度',
value: 400,
},
{
type: 'el-input-number',
label: '高度',
name: 'height',
required: false,
placeholder: '该容器在1080px大屏中的高度',
value: 300,
},
],
}
}

@ -0,0 +1,74 @@
/**
* author:wenqindong
* date:2023-05-31
*/
let selectOptions = []
for(let i=1;i<13;i++){
selectOptions.push({code: 'dv-decoration-'+i, name: '装饰'+i})
}
export const widgetDecoration = {
code: 'widget-decoration',
type: 'border',
tabName: '样式组件',
label: '装饰',
icon: 'icontupian1',
options: {
// 配置
setup: [
{
type: 'el-input-text',
label: '图层名称',
name: 'layerName',
required: false,
placeholder: '',
value: '装饰一',
},
{
type: 'el-select',
label: '样式',
name: 'showtype',
required: false,
placeholder: '',
selectOptions: selectOptions,
value: 'dv-decoration-1'
},
],
// 数据
data: [],
// 坐标
position: [
{
type: 'el-input-number',
label: '左边距',
name: 'left',
required: false,
placeholder: '',
value: 0,
},
{
type: 'el-input-number',
label: '上边距',
name: 'top',
required: false,
placeholder: '',
value: 0,
},
{
type: 'el-input-number',
label: '宽度',
name: 'width',
required: false,
placeholder: '该容器在1920px大屏中的宽度',
value: 400,
},
{
type: 'el-input-number',
label: '高度',
name: 'height',
required: false,
placeholder: '该容器在1080px大屏中的高度',
value: 150,
},
],
}
}

@ -44,10 +44,14 @@ import { widgetFormTime } from "./configure/form/widget-form-time";
import { widgetScaleVertical } from "./configure/scaleCharts/widget-scale-vertical";
import { widgetScaleHorizontal } from "./configure/scaleCharts/widget-scale-horizontal"
import {widgetBarDoubleYaxis} from "./configure/barCharts/widget-bar-double-yaxis-chart";
import {widgetBorder} from "./configure/styleWidget/widget-border";
import {widgetDecoration} from "./configure/styleWidget/widget-decoration";
export const widgetTool = [
// type=html类型的组件
widgetText,
widgetBorder,
widgetDecoration,
widgetMarquee,
widgetHref,
widgetTime,

@ -0,0 +1,46 @@
<template>
<div :style="styleObj" >
<component :is="value.setup.showtype" :value="value" />
</div>
</template>
<script>
export default ({
data() {
return {
optionsStyle: {}, //
}
},
props: {
value: Object,
ispreview: Boolean,
widgetIndex: {
type: Number,
default: 0,
}, // widgetInWorkbench
},
watch: {
value: {
handler(val) {
this.optionsStyle = val.position;
this.optionsData = val.data;
this.optionsCollapse = val.collapse;
this.optionsSetup = val.setup;
},
deep: true,
},
},
computed: {
styleObj() {
return {
position: this.ispreview ? "absolute" : "static",
width: this.optionsStyle.width + "px",
height: this.optionsStyle.height + "px",
left: this.optionsStyle.left + "px",
top: this.optionsStyle.top + "px",
};
},
}
})
</script>
<style scoped lang="scss">
</style>

@ -0,0 +1,45 @@
<template>
<div :style="styleObj">
<component :is="value.setup.showtype" :value="value" :style="styleObj"/>
</div>
</template>
<script>
export default ({
data() {
return {
optionsStyle: {}, //
}
},
props: {
value: Object,
ispreview: Boolean,
widgetIndex: {
type: Number,
default: 0,
}, // widgetInWorkbench
},
watch: {
value: {
handler(val) {
this.optionsStyle = val.position;
this.optionsData = val.data;
this.optionsCollapse = val.collapse;
this.optionsSetup = val.setup;
},
deep: true,
},
},
computed: {
styleObj() {
return {
position: this.ispreview ? "absolute" : "static",
width: this.optionsStyle.width + "px",
height: this.optionsStyle.height + "px",
left: this.optionsStyle.left + "px",
top: this.optionsStyle.top + "px",
};
},
}
})
</script>
<style scoped lang="scss"></style>

@ -53,12 +53,16 @@ import widgetFormTime from "./form/widgetFormTime.vue";
import widgetScaleVertical from "./scale/widgetScaleVertical.vue";
import widgetScaleHorizontal from "./scale/widgetScaleHorizontal.vue";
import widgetBarDoubleYaxisChart from "./bar/widgetBarDoubleYaxisChart.vue";
import widgetBorder from "./styleWidget/widgetBorder.vue";
import widgetDecoration from "./styleWidget/widgetDecoration.vue";
export default {
name: "Widget",
components: {
widgetHref,
widgetText,
widgetBorder,
widgetDecoration,
WidgetMarquee,
widgetTime,
widgetImage,

Loading…
Cancel
Save