|
@@ -26,13 +26,15 @@ const props = defineProps({
|
|
required: true,
|
|
required: true,
|
|
},
|
|
},
|
|
});
|
|
});
|
|
-const emits = defineEmits(['update:modelValue', 'confirmSuccess']);
|
|
|
|
|
|
+const emits = defineEmits([ 'confirmSuccess']);
|
|
const shopInfo = useShopInfo();
|
|
const shopInfo = useShopInfo();
|
|
const { profile } = storeToRefs(shopInfo);
|
|
const { profile } = storeToRefs(shopInfo);
|
|
const { templateId } = toRefs(props);
|
|
const { templateId } = toRefs(props);
|
|
const { activeModel } = toRefs(props);
|
|
const { activeModel } = toRefs(props);
|
|
|
|
|
|
-const dialogVisible = ref(false);
|
|
|
|
|
|
+// const dialogVisible = ref(false);
|
|
|
|
+const dialogVisible = defineModel({ default: false });
|
|
|
|
+
|
|
const targetRuleDialogVisible = ref(false);
|
|
const targetRuleDialogVisible = ref(false);
|
|
|
|
|
|
// 定向规则
|
|
// 定向规则
|
|
@@ -154,6 +156,7 @@ async function fetchAdCampaign() {
|
|
try {
|
|
try {
|
|
loading.value = true;
|
|
loading.value = true;
|
|
const cachedSelectedAds = [...selectedAds.value];
|
|
const cachedSelectedAds = [...selectedAds.value];
|
|
|
|
+ if (profile.value.profile_id && templateId.value){
|
|
const resp = await getRelationCampaign({
|
|
const resp = await getRelationCampaign({
|
|
profileId: profile.value.profile_id,
|
|
profileId: profile.value.profile_id,
|
|
templateId: templateId.value,
|
|
templateId: templateId.value,
|
|
@@ -167,6 +170,7 @@ async function fetchAdCampaign() {
|
|
gridOptions.data = resp.data;
|
|
gridOptions.data = resp.data;
|
|
total.value = resp.total;
|
|
total.value = resp.total;
|
|
currentPage.value = resp.page;
|
|
currentPage.value = resp.page;
|
|
|
|
+ }
|
|
} catch (error) {
|
|
} catch (error) {
|
|
ElMessage.error('请求广告活动数据失败');
|
|
ElMessage.error('请求广告活动数据失败');
|
|
} finally {
|
|
} finally {
|
|
@@ -472,18 +476,18 @@ watch(selectedStatus, () => {
|
|
fetchAdCampaign();
|
|
fetchAdCampaign();
|
|
});
|
|
});
|
|
|
|
|
|
-watch(templateId, () => {
|
|
|
|
- fetchAdCampaign();
|
|
|
|
- fetchAdGroupList();
|
|
|
|
-});
|
|
|
|
|
|
+// watch(templateId, () => {
|
|
|
|
+// fetchAdCampaign();
|
|
|
|
+// fetchAdGroupList();
|
|
|
|
+// });
|
|
|
|
|
|
-watch(() => props.modelValue, (newValue) => {
|
|
|
|
- dialogVisible.value = newValue;
|
|
|
|
-});
|
|
|
|
|
|
+// watch(() => props.modelValue, (newValue) => {
|
|
|
|
+// dialogVisible.value = newValue;
|
|
|
|
+// });
|
|
|
|
|
|
-watch(dialogVisible, (newValue) => {
|
|
|
|
- emits('update:modelValue', newValue);
|
|
|
|
-});
|
|
|
|
|
|
+// watch(dialogVisible, (newValue) => {
|
|
|
|
+// // emits('update:modelValue', newValue);
|
|
|
|
+// });
|
|
|
|
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
fetchAdGroupList();
|
|
fetchAdGroupList();
|