Browse Source

政策文件搜索

master
KeXuCong 1 month ago
parent
commit
e80437e16e
  1. 17
      jwtech-pc-page/src/views/policyDoc/components/docWrap.vue
  2. 41
      jwtech-pc-page/src/views/policyDoc/index.vue

17
jwtech-pc-page/src/views/policyDoc/components/docWrap.vue

@ -32,6 +32,10 @@ import { zhxxList } from "@/api/zhxx";
export default {
name: "docWrap",
props: {
isSearch: {
type: Boolean,
default: false
},
title: {
type: String,
default: "政策文件"
@ -40,6 +44,10 @@ export default {
type: String,
default: "1"
},
proTotal: {
type: Number,
default: 0
},
docData: {
type: Array,
default: () => []
@ -47,7 +55,7 @@ export default {
},
data() {
return {
total: 10,
total: 0,
pageSizes: [10, 20, 30, 50],
docDataList: [],
queryForm: {
@ -65,7 +73,12 @@ export default {
};
},
mounted() {
this.getResult();
if (!this.isSearch) {
this.getResult();
} else {
this.docDataList = this.docData;
this.total = this.proTotal;
}
},
methods: {
getResult() {

41
jwtech-pc-page/src/views/policyDoc/index.vue

@ -20,22 +20,30 @@
</el-form>
</div>
<div class="docs-wrap">
<doc-wrap
v-for="(item, index) in zhxxType"
:key="item.title"
:title="item.title"
:type="item.value"
:docData="[
{ id: 1, title: '标题1', content: '内容1', time: '2020-11-11' },
{ id: 2, title: '标题2', content: '内容2', time: '2020-11-12' }
]"
style="margin-bottom: 20px;"
></doc-wrap>
<template v-if="isSearch">
<doc-wrap
:title="搜索结果"
:isSearch="true"
:docData="tableData"
:proTotal="total"
style="margin-bottom: 20px;"
></doc-wrap>
</template>
<template v-else>
<doc-wrap
v-for="(item, index) in zhxxType"
:key="item.title"
:title="item.title"
:type="item.value"
style="margin-bottom: 20px;"
></doc-wrap>
</template>
</div>
</div>
</template>
<script>
import docWrap from "./components/docWrap.vue";
import { zhxxList } from "@/api/zhxx";
export default {
components: {
docWrap
@ -59,6 +67,7 @@ export default {
pageSize: 10
},
tableData: [],
isSearch: false,
zhxxType: [
{ title: "政策法规", value: "1" },
{ title: "部门规章", value: "2" },
@ -68,7 +77,15 @@ export default {
},
mounted() {},
methods: {
getResult() {
zhxxList(this.queryForm).then(res => {
this.isSearch = true;
this.tableData = res.data.records;
this.total = res.data.total;
});
},
resetForm() {
this.isSearch = false;
this.queryForm = {
cv: {
name: "title",
@ -78,7 +95,7 @@ export default {
pageNum: 1,
pageSize: 10
};
this.getResult();
// this.getResult();
}
}
};

Loading…
Cancel
Save