mirror of
https://github.com/silenty4ng/k5web
synced 2025-01-07 20:33:28 +00:00
增加搜索功能
This commit is contained in:
parent
3e7bb8e3ad
commit
14068b1920
3 changed files with 61 additions and 12 deletions
|
@ -3,7 +3,17 @@
|
||||||
<Breadcrumb :items="[$t('menu.workshop'), $t('menu.channel')]" />
|
<Breadcrumb :items="[$t('menu.workshop'), $t('menu.channel')]" />
|
||||||
<a-row :gutter="20" align="stretch">
|
<a-row :gutter="20" align="stretch">
|
||||||
<a-col :span="24">
|
<a-col :span="24">
|
||||||
<a-card class="general-card" :title="$t('menu.channel')">
|
<a-card class="general-card">
|
||||||
|
<template #title>
|
||||||
|
<div style="display: flex; gap: 1rem; align-items: flex-end;">
|
||||||
|
{{ $t('menu.channel') }}
|
||||||
|
<t-input size="small" style="width: 200px;" v-model="state.title" @enter="searchIt">
|
||||||
|
<template #suffixIcon>
|
||||||
|
<search-icon :style="{ cursor: 'pointer' }" @click="searchIt"/>
|
||||||
|
</template>
|
||||||
|
</t-input>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
<template #extra>
|
<template #extra>
|
||||||
<div style="margin-right: 20px;">
|
<div style="margin-right: 20px;">
|
||||||
<template v-if="userStore.name">
|
<template v-if="userStore.name">
|
||||||
|
@ -105,6 +115,7 @@
|
||||||
import { RefreshIcon } from 'tdesign-icons-vue-next';
|
import { RefreshIcon } from 'tdesign-icons-vue-next';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import { Message } from '@arco-design/web-vue';
|
import { Message } from '@arco-design/web-vue';
|
||||||
|
import { SearchIcon } from 'tdesign-icons-vue-next';
|
||||||
|
|
||||||
const appStore = useAppStore();
|
const appStore = useAppStore();
|
||||||
const userStore = useUserStore();
|
const userStore = useUserStore();
|
||||||
|
@ -120,7 +131,8 @@
|
||||||
myList: any,
|
myList: any,
|
||||||
total: number,
|
total: number,
|
||||||
page: number,
|
page: number,
|
||||||
nowpage: any
|
nowpage: any,
|
||||||
|
title: string
|
||||||
} = reactive({
|
} = reactive({
|
||||||
binaryFile: undefined,
|
binaryFile: undefined,
|
||||||
loading: false,
|
loading: false,
|
||||||
|
@ -130,7 +142,8 @@
|
||||||
myList: [],
|
myList: [],
|
||||||
total: 0,
|
total: 0,
|
||||||
page: 1,
|
page: 1,
|
||||||
nowpage: []
|
nowpage: [],
|
||||||
|
title: ''
|
||||||
})
|
})
|
||||||
|
|
||||||
const formData = reactive({
|
const formData = reactive({
|
||||||
|
@ -145,7 +158,7 @@
|
||||||
|
|
||||||
const loadit = async (page: any) => {
|
const loadit = async (page: any) => {
|
||||||
state.page = page.current
|
state.page = page.current
|
||||||
const resp : any = await axios.get("https://k5ws.vicicode.cn/api/channel/index?server=1&limit=12&page=" + page.current + "&t=" + Date.now())
|
const resp : any = await axios.get("https://k5ws.vicicode.cn/api/channel/index?server=1&limit=12&page=" + page.current + "&title=" + state.title + "&t=" + Date.now())
|
||||||
state.total = resp.data.total
|
state.total = resp.data.total
|
||||||
state.nowpage = resp.data.list
|
state.nowpage = resp.data.list
|
||||||
}
|
}
|
||||||
|
@ -237,6 +250,9 @@ const iDownload = (url: any, name: any) => {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const searchIt = () => {
|
||||||
|
loadit({current: 1})
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
|
|
|
@ -3,7 +3,17 @@
|
||||||
<Breadcrumb :items="[$t('menu.workshop'), $t('menu.firmware')]" />
|
<Breadcrumb :items="[$t('menu.workshop'), $t('menu.firmware')]" />
|
||||||
<a-row :gutter="20" align="stretch">
|
<a-row :gutter="20" align="stretch">
|
||||||
<a-col :span="24">
|
<a-col :span="24">
|
||||||
<a-card class="general-card" :title="$t('menu.firmware')">
|
<a-card class="general-card">
|
||||||
|
<template #title>
|
||||||
|
<div style="display: flex; gap: 1rem; align-items: flex-end;">
|
||||||
|
{{ $t('menu.firmware') }}
|
||||||
|
<t-input size="small" style="width: 200px;" v-model="state.title" @enter="searchIt">
|
||||||
|
<template #suffixIcon>
|
||||||
|
<search-icon :style="{ cursor: 'pointer' }" @click="searchIt"/>
|
||||||
|
</template>
|
||||||
|
</t-input>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
<template #extra>
|
<template #extra>
|
||||||
<div style="margin-right: 20px;">
|
<div style="margin-right: 20px;">
|
||||||
<template v-if="userStore.name">
|
<template v-if="userStore.name">
|
||||||
|
@ -105,6 +115,7 @@
|
||||||
import { RefreshIcon } from 'tdesign-icons-vue-next';
|
import { RefreshIcon } from 'tdesign-icons-vue-next';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import { Message } from '@arco-design/web-vue';
|
import { Message } from '@arco-design/web-vue';
|
||||||
|
import { SearchIcon } from 'tdesign-icons-vue-next';
|
||||||
|
|
||||||
const appStore = useAppStore();
|
const appStore = useAppStore();
|
||||||
const userStore = useUserStore();
|
const userStore = useUserStore();
|
||||||
|
@ -120,7 +131,8 @@
|
||||||
myList: any,
|
myList: any,
|
||||||
total: number,
|
total: number,
|
||||||
page: number,
|
page: number,
|
||||||
nowpage: any
|
nowpage: any,
|
||||||
|
title: string
|
||||||
} = reactive({
|
} = reactive({
|
||||||
binaryFile: undefined,
|
binaryFile: undefined,
|
||||||
loading: false,
|
loading: false,
|
||||||
|
@ -130,7 +142,8 @@
|
||||||
myList: [],
|
myList: [],
|
||||||
total: 0,
|
total: 0,
|
||||||
page: 1,
|
page: 1,
|
||||||
nowpage: []
|
nowpage: [],
|
||||||
|
title: ''
|
||||||
})
|
})
|
||||||
|
|
||||||
const formData = reactive({
|
const formData = reactive({
|
||||||
|
@ -145,7 +158,7 @@
|
||||||
|
|
||||||
const loadit = async (page: any) => {
|
const loadit = async (page: any) => {
|
||||||
state.page = page.current
|
state.page = page.current
|
||||||
const resp : any = await axios.get("https://k5ws.vicicode.cn/api/firmware/index?server=1&limit=12&page=" + page.current + "&t=" + Date.now())
|
const resp : any = await axios.get("https://k5ws.vicicode.cn/api/firmware/index?server=1&limit=12&page=" + page.current + "&title=" + state.title + "&t=" + Date.now())
|
||||||
state.total = resp.data.total
|
state.total = resp.data.total
|
||||||
state.nowpage = resp.data.list
|
state.nowpage = resp.data.list
|
||||||
}
|
}
|
||||||
|
@ -237,6 +250,9 @@
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const searchIt = () => {
|
||||||
|
loadit({current: 1})
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
|
|
|
@ -3,7 +3,17 @@
|
||||||
<Breadcrumb :items="[$t('menu.workshop'), $t('menu.image')]" />
|
<Breadcrumb :items="[$t('menu.workshop'), $t('menu.image')]" />
|
||||||
<a-row :gutter="20" align="stretch">
|
<a-row :gutter="20" align="stretch">
|
||||||
<a-col :span="24">
|
<a-col :span="24">
|
||||||
<a-card class="general-card" :title="$t('menu.image')">
|
<a-card class="general-card">
|
||||||
|
<template #title>
|
||||||
|
<div style="display: flex; gap: 1rem; align-items: flex-end;">
|
||||||
|
{{ $t('menu.image') }}
|
||||||
|
<t-input size="small" style="width: 200px;" v-model="state.title" @enter="searchIt">
|
||||||
|
<template #suffixIcon>
|
||||||
|
<search-icon :style="{ cursor: 'pointer' }" @click="searchIt"/>
|
||||||
|
</template>
|
||||||
|
</t-input>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
<template #extra>
|
<template #extra>
|
||||||
<div style="margin-right: 20px;">
|
<div style="margin-right: 20px;">
|
||||||
<template v-if="userStore.name">
|
<template v-if="userStore.name">
|
||||||
|
@ -115,6 +125,7 @@
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import { Message } from '@arco-design/web-vue';
|
import { Message } from '@arco-design/web-vue';
|
||||||
import { RefreshIcon } from 'tdesign-icons-vue-next';
|
import { RefreshIcon } from 'tdesign-icons-vue-next';
|
||||||
|
import { SearchIcon } from 'tdesign-icons-vue-next';
|
||||||
|
|
||||||
const appStore = useAppStore();
|
const appStore = useAppStore();
|
||||||
const userStore = useUserStore();
|
const userStore = useUserStore();
|
||||||
|
@ -131,7 +142,8 @@
|
||||||
total: number,
|
total: number,
|
||||||
page: number,
|
page: number,
|
||||||
nowpage: any,
|
nowpage: any,
|
||||||
dropzoneActive: boolean
|
dropzoneActive: boolean,
|
||||||
|
title: string
|
||||||
} = reactive({
|
} = reactive({
|
||||||
binaryFile: undefined,
|
binaryFile: undefined,
|
||||||
loading: false,
|
loading: false,
|
||||||
|
@ -142,7 +154,8 @@
|
||||||
total: 0,
|
total: 0,
|
||||||
page: 1,
|
page: 1,
|
||||||
nowpage: [],
|
nowpage: [],
|
||||||
dropzoneActive: false
|
dropzoneActive: false,
|
||||||
|
title: ''
|
||||||
})
|
})
|
||||||
|
|
||||||
const dragEnter = (event: any) => {
|
const dragEnter = (event: any) => {
|
||||||
|
@ -196,7 +209,7 @@
|
||||||
|
|
||||||
const loadit = async (page: any) => {
|
const loadit = async (page: any) => {
|
||||||
state.page = page.current
|
state.page = page.current
|
||||||
const resp : any = await axios.get("https://k5ws.vicicode.cn/api/image/index?server=1&limit=24&page=" + page.current + "&t=" + Date.now())
|
const resp : any = await axios.get("https://k5ws.vicicode.cn/api/image/index?server=1&limit=24&page=" + page.current + "&title=" + state.title + "&t=" + Date.now())
|
||||||
state.total = resp.data.total
|
state.total = resp.data.total
|
||||||
state.nowpage = resp.data.list
|
state.nowpage = resp.data.list
|
||||||
}
|
}
|
||||||
|
@ -275,6 +288,10 @@
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const searchIt = () => {
|
||||||
|
loadit({current: 1})
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
|
|
Loading…
Reference in a new issue