|
@@ -1,22 +1,78 @@
|
|
|
<template>
|
|
|
<div id="index">
|
|
|
- <van-row>
|
|
|
- <van-col span="24" class="main"> test </van-col>
|
|
|
- </van-row>
|
|
|
+ <admin-frame @search="search" :limit="limit" :total="total" topType="2" @back="back" @add="toAdd" :useNav="false">
|
|
|
+ <template v-slot:info>
|
|
|
+ <list-1 :list="list" @toView="toView"></list-1>
|
|
|
+ </template>
|
|
|
+ </admin-frame>
|
|
|
+ <van-dialog class="dialog" v-model="dialog.show" :title="dialog.title" :show-confirm-button="false" show-cancel-button cancel-button-text="返回">
|
|
|
+ <info-1 :info="info" v-if="dialog.type == '1'"></info-1>
|
|
|
+ <search-1 :form="searhForm" v-else-if="dialog.type == '2'" @reseat="reseat" @onSubmit="onSubmit"></search-1>
|
|
|
+ </van-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+import list1 from '@/layout/learning/sociology/list-1.vue';
|
|
|
+import info1 from '@/layout/learning/sociology/info-1.vue';
|
|
|
+import search1 from '@/layout/learning/sociology/search-1.vue';
|
|
|
+import adminFrame from '@common/src/components/mobile-frame/mobile-main.vue';
|
|
|
import { mapState, createNamespacedHelpers } from 'vuex';
|
|
|
export default {
|
|
|
name: 'index',
|
|
|
props: {},
|
|
|
- components: {},
|
|
|
+ components: {
|
|
|
+ adminFrame,
|
|
|
+ list1,
|
|
|
+ info1,
|
|
|
+ search1,
|
|
|
+ },
|
|
|
data: function () {
|
|
|
- return {};
|
|
|
+ return {
|
|
|
+ list: [],
|
|
|
+ total: 0,
|
|
|
+ limit: 5,
|
|
|
+ // 查询
|
|
|
+ searhForm: {},
|
|
|
+ // 弹框
|
|
|
+ dialog: { show: false, title: '详细信息', type: '1' },
|
|
|
+ // 详细信息
|
|
|
+ info: {},
|
|
|
+ };
|
|
|
+ },
|
|
|
+ async created() {
|
|
|
+ await this.search();
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ async search({ skip = 0, limit = this.limit, searchName, ...info } = {}) {
|
|
|
+ if (searchName) info.name = searchName;
|
|
|
+ console.log(this.searhForm);
|
|
|
+ },
|
|
|
+ // 查看信息
|
|
|
+ async toView(data) {
|
|
|
+ this.$set(this, `info`, data);
|
|
|
+ this.dialog = { show: true, title: '详细信息', type: '1' };
|
|
|
+ },
|
|
|
+ // 添加查询条件
|
|
|
+ toAdd() {
|
|
|
+ this.dialog = { show: true, title: '查询条件', type: '2' };
|
|
|
+ },
|
|
|
+ // 重置条件
|
|
|
+ reseat() {
|
|
|
+ this.searhForm = {};
|
|
|
+ this.dialog = { show: false, title: '查询条件', type: '2' };
|
|
|
+ this.search();
|
|
|
+ },
|
|
|
+ // 提交查询
|
|
|
+ onSubmit({ data }) {
|
|
|
+ this.search(data);
|
|
|
+ this.dialog = { show: false, title: '查询条件', type: '2' };
|
|
|
+ },
|
|
|
+ // 返回
|
|
|
+ back() {
|
|
|
+ this.$router.push({ path: '/learning/index' });
|
|
|
+ },
|
|
|
},
|
|
|
- created() {},
|
|
|
- methods: {},
|
|
|
computed: {
|
|
|
...mapState(['user']),
|
|
|
},
|
|
@@ -33,4 +89,11 @@ export default {
|
|
|
};
|
|
|
</script>
|
|
|
|
|
|
-<style lang="less" scoped></style>
|
|
|
+<style lang="less" scoped>
|
|
|
+.dialog {
|
|
|
+ /deep/.van-dialog__content {
|
|
|
+ max-height: 350px;
|
|
|
+ overflow-y: auto;
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|