|
@@ -1,57 +1,73 @@
|
|
|
-<template>
|
|
|
- <div>
|
|
|
- <div class="asj-h3">
|
|
|
- <span class="custom-title-icon"></span>
|
|
|
- 设置竞价
|
|
|
- </div>
|
|
|
- <div>关键词竞价:</div>
|
|
|
- <div v-for="(info, index) in action.keywords" class="bid">
|
|
|
- <el-checkbox v-model="info.use" :label="info.matchType">{{ MatchTypeMap[info.matchType] }}</el-checkbox>
|
|
|
- <STBidInput :bid-data="info" :index="index" v-show="info.use"></STBidInput>
|
|
|
- </div>
|
|
|
- <div>商品定向竞价:</div>
|
|
|
- <div class="bid target">
|
|
|
- <el-checkbox label="target" v-model="action.target.use">竞价</el-checkbox>
|
|
|
- <STBidInput :bid-data="action.target" v-show="action.target.use"></STBidInput>
|
|
|
- </div>
|
|
|
- <p v-show="!valid" style="font-size: small; color: #f56c6c">请至少设置一种竞价方式!</p>
|
|
|
- </div>
|
|
|
-</template>
|
|
|
-
|
|
|
<script lang="ts" setup>
|
|
|
-import { ref, onMounted, onBeforeMount, Ref, computed } from 'vue'
|
|
|
-import STBidInput from './st-bid-input.vue'
|
|
|
-import XEUtils from 'xe-utils'
|
|
|
+/**
|
|
|
+ * @Name: search-term-bid.vue
|
|
|
+ * @Description: 自动化-添加搜索词-设置竞价
|
|
|
+ * @Author: Cheney
|
|
|
+ */
|
|
|
+
|
|
|
+import { computed } from 'vue';
|
|
|
+import STBidInput from './st-bid-input.vue';
|
|
|
+import XEUtils from 'xe-utils';
|
|
|
|
|
|
interface Props {
|
|
|
- action: RuleSearchTermAction
|
|
|
+ action: RuleSearchTermAction;
|
|
|
}
|
|
|
-const props = defineProps<Props>()
|
|
|
+
|
|
|
+const props = defineProps<Props>();
|
|
|
const MatchTypeMap = {
|
|
|
EXACT: '精准匹配',
|
|
|
BROAD: '广泛匹配',
|
|
|
PHRASE: '词组匹配',
|
|
|
-}
|
|
|
+};
|
|
|
if (!props.action.keywords) {
|
|
|
props.action.keywords = [
|
|
|
{ bidType: '1', type: 'increase', numType: '1', defaultBidding: '1.00', min: '', max: '', matchType: 'EXACT', use: false },
|
|
|
{ bidType: '1', type: 'increase', numType: '1', defaultBidding: '1.00', min: '', max: '', matchType: 'BROAD', use: false },
|
|
|
{ bidType: '1', type: 'increase', numType: '1', defaultBidding: '1.00', min: '', max: '', matchType: 'PHRASE', use: false },
|
|
|
- ]
|
|
|
+ ];
|
|
|
}
|
|
|
if (!props.action.target) {
|
|
|
- props.action.target = { bidType: '1', type: 'increase', numType: '1', defaultBidding: '1', min: '', max: '', matchType: 'EXACT', use: false }
|
|
|
+ props.action.target = {
|
|
|
+ bidType: '1',
|
|
|
+ type: 'increase',
|
|
|
+ numType: '1',
|
|
|
+ defaultBidding: '1',
|
|
|
+ min: '',
|
|
|
+ max: '',
|
|
|
+ matchType: 'EXACT',
|
|
|
+ use: false,
|
|
|
+ };
|
|
|
}
|
|
|
|
|
|
const valid = computed(() => {
|
|
|
- const index = XEUtils.findIndexOf(props.action.keywords, (item) => item.use)
|
|
|
- if (index !== -1) return true
|
|
|
- return props.action.target.use
|
|
|
-})
|
|
|
+ const index = XEUtils.findIndexOf(props.action.keywords, (item) => item.use);
|
|
|
+ if (index !== -1) return true;
|
|
|
+ return props.action.target.use;
|
|
|
+});
|
|
|
|
|
|
-defineExpose({ valid })
|
|
|
+defineExpose({ valid });
|
|
|
</script>
|
|
|
|
|
|
+<template>
|
|
|
+ <div>
|
|
|
+ <div class="asj-h3">
|
|
|
+ <span class="custom-title-icon"></span>
|
|
|
+ 设置竞价
|
|
|
+ </div>
|
|
|
+ <div>关键词竞价:</div>
|
|
|
+ <div v-for="(info, index) in action.keywords" class="bid">
|
|
|
+ <el-checkbox v-model="info.use" :label="info.matchType">{{ MatchTypeMap[info.matchType] }}</el-checkbox>
|
|
|
+ <STBidInput :bid-data="info" :index="index" v-show="info.use"></STBidInput>
|
|
|
+ </div>
|
|
|
+ <div>商品定向竞价:</div>
|
|
|
+ <div class="bid target">
|
|
|
+ <el-checkbox label="target" v-model="action.target.use">竞价</el-checkbox>
|
|
|
+ <STBidInput :bid-data="action.target" v-show="action.target.use"></STBidInput>
|
|
|
+ </div>
|
|
|
+ <p v-show="!valid" style="font-size: small; color: #f56c6c">请至少设置一种竞价方式!</p>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
<style scoped>
|
|
|
.bid {
|
|
|
display: flex;
|
|
@@ -63,6 +79,7 @@ defineExpose({ valid })
|
|
|
margin-left: 23px;
|
|
|
height: 50px;
|
|
|
}
|
|
|
+
|
|
|
.target {
|
|
|
gap: 49px;
|
|
|
}
|