浏览代码

Merge remote-tracking branch 'origin/test' into test

xinyan 1 年之前
父节点
当前提交
b337e7b360

+ 27 - 27
src/views/adManage/sp/campaigns/campaignDetail/automation/index.vue

@@ -27,33 +27,33 @@
       </template>
       <SwitchCampaign :data="baseData" :RuleStatusButton="RuleStatusButton" @refresh="refresh(3)" v-if="activeTab === 3" />
     </el-tab-pane>
-    <!--<el-tab-pane label="定向规则" :name="4">-->
-    <!--  <template #label>-->
-    <!--    <div class="tab-label">-->
-    <!--      <el-switch size="small" v-model="RuleStatusButton['4']" :disabled="RuleStatusButton['4'] === '-'"></el-switch>-->
-    <!--      <span>定向规则</span>-->
-    <!--    </div>-->
-    <!--  </template>-->
-    <!--  <TargetRule :data="baseData" :RuleStatusButton="RuleStatusButton" @refresh="refresh(4)" v-if="activeTab === 4"></TargetRule>-->
-    <!--</el-tab-pane>-->
-    <!--<el-tab-pane label="添加搜索词" :name="5">-->
-    <!--  <template #label>-->
-    <!--    <div class="tab-label">-->
-    <!--      <el-switch size="small" v-model="RuleStatusButton['5']" :disabled="RuleStatusButton['5'] === '-'"></el-switch>-->
-    <!--      <span>添加搜索词</span>-->
-    <!--    </div>-->
-    <!--  </template>-->
-    <!--  <SearchTermRule :data="baseData" :RuleStatusButton="RuleStatusButton" @refresh="refresh(5)" v-if="activeTab === 5"></SearchTermRule>-->
-    <!--</el-tab-pane>-->
-    <!--<el-tab-pane label="添加否定词" :name="6">-->
-    <!--  <template #label>-->
-    <!--    <div class="tab-label">-->
-    <!--      <el-switch size="small" v-model="RuleStatusButton['6']" :disabled="RuleStatusButton['6'] === '-'"></el-switch>-->
-    <!--      <span>添加否定词</span>-->
-    <!--    </div>-->
-    <!--  </template>-->
-    <!--  <NegKeywordRule :data="baseData" :RuleStatusButton="RuleStatusButton" @refresh="refresh(6)" v-if="activeTab === 6"></NegKeywordRule>-->
-    <!--</el-tab-pane>-->
+    <el-tab-pane label="定向规则" :name="4">
+      <template #label>
+        <div class="tab-label">
+          <el-switch size="small" v-model="RuleStatusButton['4']" :disabled="RuleStatusButton['4'] === '-'"></el-switch>
+          <span>定向规则</span>
+        </div>
+      </template>
+      <TargetRule :data="baseData" :RuleStatusButton="RuleStatusButton" @refresh="refresh(4)" v-if="activeTab === 4"></TargetRule>
+    </el-tab-pane>
+    <el-tab-pane label="添加搜索词" :name="5">
+      <template #label>
+        <div class="tab-label">
+          <el-switch size="small" v-model="RuleStatusButton['5']" :disabled="RuleStatusButton['5'] === '-'"></el-switch>
+          <span>添加搜索词</span>
+        </div>
+      </template>
+      <SearchTermRule :data="baseData" :RuleStatusButton="RuleStatusButton" @refresh="refresh(5)" v-if="activeTab === 5"></SearchTermRule>
+    </el-tab-pane>
+    <el-tab-pane label="添加否定词" :name="6">
+      <template #label>
+        <div class="tab-label">
+          <el-switch size="small" v-model="RuleStatusButton['6']" :disabled="RuleStatusButton['6'] === '-'"></el-switch>
+          <span>添加否定词</span>
+        </div>
+      </template>
+      <NegKeywordRule :data="baseData" :RuleStatusButton="RuleStatusButton" @refresh="refresh(6)" v-if="activeTab === 6"></NegKeywordRule>
+    </el-tab-pane>
   </el-tabs>
 </template>
 

+ 3 - 3
src/views/efTools/utils/enum.ts

@@ -2,7 +2,7 @@ export const TemplateType = [
   { label: '分时调价', value: 1 },
   { label: '分时预算', value: 2 },
   { label: '广告活动', value: 3 },
-//   { label: '定向规则', value: 4 },
-//   { label: '添加搜索词', value: 5 },
-//   { label: '添加否定词', value: 6 },
+  { label: '定向规则', value: 4 },
+  { label: '添加搜索词', value: 5 },
+  { label: '添加否定词', value: 6 },
 ]

