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: 附件选择器,如果只有一个结果,自动选中 #666

Merged
merged 2 commits into from
Sep 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
6 changes: 6 additions & 0 deletions CHANGELOG.MD
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

更新日志文档,版本顺序从新到旧,最新版本在最前(上)面。

# 0.15.6

## 新特性

- Console附件选择器,如果只有一个结果,自动选中 #663

# 0.15.5

## 新特性
Expand Down
Original file line number Diff line number Diff line change
@@ -1,35 +1,27 @@
<script setup lang="ts">
import { Attachment } from '@runikaros/api-client';
import { computed, ref, onMounted } from 'vue';
import { apiClient } from '@/utils/api-client';
import { base64Encode, formatFileSize } from '@/utils/string-util';
import {Attachment} from '@runikaros/api-client';
import {computed, onMounted, ref} from 'vue';
import {apiClient} from '@/utils/api-client';
import {base64Encode, formatFileSize} from '@/utils/string-util';
import AttachmentFragmentUploadDrawer from './AttachmentFragmentUploadDrawer.vue';
import AttachmentDirectoryTreeSelect from '@/components/modules/content/attachment/AttachmentDirectoryTreeSelect.vue';
import moment from 'moment';
import { isImage, isVideo, isVoice } from '@/utils/file';
import {isImage, isVideo, isVoice} from '@/utils/file';

import {Document, Film, Folder, Headset, Picture, Search, Upload,} from '@element-plus/icons-vue';
import {
Upload,
Search,
Folder,
Document,
Picture,
Headset,
Film,
} from '@element-plus/icons-vue';
import {
ElRow,
ElCol,
ElInput,
ElPagination,
ElButton,
ElIcon,
ElTable,
ElTableColumn,
ElDialog,
ElFormItem,
ElButton,
ElCol,
ElDialog,
ElFormItem,
ElIcon,
ElInput,
ElPagination,
ElRow,
ElTable,
ElTableColumn,
} from 'element-plus';
import { useI18n } from 'vue-i18n';
import {useI18n} from 'vue-i18n';

const { t } = useI18n();

Expand Down Expand Up @@ -116,7 +108,7 @@ const dateFormat = (row, column) => {
const selectionAttachments = ref<Attachment[]>([]);

const onSelectionChange = (selections) => {
// console.log('selections', selections);
// console.debug('selections', selections);
selectionAttachments.value = selections;
};

Expand All @@ -136,8 +128,16 @@ const onParentDirSelected = async (val) => {
const onSearchNameChange = async () => {
attachmentCondition.value.page = 1;
await fetchAttachments();
if (attachments.value && attachments.value.length == 1) {
// selectionAttachments.value = attachments.value;
// console.debug("selections atts: ", selectionAttachments.value);
// console.debug("attachments atts: ", attachments.value);
attachmentTableRel.value?.toggleAllSelection();
}
};

const attachmentTableRel = ref<InstanceType<typeof ElTable>>();

onMounted(fetchAttachments);
</script>

Expand Down Expand Up @@ -216,6 +216,7 @@ onMounted(fetchAttachments);
<el-row>
<el-col :span="24">
<el-table
ref="attachmentTableRel"
:data="attachments"
style="width: 100%"
row-key="id"
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version=0.15.5
version=0.15.6
Loading