Fan 1 maand geleden
bovenliggende
commit
12d6a1b395

+ 4 - 1
ui/smarttrade-platform/src/components/addMarketing.vue

@@ -293,7 +293,7 @@
                             <div class="source-item" v-for="(item, index) in sourceData">
                                 <span class="source-label">{{ item.sourceLabel }}</span>
                                 <div class="source-bar">
-                                    <div class="source-fill" :style="{ width: item.ratio + '%', background: sourceColor[index] }"></div>
+                                    <div class="source-fill" :style="{ width: item.ratio + '%', background: randomColor() }"></div>
                                 </div>
                                 <span class="source-value">{{ item.ratio }}%</span>
                             </div>
@@ -1180,6 +1180,9 @@
     }
 
     const sourceColor = ['#6366F1', '#F59E0B', '#10B981', '#EF4444', '#3B82F6', '#8B5CF6', '#F43F5E', '#14B8A6', '#F97316', '#EAB308']
+    const randomColor = () => {
+        return sourceColor[Math.floor(Math.random() * sourceColor.length)]
+    }
     const getSource = () => {
         let params = {
             idList: customerList.value.map(item => item.id).join(',')

+ 1 - 1
ui/smarttrade-platform/src/views/MarketingView.vue

@@ -911,7 +911,7 @@ const aiGeneratorRef = ref()
 const openAIGenerator = (campaign) => {
   let time = campaign.updateTime || campaign.createTime
   // time跟当前时间比,小于20分钟的话,暂时不让操作
-  if (new Date().getTime() - new Date(time).getTime() < 2 * 60 * 1000) {
+  if (new Date().getTime() - new Date(time).getTime() < 20 * 60 * 1000) {
     ElMessage.error('邮件正在生成中,请稍后操作')
     return
   }