feat: 内容稿件审核列表
This commit is contained in:
@ -12,7 +12,7 @@ import {
|
||||
} from '@arco-design/web-vue';
|
||||
import CommonSelect from '@/components/common-select';
|
||||
import TextOverTips from '@/components/text-over-tips';
|
||||
import ShareModal from './share-modal';
|
||||
import ShareModal from '@/views/creative-generation-workshop/manuscript/components/share-manuscript-modal/share-modal';
|
||||
|
||||
import { INITIAL_FORM, TABLE_COLUMNS } from './constants';
|
||||
import { formatTableField, exactFormatTime } from '@/utils/tools';
|
||||
@ -116,7 +116,7 @@ export default {
|
||||
};
|
||||
|
||||
const onShare = () => {
|
||||
shareModalRef.value?.open();
|
||||
shareModalRef.value?.open(selectedRowKeys.value);
|
||||
};
|
||||
const handleSorterChange = (column, order) => {
|
||||
query.value.sort_column = column;
|
||||
@ -145,13 +145,13 @@ export default {
|
||||
已选择 <span class="cts color-#211F24 bold">{selectedRows.value.length}</span> 个
|
||||
</p>
|
||||
<div class="flex items-center">
|
||||
<Button size="large" onClick={onClose}>
|
||||
<Button size="medium" onClick={onClose}>
|
||||
取消
|
||||
</Button>
|
||||
<Button
|
||||
type="primary"
|
||||
class="ml-16px"
|
||||
size="large"
|
||||
size="medium"
|
||||
onClick={onShare}
|
||||
disabled={!selectedRows.value.length}
|
||||
>
|
||||
|
||||
@ -3,11 +3,12 @@ import { Modal, Form, FormItem, Input, Button, Message as AMessage } from '@arco
|
||||
import CommonSelect from '@/components/common-select';
|
||||
|
||||
import { useClipboard } from '@vueuse/core';
|
||||
import { postShareLinksGenerate } from '@/api/all/generationWorkshop';
|
||||
|
||||
const INITIAL_FORM = {
|
||||
link: '',
|
||||
data: 1,
|
||||
target: '',
|
||||
work_ids: [],
|
||||
days: 1,
|
||||
receiver: '',
|
||||
};
|
||||
const OPTIONS = [
|
||||
{
|
||||
@ -42,10 +43,12 @@ export default {
|
||||
const visible = ref(false);
|
||||
const formRef = ref(null);
|
||||
const formData = ref(cloneDeep(INITIAL_FORM));
|
||||
const loading = ref(false);
|
||||
|
||||
const { copy } = useClipboard({ source: formData.value.link });
|
||||
|
||||
const reset = () => {
|
||||
loading.value = false;
|
||||
formData.value = cloneDeep(INITIAL_FORM);
|
||||
formRef.value?.resetFields?.();
|
||||
formRef.value?.clearValidate?.();
|
||||
@ -56,13 +59,22 @@ export default {
|
||||
reset();
|
||||
};
|
||||
|
||||
const onCopy = () => {
|
||||
onClose();
|
||||
copy(formData.value.link);
|
||||
AMessage.success('复制成功!');
|
||||
emit('close');
|
||||
const onGenerateLink = async () => {
|
||||
try {
|
||||
loading.value = true;
|
||||
const { code, data } = await postShareLinksGenerate(formData.value);
|
||||
if (!code) {
|
||||
onClose();
|
||||
copy(data.code);
|
||||
AMessage.success('复制成功!');
|
||||
emit('close');
|
||||
}
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
};
|
||||
const open = () => {
|
||||
const open = (workIds) => {
|
||||
formData.value.work_ids = workIds;
|
||||
visible.value = true;
|
||||
};
|
||||
|
||||
@ -79,23 +91,20 @@ export default {
|
||||
v-slots={{
|
||||
footer: () => (
|
||||
<>
|
||||
<Button size="large" onClick={onClose}>
|
||||
<Button size="medium" onClick={onClose}>
|
||||
取消
|
||||
</Button>
|
||||
<Button type="primary" class="ml-16px" size="large" onClick={onCopy}>
|
||||
复制链接
|
||||
<Button type="primary" class="ml-16px" size="medium" onClick={onGenerateLink} disabled={loading.value}>
|
||||
{loading.value ? '生成中...' : '生成链接'}
|
||||
</Button>
|
||||
</>
|
||||
),
|
||||
}}
|
||||
>
|
||||
<Form ref={formRef} model={formData.value} auto-label-width>
|
||||
<FormItem label="分享地址" prop="link">
|
||||
<Input v-model={formData.value.link} size="large" placeholder="请输入分享地址" />
|
||||
</FormItem>
|
||||
<FormItem label="有效期" prop="data">
|
||||
<FormItem label="有效期" prop="days">
|
||||
<CommonSelect
|
||||
v-model={formData.value.data}
|
||||
v-model={formData.value.days}
|
||||
options={OPTIONS}
|
||||
multiple={false}
|
||||
placeholder="请选择有效期"
|
||||
@ -104,8 +113,8 @@ export default {
|
||||
allClear={false}
|
||||
/>
|
||||
</FormItem>
|
||||
<FormItem label="分享对象" prop="target">
|
||||
<Input v-model={formData.value.target} class="!w-240px" size="large" placeholder="请输入分享对象" />
|
||||
<FormItem label="分享对象" prop="receiver">
|
||||
<Input v-model={formData.value.receiver} class="!w-240px" size="large" placeholder="请输入分享对象" />
|
||||
</FormItem>
|
||||
</Form>
|
||||
</Modal>
|
||||
|
||||
Reference in New Issue
Block a user