feat: 删除部分组件

This commit is contained in:
huanghao1412 2023-12-27 20:03:03 +08:00
parent 97ce1c9ad5
commit eb4a09223c
46 changed files with 353 additions and 209 deletions

2
.env
View File

@ -2,10 +2,8 @@
VITE_DEV_PORT = '8080' VITE_DEV_PORT = '8080'
# development path # development path
# VITE_DEV_PATH = 'https://demo.mtruning.club'
VITE_DEV_PATH = 'http://192.168.0.34:8024' VITE_DEV_PATH = 'http://192.168.0.34:8024'
# VITE_DEV_PATH = 'http://192.168.0.120:3001' # VITE_DEV_PATH = 'http://192.168.0.120:3001'
# production path # production path
# VITE_PRO_PATH = 'https://demo.mtruning.club'
VITE_PRO_PATH = 'http://192.168.0.34:8024' VITE_PRO_PATH = 'http://192.168.0.34:8024'

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

View File

@ -7,7 +7,6 @@ export function getToken() {
let queryStr = window.location.href let queryStr = window.location.href
queryStr = queryStr.split('?')[1] queryStr = queryStr.split('?')[1]
if(queryStr.indexOf('#') > -1) queryStr = queryStr.split('#')[0] if(queryStr.indexOf('#') > -1) queryStr = queryStr.split('#')[0]
console.log(queryStr)
let query:{[key:string]: string} = {} let query:{[key:string]: string} = {}
queryStr.split('&').forEach((item:string) => { queryStr.split('&').forEach((item:string) => {
query[item.split('=')[0]] = item.split('=')[1] query[item.split('=')[0]] = item.split('=')[1]
@ -18,7 +17,6 @@ export function getToken() {
export const publicInterface = async (paramType:string, interfaceType:string, paramData?:unknown) =>{ export const publicInterface = async (paramType:string, interfaceType:string, paramData?:unknown) =>{
try { try {
const access_token = getToken() const access_token = getToken()
console.log(access_token, window)
const res = await http(RequestHttpEnum.POST)<any>(paramType, { const res = await http(RequestHttpEnum.POST)<any>(paramType, {
access_token, access_token,
type: interfaceType, type: interfaceType,

View File

@ -5,7 +5,13 @@ import {httpErrorHandle} from "@/utils";
// * 项目列表 // * 项目列表
export const projectListApi = async (data: object) => { export const projectListApi = async (data: object) => {
return publicInterface('/dcim/system/custom_large_screen', 'get', data) let res:any = await publicInterface('/dcim/system/custom_large_screen', 'get_page', data)
return {
data: res.data.item,
errcode: res.errcode,
count: res.data.page.total
}
// return publicInterface('/dcim/system/custom_large_screen', 'get_page', data)
} }
// * 新增项目 // * 新增项目

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

View File

@ -71,18 +71,27 @@
<!-- 预设滤镜 --> <!-- 预设滤镜 -->
<div v-if="presetImageList.length" class="preset-filter"> <div v-if="presetImageList.length" class="preset-filter">
<n-image <!-- <n-image-->
<!-- class="preset-img"-->
<!-- width="46"-->
<!-- preview-disabled-->
<!-- object-fit="scale-down"-->
<!-- v-for="(item, index) in presetImageList"-->
<!-- :key="index"-->
<!-- :class="{ 'active-preset': item.hueRotate === chartStyles.hueRotate }"-->
<!-- :style="{ filter: `hue-rotate(${item.hueRotate}deg)` }"-->
<!-- :src="item.src"-->
<!-- @click="() => (chartStyles.hueRotate = item.hueRotate)"-->
<!-- ></n-image>-->
<div
class="preset-img" class="preset-img"
width="46" style="width: 46px;height: 38px;background: #3ba4ff;"
preview-disabled
object-fit="scale-down"
v-for="(item, index) in presetImageList" v-for="(item, index) in presetImageList"
:key="index" :key="index"
:class="{ 'active-preset': item.hueRotate === chartStyles.hueRotate }" :class="{ 'active-preset': item.hueRotate === chartStyles.hueRotate }"
:style="{ filter: `hue-rotate(${item.hueRotate}deg)` }" :style="{ filter: `hue-rotate(${item.hueRotate}deg)` }"
:src="item.src"
@click="() => (chartStyles.hueRotate = item.hueRotate)" @click="() => (chartStyles.hueRotate = item.hueRotate)"
></n-image> ></div>
</div> </div>
<!-- 混合模式 --> <!-- 混合模式 -->
@ -169,7 +178,7 @@ import { ref, PropType } from 'vue'
import { PickCreateComponentType, BlendModeEnumList } from '@/packages/index.d' import { PickCreateComponentType, BlendModeEnumList } from '@/packages/index.d'
import { SettingItemBox, SettingItem, CollapseItem } from '@/components/Pages/ChartItemSetting' import { SettingItemBox, SettingItem, CollapseItem } from '@/components/Pages/ChartItemSetting'
import { icon } from '@/plugins' import { icon } from '@/plugins'
import logoImg from '@/assets/logo.png' // import logoImg from '@/assets/logo.png'
import { useDesignStore } from '@/store/modules/designStore/designStore' import { useDesignStore } from '@/store/modules/designStore/designStore'
const props = defineProps({ const props = defineProps({
@ -210,7 +219,7 @@ const presetImageList = ref([] as presetImageData[])
for (let i = 1; i <= 12; i++) { for (let i = 1; i <= 12; i++) {
presetImageList.value.push({ presetImageList.value.push({
index: i, index: i,
src: logoImg, // src: logoImg,
hueRotate: i * 30 hueRotate: i * 30
}) })
} }

View File

@ -12,9 +12,9 @@
<div class="header-item right"> <div class="header-item right">
<n-space> <n-space>
<slot name="ri-left"> </slot> <slot name="ri-left"> </slot>
<go-lang-select></go-lang-select> <!-- <go-lang-select></go-lang-select>-->
<theme-color-select></theme-color-select> <!-- <theme-color-select></theme-color-select>-->
<go-theme-select></go-theme-select> <!-- <go-theme-select></go-theme-select>-->
<slot name="ri-right"> </slot> <slot name="ri-right"> </slot>
</n-space> </n-space>
</div> </div>

View File

@ -1,6 +1,6 @@
import { BarCommonConfig } from './BarCommon/index' import { BarCommonConfig } from './BarCommon/index'
import { BarCrossrangeConfig } from './BarCrossrange/index' import { BarCrossrangeConfig } from './BarCrossrange/index'
import { CapsuleChartConfig } from './CapsuleChart/index' // import { CapsuleChartConfig } from './CapsuleChart/index'
import { BarLineConfig } from './BarLine/index' import { BarLineConfig } from './BarLine/index'
export default [BarCommonConfig, BarCrossrangeConfig, BarLineConfig, CapsuleChartConfig] export default [BarCommonConfig, BarCrossrangeConfig, BarLineConfig]

View File

@ -1,4 +1,4 @@
import { PieCommonConfig } from './PieCommon/index' import { PieCommonConfig } from './PieCommon/index'
import { PieCircleConfig } from './PieCircle/index' // import { PieCircleConfig } from './PieCircle/index'
export default [PieCommonConfig, PieCircleConfig] export default [PieCommonConfig]

View File

@ -1,8 +1,9 @@
import Bars from './Bars' import Bars from './Bars'
import Pies from './Pies' import Pies from './Pies'
import Lines from './Lines' // import Lines from './Lines'
import Scatters from './Scatters' // import Scatters from './Scatters'
import Mores from './Mores' // import Mores from './Mores'
import Maps from './Maps' // import Maps from './Maps'
export const ChartList = [...Bars, ...Lines, ...Pies, ...Scatters, ...Maps, ...Mores] // export const ChartList = [...Bars, ...Lines, ...Pies, ...Scatters, ...Maps, ...Mores]
export const ChartList = [...Bars, ...Pies]

View File

@ -10,5 +10,5 @@ export const DeviceAlarmOverviewConfig: ConfigType = {
categoryName: ChatCategoryEnumName.CUSTOMCOMPONENTS, categoryName: ChatCategoryEnumName.CUSTOMCOMPONENTS,
package: PackagesCategoryEnum.CUSTOMCOMPONENTS, package: PackagesCategoryEnum.CUSTOMCOMPONENTS,
chartFrame: ChartFrameEnum.COMMON, chartFrame: ChartFrameEnum.COMMON,
image: 'photo.png' image: 'DeviceAlarmOverview.png'
} }

View File

@ -10,5 +10,5 @@ export const RealTimeTrafficConfig: ConfigType = {
categoryName: ChatCategoryEnumName.CUSTOMCOMPONENTS, categoryName: ChatCategoryEnumName.CUSTOMCOMPONENTS,
package: PackagesCategoryEnum.CUSTOMCOMPONENTS, package: PackagesCategoryEnum.CUSTOMCOMPONENTS,
chartFrame: ChartFrameEnum.COMMON, chartFrame: ChartFrameEnum.COMMON,
image: 'photo.png' image: 'RealTimeTraffic.png'
} }

View File

@ -251,8 +251,6 @@ const getData = () => {
} else { } else {
option.tooltip.formatter = '{b}<br/>' + '测点总数' + '&nbsp;&nbsp;' + '{c}' option.tooltip.formatter = '{b}<br/>' + '测点总数' + '&nbsp;&nbsp;' + '{c}'
} }
vChartRef.value.forceUpdate()
console.log(option, vChartRef.value)
} }
}).catch((e:unknown) => { }).catch((e:unknown) => {
console.log(e) console.log(e)

View File

@ -0,0 +1,17 @@
import { ConfigType, PackagesCategoryEnum, ChartFrameEnum } from '@/packages/index.d'
import { ChatCategoryEnum,ChatCategoryEnumName } from '@/packages/components/CUSTOMCOMPONENTS/index.d'
export const Theme1Config: ConfigType = {
key: 'Theme1',
chartKey: 'VTheme1',
conKey: 'VCTheme1',
title: '背景1',
// category: ChatCategoryEnum.THEMES,
// categoryName: ChatCategoryEnumName.THEMES,
// package: PackagesCategoryEnum.THEMESANDLAYOUTS,
category: ChatCategoryEnum.CUSTOMCOMPONENTS,
categoryName: ChatCategoryEnumName.CUSTOMCOMPONENTS,
package: PackagesCategoryEnum.CUSTOMCOMPONENTS,
chartFrame: ChartFrameEnum.COMMON,
image: 'theme1.png'
}

View File

@ -1,5 +1,6 @@
import { ComprehensivePUEConfig } from './ComprehensivePUE' import { Theme1Config } from './Theme1/index'
// import { ComprehensivePUEConfig } from './ComprehensivePUE'
import { DeviceAlarmOverviewConfig } from './DeviceAlarmOverview' import { DeviceAlarmOverviewConfig } from './DeviceAlarmOverview'
import { RealTimeTrafficConfig } from './RealTimeTraffic' import { RealTimeTrafficConfig } from './RealTimeTraffic'
export default [ ComprehensivePUEConfig, DeviceAlarmOverviewConfig, RealTimeTrafficConfig ] export default [ Theme1Config, DeviceAlarmOverviewConfig, RealTimeTrafficConfig ]

View File

@ -8,12 +8,12 @@ import { PipelineHConfig } from './PipelineH/index'
import { PipelineVConfig } from './PipelineV/index' import { PipelineVConfig } from './PipelineV/index'
export default [ export default [
NumberConfig, // NumberConfig,
FlipperNumberConfig, // FlipperNumberConfig,
TimeCommonConfig, TimeCommonConfig,
CountDownConfig, // CountDownConfig,
ClockConfig, ClockConfig,
FullScreenConfig, // FullScreenConfig,
PipelineHConfig, // PipelineHConfig,
PipelineVConfig // PipelineVConfig
] ]

View File

@ -1,6 +1,7 @@
import Borders from './Borders' import Borders from './Borders'
import Decorates from './Decorates' import Decorates from './Decorates'
import Three from './Three' // import Three from './Three'
import Mores from './Mores' import Mores from './Mores'
export const DecorateList = [...Borders, ...Decorates, ...Three, ...Mores] // export const DecorateList = [...Borders, ...Decorates, ...Three, ...Mores]
export const DecorateList = [...Borders, ...Decorates, ...Mores]

View File

@ -1,5 +1,6 @@
import Texts from './Texts' import Texts from './Texts'
import Inputs from './Inputs' // import Inputs from './Inputs'
import Mores from './Mores' // import Mores from './Mores'
export const InformationList = [...Texts, ...Inputs, ...Mores] // export const InformationList = [...Texts, ...Inputs, ...Mores]
export const InformationList = [...Texts]

View File

@ -1,14 +0,0 @@
import { ConfigType, PackagesCategoryEnum, ChartFrameEnum } from '@/packages/index.d'
import { ChatCategoryEnum,ChatCategoryEnumName } from '@/packages/components/ThemesAndLayouts/index.d'
export const Theme1Config: ConfigType = {
key: 'Theme1',
chartKey: 'VTheme1',
conKey: 'VCTheme1',
title: '主题1',
category: ChatCategoryEnum.THEMES,
categoryName: ChatCategoryEnumName.THEMES,
package: PackagesCategoryEnum.THEMESANDLAYOUTS,
chartFrame: ChartFrameEnum.COMMON,
image: 'theme1.png'
}

View File

@ -1,3 +1,3 @@
import { Theme1Config } from './Theme1/index' // import { Theme1Config } from './Theme1/index'
export default [Theme1Config] export default []

View File

@ -205,10 +205,10 @@ export enum FetchComFlagType {
export type PackagesType = { export type PackagesType = {
[PackagesCategoryEnum.CHARTS]: ConfigType[] [PackagesCategoryEnum.CHARTS]: ConfigType[]
[PackagesCategoryEnum.INFORMATIONS]: ConfigType[] [PackagesCategoryEnum.INFORMATIONS]: ConfigType[]
[PackagesCategoryEnum.TABLES]: ConfigType[] // [PackagesCategoryEnum.TABLES]: ConfigType[]
[PackagesCategoryEnum.PHOTOS]: ConfigType[] // [PackagesCategoryEnum.PHOTOS]: ConfigType[]
[PackagesCategoryEnum.ICONS]: ConfigType[] [PackagesCategoryEnum.ICONS]: ConfigType[]
[PackagesCategoryEnum.DECORATES]: ConfigType[] [PackagesCategoryEnum.DECORATES]: ConfigType[]
[PackagesCategoryEnum.THEMESANDLAYOUTS]: ConfigType[] // [PackagesCategoryEnum.THEMESANDLAYOUTS]: ConfigType[]
[PackagesCategoryEnum.CUSTOMCOMPONENTS]: ConfigType[] [PackagesCategoryEnum.CUSTOMCOMPONENTS]: ConfigType[]
} }

View File

@ -1,10 +1,10 @@
import { ChartList } from '@/packages/components/Charts/index' import { ChartList } from '@/packages/components/Charts/index'
import { DecorateList } from '@/packages/components/Decorates/index' import { DecorateList } from '@/packages/components/Decorates/index'
import { InformationList } from '@/packages/components/Informations/index' import { InformationList } from '@/packages/components/Informations/index'
import { TableList } from '@/packages/components/Tables/index' // import { TableList } from '@/packages/components/Tables/index'
import { PhotoList } from '@/packages/components/Photos/index' // import { PhotoList } from '@/packages/components/Photos/index'
import { IconList } from '@/packages/components/Icons/index' import { IconList } from '@/packages/components/Icons/index'
import { ThemesAndLayoutsList } from '@/packages/components/ThemesAndLayouts/index' // import { ThemesAndLayoutsList } from '@/packages/components/ThemesAndLayouts/index'
import { CustomComponentsList } from '@/packages/components/CustomComponents/index' import { CustomComponentsList } from '@/packages/components/CustomComponents/index'
import { PackagesCategoryEnum, PackagesType, ConfigType, FetchComFlagType } from '@/packages/index.d' import { PackagesCategoryEnum, PackagesType, ConfigType, FetchComFlagType } from '@/packages/index.d'
@ -22,11 +22,11 @@ const imagesModules: Record<string, { default: string }> = import.meta.glob('../
export let packagesList: PackagesType = { export let packagesList: PackagesType = {
[PackagesCategoryEnum.CHARTS]: ChartList, [PackagesCategoryEnum.CHARTS]: ChartList,
[PackagesCategoryEnum.INFORMATIONS]: InformationList, [PackagesCategoryEnum.INFORMATIONS]: InformationList,
[PackagesCategoryEnum.TABLES]: TableList, // [PackagesCategoryEnum.TABLES]: TableList,
[PackagesCategoryEnum.DECORATES]: DecorateList, [PackagesCategoryEnum.DECORATES]: DecorateList,
[PackagesCategoryEnum.PHOTOS]: PhotoList, // [PackagesCategoryEnum.PHOTOS]: PhotoList,
[PackagesCategoryEnum.ICONS]: IconList, [PackagesCategoryEnum.ICONS]: IconList,
[PackagesCategoryEnum.THEMESANDLAYOUTS]: ThemesAndLayoutsList, // [PackagesCategoryEnum.THEMESANDLAYOUTS]: ThemesAndLayoutsList,
[PackagesCategoryEnum.CUSTOMCOMPONENTS]: CustomComponentsList, [PackagesCategoryEnum.CUSTOMCOMPONENTS]: CustomComponentsList,
} }

View File

@ -1,2 +1,2 @@
// 请求前缀 // 请求前缀
export const axiosPre = '/api/goview' export const axiosPre = '/'

View File

@ -312,10 +312,8 @@ export const JSONParse = (data: string) => {
} }
// 还原函数值 // 还原函数值
if (typeof v === 'string' && v.indexOf && (v.indexOf('function') > -1 || v.indexOf('=>') > -1)) { if (typeof v === 'string' && v.indexOf && (v.indexOf('function') > -1 || v.indexOf('=>') > -1)) {
console.log(k, v)
return evalFn(`(function(){return ${v}})()`) return evalFn(`(function(){return ${v}})()`)
} else if (typeof v === 'string' && v.indexOf && v.indexOf('return ') > -1) { } else if (typeof v === 'string' && v.indexOf && v.indexOf('return ') > -1) {
console.log(k, v)
const baseLeftIndex = v.indexOf('(') const baseLeftIndex = v.indexOf('(')
if (baseLeftIndex > -1) { if (baseLeftIndex > -1) {
const newFn = `function ${v.substring(baseLeftIndex)}` const newFn = `function ${v.substring(baseLeftIndex)}`

View File

@ -99,29 +99,29 @@
</n-space> </n-space>
<!-- 滤镜 --> <!-- 滤镜 -->
<styles-setting :isCanvas="true" :chartStyles="canvasConfig"></styles-setting> <!-- <styles-setting :isCanvas="true" :chartStyles="canvasConfig"></styles-setting>-->
<n-divider style="margin: 10px 0"></n-divider> <!-- <n-divider style="margin: 10px 0"></n-divider>-->
<!-- 主题选择和全局配置 --> <!-- 主题选择和全局配置 -->
<n-tabs class="tabs-box" size="small" type="segment"> <!-- <n-tabs class="tabs-box" size="small" type="segment">-->
<n-tab-pane <!-- <n-tab-pane-->
v-for="item in globalTabList" <!-- v-for="item in globalTabList"-->
:key="item.key" <!-- :key="item.key"-->
:name="item.key" <!-- :name="item.key"-->
size="small" <!-- size="small"-->
display-directive="show:lazy" <!-- display-directive="show:lazy"-->
> <!-- >-->
<template #tab> <!-- <template #tab>-->
<n-space> <!-- <n-space>-->
<span>{{ item.title }}</span> <!-- <span>{{ item.title }}</span>-->
<n-icon size="16" class="icon-position"> <!-- <n-icon size="16" class="icon-position">-->
<component :is="item.icon"></component> <!-- <component :is="item.icon"></component>-->
</n-icon> <!-- </n-icon>-->
</n-space> <!-- </n-space>-->
</template> <!-- </template>-->
<component :is="item.render"></component> <!-- <component :is="item.render"></component>-->
</n-tab-pane> <!-- </n-tab-pane>-->
</n-tabs> <!-- </n-tabs>-->
</div> </div>
</template> </template>
@ -270,6 +270,7 @@ const clearColor = () => {
// //
const customRequest = (options: UploadCustomRequestOptions) => { const customRequest = (options: UploadCustomRequestOptions) => {
const { file } = options const { file } = options
console.log(file)
nextTick(async () => { nextTick(async () => {
if (file.file) { if (file.file) {
// //
@ -281,10 +282,10 @@ const customRequest = (options: UploadCustomRequestOptions) => {
const uploadRes = await uploadFile(uploadParams) const uploadRes = await uploadFile(uploadParams)
if (uploadRes && uploadRes.errcode === '00000') { if (uploadRes && uploadRes.errcode === '00000') {
if (uploadRes.data.fileurl) { if (uploadRes.data[0]) {
chartEditStore.setEditCanvasConfig( chartEditStore.setEditCanvasConfig(
EditCanvasConfigEnum.BACKGROUND_IMAGE, EditCanvasConfigEnum.BACKGROUND_IMAGE,
`${uploadRes.data.fileurl}?time=${new Date().getTime()}` `${uploadRes.data[0]}?time=${new Date().getTime()}`
) )
} else { } else {
chartEditStore.setEditCanvasConfig( chartEditStore.setEditCanvasConfig(

View File

@ -1,23 +1,75 @@
<template> <template>
<!-- 事件配置 --> <!-- 事件配置 -->
<n-collapse class="go-mt-3" arrow-placement="right" :default-expanded-names="['1', '2']"> <n-collapse v-if="isReady" class="go-mt-3" arrow-placement="right" :default-expanded-names="['1', '2']">
<n-text depth="3"> <n-text depth="3">
组件 id 组件 id
<n-text>{{ targetData.id }}</n-text> <n-text>{{ targetData.id }}</n-text>
</n-text> </n-text>
<chart-event-interaction></chart-event-interaction> <!-- <chart-event-interaction></chart-event-interaction>-->
<chart-event-base-handle></chart-event-base-handle> <!-- <chart-event-base-handle></chart-event-base-handle>-->
<chart-event-advanced-handle></chart-event-advanced-handle> <!-- <chart-event-advanced-handle></chart-event-advanced-handle>-->
<div style="display: flex;align-items:center;margin-top: 10px">
<div style="margin-right: 10px;width: 60px;">链接</div>
<n-input-group>
<n-select
v-model:value="targetData.customEvent.click.linkHead"
size="small"
:style="{ width: '80%' }"
:options="linkHeadOptions"
/>
<n-input v-model:value="targetData.customEvent.click.link" size="small"></n-input>
<n-button :disabled="!targetData.customEvent.click.link" secondary size="small" @click="handleClick">跳转</n-button>
</n-input-group>
</div>
</n-collapse> </n-collapse>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { ref } from 'vue' import {ref, reactive, computed, watch, watchEffect, Ref} from 'vue'
import { ChartEventInteraction } from './components/ChartEventInteraction' import { ChartEventInteraction } from './components/ChartEventInteraction'
import { ChartEventAdvancedHandle } from './components/ChartEventAdvancedHandle' import { ChartEventAdvancedHandle } from './components/ChartEventAdvancedHandle'
import { ChartEventBaseHandle } from './components/ChartEventBaseHandle' import { ChartEventBaseHandle } from './components/ChartEventBaseHandle'
import { useTargetData } from '../hooks/useTargetData.hook' import { useTargetData } from '../hooks/useTargetData.hook'
const { targetData } = useTargetData() // const { targetData, chartEditStore } = useTargetData()
const showModal = ref(false) // const showModal = ref(false)
const { chartEditStore } = useTargetData()
const targetIndex = computed(() => chartEditStore.fetchTargetIndex())
const list = computed(() => chartEditStore.getComponentList)
let targetData:any = ref(list.value[targetIndex.value])
const isReady = ref(false)
const init = () => {
if(!targetData.value.customEvent) {
targetData.value.customEvent = {
click: {
linkHead: 'http://',
link: '',
}
}
}
}
init()
watch(() => targetIndex.value, newIndex => {
isReady.value = false
targetData.value = list.value[newIndex]
init()
setTimeout(() => {
isReady.value = true
})
})
watch(() => list.value.length, () => {
targetData.value = list.value[targetIndex.value]
init()
})
const linkHeadOptions = ['http://', 'https://'].map(_ => ({label: _, value: _}))
const finallyLink = computed(() => {
return targetData.value.customEvent.click.linkHead + (targetData.value as any).customEvent.click.link
})
const handleClick = () => {
window.open(finallyLink.value)
}
</script> </script>

View File

@ -7,7 +7,7 @@
<!-- 位置 --> <!-- 位置 -->
<position-setting :chartAttr="targetData.attr" :canvasConfig="chartEditStore.getEditCanvasConfig" /> <position-setting :chartAttr="targetData.attr" :canvasConfig="chartEditStore.getEditCanvasConfig" />
<!-- 滤镜 --> <!-- 滤镜 -->
<styles-setting :isGroup="targetData.isGroup" :chartStyles="targetData.styles"></styles-setting> <!-- <styles-setting :isGroup="targetData.isGroup" :chartStyles="targetData.styles"></styles-setting>-->
<!-- 自定义配置项 --> <!-- 自定义配置项 -->
<component :is="targetData.chartConfig.conKey" :optionData="targetData.option"></component> <component :is="targetData.chartConfig.conKey" :optionData="targetData.option"></component>
</div> </div>

View File

@ -134,12 +134,12 @@ const chartsDefaultTabList = [
icon: ConstructIcon, icon: ConstructIcon,
render: ChartSetting render: ChartSetting
}, },
{ // {
key: TabsEnum.CHART_ANIMATION, // key: TabsEnum.CHART_ANIMATION,
title: '动画', // title: '',
icon: LeafIcon, // icon: LeafIcon,
render: ChartAnimation // render: ChartAnimation
} // }
] ]
const chartsTabList = [ const chartsTabList = [

View File

@ -171,13 +171,13 @@ const btnList = [
icon: renderIcon(BrowsersOutlineIcon), icon: renderIcon(BrowsersOutlineIcon),
event: previewHandle event: previewHandle
}, },
{ // {
key: 'release', // key: 'release',
title: () => (release.value ? '已发布' : '发布'), // title: () => (release.value ? '' : ''),
icon: renderIcon(SendIcon), // icon: renderIcon(SendIcon),
type: () => (release.value ? 'primary' : 'default'), // type: () => (release.value ? 'primary' : 'default'),
event: modelShowHandle // event: modelShowHandle
} // }
] ]
const comBtnList = computed(() => { const comBtnList = computed(() => {

View File

@ -250,8 +250,7 @@ export const useSync = () => {
chartEditStore.componentList = [] chartEditStore.componentList = []
chartEditStore.setEditCanvas(EditCanvasTypeEnum.SAVE_STATUS, SyncEnum.START) chartEditStore.setEditCanvas(EditCanvasTypeEnum.SAVE_STATUS, SyncEnum.START)
try { try {
const res = await fetchProjectApi({ projectId: fetchRouteParamsLocation() }) const res = await fetchProjectApi({ id: Number(fetchRouteParamsLocation()) })
console.log(res)
if (res) { if (res) {
// type dataType = { // type dataType = {
// id: string // id: string
@ -263,6 +262,9 @@ export const useSync = () => {
// } // }
if (res.data) { if (res.data) {
updateStoreInfo(res.data as any) updateStoreInfo(res.data as any)
for(let k in res.data){
res.data[k] = res.data[k] ? res.data[k] : null
}
// 更新全局数据 // 更新全局数据
await updateComponent(JSONParse((res.data as any).content)) await updateComponent(JSONParse((res.data as any).content))
return return
@ -276,9 +278,8 @@ export const useSync = () => {
} }
chartEditStore.setEditCanvas(EditCanvasTypeEnum.SAVE_STATUS, SyncEnum.FAILURE) chartEditStore.setEditCanvas(EditCanvasTypeEnum.SAVE_STATUS, SyncEnum.FAILURE)
} catch (error) { } catch (error) {
console.log(error)
chartEditStore.setEditCanvas(EditCanvasTypeEnum.SAVE_STATUS, SyncEnum.FAILURE) chartEditStore.setEditCanvas(EditCanvasTypeEnum.SAVE_STATUS, SyncEnum.FAILURE)
httpErrorHandle() // httpErrorHandle()
} }
} }

View File

@ -30,12 +30,13 @@
:chartConfig="item" :chartConfig="item"
:themeSetting="themeSetting" :themeSetting="themeSetting"
:themeColor="themeColor" :themeColor="themeColor"
:style="{ :style="{
...getSizeStyle(item.attr), ...getSizeStyle(item.attr),
...getFilterStyle(item.styles) ...getFilterStyle(item.styles)
}" }"
v-on="useLifeHandler(item)" v-on="bindEvent(item)"
></component> ></component>
<!-- v-on="useLifeHandler(item)"-->
</div> </div>
</template> </template>
@ -50,6 +51,7 @@ import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore
import { animationsClass, getFilterStyle, getTransformStyle, getBlendModeStyle, colorCustomMerge } from '@/utils' import { animationsClass, getFilterStyle, getTransformStyle, getBlendModeStyle, colorCustomMerge } from '@/utils'
import { getSizeStyle, getComponentAttrStyle, getStatusStyle, getPreviewConfigStyle } from '../../utils' import { getSizeStyle, getComponentAttrStyle, getStatusStyle, getPreviewConfigStyle } from '../../utils'
import { useLifeHandler } from '@/hooks' import { useLifeHandler } from '@/hooks'
import { useCustomEvent } from '../../hooks/useCustomEvent.hook'
// //
const { initDataPond, clearMittDataPondMap } = useChartDataPondFetch() const { initDataPond, clearMittDataPondMap } = useChartDataPondFetch()
@ -79,6 +81,8 @@ clearMittDataPondMap()
onMounted(() => { onMounted(() => {
initDataPond(useChartEditStore) initDataPond(useChartEditStore)
}) })
const { bindEvent } = useCustomEvent()
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>

View File

@ -0,0 +1,22 @@
const bindEvent = (item:any) => {
console.log(item)
let obj = {}
if(item?.customEvent?.click) {
let {linkHead, link} = item.customEvent.click
console.log(linkHead, link)
obj = {
click: () => {
console.log(1234, linkHead,link)
if(link) window.open(`${linkHead}${link}`)
}
}
}
console.log(obj)
return obj
}
export const useCustomEvent = () => {
return {
bindEvent
}
}

View File

@ -13,13 +13,13 @@ export interface ChartEditStorageType extends ChartEditStorage {
// 根据路由 id 获取存储数据的信息 // 根据路由 id 获取存储数据的信息
export const getSessionStorageInfo = async () => { export const getSessionStorageInfo = async () => {
const id = fetchRouteParamsLocation() const id = Number(fetchRouteParamsLocation())
const storageList: ChartEditStorageType[] = getSessionStorage(StorageEnum.GO_CHART_STORAGE_LIST) const storageList: ChartEditStorageType[] = getSessionStorage(StorageEnum.GO_CHART_STORAGE_LIST)
// 是否本地预览 // 是否本地预览
if (!storageList || storageList.findIndex(e => e.id === id.toString()) === -1) { if (!storageList || storageList.findIndex(e => e.id === id.toString()) === -1) {
// 接口调用 // 接口调用
const res = await fetchProjectApi({ projectId: id }) const res = await fetchProjectApi({ id })
if (res) { if (res) {
const { content, state } = res.data const { content, state } = res.data
// if (state === -1) { // if (state === -1) {

View File

@ -5,7 +5,7 @@
<project-layout-sider></project-layout-sider> <project-layout-sider></project-layout-sider>
</n-space> </n-space>
<n-layout> <n-layout>
<layout-header-pro></layout-header-pro> <!-- <layout-header-pro></layout-header-pro>-->
<n-layout <n-layout
id="go-project-content-top" id="go-project-content-top"
class="content-top" class="content-top"
@ -42,7 +42,8 @@ import { LayoutTransitionMain } from '@/layout/components/LayoutTransitionMain/i
<style lang="scss" scoped> <style lang="scss" scoped>
@include go(project) { @include go(project) {
.content-top { .content-top {
top: $--header-height; //top: $--header-height;
top: 0;
margin-top: 1px; margin-top: 1px;
} }
} }

View File

@ -31,18 +31,18 @@
<!-- 工具 --> <!-- 工具 -->
<div class="go-flex-items-center list-footer-ri"> <div class="go-flex-items-center list-footer-ri">
<n-space> <n-space>
<n-text> <!-- <n-text>-->
<n-badge <!-- <n-badge-->
class="go-animation-twinkle" <!-- class="go-animation-twinkle"-->
dot <!-- dot-->
:color="cardData.release ? '#34c749' : '#fcbc40'" <!-- :color="cardData.release ? '#34c749' : '#fcbc40'"-->
></n-badge> <!-- ></n-badge>-->
{{ <!-- {{-->
cardData.release <!-- cardData.release-->
? $t('project.release') <!-- ? $t('project.release')-->
: $t('project.unreleased') <!-- : $t('project.unreleased')-->
}} <!-- }}-->
</n-text> <!-- </n-text>-->
<template v-for="item in fnBtnList" :key="item.key"> <template v-for="item in fnBtnList" :key="item.key">
<template v-if="item.key === 'select'"> <template v-if="item.key === 'select'">
@ -124,13 +124,13 @@ const selectOptions = ref([
key: 'preview', key: 'preview',
icon: renderIcon(BrowsersOutlineIcon) icon: renderIcon(BrowsersOutlineIcon)
}, },
{ // {
label: props.cardData?.release // label: props.cardData?.release
? renderLang('global.r_unpublish') // ? renderLang('global.r_unpublish')
: renderLang('global.r_publish'), // : renderLang('global.r_publish'),
key: 'release', // key: 'release',
icon: renderIcon(SendIcon) // icon: renderIcon(SendIcon)
}, // },
{ {
label: renderLang('global.r_delete'), label: renderLang('global.r_delete'),
key: 'delete', key: 'delete',

View File

@ -24,8 +24,10 @@ export const useDataListInit = () => {
const fetchList = async () => { const fetchList = async () => {
loading.value = true loading.value = true
const res = await projectListApi({ const res = await projectListApi({
page: paginat.page, page: {
limit: paginat.limit page_number: paginat.page,
page_size: paginat.limit
}
}) })
if (res && res.data) { if (res && res.data) {
const { count } = res as any // 这里的count与data平级不在Response结构中 const { count } = res as any // 这里的count与data平级不在Response结构中

View File

@ -39,18 +39,18 @@
</n-text> </n-text>
<!-- 工具 --> <!-- 工具 -->
<n-space> <n-space>
<n-text> <!-- <n-text>-->
<n-badge <!-- <n-badge-->
class="go-animation-twinkle" <!-- class="go-animation-twinkle"-->
dot <!-- dot-->
:color="cardData?.release ? '#34c749' : '#fcbc40'" <!-- :color="cardData?.release ? '#34c749' : '#fcbc40'"-->
></n-badge> <!-- ></n-badge>-->
{{ <!-- {{-->
cardData?.release <!-- cardData?.release-->
? $t('project.release') <!-- ? $t('project.release')-->
: $t('project.unreleased') <!-- : $t('project.unreleased')-->
}} <!-- }}-->
</n-text> <!-- </n-text>-->
<template v-for="item in fnBtnList" :key="item.key"> <template v-for="item in fnBtnList" :key="item.key">
<n-tooltip placement="bottom" trigger="hover"> <n-tooltip placement="bottom" trigger="hover">

View File

@ -64,12 +64,12 @@ const typeList = shallowRef([
icon: ObjectStorageIcon, icon: ObjectStorageIcon,
disabled: true disabled: true
}, },
{ // {
title: renderLang('project.template_market'), // title: renderLang('project.template_market'),
key: PageEnum.BASE_HOME_TEMPLATE_MARKET_NAME, // key: PageEnum.BASE_HOME_TEMPLATE_MARKET_NAME,
icon: StoreIcon, // icon: StoreIcon,
disabled: true // disabled: true
} // }
]) ])
watch(() => props.show, newValue => { watch(() => props.show, newValue => {

View File

@ -1,5 +1,5 @@
<template> <template>
<div @click="clickHandle"> <div @click="handleClick">
<n-tooltip v-if="collapsed" placement="right" trigger="hover"> <n-tooltip v-if="collapsed" placement="right" trigger="hover">
<template #trigger> <template #trigger>
<n-button ghost type="primary" size="small"> <n-button ghost type="primary" size="small">
@ -34,6 +34,9 @@ import { ref } from 'vue'
import { useDesignStore } from '@/store/modules/designStore/designStore' import { useDesignStore } from '@/store/modules/designStore/designStore'
import { CreateModal } from './components/CreateModal/index' import { CreateModal } from './components/CreateModal/index'
import { icon } from '@/plugins' import { icon } from '@/plugins'
import {createProjectApi} from "@/api/path";
import {fetchPathByName, getUUID, routerTurnByPath} from "@/utils";
import {ChartEnum} from "@/enums/pageEnum";
const { DuplicateIcon, DuplicateOutlineIcon } = icon.ionicons5 const { DuplicateIcon, DuplicateOutlineIcon } = icon.ionicons5
const designStore = useDesignStore() const designStore = useDesignStore()
@ -51,4 +54,28 @@ const clickHandle = () => {
const closeHandle = () => { const closeHandle = () => {
modalShow.value = false modalShow.value = false
} }
const handleClick = async () => {
try {
//
const res = await createProjectApi({
//
projectName: getUUID(),
// remarks
remarks: null,
//
indexImage: null,
})
if(res && res.data) {
window['$message'].success(window['$t']('project.create_success'))
const { id } = res.data
const path = fetchPathByName(ChartEnum.CHART_HOME_NAME, 'href')
routerTurnByPath(path, [id], undefined, true, true)
closeHandle()
}
} catch (error) {
window['$message'].error(window['$t']('project.create_failure'))
}
}
</script> </script>

View File

@ -25,9 +25,9 @@
></n-menu> ></n-menu>
</aside> </aside>
<!-- 底部提示 --> <!-- 底部提示 -->
<div class="sider-bottom"> <!-- <div class="sider-bottom">-->
<project-layout-aside-footer :collapsed="collapsed"></project-layout-aside-footer> <!-- <project-layout-aside-footer :collapsed="collapsed"></project-layout-aside-footer>-->
</div> <!-- </div>-->
</div> </div>
</n-layout-sider> </n-layout-sider>
</template> </template>

View File

@ -45,42 +45,42 @@ export const menuOptionsInit = () => {
key: PageEnum.BASE_HOME_ITEMS_NAME, key: PageEnum.BASE_HOME_ITEMS_NAME,
icon: renderIcon(TvOutlineIcon), icon: renderIcon(TvOutlineIcon),
}, },
{ // {
label: () => // label: () =>
h( // h(
RouterLink, // RouterLink,
{ // {
to: { // to: {
name: PageEnum.BASE_HOME_TEMPLATE_NAME, // name: PageEnum.BASE_HOME_TEMPLATE_NAME,
}, // },
}, // },
{ default: () => t('project.my_templete') } // { default: () => t('project.my_templete') }
), // ),
key: PageEnum.BASE_HOME_TEMPLATE_NAME, // key: PageEnum.BASE_HOME_TEMPLATE_NAME,
icon: renderIcon(ObjectStorageIcon), // icon: renderIcon(ObjectStorageIcon),
}, // },
], ],
}, },
], ],
}, },
{ // {
key: 'divider-2', // key: 'divider-2',
type: 'divider', // type: 'divider',
}, // },
{ // {
label: () => // label: () =>
h( // h(
RouterLink, // RouterLink,
{ // {
to: { // to: {
name: PageEnum.BASE_HOME_TEMPLATE_MARKET_NAME, // name: PageEnum.BASE_HOME_TEMPLATE_MARKET_NAME,
}, // },
}, // },
{ default: () => t('project.template_market') } // { default: () => t('project.template_market') }
), // ),
key: PageEnum.BASE_HOME_TEMPLATE_MARKET_NAME, // key: PageEnum.BASE_HOME_TEMPLATE_MARKET_NAME,
icon: renderIcon(StoreIcon), // icon: renderIcon(StoreIcon),
}, // },
]) ])
} }

View File

@ -46,27 +46,47 @@ export default ({ mode }) => defineConfig({
open: true, open: true,
port: 3000, port: 3000,
proxy: { proxy: {
// 生产list页缩略图 开发时注释掉
'/svgConfig/customLargeScreen/data/file': {
// @ts-ignore
target: loadEnv(mode, process.cwd()).VITE_DEV_PATH,
changeOrigin: true,
rewrite: (path) => path.replace(new RegExp(`^/svgConfig/customLargeScreen`), ''),
ws: true,
secure: true,
},
// 生产打开 开发时注释掉
[axiosPre]: { [axiosPre]: {
// @ts-ignore // @ts-ignore
target: loadEnv(mode, process.cwd()).VITE_DEV_PATH, target: loadEnv(mode, process.cwd()).VITE_DEV_PATH,
changeOrigin: true, changeOrigin: true,
// rewrite: (path) => path.replace(new RegExp(`^${axiosPre}`), ''), // rewrite: (path) => path.replace(new RegExp(`^${axiosPre}`), ''),
rewrite: () => '', // rewrite: () => '',
ws: true, ws: true,
secure: true, secure: true,
}, },
'/data/file': { // 开发
// @ts-ignore // '/dcim': {
target: loadEnv(mode, process.cwd()).VITE_DEV_PATH,
changeOrigin: true,
ws: true,
secure: true,
},
// '/svgConfig': {
// // @ts-ignore // // @ts-ignore
// target: loadEnv(mode, process.cwd()).VITE_DEV_PATH, // target: loadEnv(mode, process.cwd()).VITE_DEV_PATH,
// changeOrigin: true, // changeOrigin: true,
// rewrite: () => '', // ws: true,
// secure: true,
// },
// // 开发首页缩略图
// '/data/file': {
// // @ts-ignore
// target: loadEnv(mode, process.cwd()).VITE_DEV_PATH,
// changeOrigin: true,
// ws: true,
// secure: true,
// },
// // 开发 图片
// '/svgConfig/customLargeScreen': {
// // @ts-ignore
// target: loadEnv(mode, process.cwd()).VITE_DEV_PATH,
// changeOrigin: true,
// // rewrite: (path) => path.replace(new RegExp(`^/svgConfig/customLargeScreen`), ''),
// ws: true, // ws: true,
// secure: true, // secure: true,
// }, // },