diff --git a/src/router/index.js b/src/router/index.js index 63f60057..6804e6db 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -182,15 +182,13 @@ const constantRoutes = [ { path: 'data-particulars', name: 'DataParticulars', - meta: { keepAlive: true }, - meta: { showPublish: false, showPreview: false, showShare: true, showDownload: true }, + meta: { keepAlive: true, showPublish: false, showPreview: false, showShare: true, showDownload: true }, component: () => import(/* webpackChunkName: "analyse" */ '@/views/DataAnalyse/particulars/list') }, { path: 'test-particulars', name: 'TestParticulars', - meta: { keepAlive: true }, - meta: { showPublish: false, showPreview: false, showShare: true, showDownload: true }, + meta: { keepAlive: true, showPublish: false, showPreview: false, showShare: true, showDownload: true }, component: () => import(/* webpackChunkName: "analyse" */ '@/views/DataAnalyse/particulars/test') }, { diff --git a/src/views/DataAnalyse/components/CustomTableHeaderCell.vue b/src/views/DataAnalyse/components/CustomTableHeaderCell.vue index 513e6cfb..4c2a2510 100644 --- a/src/views/DataAnalyse/components/CustomTableHeaderCell.vue +++ b/src/views/DataAnalyse/components/CustomTableHeaderCell.vue @@ -9,7 +9,12 @@
{{ content }}
- 下载全部附件 + +
@@ -49,11 +54,12 @@ const question_type = ref(null) // https://stackoverflow.com/questions/15458876/check-if-a-string-is-html-or-not const includeHtmlTag = computed(() =>/<\/?[a-z][\s\S]*>/i.test(content.value)) const shortTitle = computed(() => content.value ? content.value.slice(0, 40) : '') - +const searchParams = ref({}); function download() { const params = JSON.parse(JSON.stringify(props.search_params)) const query = convertQueryToString(params) - + // console.log("serpar",params); + searchParams.value = params; // downloadAnswerFile(props.sn, question_index.value, query).then(res => { // // const url = res.data.url // // downloadFile(url) @@ -72,7 +78,7 @@ const route = useRoute(); const downloadVisible = ref(false); // 下载中心 function downloadCenter() { - let data ={ download_type: '3', question_index:question_index.value } + let data ={ download_type: '3', question_index:question_index.value, ...searchParams.value } addDownloadCenter(props.sn,data).then(res=>{ store.dispatch('downloadCenter/changeCenterUrl',route.path) // downloadVisible.value = true @@ -110,7 +116,7 @@ watchEffect(() => { display: flex; align-items: center; .label { - width: 50%; + width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; diff --git a/src/views/DataAnalyse/components/DataTable.vue b/src/views/DataAnalyse/components/DataTable.vue index a2988e66..42e398c2 100644 --- a/src/views/DataAnalyse/components/DataTable.vue +++ b/src/views/DataAnalyse/components/DataTable.vue @@ -32,14 +32,13 @@ \ No newline at end of file + diff --git a/src/views/DataAnalyse/composables/useCustomHeaderTitle.js b/src/views/DataAnalyse/composables/useCustomHeaderTitle.js index 71f678a2..e065fc7c 100644 --- a/src/views/DataAnalyse/composables/useCustomHeaderTitle.js +++ b/src/views/DataAnalyse/composables/useCustomHeaderTitle.js @@ -1,7 +1,7 @@ import { ref, watch } from "vue"; import CustomTableHeaderCell from '@/views/DataAnalyse/components/CustomTableHeaderCell' export default function renderCustomHeader(columns, sn ,search_params) { - + const customHeaders = ref([]) function renderCell(data, sn, search_params) { @@ -12,12 +12,25 @@ export default function renderCustomHeader(columns, sn ,search_params) { customHeaders.value = data.map(item => { return { ...item, - title: renderCell(item, sn, search_params) + title: renderCell(item, sn, search_params.value) } }) } }, { immediate: true }) - return { customHeaders } + watch(search_params, (data) => { + + if(columns) { + customHeaders.value = columns.value.map(item => { + return { + ...item, + title: renderCell(item, sn, data) + } + }) + } + }, { + deep:true + }) + return {customHeaders} } diff --git a/src/views/DataAnalyse/diagram/components/DiagramTableFile.vue b/src/views/DataAnalyse/diagram/components/DiagramTableFile.vue index 073a2dae..1a25eda8 100644 --- a/src/views/DataAnalyse/diagram/components/DiagramTableFile.vue +++ b/src/views/DataAnalyse/diagram/components/DiagramTableFile.vue @@ -84,7 +84,7 @@ export default defineComponent({ const permission = inject("permission"); const searchParams = inject("searchParams"); - + console.log('searchParams',searchParams); const tableSource = ref([]); const columns = ref([ @@ -138,7 +138,12 @@ export default defineComponent({ async function handleClick() { const sn = props.sn; const question_index = props.data.question_index; - let data ={ download_type: '3', question_index } + const tableSearchInfo = searchParams.value; + delete tableSearchInfo.type;//文件下载没有type类型,去掉 + console.log(tableSearchInfo); + + let data ={ download_type: '3', question_index,...tableSearchInfo } + addDownloadCenter(sn,data).then(res=>{ store.dispatch('downloadCenter/changeCenterUrl',route.path) store.dispatch('downloadCenter/changeCenterShow',true) diff --git a/src/views/DataAnalyse/particulars/list.vue b/src/views/DataAnalyse/particulars/list.vue index 2f2eb556..382fd1f2 100644 --- a/src/views/DataAnalyse/particulars/list.vue +++ b/src/views/DataAnalyse/particulars/list.vue @@ -10,14 +10,14 @@
- 明细数据 + 明细数据222 - + { return { ...queryState.value, page: page.value, - per_page: per_page.value + per_page: per_page.value, + ...subInfo.value } })