feat: 内容稿件列表相关接口对接
This commit is contained in:
@ -63,15 +63,8 @@ export default {
|
||||
AMessage.error('最多只能上传18张图片!');
|
||||
return;
|
||||
}
|
||||
const newFile = {
|
||||
id: Date.now(),
|
||||
name: file.name,
|
||||
url: URL.createObjectURL(file),
|
||||
size: file.size,
|
||||
type: file.type,
|
||||
};
|
||||
|
||||
props.modelValue.files.push(newFile);
|
||||
props.modelValue.files.push(URL.createObjectURL(file));
|
||||
emit('change');
|
||||
};
|
||||
|
||||
@ -79,7 +72,6 @@ export default {
|
||||
const handleDeleteFile = (index) => {
|
||||
props.modelValue.files.splice(index, 1);
|
||||
emit('change');
|
||||
AMessage.success('删除成功!');
|
||||
};
|
||||
|
||||
// 获取项目列表
|
||||
@ -136,12 +128,14 @@ export default {
|
||||
placeholder="请输入标题"
|
||||
size="large"
|
||||
class="!w-500px"
|
||||
maxLength={30}
|
||||
show-word-limit
|
||||
/>
|
||||
</FormItem>
|
||||
|
||||
<FormItem label="作品描述" field="desc">
|
||||
<Textarea
|
||||
v-model={props.modelValue.desc}
|
||||
v-model={props.modelValue.content}
|
||||
onChange={() => emit('change')}
|
||||
placeholder="请输入作品描述"
|
||||
size="large"
|
||||
@ -158,8 +152,8 @@ export default {
|
||||
label: () => (
|
||||
<div class="flex items-center">
|
||||
<span class="cts !color-#211F24 mr-4px">图片</span>
|
||||
<span class="cts mr-8px">{`(${props.modelValue.files?.length ?? 0}/18)`}</span>
|
||||
<span class="cts">第一张为首图,支持拖拽排序</span>
|
||||
<span class="cts mr-8px !color-#939499">{`(${props.modelValue.files?.length ?? 0}/18)`}</span>
|
||||
<span class="cts !color-#939499">第一张为首图,支持拖拽排序</span>
|
||||
</div>
|
||||
),
|
||||
}}
|
||||
@ -169,12 +163,8 @@ export default {
|
||||
{/* 已上传的图片列表 */}
|
||||
<VueDraggable v-model={props.modelValue.files} class="grid grid-cols-7 gap-8px">
|
||||
{props.modelValue.files?.map((file, index) => (
|
||||
<div key={file.id} class="group relative cursor-move">
|
||||
<img
|
||||
src={file.url}
|
||||
alt={file.name}
|
||||
class="w-100px h-100px object-cover rounded-8px border-1px border-#E6E6E8"
|
||||
/>
|
||||
<div key={index} class="group relative cursor-move">
|
||||
<img src={file} class="w-100px h-100px object-cover rounded-8px border-1px border-#E6E6E8" />
|
||||
<img
|
||||
src={icon1}
|
||||
width={16}
|
||||
|
||||
Reference in New Issue
Block a user