fix: category BUG
This commit is contained in:
parent
08ae3cfad8
commit
0f01c67467
|
@ -129,21 +129,21 @@ export default {
|
|||
default: 'Default',
|
||||
essential: 'Essential',
|
||||
full: 'Full',
|
||||
tagsHint: 'Hot Keywords',
|
||||
tagsHint: 'Hot Tags',
|
||||
refresh: 'Refresh the page',
|
||||
help1: "The topic's title length should be between 1 and 40 characters.",
|
||||
help2: "You can click on the left settings to adjust the editor's mode.",
|
||||
help3: "The website's code is handwritten, and errors are inevitable.",
|
||||
help4: 'If you encounter any errors, please',
|
||||
contact: ' Contact Us.',
|
||||
tags: 'Please input topic keywords',
|
||||
hint: `Hint: (A single keyword should be within 14 characters, choose at least one and up to 7 keywords). You can enter text and press \`Enter\` to create a keyword.`,
|
||||
hot: 'Popular Keywords (Click to Select) : ',
|
||||
tags: 'Please input topic tags',
|
||||
hint: `Hint: (A single tag should be within 14 characters, choose at least one and up to 7 tags). You can enter text and press \`Enter\` to create a tag.`,
|
||||
hot: 'Popular Tags (Click to Select) : ',
|
||||
categories:
|
||||
'Click to select topic categories (multiple selections allowed) : ',
|
||||
btnGalgame: 'Visual Novel',
|
||||
btnTechnique: 'Technique',
|
||||
btnOthers: 'Others',
|
||||
Galgame: 'Visual Novel',
|
||||
Technique: 'Technique',
|
||||
Others: 'Others',
|
||||
publish: 'Confirm Publish',
|
||||
draft: 'Save Draft',
|
||||
},
|
||||
|
|
|
@ -25,7 +25,7 @@ const plainText = getPlainText(props.data.content)
|
|||
<div class="title">
|
||||
<span>{{ props.data.title }}</span>
|
||||
</div>
|
||||
<!-- 话题发布日期 -->
|
||||
<!-- 话题的状态,点赞数等 -->
|
||||
<div class="status">
|
||||
<ul>
|
||||
<li>
|
||||
|
@ -43,7 +43,7 @@ const plainText = getPlainText(props.data.content)
|
|||
</li>
|
||||
</ul>
|
||||
|
||||
<!-- 话题的状态,点赞数等 -->
|
||||
<!-- 话题的发布日期 -->
|
||||
<div class="time">
|
||||
<span>{{
|
||||
formatTimeDifference(
|
||||
|
@ -115,7 +115,7 @@ const plainText = getPlainText(props.data.content)
|
|||
}
|
||||
/* 发帖日期 */
|
||||
.time {
|
||||
width: 60px;
|
||||
width: 77px;
|
||||
font-size: x-small;
|
||||
color: var(--kungalgame-font-color-0);
|
||||
/* 居中 */
|
||||
|
|
|
@ -12,8 +12,6 @@ import { useKUNGalgamerStore } from '@/store/modules/kungalgamer'
|
|||
import { storeToRefs } from 'pinia'
|
||||
// 导入路由
|
||||
import { useRouter } from 'vue-router'
|
||||
// 导入将富文本变成纯文本的函数
|
||||
import { getPlainText } from '@/utils/getPlainText'
|
||||
// 导入请求数据格式
|
||||
import {
|
||||
EditCreateTopicRequestData,
|
||||
|
@ -22,7 +20,7 @@ import {
|
|||
|
||||
const router = useRouter()
|
||||
|
||||
const topicData = storeToRefs(useKUNGalgameEditStore())
|
||||
const { content, isSave } = storeToRefs(useKUNGalgameEditStore())
|
||||
|
||||
const messageStore = useKUNGalgameMessageStore()
|
||||
|
||||
|
@ -31,10 +29,18 @@ const checkPublish = (topicData: EditCreateTopicRequestData) => {
|
|||
// 标题为空的话,警告
|
||||
message('Title cannot be empty!', '标题不可为空!', 'warn')
|
||||
return false
|
||||
} else if (topicData.content.trim()) {
|
||||
// TODO:
|
||||
console.log(getPlainText(topicData.content.trim()).length)
|
||||
return true
|
||||
} else if (!content.value.trim()) {
|
||||
// 内容为空的话,警告
|
||||
message('Content cannot be empty!', '内容不可为空!', 'warn')
|
||||
return false
|
||||
} else if (topicData.tags.length === 0) {
|
||||
message('Please use at least one tag!', '请至少使用一个标签!', 'warn')
|
||||
} else if (topicData.category.length === 0) {
|
||||
message(
|
||||
'Please select at least one category!',
|
||||
'请至少选择一个分类!',
|
||||
'warn'
|
||||
)
|
||||
} else {
|
||||
return true
|
||||
}
|
||||
|
@ -85,7 +91,7 @@ const handlePublish = async () => {
|
|||
|
||||
const handleSave = () => {
|
||||
// 这个值为 true 的时候每次页面加载的时候都会预加载上一次的话题数据
|
||||
topicData.isSave.value = true
|
||||
isSave.value = true
|
||||
messageStore.info('AlertInfo.edit.draft')
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -8,14 +8,14 @@ export interface Category {
|
|||
export const category: Category[] = [
|
||||
{
|
||||
index: 1,
|
||||
name: 'btnGalgame',
|
||||
name: 'Galgame',
|
||||
},
|
||||
{
|
||||
index: 2,
|
||||
name: 'btnTechnique',
|
||||
name: 'Technique',
|
||||
},
|
||||
{
|
||||
index: 3,
|
||||
name: 'btnOthers',
|
||||
name: 'Others',
|
||||
},
|
||||
]
|
||||
|
|
Loading…
Reference in a new issue