|
@@ -7,7 +7,8 @@ import {
|
|
NFormItem,
|
|
NFormItem,
|
|
NImage,
|
|
NImage,
|
|
NSelect,
|
|
NSelect,
|
|
- NSpace
|
|
|
|
|
|
+ NSpace,
|
|
|
|
+ useMessage
|
|
} from 'naive-ui';
|
|
} from 'naive-ui';
|
|
import SearchInput from '@/components/searchInput';
|
|
import SearchInput from '@/components/searchInput';
|
|
import CSelect from '@/components/CSelect';
|
|
import CSelect from '@/components/CSelect';
|
|
@@ -29,6 +30,7 @@ export default defineComponent({
|
|
},
|
|
},
|
|
tableList: [] as any
|
|
tableList: [] as any
|
|
});
|
|
});
|
|
|
|
+ const message =useMessage()
|
|
const route = useRoute();
|
|
const route = useRoute();
|
|
const router = useRouter();
|
|
const router = useRouter();
|
|
const search = () => {
|
|
const search = () => {
|
|
@@ -62,6 +64,17 @@ export default defineComponent({
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
getList();
|
|
getList();
|
|
});
|
|
});
|
|
|
|
+
|
|
|
|
+ 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 gotoDetail = (row: any) => {
|
|
const gotoDetail = (row: any) => {
|
|
router.push({
|
|
router.push({
|
|
path: '/classStudentDetail',
|
|
path: '/classStudentDetail',
|
|
@@ -72,11 +85,29 @@ export default defineComponent({
|
|
return [
|
|
return [
|
|
{
|
|
{
|
|
title: '学生姓名',
|
|
title: '学生姓名',
|
|
- key: 'nickname'
|
|
|
|
|
|
+ key: 'nickname',
|
|
|
|
+ render: (row: any) => {
|
|
|
|
+ return (
|
|
|
|
+ <div
|
|
|
|
+ style={{ userSelect: 'all', cursor: 'pointer' }}
|
|
|
|
+ onClick={() => copyTo(row.nickname)}>
|
|
|
|
+ {row.nickname}
|
|
|
|
+ </div>
|
|
|
|
+ );
|
|
|
|
+ }
|
|
},
|
|
},
|
|
{
|
|
{
|
|
title: '手机号',
|
|
title: '手机号',
|
|
- key: 'phone'
|
|
|
|
|
|
+ key: 'phone',
|
|
|
|
+ render: (row: any) => {
|
|
|
|
+ return (
|
|
|
|
+ <div
|
|
|
|
+ style={{ userSelect: 'all', cursor: 'pointer' }}
|
|
|
|
+ onClick={() => copyTo(row.phone)}>
|
|
|
|
+ {row.phone}
|
|
|
|
+ </div>
|
|
|
|
+ );
|
|
|
|
+ }
|
|
},
|
|
},
|
|
{
|
|
{
|
|
title: '性别',
|
|
title: '性别',
|