reloaded 4 年之前
父节点
当前提交
bf3fe6a701

+ 1 - 1
src/store/news.js

@@ -9,7 +9,7 @@ const state = () => ({});
 const mutations = {};
 
 const actions = {
-  async query({ commit }, { skip = 0, limit = 10, ...info } = {}) {
+  async query({ commit }, { skip, limit, ...info } = {}) {
     const res = await this.$axios.$get(api.newsInfo, { skip, limit, ...info });
     return res;
   },

+ 4 - 4
src/views/pcenter/index.vue

@@ -49,7 +49,7 @@
                       <span>职务管理</span>
                     </template>
                   </el-menu-item>
-                  <el-menu-item index="10">
+                  <el-menu-item index="10" v-if="user.type === '0'">
                     <template slot="title">
                       <span>友情链接</span>
                     </template>
@@ -79,7 +79,7 @@
               <span v-else-if="columnName == '信息管理'">
                 <el-col :span="24" class="infoTop" style="margin-bottom:0;"> <span>|</span><span>信息管理</span> </el-col>
                 <el-col :span="24">
-                  <infoAdmin></infoAdmin>
+                  <news></news>
                 </el-col>
               </span>
               <span v-else-if="columnName == '人员管理'">
@@ -124,7 +124,7 @@
 <script>
 import top from '@/layout/common/topInfo.vue';
 import foot from '@/layout/common/foot.vue';
-import infoAdmin from './parts/infoAdmin.vue';
+import news from '@/views/pcenter/news.vue';
 import personnelAdmin from './parts/personnelAdmin.vue';
 import demand from '@/views/pcenter/demand.vue';
 import pinfo from '@/views/pcenter/pinfo.vue';
@@ -141,7 +141,7 @@ export default {
   components: {
     top,
     foot,
-    infoAdmin, //信息管理
+    news, //信息管理
     personnelAdmin, //人员管理
     pinfo,
     uppasswd,

+ 185 - 0
src/views/pcenter/news.vue

@@ -0,0 +1,185 @@
+<template>
+  <div id="news">
+    <el-row>
+      <el-col :span="24" class="style">
+        <span v-if="display == 'list'">
+          <el-col :span="24" class="top">
+            <el-button type="primary" size="mini" @click="add">添加</el-button>
+          </el-col>
+          <el-col :span="24">
+            <el-tabs v-model="activeName" @tab-click="handleClick">
+              <el-tab-pane label="草稿" name="first"
+                ><infoTable :list="list" :total="total" @examineBtn="examineBtn" @deleteBtn="deleteBtn" @refer="refer"></infoTable
+              ></el-tab-pane>
+              <el-tab-pane label="待审核" name="second"
+                ><infoTable :list="list" :total="total" @examineBtn="examineBtn" @deleteBtn="deleteBtn" @refer="refer"></infoTable
+              ></el-tab-pane>
+              <el-tab-pane label="审核成功" name="third"
+                ><infoTable :list="list" :total="total" @examineBtn="examineBtn" @deleteBtn="deleteBtn"></infoTable
+              ></el-tab-pane>
+              <el-tab-pane label="已删除" name="fourth"><infoTable :list="list" :total="total" @examineBtn="examineBtn"></infoTable></el-tab-pane>
+            </el-tabs>
+          </el-col>
+        </span>
+        <span v-else>
+          <el-col :span="24" class="top">
+            <el-button type="primary" size="mini" @click="back">返回</el-button>
+          </el-col>
+          <el-col :span="24">
+            <infoFrom :newform="form" @resetForm="resetForm" @submitDraft="submitDraft"></infoFrom>
+          </el-col>
+        </span>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import infoTable from './parts/infoTable.vue';
+import infoFrom from './parts/infoFrom.vue';
+import { mapState, createNamespacedHelpers } from 'vuex';
+const { mapActions: news } = createNamespacedHelpers('news');
+export default {
+  name: 'news',
+  props: {},
+  components: { infoTable, infoFrom },
+  data: () => ({
+    display: 'list', // 展示列表或详情
+    activeName: 'second', //tab默认激活
+    list: [], //数据
+    total: 0,
+    form: {},
+  }),
+  created() {
+    this.searchInfo();
+  },
+  methods: {
+    ...news({ newsQuery: 'query', newsCreate: 'create', newsUpdate: 'update', newsDelete: 'delete' }),
+    // tab切换
+    handleClick(tab) {
+      if (tab.index == 0) {
+        this.search({ status: '0', is_del: '0', publisher: this.user.uid });
+      } else if (tab.index == 1) {
+        this.search({ status: '1', is_del: '0' });
+      } else if (tab.index == 2) {
+        this.search({ status: '2', is_del: '0' });
+      } else if (tab.index == 3) {
+        this.search({ is_del: '1', publisher: this.user.uid });
+      }
+    },
+    // 查询数据
+    async search({ ...info }) {
+      // 如果为计算中心用户只查询自己发的数据
+      if (this.user.type === '4') {
+        info = { publisher: this.user.uid, ...info };
+      }
+      let res = await this.newsQuery(info);
+      if (this.$checkRes(res)) {
+        this.$set(this, `list`, res.data);
+        this.$set(this, `total`, res.total);
+      }
+    },
+    // 查询待审核数据专门方法,用于有操作时更新页面
+    async searchInfo({ ...info }) {
+      // 如果为计算中心用户只查询自己发的数据
+      if (this.user.type === '4') {
+        info = { publisher: this.user.uid, ...info };
+      }
+      let res = await this.newsQuery({ status: '1', is_del: '0', ...info });
+      if (this.$checkRes(res)) {
+        this.$set(this, `list`, res.data);
+        this.$set(this, `total`, res.total);
+      }
+    },
+    // 列表审核打开
+    examineBtn(data) {
+      this.display = 'detail';
+      this.$set(this, `form`, data);
+    },
+    // 修改信息状态
+    async refer(id, status) {
+      const res = await this.newsUpdate({ id, status });
+      if (res.errcode === 0) {
+        this.$message({
+          message: '信息修改成功',
+          type: 'success',
+        });
+        this.searchInfo();
+      } else {
+        this.$message.error('信息修改失败');
+      }
+    },
+    // 删除
+    async deleteBtn(id) {
+      const res = await this.newsUpdate({ id, is_del: '1' });
+      if (this.$checkRes(res)) {
+        this.$message({
+          message: '删除信息成功',
+          type: 'success',
+        });
+        this.searchInfo();
+      }
+    },
+    // 添加
+    add() {
+      this.display = 'detail';
+      this.form = {};
+    },
+    // 返回
+    back() {
+      this.display = 'list';
+    },
+    async submitDraft(data) {
+      if (data.publisher) {
+        let res = await this.newsUpdate(data);
+        if (this.$checkRes(res)) {
+          this.$message({
+            message: '修改信息成功',
+            type: 'success',
+          });
+          this.form = {};
+          this.display = 'list';
+          this.searchInfo();
+        }
+      } else {
+        data.publisher = this.user.uid;
+        let res = await this.newsCreate(data);
+        if (this.$checkRes(res)) {
+          this.$message({
+            message: '创建信息成功',
+            type: 'success',
+          });
+          this.form = {};
+          this.display = 'list';
+          this.searchInfo();
+        }
+      }
+    },
+    // 取消
+    resetForm() {
+      this.display = 'list';
+      this.form = {};
+      this.searchInfo();
+    },
+  },
+  computed: {
+    ...mapState(['user']),
+    pageTitle() {
+      return `${this.$route.meta.title}`;
+    },
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.style {
+  padding: 0 20px 20px 20px;
+  .top {
+    text-align: right;
+    padding: 10px 0 0 0;
+  }
+}
+</style>

+ 163 - 49
src/views/pcenter/parts/infoAdmin.vue

@@ -7,41 +7,119 @@
             <el-button type="primary" size="mini" @click="add">添加</el-button>
           </el-col>
           <el-col :span="24" class="list">
-            <el-table :data="list" stripe style="width: 100%" border>
-              <el-table-column prop="col_name" label="所属栏目" align="center"> </el-table-column>
-              <el-table-column prop="title" label="标题" align="center" show-overflow-tooltip> </el-table-column>
-              <el-table-column prop="publish_time" label="发布时间" align="center"> </el-table-column>
-              <el-table-column prop="publish_unit" label="发布单位" align="center"> </el-table-column>
-              <el-table-column label="状态" align="center">
-                <template slot-scope="scope">
-                  <span>{{
-                    scope.row.status == '0'
-                      ? '草稿'
-                      : scope.row.status == '1'
-                      ? '审核中'
-                      : scope.row.status == '2'
-                      ? '审核通过'
-                      : scope.row.status == '3'
-                      ? '审核拒绝'
-                      : '未识别'
-                  }}</span>
-                </template>
-              </el-table-column>
-              <el-table-column label="操作" align="center" width="220">
-                <template slot-scope="scope">
-                  <el-button size="mini" @click="examineBtn(scope.row)">查看</el-button>
-                  <el-button size="mini" type="success" v-if="scope.row.status == '0'" @click="submitInfo(scope.row)">发布</el-button>
-                  <el-button size="mini" type="danger" @click="deleteBtn(scope.row.id)">删除</el-button>
-                  <el-button v-if="user.type === '0' || user.type === '1'" type="success" size="mini" @click="refer(scope.row.id, { status: '2' })"
-                    >审核通过</el-button
-                  >
-                  <el-button v-if="user.type === '0' || user.type === '1'" type="warning" size="mini" @click="refer(scope.row.id, { status: '3' })"
-                    >审核拒绝</el-button
-                  >
-                </template>
-              </el-table-column>
-            </el-table>
-            <page :total="total" position="right" @query="searchInfo"></page>
+            <el-tabs v-model="activeName" @tab-click="handleClick">
+              <el-tab-pane label="待审核" name="first">
+                <el-table :data="list" stripe style="width: 100%" border>
+                  <el-table-column prop="col_name" label="所属栏目" align="center"> </el-table-column>
+                  <el-table-column prop="title" label="标题" align="center" show-overflow-tooltip> </el-table-column>
+                  <el-table-column prop="publish_time" label="发布时间" align="center"> </el-table-column>
+                  <el-table-column prop="publish_unit" label="发布单位" align="center" show-overflow-tooltip> </el-table-column>
+                  <el-table-column label="状态" align="center">
+                    <template slot-scope="scope">
+                      <span>{{
+                        scope.row.status == '0'
+                          ? '草稿'
+                          : scope.row.status == '1'
+                          ? '审核中'
+                          : scope.row.status == '2'
+                          ? '审核通过'
+                          : scope.row.status == '3'
+                          ? '审核拒绝'
+                          : '未识别'
+                      }}</span>
+                    </template>
+                  </el-table-column>
+                  <el-table-column label="操作" align="center" width="220">
+                    <template slot-scope="scope">
+                      <el-button size="mini" @click="examineBtn(scope.row)">查看</el-button>
+                      <el-button size="mini" type="success" v-if="scope.row.status == '0'" @click="submitInfo(scope.row)">发布</el-button>
+                      <el-button size="mini" type="danger" @click="deleteBtn(scope.row.id)">删除</el-button>
+                      <el-button v-if="user.type === '0' || user.type === '1'" type="success" size="mini" @click="refer(scope.row.id, { status: '2' })"
+                        >审核通过</el-button
+                      >
+                      <!-- <el-button v-if="user.type === '0' || user.type === '1'" type="warning" size="mini" @click="refer(scope.row.id, { status: '3' })"
+                        >审核拒绝</el-button
+                      > -->
+                    </template>
+                  </el-table-column>
+                </el-table>
+                <page :total="total" position="right" @query="searchInfo1"></page
+              ></el-tab-pane>
+              <el-tab-pane label="审核成功" name="second">
+                <el-table :data="list" stripe style="width: 100%" border>
+                  <el-table-column prop="col_name" label="所属栏目" align="center"> </el-table-column>
+                  <el-table-column prop="title" label="标题" align="center" show-overflow-tooltip> </el-table-column>
+                  <el-table-column prop="publish_time" label="发布时间" align="center"> </el-table-column>
+                  <el-table-column prop="publish_unit" label="发布单位" align="center" show-overflow-tooltip> </el-table-column>
+                  <el-table-column label="状态" align="center">
+                    <template slot-scope="scope">
+                      <span>{{
+                        scope.row.status == '0'
+                          ? '草稿'
+                          : scope.row.status == '1'
+                          ? '审核中'
+                          : scope.row.status == '2'
+                          ? '审核通过'
+                          : scope.row.status == '3'
+                          ? '审核拒绝'
+                          : '未识别'
+                      }}</span>
+                    </template>
+                  </el-table-column>
+                  <el-table-column label="操作" align="center" width="220">
+                    <template slot-scope="scope">
+                      <el-button size="mini" @click="examineBtn(scope.row)">查看</el-button>
+                      <el-button size="mini" type="success" v-if="scope.row.status == '0'" @click="submitInfo(scope.row)">发布</el-button>
+                      <el-button size="mini" type="danger" @click="deleteBtn(scope.row.id)">删除</el-button>
+                      <el-button v-if="user.type === '0' || user.type === '1'" type="success" size="mini" @click="refer(scope.row.id, { status: '2' })"
+                        >审核通过</el-button
+                      >
+                      <!-- <el-button v-if="user.type === '0' || user.type === '1'" type="warning" size="mini" @click="refer(scope.row.id, { status: '3' })"
+                        >审核拒绝</el-button
+                      > -->
+                    </template>
+                  </el-table-column>
+                </el-table>
+                <page :total="total" position="right" @query="searchInfo2"></page
+              ></el-tab-pane>
+              <el-tab-pane label="已删除" name="third">
+                <el-table :data="list" stripe style="width: 100%" border>
+                  <el-table-column prop="col_name" label="所属栏目" align="center"> </el-table-column>
+                  <el-table-column prop="title" label="标题" align="center" show-overflow-tooltip> </el-table-column>
+                  <el-table-column prop="publish_time" label="发布时间" align="center"> </el-table-column>
+                  <el-table-column prop="publish_unit" label="发布单位" align="center" show-overflow-tooltip> </el-table-column>
+                  <el-table-column label="状态" align="center">
+                    <template slot-scope="scope">
+                      <span>{{
+                        scope.row.status == '0'
+                          ? '草稿'
+                          : scope.row.status == '1'
+                          ? '审核中'
+                          : scope.row.status == '2'
+                          ? '审核通过'
+                          : scope.row.status == '3'
+                          ? '审核拒绝'
+                          : '未识别'
+                      }}</span>
+                    </template>
+                  </el-table-column>
+                  <el-table-column label="操作" align="center" width="220">
+                    <template slot-scope="scope">
+                      <el-button size="mini" @click="examineBtn(scope.row)">查看</el-button>
+                      <el-button size="mini" type="success" v-if="scope.row.status == '0'" @click="submitInfo(scope.row)">发布</el-button>
+                      <!-- <el-button size="mini" type="danger" v-if="scope.row.is_del == '0'" @click="deleteBtn(scope.row.id)">删除</el-button>
+                      <el-button v-if="user.type === '0' || user.type === '1'" type="success" size="mini" @click="refer(scope.row.id, { status: '2' })"
+                        >审核通过</el-button
+                      > -->
+                      <!-- <el-button v-if="user.type === '0' || user.type === '1'" type="warning" size="mini" @click="refer(scope.row.id, { status: '3' })"
+                        >审核拒绝</el-button
+                      > -->
+                    </template>
+                  </el-table-column>
+                </el-table>
+                <page :total="total" position="right" @query="searchInfo3"></page
+              ></el-tab-pane>
+            </el-tabs>
           </el-col>
         </span>
         <span v-else>
@@ -125,14 +203,14 @@
                   <el-radio label="0">草稿</el-radio>
                   <el-radio label="1">待审核</el-radio>
                   <el-radio v-if="user.type == '0' || user.type == '1'" label="2">审核通过</el-radio>
-                  <el-radio v-if="user.type == '0' || user.type == '1'" label="3">审核拒绝</el-radio>
+                  <!-- <el-radio v-if="user.type == '0' || user.type == '1'" label="3">审核拒绝</el-radio> -->
                 </el-radio-group>
               </el-form-item>
               <el-col :span="24" style="text-align:center;">
                 <el-button type="primary" @click="submitDraft('form')">保存</el-button>
                 <el-button type="danger" @click="resetForm('form')">取消</el-button>
                 <el-button type="success" v-if="user.type == '0' || user.type == '1'" @click="examineIn()">审核通过</el-button>
-                <el-button type="danger" v-if="user.type == '0' || user.type == '1'" @click="examineOut()">审核拒绝</el-button>
+                <!-- <el-button type="danger" v-if="user.type == '0' || user.type == '1'" @click="examineOut()">审核拒绝</el-button> -->
               </el-col>
             </el-form>
           </el-col>
@@ -202,15 +280,51 @@ export default {
         img_url: [{ required: false, message: '请上传图片', trigger: 'blur' }],
         is_top: [{ required: false, message: '请选择', trigger: 'blur' }],
       },
+      activeName: 'first',
     };
   },
   created() {
-    this.searchInfo();
+    this.searchInfo1();
   },
   methods: {
     ...news({ newsQuery: 'query', newsCreate: 'create', newsUpdate: 'update', newsDelete: 'delete' }),
-    async searchInfo({ skip = 0, limit = 10, ...info } = {}) {
-      let res = await this.newsQuery({ skip, limit, ...info });
+    handleClick(tab, event) {
+      if (tab.index == 0) {
+        this.searchInfo1();
+      } else if (tab.index == 1) {
+        this.searchInfo2();
+      } else if (tab.index == 2) {
+        this.searchInfo3();
+      }
+    },
+    // 待审核查询数据
+    async searchInfo1({ skip = 0, limit = 10, ...info } = {}) {
+      if (this.user.type === '4') {
+        info = { publisher: this.user.uid, ...info };
+      }
+      let res = await this.newsQuery({ skip, limit, ...info, status: '1', is_del: '0' });
+      if (this.$checkRes(res)) {
+        this.$set(this, `list`, res.data);
+        this.$set(this, `total`, res.total);
+      }
+    },
+    // 审核成功查询数据
+    async searchInfo2({ skip = 0, limit = 10, ...info } = {}) {
+      if (this.user.type === '4') {
+        info = { publisher: this.user.uid, ...info };
+      }
+      let res = await this.newsQuery({ skip, limit, ...info, status: '2', is_del: '0' });
+      if (this.$checkRes(res)) {
+        this.$set(this, `list`, res.data);
+        this.$set(this, `total`, res.total);
+      }
+    },
+    // 已删除查询数据
+    async searchInfo3({ skip = 0, limit = 10, ...info } = {}) {
+      if (this.user.type === '4') {
+        info = { publisher: this.user.uid, ...info };
+      }
+      let res = await this.newsQuery({ skip, limit, ...info, is_del: '1' });
       if (this.$checkRes(res)) {
         this.$set(this, `list`, res.data);
         this.$set(this, `total`, res.total);
@@ -223,7 +337,7 @@ export default {
           message: '信息修改成功',
           type: 'success',
         });
-        this.searchInfo();
+        this.searchInfo1();
       } else {
         this.$message.error('信息修改失败');
       }
@@ -247,7 +361,7 @@ export default {
           message: '发布信息成功',
           type: 'success',
         });
-        this.searchInfo();
+        this.searchInfo1();
       }
     },
     // 列表审核打开
@@ -269,7 +383,7 @@ export default {
           type: 'success',
         });
         this.display = 'list';
-        this.searchInfo();
+        this.searchInfo1();
       }
     },
     // 详情审核拒绝
