guhongwei 4 سال پیش
والد
کامیت
3a571981ce
5فایلهای تغییر یافته به همراه322 افزوده شده و 0 حذف شده
  1. 17 0
      src/router/index.js
  2. 3 0
      src/store/index.js
  3. 163 0
      src/views/live/detail.vue
  4. 107 0
      src/views/live/index.vue
  5. 32 0
      src/views/product/index.vue

+ 17 - 0
src/router/index.js

@@ -76,6 +76,23 @@ export default new Router({
           component: () => import('../views/user/detail.vue'),
           meta: { title: '用户信息管理' },
         },
+        // 审核管理
+        {
+          path: '/product',
+          component: () => import('../views/product/index.vue'),
+          meta: { title: '审核管理' },
+        },
+        // 展会管理
+        {
+          path: '/live',
+          component: () => import('../views/live/index.vue'),
+          meta: { title: '展会管理' },
+        },
+        {
+          path: '/live/detail',
+          component: () => import('../views/live/detail.vue'),
+          meta: { title: '展会信息管理' },
+        },
       ],
     },
     {

+ 3 - 0
src/store/index.js

@@ -12,6 +12,8 @@ import personal from '@common/src/store/personal';
 import organization from '@common/src/store/organization';
 // 专家
 import expert from '@common/src/store/expert';
+// 展会
+import dock from '@common/src/store/dock';
 
 Vue.use(Vuex);
 
@@ -25,5 +27,6 @@ export default new Vuex.Store({
     personal,
     organization,
     expert,
+    dock,
   },
 });

+ 163 - 0
src/views/live/detail.vue

@@ -0,0 +1,163 @@
+<template>
+  <div id="detail">
+    <el-row>
+      <el-col :span="24" class="main">
+        <el-col :span="24" class="back">
+          <el-button type="primary" size="mini" @click="back">返回</el-button>
+        </el-col>
+        <el-col :span="24" class="detail">
+          <data-form :data="form" :fields="formFields" :rules="rules" @save="toSave">
+            <template #custom="{item,form}">
+              <template v-if="item.model == 'start_time'">
+                <el-date-picker
+                  v-model="form.start_time"
+                  type="datetime"
+                  placeholder="请选择开始时间"
+                  format="yyyy-MM-dd HH:mm:ss"
+                  value-format="yyyy-MM-dd HH:mm:ss"
+                >
+                </el-date-picker>
+              </template>
+              <template v-else-if="item.model == 'end_time'">
+                <el-date-picker
+                  v-model="form.end_time"
+                  type="datetime"
+                  placeholder="请选择结束时间"
+                  format="yyyy-MM-dd HH:mm:ss"
+                  value-format="yyyy-MM-dd HH:mm:ss"
+                >
+                </el-date-picker>
+              </template>
+              <template v-else-if="item.model == 'province'">
+                <el-select v-model="form.province" placeholder="请选择省份" @change="changeshenge" filterable clearable>
+                  <el-option v-for="item in provinceList" :key="item.code" :label="item.name" :value="item.code"> </el-option>
+                </el-select>
+              </template>
+              <template v-else-if="item.model == 'place'">
+                <el-select v-model="form.place" placeholder="请选择市区" filterable clearable>
+                  <el-option v-for="item in placeList" :key="item.code" :label="item.name" :value="item.code"> </el-option>
+                </el-select>
+              </template>
+            </template>
+          </data-form>
+        </el-col>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import dataForm from '@common/src/components/frame/form.vue';
+import { mapState, createNamespacedHelpers } from 'vuex';
+const { mapActions: dock } = createNamespacedHelpers('dock');
+export default {
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+  name: 'detail',
+  props: {},
+  components: {
+    dataForm,
+  },
+  data: function() {
+    return {
+      formFields: [
+        { label: '标题', model: 'title' },
+        { label: '开始时间', model: 'start_time', custom: true },
+        { label: '结束时间', model: 'end_time', custom: true },
+        { label: '省份', model: 'province', custom: true },
+        { label: '市区', model: 'place', custom: true },
+        { label: '负责人', model: 'adminuser' },
+        { label: '联系电话', model: 'phone' },
+        { label: '主办方', model: 'sponsor' },
+        { label: '承办方', model: 'organizer' },
+      ],
+      form: {},
+      rules: {
+        title: [{ required: true, message: '请输入标题' }],
+        start_time: [{ required: true, message: '请选择开始时间' }],
+        end_time: [{ required: true, message: '请选择结束时间' }],
+        province: [{ required: true, message: '请选择省份' }],
+        place: [{ required: true, message: '请选择市区' }],
+        adminuser: [{ required: true, message: '请输入负责人' }],
+        phone: [{ required: true, message: '请输入联系电话' }],
+        sponsor: [{ required: true, message: '请输入主办方' }],
+        organizer: [{ required: true, message: '请输入承办方' }],
+      },
+      // 省市
+      provinceList: [
+        {
+          name: '吉林省',
+          code: '110000',
+        },
+      ],
+      placeList: [
+        { name: '长春市', code: '210000' },
+        { name: '吉林市', code: '210001' },
+      ],
+    };
+  },
+  async created() {
+    await this.search();
+  },
+  methods: {
+    ...dock(['query', 'fetch', 'create', 'update']),
+    async search() {
+      if (this.id) {
+        let res = await this.fetch(this.id);
+        if (this.$checkRes(res)) {
+          this.$set(this, `form`, res.data);
+        }
+      }
+    },
+    // 提交
+    async toSave({ data }) {
+      if (data.id) {
+        let res = await this.update(data);
+        if (this.$checkRes(res)) {
+          this.$message({
+            message: '信息修改成功',
+            type: 'success',
+          });
+          this.back();
+        }
+      } else {
+        let res = await this.create(data);
+        if (this.$checkRes(res)) {
+          this.$alert(`房间号:${res.data.room_id};` + `手机号:${res.data.phone};` + `密码:${res.data.password.secret};`, '成功', {
+            dangerouslyUseHTMLString: true,
+            confirmButtonText: '确定',
+            type: 'success',
+            center: true,
+            callback: action => {
+              this.back();
+            },
+          });
+        }
+      }
+    },
+    // 返回
+    back() {
+      this.$router.push({ path: '/live' });
+    },
+    // 选择省,查询市
+    changeshenge() {},
+  },
+  computed: {
+    ...mapState(['user']),
+    id() {
+      return this.$route.query.id;
+    },
+  },
+  watch: {},
+};
+</script>
+
+<style lang="less" scoped>
+.main {
+  .back {
+    text-align: right;
+    margin: 0 0 10px 0;
+  }
+}
+</style>

