feat(questionStore): 适应新场景调整问题获取逻辑
- 根据当前 URL 路径动态设置 is_preview 和 is_template 参数 - 优化 SurveyItem 组件中项目名称的样式
This commit is contained in:
@@ -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') ?? ''
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user