From e10f47f18afc5fc378b808e45594f90a60dfdab7 Mon Sep 17 00:00:00 2001 From: lcc <805383944@qq.com> Date: Sun, 18 May 2025 20:48:52 +0800 Subject: [PATCH] 2025-05-18 --- admin/.env | 2 +- admin/src/components/CarSelector/index.vue | 111 +++---- .../src/views/car/product/components/edit.vue | 32 +- admin/src/views/car/product/index.vue | 27 +- .../home/analysis/components/hot-search.vue | 73 ----- .../home/analysis/components/profile-card.vue | 119 ++++++++ .../home/analysis/components/sale-card.vue | 210 ------------- .../analysis/components/statistics-card.vue | 97 +----- .../home/analysis/components/visit-hour.vue | 103 ------- admin/src/views/home/analysis/index.vue | 32 +- pingan/src/api/auto/index.js | 22 ++ pingan/src/api/car/product/index.js | 13 + pingan/src/components/CarSelector/index.vue | 196 +++++++++++++ pingan/src/i18n/lang/zh_CN/layout.js | 8 +- pingan/src/layout/components/header-tools.vue | 2 + pingan/src/views/car/product/detail.vue | 124 ++++++++ pingan/src/views/car/product/index.vue | 275 +++++++++--------- .../home/analysis/components/hot-search.vue | 73 ----- .../home/analysis/components/profile-card.vue | 119 ++++++++ .../home/analysis/components/sale-card.vue | 210 ------------- .../analysis/components/statistics-card.vue | 97 +----- .../home/analysis/components/visit-hour.vue | 103 ------- pingan/src/views/home/analysis/index.vue | 32 +- 23 files changed, 888 insertions(+), 1192 deletions(-) delete mode 100644 admin/src/views/home/analysis/components/hot-search.vue create mode 100644 admin/src/views/home/analysis/components/profile-card.vue delete mode 100644 admin/src/views/home/analysis/components/sale-card.vue delete mode 100644 admin/src/views/home/analysis/components/visit-hour.vue create mode 100644 pingan/src/api/auto/index.js create mode 100644 pingan/src/components/CarSelector/index.vue create mode 100644 pingan/src/views/car/product/detail.vue delete mode 100644 pingan/src/views/home/analysis/components/hot-search.vue create mode 100644 pingan/src/views/home/analysis/components/profile-card.vue delete mode 100644 pingan/src/views/home/analysis/components/sale-card.vue delete mode 100644 pingan/src/views/home/analysis/components/visit-hour.vue diff --git a/admin/.env b/admin/.env index c6f2eea..42ff52a 100644 --- a/admin/.env +++ b/admin/.env @@ -1,2 +1,2 @@ -VUE_APP_NAME=Ele Admin +VUE_APP_NAME=后台管理 VUE_APP_API_BASE_URL=https://v2.eleadmin.com/api diff --git a/admin/src/components/CarSelector/index.vue b/admin/src/components/CarSelector/index.vue index 93e2143..154ffe8 100644 --- a/admin/src/components/CarSelector/index.vue +++ b/admin/src/components/CarSelector/index.vue @@ -63,7 +63,7 @@ export default { name: 'CarModelSelector', props: { - modelValue: { + value: { type: Object, default: () => ({ brandId: null, @@ -80,11 +80,7 @@ }, data() { return { - form: { - brandId: null, - seriesId: null, - modelId: null - }, + form: { ...this.value }, // 初始化时深拷贝value, brandList: [], seriesList: [], modelList: [], @@ -94,43 +90,22 @@ brandFilter: '' }; }, - watch: { - modelValue: { - deep: true, - handler(newVal) { - console.log(newVal); - this.form = { ...newVal }; - this.syncFormWithProps(); - } - }, - '$props.modelValue': { - handler() { - this.syncFormWithProps(); - } - }, - 'form.brandId'(val) { - this.emitValue(); - if (!val) { - this.seriesList = []; - this.modelList = []; - this.form.seriesId = null; - this.form.modelId = null; - } - }, - 'form.seriesId'(val) { - this.emitValue(); - if (!val) this.modelList = this.form.modelId = null; - }, - 'form.modelId': { - handler() { - this.emitValue(); - }, - immediate: true - } - }, created() { this.loadBrands(); - this.syncFormWithProps(); + if (this.form.brandId) { + this.loadSeriesList(this.form.brandId); + } + if (this.form.seriesId) { + this.loadModelList(this.form.seriesId); + } + }, + watch: { + value: { + deep: true, + handler(newVal) { + this.form = { ...newVal }; // 外部值变化时更新内部form + } + } }, methods: { async loadBrands(filter = '') { @@ -138,6 +113,8 @@ try { const res = await pageBrand({ nameLike: filter }); this.brandList = res; + this.seriesList = []; + this.modelList = []; } catch (error) { this.$message.error('品牌加载失败'); } finally { @@ -150,7 +127,7 @@ try { const res = await pageSeries({ brandId }); this.seriesList = res; - this.form.seriesId = null; + this.modelList = []; } catch (error) { this.$message.error('车系加载失败'); } finally { @@ -163,7 +140,6 @@ try { const res = await pageAutoCar({ seriesId }); this.modelList = res; - this.form.modelId = null; } catch (error) { this.$message.error('车型加载失败'); } finally { @@ -172,41 +148,46 @@ }, handleBrandChange(brandId) { - if (brandId) this.loadSeriesList(brandId); + if (brandId) { + this.form.seriesId = null; + this.loadSeriesList(brandId); + } + this.emitValue(); }, handleSeriesChange(seriesId) { - if (seriesId) this.loadModelList(seriesId); + if (seriesId) { + this.form.modelId = null; + this.loadModelList(seriesId); + } + this.emitValue(); + }, + handleModelChange() { + this.emitValue(); }, - handleModelChange() {}, handleBrandFilter(filter) { this.brandFilter = filter; this.loadBrands(filter); }, - emitValue() { - this.$emit('update:modelValue', { - brandId: this.form.brandId, - seriesId: this.form.seriesId, - modelId: this.form.modelId - }); + this.$emit('input', { ...this.form }); }, syncFormWithProps() { // 重置所有数据 - this.brandList = []; - this.seriesList = []; - this.modelList = []; - - const { brandId, seriesId, modelId } = this.modelValue; - this.form = { brandId, seriesId, modelId }; - - if (brandId) { - this.loadSeriesList(brandId); - if (seriesId) { - this.loadModelList(seriesId); - } - } + // this.brandList = []; + // this.seriesList = []; + // this.modelList = []; + // + // const { brandId, seriesId, modelId } = this.modelValue; + // this.form = { brandId, seriesId, modelId }; + // + // if (brandId) { + // this.loadSeriesList(brandId); + // if (seriesId) { + // this.loadModelList(seriesId); + // } + // } } } }; diff --git a/admin/src/views/car/product/components/edit.vue b/admin/src/views/car/product/components/edit.vue index 2f8ff03..23ed731 100644 --- a/admin/src/views/car/product/components/edit.vue +++ b/admin/src/views/car/product/components/edit.vue @@ -165,6 +165,29 @@ v-model="form.descript" /> + +
+ +
+ + 新增推广文案 + +
+ diff --git a/pingan/src/views/home/analysis/components/hot-search.vue b/pingan/src/views/home/analysis/components/hot-search.vue deleted file mode 100644 index adb9de6..0000000 --- a/pingan/src/views/home/analysis/components/hot-search.vue +++ /dev/null @@ -1,73 +0,0 @@ - - - diff --git a/pingan/src/views/home/analysis/components/profile-card.vue b/pingan/src/views/home/analysis/components/profile-card.vue new file mode 100644 index 0000000..8ef3d90 --- /dev/null +++ b/pingan/src/views/home/analysis/components/profile-card.vue @@ -0,0 +1,119 @@ + + + + + + diff --git a/pingan/src/views/home/analysis/components/sale-card.vue b/pingan/src/views/home/analysis/components/sale-card.vue deleted file mode 100644 index cd7f194..0000000 --- a/pingan/src/views/home/analysis/components/sale-card.vue +++ /dev/null @@ -1,210 +0,0 @@ - - - - - diff --git a/pingan/src/views/home/analysis/components/statistics-card.vue b/pingan/src/views/home/analysis/components/statistics-card.vue index b044354..7b216e0 100644 --- a/pingan/src/views/home/analysis/components/statistics-card.vue +++ b/pingan/src/views/home/analysis/components/statistics-card.vue @@ -5,99 +5,33 @@ -
¥ 126,560
-
- - 周同比12% - - - - 日同比11% - - -
- -
日销售额 ¥12,423
-
- - - - -
8,846
-
- -
+
101条
-
日访问量 1,234
+
累计线索:100000条
-
6,560
-
- -
+
2323人
-
转化率 60%
-
-
- - - -
78%
-
- -
- -
- - 周同比12% - - - - 日同比11% - - -
+
历史成交:100000单
@@ -108,14 +42,13 @@ import { CanvasRenderer } from 'echarts/renderers'; import { LineChart, BarChart } from 'echarts/charts'; import { GridComponent, TooltipComponent } from 'echarts/components'; - import VChart from 'vue-echarts'; import { getPayNumList } from '@/api/dashboard/analysis'; import { echartsMixin } from '@/utils/echarts-mixin'; use([CanvasRenderer, LineChart, BarChart, GridComponent, TooltipComponent]); export default { - components: { VChart }, + components: {}, mixins: [echartsMixin(['visitChart', 'payNumChart'])], data() { return { diff --git a/pingan/src/views/home/analysis/components/visit-hour.vue b/pingan/src/views/home/analysis/components/visit-hour.vue deleted file mode 100644 index 9fd61df..0000000 --- a/pingan/src/views/home/analysis/components/visit-hour.vue +++ /dev/null @@ -1,103 +0,0 @@ - - - diff --git a/pingan/src/views/home/analysis/index.vue b/pingan/src/views/home/analysis/index.vue index a635250..1b63bcc 100644 --- a/pingan/src/views/home/analysis/index.vue +++ b/pingan/src/views/home/analysis/index.vue @@ -1,37 +1,33 @@ + +