feat: 完成用户列表

This commit is contained in:
xlsea
2024-09-12 16:16:38 +08:00
parent 0a62e4dcaa
commit 85f6c31878
19 changed files with 618 additions and 37 deletions

View File

@ -241,7 +241,7 @@ getDataNames();
@reset="resetSearchParams"
@search="getDataByPage"
/>
<TableColumnCheckAlert v-model:columns="checkedRowKeys" />
<TableRowCheckAlert v-model:checked-row-keys="checkedRowKeys" />
<NCard title="代码生成" :bordered="false" size="small" class="sm:flex-1-hidden card-wrapper">
<template #header-extra>
<TableHeaderOperation

View File

@ -34,7 +34,7 @@ const { columns, data, getData, getDataByPage, loading, mobilePagination, search
showTotal: true,
apiParams: {
pageNum: 1,
pageSize: 15,
pageSize: 30,
// if you want to use the searchParams in Form, you need to define the following properties, and the value is null
// the value can not be undefined, otherwise the property in Form will not be reactive
dataName: null,
@ -102,7 +102,7 @@ watch(visible, () => {
@reset="resetSearchParams"
@search="getDataByPage"
/>
<TableColumnCheckAlert v-model:columns="checkedRowKeys" class="mb-16px" />
<TableRowCheckAlert v-model:checked-row-keys="checkedRowKeys" class="mb-16px" />
<NDataTable
v-model:checked-row-keys="checkedRowKeys"
:columns="columns"

View File

@ -1,6 +1,7 @@
<script setup lang="ts">
import { useLoading } from '@sa/hooks';
import { ref, watch } from 'vue';
import { useClipboard } from '@vueuse/core';
import { fetchGetGenPreview } from '@/service/api/tool';
import MonacoEditor from '@/components/common/monaco-editor.vue';
@ -51,6 +52,24 @@ async function handleSubmit() {
emit('submitted');
}
const { copy, isSupported } = useClipboard();
async function handleCopyCode() {
if (!isSupported) {
window.$message?.error('您的浏览器不支持Clipboard API');
return;
}
const code = previewData.value[tab.value];
if (!previewData.value[tab.value]) {
return;
}
await copy(code);
window.$message?.success('代码复制成功');
}
watch(visible, () => {
if (visible.value) {
previewData.value = {};
@ -117,6 +136,14 @@ function getGenLanguage(name: string) {
:language="getGenLanguage(genMap[tab])"
height="calc(100vh - 162px)"
/>
<div class="position-absolute right-42px top-2px">
<NButton text :focusable="false" class="flex-center" @click="handleCopyCode">
<template #icon>
<icon-ep-copy-document class="text-14px" />
</template>
<span>复制</span>
</NButton>
</div>
</div>
</NSpin>
<template #footer>