feat: 增加日期格式化
- 格式化首页的日期内容 - 修复预览跳转正常使用
This commit is contained in:
@@ -56,6 +56,7 @@ export const useQuestionStore = defineStore('questionStore', () => {
|
||||
}
|
||||
});
|
||||
data = data.data;
|
||||
console.log(`data:`, data);
|
||||
// 多语言
|
||||
data.languageType = [
|
||||
data?.survey?.style?.is_en_tips ? 'en' : '',
|
||||
@@ -65,6 +66,7 @@ export const useQuestionStore = defineStore('questionStore', () => {
|
||||
// console.log(`l value:`, l.value);
|
||||
data.language = l.value;
|
||||
questionsData.value = data;
|
||||
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
3
src/utils/date.ts
Normal file
3
src/utils/date.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
export function formatTime(time: string, split = ' ', join = ' '){
|
||||
return time.split(split).join(join)
|
||||
}
|
||||
@@ -19,6 +19,7 @@ import {
|
||||
} from '@/views/Survey/hooks/useSurveyData';
|
||||
import ai from '@/assets/img/analysis/ai.svg';
|
||||
import { ref } from 'vue';
|
||||
import { formatTime } from '@/utils/date';
|
||||
|
||||
const form = ref({
|
||||
page: 0,
|
||||
@@ -66,7 +67,8 @@ function toPreview(item: SurveyItem) {
|
||||
query: {
|
||||
sn: item.sn,
|
||||
name: item.project_name,
|
||||
source: 0
|
||||
source: 0,
|
||||
is_template: 1
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -183,7 +185,9 @@ function copyItem(item: SurveyItem) {
|
||||
<!-- 问卷时间 -->
|
||||
<div class="flex align-center">
|
||||
<img src="@/assets/img/publish/time.png" alt="" />
|
||||
<el-text size="small"> 创建时间 {{ survey.created_at }}</el-text>
|
||||
<el-text size="small">
|
||||
创建时间 {{ formatTime(survey.created_at, '-', '.') }}
|
||||
</el-text>
|
||||
</div>
|
||||
</el-space>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user