zs 2 лет назад
Родитель
Сommit
6b5cee8987

Разница между файлами не показана из-за своего большого размера
+ 104 - 16305
package-lock.json


BIN
public/favicon.ico


+ 48 - 8
src/router/module/common.js

@@ -15,23 +15,63 @@ export default [
   },
   {
     path: '/homeIndex',
-    meta: { title: '中台', is_filter: true },
+    meta: { title: '系统首页', is_filter: true },
     component: () => import('@common/src/components/admin-frame/home.vue'),
     children: [
       {
         path: '/homeIndex',
-        meta: { title: '中台', is_filter: true },
+        meta: { title: '系统首页', is_filter: true },
         component: () => import('@/views/home/index.vue'),
       },
       {
-        path: '/tvadmin',
-        meta: { title: '电视节目管理', is_filter: true },
-        component: () => import('@/views/tvadmin/index.vue'),
+        path: '/shop',
+        meta: { title: '店铺信息', is_filter: true },
+        component: () => import('@/views/shop/index.vue'),
       },
       {
-        path: '/tvadmin/add',
-        meta: { title: '信息管理', is_filter: true },
-        component: () => import('@/views/tvadmin/add.vue'),
+        path: '/table',
+        meta: { title: '桌台管理', is_filter: true },
+        component: () => import('@/views/table/index.vue'),
+      },
+      {
+        path: '/table/add',
+        meta: { title: '桌台信息管理', is_filter: true },
+        component: () => import('@/views/table/add.vue'),
+      },
+      {
+        path: '/order',
+        meta: { title: '订单管理', is_filter: true },
+        component: () => import('@/views/order/index.vue'),
+      },
+      {
+        path: '/order/add',
+        meta: { title: '订单信息管理', is_filter: true },
+        component: () => import('@/views/order/add.vue'),
+      },
+      {
+        path: '/goodsTags',
+        meta: { title: '商品标签管理', is_filter: true },
+        component: () => import('@/views/goodsTags/index.vue'),
+      },
+      {
+        path: '/goodsTags/add',
+        meta: { title: '商品标签信息管理', is_filter: true },
+        component: () => import('@/views/goodsTags/add.vue'),
+      },
+      {
+        path: '/goods',
+        meta: { title: '商品管理', is_filter: true },
+        component: () => import('@/views/goods/index.vue'),
+      },
+      {
+        path: '/goods/add',
+        meta: { title: '商品信息管理', is_filter: true },
+        component: () => import('@/views/goods/add.vue'),
+      },
+      {
+        path: '/password',
+        meta: { title: '修改密码', is_filter: true },
+        component: () => import('@/views/password/index.vue'),
       },
     ],
   },

+ 105 - 0
src/views/goods/add.vue

@@ -0,0 +1,105 @@
+<template>
+  <div id="add">
+    <el-row>
+      <el-col :span="24" class="main animate__animated animate__backInRight">
+        <el-col :span="24" class="one">
+          <c-search :is_title="true" :is_back="true" @toBack="toBack"></c-search>
+        </el-col>
+        <el-col :span="24" class="two">
+          <data-form :fields="fields" :form="form" :rules="rules" @save="toSave">
+            <template #type>
+              <el-option v-for="i in typeList" :key="i.dict_value" :label="i.dict_label" :value="i.dict_value"></el-option>
+            </template>
+            <template #is_use>
+              <el-option v-for="i in is_useList" :key="i.dict_value" :label="i.dict_label" :value="i.dict_value"></el-option>
+            </template>
+            <template #file="{ item }">
+              <c-upload v-model="form[item.model]" url="/files/padmin/upload" accept="" listType="picture" :limit="1"></c-upload>
+            </template>
+          </data-form>
+        </el-col>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import { is_use } from '@common/src/layout/site';
+import { mapState, createNamespacedHelpers } from 'vuex';
+// const { mapActions } = createNamespacedHelpers('program');
+export default {
+  name: 'add',
+  props: {},
+  components: {},
+  data: function () {
+    return {
+      rules: {
+        name: [{ required: false, message: '请输入商品名称', trigger: 'blur' }],
+        stock: [{ required: false, message: '请输入商品库存', trigger: 'blur' }],
+        price: [{ required: false, message: '请输入商品价格', trigger: 'blur' }],
+        type: [{ required: false, message: '请选择商品类型', trigger: 'change' }],
+        file: [{ required: false, message: '请选择商品图片', trigger: 'change' }],
+        is_use: [{ required: false, message: '请选择是否启用', trigger: 'change' }],
+      },
+      fields: [
+        { label: '商品类型', model: 'type', type: 'select' },
+        { label: '商品名称', model: 'name' },
+        { label: '商品规格', model: 'spec' },
+        { label: '商品库存', model: 'stock', type: 'number' },
+        { label: '商品价格', model: 'price', type: 'number' },
+        { label: '商品图片', model: 'file', custom: true },
+        { label: '是否启用', model: 'is_use', type: 'select' },
+      ],
+      form: {},
+      is_useList: is_use,
+      // 节目类型
+      typeList: [],
+    };
+  },
+  created() {
+    this.search();
+  },
+  methods: {
+    ...mapActions(['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 }) {
+      let res;
+      // if (data.id) res = await this.update(data);
+      // else res = await this.create(data);
+      // if (this.$checkRes(res, `维护信息成功`, res.errmsg)) this.toBack();
+    },
+
+    // 返回
+    toBack() {
+      window.history.go('-1');
+    },
+  },
+  computed: {
+    ...mapState(['user']),
+    id() {
+      return this.$route.query.id;
+    },
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+  watch: {
+    test: {
+      deep: true,
+      immediate: true,
+      handler(val) {},
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped></style>

+ 24 - 44
src/views/tvadmin/index.vue

@@ -20,20 +20,13 @@
         </el-col>
       </el-col>
     </el-row>
-    <!-- <c-dialog :dialog="dialog" @toClose="toClose">
-      <template slot="info">
-        <el-col :span="24" class="dialog_1" v-if="dialog.type == '1'">
-          <video :src="info.path" controls autoplay></video>
-        </el-col>
-      </template>
-    </c-dialog> -->
   </div>
 </template>
 
 <script>
-import { is_use, pro_type } from '@common/src/layout/site';
+import { is_use, goods_type } from '@common/src/layout/site';
 import { mapState, createNamespacedHelpers } from 'vuex';
-const { mapActions } = createNamespacedHelpers('program');
+// const { mapActions } = createNamespacedHelpers('program');
 export default {
   name: 'index',
   props: {},
@@ -46,8 +39,9 @@ export default {
       total: 0,
       fields: [
         { label: '序号', options: { type: 'index' } },
+        { label: '商品名称', model: 'name', isSearch: true },
         {
-          label: '节目类型',
+          label: '商品类型',
           model: 'type',
           type: 'select',
           format: (i) => {
@@ -57,10 +51,9 @@ export default {
           },
           isSearch: true,
         },
-        { label: '名称', model: 'name', isSearch: true },
-        { label: '视频流', model: 'path', isSearch: true },
-        { label: '排序', model: 'sort', isSearch: true },
-
+        { label: '价格', model: 'price' },
+        { label: '规格', model: 'spec' },
+        { label: '库存', model: 'stock' },
         {
           label: '是否启用',
           model: 'is_use',
@@ -74,17 +67,13 @@ export default {
         },
       ],
       opera: [
+        { label: '生成桌码', method: 'code' },
         { label: '修改', method: 'edit' },
         { label: '删除', method: 'del', confirm: true, type: 'danger' },
-        // { label: '观看', method: 'view' },
       ],
       is_useList: is_use,
-      // 节目类型
-      typeList: pro_type,
-      // 详细信息
-      info: {},
-      // 弹框
-      dialog: { title: '观看', show: false, type: '1' },
+      // 商品类型
+      typeList: goods_type,
     };
   },
   created() {
@@ -92,44 +81,35 @@ export default {
   },
   mounted() {},
   methods: {
-    ...mapActions(['query', 'fetch', 'delete']),
+    // ...mapActions(['query', 'fetch', 'delete']),
     async search({ skip = 0, limit = 10, ...info } = {}) {
-      let res = await this.query({ skip, limit, ...info, ...this.searchInfo });
-      if (this.$checkRes(res)) {
-        this.$set(this, `list`, res.data);
-        this.$set(this, `total`, res.total);
-      }
+      // let res = await this.query({ skip, limit, ...info, ...this.searchInfo });
+      // if (this.$checkRes(res)) {
+      //   this.$set(this, `list`, res.data);
+      //   this.$set(this, `total`, res.total);
+      // }
     },
     btSearch(query) {
       this.$set(this, `searchInfo`, query);
       this.search();
     },
+    // 生成桌码
+    code() {
+      console.log('1');
+    },
     // 添加
     toAdd() {
-      this.$router.push({ path: '/tvadmin/add' });
+      this.$router.push({ path: '/goods/add' });
     },
     // 修改
     toEdit({ data }) {
-      this.$router.push({ path: '/tvadmin/add', query: { id: data._id } });
+      this.$router.push({ path: '/goods/add', query: { id: data._id } });
     },
     // 删除信息
     async toDel({ data }) {
-      let res = await this.delete(data.id);
-      if (this.$checkRes(res, `刪除信息成功`, `${res.errmsg}`)) this.search();
+      // let res = await this.delete(data.id);
+      // if (this.$checkRes(res, `刪除信息成功`, `${res.errmsg}`)) this.search();
     },
-    // // 观看
-    // async toView({ data }) {
-    //   let res = await this.fetch(data.id);
-    //   if (this.$checkRes(res)) {
-    //     this.$set(this, `info`, res.data);
-    //     this.$set(this, `dialog`, { title: res.data.name, show: true, type: '1' });
-    //   }
-    // },
-    // // 关闭弹框
-    // toClose() {
-    //   this.$set(this, `info`, {});
-    //   this.$set(this, `dialog`, { title: '观看', show: false, type: '1' });
-    // },
   },
   computed: {
     ...mapState(['user']),

+ 90 - 0
src/views/goodsTags/add.vue

@@ -0,0 +1,90 @@
+<template>
+  <div id="add">
+    <el-row>
+      <el-col :span="24" class="main animate__animated animate__backInRight">
+        <el-col :span="24" class="one">
+          <c-search :is_title="true" :is_back="true" @toBack="toBack"></c-search>
+        </el-col>
+        <el-col :span="24" class="two">
+          <data-form :fields="fields" :form="form" :rules="rules" @save="toSave">
+            <template #is_use>
+              <el-option v-for="i in is_useList" :key="i.dict_value" :label="i.dict_label" :value="i.dict_value"></el-option>
+            </template>
+          </data-form>
+        </el-col>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import { is_use } from '@common/src/layout/site';
+import { mapState, createNamespacedHelpers } from 'vuex';
+// const { mapActions } = createNamespacedHelpers('program');
+export default {
+  name: 'add',
+  props: {},
+  components: {},
+  data: function () {
+    return {
+      rules: {
+        name: [{ required: false, message: '请输入标签名称', trigger: 'blur' }],
+        code: [{ required: false, message: '请输入标签编码', trigger: 'blur' }],
+        is_use: [{ required: false, message: '请选择是否启用', trigger: 'change' }],
+      },
+      fields: [
+        { label: '标签名称', model: 'name' },
+        { label: '标签编码', model: 'code' },
+        { label: '标签图标', model: 'icon' },
+        { label: '排序', model: 'sort', type: 'number' },
+        { label: '是否启用', model: 'is_use', type: 'select' },
+      ],
+      form: {},
+      is_useList: is_use,
+    };
+  },
+  created() {
+    this.search();
+  },
+  methods: {
+    ...mapActions(['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 }) {
+      // let res;
+      // if (data.id) res = await this.update(data);
+      // else res = await this.create(data);
+      // if (this.$checkRes(res, `维护信息成功`, res.errmsg)) this.toBack();
+    },
+    // 返回
+    toBack() {
+      window.history.go('-1');
+    },
+  },
+  computed: {
+    ...mapState(['user']),
+    id() {
+      return this.$route.query.id;
+    },
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+  watch: {
+    test: {
+      deep: true,
+      immediate: true,
+      handler(val) {},
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped></style>

+ 119 - 0
src/views/goodsTags/index.vue

@@ -0,0 +1,119 @@
+<template>
+  <div id="index">
+    <el-row>
+      <el-col :span="24" class="main animate__animated animate__backInRight">
+        <el-col :span="24" class="one">
+          <c-search :is_search="true" :fields="fields" @search="btSearch">
+            <template #type>
+              <el-option v-for="i in typeList" :key="i.dict_value" :label="i.dict_label" :value="i.dict_value"></el-option>
+            </template>
+            <template #is_use>
+              <el-option v-for="i in is_useList" :key="i.dict_value" :label="i.dict_label" :value="i.dict_value"></el-option>
+            </template>
+          </c-search>
+        </el-col>
+        <el-col :span="24" class="two">
+          <c-button @toAdd="toAdd"></c-button>
+        </el-col>
+        <el-col :span="24" class="thr">
+          <data-table :fields="fields" :opera="opera" @query="search" :data="list" :total="total" @edit="toEdit" @del="toDel"> </data-table>
+        </el-col>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import { is_use } from '@common/src/layout/site';
+import { mapState, createNamespacedHelpers } from 'vuex';
+// const { mapActions } = createNamespacedHelpers('program');
+export default {
+  name: 'index',
+  props: {},
+  components: {},
+  data: function () {
+    return {
+      // 查询
+      searchInfo: {},
+      list: [],
+      total: 0,
+      fields: [
+        { label: '序号', options: { type: 'index' } },
+        { label: '标签名称', model: 'name', isSearch: true },
+        { label: '标签编码', model: 'code', isSearch: true },
+        { label: '排序', model: 'sort' },
+        {
+          label: '是否启用',
+          model: 'is_use',
+          type: 'select',
+          format: (i) => {
+            let data = this.is_useList.find((r) => r.dict_value == i);
+            if (data) return data.dict_label;
+            else return '暂无';
+          },
+          isSearch: true,
+        },
+      ],
+      opera: [
+        { label: '修改', method: 'edit' },
+        { label: '删除', method: 'del', confirm: true, type: 'danger' },
+      ],
+      is_useList: is_use,
+    };
+  },
+  created() {
+    this.search();
+  },
+  mounted() {},
+  methods: {
+    // ...mapActions(['query', 'fetch', 'delete']),
+    async search({ skip = 0, limit = 10, ...info } = {}) {
+      // let res = await this.query({ skip, limit, ...info, ...this.searchInfo });
+      // if (this.$checkRes(res)) {
+      //   this.$set(this, `list`, res.data);
+      //   this.$set(this, `total`, res.total);
+      // }
+    },
+    btSearch(query) {
+      this.$set(this, `searchInfo`, query);
+      this.search();
+    },
+    // 添加
+    toAdd() {
+      this.$router.push({ path: '/goodsTags/add' });
+    },
+    // 修改
+    toEdit({ data }) {
+      this.$router.push({ path: '/goodsTags/add', query: { id: data._id } });
+    },
+    // 删除信息
+    async toDel({ data }) {
+      // let res = await this.delete(data.id);
+      // if (this.$checkRes(res, `刪除信息成功`, `${res.errmsg}`)) this.search();
+    },
+  },
+  computed: {
+    ...mapState(['user']),
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+  watch: {
+    test: {
+      deep: true,
+      immediate: true,
+      handler(val) {},
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.dialog_1 {
+  video {
+    width: 100%;
+    height: 390px;
+    background-color: #000000;
+  }
+}
+</style>

+ 4 - 4
src/views/login.vue

@@ -2,10 +2,10 @@
   <div id="login">
     <el-row>
       <el-col :span="24" class="main animate__animated animate__backInRight">
-        <!-- <login-1 @toLogin="toLogin" @toRegister="toRegister"></login-1> -->
+        <login-1 @toLogin="toLogin" @toRegister="toRegister"></login-1>
         <!-- <login-2 @toLogin="toLogin" @toRegister="toRegister"></login-2> -->
         <!-- <login-3 @toLogin="toLogin" @toRegister="toRegister"></login-3> -->
-        <login-4 @toLogin="toLogin" @toRegister="toRegister"></login-4>
+        <!-- <login-4 @toLogin="toLogin" @toRegister="toRegister"></login-4> -->
       </el-col>
     </el-row>
   </div>
@@ -18,10 +18,10 @@ export default {
   name: 'login',
   props: {},
   components: {
-    // login1: () => import('@/components/login/login-1.vue'),
+    login1: () => import('@/components/login/login-1.vue'),
     // login2: () => import('@/components/login/login-2.vue'),
     // login3: () => import('@/components/login/login-3.vue'),
-    login4: () => import('@/components/login/login-4.vue'),
+    // login4: () => import('@/components/login/login-4.vue'),
   },
   data: function () {
     return {};

+ 2 - 2
src/views/tvadmin/add.vue

@@ -21,7 +21,7 @@
 </template>
 
 <script>
-import { is_use, pro_type } from '@common/src/layout/site';
+import { is_use, order_type } from '@common/src/layout/site';
 import { mapState, createNamespacedHelpers } from 'vuex';
 const { mapActions } = createNamespacedHelpers('program');
 export default {
@@ -41,7 +41,7 @@ export default {
       form: {},
       is_useList: is_use,
       // 节目类型
-      typeList: pro_type,
+      typeList: order_type,
     };
   },
   created() {

+ 108 - 0
src/views/order/index.vue

@@ -0,0 +1,108 @@
+<template>
+  <div id="index">
+    <el-row>
+      <el-col :span="24" class="main animate__animated animate__backInRight">
+        <el-col :span="24" class="one">
+          <c-search :is_search="true" :fields="fields" @search="btSearch"></c-search>
+        </el-col>
+        <el-col :span="24" class="two">
+          <data-table :fields="fields" :opera="opera" @query="search" :data="list" :total="total" @view="toView" @pay="toPay"> </data-table>
+        </el-col>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import { order_type } from '@common/src/layout/site';
+import { mapState, createNamespacedHelpers } from 'vuex';
+// const { mapActions } = createNamespacedHelpers('program');
+export default {
+  name: 'index',
+  props: {},
+  components: {},
+  data: function () {
+    return {
+      // 查询
+      searchInfo: {},
+      list: [],
+      total: 0,
+      fields: [
+        { label: '序号', options: { type: 'index' } },
+        { label: '订单号', model: 'order', isSearch: true },
+        { label: '下单时间', model: 'time' },
+        { label: '下单桌号', model: 'code' },
+        { label: '支付金额', model: 'money' },
+        { label: '商品数量', model: 'num' },
+        {
+          label: '订单类型',
+          model: 'type',
+          type: 'select',
+          format: (i) => {
+            let data = this.typeList.find((r) => r.dict_value == i);
+            if (data) return data.dict_label;
+            else return '暂无';
+          },
+          isSearch: true,
+        },
+        { label: '备注', model: 'remark' },
+      ],
+      opera: [
+        { label: '详情', method: 'view' },
+        { label: '收款', method: 'pay', confirm: true, type: 'danger' },
+      ],
+      // 订单类型
+      typeList: order_type,
+    };
+  },
+  created() {
+    this.search();
+  },
+  mounted() {},
+  methods: {
+    // ...mapActions(['query', 'fetch', 'delete']),
+    async search({ skip = 0, limit = 10, ...info } = {}) {
+      // let res = await this.query({ skip, limit, ...info, ...this.searchInfo });
+      // if (this.$checkRes(res)) {
+      //   this.$set(this, `list`, res.data);
+      //   this.$set(this, `total`, res.total);
+      // }
+    },
+    btSearch(query) {
+      this.$set(this, `searchInfo`, query);
+      this.search();
+    },
+    // 收款
+    toPay() {
+      console.log('收款');
+    },
+    // 详情
+    toView({ data }) {
+      this.$router.push({ path: '/order/add', query: { id: data._id } });
+    },
+  },
+  computed: {
+    ...mapState(['user']),
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+  watch: {
+    test: {
+      deep: true,
+      immediate: true,
+      handler(val) {},
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.dialog_1 {
+  video {
+    width: 100%;
+    height: 390px;
+    background-color: #000000;
+  }
+}
+</style>

+ 78 - 0
src/views/password/index.vue

@@ -0,0 +1,78 @@
+<template>
+  <div id="index">
+    <el-row>
+      <el-col :span="24" class="main animate__animated animate__backInRight">
+        <data-form :span="24" :fields="fields" :form="form" :rules="rules" @save="toSave"></data-form>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import { mapState, createNamespacedHelpers } from 'vuex';
+// const { mapActions: user } = createNamespacedHelpers('user');
+export default {
+  name: 'index',
+  props: {},
+  components: {},
+  data: function () {
+    return {
+      fields: [
+        { label: '新密码', model: 'password', type: 'password' },
+        { label: '确认新密码', model: 'ispassword', type: 'password' },
+      ],
+      form: {},
+      rules: {
+        password: [{ required: true, message: '请输入新密码' }],
+        ispassword: [
+          { required: true, message: '请输入确认新密码' },
+          {
+            trigger: 'blur',
+            validator: (rule, value, callback) => {
+              if (this.form.password !== value) {
+                callback(new Error('两次输入的密码不一致'));
+              } else {
+                callback();
+              }
+            },
+          },
+        ],
+      },
+    };
+  },
+  async created() {
+    await this.search();
+  },
+  methods: {
+    // ...user({ usRp: 'rp' }),
+    //查询
+    async search() {},
+    // 保存
+    async toSave({ data }) {
+      // let res = await this.uRp(data.password);
+      // this.$checkRes(res, '操作成功', res.errmsg);
+      this.logout();
+    },
+    // 退出登录
+    logout() {
+      localStorage.removeItem('token');
+      window.location.href = 'http://localhost:8005/login';
+    },
+  },
+  computed: {
+    ...mapState(['user']),
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+  watch: {
+    test: {
+      deep: true,
+      immediate: true,
+      handler(val) {},
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped></style>

+ 57 - 0
src/views/shop/index.vue

@@ -0,0 +1,57 @@
+<template>
+  <div id="index">
+    <el-row>
+      <el-col :span="24" class="main animate__animated animate__backInRight">
+        <data-form :span="24" :fields="fields" :form="form" :rules="rules" @save="onSubmit">
+          <template #logo="{ item }">
+            <c-upload v-model="form[item.model]" url="/files/padmin/upload" accept="" listType="picture" :limit="1"></c-upload>
+          </template>
+        </data-form>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import { mapState, createNamespacedHelpers } from 'vuex';
+export default {
+  name: 'index',
+  props: {},
+  components: {},
+  data: function () {
+    return {
+      form: {},
+      rules: {
+        name: [{ required: false, message: '请输入店铺名称', trigger: 'blur' }],
+        notice: [{ required: false, message: '请输入公告内容', trigger: 'blur' }],
+        logo: [{ required: false, message: '请选择首页图片', trigger: 'change' }],
+      },
+      fields: [
+        { label: '店铺名称', model: 'name' },
+        { label: '公告内容', model: 'notice' },
+        { label: '首页图片', model: 'logo', custom: true },
+      ],
+    };
+  },
+  created() {},
+  methods: {
+    // 提交保存
+    onSubmit() {},
+  },
+  computed: {
+    ...mapState(['user']),
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+  watch: {
+    test: {
+      deep: true,
+      immediate: true,
+      handler(val) {},
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped></style>

+ 94 - 0
src/views/table/add.vue

@@ -0,0 +1,94 @@
+<template>
+  <div id="add">
+    <el-row>
+      <el-col :span="24" class="main animate__animated animate__backInRight">
+        <el-col :span="24" class="one">
+          <c-search :is_title="true" :is_back="true" @toBack="toBack"></c-search>
+        </el-col>
+        <el-col :span="24" class="two">
+          <data-form :fields="fields" :form="form" :rules="rules" @save="toSave">
+            <template #type>
+              <el-option v-for="i in typeList" :key="i.dict_value" :label="i.dict_label" :value="i.dict_value"></el-option>
+            </template>
+            <template #is_use>
+              <el-option v-for="i in is_useList" :key="i.dict_value" :label="i.dict_label" :value="i.dict_value"></el-option>
+            </template>
+          </data-form>
+        </el-col>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import { is_use, table_type } from '@common/src/layout/site';
+import { mapState, createNamespacedHelpers } from 'vuex';
+// const { mapActions } = createNamespacedHelpers('program');
+export default {
+  name: 'add',
+  props: {},
+  components: {},
+  data: function () {
+    return {
+      rules: {
+        name: [{ required: false, message: '请输入桌号', trigger: 'blur' }],
+        type: [{ required: false, message: '请选择桌台类型', trigger: 'change' }],
+        is_use: [{ required: false, message: '请选择是否启用', trigger: 'change' }],
+      },
+      fields: [
+        { label: '桌台类型', model: 'type', type: 'select' },
+        { label: '桌号', model: 'name' },
+        { label: '备注', model: 'remark', type: 'textarea' },
+        { label: '是否启用', model: 'is_use', type: 'select' },
+      ],
+      form: {},
+      is_useList: is_use,
+      // 桌台类型
+      typeList: table_type,
+    };
+  },
+  created() {
+    this.search();
+  },
+  methods: {
+    ...mapActions(['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 }) {
+      let res;
+      // if (data.id) res = await this.update(data);
+      // else res = await this.create(data);
+      // if (this.$checkRes(res, `维护信息成功`, res.errmsg)) this.toBack();
+    },
+    // 返回
+    toBack() {
+      window.history.go('-1');
+    },
+  },
+  computed: {
+    ...mapState(['user']),
+    id() {
+      return this.$route.query.id;
+    },
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+  watch: {
+    test: {
+      deep: true,
+      immediate: true,
+      handler(val) {},
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped></style>

+ 136 - 0
src/views/table/index.vue

@@ -0,0 +1,136 @@
+<template>
+  <div id="index">
+    <el-row>
+      <el-col :span="24" class="main animate__animated animate__backInRight">
+        <el-col :span="24" class="one">
+          <c-search :is_search="true" :fields="fields" @search="btSearch">
+            <template #type>
+              <el-option v-for="i in typeList" :key="i.dict_value" :label="i.dict_label" :value="i.dict_value"></el-option>
+            </template>
+            <template #is_use>
+              <el-option v-for="i in is_useList" :key="i.dict_value" :label="i.dict_label" :value="i.dict_value"></el-option>
+            </template>
+          </c-search>
+        </el-col>
+        <el-col :span="24" class="two">
+          <c-button @toAdd="toAdd"></c-button>
+        </el-col>
+        <el-col :span="24" class="thr">
+          <data-table :fields="fields" :opera="opera" @query="search" :data="list" :total="total" @code="toCode" @edit="toEdit" @del="toDel"> </data-table>
+        </el-col>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import { is_use, table_type } from '@common/src/layout/site';
+import { mapState, createNamespacedHelpers } from 'vuex';
+// const { mapActions } = createNamespacedHelpers('program');
+export default {
+  name: 'index',
+  props: {},
+  components: {},
+  data: function () {
+    return {
+      // 查询
+      searchInfo: {},
+      list: [],
+      total: 0,
+      fields: [
+        { label: '序号', options: { type: 'index' } },
+        { label: '桌号', model: 'name', isSearch: true },
+        {
+          label: '桌台类型',
+          model: 'type',
+          type: 'select',
+          format: (i) => {
+            let data = this.typeList.find((r) => r.dict_value == i);
+            if (data) return data.dict_label;
+            else return '暂无';
+          },
+          isSearch: true,
+        },
+        { label: '备注', model: 'remark' },
+        {
+          label: '是否启用',
+          model: 'is_use',
+          type: 'select',
+          format: (i) => {
+            let data = this.is_useList.find((r) => r.dict_value == i);
+            if (data) return data.dict_label;
+            else return '暂无';
+          },
+          isSearch: true,
+        },
+      ],
+      opera: [
+        { label: '生成桌码', method: 'code' },
+        { label: '修改', method: 'edit' },
+        { label: '删除', method: 'del', confirm: true, type: 'danger' },
+      ],
+      is_useList: is_use,
+      // 桌台类型
+      typeList: table_type,
+    };
+  },
+  created() {
+    this.search();
+  },
+  mounted() {},
+  methods: {
+    // ...mapActions(['query', 'fetch', 'delete']),
+    async search({ skip = 0, limit = 10, ...info } = {}) {
+      // let res = await this.query({ skip, limit, ...info, ...this.searchInfo });
+      // if (this.$checkRes(res)) {
+      //   this.$set(this, `list`, res.data);
+      //   this.$set(this, `total`, res.total);
+      // }
+    },
+    btSearch(query) {
+      this.$set(this, `searchInfo`, query);
+      this.search();
+    },
+    // 生成桌码
+    toCode() {
+      console.log('1');
+    },
+    // 添加
+    toAdd() {
+      this.$router.push({ path: '/table/add' });
+    },
+    // 修改
+    toEdit({ data }) {
+      this.$router.push({ path: '/table/add', query: { id: data._id } });
+    },
+    // 删除信息
+    async toDel({ data }) {
+      // let res = await this.delete(data.id);
+      // if (this.$checkRes(res, `刪除信息成功`, `${res.errmsg}`)) this.search();
+    },
+  },
+  computed: {
+    ...mapState(['user']),
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+  watch: {
+    test: {
+      deep: true,
+      immediate: true,
+      handler(val) {},
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.dialog_1 {
+  video {
+    width: 100%;
+    height: 390px;
+    background-color: #000000;
+  }
+}
+</style>

+ 1 - 1
vue.config.js

@@ -23,7 +23,7 @@ module.exports = {
         target: 'http://broadcast.waityou24.cn',
       },
       '/projectadmin/api': {
-        target: 'http://www.freeskyghw.cn', //http://127.0.0.1:10102  http://www.freeskyghw.cn
+        target: 'http://broadcast.waityou24.cn', //http://127.0.0.1:10102  http://www.freeskyghw.cn
         changeOrigin: true,
         ws: false,
       },