diff --git a/bun.lockb b/bun.lockb index e35e8a4..9d9f4ee 100644 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/package.json b/package.json index a75ea70..620cd61 100644 --- a/package.json +++ b/package.json @@ -12,10 +12,12 @@ "@ant-design/icons-vue": "^7.0.1", "ant-design-vue": "4.x", "dayjs": "^1.11.13", + "echarts": "^5.5.1", "mande": "^2.0.8", "moment": "^2.30.1", "radash": "^12.1.0", "vue": "^3.4.21", + "vue-echarts": "^7.0.3", "vue-router": "4" }, "devDependencies": { @@ -23,6 +25,7 @@ "@vitejs/plugin-vue": "^5.0.4", "unocss": "^0.59.0", "unplugin-vue-components": "^0.26.0", + "unplugin-vue-router": "^0.10.7", "vite": "^5.2.0" } } diff --git a/src/api/articles.js b/src/api/articles.js new file mode 100644 index 0000000..f33a2ab --- /dev/null +++ b/src/api/articles.js @@ -0,0 +1,36 @@ +import {mande} from "mande"; +import {queryRemoveZero} from "@/api/utils.js"; + +const articles = mande('/api/v2/articles') + +export const ListArticles = (q) => { + const query = queryRemoveZero(q) + return articles.get({query}) +} + +export const GetArticle = (id) =>{ + return articles.get(`/${id}`) +} + +export const UpdateArticle = (article)=>{ + return articles.patch(article) +} + +export const GetBrandsDict=()=>{ + return articles.get('dict/brand') +} +export const GetProviderHistory=(id)=>{ + return articles.get(`/provider/history/${id}`) +} + +export const GetSellerHistory=(id)=>{ + return articles.get(`/seller/history/${id}`) +} + +export const UpdateProviderArticle=(article)=>{ + return articles.patch('provider',article) +} + +export const UpdateSellerArticle=(article)=>{ + return articles.patch('seller',article) +} \ No newline at end of file diff --git a/src/api/provider.js b/src/api/provider.js index 7eba9fd..871f53a 100644 --- a/src/api/provider.js +++ b/src/api/provider.js @@ -1,25 +1,47 @@ import {mande} from "mande"; import {queryRemoveZero} from "@/api/utils.js"; -const product = mande('/api/v2/providers') +const providers = mande('/api/v2/providers') export const ListProviders = (q) => { const query = queryRemoveZero(q) - return product.get({query}) + return providers.get({query}) } export const CreateProvider = (provider)=>{ - return product.post(provider) + return providers.post(provider) } export const UpdateProvider = (provider)=>{ - return product.put(provider) + return providers.put(provider) } export const GetProvider = (id) =>{ - return product.get(`/${id}`) + return providers.get(`/${id}`) } export const DeleteProvider = (id)=>{ - return product.delete(`/${id}`) + return providers.delete(`/${id}`) +} + +export const GetProviderDictStatus = () =>{ + return providers.get('/dict/status') +} + +export const FindProviders= (q) =>{ + const query = queryRemoveZero(q) + return providers.get('find',{query}) +} + + + +const provider = mande('/api/v2/provider') + +// 拉取供应商所有商品价格 +export const FetchProviderArticles = (providerId)=>{ + return provider.post(`/${providerId}/pull`) +} + +export const FetchProviderArticle = (providerArticle)=>{ + return provider.post(`/${providerArticle.providerId}/fetch/${providerArticle.id}`) } \ No newline at end of file diff --git a/src/api/seller.js b/src/api/seller.js index ef5c7e3..0ef1ec9 100644 --- a/src/api/seller.js +++ b/src/api/seller.js @@ -1,25 +1,48 @@ import {mande} from "mande"; import {queryRemoveZero} from "@/api/utils.js"; -const product = mande('/api/v2/sellers') +const sellers = mande('/api/v2/sellers') export const ListSellers = (q) => { const query = queryRemoveZero(q) - return product.get({query}) + return sellers.get({query}) +} + +export const FindSellers= (q) =>{ + const query = queryRemoveZero(q) + return sellers.get('find',{query}) } export const CreateSeller = (seller)=>{ - return product.post(seller) + return sellers.post(seller) } export const UpdateSeller = (seller)=>{ - return product.put(seller) + return sellers.put(seller) } export const GetSeller = (id) =>{ - return product.get(`/${id}`) + return sellers.get(`/${id}`) } export const DeleteSeller = (id)=>{ - return product.delete(`/${id}`) + return sellers.delete(`/${id}`) +} + +export const GetSellerDictStatus = () =>{ + return sellers.get('/dict/status') +} + + +const seller = mande('/api/v2/seller') +export const FetchSellerArticles = (sellerId)=>{ + return seller.post(`/${sellerId}/pull`) +} + +export const MatchSellerSku = (sellerArticle)=>{ + return seller.post(`/${sellerArticle.sellerId}/match`, sellerArticle) +} + +export const FetchSellerArticle = (sellerArticle)=>{ + return seller.post(`/${sellerArticle.sellerId}/fetch/${sellerArticle.id}`) } \ No newline at end of file diff --git a/src/componse/provider-article/provider-article-panel.vue b/src/componse/provider-article/provider-article-panel.vue new file mode 100644 index 0000000..92fffa0 --- /dev/null +++ b/src/componse/provider-article/provider-article-panel.vue @@ -0,0 +1,170 @@ + + + + + \ No newline at end of file diff --git a/src/componse/seller-article/seller-article-panel.vue b/src/componse/seller-article/seller-article-panel.vue new file mode 100644 index 0000000..9e32527 --- /dev/null +++ b/src/componse/seller-article/seller-article-panel.vue @@ -0,0 +1,197 @@ + + + + \ No newline at end of file diff --git a/src/routers/index.js b/src/routers/index.js index f630054..c4f3930 100644 --- a/src/routers/index.js +++ b/src/routers/index.js @@ -1,50 +1,15 @@ import {createRouter, createWebHashHistory} from "vue-router"; +import { routes } from 'vue-router/auto-routes'; -const routes = [ - { - path: '/', - redirect: '/watcher' - }, - { - path: '/watcher', - name: 'watcher', - component: ()=>import('@/views/Watcher/index.vue') - }, - { - path: '/us-coach', - name: 'us-coach', - component: ()=>import('@/views/Product/USCoachOutlet.vue') - }, - { - path: '/cn-coach', - name: 'cn-coach', - component: ()=>import('@/views/Product/CNCoachOutlet.vue') - }, - { - path: '/cn-coach-outlet', - name: 'cn-coach-outlet', - component: ()=>import('@/views/Product/CNCoachOutlet.vue') - }, - { - path: '/pusher', - name: 'pusher', - component: ()=>import('@/views/Pusher/index.vue') - }, - { - path: '/provider', - name: 'provider', - component: ()=>import('@/views/Provider/index.vue') - }, - { - path: '/seller', - name: 'seller', - component: ()=>import('@/views/Seller/index.vue') - } -] const router = createRouter({ history: createWebHashHistory(), - routes + routes:[ + ...routes, + { path: '/', + redirect: '/watcher' + }, + ] }) export default router \ No newline at end of file diff --git a/src/views/article/detail.vue b/src/views/article/detail.vue new file mode 100644 index 0000000..0a45d93 --- /dev/null +++ b/src/views/article/detail.vue @@ -0,0 +1,180 @@ + + + + \ No newline at end of file diff --git a/src/views/article/index.vue b/src/views/article/index.vue new file mode 100644 index 0000000..bf017e1 --- /dev/null +++ b/src/views/article/index.vue @@ -0,0 +1,205 @@ + + + \ No newline at end of file diff --git a/src/views/layout/Aside.vue b/src/views/layout/Aside.vue index 5dd7bee..d3cd67f 100644 --- a/src/views/layout/Aside.vue +++ b/src/views/layout/Aside.vue @@ -16,7 +16,7 @@ const router = useRouter() const onclick = ({key}) => { router.push({ - name: key + path: '/'+key }) } @@ -28,28 +28,11 @@ const items = [ title: '蹲货', }, { - key: 'product', + key: 'article', icon: () => h(DollarCircleOutlined), label: '商品', title: '商品', onTitleClick: onclick, - children: [ - { - key: 'us-coach', - label: '美国coach outlet', - title: '美国coach outlet', - }, - { - key: 'cn-coach-outlet', - label: '中国coach outlet', - title: '中国coach outlet', - }, - { - key: 'cn-coach', - label: '中国coach', - title: '中国coach', - } - ] }, { key: 'pusher', @@ -66,8 +49,8 @@ const items = [ { key: 'seller', icon: () => h(DeploymentUnitOutlined), - label: '出货商', - title: '出货商', + label: '销售商', + title: '销售商', } ] diff --git a/src/views/layout/index.vue b/src/views/layout/index.vue index d92d49c..d9603ad 100644 --- a/src/views/layout/index.vue +++ b/src/views/layout/index.vue @@ -1,7 +1,7 @@ + + @@ -76,10 +83,18 @@