guhongwei hace 4 años
padre
commit
b3026c29f9

+ 2 - 2
src/layout/layout-part/menus.vue

@@ -44,7 +44,7 @@
 </template>
 
 <script>
-import { index, user, role, live, room, question, stat, test } from '@/util/role_menu.js';
+import { index, user, role, live, room, question, stat, contact, meetingBrief, test } from '@/util/role_menu.js';
 import * as menus from '@/util/role_menu.js';
 import { mapState, createNamespacedHelpers } from 'vuex';
 export default {
@@ -61,7 +61,7 @@ export default {
     search() {
       let menu = [];
       if (this.user.role == '1') {
-        menu.push(index, user, role, room, question);
+        menu.push(index, user, role, room, question, contact, meetingBrief);
       } else {
         menu.push(index, live);
       }

+ 15 - 0
src/router/index.js

@@ -86,6 +86,21 @@ const routes = [
     meta: { title: '问卷管理' },
     component: () => import('../views/question/index.vue'),
   },
+  {
+    path: '/contact/index',
+    meta: { title: '联系我们' },
+    component: () => import('../views/contact/index.vue'),
+  },
+  {
+    path: '/meetingBrief/index',
+    meta: { title: '信息发布' },
+    component: () => import('../views/meetingBrief/index.vue'),
+  },
+  {
+    path: '/meetingBrief/detail',
+    meta: { title: '信息发布信息管理' },
+    component: () => import('../views/meetingBrief/detail.vue'),
+  },
   {
     path: '/login',
     name: 'login',

+ 46 - 0
src/store/contact.js

@@ -0,0 +1,46 @@
+// 权限
+import Vue from 'vue';
+import Vuex from 'vuex';
+import _ from 'lodash';
+Vue.use(Vuex);
+const api = {
+  contactInfo: `/api/onlive/contact`,
+};
+const state = () => ({});
+const mutations = {};
+
+const actions = {
+  async query({ commit }, { skip = 0, limit = 10, ...info } = {}) {
+    const res = await this.$axios.$get(api.contactInfo, {
+      skip,
+      limit,
+      ...info,
+    });
+    return res;
+  },
+  async create({ commit }, payload) {
+    const res = await this.$axios.$post(`${api.contactInfo}`, payload);
+    return res;
+  },
+  async fetch({ commit }, payload) {
+    const res = await this.$axios.$get(`${api.contactInfo}/${payload}`);
+    return res;
+  },
+  async update({ commit }, { id, ...info } = {}) {
+    const res = await this.$axios.$post(`${api.contactInfo}/update/${id}`, {
+      ...info,
+    });
+    return res;
+  },
+  async delete({ commit }, payload) {
+    const res = await this.$axios.$delete(`${api.contactInfo}/${payload}`);
+    return res;
+  },
+};
+
+export default {
+  namespaced: true,
+  state,
+  mutations,
+  actions,
+};

+ 4 - 0
src/store/index.js

@@ -10,6 +10,8 @@ import chat from './chat';
 import question from './question';
 import questionnaire from './questionnaire';
 import uploadquestion from './uploadquestion';
+import contact from './contact';
+import news from './news';
 import * as ustate from './user/state';
 import * as umutations from './user/mutations';
 
@@ -30,5 +32,7 @@ export default new Vuex.Store({
     question,
     questionnaire,
     uploadquestion,
+    contact,
+    news,
   },
 });

+ 46 - 0
src/store/news.js

@@ -0,0 +1,46 @@
+// 权限
+import Vue from 'vue';
+import Vuex from 'vuex';
+import _ from 'lodash';
+Vue.use(Vuex);
+const api = {
+  newsInfo: `/api/onlive/news`,
+};
+const state = () => ({});
+const mutations = {};
+
+const actions = {
+  async query({ commit }, { skip = 0, limit = 10, ...info } = {}) {
+    const res = await this.$axios.$get(api.newsInfo, {
+      skip,
+      limit,
+      ...info,
+    });
+    return res;
+  },
+  async create({ commit }, payload) {
+    const res = await this.$axios.$post(`${api.newsInfo}`, payload);
+    return res;
+  },
+  async fetch({ commit }, payload) {
+    const res = await this.$axios.$get(`${api.newsInfo}/${payload}`);
+    return res;
+  },
+  async update({ commit }, { id, ...info } = {}) {
+    const res = await this.$axios.$post(`${api.newsInfo}/update/${id}`, {
+      ...info,
+    });
+    return res;
+  },
+  async delete({ commit }, payload) {
+    const res = await this.$axios.$delete(`${api.newsInfo}/${payload}`);
+    return res;
+  },
+};
+
+export default {
+  namespaced: true,
+  state,
+  mutations,
+  actions,
+};

+ 10 - 0
src/util/role_menu.js

@@ -38,3 +38,13 @@ export const question = {
   path: '/question/index',
   icon: 'iconfont icontongji',
 };
+export const contact = {
+  name: '联系我们',
+  path: '/contact/index',
+  icon: 'iconfont icontongji',
+};
+export const meetingBrief = {
+  name: '信息发布',
+  path: '/meetingBrief/index',
+  icon: 'iconfont icontongji',
+};

+ 76 - 0
src/views/contact/index.vue

@@ -0,0 +1,76 @@
+<template>
+  <div id="index">
+    <el-row>
+      <el-col :span="24" class="index">
+        <el-col :span="24" class="top">
+          <topInfo :topTitle="pageTitle"></topInfo>
+        </el-col>
+        <el-col :span="24" class="main">
+          <el-form :model="form" :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm">
+            <el-form-item label="标题" prop="title">
+              <el-input v-model="form.title"></el-input>
+            </el-form-item>
+            <el-form-item label="内容" prop="content">
+              <wang-editor v-model="form.content"></wang-editor>
+            </el-form-item>
+            <el-form-item label="发布时间" prop="publish_time">
+              <el-date-picker
+                v-model="form.publish_time"
+                type="datetime"
+                style="width:100%"
+                placeholder="请选择发布时间"
+                format="yyyy-MM-dd HH:mm"
+                value-format="yyyy-MM-dd HH:mm"
+              >
+              </el-date-picker>
+            </el-form-item>
+            <el-form-item>
+              <el-button type="primary" @click="submitForm()">保存</el-button>
+            </el-form-item>
+          </el-form>
+        </el-col>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import wangEditor from '@/components/wang-editor.vue';
+import topInfo from '@/layout/public/top.vue';
+import { mapState, createNamespacedHelpers } from 'vuex';
+export default {
+  name: 'index',
+  props: {},
+  components: {
+    topInfo,
+    wangEditor,
+  },
+  data: function() {
+    return {
+      form: {},
+      rules: {},
+    };
+  },
+  created() {},
+  methods: {
+    submitForm() {
+      alert(this.form);
+    },
+  },
+  computed: {
+    ...mapState(['user']),
+    pageTitle() {
+      return `${this.$route.meta.title}`;
+    },
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+};
+</script>
+
+<style lang="less" scoped>
+// .main {
+//   padding: 0 50% 0 0;
+// }
+</style>

+ 105 - 0
src/views/meetingBrief/detail.vue

@@ -0,0 +1,105 @@
+<template>
+  <div id="detail">
+    <el-row>
+      <el-col :span="24" class="index">
+        <el-col :span="24" class="top">
+          <topInfo :topTitle="pageTitle"></topInfo>
+        </el-col>
+        <el-col :span="24" class="main">
+          <el-col :span="24" class="btn">
+            <el-button type="primary" size="mini" @click="back()">返回</el-button>
+          </el-col>
+          <el-form :model="form" :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm">
+            <el-form-item label="标题" prop="title">
+              <el-input v-model="form.title"></el-input>
+            </el-form-item>
+            <el-form-item label="信息图片" prop="filedir">
+              <upload :limit="1" :data="form.filedir" type="filedir" :url="'/files/filedir/upload'" @upload="uploadSuccess"></upload>
+            </el-form-item>
+            <el-form-item label="类型" prop="type">
+              <el-select v-model="form.type" placeholder="请选择信息类型">
+                <el-option label="会议简介" value="0"></el-option>
+                <el-option label="会议日程" value="1"></el-option>
+                <el-option label="主办方介绍" value="2"></el-option>
+                <el-option label="协办方介绍" value="3"></el-option>
+                <el-option label="专家介绍" value="4"></el-option>
+                <el-option label="继续再教育申请表" value="5"></el-option>
+                <el-option label="温馨提示" value="6"></el-option>
+              </el-select>
+            </el-form-item>
+            <el-form-item label="内容" prop="content">
+              <wang-editor v-model="form.content"></wang-editor>
+            </el-form-item>
+            <el-form-item label="发布时间" prop="publish_time">
+              <el-date-picker
+                v-model="form.publish_time"
+                type="datetime"
+                style="width:100%"
+                placeholder="请选择发布时间"
+                format="yyyy-MM-dd HH:mm"
+                value-format="yyyy-MM-dd HH:mm"
+              >
+              </el-date-picker>
+            </el-form-item>
+            <el-form-item>
+              <el-button type="primary" @click="submitForm()">保存</el-button>
+            </el-form-item>
+          </el-form>
+        </el-col>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import upload from '@/components/upload.vue';
+import wangEditor from '@/components/wang-editor.vue';
+import topInfo from '@/layout/public/top.vue';
+import { mapState, createNamespacedHelpers } from 'vuex';
+export default {
+  name: 'detail',
+  props: {},
+  components: {
+    topInfo,
+    wangEditor,
+    upload,
+  },
+  data: function() {
+    return {
+      form: {},
+      rules: {},
+    };
+  },
+  created() {},
+  methods: {
+    submitForm() {
+      console.log(this.form);
+    },
+    // 返回
+    back() {
+      this.$router.push({ path: '/meetingBrief/index' });
+    },
+    uploadSuccess({ type, data }) {
+      this.$set(this.form, `${type}`, data.uri);
+    },
+  },
+  computed: {
+    ...mapState(['user']),
+    pageTitle() {
+      return `${this.$route.meta.title}`;
+    },
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.main {
+  .btn {
+    text-align: right;
+    padding: 10px 0;
+  }
+}
+</style>

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

@@ -0,0 +1,107 @@
+<template>
+  <div id="index">
+    <el-row>
+      <el-col :span="24" class="index">
+        <el-col :span="24" class="top">
+          <topInfo :topTitle="pageTitle"></topInfo>
+        </el-col>
+        <el-col :span="24" class="main">
+          <el-col :span="24" class="btn">
+            <el-button type="primary" size="mini" @click="add()">增加</el-button>
+          </el-col>
+          <el-col :span="24">
+            <data-table :fields="fields" @delete="toDelete" :data="list" :opera="opera" @edit="toEdit" :total="total" @query="search"></data-table>
+          </el-col>
+        </el-col>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import topInfo from '@/layout/public/top.vue';
+import dataTable from '@/components/data-table.vue';
+import { mapState, createNamespacedHelpers } from 'vuex';
+export default {
+  name: 'index',
+  props: {},
+  components: {
+    topInfo,
+    dataTable,
+  },
+  data: function() {
+    return {
+      opera: [
+        {
+          label: '修改',
+          icon: 'el-icon-edit',
+          method: 'edit',
+        },
+        {
+          label: '删除',
+          icon: 'el-icon-delete',
+          method: 'delete',
+          confirm: true,
+        },
+      ],
+      fields: [
+        { label: '标题', prop: 'title' },
+        {
+          label: '类型',
+          prop: 'type',
+          format: i =>
+            i == '0'
+              ? '会议简介'
+              : i == '1'
+              ? '会议日程'
+              : i == '2'
+              ? '主办方介绍'
+              : i == '3'
+              ? '协办方介绍'
+              : i == '4'
+              ? '专家介绍'
+              : i == '5'
+              ? '继续再教育申请表'
+              : i == '6'
+              ? '温馨提示'
+              : '',
+        },
+        { label: '发布时间', prop: 'publish_time' },
+        { label: '状态', prop: 'status', format: i => (i == '0' ? '开启' : i == '1' ? '禁用' : '暂无') },
+      ],
+      list: [],
+      total: 0,
+    };
+  },
+  created() {
+    this.search();
+  },
+  methods: {
+    async search({ skip = 0, limit = 10, ...info } = {}) {},
+    toEdit({ data }) {},
+    async toDelete({ data }) {},
+    // 增加
+    add() {
+      this.$router.push({ path: '/meetingBrief/detail' });
+    },
+  },
+  computed: {
+    ...mapState(['user']),
+    pageTitle() {
+      return `${this.$route.meta.title}`;
+    },
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.main {
+  .btn {
+    text-align: right;
+    padding: 10px 0;
+  }
+}
+</style>