|
@@ -8,7 +8,8 @@ import {
|
|
|
NImage,
|
|
|
NModal,
|
|
|
NSelect,
|
|
|
- NSpace
|
|
|
+ NSpace,
|
|
|
+ useMessage
|
|
|
} from 'naive-ui';
|
|
|
import SearchInput from '@/components/searchInput';
|
|
|
import CSelect from '@/components/CSelect';
|
|
@@ -49,6 +50,7 @@ export default defineComponent({
|
|
|
const route = useRoute();
|
|
|
const router = useRouter();
|
|
|
const showGuide = ref(false);
|
|
|
+ const message = useMessage()
|
|
|
const search = () => {
|
|
|
state.pagination.page = 1;
|
|
|
getList();
|
|
@@ -66,6 +68,17 @@ export default defineComponent({
|
|
|
console.log(e);
|
|
|
}
|
|
|
};
|
|
|
+
|
|
|
+ const copyTo = (text: string) => {
|
|
|
+ const input = document.createElement('input');
|
|
|
+ input.value = text;
|
|
|
+ document.body.appendChild(input);
|
|
|
+ input.select();
|
|
|
+ input.setSelectionRange(0, input.value.length);
|
|
|
+ document.execCommand('Copy');
|
|
|
+ document.body.removeChild(input);
|
|
|
+ message.success('复制成功');
|
|
|
+ };
|
|
|
const onReset = () => {
|
|
|
state.searchForm = {
|
|
|
keyword: '',
|
|
@@ -101,11 +114,29 @@ export default defineComponent({
|
|
|
return [
|
|
|
{
|
|
|
title: '学生姓名',
|
|
|
- key: 'nickname'
|
|
|
+ key: 'nickname',
|
|
|
+ render: (row: any) => {
|
|
|
+ return (
|
|
|
+ <div
|
|
|
+ style={{ userSelect: 'all', cursor: 'pointer' }}
|
|
|
+ onClick={() => copyTo(row.nickname)}>
|
|
|
+ {row.nickname}
|
|
|
+ </div>
|
|
|
+ );
|
|
|
+ }
|
|
|
},
|
|
|
{
|
|
|
title: '手机号',
|
|
|
- key: 'phone'
|
|
|
+ key: 'phone',
|
|
|
+ render: (row: any) => {
|
|
|
+ return (
|
|
|
+ <div
|
|
|
+ style={{ userSelect: 'all', cursor: 'pointer' }}
|
|
|
+ onClick={() => copyTo(row.phone)}>
|
|
|
+ {row.phone}
|
|
|
+ </div>
|
|
|
+ );
|
|
|
+ }
|
|
|
},
|
|
|
{
|
|
|
title: '性别',
|