@@ -14,6 +14,7 @@ import {
1414 createGalgameRatingSchema ,
1515 updateGalgameRatingSchema
1616} from ' ~/validations/galgame-rating'
17+ import { usePersistEditGalgameRatingStore } from ' ~/store/modules/edit/rating'
1718import type { GalgamePageRatingCard } from ' ~/types/api/galgame-rating'
1819
1920type RatingInitialData = {
@@ -46,6 +47,10 @@ const emits = defineEmits<{
4647 onPublished: [GalgamePageRatingCard ]
4748}>()
4849
50+ const { shortSummary : shortSummaryStore } = storeToRefs (
51+ usePersistEditGalgameRatingStore ()
52+ )
53+
4954const recommend =
5055 ref <(typeof KUN_GALGAME_RATING_RECOMMEND_CONST )[number ]>(' neutral' )
5156const playStatus =
@@ -95,6 +100,15 @@ watch(
95100 }
96101)
97102
103+ watch (
104+ () => shortSummary .value ,
105+ () => {
106+ if (! props .initialData ) {
107+ shortSummaryStore .value = shortSummary .value
108+ }
109+ }
110+ )
111+
98112const isSubmitting = ref (false )
99113
100114const recommendOptions = computed (() =>
@@ -140,6 +154,8 @@ watch(
140154 }
141155 selectedTypes .value = [... (props .initialData .galgameType ?? [])]
142156 showAdvanced .value = true
157+ } else {
158+ shortSummary .value = shortSummaryStore .value
143159 }
144160 }
145161)
@@ -238,6 +254,7 @@ const submit = async () => {
238254 resetForm ()
239255 close ()
240256 emits (' onPublished' , res )
257+ shortSummaryStore .value = ' '
241258 }
242259 }
243260}
@@ -317,7 +334,7 @@ const submit = async () => {
317334
318335 <KunTextarea
319336 v-model =" shortSummary"
320- label =" 短评 (可选, 请勿包含 R18 内容)"
337+ label =" 短评 (可选, 请勿包含 R18 内容, 您的短评在编写的同时会被自动保存在本地, 关掉面板不会丢失 )"
321338 :rows =" 4"
322339 placeholder =" 「 枯れない世界と終わる花 」莲真的是我遇见最好的女孩子, 想和她结婚天长地久恩恩爱爱百年好合, 想和她翻云覆雨、干湿分离、水乳交融、干柴烈火, 日日夜夜每时每刻每个开心难过七滋八味苦辣麻香咸的日子里都在想念、挚爱、铭记着莲, 你们懂这种心情吗!!!这已经不是爱了, 这种东西叫本能, 我只是本能的爱着这个孩子而已, 我无法控制自己的本能, 我已经病入膏肓了, 病名为莲。"
323340 :maxlength =" 1314"
0 commit comments