+ 107 - 0
src/views/live/index.vue

@@ -0,0 +1,107 @@
+<template>
+  <div id="index">
+    <el-row>
+      <el-col :span="24" class="main">
+        <el-col :span="24" class="add">
+          <el-button type="primary" size="mini" @click="add">添加</el-button>
+        </el-col>
+        <el-col :span="24" class="list">
+          <data-table :fields="fields" :opera="opera" :data="list" :total="total" @query="search" @edit="toEdit" @delete="toDelete"></data-table>
+        </el-col>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import dataTable from '@common/src/components/frame/filter-page-table.vue';
+import { mapState, createNamespacedHelpers } from 'vuex';
+const { mapActions: dock } = createNamespacedHelpers('dock');
+export default {
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+  name: 'index',
+  props: {},
+  components: {
+    dataTable,
+  },
+  data: function() {
+    return {
+      opera: [
+        {
+          label: '编辑',
+          method: 'edit',
+        },
+        {
+          label: '删除',
+          method: 'delete',
+        },
+      ],
+      fields: [
+        { label: '房间号', prop: 'room_id', filter: 'input' },
+        { label: '展会标题', prop: 'title', filter: 'input' },
+        { label: '负责人', prop: 'adminuser' },
+        { label: '联系电话', prop: 'phone' },
+        { label: '开始时间', prop: 'start_time' },
+        { label: '结束时间', prop: 'end_time' },
+        {
+          label: '状态',
+          prop: 'status',
+          format: item => {
+            return item === '0' ? '准备中' : item === '1' ? '开始' : '结束';
+          },
+        },
+      ],
+      list: [],
+      total: 0,
+    };
+  },
+  async created() {
+    await this.search();
+  },
+  methods: {
+    ...dock(['query', 'delete']),
+    // 查询列表
+    async search({ skip = 0, limit = 10, ...info } = {}) {
+      let res = await this.query({ skip, limit, ...info });
+      if (this.$checkRes(res)) {
+        this.$set(this, `list`, res.data);
+        this.$set(this, `total`, res.total);
+      }
+    },
+    // 修改
+    toEdit({ data }) {
+      this.$router.push({ path: '/live/detail', query: { id: data.id } });
+    },
+    // 删除
+    async toDelete({ data }) {
+      let res = await this.delete(data.id);
+      if (this.$checkRes(res)) {
+        this.$message({
+          message: '信息修改成功',
+          type: 'success',
+        });
+        this.search();
+      }
+    },
+    // 添加数据
+    add() {
+      this.$router.push({ path: '/live/detail' });
+    },
+  },
+  computed: {
+    ...mapState(['user']),
+  },
+  watch: {},
+};
+</script>
+
+<style lang="less" scoped>
+.main {
+  .add {
+    text-align: right;
+    margin: 0 0 10px 0;
+  }
+}
+</style>

+ 32 - 0
src/views/product/index.vue

@@ -0,0 +1,32 @@
+<template>
+  <div id="index">
+    <el-row>
+      <el-col :span="24">
+        <p>index</p>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import { mapState, createNamespacedHelpers } from 'vuex';
+export default {
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+  name: 'index',
+  props: {},
+  components: {},
+  data: function() {
+    return {};
+  },
+  created() {},
+  methods: {},
+  computed: {
+    ...mapState(['user']),
+  },
+  watch: {},
+};
+</script>
+
+<style lang="less" scoped></style>