|
@@ -3,6 +3,21 @@
|
|
|
<Button class="full-width-btn" @click="chartDataEditorVisible = true">
|
|
<Button class="full-width-btn" @click="chartDataEditorVisible = true">
|
|
|
<IconEdit class="btn-icon" /> 编辑图表数据
|
|
<IconEdit class="btn-icon" /> 编辑图表数据
|
|
|
</Button>
|
|
</Button>
|
|
|
|
|
+
|
|
|
|
|
+ <div class="row">
|
|
|
|
|
+ <div style="flex: 2;">背景填充:</div>
|
|
|
|
|
+ <Popover trigger="click">
|
|
|
|
|
+ <template #content>
|
|
|
|
|
+ <ColorPicker
|
|
|
|
|
+ :modelValue="fill"
|
|
|
|
|
+ @update:modelValue="value => updateFill(value)"
|
|
|
|
|
+ />
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <ColorButton :color="fill" style="flex: 3;" />
|
|
|
|
|
+ </Popover>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <Divider />
|
|
|
<ElementOutline />
|
|
<ElementOutline />
|
|
|
|
|
|
|
|
<Modal
|
|
<Modal
|
|
@@ -23,7 +38,7 @@
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
<script lang="ts">
|
|
|
-import { computed, defineComponent, Ref, ref } from 'vue'
|
|
|
|
|
|
|
+import { computed, defineComponent, Ref, ref, watch } from 'vue'
|
|
|
import { useStore } from 'vuex'
|
|
import { useStore } from 'vuex'
|
|
|
import { MutationTypes, State } from '@/store'
|
|
import { MutationTypes, State } from '@/store'
|
|
|
import { ChartData, PPTChartElement } from '@/types/slides'
|
|
import { ChartData, PPTChartElement } from '@/types/slides'
|
|
@@ -31,12 +46,14 @@ import useHistorySnapshot from '@/hooks/useHistorySnapshot'
|
|
|
|
|
|
|
|
import ElementOutline from '../common/ElementOutline.vue'
|
|
import ElementOutline from '../common/ElementOutline.vue'
|
|
|
import ChartDataEditor from './ChartDataEditor.vue'
|
|
import ChartDataEditor from './ChartDataEditor.vue'
|
|
|
|
|
+import ColorButton from '../common/ColorButton.vue'
|
|
|
|
|
|
|
|
export default defineComponent({
|
|
export default defineComponent({
|
|
|
name: 'chart-style-panel',
|
|
name: 'chart-style-panel',
|
|
|
components: {
|
|
components: {
|
|
|
ElementOutline,
|
|
ElementOutline,
|
|
|
ChartDataEditor,
|
|
ChartDataEditor,
|
|
|
|
|
+ ColorButton,
|
|
|
},
|
|
},
|
|
|
setup() {
|
|
setup() {
|
|
|
const store = useStore<State>()
|
|
const store = useStore<State>()
|
|
@@ -46,6 +63,13 @@ export default defineComponent({
|
|
|
|
|
|
|
|
const { addHistorySnapshot } = useHistorySnapshot()
|
|
const { addHistorySnapshot } = useHistorySnapshot()
|
|
|
|
|
|
|
|
|
|
+ const fill = ref<string>()
|
|
|
|
|
+
|
|
|
|
|
+ watch(handleElement, () => {
|
|
|
|
|
+ if(!handleElement.value) return
|
|
|
|
|
+ fill.value = handleElement.value.fill || '#000'
|
|
|
|
|
+ }, { deep: true, immediate: true })
|
|
|
|
|
+
|
|
|
const updateData = (data: ChartData) => {
|
|
const updateData = (data: ChartData) => {
|
|
|
chartDataEditorVisible.value = false
|
|
chartDataEditorVisible.value = false
|
|
|
const props = { data }
|
|
const props = { data }
|
|
@@ -53,10 +77,18 @@ export default defineComponent({
|
|
|
addHistorySnapshot()
|
|
addHistorySnapshot()
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ const updateFill = (value: string) => {
|
|
|
|
|
+ const props = { fill: value }
|
|
|
|
|
+ store.commit(MutationTypes.UPDATE_ELEMENT, { id: handleElement.value.id, props })
|
|
|
|
|
+ addHistorySnapshot()
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
return {
|
|
return {
|
|
|
chartDataEditorVisible,
|
|
chartDataEditorVisible,
|
|
|
handleElement,
|
|
handleElement,
|
|
|
updateData,
|
|
updateData,
|
|
|
|
|
+ fill,
|
|
|
|
|
+ updateFill,
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
})
|
|
})
|