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

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

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

Loading…
Cancel
Save