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'
# 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.120:3001'
# production path
# VITE_PRO_PATH = 'https://demo.mtruning.club'
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
queryStr = queryStr.split('?')[1]
if(queryStr.indexOf('#') > -1) queryStr = queryStr.split('#')[0]
console.log(queryStr)
let query:{[key:string]: string} = {}
queryStr.split('&').forEach((item:string) => {
query[item.split('=')[0]] = item.split('=')[1]
@ -18,7 +17,6 @@ export function getToken() {
export const publicInterface = async (paramType:string, interfaceType:string, paramData?:unknown) =>{
try {
const access_token = getToken()
console.log(access_token, window)
const res = await http(RequestHttpEnum.POST)<any>(paramType, {
access_token,
type: interfaceType,

View File

@ -5,7 +5,13 @@ import {httpErrorHandle} from "@/utils";
// * 项目列表
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">
<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"
width="46"
preview-disabled
object-fit="scale-down"
style="width: 46px;height: 38px;background: #3ba4ff;"
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>
</div>
<!-- 混合模式 -->
@ -169,7 +178,7 @@ import { ref, PropType } from 'vue'
import { PickCreateComponentType, BlendModeEnumList } from '@/packages/index.d'
import { SettingItemBox, SettingItem, CollapseItem } from '@/components/Pages/ChartItemSetting'
import { icon } from '@/plugins'
import logoImg from '@/assets/logo.png'
// import logoImg from '@/assets/logo.png'
import { useDesignStore } from '@/store/modules/designStore/designStore'
const props = defineProps({
@ -210,7 +219,7 @@ const presetImageList = ref([] as presetImageData[])
for (let i = 1; i <= 12; i++) {
presetImageList.value.push({
index: i,
src: logoImg,
// src: logoImg,
hueRotate: i * 30
})
}

View File

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

View File

@ -1,6 +1,6 @@
import { BarCommonConfig } from './BarCommon/index'
import { BarCrossrangeConfig } from './BarCrossrange/index'
import { CapsuleChartConfig } from './CapsuleChart/index'
// import { CapsuleChartConfig } from './CapsuleChart/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 { 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 Pies from './Pies'
import Lines from './Lines'
import Scatters from './Scatters'
import Mores from './Mores'
import Maps from './Maps'
// import Lines from './Lines'
// import Scatters from './Scatters'
// import Mores from './Mores'
// 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,
package: PackagesCategoryEnum.CUSTOMCOMPONENTS,
chartFrame: ChartFrameEnum.COMMON,
image: 'photo.png'
image: 'DeviceAlarmOverview.png'
}

View File

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

View File

@ -251,8 +251,6 @@ const getData = () => {
} else {
option.tooltip.formatter = '{b}<br/>' + '测点总数' + '&nbsp;&nbsp;' + '{c}'
}
vChartRef.value.forceUpdate()
console.log(option, vChartRef.value)
}
}).catch((e:unknown) => {
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 { 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'
export default [
NumberConfig,
FlipperNumberConfig,
// NumberConfig,
// FlipperNumberConfig,
TimeCommonConfig,
CountDownConfig,
// CountDownConfig,
ClockConfig,
FullScreenConfig,
PipelineHConfig,
PipelineVConfig
// FullScreenConfig,
// PipelineHConfig,
// PipelineVConfig
]

View File

@ -1,6 +1,7 @@
import Borders from './Borders'
import Decorates from './Decorates'
import Three from './Three'
// import Three from './Three'
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 Inputs from './Inputs'
import Mores from './Mores'
// import Inputs from './Inputs'
// 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 = {
[PackagesCategoryEnum.CHARTS]: ConfigType[]
[PackagesCategoryEnum.INFORMATIONS]: ConfigType[]
[PackagesCategoryEnum.TABLES]: ConfigType[]
[PackagesCategoryEnum.PHOTOS]: ConfigType[]
// [PackagesCategoryEnum.TABLES]: ConfigType[]
// [PackagesCategoryEnum.PHOTOS]: ConfigType[]
[PackagesCategoryEnum.ICONS]: ConfigType[]
[PackagesCategoryEnum.DECORATES]: ConfigType[]
[PackagesCategoryEnum.THEMESANDLAYOUTS]: ConfigType[]
// [PackagesCategoryEnum.THEMESANDLAYOUTS]: ConfigType[]
[PackagesCategoryEnum.CUSTOMCOMPONENTS]: ConfigType[]
}

View File

@ -1,10 +1,10 @@
import { ChartList } from '@/packages/components/Charts/index'
import { DecorateList } from '@/packages/components/Decorates/index'
import { InformationList } from '@/packages/components/Informations/index'
import { TableList } from '@/packages/components/Tables/index'
import { PhotoList } from '@/packages/components/Photos/index'
// import { TableList } from '@/packages/components/Tables/index'
// import { PhotoList } from '@/packages/components/Photos/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 { 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 = {
[PackagesCategoryEnum.CHARTS]: ChartList,
[PackagesCategoryEnum.INFORMATIONS]: InformationList,
[PackagesCategoryEnum.TABLES]: TableList,
// [PackagesCategoryEnum.TABLES]: TableList,
[PackagesCategoryEnum.DECORATES]: DecorateList,
[PackagesCategoryEnum.PHOTOS]: PhotoList,
// [PackagesCategoryEnum.PHOTOS]: PhotoList,
[PackagesCategoryEnum.ICONS]: IconList,
[PackagesCategoryEnum.THEMESANDLAYOUTS]: ThemesAndLayoutsList,
// [PackagesCategoryEnum.THEMESANDLAYOUTS]: ThemesAndLayoutsList,
[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)) {
console.log(k, v)
return evalFn(`(function(){return ${v}})()`)
} else if (typeof v === 'string' && v.indexOf && v.indexOf('return ') > -1) {
console.log(k, v)
const baseLeftIndex = v.indexOf('(')
if (baseLeftIndex > -1) {
const newFn = `function ${v.substring(baseLeftIndex)}`

View File

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

View File

@ -1,23 +1,75 @@
<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">
组件 id
<n-text>{{ targetData.id }}</n-text>
</n-text>
<chart-event-interaction></chart-event-interaction>
<chart-event-base-handle></chart-event-base-handle>
<chart-event-advanced-handle></chart-event-advanced-handle>
<!-- <chart-event-interaction></chart-event-interaction>-->
<!-- <chart-event-base-handle></chart-event-base-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>
</template>
<script setup lang="ts">
import { ref } from 'vue'
import {ref, reactive, computed, watch, watchEffect, Ref} from 'vue'
import { ChartEventInteraction } from './components/ChartEventInteraction'
import { ChartEventAdvancedHandle } from './components/ChartEventAdvancedHandle'
import { ChartEventBaseHandle } from './components/ChartEventBaseHandle'
import { useTargetData } from '../hooks/useTargetData.hook'
const { targetData } = useTargetData()
const showModal = ref(false)
// const { targetData, chartEditStore } = useTargetData()
// 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>

View File

@ -7,7 +7,7 @@
<!-- 位置 -->
<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>
</div>

View File

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

View File

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

View File

@ -250,8 +250,7 @@ export const useSync = () => {
chartEditStore.componentList = []
chartEditStore.setEditCanvas(EditCanvasTypeEnum.SAVE_STATUS, SyncEnum.START)
try {
const res = await fetchProjectApi({ projectId: fetchRouteParamsLocation() })
console.log(res)
const res = await fetchProjectApi({ id: Number(fetchRouteParamsLocation()) })
if (res) {
// type dataType = {
// id: string
@ -263,6 +262,9 @@ export const useSync = () => {
// }
if (res.data) {
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))
return
@ -276,9 +278,8 @@ export const useSync = () => {
}
chartEditStore.setEditCanvas(EditCanvasTypeEnum.SAVE_STATUS, SyncEnum.FAILURE)
} catch (error) {
console.log(error)
chartEditStore.setEditCanvas(EditCanvasTypeEnum.SAVE_STATUS, SyncEnum.FAILURE)
httpErrorHandle()
// httpErrorHandle()
}
}

View File

@ -30,12 +30,13 @@
:chartConfig="item"
:themeSetting="themeSetting"
:themeColor="themeColor"
:style="{
:style="{
...getSizeStyle(item.attr),
...getFilterStyle(item.styles)
}"
v-on="useLifeHandler(item)"
v-on="bindEvent(item)"
></component>
<!-- v-on="useLifeHandler(item)"-->
</div>
</template>
@ -50,6 +51,7 @@ import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore
import { animationsClass, getFilterStyle, getTransformStyle, getBlendModeStyle, colorCustomMerge } from '@/utils'
import { getSizeStyle, getComponentAttrStyle, getStatusStyle, getPreviewConfigStyle } from '../../utils'
import { useLifeHandler } from '@/hooks'
import { useCustomEvent } from '../../hooks/useCustomEvent.hook'
//
const { initDataPond, clearMittDataPondMap } = useChartDataPondFetch()
@ -79,6 +81,8 @@ clearMittDataPondMap()
onMounted(() => {
initDataPond(useChartEditStore)
})
const { bindEvent } = useCustomEvent()
</script>
<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 获取存储数据的信息
export const getSessionStorageInfo = async () => {
const id = fetchRouteParamsLocation()
const id = Number(fetchRouteParamsLocation())
const storageList: ChartEditStorageType[] = getSessionStorage(StorageEnum.GO_CHART_STORAGE_LIST)
// 是否本地预览
if (!storageList || storageList.findIndex(e => e.id === id.toString()) === -1) {
// 接口调用
const res = await fetchProjectApi({ projectId: id })
const res = await fetchProjectApi({ id })
if (res) {
const { content, state } = res.data
// if (state === -1) {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,5 +1,5 @@
<template>
<div @click="clickHandle">
<div @click="handleClick">
<n-tooltip v-if="collapsed" placement="right" trigger="hover">
<template #trigger>
<n-button ghost type="primary" size="small">
@ -34,6 +34,9 @@ import { ref } from 'vue'
import { useDesignStore } from '@/store/modules/designStore/designStore'
import { CreateModal } from './components/CreateModal/index'
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 designStore = useDesignStore()
@ -51,4 +54,28 @@ const clickHandle = () => {
const closeHandle = () => {
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>

View File

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

View File

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

View File

@ -46,27 +46,47 @@ export default ({ mode }) => defineConfig({
open: true,
port: 3000,
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]: {
// @ts-ignore
target: loadEnv(mode, process.cwd()).VITE_DEV_PATH,
changeOrigin: true,
// rewrite: (path) => path.replace(new RegExp(`^${axiosPre}`), ''),
rewrite: () => '',
// rewrite: () => '',
ws: true,
secure: true,
},
'/data/file': {
// @ts-ignore
target: loadEnv(mode, process.cwd()).VITE_DEV_PATH,
changeOrigin: true,
ws: true,
secure: true,
},
// '/svgConfig': {
// 开发
// '/dcim': {
// // @ts-ignore
// target: loadEnv(mode, process.cwd()).VITE_DEV_PATH,
// 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,
// secure: true,
// },