guhongwei 4 gadi atpakaļ
vecāks
revīzija
a599a40349
1 mainītis faili ar 50 papildinājumiem un 9 dzēšanām
  1. 50 9
      src/views/adminCenter/policy/apply.vue

+ 50 - 9
src/views/adminCenter/policy/apply.vue

@@ -1,36 +1,77 @@
 <template>
-  <div id="apply">
+  <div id="list">
     <el-row>
-      <el-col :span="24" class="main"> test </el-col>
+      <el-col :span="24" class="main">
+        <el-col :span="24" class="one">
+          <data-table :fields="fields" :opera="opera" :data="list" :total="total" @query="search">
+            <template #options="{ item }">
+              <template v-if="item.prop === 'type'">
+                <el-option v-for="(i, index) in typeList" :key="`type-${index}`" :label="i" :value="i"></el-option>
+              </template>
+            </template>
+          </data-table>
+        </el-col>
+      </el-col>
     </el-row>
   </div>
 </template>
 
 <script>
 import { mapState, createNamespacedHelpers } from 'vuex';
+const { mapActions: policy } = createNamespacedHelpers('policy');
 export default {
-  name: 'apply',
+  name: 'list',
   props: {},
   components: {},
   data: function () {
-    return {};
+    return {
+      list: [],
+      total: 0,
+      opera: [],
+      fields: [{ label: '创新券类型', prop: 'type', filter: 'select' }],
+    };
+  },
+  created() {
+    this.search();
+  },
+  methods: {
+    ...policy(['query', 'update']),
+    async search({ skip = 0, limit = 10, ...info } = {}) {
+      const res = await this.query({ skip, limit, ...info });
+      if (this.$checkRes(res)) {
+        this.$set(this, `list`, res.data);
+        this.$set(this, `total`, res.total);
+      }
+    },
   },
-  created() {},
-  methods: {},
   computed: {
     ...mapState(['user']),
+    type() {
+      return this.$route.query.type;
+    },
   },
   metaInfo() {
     return { title: this.$route.meta.title };
   },
   watch: {
-    test: {
+    type: {
       deep: true,
       immediate: true,
-      handler(val) {},
+      handler(val) {
+        this.search();
+      },
     },
   },
 };
 </script>
 
-<style lang="less" scoped></style>
+<style lang="less" scoped>
+.main {
+  border-radius: 10px;
+  box-shadow: 0 0 5px #cccccc;
+  padding: 20px;
+}
+.main:hover {
+  box-shadow: 0 0 5px #409eff;
+}
+</style>