guhongwei 4 년 전
부모
커밋
d46121074f
3개의 변경된 파일326개의 추가작업 그리고 5개의 파일을 삭제
  1. 159 0
      src/views/superAdminCenter/guestInter/index.vue
  2. 8 5
      src/views/superAdminCenter/index.vue
  3. 159 0
      src/views/superAdminCenter/roadshow/index.vue

+ 159 - 0
src/views/superAdminCenter/guestInter/index.vue

@@ -0,0 +1,159 @@
+<template>
+  <div id="index">
+    <el-row>
+      <el-col :span="24">
+        <el-col :span="24" class="add" style="text-align:right;padding: 10px 20px;">
+          <el-button size="mini" type="primary" @click="toAdd" icon="el-icon-plus">添加{{ theme }}</el-button>
+        </el-col>
+        <el-col :span="24" class="main">
+          <data-table :fields="fields" :opera="opera" @edit="toEdit" :data="list" :total="total" @delete="toDelete" @query="search"></data-table>
+        </el-col>
+        <el-dialog :title="theme" width="60%" :visible.sync="dialog" @closed="handleClose" :destroy-on-close="true">
+          <el-form ref="form" :rules="rules" :model="form" label-width="80px">
+            <el-form-item label="信息标题" prop="title">
+              <el-input v-model="form.title" placeholder="请输入信息标题"></el-input>
+            </el-form-item>
+            <el-form-item label="来源">
+              <el-input v-model="form.orgin" placeholder="请输入信息来源"></el-input>
+            </el-form-item>
+            <el-form-item label="标题简介">
+              <el-input type="textarea" v-model="form.titlejj" placeholder="请输入标题简介"></el-input>
+            </el-form-item>
+            <el-form-item label="信息图片" prop="picture">
+              <upload :limit="1" :data="form.picture" type="picture" :url="'/files/imgpath/upload'" @upload="uploadSuccess"></upload>
+            </el-form-item>
+            <el-form-item label="视频" prop="filepath">
+              <upload :limit="1" :data="form.filepath" type="filepath" listType="" :url="'/files/imgpath/upload'" @upload="uploadSuccess"></upload>
+            </el-form-item>
+            <el-form-item label="信息内容">
+              <wang-editor v-model="form.content" placeholder="请输入信息内容"></wang-editor>
+            </el-form-item>
+            <el-form-item label="发布时间">
+              <el-col :span="11">
+                <el-date-picker type="date" placeholder="发布时间" value-format="yyyy-MM-dd" v-model="form.publish_time" style="width: 100%;"></el-date-picker>
+              </el-col>
+            </el-form-item>
+            <el-form-item>
+              <el-button type="primary" @click="onSubmit()">提交</el-button>
+            </el-form-item>
+          </el-form>
+        </el-dialog>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import WangEditor from '@/components/wang-editor.vue';
+import upload from '@/components/upload.vue';
+import dataTable from '@/components/data-table.vue';
+import { mapState, createNamespacedHelpers } from 'vuex';
+const { mapActions: newsguidance } = createNamespacedHelpers('newsguidance');
+export default {
+  name: 'index',
+  props: {},
+  components: {
+    dataTable,
+    WangEditor,
+    upload,
+  },
+  data: function() {
+    return {
+      theme: '嘉宾访谈',
+      opera: [
+        {
+          label: '修改',
+          icon: 'el-icon-edit',
+          method: 'edit',
+        },
+        {
+          label: '删除',
+          icon: 'el-icon-delete',
+          method: 'delete',
+        },
+      ],
+      fields: [
+        { label: '信息标题', prop: 'title', filter: 'input' },
+        { label: '来源', prop: 'orgin' },
+        { label: '标题简介', prop: 'titlejj' },
+        { label: '发布时间', prop: 'publish_time' },
+      ],
+      list: [],
+      total: 0,
+      dialog: false,
+      // 添加信息
+      form: {},
+      rules: {},
+    };
+  },
+  created() {
+    this.search();
+  },
+  methods: {
+    ...newsguidance(['query', 'create', 'update', 'delete']),
+    async search({ skip = 0, limit = 10, ...info } = {}) {
+      let arr = await this.query({ skip, limit, ...info });
+      this.$set(this, `list`, arr.data);
+      this.$set(this, `total`, arr.total);
+    },
+    toEdit({ data }) {
+      this.dialog = true;
+      this.$set(this, `form`, data);
+    },
+    async toDelete({ data }) {
+      let res = await this.delete(data.id);
+      this.$message({
+        message: '刪除信息成功',
+        type: 'success',
+      });
+      this.search();
+    },
+    // 添加
+    toAdd() {
+      this.dialog = true;
+      this.form = {};
+    },
+    // 提交
+    async onSubmit() {
+      if (this.form.id) {
+        let res = await this.update(this.form);
+        if (this.$checkRes(res)) {
+          this.$message({
+            message: '修改信息成功',
+            type: 'success',
+          });
+          this.handleClose();
+        }
+      } else {
+        let res = await this.create(this.form);
+        if (this.$checkRes(res)) {
+          this.$message({
+            message: '添加信息成功',
+            type: 'success',
+          });
+          this.handleClose();
+        }
+      }
+    },
+    // 取消
+    handleClose() {
+      this.form = {};
+      this.dialog = false;
+    },
+    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></style>

+ 8 - 5
src/views/superAdminCenter/index.vue

@@ -39,6 +39,8 @@ import duijiehui from './duijiehui/index.vue';
 import enterpriseProduct from './enterpriseProduct/index.vue';
 import enterpriseTrans from './enterpriseTrans/index.vue';
 import technical from './technical/index.vue';
+import roadshow from './roadshow/index.vue';
+import guestInter from './guestInter/index.vue';
 import dictionary from './dictionary/index.vue';
 import business from './business/index.vue';
 import manager from './manager/index.vue';
@@ -60,6 +62,8 @@ export default {
     enterpriseProduct,
     enterpriseTrans,
     technical,
+    roadshow,
+    guestInter,
     dictionary,
     business,
     manager,
@@ -68,7 +72,7 @@ export default {
   },
   data: function() {
     return {
-      cpt: 'enterpriseTrans',
+      cpt: 'role',
       topTitle: '',
     };
   },
@@ -76,7 +80,6 @@ export default {
   methods: {
     setRight(menu) {
       let { name, cpt } = menu;
-      console.log(menu);
       this.$set(this, `topTitle`, name);
       this.$set(this, `cpt`, cpt);
     },
@@ -102,17 +105,17 @@ export default {
   background-color: #e9edf6;
 }
 .main {
-  min-height: 666px;
+  min-height: 834px;
   margin: 15px 0;
 }
 .mainMenu {
   width: 20%;
-  min-height: 666px;
+  min-height: 834px;
   background-color: #fff;
 }
 .mainMess {
   float: right;
-  min-height: 666px;
+  min-height: 834px;
   background-color: #fff;
 }
 </style>

+ 159 - 0
src/views/superAdminCenter/roadshow/index.vue

@@ -0,0 +1,159 @@
+<template>
+  <div id="index">
+    <el-row>
+      <el-col :span="24">
+        <el-col :span="24" class="add" style="text-align:right;padding: 10px 20px;">
+          <el-button size="mini" type="primary" @click="toAdd" icon="el-icon-plus">添加{{ theme }}</el-button>
+        </el-col>
+        <el-col :span="24" class="main">
+          <data-table :fields="fields" :opera="opera" @edit="toEdit" :data="list" :total="total" @delete="toDelete" @query="search"></data-table>
+        </el-col>
+        <el-dialog :title="theme" width="60%" :visible.sync="dialog" @closed="handleClose" :destroy-on-close="true">
+          <el-form ref="form" :rules="rules" :model="form" label-width="80px">
+            <el-form-item label="信息标题" prop="title">
+              <el-input v-model="form.title" placeholder="请输入信息标题"></el-input>
+            </el-form-item>
+            <el-form-item label="来源">
+              <el-input v-model="form.orgin" placeholder="请输入信息来源"></el-input>
+            </el-form-item>
+            <el-form-item label="标题简介">
+              <el-input type="textarea" v-model="form.titlejj" placeholder="请输入标题简介"></el-input>
+            </el-form-item>
+            <el-form-item label="信息图片" prop="picture">
+              <upload :limit="1" :data="form.picture" type="picture" :url="'/files/imgpath/upload'" @upload="uploadSuccess"></upload>
+            </el-form-item>
+            <el-form-item label="视频" prop="filepath">
+              <upload :limit="1" :data="form.filepath" type="filepath" listType="" :url="'/files/imgpath/upload'" @upload="uploadSuccess"></upload>
+            </el-form-item>
+            <el-form-item label="信息内容">
+              <wang-editor v-model="form.content" placeholder="请输入信息内容"></wang-editor>
+            </el-form-item>
+            <el-form-item label="发布时间">
+              <el-col :span="11">
+                <el-date-picker type="date" placeholder="发布时间" value-format="yyyy-MM-dd" v-model="form.publish_time" style="width: 100%;"></el-date-picker>
+              </el-col>
+            </el-form-item>
+            <el-form-item>
+              <el-button type="primary" @click="onSubmit()">提交</el-button>
+            </el-form-item>
+          </el-form>
+        </el-dialog>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import WangEditor from '@/components/wang-editor.vue';
+import upload from '@/components/upload.vue';
+import dataTable from '@/components/data-table.vue';
+import { mapState, createNamespacedHelpers } from 'vuex';
+const { mapActions: newsroadshow } = createNamespacedHelpers('newsroadshow');
+export default {
+  name: 'index',
+  props: {},
+  components: {
+    dataTable,
+    WangEditor,
+    upload,
+  },
+  data: function() {
+    return {
+      theme: '项目路演',
+      opera: [
+        {
+          label: '修改',
+          icon: 'el-icon-edit',
+          method: 'edit',
+        },
+        {
+          label: '删除',
+          icon: 'el-icon-delete',
+          method: 'delete',
+        },
+      ],
+      fields: [
+        { label: '信息标题', prop: 'title', filter: 'input' },
+        { label: '来源', prop: 'orgin' },
+        { label: '标题简介', prop: 'titlejj' },
+        { label: '发布时间', prop: 'publish_time' },
+      ],
+      list: [],
+      total: 0,
+      dialog: false,
+      // 添加信息
+      form: {},
+      rules: {},
+    };
+  },
+  created() {
+    this.search();
+  },
+  methods: {
+    ...newsroadshow(['query', 'create', 'update', 'delete']),
+    async search({ skip = 0, limit = 10, ...info } = {}) {
+      let arr = await this.query({ skip, limit, ...info });
+      this.$set(this, `list`, arr.data);
+      this.$set(this, `total`, arr.total);
+    },
+    toEdit({ data }) {
+      this.dialog = true;
+      this.$set(this, `form`, data);
+    },
+    async toDelete({ data }) {
+      let res = await this.delete(data.id);
+      this.$message({
+        message: '刪除信息成功',
+        type: 'success',
+      });
+      this.search();
+    },
+    // 添加
+    toAdd() {
+      this.dialog = true;
+      this.form = {};
+    },
+    // 提交
+    async onSubmit() {
+      if (this.form.id) {
+        let res = await this.update(this.form);
+        if (this.$checkRes(res)) {
+          this.$message({
+            message: '修改信息成功',
+            type: 'success',
+          });
+          this.handleClose();
+        }
+      } else {
+        let res = await this.create(this.form);
+        if (this.$checkRes(res)) {
+          this.$message({
+            message: '添加信息成功',
+            type: 'success',
+          });
+          this.handleClose();
+        }
+      }
+    },
+    // 取消
+    handleClose() {
+      this.form = {};
+      this.dialog = false;
+    },
+    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></style>