@@ -282,7 +396,7 @@ export default {
           type: 'error',
         });
         this.display = 'list';
-        this.searchInfo();
+        this.searchInfo1();
       }
     },
     // 保存草稿
@@ -298,7 +412,7 @@ export default {
               });
               this.form = {};
               this.display = 'list';
-              this.searchInfo();
+              this.searchInfo1();
             }
           } else {
             this.form.publisher = this.user.uid;
@@ -310,7 +424,7 @@ export default {
               });
               this.form = {};
               this.display = 'list';
-              this.searchInfo();
+              this.searchInfo1();
             }
           }
         } else {
@@ -323,17 +437,17 @@ export default {
     resetForm(formName) {
       this.$refs[formName].resetFields();
       this.display = 'list';
-      this.searchInfo();
+      this.searchInfo1();
     },
     // 删除
     async deleteBtn(id) {
-      let res = await this.newsDelete(id);
+      const res = await this.newsUpdate({ id, is_del: '1' });
       if (this.$checkRes(res)) {
         this.$message({
           message: '删除信息成功',
           type: 'success',
         });
-        this.searchInfo();
+        this.searchInfo1();
       }
     },
     // 图片

+ 165 - 0
src/views/pcenter/parts/infoFrom.vue

@@ -0,0 +1,165 @@
+<template>
+  <div id="infoFrom">
+    <el-row>
+      <el-col :span="24" class="form">
+        <el-form :model="form" :rules="rules" ref="form" label-width="100px" class="demo-ruleForm">
+          <el-form-item label="选择栏目" filterable prop="col_name">
+            <el-select :disabled="disabled" v-model="form.col_name" filterable placeholder="请选择栏目">
+              <el-option v-for="item in column_list" :key="item.value" :label="item.label" :value="item.value"> </el-option>
+            </el-select>
+          </el-form-item>
+          <el-form-item label="信息标题" prop="title">
+            <el-input :disabled="disabled" v-model="form.title" placeholder="请输入信息标题"></el-input>
+          </el-form-item>
+          <el-form-item label="简介" prop="introduction">
+            <el-input :disabled="disabled" v-model="form.introduction" type="textarea" placeholder="请输入信息简介" maxlength="300" show-word-limit></el-input>
+          </el-form-item>
+          <el-form-item label="发布时间" prop="publish_time">
+            <el-date-picker :disabled="disabled" v-model="form.publish_time" type="date" placeholder="选择日期" value-format="yyyy-MM-dd"> </el-date-picker>
+          </el-form-item>
+          <el-form-item label="信息类型" prop="type">
+            <el-radio-group :disabled="disabled" v-model="form.type">
+              <el-radio label="0">自有</el-radio>
+              <el-radio label="1">外链</el-radio>
+            </el-radio-group>
+          </el-form-item>
+          <el-form-item label="链接地址" prop="url" v-if="form.type == '1'">
+            <el-input :disabled="disabled" v-model="form.url" placeholder="请输入链接地址(https://)"></el-input>
+          </el-form-item>
+          <el-form-item label="发布单位" prop="publish_unit">
+            <el-input :disabled="disabled" v-model="form.publish_unit" placeholder="请输入发布单位"></el-input>
+          </el-form-item>
+          <el-form-item label="图片" prop="img_url" v-if="form.type == '0' && form.col_name == '图片新闻'">
+            <el-image v-if="disabled" :src="form.img_url"></el-image>
+            <upload v-else :limit="9" :data="form.img_url" type="img_url" :url="'/files/imgpath/upload'" @upload="uploadSuccess"></upload>
+          </el-form-item>
+          <el-form-item label="视频" prop="file_url" v-if="form.type == '0' && form.col_name == '科技培训'">
+            <video v-if="disabled" :src="form.file_url" controls="controls" style="height: 395px; width: 100%;">
+              您的浏览器不支持 video 标签。
+            </video>
+            <upload
+              v-else
+              :limit="1"
+              :data="form.file_url"
+              type="file_url"
+              accept=".mp4"
+              listType=""
+              :url="'/files/imgpath/upload'"
+              @upload="uploadSuccess"
+            ></upload>
+          </el-form-item>
+          <el-form-item label="内容" prop="content" v-if="form.type == '0'">
+            <span v-if="disabled" v-html="form.content"></span>
+            <el-input
+              v-if="!disabled && form.col_name == '专题研讨'"
+              v-model="form.content"
+              type="textarea"
+              placeholder="请输入内容"
+              maxlength="300"
+              show-word-limit
+            ></el-input>
+            <wang-editor v-if="!disabled && form.col_name != '专题研讨'" v-model="form.content" ref="editor"></wang-editor>
+          </el-form-item>
+          <el-form-item label="是否推荐" prop="is_top">
+            <el-radio-group :disabled="disabled" v-model="form.is_top">
+              <el-radio label="0">不推荐</el-radio>
+              <el-radio label="1">推荐</el-radio>
+            </el-radio-group>
+          </el-form-item>
+          <el-form-item label="信息状态" prop="status">
+            <el-radio-group :disabled="disabled" v-model="form.status">
+              <el-radio label="0">草稿</el-radio>
+              <el-radio label="1">待审核</el-radio>
+              <el-radio v-if="user.type == '0' || user.type == '1'" label="2">审核通过</el-radio>
+            </el-radio-group>
+          </el-form-item>
+          <el-col :span="24" style="text-align:center;">
+            <el-button type="primary" @click="submitDraft('form')">保存</el-button>
+            <el-button type="danger" @click="resetForm()">取消</el-button>
+          </el-col>
+        </el-form>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import upload from '@/components/upload.vue';
+import wangEditor from '@/components/wang-editor.vue';
+import { mapState, createNamespacedHelpers } from 'vuex';
+export default {
+  name: 'infoFrom',
+  props: {
+    newform: null,
+  },
+  components: { upload, wangEditor },
+  data: () => ({
+    disabled: false,
+    // 选择栏目
+    column_list: [
+      { value: '科技资讯', label: '科技资讯' },
+      { value: '技术前沿', label: '技术前沿' },
+      { value: '工作动态', label: '工作动态' },
+      { value: '通知通告', label: '通知通告' },
+      { value: '平台建设', label: '平台建设' },
+      { value: '项目成果', label: '项目成果' },
+      { value: '知识产权', label: '知识产权' },
+      { value: '科技支撑', label: '科技支撑' },
+      { value: '超算联盟', label: '超算联盟' },
+      { value: '国家网格', label: '国家网格' },
+      { value: '数学中心', label: '数学中心' },
+      { value: '创新基地', label: '创新基地' },
+      { value: '软件中心', label: '软件中心' },
+      { value: '专题研讨', label: '专题研讨' },
+      { value: '技术问答', label: '技术问答' },
+      { value: '行业研究', label: '行业研究' },
+      { value: '科技培训', label: '科技培训' },
+      { value: '图片新闻', label: '图片新闻' },
+      { value: '党建工作', label: '党建工作' },
+      { value: '学习园地', label: '学习园地' },
+      { value: '党风廉政', label: '党风廉政' },
+    ],
+    // 发布
+    form: {},
+    imgList: [],
+    // 规则
+    rules: {
+      col_name: [{ required: true, message: '请选择栏目', trigger: 'blur' }],
+      title: [{ required: true, message: '请输入信息标题', trigger: 'blur' }],
+      // introduction: [{ required: true, message: '请输入简介', trigger: 'blur' }],
+      publish_time: [{ required: false, message: '请选择发布时间', trigger: 'blur' }],
+      publish_unit: [{ required: false, message: '请输入发布单位', trigger: 'blur' }],
+      type: [{ required: true, message: '请输入信息类型', trigger: 'blur' }],
+      status: [{ required: true, message: '请选择信息状态', trigger: 'blur' }],
+      img_url: [{ required: false, message: '请上传图片', trigger: 'blur' }],
+      is_top: [{ required: false, message: '请选择', trigger: 'blur' }],
+    },
+  }),
+  created() {
+    this.search();
+  },
+  computed: {
+    ...mapState(['user']),
+  },
+  methods: {
+    search() {
+      if (this.newform) {
+        console.log(this.newform);
+
+        this.$set(this, `form`, this.newform);
+        if (this.user.type == '4' && (this.newform.status == '1' || this.newform.status == '2')) {
+          this.disabled = true;
+        }
+      }
+    },
+    resetForm() {
+      this.$emit('resetForm');
+    },
+    submitDraft() {
+      this.$emit('submitDraft', this.form);
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped></style>

+ 112 - 0
src/views/pcenter/parts/infoTable.vue

@@ -0,0 +1,112 @@
+<template>
+  <div id="infoTable">
+    <el-table :data="newlist" stripe style="width: 100%" border>
+      <el-table-column prop="col_name" label="所属栏目" align="center"> </el-table-column>
+      <el-table-column prop="title" label="标题" align="center" show-overflow-tooltip> </el-table-column>
+      <el-table-column prop="publish_time" label="发布时间" align="center"> </el-table-column>
+      <el-table-column prop="publish_unit" label="发布单位" align="center" show-overflow-tooltip> </el-table-column>
+      <el-table-column label="状态" align="center">
+        <template slot-scope="scope">
+          <span>{{
+            scope.row.is_del == '0' && scope.row.status == '0'
+              ? '草稿'
+              : scope.row.is_del == '0' && scope.row.status == '1'
+              ? '审核中'
+              : scope.row.is_del == '0' && scope.row.status == '2'
+              ? '审核通过'
+              : scope.row.is_del == '1'
+              ? '已删除'
+              : '未识别'
+          }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="操作" align="center" width="220">
+        <template slot-scope="scope">
+          <el-button size="mini" @click="examineBtn(scope.row)">查看</el-button>
+          <el-button
+            size="mini"
+            type="success"
+            v-if="scope.row.status == '0' && user.type == '4' && scope.row.is_del == '0'"
+            @click="refer(scope.row.id, { status: '1' })"
+            >发布</el-button
+          >
+          <el-button
+            size="mini"
+            type="danger"
+            v-if="
+              ((user.type === '0' || user.type === '1') && scope.row.is_del == '0') || (user.type == '4' && scope.row.status == '0' && scope.row.is_del == '0')
+            "
+            @click="deleteBtn(scope.row.id)"
+            >删除</el-button
+          >
+          <el-button
+            v-if="(user.type === '0' || user.type === '1') && (scope.row.status == '0' || scope.row.status == '1') && scope.row.is_del == '0'"
+            type="success"
+            size="mini"
+            @click="refer(scope.row.id, { status: '2' })"
+            >审核通过</el-button
+          >
+        </template>
+      </el-table-column>
+    </el-table>
+    <el-pagination background layout="total,prev, pager, next" :total="total" @current-change="handleCurrentChange"> </el-pagination>
+  </div>
+</template>
+
+<script>
+import _ from 'lodash';
+import { mapState, createNamespacedHelpers } from 'vuex';
+export default {
+  name: 'infoTable',
+  props: {
+    list: { type: Array, required: true },
+    total: null,
+  },
+  components: {},
+  data: () => ({
+    newlist: [],
+  }),
+  created() {},
+  computed: { ...mapState(['user']) },
+  methods: {
+    handleCurrentChange(val) {
+      const list = this.list;
+      const newlist = _.slice(list, (val - 1) * 10, 10 * val);
+      this.$set(this, `newlist`, newlist);
+    },
+    examineBtn(data) {
+      this.$emit('examineBtn', data);
+    },
+    deleteBtn(id) {
+      this.$emit('deleteBtn', id);
+    },
+    refer(id, { status }) {
+      this.$emit('refer', id, status);
+    },
+  },
+  watch: {
+    list: {
+      handler(val) {
+        if (val.length >= 0) {
+          this.handleCurrentChange(1);
+        }
+      },
+      immediate: true,
+      deep: true,
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+/deep/.el-button {
+  display: inline-block;
+  height: 30px;
+  width: 47px;
+  text-align: center;
+  line-height: 20px;
+  padding: 0;
+  margin: 5px 1px;
+  font-size: 11px;
+}
+</style>