update:保存功能优化
This commit is contained in:
@@ -89,7 +89,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</a-form>
|
</a-form>
|
||||||
<a-button type="primary" class="custom-button mr-12" @click="toCreate">
|
<a-button type="primary" class="custom-button mr-12" @click="toCreate">
|
||||||
<span>添加投放</span>
|
<span> + 新增投放</span>
|
||||||
</a-button>
|
</a-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -131,7 +131,7 @@
|
|||||||
>查看</a>
|
>查看</a>
|
||||||
<a @click="handleCopy(record)" style="margin-right: 10px">复制</a>
|
<a @click="handleCopy(record)" style="margin-right: 10px">复制</a>
|
||||||
<a @click="delClick(record)"
|
<a @click="delClick(record)"
|
||||||
:class="{ disabled: [3,4].includes(record.taskProgress) }">取消投放</a>
|
:class="{ disabled: ![3,4].includes(record.taskProgress) }">取消投放</a>
|
||||||
</template>
|
</template>
|
||||||
</a-table>
|
</a-table>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</a-form>
|
</a-form>
|
||||||
<a-table class="table" :dataSource="dataSource" :columns="columns"
|
<a-table class="table" :dataSource="dataSource" :columns="columns"
|
||||||
:row-selection="rowSelection">
|
:row-selection="rowSelection" :pagination="false" >
|
||||||
<template #contactPerson="{ record }">
|
<template #contactPerson="{ record }">
|
||||||
<div>
|
<div>
|
||||||
{{ record.contactPerson }} ({{ record.contactPersonCode }})
|
{{ record.contactPerson }} ({{ record.contactPersonCode }})
|
||||||
@@ -78,11 +78,12 @@ const columns = ref([
|
|||||||
|
|
||||||
const init = () => {
|
const init = () => {
|
||||||
console.log('init');
|
console.log('init');
|
||||||
|
dataSource.value = [];
|
||||||
visible.value = true;
|
visible.value = true;
|
||||||
getContactList();
|
getContactList();
|
||||||
};
|
};
|
||||||
const onSubmit = () => {
|
const onSubmit = () => {
|
||||||
visible.value = true;
|
init()
|
||||||
};
|
};
|
||||||
const handleOk = () => {
|
const handleOk = () => {
|
||||||
// 获取选中的数据
|
// 获取选中的数据
|
||||||
@@ -109,16 +110,20 @@ defineExpose({
|
|||||||
});
|
});
|
||||||
|
|
||||||
const cancel = () => {
|
const cancel = () => {
|
||||||
|
formState.value = {
|
||||||
|
appName: '',
|
||||||
|
appId: ''
|
||||||
|
}
|
||||||
|
getContactList()
|
||||||
};
|
};
|
||||||
|
|
||||||
// 获取触点列表数据
|
// 获取触点列表数据
|
||||||
const getContactList = async () => {
|
const getContactList = async () => {
|
||||||
try {
|
try {
|
||||||
const res = await getTeamSigns({
|
const res = await getTeamSigns({
|
||||||
// TODO
|
|
||||||
"findType": "NODE",
|
"findType": "NODE",
|
||||||
"parentAppId": props.channel.appId
|
"parentAppId": props.channel.appId,
|
||||||
|
...formState.value
|
||||||
// "parentAppId": ''
|
// "parentAppId": ''
|
||||||
});
|
});
|
||||||
dataSource.value = res.data;
|
dataSource.value = res.data;
|
||||||
|
|||||||
@@ -168,6 +168,11 @@ async function submitData() {
|
|||||||
dataSource.value.forEach(item=>{
|
dataSource.value.forEach(item=>{
|
||||||
appId.push(item.appId)
|
appId.push(item.appId)
|
||||||
})
|
})
|
||||||
|
if (appId.length === 0){
|
||||||
|
message.error('请选择投放应用')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
let params ={
|
let params ={
|
||||||
...formState.value,
|
...formState.value,
|
||||||
appId,
|
appId,
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ const getDetail = async (id) => {
|
|||||||
if (res.data) {
|
if (res.data) {
|
||||||
// 填充表单数据
|
// 填充表单数据
|
||||||
formState.value = {
|
formState.value = {
|
||||||
name: res.data.launchName,
|
launchName: res.data.launchName,
|
||||||
launchMessage: res.data.launchMessage
|
launchMessage: res.data.launchMessage
|
||||||
};
|
};
|
||||||
// 如果有链接,显示链接相关内容
|
// 如果有链接,显示链接相关内容
|
||||||
@@ -108,7 +108,7 @@ onMounted(() => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const rules = {
|
const rules = {
|
||||||
name: [
|
launchName: [
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
message: '请填写投放名称',
|
message: '请填写投放名称',
|
||||||
@@ -130,7 +130,6 @@ const dataSource = ref([]);
|
|||||||
* 下一步
|
* 下一步
|
||||||
*/
|
*/
|
||||||
const nextStep = () => {
|
const nextStep = () => {
|
||||||
isHasLink.value = true
|
|
||||||
formRef.value.validate().then(() => {
|
formRef.value.validate().then(() => {
|
||||||
console.log('values', formState);
|
console.log('values', formState);
|
||||||
submitData()
|
submitData()
|
||||||
@@ -142,17 +141,21 @@ async function submitData(){
|
|||||||
try {
|
try {
|
||||||
let params = {
|
let params = {
|
||||||
...formState.value,
|
...formState.value,
|
||||||
"publishSn": route.query.sn
|
"publishSn": route.query.sn,
|
||||||
|
appId:[props.channel.appId]
|
||||||
}
|
}
|
||||||
const res = await savePublish(params);
|
const res = await savePublish(params);
|
||||||
|
console.log(res);
|
||||||
if(res.code === 0) {
|
if(res.code === 0) {
|
||||||
message.success('提交成功');
|
message.success('提交成功');
|
||||||
res.data.
|
res.data.
|
||||||
isHasLink.value = true
|
isHasLink.value = true
|
||||||
} else {
|
} else {
|
||||||
|
isHasLink.value = false
|
||||||
message.error(res.msg || '提交失败');
|
message.error(res.msg || '提交失败');
|
||||||
}
|
}
|
||||||
} catch(error) {
|
} catch(error) {
|
||||||
|
isHasLink.value = false
|
||||||
console.error('提交失败:', error);
|
console.error('提交失败:', error);
|
||||||
message.error('提交失败');
|
message.error('提交失败');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
<a-form-item label="投放描述" name="launchMessage">
|
<a-form-item label="投放描述" name="launchMessage">
|
||||||
<a-textarea v-model:value="formState.launchMessage" :rows="4" placeholder="请输入投放描述"/>
|
<a-textarea v-model:value="formState.launchMessage" :rows="4" placeholder="请输入投放描述"/>
|
||||||
</a-form-item>
|
</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-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 v-for="(item,index) in applicationList" :key="index" :value="item.value">{{ item.label }}</a-radio>
|
||||||
</a-radio-group>
|
</a-radio-group>
|
||||||
@@ -78,7 +78,8 @@ async function submitData(){
|
|||||||
try {
|
try {
|
||||||
let params = {
|
let params = {
|
||||||
...formState.value,
|
...formState.value,
|
||||||
"publishSn": route.query.sn
|
"publishSn": route.query.sn,
|
||||||
|
appId:[props.channel.appId]
|
||||||
}
|
}
|
||||||
const res = await savePublish(params);
|
const res = await savePublish(params);
|
||||||
if(res.code === 200) {
|
if(res.code === 200) {
|
||||||
|
|||||||
Reference in New Issue
Block a user