Compare commits

...

2 Commits

2 changed files with 28 additions and 2 deletions

View File

@ -5,6 +5,9 @@
<!-- <a-button type="primary" @click="handleAdd"></a-button> -->
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'shpPath'">
<div @click="copyToClipboard(record.shpPath)">{{record.shpPath}}</div>
</template>
<template v-if="column.key === 'action'">
<TableAction
:actions="[
@ -44,7 +47,8 @@
import { searchFormSchema, achievementColumns } from './index.data';
// api
import { loadTableListData } from '@/api/achievement/index';
import { useMessage } from '@/hooks/web/useMessage';
const { createMessage } = useMessage();
const modalForm = ref();
let openModal = ref(false);
@ -108,6 +112,15 @@
clearSelectedRowKeys();
reload();
}
//
const copyToClipboard = async (record) => {
try {
await navigator.clipboard.writeText(record);
createMessage.success('文本已复制到剪贴板');
} catch (err) {
createMessage.error('无法复制文本');
}
};
</script>
<style lang="scss">
.categories-modal {

View File

@ -5,6 +5,9 @@
<!-- <a-button type="primary" @click="handleAdd"></a-button> -->
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'tifPath'">
<div @click="copyToClipboard(record.tifPath)">{{record.tifPath}}</div>
</template>
<template v-if="column.key === 'action'">
<TableAction
:actions="[
@ -44,7 +47,8 @@
import { searchFormSchema, achievementColumns } from './index.data';
// api
import { loadTifTableListData } from '@/api/achievement/index';
import { useMessage } from '@/hooks/web/useMessage';
const { createMessage } = useMessage();
const modalForm = ref();
let openModal = ref(false);
@ -108,6 +112,15 @@
clearSelectedRowKeys();
reload();
}
//
const copyToClipboard = async (record) => {
try {
await navigator.clipboard.writeText(record);
createMessage.success('文本已复制到剪贴板');
} catch (err) {
createMessage.error('无法复制文本');
}
};
</script>
<style lang="scss">
.categories-modal {