fix : 修复首页待立项等任务跳转及各种类型文章跳转显示对应数据
This commit is contained in:
@@ -52,6 +52,16 @@ const props = defineProps({
|
||||
searchConfig: {
|
||||
type: Array,
|
||||
default: []
|
||||
},
|
||||
//搜索参数
|
||||
searchProp: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
//搜索值
|
||||
searchValue: {
|
||||
type: String,
|
||||
default: ''
|
||||
}
|
||||
})
|
||||
|
||||
@@ -68,7 +78,10 @@ const filterConfig = computed(() => {
|
||||
})
|
||||
return arr.length >= 4 && showMore.value ? arr : arr.slice(0, 3)
|
||||
})
|
||||
|
||||
const setForm=(prop,value)=>{
|
||||
form.value[prop]=value
|
||||
return form.value;
|
||||
}
|
||||
// 搜索功能表单元素默认值
|
||||
// const setDefaultFormValues = () => {
|
||||
// filterConfig.value.forEach(item => {
|
||||
@@ -80,6 +93,9 @@ watchEffect(() => {
|
||||
if (filterConfig.value.length) {
|
||||
// setDefaultFormValues()
|
||||
}
|
||||
if(props.searchProp&&props.searchValue){
|
||||
setForm(props.searchProp,props.searchValue)
|
||||
}
|
||||
})
|
||||
|
||||
const elChange = () => {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<fvSearchForm :searchConfig="researchFundSearchConfig" @search="searchResearchFund"
|
||||
<fvSearchForm :searchConfig="articleSearchConfig" @search="searchArticle" searchProp="articleType" :searchValue="routeArticleType"
|
||||
style="margin-left: 16px"></fvSearchForm>
|
||||
<fvTable ref="tableIns" :tableConfig="researchFundTableConfig" @headBtnClick="headBtnClick">
|
||||
<fvTable ref="tableIns" :tableConfig="articleTableConfig" @headBtnClick="headBtnClick">
|
||||
<template #empty>
|
||||
<el-empty description="暂无数据"/>
|
||||
</template>
|
||||
@@ -14,7 +14,9 @@ import {deleteArticle} from "@/api/article";
|
||||
import fvSelect from '@/fvcomponents/fvSelect/index.vue'
|
||||
|
||||
const router = useRouter();
|
||||
const researchFundSearchConfig = reactive([
|
||||
const route = useRoute();
|
||||
const routeArticleType = ref(route.query.type)
|
||||
const articleSearchConfig = reactive([
|
||||
{
|
||||
label: '文章标题',
|
||||
prop: 'articleTitle',
|
||||
@@ -54,7 +56,7 @@ const researchFundSearchConfig = reactive([
|
||||
},
|
||||
])
|
||||
const tableIns = ref()
|
||||
const researchFundTableConfig = reactive({
|
||||
const articleTableConfig = reactive({
|
||||
columns: [
|
||||
{
|
||||
prop: 'index',
|
||||
@@ -142,16 +144,28 @@ const researchFundTableConfig = reactive({
|
||||
],
|
||||
params: {}
|
||||
})
|
||||
const searchResearchFund = (val) => {
|
||||
|
||||
const searchArticle = (val) => {
|
||||
let obj = {...val}
|
||||
if (obj.dateValue) {
|
||||
obj.startGenerationTime = obj.dateValue[0]
|
||||
obj.endGenerationTime = obj.dateValue[1]
|
||||
delete obj.dateValue
|
||||
}
|
||||
researchFundTableConfig.params = obj
|
||||
articleTableConfig.params = obj
|
||||
tableIns.value.refresh()
|
||||
}
|
||||
const init = async () => {
|
||||
if(routeArticleType.value){
|
||||
nextTick(()=>{
|
||||
console.info("🚀 ~method:articleSearchConfig -----", articleSearchConfig[1].component.props)
|
||||
searchArticle({articleType:routeArticleType.value})
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
init()
|
||||
|
||||
const headBtnClick = (key) => {
|
||||
switch (key) {
|
||||
case 'add':
|
||||
|
||||
@@ -125,7 +125,7 @@
|
||||
<div class="tag"></div>
|
||||
<span>通知公告</span>
|
||||
</div>
|
||||
<div class="more" @click="goToArticleList">
|
||||
<div class="more" @click="goToArticleList('0')">
|
||||
<span>更多</span>
|
||||
<el-icon color="#1F63E6" size="18">
|
||||
<ArrowRight/>
|
||||
@@ -221,7 +221,7 @@
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="24" :md="24" :lg="10" :xl="10">
|
||||
<el-card shadow="never" class="todo-bg">
|
||||
<el-tabs v-model="docActiveTab" editable @tab-add="goToArticleList">
|
||||
<el-tabs v-model="docActiveTab" editable @tab-add="goToArticleList('',docActiveTab)">
|
||||
<template #add-icon>
|
||||
<div style="white-space: nowrap;display: flex;align-items: center">
|
||||
更多
|
||||
@@ -562,9 +562,25 @@ const handleGoToArticleDetail = (row) => {
|
||||
}
|
||||
})
|
||||
}
|
||||
const goToArticleList = () => {
|
||||
const goToArticleList = (type,otherHelpType) => {
|
||||
let queryType=''
|
||||
if(type){
|
||||
queryType=type
|
||||
}else{
|
||||
console.info("🚀 ~method:'otherHelpType' -----", otherHelpType)
|
||||
if(otherHelpType=='first'){
|
||||
queryType= '1'
|
||||
}else if(otherHelpType=='second'){
|
||||
queryType= '2'
|
||||
}else if(otherHelpType=='third'){
|
||||
queryType= '3'
|
||||
}
|
||||
}
|
||||
router.push({
|
||||
name: 'Manage',
|
||||
query:{
|
||||
type: queryType
|
||||
}
|
||||
})
|
||||
}
|
||||
const goToResearchFund = () => {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<fvSearchForm :searchConfig="searchConfig" @search="search" style="margin-left: 16px"></fvSearchForm>
|
||||
<fvSearchForm :searchConfig="searchConfig" @search="search" searchProp="state" :searchValue="route.query.state" style="margin-left: 16px"></fvSearchForm>
|
||||
<fvTable ref="tableIns" :tableConfig="tableConfig">
|
||||
<template #empty>
|
||||
<el-empty description="暂无数据"/>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<fvSearchForm :searchConfig="searchConfig" @search="search" style="margin-left: 16px"></fvSearchForm>
|
||||
<fvSearchForm :searchConfig="searchConfig" @search="search" searchProp="state" :searchValue="route.query.state" style="margin-left: 16px"></fvSearchForm>
|
||||
<fvTable ref="tableIns" :tableConfig="tableConfig">
|
||||
<template #empty>
|
||||
<el-empty description="暂无数据"/>
|
||||
|
||||
Reference in New Issue
Block a user