feat(questionStore): 适应新场景调整问题获取逻辑

- 根据当前 URL 路径动态设置 is_preview 和 is_template 参数
- 优化 SurveyItem 组件中项目名称的样式
This commit is contained in:
Huangzhe
2025-05-26 12:03:19 +08:00
parent 23b1a46bec
commit 001279874d
2 changed files with 4 additions and 3 deletions

View File

@@ -48,12 +48,13 @@ export const useQuestionStore = defineStore('questionStore', () => {
// 更新数据
async function getQuestions() {
const _url = new URL(location.href).pathname;
const urlParamSearch = new URL(location.href).searchParams;
let { data } = await AnswerApi.getQuetions({
id: urlParamSearch.get('sn'),
data: {
is_preview: 1,
is_template: 0,
is_preview: _url.includes('create') ? 0 : 1,
is_template: _url.includes('create') ? 1 : 0,
// is_template: urlParamSearch.get('is_template') || 0,
source: urlParamSearch.get('source') ?? ''
}

View File

@@ -149,7 +149,7 @@ function copyItem(item: SurveyItem) {
<div style="position: relative">
<div style="display: flex; justify-content: space-between; margin: 10px 0">
<div class="survey_item_info_title">
<el-text style="max-width: 100px">
<el-text>
<b v-html="survey.project_name"></b>
</el-text>
<el-text v-if="survey.is_publish_number" class="wrap">