diff --git a/web/src/management/hooks/useQuestionInfo.js b/web/src/management/hooks/useQuestionInfo.js index f8f66e3f..19049008 100644 --- a/web/src/management/hooks/useQuestionInfo.js +++ b/web/src/management/hooks/useQuestionInfo.js @@ -1,17 +1,19 @@ import { computed } from 'vue' -import store from '@/management/store' +import { storeToRefs } from 'pinia' +import { useEditStore } from '@/management/stores/edit' import { cleanRichText } from '@/common/xss' export const useQuestionInfo = (field) => { + const editStore = useEditStore() + const { questionDataList } = storeToRefs(editStore) + const getQuestionTitle = computed(() => { - const questionDataList = store.state.edit.schema.questionDataList return () => { - return questionDataList.find((item) => item.field === field)?.title + return questionDataList.value.find((item) => item.field === field)?.title } }) const getOptionTitle = computed(() => { - const questionDataList = store.state.edit.schema.questionDataList return (value) => { - const options = questionDataList.find((item) => item.field === field)?.options || [] + const options = questionDataList.value.find((item) => item.field === field)?.options || [] if (value instanceof Array) { return options .filter((item) => value.includes(item.hash)) diff --git a/web/src/management/hooks/useResizeObserver.js b/web/src/management/hooks/useResizeObserver.js index 486962f2..cbf400ea 100644 --- a/web/src/management/hooks/useResizeObserver.js +++ b/web/src/management/hooks/useResizeObserver.js @@ -1,5 +1,5 @@ // 引入防抖函数 -import _debounce from 'lodash/debounce' +import { debounce as _debounce } from 'lodash-es' /** * @description: 监听元素尺寸变化 * @param {*} el 元素dom diff --git a/web/src/management/pages/analysis/components/StatisticsItem.vue b/web/src/management/pages/analysis/components/StatisticsItem.vue index 7cd95b1e..9d43ce2d 100644 --- a/web/src/management/pages/analysis/components/StatisticsItem.vue +++ b/web/src/management/pages/analysis/components/StatisticsItem.vue @@ -34,7 +34,7 @@