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