优化手动复制到微信群
This commit is contained in:
1
src/components.d.ts
vendored
1
src/components.d.ts
vendored
@@ -56,6 +56,7 @@ declare module 'vue' {
|
|||||||
NTabPane: typeof import('naive-ui')['NTabPane']
|
NTabPane: typeof import('naive-ui')['NTabPane']
|
||||||
NTabs: typeof import('naive-ui')['NTabs']
|
NTabs: typeof import('naive-ui')['NTabs']
|
||||||
NTag: typeof import('naive-ui')['NTag']
|
NTag: typeof import('naive-ui')['NTag']
|
||||||
|
NText: typeof import('naive-ui')['NText']
|
||||||
NTooltip: typeof import('naive-ui')['NTooltip']
|
NTooltip: typeof import('naive-ui')['NTooltip']
|
||||||
NUpload: typeof import('naive-ui')['NUpload']
|
NUpload: typeof import('naive-ui')['NUpload']
|
||||||
RouterLink: typeof import('vue-router')['RouterLink']
|
RouterLink: typeof import('vue-router')['RouterLink']
|
||||||
|
|||||||
@@ -63,7 +63,7 @@
|
|||||||
<n-button type="warning" @click="toggleUnaccepted(!unaccepted)">
|
<n-button type="warning" @click="toggleUnaccepted(!unaccepted)">
|
||||||
{{ unaccepted ? "隐藏没有完成的" : "显示没有完成的" }}
|
{{ unaccepted ? "隐藏没有完成的" : "显示没有完成的" }}
|
||||||
</n-button>
|
</n-button>
|
||||||
<n-button @click="copyUnaccepted">复制名单</n-button>
|
<n-button @click="copyUnaccepted">手动复制到微信群</n-button>
|
||||||
</n-flex>
|
</n-flex>
|
||||||
</n-space>
|
</n-space>
|
||||||
<n-h1 v-if="count.total === 0">
|
<n-h1 v-if="count.total === 0">
|
||||||
@@ -74,6 +74,7 @@
|
|||||||
<n-h1 v-for="item in listUnaccepted" :key="item">
|
<n-h1 v-for="item in listUnaccepted" :key="item">
|
||||||
{{ removeClassname(item) }}
|
{{ removeClassname(item) }}
|
||||||
</n-h1>
|
</n-h1>
|
||||||
|
<n-text v-if="message">{{ message }}</n-text>
|
||||||
</n-space>
|
</n-space>
|
||||||
<n-data-table v-if="list.length" striped :columns="columns" :data="list" />
|
<n-data-table v-if="list.length" striped :columns="columns" :data="list" />
|
||||||
</n-flex>
|
</n-flex>
|
||||||
@@ -89,7 +90,6 @@ interface Props {
|
|||||||
|
|
||||||
const props = defineProps<Props>()
|
const props = defineProps<Props>()
|
||||||
|
|
||||||
const message = useMessage()
|
|
||||||
const options: SelectOption[] = [
|
const options: SelectOption[] = [
|
||||||
{ label: "30分钟内", value: "minutes:30" },
|
{ label: "30分钟内", value: "minutes:30" },
|
||||||
{ label: "本节课内", value: "hours:1" },
|
{ label: "本节课内", value: "hours:1" },
|
||||||
@@ -97,6 +97,7 @@ const options: SelectOption[] = [
|
|||||||
{ label: "一天内", value: "days:1" },
|
{ label: "一天内", value: "days:1" },
|
||||||
{ label: "一周内", value: "weeks:1" },
|
{ label: "一周内", value: "weeks:1" },
|
||||||
{ label: "一个月内", value: "months:1" },
|
{ label: "一个月内", value: "months:1" },
|
||||||
|
{ label: "一个月内", value: "years:1" },
|
||||||
]
|
]
|
||||||
|
|
||||||
const columns: DataTableColumn[] = [
|
const columns: DataTableColumn[] = [
|
||||||
@@ -124,6 +125,7 @@ const person = reactive({
|
|||||||
const list = ref([])
|
const list = ref([])
|
||||||
const listUnaccepted = ref([])
|
const listUnaccepted = ref([])
|
||||||
const [unaccepted, toggleUnaccepted] = useToggle()
|
const [unaccepted, toggleUnaccepted] = useToggle()
|
||||||
|
const message = ref("")
|
||||||
|
|
||||||
const subOptions = computed<Duration>(() => {
|
const subOptions = computed<Duration>(() => {
|
||||||
let dur = options.find((it) => it.value === query.duration) ?? options[0]
|
let dur = options.find((it) => it.value === query.duration) ?? options[0]
|
||||||
@@ -151,6 +153,7 @@ async function handleStatistics() {
|
|||||||
person.rate = res.data.person_rate
|
person.rate = res.data.person_rate
|
||||||
|
|
||||||
toggleUnaccepted(false)
|
toggleUnaccepted(false)
|
||||||
|
message.value = ""
|
||||||
}
|
}
|
||||||
|
|
||||||
function removeClassname(name: string) {
|
function removeClassname(name: string) {
|
||||||
@@ -166,7 +169,6 @@ function copyUnaccepted() {
|
|||||||
const prefix = `${grade}计算机${classname}班${query.problem}这道题有${listUnaccepted.value.length}人没有完成,分别是:`
|
const prefix = `${grade}计算机${classname}班${query.problem}这道题有${listUnaccepted.value.length}人没有完成,分别是:`
|
||||||
const names = listUnaccepted.value.map(removeClassname).join("、")
|
const names = listUnaccepted.value.map(removeClassname).join("、")
|
||||||
const suffix = "。请以上同学尽快完成!"
|
const suffix = "。请以上同学尽快完成!"
|
||||||
console.log(prefix+names+suffix)
|
message.value = prefix+names+suffix
|
||||||
message.success("到 DevTool 中手动复制")
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user