样式修改

This commit is contained in:
lq
2025-09-26 16:49:17 +08:00
parent 002fa12bc8
commit 2b071f0907

View File

@ -77,13 +77,12 @@
>
{{ item }}
</div>
<div class="flex items-center w-full">
<img
v-for="item in selectedMaterials.images"
:key="item.id"
:src="item.cover"
class="w-88 h-88 mr-8px border-rounded-8px"
/>
<div class="w-full">
<div class="grid grid-cols-4 gap-8px w-full">
<div v-for="(item, index) in selectedMaterials.images" :key="item.id" class="w-88px h-88px">
<img :src="item.cover" class="w-full h-full rounded-8px" />
</div>
</div>
</div>
</div>
<div v-else class="flex flex-col items-center">
@ -118,7 +117,7 @@
/>
</div>
<div class="mb-12px" v-if="selectedProducts.data.length > 0">{{ selectedProducts.data[0].title }}</div>
<div class="mb-12px color-#939499" v-if="selectedProducts.data.length > 0">
<div class="mb-12px color-#939499 line-clamp-2" v-if="selectedProducts.data.length > 0">
{{ selectedProducts.data[0].content }}
</div>
<div v-for="item in selectedProducts.images" :key="item.id">
@ -401,7 +400,7 @@ const handleProductConfirm = async (result) => {
hasChoseFinishedProducts.value = true;
// 取第一个选中的项目
const selectedProduct = result.selectedRows[0];
// 获取成品详情
try {
const res = await getWorkDetail(selectedProduct.id);
@ -411,7 +410,7 @@ const handleProductConfirm = async (result) => {
keys: [workDetail.id],
data: [workDetail],
text: workDetail.title || '1个稿件',
images: workDetail.files ? workDetail.files.filter(f => f.type === 0) : [], // 图片文件
images: workDetail.files ? workDetail.files.filter((f) => f.type === 0) : [], // 图片文件
};
}
} catch (error) {
@ -493,7 +492,7 @@ const showDrawer = (accountInfo = null, selectedDate = null) => {
if (accountInfo && accountInfo.id) {
nextTick(() => {
// 查找账号列表中匹配的账号,包含平台信息和图标
const matchedAccount = accountList.value.find(account => account.value === accountInfo.id);
const matchedAccount = accountList.value.find((account) => account.value === accountInfo.id);
if (matchedAccount) {
localQuery.value.accounts = [matchedAccount.name];
localQuery.value.ids = [accountInfo.id];
@ -505,20 +504,24 @@ const showDrawer = (accountInfo = null, selectedDate = null) => {
localQuery.value.ids = [accountInfo.id];
} else {
// 账号列表尚未加载,等待加载完成后再设置
const unwatch = watch(accountList, (newAccountList) => {
if (newAccountList.length > 0) {
const matched = newAccountList.find(account => account.value === accountInfo.id);
if (matched) {
localQuery.value.accounts = [matched.name];
localQuery.value.ids = [accountInfo.id];
} else {
localQuery.value.accounts = [`${accountInfo.name}(${getPlatformName(accountInfo.platform)})`];
localQuery.value.ids = [accountInfo.id];
const unwatch = watch(
accountList,
(newAccountList) => {
if (newAccountList.length > 0) {
const matched = newAccountList.find((account) => account.value === accountInfo.id);
if (matched) {
localQuery.value.accounts = [matched.name];
localQuery.value.ids = [accountInfo.id];
} else {
localQuery.value.accounts = [`${accountInfo.name}(${getPlatformName(accountInfo.platform)})`];
localQuery.value.ids = [accountInfo.id];
}
// 取消监听
unwatch();
}
// 取消监听
unwatch();
}
}, { immediate: true });
},
{ immediate: true },
);
}
}
});
@ -535,7 +538,7 @@ const showDrawer = (accountInfo = null, selectedDate = null) => {
const fillTaskData = async (taskData) => {
// 如果传入的数据包含完整信息,则直接使用,否则获取详情
let fullTaskData = taskData;
// 如果没有work或raw_materials等详细信息则需要获取完整详情
if ((!taskData.work && !taskData.raw_materials) || taskData.id) {
try {
@ -547,7 +550,7 @@ const fillTaskData = async (taskData) => {
console.error('获取任务详情失败:', error);
}
}
// 设置账号信息
if (fullTaskData.media_account) {
nextTick(() => {
@ -555,15 +558,15 @@ const fillTaskData = async (taskData) => {
localQuery.value.ids = [fullTaskData.media_account.id];
});
}
// 设置AI生成或成品库选择
isActive.value = fullTaskData.is_ai_generate ? 'ai' : 'chose';
// 设置任务描述AI生成时
if (fullTaskData.is_ai_generate && fullTaskData.ai_prompt) {
taskDescription.value = fullTaskData.ai_prompt;
}
// 设置发布时间
if (fullTaskData.publish_type === 1 && fullTaskData.execution_time) {
// 定时发布
@ -575,20 +578,20 @@ const fillTaskData = async (taskData) => {
// 立即发布
publishType.value = 'immediate';
}
// 设置选中的素材AI生成时
if (fullTaskData.is_ai_generate && fullTaskData.raw_materials && fullTaskData.raw_materials.length > 0) {
const materials = fullTaskData.raw_materials;
selectedMaterials.value = {
keys: materials.map(m => m.id),
keys: materials.map((m) => m.id),
data: materials,
text: '',
images: materials.filter(m => m.type === 0), // 图片
texts: materials.filter(m => m.type === 2), // 文本
images: materials.filter((m) => m.type === 0), // 图片
texts: materials.filter((m) => m.type === 2), // 文本
};
hasChoseMaterial.value = materials.length > 0;
}
// 设置选中的成品(成品库选择时)
if (!fullTaskData.is_ai_generate && fullTaskData.work) {
const work = fullTaskData.work;
@ -596,7 +599,7 @@ const fillTaskData = async (taskData) => {
keys: [work.id],
data: [work],
text: work.title || '1个稿件',
images: work.files ? work.files.filter(f => f.type === 0) : [], // 图片文件
images: work.files ? work.files.filter((f) => f.type === 0) : [], // 图片文件
};
hasChoseFinishedProducts.value = true;
}