@zhangqingcq/vgce 0.0.27 → 0.0.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/style.css +2 -2
- package/dist/vgce.js +9271 -8810
- package/dist/vgce.umd.cjs +206 -98
- package/package.json +7 -7
- package/src/assets/svgs/alert-light.svg +39 -0
- package/src/assets/svgs/bot-9.svg +94 -0
- package/src/assets/svgs/common-table.svg +1 -7
- package/src/assets/svgs/el-button.svg +1 -10
- package/src/assets/svgs/hamburger.svg +1 -0
- package/src/assets/svgs/hotpot.svg +1 -0
- package/src/assets/svgs/now-time.svg +1 -9
- package/src/assets/svgs/pie-charts.svg +1 -10
- package/src/assets/svgs/progress-a.svg +1 -1
- package/src/assets/svgs/svg-text.svg +1 -1
- package/src/assets/svgs/switch-on.svg +12 -0
- package/src/assets/svgs/switch-r.svg +14 -0
- package/src/assets/svgs/thermometer.svg +22 -0
- package/src/assets/svgs/thermometer2.svg +16 -0
- package/src/components/config/index.ts +11 -0
- package/src/components/svg-editor/{center-panel/index.vue → center-panel.vue} +14 -8
- package/src/components/svg-editor/{handle-panel/index.vue → handle-panel.vue} +10 -0
- package/src/components/svg-editor/index.vue +8 -7
- package/src/components/svg-editor/{left-panel/index.vue → left-panel.vue} +2 -2
- package/src/components/svg-editor/right-panel/code-edit-modal.vue +2 -2
- package/src/components/svg-editor/right-panel/common-animate.vue +1 -1
- package/src/components/svg-editor/right-panel/dynamic-el-form-item.vue +22 -0
- package/src/components/svg-editor/right-panel/list.vue +1 -1
- package/src/components/svg-editor/{right-panel/index.vue → right-panel.vue} +47 -31
- package/src/components/svg-editor/{top-panel/index.vue → top-panel.vue} +11 -3
- package/src/components/{svg-viewer/index.vue → svg-viewer.vue} +8 -6
- package/src/config/files/common-table.vue +48 -48
- package/src/config/files/now-time.vue +71 -52
- package/src/config/files/pie-charts.vue +72 -71
- package/src/config/files/svg-text.vue +17 -37
- package/src/config/files/switch-r.vue +72 -0
- package/src/config/index.ts +2 -2
- package/src/config/svg/animation/index.ts +2 -2
- package/src/config/svg/{stateless/alternator.ts → animation/thermometer.ts} +4 -11
- package/src/config/svg/custom/index.ts +2 -2
- package/src/config/svg/custom/svg-text.ts +25 -1
- package/src/config/svg/custom/{switch-a.ts → switch-r.ts} +4 -4
- package/src/config/svg/stateful/alert-light.ts +33 -0
- package/src/config/svg/stateful/index.ts +2 -2
- package/src/config/svg/stateless/{house.ts → bot-9.ts} +3 -3
- package/src/config/svg/stateless/{sheet-border.ts → hamburger.ts} +3 -3
- package/src/config/svg/{stateful/circuit-breaker.ts → stateless/hotpot.ts} +4 -20
- package/src/config/svg/stateless/index.ts +4 -4
- package/src/config/types.ts +2 -9
- package/src/config/vue/component/button.ts +1 -1
- package/src/config/vue/component/common-table.ts +7 -7
- package/src/config/vue/component/now-time.ts +36 -2
- package/src/config/vue/component/progress.ts +2 -2
- package/src/index.ts +12 -12
- package/src/utils/index.ts +36 -37
- package/src/views/Preview.vue +1 -1
- package/src/assets/svgs/alternator.svg +0 -8
- package/src/assets/svgs/circuit-breaker.svg +0 -11
- package/src/assets/svgs/house.svg +0 -1
- package/src/assets/svgs/package.svg +0 -1
- package/src/assets/svgs/reservoir.svg +0 -10
- package/src/assets/svgs/sheet-border.svg +0 -1
- package/src/assets/svgs/switch-a.svg +0 -5
- package/src/components/svg-editor/center-panel/types.ts +0 -11
- package/src/config/files/switch-a.vue +0 -43
- package/src/config/svg/animation/reservoir.ts +0 -32
- /package/src/components/{ace-edit/index.ts → ace-edit.ts} +0 -0
- /package/src/components/{svg-analysis/index.vue → svg-analysis.vue} +0 -0
- /package/src/components/svg-editor/{component-tree/index.vue → component-tree.vue} +0 -0
- /package/src/components/svg-editor/{connection-line/index.vue → connection-line.vue} +0 -0
- /package/src/components/svg-editor/{connection-panel/index.vue → connection-panel.vue} +0 -0
- /package/src/components/svg-editor/{export-json/index.vue → export-json.vue} +0 -0
- /package/src/components/svg-editor/{import-json/index.vue → import-json.vue} +0 -0
- /package/src/components/{vue3-ruler-tool/index.vue → vue3-ruler-tool.vue} +0 -0
@@ -1,52 +1,71 @@
|
|
1
|
-
<script setup lang="ts">
|
2
|
-
const props = defineProps
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
const
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
const
|
18
|
-
|
19
|
-
|
20
|
-
const
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
const
|
27
|
-
const
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
1
|
+
<script setup lang="ts">
|
2
|
+
const props = defineProps<{
|
3
|
+
width: number
|
4
|
+
fontFamily: string
|
5
|
+
color: string
|
6
|
+
fontSize: number
|
7
|
+
bold: boolean
|
8
|
+
}>()
|
9
|
+
|
10
|
+
const styles = computed(() => ({
|
11
|
+
fontFamily: props.fontFamily,
|
12
|
+
color: props.color,
|
13
|
+
fontSize: props.fontSize + 'px',
|
14
|
+
fontWeight: props.bold ? 'bold' : 'normal'
|
15
|
+
}))
|
16
|
+
|
17
|
+
const now_date = ref(new Date())
|
18
|
+
const timer = ref()
|
19
|
+
const date = computed(() => {
|
20
|
+
const year = now_date.value.getFullYear()
|
21
|
+
const month = now_date.value.getMonth() + 1
|
22
|
+
const day = now_date.value.getDate()
|
23
|
+
return year.toString() + '年' + month.toString() + '月' + day.toString() + '日'
|
24
|
+
})
|
25
|
+
const week = computed(() => {
|
26
|
+
const d = now_date.value.getDay()
|
27
|
+
const weekday = ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六']
|
28
|
+
return weekday[d]
|
29
|
+
})
|
30
|
+
const time = computed(() => {
|
31
|
+
const hour = now_date.value.getHours()
|
32
|
+
const minute = now_date.value.getMinutes()
|
33
|
+
const second = now_date.value.getSeconds()
|
34
|
+
return (
|
35
|
+
(hour < 10 ? '0' + hour.toString() : hour.toString()) +
|
36
|
+
':' +
|
37
|
+
(minute < 10 ? '0' + minute.toString() : minute.toString()) +
|
38
|
+
':' +
|
39
|
+
(second < 10 ? '0' + second.toString() : second.toString())
|
40
|
+
)
|
41
|
+
})
|
42
|
+
|
43
|
+
onMounted(() => {
|
44
|
+
timer.value = setInterval(() => {
|
45
|
+
now_date.value = new Date() // 修改数据date
|
46
|
+
}, 500)
|
47
|
+
})
|
48
|
+
onUnmounted(() => {
|
49
|
+
clearInterval(timer.value)
|
50
|
+
})
|
51
|
+
</script>
|
52
|
+
<template>
|
53
|
+
<div class="now-time" :style="{ width: props.width + 'px' }">
|
54
|
+
<div :style="styles">{{ date }}</div>
|
55
|
+
<div class="flex mt-5px">
|
56
|
+
<div :style="styles">{{ week }}</div>
|
57
|
+
<div :style="styles">{{ time }}</div>
|
58
|
+
</div>
|
59
|
+
</div>
|
60
|
+
</template>
|
61
|
+
<style lang="less" scoped>
|
62
|
+
.now-time {
|
63
|
+
min-height: 40px;
|
64
|
+
min-width: 100px;
|
65
|
+
color: #c54e6a;
|
66
|
+
|
67
|
+
.flex {
|
68
|
+
justify-content: space-between;
|
69
|
+
}
|
70
|
+
}
|
71
|
+
</style>
|
@@ -1,71 +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
|
-
use([SVGRenderer, PieChart, TitleComponent, TooltipComponent, LegendComponent])
|
8
|
-
|
9
|
-
provide(THEME_KEY, 'dark')
|
10
|
-
|
11
|
-
const props = defineProps({
|
12
|
-
title: {
|
13
|
-
type: String,
|
14
|
-
default: '标题'
|
15
|
-
},
|
16
|
-
seriesName: {
|
17
|
-
type: String,
|
18
|
-
default: '详情'
|
19
|
-
},
|
20
|
-
seriesData: {
|
21
|
-
type: Array,
|
22
|
-
default: () => []
|
23
|
-
}
|
24
|
-
})
|
25
|
-
|
26
|
-
const option = reactive({
|
27
|
-
title: {
|
28
|
-
text: props.title,
|
29
|
-
left: 'center'
|
30
|
-
},
|
31
|
-
tooltip: {
|
32
|
-
trigger: 'item',
|
33
|
-
formatter: '{a} <br/>{b} : {c} ({d}%)'
|
34
|
-
},
|
35
|
-
legend: {
|
36
|
-
orient: 'vertical',
|
37
|
-
left: 'left'
|
38
|
-
},
|
39
|
-
series: [
|
40
|
-
{
|
41
|
-
name: props.seriesName,
|
42
|
-
type: 'pie',
|
43
|
-
radius: '55%',
|
44
|
-
center: ['50%', '60%'],
|
45
|
-
data: props.seriesData,
|
46
|
-
emphasis: {
|
47
|
-
itemStyle: {
|
48
|
-
shadowBlur: 10,
|
49
|
-
shadowOffsetX: 0,
|
50
|
-
shadowColor: 'rgba(0, 0, 0, 0.5)'
|
51
|
-
}
|
52
|
-
}
|
53
|
-
}
|
54
|
-
]
|
55
|
-
})
|
56
|
-
watch(props, (new_val) => {
|
57
|
-
option.title.text = new_val.title
|
58
|
-
option.series[0].name = new_val.seriesName
|
59
|
-
option.series[0].data = new_val.seriesData
|
60
|
-
})
|
61
|
-
</script>
|
62
|
-
|
63
|
-
<template>
|
64
|
-
<v-chart class="chart" :option="option" autoresize />
|
65
|
-
</template>
|
66
|
-
|
67
|
-
<style scoped>
|
68
|
-
.chart {
|
69
|
-
height:
|
70
|
-
|
71
|
-
|
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
|
+
use([SVGRenderer, PieChart, TitleComponent, TooltipComponent, LegendComponent])
|
8
|
+
|
9
|
+
provide(THEME_KEY, 'dark')
|
10
|
+
|
11
|
+
const props = defineProps({
|
12
|
+
title: {
|
13
|
+
type: String,
|
14
|
+
default: '标题'
|
15
|
+
},
|
16
|
+
seriesName: {
|
17
|
+
type: String,
|
18
|
+
default: '详情'
|
19
|
+
},
|
20
|
+
seriesData: {
|
21
|
+
type: Array,
|
22
|
+
default: () => []
|
23
|
+
}
|
24
|
+
})
|
25
|
+
|
26
|
+
const option = reactive({
|
27
|
+
title: {
|
28
|
+
text: props.title,
|
29
|
+
left: 'center'
|
30
|
+
},
|
31
|
+
tooltip: {
|
32
|
+
trigger: 'item',
|
33
|
+
formatter: '{a} <br/>{b} : {c} ({d}%)'
|
34
|
+
},
|
35
|
+
legend: {
|
36
|
+
orient: 'vertical',
|
37
|
+
left: 'left'
|
38
|
+
},
|
39
|
+
series: [
|
40
|
+
{
|
41
|
+
name: props.seriesName,
|
42
|
+
type: 'pie',
|
43
|
+
radius: '55%',
|
44
|
+
center: ['50%', '60%'],
|
45
|
+
data: props.seriesData,
|
46
|
+
emphasis: {
|
47
|
+
itemStyle: {
|
48
|
+
shadowBlur: 10,
|
49
|
+
shadowOffsetX: 0,
|
50
|
+
shadowColor: 'rgba(0, 0, 0, 0.5)'
|
51
|
+
}
|
52
|
+
}
|
53
|
+
}
|
54
|
+
]
|
55
|
+
})
|
56
|
+
watch(props, (new_val) => {
|
57
|
+
option.title.text = new_val.title
|
58
|
+
option.series[0].name = new_val.seriesName
|
59
|
+
option.series[0].data = new_val.seriesData
|
60
|
+
})
|
61
|
+
</script>
|
62
|
+
|
63
|
+
<template>
|
64
|
+
<v-chart class="chart" :option="option" autoresize />
|
65
|
+
</template>
|
66
|
+
|
67
|
+
<style scoped>
|
68
|
+
.chart {
|
69
|
+
min-height: 300px;
|
70
|
+
min-width: 400px;
|
71
|
+
}
|
72
|
+
</style>
|
@@ -1,37 +1,17 @@
|
|
1
|
-
<script setup lang="ts">
|
2
|
-
// 文字的内容决定了长度 所以没办法预先定义中心点 导致连线有偏移
|
3
|
-
|
4
|
-
|
5
|
-
const props = defineProps(
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
fill: {
|
19
|
-
type: String,
|
20
|
-
default: ''
|
21
|
-
}
|
22
|
-
})
|
23
|
-
|
24
|
-
watch(
|
25
|
-
() => [props.text, props.fontSize, props.fontFamily],
|
26
|
-
() => {
|
27
|
-
nextTick(function () {
|
28
|
-
emit('resize')
|
29
|
-
})
|
30
|
-
}
|
31
|
-
)
|
32
|
-
</script>
|
33
|
-
<template>
|
34
|
-
<text x="50" y="55" :font-family="props.fontFamily" :font-size="props.fontSize" :fill="props.fill"
|
35
|
-
>{{ props.text }}
|
36
|
-
</text>
|
37
|
-
</template>
|
1
|
+
<script setup lang="ts">
|
2
|
+
// 文字的内容决定了长度 所以没办法预先定义中心点 导致连线有偏移
|
3
|
+
|
4
|
+
const emit = defineEmits(['resize'])
|
5
|
+
const props = defineProps<{ text?: string; bold: boolean }>()
|
6
|
+
watch(
|
7
|
+
() => props.text,
|
8
|
+
() => {
|
9
|
+
nextTick(function () {
|
10
|
+
emit('resize')
|
11
|
+
})
|
12
|
+
}
|
13
|
+
)
|
14
|
+
</script>
|
15
|
+
<template>
|
16
|
+
<text x="50" y="55" :style="{ 'font-weight': props.bold ? 'bold' : 'normal' }">{{ props.text }}</text>
|
17
|
+
</template>
|
@@ -0,0 +1,72 @@
|
|
1
|
+
<script setup lang="ts">
|
2
|
+
const props = defineProps({
|
3
|
+
id: {
|
4
|
+
type: String,
|
5
|
+
default: ''
|
6
|
+
},
|
7
|
+
isOpen: {
|
8
|
+
type: Boolean,
|
9
|
+
default: true
|
10
|
+
}
|
11
|
+
})
|
12
|
+
const emit = defineEmits(['onChange'])
|
13
|
+
watch(
|
14
|
+
() => props.isOpen,
|
15
|
+
() => {
|
16
|
+
emit('onChange')
|
17
|
+
}
|
18
|
+
)
|
19
|
+
</script>
|
20
|
+
<template>
|
21
|
+
<g :id="props.id">
|
22
|
+
<symbol viewBox="0 0 1027 1024" :id="`${props.id}switch-demo-open`">
|
23
|
+
<path
|
24
|
+
d="M747.52 238.933333 H276.48 C122.88 238.933333 0 361.813333 0 512 s122.88 273.066667 276.48 273.066667 H750.933333 c150.186667 0 276.48-122.88 276.48-273.066667 s-126.293333-273.066667-279.893333-273.066667z"
|
25
|
+
fill="white"
|
26
|
+
fill-opacity=".01"
|
27
|
+
p-id="1537"
|
28
|
+
data-spm-anchor-id="a313x.manage_type_myprojects.0.i0.1adc3a81uCnBP5"
|
29
|
+
/>
|
30
|
+
<path
|
31
|
+
d="M747.52 238.933333 H276.48 C122.88 238.933333 0 361.813333 0 512 s122.88 273.066667 276.48 273.066667 H750.933333 c150.186667 0 276.48-122.88 276.48-273.066667 s-126.293333-273.066667-279.893333-273.066667z m0 512 H276.48 C143.36 750.933333 34.133333 645.12 34.133333 512s109.226667-238.933333 242.346667-238.933333 H750.933333c133.12 0 242.346667 105.813333 242.346667 238.933333s-112.64 238.933333-245.76 238.933333z"
|
32
|
+
fill="#2c2c2c"
|
33
|
+
p-id="1531"
|
34
|
+
data-spm-anchor-id="a313x.manage_type_myprojects.0.i0.1adc3a81uCnBP5"
|
35
|
+
/>
|
36
|
+
<path
|
37
|
+
d="M238.933333 409.6c-37.546667 0-68.266667 27.306667-68.266666 61.44v85.333333c0 34.133333 30.72 61.44 68.266666 61.44s68.266667-27.306667 68.266667-61.44v-85.333333c0-34.133333-30.72-61.44-68.266667-61.44z m34.133334 146.773333c0 13.653333-17.066667 23.893333-34.133334 23.893334s-34.133333-10.24-34.133333-27.306667v-85.333333c0-13.653333 17.066667-23.893333 34.133333-23.893334s34.133333 10.24 34.133334 27.306667v85.333333zM460.8 409.6c-10.24 0-17.066667 6.826667-17.066667 17.066667v109.226666l-71.68-119.466666c-3.413333-6.826667-10.24-10.24-20.48-6.826667-6.826667 3.413333-13.653333 10.24-13.653333 17.066667v170.666666c0 10.24 6.826667 17.066667 17.066667 17.066667s17.066667-6.826667 17.066666-17.066667v-109.226666l71.68 119.466666c3.413333 6.826667 10.24 6.826667 13.653334 6.826667h3.413333c6.826667-3.413333 13.653333-10.24 13.653333-17.066667v-170.666666c3.413333-10.24-3.413333-17.066667-13.653333-17.066667zM750.933333 341.333333c-95.573333 0-170.666667 75.093333-170.666666 170.666667s75.093333 170.666667 170.666666 170.666667 170.666667-75.093333 170.666667-170.666667-75.093333-170.666667-170.666667-170.666667z"
|
38
|
+
fill="#5ad562"
|
39
|
+
p-id="1530"
|
40
|
+
data-spm-anchor-id="a313x.manage_type_myprojects.0.i1.1adc3a81uCnBP5"
|
41
|
+
/>
|
42
|
+
</symbol>
|
43
|
+
<symbol viewBox="0 0 1027 1024" :id="`${props.id}switch-demo-close`">
|
44
|
+
<path
|
45
|
+
d="M747.52 238.933333 H276.48 C122.88 238.933333 0 361.813333 0 512 s122.88 273.066667 276.48 273.066667 H750.933333 c150.186667 0 276.48-122.88 276.48-273.066667 s-126.293333-273.066667-279.893333-273.066667z"
|
46
|
+
fill="white"
|
47
|
+
fill-opacity=".01"
|
48
|
+
p-id="1536"
|
49
|
+
data-spm-anchor-id="a313x.manage_type_myprojects.0.i0.1adc3a81uCnBP5"
|
50
|
+
/>
|
51
|
+
<path
|
52
|
+
d="M747.52 238.933333 H276.48 C122.88 238.933333 0 361.813333 0 512 s122.88 273.066667 276.48 273.066667 H750.933333 c150.186667 0 276.48-122.88 276.48-273.066667 s-126.293333-273.066667-279.893333-273.066667z m0 512 H276.48 C143.36 750.933333 34.133333 645.12 34.133333 512s109.226667-238.933333 242.346667-238.933333 H750.933333c133.12 0 242.346667 105.813333 242.346667 238.933333s-112.64 238.933333-245.76 238.933333z"
|
53
|
+
fill="#2c2c2c"
|
54
|
+
p-id="1535"
|
55
|
+
data-spm-anchor-id="a313x.manage_type_myprojects.0.i0.1adc3a81uCnBP5"
|
56
|
+
/>
|
57
|
+
<path
|
58
|
+
d="M273.066667 341.333333c-95.573333 0-170.666667 75.093333-170.666667 170.666667s75.093333 170.666667 170.666667 170.666667 170.666667-75.093333 170.666666-170.666667-75.093333-170.666667-170.666666-170.666667z"
|
59
|
+
fill="#bfbfbf"
|
60
|
+
p-id="1534"
|
61
|
+
data-spm-anchor-id="a313x.manage_type_myprojects.0.i0.1adc3a81KYNNkt"
|
62
|
+
/>
|
63
|
+
<path
|
64
|
+
d="M580.266667 409.6c-37.546667 0-68.266667 27.306667-68.266667 61.44v85.333333c0 34.133333 30.72 61.44 68.266667 61.44s68.266667-27.306667 68.266666-61.44v-85.333333c0-34.133333-30.72-61.44-68.266666-61.44z m34.133333 146.773333c0 13.653333-17.066667 27.306667-34.133333 27.306667s-34.133333-10.24-34.133334-27.306667v-85.333333c0-13.653333 17.066667-27.306667 34.133334-27.306667s34.133333 10.24 34.133333 27.306667v85.333333zM904.533333 409.6h-68.266666c-10.24 0-17.066667 6.826667-17.066667 17.066667v170.666666c0 10.24 6.826667 17.066667 17.066667 17.066667s17.066667-6.826667 17.066666-17.066667V512h17.066667c10.24 0 17.066667-6.826667 17.066667-17.066667s-6.826667-17.066667-17.066667-17.066666H853.333333v-34.133334h51.2c10.24 0 17.066667-6.826667 17.066667-17.066666s-6.826667-17.066667-17.066667-17.066667zM768 409.6h-68.266667c-10.24 0-17.066667 6.826667-17.066666 17.066667v170.666666c0 10.24 6.826667 17.066667 17.066666 17.066667s17.066667-6.826667 17.066667-17.066667V512h17.066667c10.24 0 17.066667-6.826667 17.066666-17.066667s-6.826667-17.066667-17.066666-17.066666H716.8v-34.133334h51.2c10.24 0 17.066667-6.826667 17.066667-17.066666s-6.826667-17.066667-17.066667-17.066667z"
|
65
|
+
fill="#707070"
|
66
|
+
p-id="1533"
|
67
|
+
data-spm-anchor-id="a313x.manage_type_myprojects.0.i2.1adc3a81KYNNkt"
|
68
|
+
/>
|
69
|
+
</symbol>
|
70
|
+
<use :xlink:href="`#${props.id}switch-demo-${props.isOpen ? 'open' : 'close'}`" width="100" height="100" />
|
71
|
+
</g>
|
72
|
+
</template>
|
package/src/config/index.ts
CHANGED
@@ -4,7 +4,7 @@ import { vue_config } from './vue'
|
|
4
4
|
|
5
5
|
import { ElButton, ElTag } from 'element-plus'
|
6
6
|
import Progress from '@/config/files/progress.vue'
|
7
|
-
import
|
7
|
+
import SwitchR from '@/config/files/switch-r.vue'
|
8
8
|
import SvgText from '@/config/files/svg-text.vue'
|
9
9
|
import CommonTable from '@/config/files/common-table.vue'
|
10
10
|
import NowTime from '@/config/files/now-time.vue'
|
@@ -19,7 +19,7 @@ export const vueComp: Record<string, any> = {
|
|
19
19
|
'el-tag': ElTag,
|
20
20
|
'common-table': CommonTable,
|
21
21
|
'pie-charts': PieCharts,
|
22
|
-
'switch-
|
22
|
+
'switch-r': SwitchR,
|
23
23
|
'now-time': NowTime,
|
24
24
|
'light-a': LightA,
|
25
25
|
'clock-a': ClockA
|
@@ -1,8 +1,8 @@
|
|
1
1
|
import type { IConfigComponentGroup } from '../../types'
|
2
|
-
import {
|
2
|
+
import { thermometer } from './thermometer'
|
3
3
|
|
4
4
|
export const animation_group: IConfigComponentGroup = {
|
5
5
|
groupType: 'have_animation',
|
6
6
|
title: '动画SVG',
|
7
|
-
list: [
|
7
|
+
list: [thermometer]
|
8
8
|
}
|
@@ -1,9 +1,8 @@
|
|
1
1
|
import { EConfigItemPropsType, EDoneJsonType } from '@/config/types'
|
2
2
|
import type { IConfigItem } from '@/config/types'
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
title: '发电机',
|
3
|
+
export const thermometer: IConfigItem = {
|
4
|
+
name: 'thermometer',
|
5
|
+
title: '温度计',
|
7
6
|
type: EDoneJsonType.File,
|
8
7
|
config: {
|
9
8
|
can_zoom: true,
|
@@ -11,13 +10,7 @@ export const alternator_svg_file: IConfigItem = {
|
|
11
10
|
actual_rect: true
|
12
11
|
},
|
13
12
|
display: true,
|
14
|
-
props: {
|
15
|
-
fill: {
|
16
|
-
title: '填充色',
|
17
|
-
type: EConfigItemPropsType.Color,
|
18
|
-
val: '#00ff00'
|
19
|
-
}
|
20
|
-
},
|
13
|
+
props: {},
|
21
14
|
common_animations: {
|
22
15
|
val: '',
|
23
16
|
delay: 'delay-0s',
|
@@ -1,11 +1,11 @@
|
|
1
1
|
import type { IConfigComponentGroup } from '../../types'
|
2
2
|
import { svg_text } from './svg-text'
|
3
|
-
import {
|
3
|
+
import { switch_r } from './switch-r'
|
4
4
|
import { light_a } from '@/config/svg/custom/light'
|
5
5
|
import { clock_a } from '@/config/svg/custom/clock-a'
|
6
6
|
|
7
7
|
export const custom_svg_group: IConfigComponentGroup = {
|
8
8
|
groupType: 'custom_svg_group',
|
9
9
|
title: 'SVG组件',
|
10
|
-
list: [svg_text,
|
10
|
+
list: [svg_text, switch_r, light_a, clock_a]
|
11
11
|
}
|
@@ -30,18 +30,42 @@ export const svg_text: IConfigItem = {
|
|
30
30
|
{
|
31
31
|
value: 'NSimSun',
|
32
32
|
label: '新宋体'
|
33
|
+
},
|
34
|
+
{
|
35
|
+
value: 'KaiTi',
|
36
|
+
label: '楷体'
|
33
37
|
}
|
34
38
|
]
|
35
39
|
},
|
36
40
|
fontSize: {
|
37
41
|
title: '文字大小',
|
38
42
|
type: EConfigItemPropsType.InputNumber,
|
39
|
-
val:
|
43
|
+
val: 18
|
40
44
|
},
|
41
45
|
fill: {
|
42
46
|
title: '文字颜色',
|
43
47
|
type: EConfigItemPropsType.Color,
|
44
48
|
val: '#000'
|
49
|
+
},
|
50
|
+
bold: {
|
51
|
+
title: '文字加粗',
|
52
|
+
type: EConfigItemPropsType.Switch,
|
53
|
+
val: false
|
54
|
+
},
|
55
|
+
writingMode: {
|
56
|
+
title: '文字朝向',
|
57
|
+
type: EConfigItemPropsType.Select,
|
58
|
+
val: 'horizontal-tb',
|
59
|
+
options: [
|
60
|
+
{
|
61
|
+
value: 'horizontal-tb',
|
62
|
+
label: '水平'
|
63
|
+
},
|
64
|
+
{
|
65
|
+
value: 'vertical-rl',
|
66
|
+
label: '垂直'
|
67
|
+
}
|
68
|
+
]
|
45
69
|
}
|
46
70
|
},
|
47
71
|
common_animations: {
|
@@ -1,10 +1,10 @@
|
|
1
1
|
import { EConfigItemPropsType, EDoneJsonType } from '@/config/types'
|
2
2
|
import type { IConfigItem } from '@/config/types'
|
3
3
|
|
4
|
-
export const
|
5
|
-
name: 'switch-
|
4
|
+
export const switch_r: IConfigItem = {
|
5
|
+
name: 'switch-r',
|
6
6
|
title: '开关',
|
7
|
-
tag: 'switch-
|
7
|
+
tag: 'switch-r',
|
8
8
|
type: EDoneJsonType.CustomSvg,
|
9
9
|
display: true,
|
10
10
|
config: {
|
@@ -16,7 +16,7 @@ export const switch_a: IConfigItem = {
|
|
16
16
|
isOpen: {
|
17
17
|
title: '开关',
|
18
18
|
type: EConfigItemPropsType.Switch,
|
19
|
-
val:
|
19
|
+
val: false
|
20
20
|
}
|
21
21
|
},
|
22
22
|
common_animations: {
|
@@ -0,0 +1,33 @@
|
|
1
|
+
import { EDoneJsonType } from '@/config/types'
|
2
|
+
import type { IConfigItem } from '@/config/types'
|
3
|
+
|
4
|
+
export const svg_alert_light: IConfigItem = {
|
5
|
+
name: 'alert-light',
|
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
|
+
defaultState: 'yellow',
|
16
|
+
state: {
|
17
|
+
green: {
|
18
|
+
label: '正常',
|
19
|
+
fill: '#00ff00',
|
20
|
+
fillOpacity: '1'
|
21
|
+
},
|
22
|
+
yellow: { label: '请注意', fill: '#ffff00', fillOpacity: '1' },
|
23
|
+
red: { label: '报警', fill: '#ff0000', fillOpacity: '1' },
|
24
|
+
white: { label: '关闭', fill: '#ffffff', fillOpacity: '0' }
|
25
|
+
},
|
26
|
+
common_animations: {
|
27
|
+
val: '',
|
28
|
+
delay: 'delay-0s',
|
29
|
+
speed: 'slow',
|
30
|
+
repeat: 'infinite'
|
31
|
+
},
|
32
|
+
events: []
|
33
|
+
}
|
@@ -1,8 +1,8 @@
|
|
1
1
|
import type { IConfigComponentGroup } from '../../types'
|
2
|
-
import {
|
2
|
+
import { svg_alert_light } from './alert-light'
|
3
3
|
|
4
4
|
export const stateful_group: IConfigComponentGroup = {
|
5
5
|
groupType: 'stateful',
|
6
6
|
title: '状态SVG',
|
7
|
-
list: [
|
7
|
+
list: [svg_alert_light]
|
8
8
|
}
|
@@ -1,9 +1,9 @@
|
|
1
1
|
import { EDoneJsonType } from '@/config/types'
|
2
2
|
import type { IConfigItem } from '@/config/types'
|
3
3
|
|
4
|
-
export const
|
5
|
-
name: '
|
6
|
-
title: '
|
4
|
+
export const svg_bot_9: IConfigItem = {
|
5
|
+
name: 'bot-9',
|
6
|
+
title: '9号机',
|
7
7
|
type: EDoneJsonType.File,
|
8
8
|
display: true,
|
9
9
|
config: {
|
@@ -1,9 +1,9 @@
|
|
1
1
|
import { EDoneJsonType } from '@/config/types'
|
2
2
|
import type { IConfigItem } from '@/config/types'
|
3
3
|
|
4
|
-
export const
|
5
|
-
name: '
|
6
|
-
title: '
|
4
|
+
export const svg_hamburger: IConfigItem = {
|
5
|
+
name: 'hamburger',
|
6
|
+
title: '汉堡',
|
7
7
|
type: EDoneJsonType.File,
|
8
8
|
display: true,
|
9
9
|
config: {
|
@@ -1,33 +1,17 @@
|
|
1
1
|
import { EDoneJsonType } from '@/config/types'
|
2
2
|
import type { IConfigItem } from '@/config/types'
|
3
3
|
|
4
|
-
export const
|
5
|
-
name: '
|
6
|
-
title: '
|
4
|
+
export const svg_hotpot: IConfigItem = {
|
5
|
+
name: 'hotpot',
|
6
|
+
title: '火锅',
|
7
7
|
type: EDoneJsonType.File,
|
8
|
+
display: true,
|
8
9
|
config: {
|
9
10
|
can_zoom: true,
|
10
11
|
have_anchor: true,
|
11
12
|
actual_rect: true
|
12
13
|
},
|
13
|
-
display: true,
|
14
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
15
|
common_animations: {
|
32
16
|
val: '',
|
33
17
|
delay: 'delay-0s',
|