update:保存功能优化

This commit is contained in:
du.meimei
2025-03-17 13:11:36 +08:00
parent 97062309b0
commit 0c98a27c74
5 changed files with 27 additions and 13 deletions

View File

@@ -89,7 +89,7 @@
</div>
</a-form>
<a-button type="primary" class="custom-button mr-12" @click="toCreate">
<span>添加投放</span>
<span> + 新增投放</span>
</a-button>
</div>
</div>
@@ -131,7 +131,7 @@
>查看</a>
<a @click="handleCopy(record)" style="margin-right: 10px">复制</a>
<a @click="delClick(record)"
:class="{ disabled: [3,4].includes(record.taskProgress) }">取消投放</a>
:class="{ disabled: ![3,4].includes(record.taskProgress) }">取消投放</a>
</template>
</a-table>
</div>

View File

@@ -24,7 +24,7 @@
</div>
</a-form>
<a-table class="table" :dataSource="dataSource" :columns="columns"
:row-selection="rowSelection">
:row-selection="rowSelection" :pagination="false" >
<template #contactPerson="{ record }">
<div>
{{ record.contactPerson }} ({{ record.contactPersonCode }})
@@ -78,11 +78,12 @@ const columns = ref([
const init = () => {
console.log('init');
dataSource.value = [];
visible.value = true;
getContactList();
};
const onSubmit = () => {
visible.value = true;
init()
};
const handleOk = () => {
// 获取选中的数据
@@ -109,16 +110,20 @@ defineExpose({
});
const cancel = () => {
formState.value = {
appName: '',
appId: ''
}
getContactList()
};
// 获取触点列表数据
const getContactList = async () => {
try {
const res = await getTeamSigns({
// TODO
"findType": "NODE",
"parentAppId": props.channel.appId
"parentAppId": props.channel.appId,
...formState.value
// "parentAppId": ''
});
dataSource.value = res.data;

View File

@@ -168,6 +168,11 @@ async function submitData() {
dataSource.value.forEach(item=>{
appId.push(item.appId)
})
if (appId.length === 0){
message.error('请选择投放应用')
return
}
let params ={
...formState.value,
appId,

View File

@@ -77,7 +77,7 @@ const getDetail = async (id) => {
if (res.data) {
// 填充表单数据
formState.value = {
name: res.data.launchName,
launchName: res.data.launchName,
launchMessage: res.data.launchMessage
};
// 如果有链接,显示链接相关内容
@@ -108,7 +108,7 @@ onMounted(() => {
});
const rules = {
name: [
launchName: [
{
required: true,
message: '请填写投放名称',
@@ -130,7 +130,6 @@ const dataSource = ref([]);
* 下一步
*/
const nextStep = () => {
isHasLink.value = true
formRef.value.validate().then(() => {
console.log('values', formState);
submitData()
@@ -142,17 +141,21 @@ async function submitData(){
try {
let params = {
...formState.value,
"publishSn": route.query.sn
"publishSn": route.query.sn,
appId:[props.channel.appId]
}
const res = await savePublish(params);
console.log(res);
if(res.code === 0) {
message.success('提交成功');
res.data.
isHasLink.value = true
} else {
isHasLink.value = false
message.error(res.msg || '提交失败');
}
} catch(error) {
isHasLink.value = false
console.error('提交失败:', error);
message.error('提交失败');
}

View File

@@ -11,7 +11,7 @@
<a-form-item label="投放描述" name="launchMessage">
<a-textarea v-model:value="formState.launchMessage" :rows="4" placeholder="请输入投放描述"/>
</a-form-item>
<a-form-item label="投放触点" v-if="channel === 2">
<a-form-item label="投放触点" v-if="channel.appId === 'YIP'">
<a-radio-group v-model:value="formState.resource">
<a-radio v-for="(item,index) in applicationList" :key="index" :value="item.value">{{ item.label }}</a-radio>
</a-radio-group>
@@ -78,7 +78,8 @@ async function submitData(){
try {
let params = {
...formState.value,
"publishSn": route.query.sn
"publishSn": route.query.sn,
appId:[props.channel.appId]
}
const res = await savePublish(params);
if(res.code === 200) {