fix:修复渠道复制问题
This commit is contained in:
@@ -41,10 +41,7 @@ const getDetail = async (surveyPublishId) => {
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
const { record, surveyPublishId } = route.query
|
||||
// if (record) {
|
||||
// handleRecordData(record)
|
||||
// } else
|
||||
const { surveyPublishId } = route.query
|
||||
if (surveyPublishId) {
|
||||
getDetail(surveyPublishId)
|
||||
}
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
:class="{'active_channel':channel.appId === active,
|
||||
'disabled': isDisabled(channel.appCategory)}"
|
||||
class="flex"
|
||||
|
||||
:key="index"
|
||||
@click="selectChannel(channel,index)">
|
||||
<div>
|
||||
|
||||
@@ -244,7 +244,7 @@ const cancel = () => {
|
||||
|
||||
// 监听 channel 变化
|
||||
watch(() => props.channel, (newVal) => {
|
||||
if (!route.query.record) {
|
||||
if (!route.query.surveyPublishId) {
|
||||
formState.value = {
|
||||
launchName: '',
|
||||
launchMessage: ''
|
||||
|
||||
@@ -220,7 +220,7 @@ watch(() => props.channel, (newVal) => {
|
||||
console.log('watch channel change:', newVal);
|
||||
isHasLink.value = false;
|
||||
// 只有在没有 record 参数时才重置表单
|
||||
if (!route.query.record) {
|
||||
if (!route.query.surveyPublishId) {
|
||||
formState.value = {
|
||||
launchName: '',
|
||||
launchMessage: ''
|
||||
@@ -236,6 +236,7 @@ onMounted(() => {
|
||||
getDetail(surveyPublishId);
|
||||
}
|
||||
});
|
||||
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
.mr-12{
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
class="custom-button mr-12"
|
||||
@click="onSubmit"
|
||||
:loading="submitLoading"
|
||||
:disabled="!formState.launchName ||!formState.launchMessage">
|
||||
:disabled="!formState.launchName ||!formState.launchMessage ">
|
||||
<span>去配置</span>
|
||||
</a-button>
|
||||
<a-button class="custom-button mr-12" @click="onCancel" style="width: 98px;">
|
||||
@@ -104,8 +104,10 @@ const getContactList = async () => {
|
||||
appType:'APPLICATION'
|
||||
});
|
||||
applicationList.value = res.data;
|
||||
if (applicationList.value.length){
|
||||
formState.value.appId = formState.value.appId?formState.value.appId:applicationList.value[0].appId
|
||||
if (!route.query.surveyPublishId) {
|
||||
if (applicationList.value.length){
|
||||
formState.value.appId = formState.value.appId?formState.value.appId:applicationList.value[0].appId
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('获取触点列表失败:', error);
|
||||
@@ -160,20 +162,10 @@ async function submitData(){
|
||||
const onCancel = () => {
|
||||
router.go(-1)
|
||||
};
|
||||
// 监听 channel 变化
|
||||
watch(() => props.channel, (newVal) => {
|
||||
if (!route.query.record) {
|
||||
formState.value = {
|
||||
launchName: '',
|
||||
launchMessage: ''
|
||||
};
|
||||
}
|
||||
if (newVal.appId === 'SHOPPING_GUIDE'){
|
||||
getContactList()
|
||||
}
|
||||
});
|
||||
|
||||
// 获取详情数据
|
||||
const getDetail = async (id) => {
|
||||
console.log('getDetail');
|
||||
try {
|
||||
const res = await getPublishDetail({ surveyPublishId: id });
|
||||
if (res.data) {
|
||||
@@ -183,13 +175,28 @@ const getDetail = async (id) => {
|
||||
launchMessage: res.data.launchMessage,
|
||||
appId: res.data.appId,
|
||||
};
|
||||
if (res.data.appCategory !== 'SHOPPING_GUIDE'){
|
||||
formState.value.appId = ''
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('获取详情失败:', error);
|
||||
}
|
||||
};
|
||||
// 监听 channel 变化
|
||||
watch(() => props.channel, (newVal) => {
|
||||
if (!route.query.surveyPublishId) {
|
||||
formState.value.launchName = '';
|
||||
formState.value.launchMessage = ''
|
||||
formState.value.appId= ''
|
||||
}
|
||||
if (newVal.appId === 'SHOPPING_GUIDE'){
|
||||
getContactList()
|
||||
}
|
||||
});
|
||||
// 组件挂载时检查路由参数
|
||||
onMounted(() => {
|
||||
console.log('onMounted');
|
||||
getContactList()
|
||||
const { surveyPublishId } = route.query;
|
||||
if (surveyPublishId) {
|
||||
|
||||
Reference in New Issue
Block a user