@zhangqingcq/vgce 0.0.13 → 0.0.15
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +16 -2
- package/dist/style.css +1 -1
- package/dist/vgce.js +28 -34
- package/dist/vgce.umd.cjs +5 -5
- package/package.json +3 -2
- package/src/App.vue +11 -0
- package/src/assets/base.less +49 -0
- package/src/assets/icons/add.svg +1 -0
- package/src/assets/icons/delete.svg +12 -0
- package/src/assets/icons/export.svg +1 -0
- package/src/assets/icons/group.svg +13 -0
- package/src/assets/icons/import.svg +1 -0
- package/src/assets/icons/lock.svg +7 -0
- package/src/assets/icons/menu-fold.svg +9 -0
- package/src/assets/icons/menu-unfold.svg +9 -0
- package/src/assets/icons/preview.svg +6 -0
- package/src/assets/icons/redo.svg +8 -0
- package/src/assets/icons/return.svg +8 -0
- package/src/assets/icons/rotate.svg +1 -0
- package/src/assets/icons/save.svg +9 -0
- package/src/assets/icons/setting.svg +6 -0
- package/src/assets/icons/undo.svg +7 -0
- package/src/assets/icons/ungroup.svg +16 -0
- package/src/assets/icons/unlock.svg +7 -0
- package/src/assets/main.less +6 -0
- package/src/assets/svgs/alternator.svg +8 -0
- package/src/assets/svgs/bot-12.svg +1 -0
- package/src/assets/svgs/bot-2.svg +1 -0
- package/src/assets/svgs/bot-3.svg +1 -0
- package/src/assets/svgs/bot-7.svg +1 -0
- package/src/assets/svgs/bot-9.svg +94 -0
- package/src/assets/svgs/car.svg +1 -0
- package/src/assets/svgs/circuit-breaker.svg +11 -0
- package/src/assets/svgs/clock-a.svg +23 -0
- package/src/assets/svgs/common-table.svg +7 -0
- package/src/assets/svgs/el-button.svg +10 -0
- package/src/assets/svgs/el-tag.svg +13 -0
- package/src/assets/svgs/hospital.svg +1 -0
- package/src/assets/svgs/house.svg +1 -0
- package/src/assets/svgs/light.svg +24 -0
- package/src/assets/svgs/now-time.svg +9 -0
- package/src/assets/svgs/package.svg +1 -0
- package/src/assets/svgs/pie-charts.svg +10 -0
- package/src/assets/svgs/progress-a.svg +1 -0
- package/src/assets/svgs/reservoir.svg +10 -0
- package/src/assets/svgs/svg-text.svg +5 -0
- package/src/assets/svgs/switch-a.svg +5 -0
- package/src/assets/svgs/traction-transformer.svg +11 -0
- package/src/components/ace-edit/index.ts +27 -0
- package/src/components/config/index.ts +450 -0
- package/src/components/config/types.ts +25 -0
- package/src/components/svg-analysis/index.vue +11 -0
- package/src/components/svg-editor/center-panel/index.vue +867 -0
- package/src/components/svg-editor/center-panel/types.ts +11 -0
- package/src/components/svg-editor/component-tree/index.vue +33 -0
- package/src/components/svg-editor/connection-line/index.vue +125 -0
- package/src/components/svg-editor/connection-panel/index.vue +198 -0
- package/src/components/svg-editor/export-json/index.vue +37 -0
- package/src/components/svg-editor/handle-panel/index.vue +342 -0
- package/src/components/svg-editor/import-json/index.vue +37 -0
- package/src/components/svg-editor/index.vue +280 -0
- package/src/components/svg-editor/left-panel/index.vue +83 -0
- package/src/components/svg-editor/right-panel/code-edit-modal.vue +50 -0
- package/src/components/svg-editor/right-panel/common-animate.vue +96 -0
- package/src/components/svg-editor/right-panel/condition.vue +101 -0
- package/src/components/svg-editor/right-panel/dynamic-el-form-item.vue +97 -0
- package/src/components/svg-editor/right-panel/index.vue +304 -0
- package/src/components/svg-editor/right-panel/list.vue +86 -0
- package/src/components/svg-editor/top-panel/index.vue +139 -0
- package/src/components/svg-editor/types.ts +22 -0
- package/src/components/svg-viewer/index.vue +340 -0
- package/src/components/vue3-ruler-tool/index.vue +506 -0
- package/src/config/files/clock-a.vue +66 -0
- package/src/config/files/common-table.vue +49 -0
- package/src/config/files/light-a.vue +72 -0
- package/src/config/files/now-time.vue +53 -0
- package/src/config/files/pie-charts.vue +72 -0
- package/src/config/files/progress.vue +40 -0
- package/src/config/files/svg-text.vue +39 -0
- package/src/config/files/switch-a.vue +45 -0
- package/src/config/index.ts +28 -0
- package/src/config/svg/animation/index.ts +8 -0
- package/src/config/svg/animation/reservoir.ts +32 -0
- package/src/config/svg/custom/clock-a.ts +23 -0
- package/src/config/svg/custom/index.ts +11 -0
- package/src/config/svg/custom/light.ts +29 -0
- package/src/config/svg/custom/svg-text.ts +54 -0
- package/src/config/svg/custom/switch-a.ts +29 -0
- package/src/config/svg/index.ts +12 -0
- package/src/config/svg/stateful/circuit-breaker.ts +38 -0
- package/src/config/svg/stateful/index.ts +8 -0
- package/src/config/svg/stateless/alternator.ts +28 -0
- package/src/config/svg/stateless/bot-12.ts +22 -0
- package/src/config/svg/stateless/bot-2.ts +22 -0
- package/src/config/svg/stateless/bot-3.ts +22 -0
- package/src/config/svg/stateless/bot-7.ts +22 -0
- package/src/config/svg/stateless/bot-9.ts +22 -0
- package/src/config/svg/stateless/car.ts +22 -0
- package/src/config/svg/stateless/hospital.ts +22 -0
- package/src/config/svg/stateless/house.ts +22 -0
- package/src/config/svg/stateless/index.ts +30 -0
- package/src/config/svg/stateless/package.ts +22 -0
- package/src/config/svg/stateless/traction-transformer.ts +28 -0
- package/src/config/types.ts +126 -0
- package/src/config/vue/component/button.ts +57 -0
- package/src/config/vue/component/common-table.ts +124 -0
- package/src/config/vue/component/index.ts +13 -0
- package/src/config/vue/component/now-time.ts +29 -0
- package/src/config/vue/component/progress.ts +29 -0
- package/src/config/vue/component/tag.ts +46 -0
- package/src/config/vue/echarts/index.ts +8 -0
- package/src/config/vue/echarts/pie-charts.ts +60 -0
- package/src/config/vue/index.ts +5 -0
- package/src/hooks.ts +47 -0
- package/src/index.ts +14 -0
- package/src/main.ts +15 -0
- package/src/router.ts +24 -0
- package/src/stores/config/index.ts +44 -0
- package/src/stores/config/types.ts +27 -0
- package/src/stores/global/index.ts +109 -0
- package/src/stores/global/types.ts +115 -0
- package/src/stores/main.ts +10 -0
- package/src/stores/svg-edit-layout/index.ts +17 -0
- package/src/stores/svg-edit-layout/types.ts +8 -0
- package/src/stores/system/index.ts +174 -0
- package/src/stores/system/types.ts +43 -0
- package/src/utils/fetch.ts +351 -0
- package/src/utils/file-read-write.ts +26 -0
- package/src/utils/index.ts +397 -0
- package/src/utils/mqtt-net.ts +48 -0
- package/src/utils/proxy.ts +7 -0
- package/src/utils/scale-core.ts +214 -0
- package/src/utils/types.ts +13 -0
- package/src/views/EditorS.vue +18 -0
- package/src/views/Preview.vue +12 -0
@@ -0,0 +1,53 @@
|
|
1
|
+
<script setup lang="ts">
|
2
|
+
import { computed, onMounted, ref, onUnmounted } from 'vue'
|
3
|
+
const props = defineProps({
|
4
|
+
fontColor: {
|
5
|
+
type: String,
|
6
|
+
default: '#000000'
|
7
|
+
}
|
8
|
+
})
|
9
|
+
const now_date = ref(new Date())
|
10
|
+
const timer = ref()
|
11
|
+
const date = computed(() => {
|
12
|
+
const year = now_date.value.getFullYear()
|
13
|
+
const month = now_date.value.getMonth() + 1
|
14
|
+
const day = now_date.value.getDate()
|
15
|
+
const time = year.toString() + '年' + month.toString() + '月' + day.toString() + '日'
|
16
|
+
return time
|
17
|
+
})
|
18
|
+
const week = computed(() => {
|
19
|
+
const d = now_date.value.getDay()
|
20
|
+
const weekday = ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六']
|
21
|
+
const time = weekday[d]
|
22
|
+
return time
|
23
|
+
})
|
24
|
+
const time = computed(() => {
|
25
|
+
const hour = now_date.value.getHours()
|
26
|
+
const minute = now_date.value.getMinutes()
|
27
|
+
const second = now_date.value.getSeconds()
|
28
|
+
const time =
|
29
|
+
(hour < 10 ? '0' + hour.toString() : hour.toString()) +
|
30
|
+
':' +
|
31
|
+
(minute < 10 ? '0' + minute.toString() : minute.toString()) +
|
32
|
+
':' +
|
33
|
+
(second < 10 ? '0' + second.toString() : second.toString())
|
34
|
+
return time
|
35
|
+
})
|
36
|
+
onMounted(() => {
|
37
|
+
timer.value = setInterval(() => {
|
38
|
+
now_date.value = new Date() // 修改数据date
|
39
|
+
}, 500)
|
40
|
+
})
|
41
|
+
onUnmounted(() => {
|
42
|
+
clearInterval(timer.value)
|
43
|
+
})
|
44
|
+
</script>
|
45
|
+
<template>
|
46
|
+
<div>
|
47
|
+
<div class="text-12px font-bold" :style="{ color: props.fontColor }">{{ date }}</div>
|
48
|
+
<div class="flex mt-5px">
|
49
|
+
<div class="text-12px font-bold" :style="{ color: props.fontColor }">{{ week }}</div>
|
50
|
+
<div class="text-12px font-bold ml-5px" :style="{ color: props.fontColor }">{{ time }}</div>
|
51
|
+
</div>
|
52
|
+
</div>
|
53
|
+
</template>
|
@@ -0,0 +1,72 @@
|
|
1
|
+
<script lang="ts" setup>
|
2
|
+
import { use } from 'echarts/core'
|
3
|
+
import { SVGRenderer } from 'echarts/renderers'
|
4
|
+
import { PieChart } from 'echarts/charts'
|
5
|
+
import { TitleComponent, TooltipComponent, LegendComponent } from 'echarts/components'
|
6
|
+
import VChart, { THEME_KEY } from 'vue-echarts'
|
7
|
+
import { watch, provide, reactive } from 'vue'
|
8
|
+
use([SVGRenderer, PieChart, TitleComponent, TooltipComponent, LegendComponent])
|
9
|
+
|
10
|
+
provide(THEME_KEY, 'dark')
|
11
|
+
|
12
|
+
const props = defineProps({
|
13
|
+
title: {
|
14
|
+
type: String,
|
15
|
+
default: '标题'
|
16
|
+
},
|
17
|
+
seriesName: {
|
18
|
+
type: String,
|
19
|
+
default: '详情'
|
20
|
+
},
|
21
|
+
seriesData: {
|
22
|
+
type: Array,
|
23
|
+
default: () => []
|
24
|
+
}
|
25
|
+
})
|
26
|
+
|
27
|
+
const option = reactive({
|
28
|
+
title: {
|
29
|
+
text: props.title,
|
30
|
+
left: 'center'
|
31
|
+
},
|
32
|
+
tooltip: {
|
33
|
+
trigger: 'item',
|
34
|
+
formatter: '{a} <br/>{b} : {c} ({d}%)'
|
35
|
+
},
|
36
|
+
legend: {
|
37
|
+
orient: 'vertical',
|
38
|
+
left: 'left'
|
39
|
+
},
|
40
|
+
series: [
|
41
|
+
{
|
42
|
+
name: props.seriesName,
|
43
|
+
type: 'pie',
|
44
|
+
radius: '55%',
|
45
|
+
center: ['50%', '60%'],
|
46
|
+
data: props.seriesData,
|
47
|
+
emphasis: {
|
48
|
+
itemStyle: {
|
49
|
+
shadowBlur: 10,
|
50
|
+
shadowOffsetX: 0,
|
51
|
+
shadowColor: 'rgba(0, 0, 0, 0.5)'
|
52
|
+
}
|
53
|
+
}
|
54
|
+
}
|
55
|
+
]
|
56
|
+
})
|
57
|
+
watch(props, (new_val) => {
|
58
|
+
option.title.text = new_val.title
|
59
|
+
option.series[0].name = new_val.seriesName
|
60
|
+
option.series[0].data = new_val.seriesData
|
61
|
+
})
|
62
|
+
</script>
|
63
|
+
|
64
|
+
<template>
|
65
|
+
<v-chart class="chart" :option="option" autoresize />
|
66
|
+
</template>
|
67
|
+
|
68
|
+
<style scoped>
|
69
|
+
.chart {
|
70
|
+
height: 400px;
|
71
|
+
}
|
72
|
+
</style>
|
@@ -0,0 +1,40 @@
|
|
1
|
+
<script setup lang="ts">
|
2
|
+
import { ElProgress } from 'element-plus'
|
3
|
+
import type { ProgressColor } from 'element-plus'
|
4
|
+
import { watch } from 'vue'
|
5
|
+
|
6
|
+
const colors: ProgressColor[] = [
|
7
|
+
{
|
8
|
+
color: '#f56c6c',
|
9
|
+
percentage: 20
|
10
|
+
},
|
11
|
+
{
|
12
|
+
color: '#e6a23c',
|
13
|
+
percentage: 40
|
14
|
+
},
|
15
|
+
{
|
16
|
+
color: '#5cb87a',
|
17
|
+
percentage: 60
|
18
|
+
},
|
19
|
+
{
|
20
|
+
color: '#1989fa',
|
21
|
+
percentage: 80
|
22
|
+
},
|
23
|
+
{
|
24
|
+
color: '#6f7ad3',
|
25
|
+
percentage: 100
|
26
|
+
}
|
27
|
+
]
|
28
|
+
const props = withDefaults(defineProps<{ percentage: number | string }>(), { percentage: 10 })
|
29
|
+
const emit = defineEmits(['onChange'])
|
30
|
+
watch(
|
31
|
+
() => props.percentage,
|
32
|
+
() => {
|
33
|
+
emit('onChange')
|
34
|
+
}
|
35
|
+
)
|
36
|
+
</script>
|
37
|
+
|
38
|
+
<template>
|
39
|
+
<el-progress type="dashboard" :percentage="Number(props.percentage)" :color="colors" />
|
40
|
+
</template>
|
@@ -0,0 +1,39 @@
|
|
1
|
+
<script setup lang="ts">
|
2
|
+
// 文字的内容决定了长度 所以没办法预先定义中心点 导致连线有偏移
|
3
|
+
import { nextTick, watch } from 'vue'
|
4
|
+
|
5
|
+
const emit = defineEmits(['resize'])
|
6
|
+
|
7
|
+
const props = defineProps({
|
8
|
+
fontFamily: {
|
9
|
+
type: String,
|
10
|
+
default: ''
|
11
|
+
},
|
12
|
+
fontSize: {
|
13
|
+
type: Number,
|
14
|
+
default: 15
|
15
|
+
},
|
16
|
+
text: {
|
17
|
+
type: String,
|
18
|
+
default: ''
|
19
|
+
},
|
20
|
+
fill: {
|
21
|
+
type: String,
|
22
|
+
default: ''
|
23
|
+
}
|
24
|
+
})
|
25
|
+
|
26
|
+
watch(
|
27
|
+
() => [props.text, props.fontSize, props.fontFamily],
|
28
|
+
() => {
|
29
|
+
nextTick(function () {
|
30
|
+
emit('resize')
|
31
|
+
})
|
32
|
+
}
|
33
|
+
)
|
34
|
+
</script>
|
35
|
+
<template>
|
36
|
+
<text x="50" y="55" :font-family="props.fontFamily" :font-size="props.fontSize" :fill="props.fill"
|
37
|
+
>{{ props.text }}
|
38
|
+
</text>
|
39
|
+
</template>
|
@@ -0,0 +1,45 @@
|
|
1
|
+
<script setup lang="ts">
|
2
|
+
import { watch } from 'vue'
|
3
|
+
|
4
|
+
const props = defineProps({
|
5
|
+
id: {
|
6
|
+
type: String,
|
7
|
+
default: ''
|
8
|
+
},
|
9
|
+
isOpen: {
|
10
|
+
type: Boolean,
|
11
|
+
default: true
|
12
|
+
}
|
13
|
+
})
|
14
|
+
const emit = defineEmits(['onChange'])
|
15
|
+
watch(
|
16
|
+
() => props.isOpen,
|
17
|
+
() => {
|
18
|
+
emit('onChange')
|
19
|
+
}
|
20
|
+
)
|
21
|
+
</script>
|
22
|
+
<template>
|
23
|
+
<g :id="props.id">
|
24
|
+
<symbol viewBox="0 0 1024 1024" :id="`${props.id}switch-demo-open`">
|
25
|
+
<path
|
26
|
+
d="M735.2 792.4H287.6C136.9 792.4 14.2 669.8 14.2 519c0-150.9 122.6-273.5 273.4-273.5h447.6c150.7 0 273.4 122.6 273.4 273.4 0 150.9-122.7 273.5-273.4 273.5zM287.6 300.2c-120.6 0-218.7 98.1-218.7 218.7 0 120.8 98.1 218.9 218.7 218.9h447.6c120.6 0 218.7-98.1 218.7-218.7 0-120.8-98.1-218.9-218.7-218.9H287.6z"
|
27
|
+
fill="#666666"
|
28
|
+
></path>
|
29
|
+
<path
|
30
|
+
d="M724.7 687.1c-92.7 0-168.1-75.4-168.1-168.1S632 350.9 724.7 350.9 892.8 426.3 892.8 519s-75.4 168.1-168.1 168.1z m0-278.6c-60.9 0-110.5 49.6-110.5 110.5s49.5 110.5 110.5 110.5S835.1 579.9 835.1 519s-49.5-110.5-110.4-110.5z"
|
31
|
+
fill="#666666"
|
32
|
+
></path>
|
33
|
+
</symbol>
|
34
|
+
<symbol viewBox="0 0 1024 1024" :id="`${props.id}switch-demo-close`">
|
35
|
+
<path
|
36
|
+
d="M704 224H320C161.216 224 32 353.216 32 512c0 158.816 129.216 288 288 288h384c158.816 0 288-129.184 288-288 0-158.784-129.184-288-288-288z m0 512H320C196.48 736 96 635.488 96 512c0-123.52 100.48-224 224-224h384c123.488 0 224 100.48 224 224 0 123.488-100.512 224-224 224z"
|
37
|
+
></path>
|
38
|
+
<path
|
39
|
+
d="M320 320c-105.888 0-192 86.112-192 192s86.112 192 192 192 192-86.112 192-192-86.112-192-192-192z m0 320c-70.592 0-128-57.408-128-128s57.408-128 128-128 128 57.408 128 128-57.408 128-128 128z"
|
40
|
+
></path>
|
41
|
+
</symbol>
|
42
|
+
<use v-if="props.isOpen" :xlink:href="`#${props.id}switch-demo-open`" width="100" height="100" />
|
43
|
+
<use v-else :xlink:href="`#${props.id}switch-demo-close`" width="100" height="100" />
|
44
|
+
</g>
|
45
|
+
</template>
|
@@ -0,0 +1,28 @@
|
|
1
|
+
import type { IConfig } from './types'
|
2
|
+
import { svg_config } from './svg'
|
3
|
+
import { vue_config } from './vue'
|
4
|
+
|
5
|
+
import { ElButton, ElTag } from 'element-plus'
|
6
|
+
import Progress from '@/config/files/progress.vue'
|
7
|
+
import SwitchA from '@/config/files/switch-a.vue'
|
8
|
+
import SvgText from '@/config/files/svg-text.vue'
|
9
|
+
import CommonTable from '@/config/files/common-table.vue'
|
10
|
+
import NowTime from '@/config/files/now-time.vue'
|
11
|
+
import PieCharts from '@/config/files/pie-charts.vue'
|
12
|
+
import LightA from '@/config/files/light-a.vue'
|
13
|
+
import ClockA from '@/config/files/clock-a.vue'
|
14
|
+
|
15
|
+
export const vueComp: Record<string, any> = {
|
16
|
+
'svg-text': SvgText,
|
17
|
+
'el-button': ElButton,
|
18
|
+
'progress-a': Progress,
|
19
|
+
'el-tag': ElTag,
|
20
|
+
'common-table': CommonTable,
|
21
|
+
'pie-charts': PieCharts,
|
22
|
+
'switch-a': SwitchA,
|
23
|
+
'now-time': NowTime,
|
24
|
+
'light-a': LightA,
|
25
|
+
'clock-a': ClockA
|
26
|
+
}
|
27
|
+
|
28
|
+
export const config: IConfig = [...svg_config, ...vue_config]
|
@@ -0,0 +1,32 @@
|
|
1
|
+
import { EConfigItemPropsType, EDoneJsonType } from '@/config/types'
|
2
|
+
import type { IConfigItem } from '@/config/types'
|
3
|
+
export const reservoir: IConfigItem = {
|
4
|
+
name: 'reservoir',
|
5
|
+
title: '蓄水池',
|
6
|
+
type: EDoneJsonType.File,
|
7
|
+
config: {
|
8
|
+
can_zoom: true,
|
9
|
+
have_anchor: true,
|
10
|
+
actual_rect: true
|
11
|
+
},
|
12
|
+
display: true,
|
13
|
+
props: {
|
14
|
+
fill: {
|
15
|
+
title: '水流颜色',
|
16
|
+
type: EConfigItemPropsType.Color,
|
17
|
+
val: '#37cfe7'
|
18
|
+
},
|
19
|
+
stroke: {
|
20
|
+
title: '边框颜色',
|
21
|
+
type: EConfigItemPropsType.Color,
|
22
|
+
val: '#000'
|
23
|
+
}
|
24
|
+
},
|
25
|
+
common_animations: {
|
26
|
+
val: '',
|
27
|
+
delay: 'delay-0s',
|
28
|
+
speed: 'slow',
|
29
|
+
repeat: 'infinite'
|
30
|
+
},
|
31
|
+
events: []
|
32
|
+
}
|
@@ -0,0 +1,23 @@
|
|
1
|
+
import { EDoneJsonType } from '@/config/types'
|
2
|
+
import type { IConfigItem } from '@/config/types'
|
3
|
+
|
4
|
+
export const clock_a: IConfigItem = {
|
5
|
+
name: 'clock-a',
|
6
|
+
title: '时钟',
|
7
|
+
tag: 'clock-a',
|
8
|
+
type: EDoneJsonType.CustomSvg,
|
9
|
+
config: {
|
10
|
+
can_zoom: true,
|
11
|
+
have_anchor: true,
|
12
|
+
actual_rect: true
|
13
|
+
},
|
14
|
+
display: true,
|
15
|
+
props: {},
|
16
|
+
common_animations: {
|
17
|
+
val: '',
|
18
|
+
delay: 'delay-0s',
|
19
|
+
speed: 'slow',
|
20
|
+
repeat: 'infinite'
|
21
|
+
},
|
22
|
+
events: []
|
23
|
+
}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import type { IConfigComponentGroup } from '../../types'
|
2
|
+
import { svg_text } from './svg-text'
|
3
|
+
import { switch_a } from './switch-a'
|
4
|
+
import { light_a } from '@/config/svg/custom/light'
|
5
|
+
import { clock_a } from '@/config/svg/custom/clock-a'
|
6
|
+
|
7
|
+
export const custom_svg_group: IConfigComponentGroup = {
|
8
|
+
groupType: 'custom_svg_group',
|
9
|
+
title: 'SVG组件',
|
10
|
+
list: [svg_text, switch_a, light_a, clock_a]
|
11
|
+
}
|
@@ -0,0 +1,29 @@
|
|
1
|
+
import { EConfigItemPropsType, EDoneJsonType } from '@/config/types'
|
2
|
+
import type { IConfigItem } from '@/config/types'
|
3
|
+
|
4
|
+
export const light_a: IConfigItem = {
|
5
|
+
name: 'light',
|
6
|
+
tag: 'light-a',
|
7
|
+
title: '灯',
|
8
|
+
type: EDoneJsonType.CustomSvg,
|
9
|
+
config: {
|
10
|
+
can_zoom: true,
|
11
|
+
have_anchor: true,
|
12
|
+
actual_rect: true
|
13
|
+
},
|
14
|
+
display: true,
|
15
|
+
props: {
|
16
|
+
isOpen: {
|
17
|
+
title: '开关',
|
18
|
+
type: EConfigItemPropsType.Switch,
|
19
|
+
val: false
|
20
|
+
}
|
21
|
+
},
|
22
|
+
common_animations: {
|
23
|
+
val: '',
|
24
|
+
delay: 'delay-0s',
|
25
|
+
speed: 'slow',
|
26
|
+
repeat: 'infinite'
|
27
|
+
},
|
28
|
+
events: []
|
29
|
+
}
|
@@ -0,0 +1,54 @@
|
|
1
|
+
import { EConfigItemPropsType, EDoneJsonType } from '@/config/types'
|
2
|
+
import type { IConfigItem } from '@/config/types'
|
3
|
+
|
4
|
+
export const svg_text: IConfigItem = {
|
5
|
+
name: 'svg-text',
|
6
|
+
title: '文字',
|
7
|
+
tag: 'svg-text',
|
8
|
+
type: EDoneJsonType.CustomSvg,
|
9
|
+
display: true,
|
10
|
+
config: {
|
11
|
+
can_zoom: true,
|
12
|
+
have_anchor: true,
|
13
|
+
actual_rect: true
|
14
|
+
},
|
15
|
+
props: {
|
16
|
+
text: {
|
17
|
+
title: '文字内容',
|
18
|
+
type: EConfigItemPropsType.Input,
|
19
|
+
val: '文字'
|
20
|
+
},
|
21
|
+
fontFamily: {
|
22
|
+
title: '字体',
|
23
|
+
type: EConfigItemPropsType.Select,
|
24
|
+
val: 'Microsoft YaHei',
|
25
|
+
options: [
|
26
|
+
{
|
27
|
+
value: 'Microsoft YaHei',
|
28
|
+
label: '微软雅黑'
|
29
|
+
},
|
30
|
+
{
|
31
|
+
value: 'NSimSun',
|
32
|
+
label: '新宋体'
|
33
|
+
}
|
34
|
+
]
|
35
|
+
},
|
36
|
+
fontSize: {
|
37
|
+
title: '文字大小',
|
38
|
+
type: EConfigItemPropsType.InputNumber,
|
39
|
+
val: 15
|
40
|
+
},
|
41
|
+
fill: {
|
42
|
+
title: '文字颜色',
|
43
|
+
type: EConfigItemPropsType.Color,
|
44
|
+
val: '#000'
|
45
|
+
}
|
46
|
+
},
|
47
|
+
common_animations: {
|
48
|
+
val: '',
|
49
|
+
delay: 'delay-0s',
|
50
|
+
speed: 'slow',
|
51
|
+
repeat: 'infinite'
|
52
|
+
},
|
53
|
+
events: []
|
54
|
+
}
|
@@ -0,0 +1,29 @@
|
|
1
|
+
import { EConfigItemPropsType, EDoneJsonType } from '@/config/types'
|
2
|
+
import type { IConfigItem } from '@/config/types'
|
3
|
+
|
4
|
+
export const switch_a: IConfigItem = {
|
5
|
+
name: 'switch-a',
|
6
|
+
title: '开关',
|
7
|
+
tag: 'switch-a',
|
8
|
+
type: EDoneJsonType.CustomSvg,
|
9
|
+
display: true,
|
10
|
+
config: {
|
11
|
+
can_zoom: true,
|
12
|
+
have_anchor: true,
|
13
|
+
actual_rect: true
|
14
|
+
},
|
15
|
+
props: {
|
16
|
+
isOpen: {
|
17
|
+
title: '开关',
|
18
|
+
type: EConfigItemPropsType.Switch,
|
19
|
+
val: true
|
20
|
+
}
|
21
|
+
},
|
22
|
+
common_animations: {
|
23
|
+
val: '',
|
24
|
+
delay: 'delay-0s',
|
25
|
+
speed: 'slow',
|
26
|
+
repeat: 'infinite'
|
27
|
+
},
|
28
|
+
events: []
|
29
|
+
}
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import type { IConfigComponentGroup } from '../types'
|
2
|
+
import { stateful_group } from './stateful'
|
3
|
+
import { stateless_group } from './stateless'
|
4
|
+
import { animation_group } from './animation'
|
5
|
+
import { custom_svg_group } from './custom'
|
6
|
+
|
7
|
+
export const svg_config: IConfigComponentGroup[] = Object.seal([
|
8
|
+
stateless_group,
|
9
|
+
stateful_group,
|
10
|
+
animation_group,
|
11
|
+
custom_svg_group
|
12
|
+
])
|
@@ -0,0 +1,38 @@
|
|
1
|
+
import { EDoneJsonType } from '@/config/types'
|
2
|
+
import type { IConfigItem } from '@/config/types'
|
3
|
+
|
4
|
+
export const circuit_breaker_svg_file: IConfigItem = {
|
5
|
+
name: 'circuit-breaker',
|
6
|
+
title: '断路器',
|
7
|
+
type: EDoneJsonType.File,
|
8
|
+
config: {
|
9
|
+
can_zoom: true,
|
10
|
+
have_anchor: true,
|
11
|
+
actual_rect: true
|
12
|
+
},
|
13
|
+
display: true,
|
14
|
+
props: {},
|
15
|
+
state: {
|
16
|
+
OnOff: {
|
17
|
+
title: '开关',
|
18
|
+
default: false,
|
19
|
+
props: {
|
20
|
+
fill: {
|
21
|
+
openVal: '#00ff00',
|
22
|
+
closeVal: '#ff0000'
|
23
|
+
},
|
24
|
+
'fill-opacity': {
|
25
|
+
openVal: '0',
|
26
|
+
closeVal: '1'
|
27
|
+
}
|
28
|
+
}
|
29
|
+
}
|
30
|
+
},
|
31
|
+
common_animations: {
|
32
|
+
val: '',
|
33
|
+
delay: 'delay-0s',
|
34
|
+
speed: 'slow',
|
35
|
+
repeat: 'infinite'
|
36
|
+
},
|
37
|
+
events: []
|
38
|
+
}
|
@@ -0,0 +1,28 @@
|
|
1
|
+
import { EConfigItemPropsType, EDoneJsonType } from '@/config/types'
|
2
|
+
import type { IConfigItem } from '@/config/types'
|
3
|
+
|
4
|
+
export const alternator_svg_file: IConfigItem = {
|
5
|
+
name: 'alternator',
|
6
|
+
title: '发电机',
|
7
|
+
type: EDoneJsonType.File,
|
8
|
+
config: {
|
9
|
+
can_zoom: true,
|
10
|
+
have_anchor: true,
|
11
|
+
actual_rect: true
|
12
|
+
},
|
13
|
+
display: true,
|
14
|
+
props: {
|
15
|
+
fill: {
|
16
|
+
title: '填充色',
|
17
|
+
type: EConfigItemPropsType.Color,
|
18
|
+
val: '#00ff00'
|
19
|
+
}
|
20
|
+
},
|
21
|
+
common_animations: {
|
22
|
+
val: '',
|
23
|
+
delay: 'delay-0s',
|
24
|
+
speed: 'slow',
|
25
|
+
repeat: 'infinite'
|
26
|
+
},
|
27
|
+
events: []
|
28
|
+
}
|
@@ -0,0 +1,22 @@
|
|
1
|
+
import { EDoneJsonType } from '@/config/types'
|
2
|
+
import type { IConfigItem } from '@/config/types'
|
3
|
+
|
4
|
+
export const svg_bot_12: IConfigItem = {
|
5
|
+
name: 'bot-12',
|
6
|
+
title: '12号机',
|
7
|
+
type: EDoneJsonType.File,
|
8
|
+
display: true,
|
9
|
+
config: {
|
10
|
+
can_zoom: true,
|
11
|
+
have_anchor: true,
|
12
|
+
actual_rect: true
|
13
|
+
},
|
14
|
+
props: {},
|
15
|
+
common_animations: {
|
16
|
+
val: '',
|
17
|
+
delay: 'delay-0s',
|
18
|
+
speed: 'slow',
|
19
|
+
repeat: 'infinite'
|
20
|
+
},
|
21
|
+
events: []
|
22
|
+
}
|
@@ -0,0 +1,22 @@
|
|
1
|
+
import { EDoneJsonType } from '@/config/types'
|
2
|
+
import type { IConfigItem } from '@/config/types'
|
3
|
+
|
4
|
+
export const svg_bot_2: IConfigItem = {
|
5
|
+
name: 'bot-2',
|
6
|
+
title: '2号机',
|
7
|
+
type: EDoneJsonType.File,
|
8
|
+
display: true,
|
9
|
+
config: {
|
10
|
+
can_zoom: true,
|
11
|
+
have_anchor: true,
|
12
|
+
actual_rect: true
|
13
|
+
},
|
14
|
+
props: {},
|
15
|
+
common_animations: {
|
16
|
+
val: '',
|
17
|
+
delay: 'delay-0s',
|
18
|
+
speed: 'slow',
|
19
|
+
repeat: 'infinite'
|
20
|
+
},
|
21
|
+
events: []
|
22
|
+
}
|
@@ -0,0 +1,22 @@
|
|
1
|
+
import { EDoneJsonType } from '@/config/types'
|
2
|
+
import type { IConfigItem } from '@/config/types'
|
3
|
+
|
4
|
+
export const svg_bot_3: IConfigItem = {
|
5
|
+
name: 'bot-3',
|
6
|
+
title: '3号机',
|
7
|
+
type: EDoneJsonType.File,
|
8
|
+
display: true,
|
9
|
+
config: {
|
10
|
+
can_zoom: true,
|
11
|
+
have_anchor: true,
|
12
|
+
actual_rect: true
|
13
|
+
},
|
14
|
+
props: {},
|
15
|
+
common_animations: {
|
16
|
+
val: '',
|
17
|
+
delay: 'delay-0s',
|
18
|
+
speed: 'slow',
|
19
|
+
repeat: 'infinite'
|
20
|
+
},
|
21
|
+
events: []
|
22
|
+
}
|
@@ -0,0 +1,22 @@
|
|
1
|
+
import { EDoneJsonType } from '@/config/types'
|
2
|
+
import type { IConfigItem } from '@/config/types'
|
3
|
+
|
4
|
+
export const svg_bot_7: IConfigItem = {
|
5
|
+
name: 'bot-7',
|
6
|
+
title: '7号机',
|
7
|
+
type: EDoneJsonType.File,
|
8
|
+
display: true,
|
9
|
+
config: {
|
10
|
+
can_zoom: true,
|
11
|
+
have_anchor: true,
|
12
|
+
actual_rect: true
|
13
|
+
},
|
14
|
+
props: {},
|
15
|
+
common_animations: {
|
16
|
+
val: '',
|
17
|
+
delay: 'delay-0s',
|
18
|
+
speed: 'slow',
|
19
|
+
repeat: 'infinite'
|
20
|
+
},
|
21
|
+
events: []
|
22
|
+
}
|
@@ -0,0 +1,22 @@
|
|
1
|
+
import { EDoneJsonType } from '@/config/types'
|
2
|
+
import type { IConfigItem } from '@/config/types'
|
3
|
+
|
4
|
+
export const svg_bot_9: IConfigItem = {
|
5
|
+
name: 'bot-9',
|
6
|
+
title: '9号机',
|
7
|
+
type: EDoneJsonType.File,
|
8
|
+
display: true,
|
9
|
+
config: {
|
10
|
+
can_zoom: true,
|
11
|
+
have_anchor: true,
|
12
|
+
actual_rect: true
|
13
|
+
},
|
14
|
+
props: {},
|
15
|
+
common_animations: {
|
16
|
+
val: '',
|
17
|
+
delay: 'delay-0s',
|
18
|
+
speed: 'slow',
|
19
|
+
repeat: 'infinite'
|
20
|
+
},
|
21
|
+
events: []
|
22
|
+
}
|