fix
This commit is contained in:
@@ -54,7 +54,7 @@ async function submit() {
|
||||
const api = {
|
||||
"admin announcement create": createAnnouncement,
|
||||
"admin announcement edit": editAnnouncement,
|
||||
}[<string>route.name]
|
||||
}[route.name as string]
|
||||
try {
|
||||
await api!(announcement)
|
||||
if (route.name === "admin announcement create") {
|
||||
|
||||
@@ -97,7 +97,7 @@ async function submit() {
|
||||
const api = {
|
||||
"admin contest create": createContest,
|
||||
"admin contest edit": editContest,
|
||||
}[<string>route.name]
|
||||
}[route.name as string]
|
||||
try {
|
||||
await api!(contest)
|
||||
if (route.name === "admin contest create") {
|
||||
|
||||
@@ -33,7 +33,7 @@ const columns: DataTableColumn<AdminProblemFiltered>[] = [
|
||||
render: (row) =>
|
||||
h(AddButton, {
|
||||
problemID: row.id,
|
||||
contestID: <string>route.params.contestID,
|
||||
contestID: route.params.contestID as string,
|
||||
onAdded: () => emit("change"),
|
||||
}),
|
||||
width: 60,
|
||||
|
||||
@@ -44,7 +44,7 @@ const title = computed(
|
||||
"admin problem edit": "编辑题目",
|
||||
"admin contest problem create": "新建比赛题目",
|
||||
"admin contest problem edit": "编辑比赛题目",
|
||||
})[<string>route.name],
|
||||
})[route.name as string],
|
||||
)
|
||||
|
||||
const isAIGenerating = ref(false)
|
||||
@@ -358,7 +358,7 @@ async function submit() {
|
||||
"admin problem edit": editProblem,
|
||||
"admin contest problem create": createContestProblem,
|
||||
"admin contest problem edit": editContestProblem,
|
||||
}[<string>route.name]
|
||||
}[route.name as string]
|
||||
if (
|
||||
route.name === "admin contest problem create" ||
|
||||
route.name === "admin contest problem edit"
|
||||
|
||||
@@ -23,7 +23,7 @@ const title = computed(
|
||||
({
|
||||
"admin problem list": "题目列表",
|
||||
"admin contest problem list": "比赛题目列表",
|
||||
})[<string>route.name],
|
||||
})[route.name as string],
|
||||
)
|
||||
const isContestProblemList = computed(
|
||||
() => route.name === "admin contest problem list",
|
||||
|
||||
@@ -50,7 +50,7 @@ const columns: DataTableColumn<Submission>[] = [
|
||||
text: true,
|
||||
type: "info",
|
||||
onClick: () => {
|
||||
showCodePanel(row.id, <string>route.params.problemID ?? "")
|
||||
showCodePanel(row.id, (route.params.problemID as string) ?? "")
|
||||
},
|
||||
},
|
||||
() => row.id.slice(0, 12),
|
||||
@@ -116,8 +116,8 @@ async function listSubmissions() {
|
||||
...query,
|
||||
myself: "1",
|
||||
offset,
|
||||
problem_id: <string>route.params.problemID ?? "",
|
||||
contest_id: <string>route.params.contestID ?? "",
|
||||
problem_id: (route.params.problemID as string) ?? "",
|
||||
contest_id: (route.params.contestID as string) ?? "",
|
||||
})
|
||||
submissions.value = res.data.results
|
||||
total.value = res.data.total
|
||||
@@ -125,7 +125,7 @@ async function listSubmissions() {
|
||||
|
||||
async function getRankOfThisProblem() {
|
||||
loading.value = true
|
||||
const res = await getRankOfProblem(<string>route.params.problemID ?? "")
|
||||
const res = await getRankOfProblem((route.params.problemID as string) ?? "")
|
||||
loading.value = false
|
||||
|
||||
class_name.value = res.data.class_name
|
||||
|
||||
@@ -24,8 +24,8 @@ const codeStore = useCodeStore()
|
||||
const problemStore = useProblemStore()
|
||||
const { problem } = storeToRefs(problemStore)
|
||||
const route = useRoute()
|
||||
const contestID = <string>route.params.contestID ?? ""
|
||||
const problemSetId = <string>route.params.problemSetId ?? ""
|
||||
const contestID = (route.params.contestID as string) ?? ""
|
||||
const problemSetId = (route.params.problemSetId as string) ?? ""
|
||||
|
||||
const router = useRouter()
|
||||
const [commentPanel] = useToggle()
|
||||
|
||||
@@ -81,7 +81,7 @@ async function copyToProblem() {
|
||||
}
|
||||
|
||||
const contestID = submission.value!.contest
|
||||
const problemSetId = <string>route.params.problemSetId ?? ""
|
||||
const problemSetId = (route.params.problemSetId as string) ?? ""
|
||||
if (contestID) {
|
||||
// 竞赛题目
|
||||
router.push({
|
||||
|
||||
@@ -103,7 +103,7 @@ async function listSubmissions() {
|
||||
...query,
|
||||
offset,
|
||||
problem_id: query.problem,
|
||||
contest_id: <string>route.params.contestID ?? "",
|
||||
contest_id: (route.params.contestID as string) ?? "",
|
||||
language: query.language,
|
||||
today: query.today,
|
||||
})
|
||||
|
||||
@@ -93,7 +93,7 @@ function groupBadgesByIcon(badges: UserBadgeType[]): GroupedBadge[] {
|
||||
async function init() {
|
||||
toggle(true)
|
||||
try {
|
||||
const res = await getProfile(<string>route.query.name)
|
||||
const res = await getProfile(route.query.name as string)
|
||||
profile.value = res.data
|
||||
const acm = res.data.acm_problems_status.problems || {}
|
||||
const oi = res.data.oi_problems_status.problems || {}
|
||||
@@ -114,7 +114,7 @@ async function init() {
|
||||
}
|
||||
|
||||
if (route.query.name) {
|
||||
promises.push(getUserBadges(<string>route.query.name))
|
||||
promises.push(getUserBadges(route.query.name as string))
|
||||
} else {
|
||||
promises.push(getUserBadges())
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ import { useBreakpoints } from "shared/composables/breakpoints"
|
||||
const route = useRoute()
|
||||
const { isMobile } = useBreakpoints()
|
||||
const hiddenICP = computed(() =>
|
||||
["problem", "contest problem"].includes(<string>route.name),
|
||||
["problem", "contest problem"].includes(route.name as string),
|
||||
)
|
||||
|
||||
function goICP() {
|
||||
|
||||
Reference in New Issue
Block a user