Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: cloud file support in fms #92

Merged
merged 5 commits into from
Sep 3, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feat: add provider select in cloud file upload
suyuan32 committed Sep 3, 2023

Verified

This commit was signed with the committer’s verified signature.
pradyunsg Pradyun Gedam
commit 418d21088a6618fdbe6098eb7702c36491e19e5c
27 changes: 25 additions & 2 deletions src/views/fms/cloudFile/index.vue
Original file line number Diff line number Diff line change
@@ -13,12 +13,22 @@
</Button>
</template>
<template #toolbar>
<span>{{ t('fms.cloudFile.providerId') }}</span>
<ApiSelect
v-bind:api="getStorageProviderList"
:params="{ page: 1, pageSize: 1000 }"
result-field="data.data"
label-field="name"
value-field="name"
class="w-32"
v-model:value="providerName"
/>
<BasicUpload
:maxSize="1000"
:maxNumber="10"
@change="handleChange"
:api="uploadApi"
:upload-params="{ provider: 'tencent-1' }"
:upload-params="providerParams"
class="my-5"
:accept="['image/*', 'video/*', 'audio/*']"
/>
@@ -97,7 +107,7 @@
</div>
</template>
<script lang="ts">
import { createVNode, defineComponent, ref } from 'vue';
import { computed, createVNode, defineComponent, ref } from 'vue';
import { Image, Modal } from 'ant-design-vue';

import { BasicTable, useTable, TableAction } from '/@/components/Table';
@@ -113,6 +123,8 @@
import { deleteCloudFile, getCloudFileList, uploadApi } from '/@/api/fms/cloudFile';
import { ExclamationCircleOutlined } from '@ant-design/icons-vue/lib/icons';
import { Button } from '/@/components/Button';
import { ApiSelect } from '/@/components/Form';
import { getStorageProviderList } from '/@/api/fms/storageProvider';

export default defineComponent({
name: 'CloudFileManagement',
@@ -124,13 +136,21 @@
BasicUpload,
Image,
Modal,
ApiSelect,
},
setup() {
const { t } = useI18n();
const { toClipboard } = useClipboard();
const { createErrorModal, createMessage } = useMessage();
const showDeleteButton = ref<boolean>(false);
const selectedIds = ref<number[] | string[]>();
const providerName = ref<string>('');

const providerParams = computed(() => {
return {
provider: providerName.value,
};
});

const [registerDrawer, { openDrawer }] = useDrawer();
const [registerTable, { reload }] = useTable({
@@ -280,6 +300,8 @@
handleEdit,
handleDelete,
handleSuccess,
providerName,
providerParams,
handleDownload,
handleChange: (list: string[]) => {
// createMessage.info(`已上传文件${JSON.stringify(list)}`);
@@ -301,6 +323,7 @@
handleCopyToClipboard,
handleBatchDelete,
showDeleteButton,
getStorageProviderList,
};
},
});
2 changes: 1 addition & 1 deletion src/views/fms/storageProvider/storageProvider.data.ts
Original file line number Diff line number Diff line change
@@ -121,7 +121,7 @@ export const formSchema: FormSchema[] = [
componentProps: {
options: [
{ label: t('mcms.smsProvider.tencent'), value: 'tencent' },
{ label: t('mcms.smsProvider.aliyun'), value: 'aliyun' },
// { label: t('mcms.smsProvider.aliyun'), value: 'aliyun' },
],
},
required: true,