@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.
Files changed (135) hide show
  1. package/README.md +16 -2
  2. package/dist/style.css +1 -1
  3. package/dist/vgce.js +28 -34
  4. package/dist/vgce.umd.cjs +5 -5
  5. package/package.json +3 -2
  6. package/src/App.vue +11 -0
  7. package/src/assets/base.less +49 -0
  8. package/src/assets/icons/add.svg +1 -0
  9. package/src/assets/icons/delete.svg +12 -0
  10. package/src/assets/icons/export.svg +1 -0
  11. package/src/assets/icons/group.svg +13 -0
  12. package/src/assets/icons/import.svg +1 -0
  13. package/src/assets/icons/lock.svg +7 -0
  14. package/src/assets/icons/menu-fold.svg +9 -0
  15. package/src/assets/icons/menu-unfold.svg +9 -0
  16. package/src/assets/icons/preview.svg +6 -0
  17. package/src/assets/icons/redo.svg +8 -0
  18. package/src/assets/icons/return.svg +8 -0
  19. package/src/assets/icons/rotate.svg +1 -0
  20. package/src/assets/icons/save.svg +9 -0
  21. package/src/assets/icons/setting.svg +6 -0
  22. package/src/assets/icons/undo.svg +7 -0
  23. package/src/assets/icons/ungroup.svg +16 -0
  24. package/src/assets/icons/unlock.svg +7 -0
  25. package/src/assets/main.less +6 -0
  26. package/src/assets/svgs/alternator.svg +8 -0
  27. package/src/assets/svgs/bot-12.svg +1 -0
  28. package/src/assets/svgs/bot-2.svg +1 -0
  29. package/src/assets/svgs/bot-3.svg +1 -0
  30. package/src/assets/svgs/bot-7.svg +1 -0
  31. package/src/assets/svgs/bot-9.svg +94 -0
  32. package/src/assets/svgs/car.svg +1 -0
  33. package/src/assets/svgs/circuit-breaker.svg +11 -0
  34. package/src/assets/svgs/clock-a.svg +23 -0
  35. package/src/assets/svgs/common-table.svg +7 -0
  36. package/src/assets/svgs/el-button.svg +10 -0
  37. package/src/assets/svgs/el-tag.svg +13 -0
  38. package/src/assets/svgs/hospital.svg +1 -0
  39. package/src/assets/svgs/house.svg +1 -0
  40. package/src/assets/svgs/light.svg +24 -0
  41. package/src/assets/svgs/now-time.svg +9 -0
  42. package/src/assets/svgs/package.svg +1 -0
  43. package/src/assets/svgs/pie-charts.svg +10 -0
  44. package/src/assets/svgs/progress-a.svg +1 -0
  45. package/src/assets/svgs/reservoir.svg +10 -0
  46. package/src/assets/svgs/svg-text.svg +5 -0
  47. package/src/assets/svgs/switch-a.svg +5 -0
  48. package/src/assets/svgs/traction-transformer.svg +11 -0
  49. package/src/components/ace-edit/index.ts +27 -0
  50. package/src/components/config/index.ts +450 -0
  51. package/src/components/config/types.ts +25 -0
  52. package/src/components/svg-analysis/index.vue +11 -0
  53. package/src/components/svg-editor/center-panel/index.vue +867 -0
  54. package/src/components/svg-editor/center-panel/types.ts +11 -0
  55. package/src/components/svg-editor/component-tree/index.vue +33 -0
  56. package/src/components/svg-editor/connection-line/index.vue +125 -0
  57. package/src/components/svg-editor/connection-panel/index.vue +198 -0
  58. package/src/components/svg-editor/export-json/index.vue +37 -0
  59. package/src/components/svg-editor/handle-panel/index.vue +342 -0
  60. package/src/components/svg-editor/import-json/index.vue +37 -0
  61. package/src/components/svg-editor/index.vue +280 -0
  62. package/src/components/svg-editor/left-panel/index.vue +83 -0
  63. package/src/components/svg-editor/right-panel/code-edit-modal.vue +50 -0
  64. package/src/components/svg-editor/right-panel/common-animate.vue +96 -0
  65. package/src/components/svg-editor/right-panel/condition.vue +101 -0
  66. package/src/components/svg-editor/right-panel/dynamic-el-form-item.vue +97 -0
  67. package/src/components/svg-editor/right-panel/index.vue +304 -0
  68. package/src/components/svg-editor/right-panel/list.vue +86 -0
  69. package/src/components/svg-editor/top-panel/index.vue +139 -0
  70. package/src/components/svg-editor/types.ts +22 -0
  71. package/src/components/svg-viewer/index.vue +340 -0
  72. package/src/components/vue3-ruler-tool/index.vue +506 -0
  73. package/src/config/files/clock-a.vue +66 -0
  74. package/src/config/files/common-table.vue +49 -0
  75. package/src/config/files/light-a.vue +72 -0
  76. package/src/config/files/now-time.vue +53 -0
  77. package/src/config/files/pie-charts.vue +72 -0
  78. package/src/config/files/progress.vue +40 -0
  79. package/src/config/files/svg-text.vue +39 -0
  80. package/src/config/files/switch-a.vue +45 -0
  81. package/src/config/index.ts +28 -0
  82. package/src/config/svg/animation/index.ts +8 -0
  83. package/src/config/svg/animation/reservoir.ts +32 -0
  84. package/src/config/svg/custom/clock-a.ts +23 -0
  85. package/src/config/svg/custom/index.ts +11 -0
  86. package/src/config/svg/custom/light.ts +29 -0
  87. package/src/config/svg/custom/svg-text.ts +54 -0
  88. package/src/config/svg/custom/switch-a.ts +29 -0
  89. package/src/config/svg/index.ts +12 -0
  90. package/src/config/svg/stateful/circuit-breaker.ts +38 -0
  91. package/src/config/svg/stateful/index.ts +8 -0
  92. package/src/config/svg/stateless/alternator.ts +28 -0
  93. package/src/config/svg/stateless/bot-12.ts +22 -0
  94. package/src/config/svg/stateless/bot-2.ts +22 -0
  95. package/src/config/svg/stateless/bot-3.ts +22 -0
  96. package/src/config/svg/stateless/bot-7.ts +22 -0
  97. package/src/config/svg/stateless/bot-9.ts +22 -0
  98. package/src/config/svg/stateless/car.ts +22 -0
  99. package/src/config/svg/stateless/hospital.ts +22 -0
  100. package/src/config/svg/stateless/house.ts +22 -0
  101. package/src/config/svg/stateless/index.ts +30 -0
  102. package/src/config/svg/stateless/package.ts +22 -0
  103. package/src/config/svg/stateless/traction-transformer.ts +28 -0
  104. package/src/config/types.ts +126 -0
  105. package/src/config/vue/component/button.ts +57 -0
  106. package/src/config/vue/component/common-table.ts +124 -0
  107. package/src/config/vue/component/index.ts +13 -0
  108. package/src/config/vue/component/now-time.ts +29 -0
  109. package/src/config/vue/component/progress.ts +29 -0
  110. package/src/config/vue/component/tag.ts +46 -0
  111. package/src/config/vue/echarts/index.ts +8 -0
  112. package/src/config/vue/echarts/pie-charts.ts +60 -0
  113. package/src/config/vue/index.ts +5 -0
  114. package/src/hooks.ts +47 -0
  115. package/src/index.ts +14 -0
  116. package/src/main.ts +15 -0
  117. package/src/router.ts +24 -0
  118. package/src/stores/config/index.ts +44 -0
  119. package/src/stores/config/types.ts +27 -0
  120. package/src/stores/global/index.ts +109 -0
  121. package/src/stores/global/types.ts +115 -0
  122. package/src/stores/main.ts +10 -0
  123. package/src/stores/svg-edit-layout/index.ts +17 -0
  124. package/src/stores/svg-edit-layout/types.ts +8 -0
  125. package/src/stores/system/index.ts +174 -0
  126. package/src/stores/system/types.ts +43 -0
  127. package/src/utils/fetch.ts +351 -0
  128. package/src/utils/file-read-write.ts +26 -0
  129. package/src/utils/index.ts +397 -0
  130. package/src/utils/mqtt-net.ts +48 -0
  131. package/src/utils/proxy.ts +7 -0
  132. package/src/utils/scale-core.ts +214 -0
  133. package/src/utils/types.ts +13 -0
  134. package/src/views/EditorS.vue +18 -0
  135. 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,8 @@
1
+ import type { IConfigComponentGroup } from '../../types'
2
+ import { reservoir } from './reservoir'
3
+
4
+ export const animation_group: IConfigComponentGroup = {
5
+ groupType: 'have_animation',
6
+ title: '动画图标',
7
+ list: [reservoir]
8
+ }
@@ -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,8 @@
1
+ import type { IConfigComponentGroup } from '../../types'
2
+ import { circuit_breaker_svg_file } from './circuit-breaker'
3
+
4
+ export const stateful_group: IConfigComponentGroup = {
5
+ groupType: 'stateful',
6
+ title: '状态图标',
7
+ list: [circuit_breaker_svg_file]
8
+ }
@@ -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
+ }