+ 95 - 15
src/views/productCenter/productAnalysis/components/DateTendency/index.vue

@@ -121,6 +121,23 @@ const option: any = {
       },
       show: true,
     },
+    {
+      id: 3,
+      type: 'value',
+      position: 'right',
+      offset: 90,
+      name: '',
+      splitLine: {
+        show: false,
+      },
+      axisLine: {
+        show: true,
+        lineStyle: {
+          color: '',
+        },
+      },
+      show: true,
+    },
   ],
   series: [
     {
@@ -182,6 +199,28 @@ const option: any = {
         focus: 'series',
       },
     },
+    {
+      id: 3,
+      name: 'NewMetric',
+      type: 'line',
+      encode: {
+        x: 'Name',
+        y: metrics.value[1].metric,  // TODO: 数据源后续需要修改
+      },
+      symbolSize: 6,
+      symbol: 'circle',
+      smooth: true,
+      yAxisIndex: 0, // 假设在默认的y轴上
+      itemStyle: {
+        color: '#1e1e2d',
+        borderColor: '#1e1e2d',
+      },
+      areaStyle: {},
+      emphasis: {
+        focus: 'series',
+      },
+    },
+
   ],
 }
 const loading = ref(true)
@@ -203,30 +242,71 @@ onBeforeUnmount(() => {
   removeResize()
 })
 
+// const initLine = async () => {
+//   chartObj = echarts.init(chartRef.value)
+//   const items = await getDataset()
+//   option.dataset.source = items
+//
+//   XEUtils.arrayEach(option.series, (info: any, index) => {
+//     const color = metrics.value[index].color
+//     info.name = metrics.value[index].label
+//     info.encode.y = metrics.value[index]?.metric
+//     if (info.type === 'bar') {
+//       info.itemStyle.color = color
+//     } else {
+//       info.itemStyle = { color: color, borderColor: color }
+//       info.areaStyle = {
+//         color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
+//           { offset: 0, color: color + '53' },
+//           { offset: 1, color: color + '03' },
+//         ]),
+//       }
+//     }
+//   })
+//   XEUtils.arrayEach(option.yAxis, (info: any, index) => {
+//     info.name = metrics.value[index].label
+//     info.axisLine.lineStyle.color = metrics.value[index].color
+//   })
+//
+//   XEUtils.arrayEach(props.metricEnum, (info) => {
+//     option.legend.selected[info.label] = false
+//   })
+//   for (const info of metrics.value) {
+//     option.legend.selected[info.label] = true
+//   }
+//   // console.log(option)
+//   chartObj.setOption(option)
+//   loading.value = false
+// }
+
 const initLine = async () => {
   chartObj = echarts.init(chartRef.value)
   const items = await getDataset()
   option.dataset.source = items
 
   XEUtils.arrayEach(option.series, (info: any, index) => {
-    const color = metrics.value[index].color
-    info.name = metrics.value[index].label
-    info.encode.y = metrics.value[index].metric
-    if (info.type === 'bar') {
-      info.itemStyle.color = color
-    } else {
-      info.itemStyle = { color: color, borderColor: color }
-      info.areaStyle = {
-        color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
-          { offset: 0, color: color + '53' },
-          { offset: 1, color: color + '03' },
-        ]),
+    if (info.id < 3) { // 确保只处理前3个series
+      const color = metrics.value[index].color
+      info.name = metrics.value[index].label
+      info.encode.y = metrics.value[index]?.metric
+      if (info.type === 'bar') {
+        info.itemStyle.color = color
+      } else {
+        info.itemStyle = { color: color, borderColor: color }
+        info.areaStyle = {
+          color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
+            { offset: 0, color: color + '53' },
+            { offset: 1, color: color + '03' },
+          ]),
+        }
       }
     }
   })
   XEUtils.arrayEach(option.yAxis, (info: any, index) => {
-    info.name = metrics.value[index].label
-    info.axisLine.lineStyle.color = metrics.value[index].color
+    if (index < metrics.value.length) {
+      info.name = metrics.value[index].label
+      info.axisLine.lineStyle.color = metrics.value[index].color
+    }
   })
 
   XEUtils.arrayEach(props.metricEnum, (info) => {
@@ -235,7 +315,7 @@ const initLine = async () => {
   for (const info of metrics.value) {
     option.legend.selected[info.label] = true
   }
-  // console.log(option)
+
   chartObj.setOption(option)
   loading.value = false
 }