fix:投放取消投放判断修改

This commit is contained in:
du.meimei
2025-03-19 10:08:41 +08:00
parent 6085fd4a3c
commit 1b411684dd
5 changed files with 42 additions and 19 deletions

View File

@@ -30,9 +30,9 @@
@change="getNode"
allowClear>
<a-select-option
v-for="item in channelList"
v-for="(item,index) in channelList"
:value="item.appId"
:key="item.appId">
:key="index">
{{ item.appName }}
</a-select-option>
</a-select>
@@ -52,12 +52,11 @@
style="border-radius: 4px"
placeholder="请选择投放触点"
allowClear
:not-found-content="fetching ? undefined : null"
>
<a-select-option
v-for="item in nodeList"
v-for="(item,index) in nodeList"
:value="item.appId"
:key="item.appId">
:key="index">
{{ item.appName }}
</a-select-option>
</a-select>
@@ -134,8 +133,10 @@
style="margin-right: 10px"
>查看</a>
<a @click="handleCopy(record)" style="margin-right: 10px">复制</a>
<a @click="delClick(record)"
:class="{ disabled: ![3,4].includes(record.taskProgress) }">取消投放</a>
<a v-if="record.taskProgress === '3' || record.taskProgress === '4'"
@click="delClick(record)"
>取消投放</a>
<a v-else disabled>取消投放</a>
</template>
</a-table>
</div>
@@ -437,7 +438,7 @@ function getNode(){
// nodeList.value = []
// return
// }
ruleForm.value.appId = null
// ruleForm.value.appId = null
let params = {
"pageNum": 1,
"pageSize": 999,
@@ -447,7 +448,7 @@ function getNode(){
}
getNodeList(params).then(res=>{
console.log(res);
nodeList.value.concat( res.data)
nodeList.value = nodeList.value.concat( res.data)
})
}
// 获取投放来源列表

View File

@@ -123,7 +123,8 @@ const getContactList = async () => {
const res = await getTeamSigns({
"findType": "NODE",
"parentAppId": props.channel.appId,
...formState.value
...formState.value,
appType:'APPLICATION'
// "parentAppId": ''
});
dataSource.value = res.data;

View File

@@ -6,10 +6,10 @@
:label-col="labelCol"
:wrapper-col="wrapperCol">
<a-form-item label="投放名称" name="launchName">
<a-input v-model:value="formState.launchName" placeholder="请输入投放名称" :maxlength="30"/>
<a-input v-model:value="formState.launchName" placeholder="请输入投放名称" showCount :maxlength="30"/>
</a-form-item>
<a-form-item label="投放描述" name="launchMessage">
<a-textarea v-model:value="formState.launchMessage" :rows="4" :maxlength="150"
<a-textarea v-model:value="formState.launchMessage" :rows="4" :maxlength="150" showCount
placeholder="请描述您本次投放的需求,包含投放位置、投放时段等,运营会根据您的描述配置投放任务"/>
</a-form-item>
<a-form-item label="投放应用" name="desc">
@@ -71,7 +71,6 @@ const formState = ref({
launchName: '',
launchMessage: ''
});
const isHasLink = ref(false);
const rules = {
launchName: [
@@ -203,7 +202,6 @@ watch(() => props.channel, (newVal) => {
launchMessage: ''
};
dataSource.value = [];
isHasLink.value = false;
}
});
</script>

View File

@@ -36,7 +36,7 @@
</template>
<script setup>
import { defineProps, onMounted, ref, watch } from 'vue';
import { getTeamSigns, savePublish } from '@/api/accurate';
import { getTeamSigns, savePublish,getPublishDetail } from '@/api/accurate';
import { message } from 'ant-design-vue';
import { useRoute,useRouter } from 'vue-router';
const route = useRoute()
@@ -82,6 +82,7 @@ const getContactList = async () => {
const res = await getTeamSigns({
"findType": "NODE",
"parentAppId": props.channel.appId,
appType:'APPLICATION'
});
console.log(res);
applicationList.value = res.data;
@@ -111,7 +112,7 @@ async function submitData(){
window.location.href = res.data.linkUrl;
}
message.success('提交成功');
cancel()
onCancel()
} else {
message.error(res.msg || '提交失败');
}
@@ -131,8 +132,31 @@ watch(() => props.channel, (newVal) => {
if (newVal.appId === 'SHOPPING_GUIDE'){
getContactList()
}
});
// 获取详情数据
const getDetail = async (id) => {
try {
const res = await getPublishDetail({ surveyPublishId: id });
if (res.data) {
// 填充表单数据
formState.value = {
launchName: res.data.launchName,
launchMessage: res.data.launchMessage
};
}
} catch (error) {
console.error('获取详情失败:', error);
}
};
// 组件挂载时检查路由参数
onMounted(() => {
const { record } = route.query;
if (record) {
const recordObj = JSON.parse(decodeURIComponent(record));
if (recordObj.surveyPublishId) {
getDetail(recordObj.surveyPublishId);
}
}
});
</script>
<style scoped lang="scss">

View File

@@ -171,7 +171,6 @@ async function getChannels(page = 1, size = pagination.value.pageSize) {
page,
per_page: size,
app_name: '',
appType:'ACTIVITY'
});
loading.value = false;