Commit 2a0a78d4 authored by zhengke's avatar zhengke

no message

parent c34d7f19
......@@ -65,7 +65,7 @@ const getErrorCode2text = (response: AxiosResponse): string => {
* service.get<{data: string; code: number}>('/test').then(({data}) => { console.log(data.code) })
*/
const service = Axios.create({
baseURL: 'http://192.168.10.160/api/common/post',
baseURL: 'http://192.168.10.214/api/common/post',//'http://192.168.10.160/api/common/post',
timeout: 20000,
headers: {
'User-Type': 'bus',
......
......@@ -8,7 +8,7 @@ export interface ScreenState {
export const useScreenStore = defineStore('screen', {
state: (): ScreenState => ({
screening: false, // 是否进入放映状态
market: true
market: false
}),
actions: {
......
......@@ -6,7 +6,8 @@ export type RadioGroupValue = {
value: Ref<string>
updateValue: (value: string) => void
}
export type SlideDataSource = Ref<object>
export const injectKeySlideScale: InjectionKey<SlideScale> = Symbol()
export const injectKeySlideId: InjectionKey<SlideId> = Symbol()
export const injectKeyRadioGroupValue: InjectionKey<RadioGroupValue> = Symbol()
export const injectKeyDataSource: InjectionKey<SlideDataSource> = Symbol()
\ No newline at end of file
<template>
<div v-if="datas.DataSource.DataSourceOverlay">
<div class="DataaSourceOverlay" @click="OffDataSource"></div>
<div class="DataaSource">
<el-table
:data="datas.DataSource.DataSourceList"
style="width: 100%">
<el-table-column
fixed
prop="date"
label="基础数据"
width="300">
<template #default="scope">
<div class="DataaSourceL">
<div v-if="scope.row.type=='text'">
{{scope.row.FiledTypeStr}}
</div>
<div v-if="scope.row.type=='image'">
<el-image
style="width: 20px; height: 20px"
:src="scope.row.FiledTypeStr"
:preview-src-list="[scope.row.FiledTypeStr]">
</el-image>
</div>
</div>
</template>
</el-table-column>
<el-table-column
prop=""
label="数据源">
<template #default="scope">
<div class="DataaSourceR">
<div v-if="scope.row.type=='text'">
{{scope.row.content}}
</div>
<div v-else>
<el-image
style="width: 50px; height: 50px"
:src="scope.row.FiledTypeStr"
:preview-src-list="[scope.row.FiledTypeStr]">
</el-image>
</div>
</div>
</template>
</el-table-column>
</el-table>
</div>
</div>
</template>
<script lang="ts" setup>
import { computed, nextTick, ref, watch, reactive, inject } from 'vue'
import { storeToRefs } from 'pinia'
import { useSlidesStore } from '@/store'
import { injectKeyDataSource } from '@/types/injectKey'
const datas = reactive({
DataSource:{}
})
datas.DataSource = inject(injectKeyDataSource)
watch(datas.DataSource, (n, o) => {
})
const OffDataSource = () =>{
datas.DataSource.DataSourceOverlay = !datas.DataSource.DataSourceOverlay
}
</script>
<style lang="scss" scoped>
.DataaSourceOverlay{
position: fixed;
left: 160px;
top: 80px;
right: 260px;
bottom: 0;
z-index: 1;
background: rgba(23,23,23,0.5);
cursor: pointer;
}
.DataaSource{
position: fixed;
left: 200px;
top: 120px;
right: 300px;
bottom: 30px;
z-index: 2;
padding: 40px;
border-radius: 10px;
background: #fff;
overflow: auto;
}
.DataaSourceL{
font-weight: bold;
color: black;
font-size: 15px;
}
</style>
\ No newline at end of file
......@@ -100,6 +100,10 @@
<Button style="flex: 1;" @click="applyBackgroundAllSlide()">应用背景到全部</Button>
</div>
<div class="row">
<Button style="flex: 1;" @click="AllDataSource()">数据源</Button>
</div>
<Divider />
<div class="row">
......@@ -290,7 +294,7 @@
</template>
<script lang="ts" setup>
import { computed, ref } from 'vue'
import { computed, ref, reactive,inject } from 'vue'
import { storeToRefs } from 'pinia'
import { useMainStore, useSlidesStore } from '@/store'
import type { SlideBackground, SlideTheme } from '@/types/slides'
......@@ -299,6 +303,7 @@ import { WEB_FONTS } from '@/configs/font'
import useHistorySnapshot from '@/hooks/useHistorySnapshot'
import useSlideTheme from '@/hooks/useSlideTheme'
import { getImageDataURL } from '@/utils/image'
import { injectKeyDataSource } from '@/types/injectKey'
import ColorButton from './common/ColorButton.vue'
import FileInput from '@/components/FileInput.vue'
......@@ -310,9 +315,15 @@ import Select from '@/components/Select.vue'
import Popover from '@/components/Popover.vue'
import NumberInput from '@/components/NumberInput.vue'
const datas = reactive({
DataSource:{
DataSourceOverlay: false
}
})
const slidesStore = useSlidesStore()
const { availableFonts } = storeToRefs(useMainStore())
const { slides, currentSlide, viewportRatio, theme } = storeToRefs(slidesStore)
const { slides, currentSlide, viewportRatio, theme, slideIndex } = storeToRefs(slidesStore)
const moreThemeConfigsVisible = ref(false)
......@@ -333,6 +344,44 @@ const {
applyThemeToAllSlides,
} = useSlideTheme()
//提取字符串中的文字
const getHtmlPlainText = (html_str) => {
let re = new RegExp('<[^<>]+>', 'g')
if (html_str) {
let text = html_str.replace(re, '')
return text
} else {
return ''
}
}
datas.DataSource = inject(injectKeyDataSource)
// 所有数据源
const AllDataSource = () => {
datas.DataSource.DataSourceOverlay = !datas.DataSource.DataSourceOverlay
console.log(slideIndex.value,'-------')
const newElements = slides.value.find((slide,index) => {
return slideIndex.value==index
})
datas.DataSource.DataSourceList = []
newElements.elements.forEach(slide=>{
if(slide.type=="text"){
let Obj = {
...slide,
FiledTypeStr: getHtmlPlainText(slide.content)
}
datas.DataSource.DataSourceList.push(Obj)
}
if(slide.type=="image"){
let Obj = {
...slide,
FiledTypeStr: slide.src
}
datas.DataSource.DataSourceList.push(Obj)
}
})
console.log(datas.DataSource.DataSourceList,'-------1111')
}
// 设置背景模式:纯色、图片、渐变色
const updateBackgroundType = (type: 'solid' | 'image' | 'gradient') => {
if (type === 'solid') {
......@@ -390,6 +439,7 @@ const applyBackgroundAllSlide = () => {
addHistorySnapshot()
}
// 设置主题
const updateTheme = (themeProps: Partial<SlideTheme>) => {
slidesStore.setTheme(themeProps)
......
......@@ -11,6 +11,7 @@
v-model:height="remarkHeight"
:style="{ height: `${remarkHeight}px` }"
/>
<DataaSource/>
</div>
<Toolbar class="layout-content-right" />
</div>
......@@ -29,11 +30,12 @@
</template>
<script lang="ts" setup>
import { ref } from 'vue'
import { ref,reactive,provide } from 'vue'
import { storeToRefs } from 'pinia'
import { useMainStore } from '@/store'
import useGlobalHotkey from '@/hooks/useGlobalHotkey'
import usePasteEvent from '@/hooks/usePasteEvent'
import { injectKeyDataSource } from '@/types/injectKey'
import EditorHeader from './EditorHeader/index.vue'
import Canvas from './Canvas/index.vue'
......@@ -45,7 +47,14 @@ import ExportDialog from './ExportDialog/index.vue'
import SelectPanel from './SelectPanel.vue'
import SearchPanel from './SearchPanel.vue'
import Modal from '@/components/Modal.vue'
import DataaSource from './DataaSource/index.vue'
const datas = reactive({
DataSource:{
DataSourceOverlay: false,
DataSourceList:[]
},
})
const mainStore = useMainStore()
const { dialogForExport, showSelectPanel, showSearchPanel } = storeToRefs(mainStore)
const closeExportDialog = () => mainStore.setDialogForExport('')
......@@ -54,6 +63,7 @@ const remarkHeight = ref(40)
useGlobalHotkey()
usePasteEvent()
provide(injectKeyDataSource,datas)
</script>
<style lang="scss" scoped>
......
......@@ -29,7 +29,7 @@ import BaseVideoElement from '@/views/components/element/VideoElement/BaseVideoE
import BaseAudioElement from '@/views/components/element/AudioElement/BaseAudioElement.vue'
const props = defineProps<{
elementInfo: PPTElement
elementInfo: PPTElement,
elementIndex: number
}>()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment