guhongwei 4 gadi atpakaļ
vecāks
revīzija
e87e16be9e

+ 22 - 16
src/layout/adminCenter/menuInfo.vue

@@ -22,59 +22,65 @@
             </el-menu-item> -->
             <el-menu-item index="1">
               <template slot="title">
-                <i class="el-icon-pie-chart"></i>
+                <i class="el-icon-setting"></i>
                 <span>展会管理</span>
               </template>
             </el-menu-item>
             <el-menu-item index="2">
               <template slot="title">
                 <i class="el-icon-pie-chart"></i>
-                <span>申请管理</span>
+                <span>图文管理</span>
               </template>
             </el-menu-item>
             <el-menu-item index="3">
               <template slot="title">
                 <i class="el-icon-pie-chart"></i>
-                <span>VIP用户</span>
+                <span>申请管理</span>
               </template>
             </el-menu-item>
             <el-menu-item index="4">
               <template slot="title">
-                <i class="el-icon-notebook-1"></i>
-                <span>交易备案</span>
+                <i class="el-icon-user-solid"></i>
+                <span>VIP用户</span>
               </template>
             </el-menu-item>
             <el-menu-item index="5">
               <template slot="title">
                 <i class="el-icon-notebook-1"></i>
-                <span>嘉宾访谈</span>
+                <span>交易备案</span>
               </template>
             </el-menu-item>
             <el-menu-item index="6">
               <template slot="title">
-                <i class="el-icon-notebook-1"></i>
-                <span>项目路演</span>
+                <i class="el-icon-user-solid"></i>
+                <span>嘉宾访谈</span>
               </template>
             </el-menu-item>
             <el-menu-item index="7">
               <template slot="title">
-                <i class="el-icon-notebook-1"></i>
-                <span>统计报表</span>
+                <i class="el-icon-video-camera-solid"></i>
+                <span>项目路演</span>
               </template>
             </el-menu-item>
             <el-menu-item index="8">
               <template slot="title">
-                <i class="el-icon-notebook-1"></i>
+                <i class="el-icon-s-operation"></i>
+                <span>统计报表</span>
+              </template>
+            </el-menu-item>
+            <el-menu-item index="9">
+              <template slot="title">
+                <i class="el-icon-pie-chart"></i>
                 <span>动态监测</span>
               </template>
             </el-menu-item>
-            <!-- <el-menu-item index="9">
+            <!-- <el-menu-item index="10">
               <template slot="title">
                 <i class="el-icon-refresh-right"></i>
                 <span>返回</span>
               </template>
             </el-menu-item> -->
-            <el-menu-item index="10">
+            <el-menu-item index="11">
               <template slot="title">
                 <i class="el-icon-circle-close"></i>
                 <span>退出登录</span>
@@ -112,14 +118,14 @@ export default {
     ...dock(['fetch', 'query', 'delete', 'update', 'fetch']),
     // 菜单跳转
     async selectMenu(key) {
-      if (key == '10') {
+      if (key == '11') {
         this.logout();
         this.$message({
           message: '退出登录成功',
           type: 'success',
         });
-        this.$router.push({ path: '/webLogin' });
-      } else if (key == '9') {
+        this.$router.push({ path: '/dockLogin' });
+      } else if (key == '10') {
         let res = await this.fetch(this.user.uid);
         if (res.data.room_id == '1005') {
           this.$router.push({ path: '/halltwo/directTwo', query: { id: res.data.id, title: res.data.title } });

+ 208 - 0
src/views/adminCenter/imgtxtdock/index.vue

@@ -0,0 +1,208 @@
+<template>
+  <div id="index">
+    <el-row>
+      <el-col :span="24">
+        <el-col :span="24" class="leftTop"> <span>|</span> <span>图文管理</span> </el-col>
+        <el-col :span="24" class="info">
+          <el-col :span="24" class="top">
+            <el-button type="primary" size="mini" @click="dialog = true">添加信息</el-button>
+          </el-col>
+          <el-col :span="24" class="list">
+            <data-table :fields="fields" :opera="opera" :data="list" :total="total" @edit="toEdit" @delete="toDelete" @query="search"></data-table>
+          </el-col>
+        </el-col>
+      </el-col>
+    </el-row>
+    <el-dialog title="信息管理" :visible.sync="dialog" @closed="handleClose" width="50%" :append-to-body="true">
+      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+        <el-form-item label="信息内容" prop="brief">
+          <el-input v-model="form.brief" type="textarea" placeholder="请输入信息内容"></el-input>
+        </el-form-item>
+        <el-form-item label="图片" prop="image">
+          <upload
+            :limit="6"
+            :data="form.image"
+            :uploadBtn="true"
+            type="image"
+            :url="`/files/image/upload`"
+            @upload="uploadSuccess"
+            @delete="uploadDelete"
+          ></upload>
+        </el-form-item>
+        <el-form-item label="视频文件" prop="file_path">
+          <uploadfile
+            :limit="1"
+            :data="form.file_path"
+            type="file_path"
+            listType=""
+            :url="'/files/imgpath/upload'"
+            @upload="sucfile"
+            @delete="delfile"
+          ></uploadfile>
+        </el-form-item>
+        <el-form-item>
+          <el-button type="primary" @click="save">保存</el-button>
+        </el-form-item>
+      </el-form>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import upload from '@/components/upload.vue';
+import uploadfile from '@/components/uploaddock.vue';
+import dataTable from '@/components/data-table.vue';
+import { mapState, createNamespacedHelpers } from 'vuex';
+const { mapActions: imgtxtdock } = createNamespacedHelpers('imgtxtdock');
+import moment from 'moment';
+export default {
+  name: 'index',
+  props: {},
+  components: {
+    dataTable,
+    upload,
+    uploadfile,
+  },
+  data: function() {
+    return {
+      // 展会id
+      dock_id: '',
+      opera: [
+        {
+          label: '修改',
+          icon: 'el-icon-edit',
+          method: 'edit',
+        },
+        {
+          label: '删除',
+          icon: 'el-icon-delete',
+          method: 'delete',
+        },
+      ],
+      fields: [
+        { label: '信息内容', prop: 'brief' },
+        { label: '发布时间', prop: 'create_date' },
+      ],
+      list: [],
+      total: 0,
+      // 添加数据
+      dialog: false,
+      form: {},
+      rules: {},
+    };
+  },
+  async created() {
+    this.$set(this, `dock_id`, this.user.uid);
+    await this.search();
+  },
+  methods: {
+    ...imgtxtdock(['query', 'create', 'update', 'delete']),
+    async search({ skip = 0, limit = 10, ...info } = {}) {
+      let res = await this.query({ skip, limit, dock_id: this.dock_id, ...info });
+      if (this.$checkRes(res)) {
+        for (const val of res.data) {
+          let create_date = moment(val.meta.createdAt).format('yyyy-MM-DD hh:mm');
+          val.create_date = create_date;
+        }
+        this.$set(this, `list`, res.data);
+        this.$set(this, `total`, res.total);
+      }
+    },
+    // 修改
+    toEdit({ data }) {
+      this.$set(this, `form`, data);
+      this.dialog = true;
+    },
+    // 保存
+    async save() {
+      let data = this.form;
+      if (data.id) {
+        let res = await this.update(data);
+        if (this.$checkRes(res)) {
+          this.$message({
+            message: '修改信息成功',
+            type: 'success',
+          });
+          this.handleClose();
+        }
+      } else {
+        data.dock_id = this.dock_id;
+        data.user_name = this.user.adminuser;
+        let res = await this.create(data);
+        if (this.$checkRes(res)) {
+          this.$message({
+            message: '添加信息成功',
+            type: 'success',
+          });
+          this.handleClose();
+        }
+      }
+    },
+    // 删除
+    async toDelete({ data }) {
+      let res = await this.delete(data.id);
+      if (this.$checkRes(res)) {
+        this.$message({
+          message: '删除信息成功',
+          type: 'success',
+        });
+        this.search();
+      }
+    },
+    // 取消
+    handleClose() {
+      this.form = {};
+      this.dialog = false;
+      this.search();
+    },
+    // 图片
+    uploadSuccess({ type, data }) {
+      let arr = _.get(this.form, type);
+      if (_.isArray(arr)) {
+        let datas = { name: data.name, url: data.uri };
+        this.form[type].push({ name: data.name, url: data.uri });
+      } else {
+        let newArr = [{ name: data.name, url: data.uri }];
+        this.$set(this.form, `${type}`, newArr);
+      }
+    },
+    // 删除图片
+    uploadDelete(index) {
+      this.form.image.splice(index, 1);
+    },
+    // 视频文件
+    sucfile({ type, data }) {
+      this.$set(this.form, `${type}`, data.uri);
+    },
+    delfile(index) {
+      this.$set(this.form, `file_path`, '');
+    },
+  },
+  computed: {
+    ...mapState(['user']),
+  },
+  watch: {},
+};
+</script>
+
+<style lang="less" scoped>
+.leftTop {
+  font-size: 18px;
+  width: 96%;
+  height: 41px;
+  line-height: 35px;
+  border-bottom: 1px solid #e5e5e5;
+  position: relative;
+  bottom: 1px;
+  margin: 10px;
+  font-weight: 600;
+  color: #22529a;
+}
+.info {
+  padding: 0 38px 0 10px;
+  .top {
+    text-align: right;
+    padding: 10px 0;
+  }
+}
+</style>

+ 18 - 12
src/views/adminCenter/index.vue

@@ -18,24 +18,27 @@
                 <dockInfo></dockInfo>
               </span>
               <span v-else-if="num == '2'">
-                <applyInfo></applyInfo>
+                <imgtxtdock></imgtxtdock>
               </span>
               <span v-else-if="num == '3'">
-                <vipInfo></vipInfo>
+                <applyInfo></applyInfo>
               </span>
               <span v-else-if="num == '4'">
-                <transaction></transaction>
+                <vipInfo></vipInfo>
               </span>
               <span v-else-if="num == '5'">
-                <zxzd></zxzd>
+                <transaction></transaction>
               </span>
               <span v-else-if="num == '6'">
-                <xmly></xmly>
+                <zxzd></zxzd>
               </span>
               <span v-else-if="num == '7'">
-                <statisInfo></statisInfo>
+                <xmly></xmly>
               </span>
               <span v-else-if="num == '8'">
+                <statisInfo></statisInfo>
+              </span>
+              <span v-else-if="num == '9'">
                 <dynamicInfo></dynamicInfo>
               </span>
               <span v-else>
@@ -55,16 +58,18 @@
 <script>
 import heads from '@/layout/userCenter/heads.vue';
 import menuInfo from '@/layout/adminCenter/menuInfo.vue';
-import foot from '@/layout/live/foot.vue';
-import basicInfo from './basicInfo/index.vue';
-import transaction from './transaction/index.vue';
 import dockInfo from './dockInfo/index.vue';
-import statisInfo from './statisInfo/index.vue';
+import imgtxtdock from './imgtxtdock/index.vue';
 import applyInfo from './applyInfo/index.vue';
 import vipInfo from './vipInfo/index.vue';
-import dynamicInfo from './dynamicInfo/index.vue';
+import transaction from './transaction/index.vue';
 import zxzd from './zxzd/index.vue';
 import xmly from './xmly/index.vue';
+import statisInfo from './statisInfo/index.vue';
+import dynamicInfo from './dynamicInfo/index.vue';
+import foot from '@/layout/live/foot.vue';
+import basicInfo from './basicInfo/index.vue';
+
 import { mapState, createNamespacedHelpers } from 'vuex';
 export default {
   name: 'index',
@@ -72,9 +77,9 @@ export default {
   components: {
     heads,
     menuInfo,
-    foot,
     // basicInfo, //绑定微信
     dockInfo, //展会管理
+    imgtxtdock, //图文直播
     applyInfo, //申请管理
     vipInfo, //VIP用户
     transaction, //交易确定
@@ -82,6 +87,7 @@ export default {
     dynamicInfo, //动态监测
     zxzd, //嘉宾访谈
     xmly, //项目路演
+    foot,
   },
   data: function() {
     return {};

+ 0 - 1
src/views/hall/parts/imagetxtList.vue

@@ -102,7 +102,6 @@ export default {
       let data = this.form;
       data.dock_id = this.dock_id;
       data.user_name = this.user.adminuser;
-      console.log(data);
       let res = await this.create(data);
       if (this.$checkRes(res)) {
         this.$message({