去除了多余的变量
This commit is contained in:
parent
bf3e77e7a3
commit
fe0b9edf01
|
@ -81,7 +81,6 @@ export default defineComponent(() => {
|
||||||
menu.show && (
|
menu.show && (
|
||||||
<div
|
<div
|
||||||
v-outside-click={() => {
|
v-outside-click={() => {
|
||||||
console.log(2333)
|
|
||||||
menu.dismiss()
|
menu.dismiss()
|
||||||
}}
|
}}
|
||||||
class="fixed px-2 pt-4 pb-2 bg-white/60 backdrop-blur shadow-lg rounded-lg overflow-hidden w-[120px]"
|
class="fixed px-2 pt-4 pb-2 bg-white/60 backdrop-blur shadow-lg rounded-lg overflow-hidden w-[120px]"
|
||||||
|
|
|
@ -3,11 +3,9 @@ import {
|
||||||
defineComponent,
|
defineComponent,
|
||||||
provide,
|
provide,
|
||||||
ref,
|
ref,
|
||||||
Transition,
|
|
||||||
type InjectionKey,
|
type InjectionKey,
|
||||||
type Ref
|
type Ref
|
||||||
} from 'vue'
|
} from 'vue'
|
||||||
import AdderPageBack from './AdderPageBack'
|
|
||||||
import useLayoutStore from '../useLayoutStore'
|
import useLayoutStore from '../useLayoutStore'
|
||||||
import { OhVueIcon, addIcons } from 'oh-vue-icons'
|
import { OhVueIcon, addIcons } from 'oh-vue-icons'
|
||||||
import {
|
import {
|
||||||
|
|
|
@ -3,7 +3,6 @@ import useLayoutStore from '../useLayoutStore'
|
||||||
import { Button, Form, Input, InputGroup } from 'ant-design-vue'
|
import { Button, Form, Input, InputGroup } from 'ant-design-vue'
|
||||||
import { OhVueIcon, addIcons } from 'oh-vue-icons'
|
import { OhVueIcon, addIcons } from 'oh-vue-icons'
|
||||||
import { MdUpload, MdImage, MdCheck } from 'oh-vue-icons/icons'
|
import { MdUpload, MdImage, MdCheck } from 'oh-vue-icons/icons'
|
||||||
import ImageUploader from '@/utils/ImageUploader'
|
|
||||||
import useLink from '../../utils/useLink'
|
import useLink from '../../utils/useLink'
|
||||||
import { CheckOutlined } from '@ant-design/icons-vue'
|
import { CheckOutlined } from '@ant-design/icons-vue'
|
||||||
import { v4 as uuid } from 'uuid'
|
import { v4 as uuid } from 'uuid'
|
||||||
|
|
|
@ -1,12 +1,10 @@
|
||||||
import CategoryTab from '@/utils/CategoryTab'
|
import CategoryTab from '@/utils/CategoryTab'
|
||||||
import request from '@/utils/request'
|
import request from '@/utils/request'
|
||||||
import { computed, defineComponent, inject, onMounted, ref, watch } from 'vue'
|
import { computed, defineComponent, inject, ref, watch } from 'vue'
|
||||||
import type { BackgroundType } from '../background/BackgroundSwtich'
|
|
||||||
import clsx from 'clsx'
|
import clsx from 'clsx'
|
||||||
import useLayoutStore from '../useLayoutStore'
|
import useLayoutStore from '../useLayoutStore'
|
||||||
import { AddToToken } from './AdderPage'
|
import { AddToToken } from './AdderPage'
|
||||||
import { v4 as uuid } from 'uuid'
|
import { v4 as uuid } from 'uuid'
|
||||||
import { Button } from 'ant-design-vue'
|
|
||||||
import { frontAddress, ossBase } from '@/config'
|
import { frontAddress, ossBase } from '@/config'
|
||||||
import dayjs from 'dayjs'
|
import dayjs from 'dayjs'
|
||||||
import { generateRandomString } from '@/utils/tool'
|
import { generateRandomString } from '@/utils/tool'
|
||||||
|
@ -161,7 +159,6 @@ export default defineComponent(() => {
|
||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
Promise.all([fetchGame(1), fetchGame(2), fetchGame(3)]).then((res) => {
|
Promise.all([fetchGame(1), fetchGame(2), fetchGame(3)]).then((res) => {
|
||||||
console.log(res.flat())
|
|
||||||
const resData = res.flat() as OtherGame[]
|
const resData = res.flat() as OtherGame[]
|
||||||
appList.value = resData.map((el) => ({
|
appList.value = resData.map((el) => ({
|
||||||
id: el.id.toString(),
|
id: el.id.toString(),
|
||||||
|
|
|
@ -6,7 +6,6 @@ import clsx from 'clsx'
|
||||||
import useLayoutStore from '../useLayoutStore'
|
import useLayoutStore from '../useLayoutStore'
|
||||||
import { AddToToken } from './AdderPage'
|
import { AddToToken } from './AdderPage'
|
||||||
import { v4 as uuid } from 'uuid'
|
import { v4 as uuid } from 'uuid'
|
||||||
import { Button } from 'ant-design-vue'
|
|
||||||
|
|
||||||
interface HotAppCategoryType {
|
interface HotAppCategoryType {
|
||||||
id: string
|
id: string
|
||||||
|
@ -129,7 +128,6 @@ export default defineComponent(() => {
|
||||||
const categoryList = ref<BackgroundType[]>([])
|
const categoryList = ref<BackgroundType[]>([])
|
||||||
const selectType = ref('')
|
const selectType = ref('')
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
console.log('hot')
|
|
||||||
request<HotAppCategoryType[]>('GET', '/api/app/hotAppTypes').then((res) => {
|
request<HotAppCategoryType[]>('GET', '/api/app/hotAppTypes').then((res) => {
|
||||||
categoryList.value = res.map((el) => ({
|
categoryList.value = res.map((el) => ({
|
||||||
id: el.id,
|
id: el.id,
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
import { computed, defineComponent, inject } from 'vue'
|
import { computed, defineComponent, inject } from 'vue'
|
||||||
import useLayoutStore from '../useLayoutStore'
|
import useLayoutStore from '../useLayoutStore'
|
||||||
import widgetList, { type Widget } from '@/widgets'
|
import widgetList, { type Widget } from '@/widgets'
|
||||||
import { Button } from 'ant-design-vue'
|
|
||||||
import clsx from 'clsx'
|
import clsx from 'clsx'
|
||||||
import { AddToToken } from './AdderPage'
|
import { AddToToken } from './AdderPage'
|
||||||
import { v4 as uuid } from 'uuid'
|
import { v4 as uuid } from 'uuid'
|
||||||
|
@ -18,7 +17,6 @@ export const WidgetItem = defineComponent({
|
||||||
const isGame = computed(() => layout.state.current === 0)
|
const isGame = computed(() => layout.state.current === 0)
|
||||||
const addTo = inject(AddToToken)
|
const addTo = inject(AddToToken)
|
||||||
const isExist = computed(() => {
|
const isExist = computed(() => {
|
||||||
console.log(layout.state.content[layout.state.currentPage].pages)
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
layout.state.content[layout.state.current].pages[layout.state.currentPage].list.findIndex(
|
layout.state.content[layout.state.current].pages[layout.state.currentPage].list.findIndex(
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import SettingItem from '@/settings/SettingItem'
|
import SettingItem from '@/settings/SettingItem'
|
||||||
import useSettingsStore from '@/settings/useSettingsStore'
|
import useSettingsStore from '@/settings/useSettingsStore'
|
||||||
import { Select, Slider, Switch, type SelectProps } from 'ant-design-vue'
|
import { Select, Switch, type SelectProps } from 'ant-design-vue'
|
||||||
import { defineComponent, ref } from 'vue'
|
import { defineComponent, ref } from 'vue'
|
||||||
import useSearchConfigStore from '../header/search/useSearchConfigStore'
|
import useSearchConfigStore from '../header/search/useSearchConfigStore'
|
||||||
|
|
||||||
|
|
|
@ -37,7 +37,6 @@ export default defineComponent({
|
||||||
layout="vertical"
|
layout="vertical"
|
||||||
model={addState}
|
model={addState}
|
||||||
onFinish={(res) => {
|
onFinish={(res) => {
|
||||||
console.log(res)
|
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Form.Item label="名称" name="name" rules={[{ required: true, message: '引擎名必填' }]}>
|
<Form.Item label="名称" name="name" rules={[{ required: true, message: '引擎名必填' }]}>
|
||||||
|
|
|
@ -33,7 +33,6 @@ export default defineStore('layout', () => {
|
||||||
[ready, state],
|
[ready, state],
|
||||||
([re, s]) => {
|
([re, s]) => {
|
||||||
if (!re) return
|
if (!re) return
|
||||||
console.log(toRaw(s))
|
|
||||||
db.setItem('layout', toRaw(s))
|
db.setItem('layout', toRaw(s))
|
||||||
},
|
},
|
||||||
{ deep: true }
|
{ deep: true }
|
||||||
|
@ -65,8 +64,6 @@ export default defineStore('layout', () => {
|
||||||
// 添加图标
|
// 添加图标
|
||||||
const addBlock = (block: Block, _page: number = -1) => {
|
const addBlock = (block: Block, _page: number = -1) => {
|
||||||
const page = _page >= 0 ? _page : state.currentPage
|
const page = _page >= 0 ? _page : state.currentPage
|
||||||
console.log(page)
|
|
||||||
console.log(state.content[state.current].pages[page])
|
|
||||||
if (!state.content[state.current].pages[page]) {
|
if (!state.content[state.current].pages[page]) {
|
||||||
globalToast.warning('请先添加页面')
|
globalToast.warning('请先添加页面')
|
||||||
return
|
return
|
||||||
|
@ -99,8 +96,6 @@ export default defineStore('layout', () => {
|
||||||
}
|
}
|
||||||
// 处理不同的组件的名称
|
// 处理不同的组件的名称
|
||||||
if (block.name === 'gameVideo') {
|
if (block.name === 'gameVideo') {
|
||||||
console.log(state.currentPage);
|
|
||||||
console.log(block);
|
|
||||||
|
|
||||||
return state.current === 0 ? '游戏视频' : state.current === 1 ? '学习视频' : '娱乐视频'
|
return state.current === 0 ? '游戏视频' : state.current === 1 ? '学习视频' : '娱乐视频'
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,7 +51,6 @@ export default defineComponent({
|
||||||
() => {
|
() => {
|
||||||
const idx = props.list.findIndex((item) => item.id === props.selectType)
|
const idx = props.list.findIndex((item) => item.id === props.selectType)
|
||||||
if (idx === -1) return
|
if (idx === -1) return
|
||||||
console.log(tabRefs.value)
|
|
||||||
|
|
||||||
if (tabRefs.value[idx]) {
|
if (tabRefs.value[idx]) {
|
||||||
const childRef = tabRefs.value[idx]
|
const childRef = tabRefs.value[idx]
|
||||||
|
|
|
@ -45,7 +45,6 @@ export default defineComponent({
|
||||||
const file: File | undefined = el.files?.[0]
|
const file: File | undefined = el.files?.[0]
|
||||||
el.value = ''
|
el.value = ''
|
||||||
if (!file) return
|
if (!file) return
|
||||||
console.log(file.size, props.size)
|
|
||||||
if (file.size > props.size * 1000 * 1000) {
|
if (file.size > props.size * 1000 * 1000) {
|
||||||
globalToast.warning(`大小不得超过${props.size}mb`)
|
globalToast.warning(`大小不得超过${props.size}mb`)
|
||||||
return
|
return
|
||||||
|
|
|
@ -16,7 +16,6 @@ export default defineComponent({
|
||||||
const handle = () => {
|
const handle = () => {
|
||||||
if (!dom) return
|
if (!dom) return
|
||||||
const { width } = dom.getBoundingClientRect()
|
const { width } = dom.getBoundingClientRect()
|
||||||
console.log(width)
|
|
||||||
height.value = width * props.ratio
|
height.value = width * props.ratio
|
||||||
}
|
}
|
||||||
const listen = new ResizeObserver(handle)
|
const listen = new ResizeObserver(handle)
|
||||||
|
|
Loading…
Reference in New Issue