瀏覽代碼

科技数据+科技服务更新

guhongwei 5 年之前
父節點
當前提交
f7ab25709c

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

@@ -4,6 +4,8 @@
       <el-menu-item index="/"> <i class="el-icon-s-grid"></i>首页 </el-menu-item>
       <el-menu-item index="/government/index"> <i class="el-icon-s-grid"></i>科技政务</el-menu-item>
       <el-menu-item index="/policy/index"> <i class="el-icon-s-grid"></i>科技政策</el-menu-item>
+      <el-menu-item index="/record/index"> <i class="el-icon-s-grid"></i>科技数据</el-menu-item>
+      <el-menu-item index="/serve/index"> <i class="el-icon-s-grid"></i>科技服务</el-menu-item>
       <el-menu-item index="/site/index"> <i class="el-icon-s-grid"></i>站点信息管理</el-menu-item>
       <el-menu-item index="/links/index"> <i class="el-icon-attract"></i>友情链接管理</el-menu-item>
     </el-menu>

+ 75 - 0
src/layout/record/column.vue

@@ -0,0 +1,75 @@
+<template>
+  <div id="column">
+    <el-row>
+      <el-col :span="24" class="info">
+        <el-col :span="24" class="top">
+          <el-col :span="12" class="topTitle">
+            <span>栏目列表</span>
+          </el-col>
+          <el-col :span="12" class="topAdd">
+            <el-button type="primary" size="mini" @click="addData()"><i class="el-icon-plus"></i></el-button>
+          </el-col>
+        </el-col>
+        <el-col :span="24" class="list">
+          <template>
+            <el-table :data="columnInfo" style="width: 100%">
+              <el-table-column label="栏目名称" align="center">
+                <template slot-scope="scoped">
+                  <el-tooltip effect="dark" content="点击查询栏目" placement="left">
+                    <el-col :span="24" @click.native="handleClick(scoped.row)">{{ scoped.row.name }}</el-col>
+                  </el-tooltip>
+                </template>
+              </el-table-column>
+              <el-table-column label="操作" align="center">
+                <template slot-scope="scoped">
+                  <el-button type="text" size="small" @click="$router.push({ path: '/record/columnDetail', query: { id: scoped.row.id } })"
+                    ><i class="el-icon-edit"></i
+                  ></el-button>
+                  <el-button type="text" size="small" @click="handleDelete(scoped.row)"><i class="el-icon-delete"></i></el-button>
+                </template>
+              </el-table-column>
+            </el-table>
+          </template>
+        </el-col>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+export default {
+  name: 'column',
+  props: {
+    columnInfo: null,
+  },
+  components: {},
+  data: () => ({}),
+  created() {},
+  computed: {},
+  methods: {
+    addData() {
+      this.$router.push({ path: '/record/columnDetail' });
+    },
+    handleDelete(item) {
+      this.$emit('delete', item);
+    },
+    handleClick(row) {
+      this.$emit('list', { data: row });
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.top {
+  padding: 15px 0;
+  border-bottom: 1px solid #cccc;
+}
+.top .topTitle {
+  padding: 0 10px;
+}
+.top .topAdd {
+  padding: 0 10px 0 0;
+  text-align: right;
+}
+</style>

+ 66 - 0
src/layout/record/columnDetail.vue

@@ -0,0 +1,66 @@
+<template>
+  <div id="columnDetail">
+    <el-row>
+      <el-col :span="24">
+        <el-col :span="24" class="top">
+          <el-col :span="12" class="topTitle">
+            添加栏目
+          </el-col>
+          <el-col :span="12" class="topBtn">
+            <el-button type="primary" size="mini" @click="returnBtn()">返回</el-button>
+          </el-col>
+        </el-col>
+        <el-col :span="24" class="messgae">
+          <el-form ref="form" :model="form" label-width="80px">
+            <el-form-item label="栏目名称">
+              <el-input v-model="form.name"></el-input>
+            </el-form-item>
+            <el-form-item label="所在位置">
+              <el-select v-model="form.site" placeholder="请选择所在位置">
+                <el-option label="科技文献" value="zhidao"></el-option>
+                <el-option label="科技报告" value="zhuanhua"></el-option>
+              </el-select>
+            </el-form-item>
+            <el-form-item>
+              <el-button type="primary" @click="onSubmit()">提交</el-button>
+            </el-form-item>
+          </el-form>
+        </el-col>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+export default {
+  name: 'columnDetail',
+  props: {
+    form: null,
+  },
+  components: {},
+  data: () => ({}),
+  created() {},
+  computed: {},
+  methods: {
+    onSubmit() {
+      this.$emit('submitDate', { data: this.form, id: this.form.id });
+    },
+    returnBtn() {
+      this.$router.push({ path: '/record/index' });
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.top {
+  padding: 15px 0;
+}
+.top .topTitle {
+  text-align: left;
+}
+.top .topBtn {
+  text-align: right;
+  padding: 0 5px;
+}
+</style>

+ 83 - 0
src/layout/record/messageDetail.vue

@@ -0,0 +1,83 @@
+<template>
+  <div id="messageDetail">
+    <el-row v-if="loading">
+      <el-col :span="24">
+        <el-col :span="24" class="topBtn">
+          <el-button type="primary" size="mini" @click="returnBtn()">返回</el-button>
+        </el-col>
+      </el-col>
+      <el-col>
+        <el-col :span="24" class="messgae">
+          <el-form ref="form" :model="form" label-width="80px">
+            <el-form-item label="信息标题">
+              <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="所属栏目" placeholder="请选择所属栏目">
+              <el-select v-model="form.column_id" filterable @change="selectChild">
+                <el-option v-for="(item, index) in columnList" :key="index" :value="item.id" :label="item.name"></el-option>
+              </el-select>
+            </el-form-item>
+            <el-form-item label="信息图片" prop="picture">
+              <upload :limit="1" :data="form.picture" type="picture" :url="'/files/links/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>
+              <el-button type="primary" @click="onSubmit()">提交</el-button>
+            </el-form-item>
+          </el-form>
+        </el-col>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import WangEditor from '@/components/wang-editor.vue';
+import upload from '@/components/upload.vue';
+export default {
+  name: 'messageDetail',
+  props: {
+    form: null,
+    columnList: null,
+    loading: null,
+  },
+  components: {
+    WangEditor,
+    upload,
+  },
+  data: () => ({}),
+  created() {},
+  computed: {},
+  methods: {
+    returnBtn() {
+      this.$router.push({ path: '/record/index' });
+    },
+    onSubmit() {
+      this.$emit('submitDate', { data: this.form, id: this.form.id });
+    },
+    selectChild(column_id) {
+      let res = this.columnList.filter(fil => fil.id === column_id);
+      if (res.length > 0) {
+        console.log(res[0].name);
+        this.$set(this.form, `column_name`, res[0].name);
+      }
+      this.$forceUpdate();
+    },
+    uploadSuccess({ type, data }) {
+      this.$set(this.form, `${type}`, data.uri);
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.topBtn {
+  text-align: right;
+  padding: 15px 5px;
+}
+</style>

+ 90 - 0
src/layout/record/messageInfo.vue

@@ -0,0 +1,90 @@
+<template>
+  <div id="messageInfo">
+    <el-row>
+      <el-col :span="24" class="info">
+        <el-col :span="24" class="top">
+          <el-col :span="12" class="topTitle">
+            <span>信息列表</span>
+          </el-col>
+          <el-col :span="12" class="topAdd">
+            <el-button type="primary" size="mini" @click="addData()"><i class="el-icon-plus"></i></el-button>
+          </el-col>
+        </el-col>
+        <el-col :span="24" class="list">
+          <template>
+            <el-table :data="message" style="width: 100%">
+              <el-table-column prop="title" label="标题" align="center"> </el-table-column>
+              <el-table-column prop="column_name" label="所属栏目" align="center"> </el-table-column>
+              <el-table-column label="操作" align="center">
+                <template slot-scope="scope">
+                  <el-button type="text" size="small" @click="$router.push({ path: '/record/messageInfoDetail', query: { id: scope.row.id } })"
+                    ><i class="el-icon-edit"></i
+                  ></el-button>
+                  <el-button type="text" size="small" @click="handleDelete(scope.row)"><i class="el-icon-delete"></i></el-button>
+                </template>
+              </el-table-column>
+            </el-table>
+            <el-col :span="24" class="page">
+              <el-pagination
+                @size-change="handleSizeChange"
+                @current-change="handleCurrentChange"
+                :current-page="currentPage"
+                layout="total, prev, pager, next, jumper"
+                :total="total"
+              >
+              </el-pagination>
+            </el-col>
+          </template>
+        </el-col>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+export default {
+  name: 'messageInfo',
+  props: {
+    message: null,
+    total: null,
+  },
+  components: {},
+  data: () => ({
+    currentPage: 1,
+  }),
+  created() {},
+  computed: {},
+  methods: {
+    handleSizeChange(val) {
+      console.log(`每页 ${val} 条`);
+    },
+    handleCurrentChange(val) {
+      console.log(`当前页: ${val}`);
+    },
+    addData() {
+      this.$router.push({ path: '/record/messageInfoDetail' });
+    },
+    handleDelete(item) {
+      this.$emit('delete', item);
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.top {
+  padding: 15px 0;
+  border-bottom: 1px solid #cccc;
+}
+.top .topTitle {
+  padding: 0 10px;
+}
+.top .topAdd {
+  padding: 0 10px 0 0;
+  text-align: right;
+}
+.page {
+  padding: 20px 0;
+  text-align: center;
+}
+</style>

+ 75 - 0
src/layout/serve/column.vue

@@ -0,0 +1,75 @@
+<template>
+  <div id="column">
+    <el-row>
+      <el-col :span="24" class="info">
+        <el-col :span="24" class="top">
+          <el-col :span="12" class="topTitle">
+            <span>栏目列表</span>
+          </el-col>
+          <el-col :span="12" class="topAdd">
+            <el-button type="primary" size="mini" @click="addData()"><i class="el-icon-plus"></i></el-button>
+          </el-col>
+        </el-col>
+        <el-col :span="24" class="list">
+          <template>
+            <el-table :data="columnInfo" style="width: 100%">
+              <el-table-column label="栏目名称" align="center">
+                <template slot-scope="scoped">
+                  <el-tooltip effect="dark" content="点击查询栏目" placement="left">
+                    <el-col :span="24" @click.native="handleClick(scoped.row)">{{ scoped.row.name }}</el-col>
+                  </el-tooltip>
+                </template>
+              </el-table-column>
+              <el-table-column label="操作" align="center">
+                <template slot-scope="scoped">
+                  <el-button type="text" size="small" @click="$router.push({ path: '/serve/columnDetail', query: { id: scoped.row.id } })"
+                    ><i class="el-icon-edit"></i
+                  ></el-button>
+                  <el-button type="text" size="small" @click="handleDelete(scoped.row)"><i class="el-icon-delete"></i></el-button>
+                </template>
+              </el-table-column>
+            </el-table>
+          </template>
+        </el-col>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+export default {
+  name: 'column',
+  props: {
+    columnInfo: null,
+  },
+  components: {},
+  data: () => ({}),
+  created() {},
+  computed: {},
+  methods: {
+    addData() {
+      this.$router.push({ path: '/serve/columnDetail' });
+    },
+    handleDelete(item) {
+      this.$emit('delete', item);
+    },
+    handleClick(row) {
+      this.$emit('list', { data: row });
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.top {
+  padding: 15px 0;
+  border-bottom: 1px solid #cccc;
+}
+.top .topTitle {
+  padding: 0 10px;
+}
+.top .topAdd {
+  padding: 0 10px 0 0;
+  text-align: right;
+}
+</style>

+ 66 - 0
src/layout/serve/columnDetail.vue

@@ -0,0 +1,66 @@
+<template>
+  <div id="columnDetail">
+    <el-row>
+      <el-col :span="24">
+        <el-col :span="24" class="top">
+          <el-col :span="12" class="topTitle">
+            添加栏目
+          </el-col>
+          <el-col :span="12" class="topBtn">
+            <el-button type="primary" size="mini" @click="returnBtn()">返回</el-button>
+          </el-col>
+        </el-col>
+        <el-col :span="24" class="messgae">
+          <el-form ref="form" :model="form" label-width="80px">
+            <el-form-item label="栏目名称">
+              <el-input v-model="form.name"></el-input>
+            </el-form-item>
+            <el-form-item label="所在位置">
+              <el-select v-model="form.site" placeholder="请选择所在位置">
+                <el-option label="视频会议中心" value="zhidao"></el-option>
+                <el-option label="专题研讨" value="zhuanhua"></el-option>
+              </el-select>
+            </el-form-item>
+            <el-form-item>
+              <el-button type="primary" @click="onSubmit()">提交</el-button>
+            </el-form-item>
+          </el-form>
+        </el-col>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+export default {
+  name: 'columnDetail',
+  props: {
+    form: null,
+  },
+  components: {},
+  data: () => ({}),
+  created() {},
+  computed: {},
+  methods: {
+    onSubmit() {
+      this.$emit('submitDate', { data: this.form, id: this.form.id });
+    },
+    returnBtn() {
+      this.$router.push({ path: '/serve/index' });
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.top {
+  padding: 15px 0;
+}
+.top .topTitle {
+  text-align: left;
+}
+.top .topBtn {
+  text-align: right;
+  padding: 0 5px;
+}
+</style>

+ 83 - 0
src/layout/serve/messageDetail.vue

@@ -0,0 +1,83 @@
+<template>
+  <div id="messageDetail">
+    <el-row v-if="loading">
+      <el-col :span="24">
+        <el-col :span="24" class="topBtn">
+          <el-button type="primary" size="mini" @click="returnBtn()">返回</el-button>
+        </el-col>
+      </el-col>
+      <el-col>
+        <el-col :span="24" class="messgae">
+          <el-form ref="form" :model="form" label-width="80px">
+            <el-form-item label="信息标题">
+              <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="所属栏目" placeholder="请选择所属栏目">
+              <el-select v-model="form.column_id" filterable @change="selectChild">
+                <el-option v-for="(item, index) in columnList" :key="index" :value="item.id" :label="item.name"></el-option>
+              </el-select>
+            </el-form-item>
+            <el-form-item label="信息图片" prop="picture">
+              <upload :limit="1" :data="form.picture" type="picture" :url="'/files/links/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>
+              <el-button type="primary" @click="onSubmit()">提交</el-button>
+            </el-form-item>
+          </el-form>
+        </el-col>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import WangEditor from '@/components/wang-editor.vue';
+import upload from '@/components/upload.vue';
+export default {
+  name: 'messageDetail',
+  props: {
+    form: null,
+    columnList: null,
+    loading: null,
+  },
+  components: {
+    WangEditor,
+    upload,
+  },
+  data: () => ({}),
+  created() {},
+  computed: {},
+  methods: {
+    returnBtn() {
+      this.$router.push({ path: '/serve/index' });
+    },
+    onSubmit() {
+      this.$emit('submitDate', { data: this.form, id: this.form.id });
+    },
+    selectChild(column_id) {
+      let res = this.columnList.filter(fil => fil.id === column_id);
+      if (res.length > 0) {
+        console.log(res[0].name);
+        this.$set(this.form, `column_name`, res[0].name);
+      }
+      this.$forceUpdate();
+    },
+    uploadSuccess({ type, data }) {
+      this.$set(this.form, `${type}`, data.uri);
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.topBtn {
+  text-align: right;
+  padding: 15px 5px;
+}
+</style>

+ 90 - 0
src/layout/serve/messageInfo.vue

@@ -0,0 +1,90 @@
+<template>
+  <div id="messageInfo">
+    <el-row>
+      <el-col :span="24" class="info">
+        <el-col :span="24" class="top">
+          <el-col :span="12" class="topTitle">
+            <span>信息列表</span>
+          </el-col>
+          <el-col :span="12" class="topAdd">
+            <el-button type="primary" size="mini" @click="addData()"><i class="el-icon-plus"></i></el-button>
+          </el-col>
+        </el-col>
+        <el-col :span="24" class="list">
+          <template>
+            <el-table :data="message" style="width: 100%">
+              <el-table-column prop="title" label="标题" align="center"> </el-table-column>
+              <el-table-column prop="column_name" label="所属栏目" align="center"> </el-table-column>
+              <el-table-column label="操作" align="center">
+                <template slot-scope="scope">
+                  <el-button type="text" size="small" @click="$router.push({ path: '/serve/messageInfoDetail', query: { id: scope.row.id } })"
+                    ><i class="el-icon-edit"></i
+                  ></el-button>
+                  <el-button type="text" size="small" @click="handleDelete(scope.row)"><i class="el-icon-delete"></i></el-button>
+                </template>
+              </el-table-column>
+            </el-table>
+            <el-col :span="24" class="page">
+              <el-pagination
+                @size-change="handleSizeChange"
+                @current-change="handleCurrentChange"
+                :current-page="currentPage"
+                layout="total, prev, pager, next, jumper"
+                :total="total"
+              >
+              </el-pagination>
+            </el-col>
+          </template>
+        </el-col>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+export default {
+  name: 'messageInfo',
+  props: {
+    message: null,
+    total: null,
+  },
+  components: {},
+  data: () => ({
+    currentPage: 1,
+  }),
+  created() {},
+  computed: {},
+  methods: {
+    handleSizeChange(val) {
+      console.log(`每页 ${val} 条`);
+    },
+    handleCurrentChange(val) {
+      console.log(`当前页: ${val}`);
+    },
+    addData() {
+      this.$router.push({ path: '/serve/messageInfoDetail' });
+    },
+    handleDelete(item) {
+      this.$emit('delete', item);
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.top {
+  padding: 15px 0;
+  border-bottom: 1px solid #cccc;
+}
+.top .topTitle {
+  padding: 0 10px;
+}
+.top .topAdd {
+  padding: 0 10px 0 0;
+  text-align: right;
+}
+.page {
+  padding: 20px 0;
+  text-align: center;
+}
+</style>

+ 30 - 1
src/router/index.js

@@ -41,13 +41,42 @@ export default new Router({
       path: '/policy/messageInfoDetail',
       component: () => import('../views/policy/messageInfoDetail.vue'),
     },
+    // 科技数据
+    {
+      path: '/record/index',
+      component: () => import('../views/record/index.vue'),
+    },
+    // 科技数据-栏目列表
+    {
+      path: '/record/columnDetail',
+      component: () => import('../views/record/columnDetail.vue'),
+    },
+    // 科技数据-信息列表
+    {
+      path: '/record/messageInfoDetail',
+      component: () => import('../views/record/messageInfoDetail.vue'),
+    },
+    // 科技服务
+    {
+      path: '/serve/index',
+      component: () => import('../views/serve/index.vue'),
+    },
+    // 科技服务-栏目列表
+    {
+      path: '/serve/columnDetail',
+      component: () => import('../views/serve/columnDetail.vue'),
+    },
+    // 科技服务-信息列表
+    {
+      path: '/serve/messageInfoDetail',
+      component: () => import('../views/serve/messageInfoDetail.vue'),
+    },
     // 站点信息
     {
       path: '/site/index',
       meta: { title: '网站设置' },
       component: () => import('../views/site/index.vue'),
     },
-
     // 友情链接管理
     {
       path: '/links/index',

+ 8 - 0
src/store/index.js

@@ -6,6 +6,10 @@ import news from './news';
 import column from './column';
 import policyColumn from './policyColumn';
 import policyNews from './policyNews';
+import recordColumn from './recordColumn';
+import recordNews from './recordNews';
+import serveColumn from './serveColumn';
+import serveNews from './serveNews';
 
 Vue.use(Vuex);
 
@@ -17,6 +21,10 @@ export default new Vuex.Store({
     column,
     policyColumn,
     policyNews,
+    recordColumn,
+    recordNews,
+    serveColumn,
+    serveNews,
   },
   state: {},
   mutations: {},

+ 38 - 0
src/store/recordColumn.js

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

+ 38 - 0
src/store/recordNews.js

@@ -0,0 +1,38 @@
+import Vue from 'vue';
+import Vuex from 'vuex';
+import _ from 'lodash';
+Vue.use(Vuex);
+const api = {
+  newsInfo: `/api/record/news`,
+};
+const state = () => ({});
+const mutations = {};
+
+const actions = {
+  async query({ commit }, { skip = 0, limit, column_id, ...info } = {}) {
+    const res = await this.$axios.$get(`${api.newsInfo}`, { skip, limit, column_id, ...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, ...data }) {
+    const res = await this.$axios.$post(`${api.newsInfo}/update/${id}`, data);
+    return res;
+  },
+  async delete({ commit }, payload) {
+    const res = await this.$axios.$delete(`${api.newsInfo}/${payload}`);
+    return res;
+  },
+};
+export default {
+  namespaced: true,
+  state,
+  mutations,
+  actions,
+};

+ 38 - 0
src/store/serveColumn.js

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

+ 38 - 0
src/store/serveNews.js

@@ -0,0 +1,38 @@
+import Vue from 'vue';
+import Vuex from 'vuex';
+import _ from 'lodash';
+Vue.use(Vuex);
+const api = {
+  newsInfo: `/api/serve/news`,
+};
+const state = () => ({});
+const mutations = {};
+
+const actions = {
+  async query({ commit }, { skip = 0, limit, column_id, ...info } = {}) {
+    const res = await this.$axios.$get(`${api.newsInfo}`, { skip, limit, column_id, ...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, ...data }) {
+    const res = await this.$axios.$post(`${api.newsInfo}/update/${id}`, data);
+    return res;
+  },
+  async delete({ commit }, payload) {
+    const res = await this.$axios.$delete(`${api.newsInfo}/${payload}`);
+    return res;
+  },
+};
+export default {
+  namespaced: true,
+  state,
+  mutations,
+  actions,
+};

+ 76 - 0
src/views/record/columnDetail.vue

@@ -0,0 +1,76 @@
+<template>
+  <div id="columnDetail">
+    <el-row>
+      <el-col :span="24" class="top">
+        <topInfo :topTitle="topTitle"></topInfo>
+      </el-col>
+      <el-col :span="24" class="main">
+        <column :form="form" @submitDate="onSubmit"></column>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import topInfo from '@/layout/public/top.vue';
+import column from '@/layout/record/columnDetail.vue';
+import { createNamespacedHelpers } from 'vuex';
+const { mapActions } = createNamespacedHelpers('recordColumn');
+export default {
+  name: 'columnDetail',
+  props: {},
+  components: {
+    column,
+    topInfo,
+  },
+  data: () => ({
+    topTitle: '添加栏目',
+    form: {},
+  }),
+  created() {
+    this.search();
+  },
+  computed: {
+    id() {
+      return this.$route.query.id;
+    },
+    keyWord() {
+      let meta = this.$route.meta;
+      let main = meta.title || '';
+      return main;
+    },
+  },
+  methods: {
+    ...mapActions(['fetch', 'create', 'update']),
+    async search() {
+      if (this.$route.query.id) {
+        const res = await this.fetch(this.id);
+        this.$set(this, `form`, res.data);
+      }
+    },
+    async onSubmit(form) {
+      let data = this.form;
+      console.log(data);
+      let res;
+      let msg;
+      if (data.id) {
+        res = await this.update(data);
+        msg = `${this.keyWord}修改成功`;
+      } else {
+        res = await this.create(data);
+        msg = `${this.keyWord}添加成功`;
+      }
+      if (this.$checkRes(res, msg)) this.$router.push({ path: '/record/index' });
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.main {
+  padding: 20px;
+  margin: 10px 20px;
+  border: 1px solid #ccc;
+  width: 96%;
+}
+</style>

+ 99 - 0
src/views/record/index.vue

@@ -0,0 +1,99 @@
+<template>
+  <div id="index">
+    <el-row>
+      <el-col :span="24" class="top">
+        <topInfo :topTitle="topTitle"></topInfo>
+      </el-col>
+      <el-col :span="24" class="main">
+        <el-col :span="7" class="column">
+          <column :columnInfo="columnInfo" @delete="deleteData" @list="handleList"></column>
+        </el-col>
+        <el-col :span="17" class="message">
+          <messageInfo :message="message" :total="total" @delete="deleteMess"></messageInfo>
+        </el-col>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import topInfo from '@/layout/public/top.vue';
+import column from '@/layout/record/column.vue';
+import messageInfo from '@/layout/record/messageInfo.vue';
+import { createNamespacedHelpers, mapGetters } from 'vuex';
+const { mapActions: mapColumn } = createNamespacedHelpers('recordColumn');
+const { mapActions: mapNews } = createNamespacedHelpers('recordNews');
+export default {
+  name: 'index',
+  props: {},
+  components: {
+    topInfo, //头部信息
+    column, //栏目列表
+    messageInfo, //信息列表
+  },
+  data: () => ({
+    topTitle: '科技数据',
+    columnInfo: [],
+    message: [],
+    total: 0,
+    leftId: null,
+  }),
+  created() {
+    this.search();
+  },
+  computed: {},
+  methods: {
+    ...mapColumn(['query', 'delete', 'fetch']),
+    ...mapNews({ queryList: 'query', deleteList: 'delete' }),
+    async search({ skip = 0, limit = 10, ...info } = {}) {
+      const res = await this.query({ skip, limit, ...info });
+      if (this.$checkRes(res)) {
+        this.$set(this, `columnInfo`, res.data);
+      }
+    },
+    async deleteData(item) {
+      const res = await this.delete(item.id);
+      this.$checkRes(res, '删除成功', '删除失败');
+      this.search();
+    },
+    handleList({ data }) {
+      this.$set(this, `leftId`, data.id);
+      this.searchRight();
+    },
+    async searchRight({ skip = 0, limit = 10, column_id } = {}) {
+      const res = await this.queryList({ skip, limit, column_id: this.leftId });
+      for (const val of res.data) {
+        const result = await this.fetch(val.column_id);
+        val.column_name = result.data.name;
+      }
+      this.$set(this, `message`, res.data);
+      this.$set(this, `total`, res.total);
+    },
+    async deleteMess(item) {
+      const res = await this.deleteList(item.id);
+      this.$checkRes(res, '删除成功', '删除失败');
+      this.search();
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.main {
+  padding: 20px;
+  margin: 10px 20px;
+  border: 1px solid #ccc;
+  width: 96%;
+}
+.column {
+  width: 258px;
+  min-height: 500px;
+  border: 1px solid #ccc;
+  margin: 0 20px 0 0;
+}
+.message {
+  border: 1px solid #ccc;
+  min-height: 500px;
+  width: 715px;
+}
+</style>

+ 92 - 0
src/views/record/messageInfoDetail.vue

@@ -0,0 +1,92 @@
+<template>
+  <div id="messageInfoDetail">
+    <el-row>
+      <el-col :span="24" class="top">
+        <topInfo :topTitle="topTitle"></topInfo>
+      </el-col>
+      <el-col :span="24" class="main">
+        <message :form="form" :columnList="columnList" @submitDate="onSubmit" :loading="loading"></message>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import topInfo from '@/layout/public/top.vue';
+import message from '@/layout/record/messageDetail.vue';
+import { createNamespacedHelpers, mapGetters } from 'vuex';
+const { mapActions: mapColumn } = createNamespacedHelpers('recordColumn');
+const { mapActions: mapNews } = createNamespacedHelpers('recordNews');
+export default {
+  name: 'messageInfoDetail',
+  props: {},
+  components: {
+    message,
+    topInfo,
+  },
+  data: () => ({
+    topTitle: '添加信息',
+    form: {},
+    columnList: [],
+    loading: true,
+  }),
+  created() {
+    this.search();
+    this.searchColumn();
+  },
+  computed: {
+    id() {
+      return this.$route.query.id;
+    },
+    keyWord() {
+      let meta = this.$route.meta;
+      let main = meta.title || '';
+      return main;
+    },
+  },
+  methods: {
+    ...mapNews(['fetch', 'create', 'update']),
+    ...mapColumn({ queryList: 'query' }),
+    async search() {
+      this.loading = false;
+      if (this.$route.query.id) {
+        const res = await this.fetch(this.id);
+        this.$set(this, `form`, res.data);
+      }
+      this.loading = true;
+    },
+    async onSubmit(form) {
+      let data = this.form;
+      console.log(data);
+      let res;
+      let msg;
+      if (data.id) {
+        res = await this.update(data);
+        msg = `${this.keyWord}修改成功`;
+      } else {
+        res = await this.create(data);
+        msg = `${this.keyWord}添加成功`;
+      }
+      if (this.$checkRes(res, msg)) this.$router.push({ path: '/record/index' });
+    },
+    async searchColumn({ ...info } = {}) {
+      const res = await this.queryList({ ...info });
+      if (this.$checkRes(res)) {
+        this.$set(this, `columnList`, res.data);
+      }
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.top {
+  padding: 0 0 10px 0;
+}
+.main {
+  padding: 20px;
+  margin: 10px 20px;
+  border: 1px solid #ccc;
+  width: 96%;
+}
+</style>

+ 76 - 0
src/views/serve/columnDetail.vue

@@ -0,0 +1,76 @@
+<template>
+  <div id="columnDetail">
+    <el-row>
+      <el-col :span="24" class="top">
+        <topInfo :topTitle="topTitle"></topInfo>
+      </el-col>
+      <el-col :span="24" class="main">
+        <column :form="form" @submitDate="onSubmit"></column>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import topInfo from '@/layout/public/top.vue';
+import column from '@/layout/serve/columnDetail.vue';
+import { createNamespacedHelpers } from 'vuex';
+const { mapActions } = createNamespacedHelpers('serveColumn');
+export default {
+  name: 'columnDetail',
+  props: {},
+  components: {
+    column,
+    topInfo,
+  },
+  data: () => ({
+    topTitle: '添加栏目',
+    form: {},
+  }),
+  created() {
+    this.search();
+  },
+  computed: {
+    id() {
+      return this.$route.query.id;
+    },
+    keyWord() {
+      let meta = this.$route.meta;
+      let main = meta.title || '';
+      return main;
+    },
+  },
+  methods: {
+    ...mapActions(['fetch', 'create', 'update']),
+    async search() {
+      if (this.$route.query.id) {
+        const res = await this.fetch(this.id);
+        this.$set(this, `form`, res.data);
+      }
+    },
+    async onSubmit(form) {
+      let data = this.form;
+      console.log(data);
+      let res;
+      let msg;
+      if (data.id) {
+        res = await this.update(data);
+        msg = `${this.keyWord}修改成功`;
+      } else {
+        res = await this.create(data);
+        msg = `${this.keyWord}添加成功`;
+      }
+      if (this.$checkRes(res, msg)) this.$router.push({ path: '/serve/index' });
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.main {
+  padding: 20px;
+  margin: 10px 20px;
+  border: 1px solid #ccc;
+  width: 96%;
+}
+</style>

+ 99 - 0
src/views/serve/index.vue

@@ -0,0 +1,99 @@
+<template>
+  <div id="index">
+    <el-row>
+      <el-col :span="24" class="top">
+        <topInfo :topTitle="topTitle"></topInfo>
+      </el-col>
+      <el-col :span="24" class="main">
+        <el-col :span="7" class="column">
+          <column :columnInfo="columnInfo" @delete="deleteData" @list="handleList"></column>
+        </el-col>
+        <el-col :span="17" class="message">
+          <messageInfo :message="message" :total="total" @delete="deleteMess"></messageInfo>
+        </el-col>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import topInfo from '@/layout/public/top.vue';
+import column from '@/layout/serve/column.vue';
+import messageInfo from '@/layout/serve/messageInfo.vue';
+import { createNamespacedHelpers, mapGetters } from 'vuex';
+const { mapActions: mapColumn } = createNamespacedHelpers('serveColumn');
+const { mapActions: mapNews } = createNamespacedHelpers('serveNews');
+export default {
+  name: 'index',
+  props: {},
+  components: {
+    topInfo, //头部信息
+    column, //栏目列表
+    messageInfo, //信息列表
+  },
+  data: () => ({
+    topTitle: '科技服务',
+    columnInfo: [],
+    message: [],
+    total: 0,
+    leftId: null,
+  }),
+  created() {
+    this.search();
+  },
+  computed: {},
+  methods: {
+    ...mapColumn(['query', 'delete', 'fetch']),
+    ...mapNews({ queryList: 'query', deleteList: 'delete' }),
+    async search({ skip = 0, limit = 10, ...info } = {}) {
+      const res = await this.query({ skip, limit, ...info });
+      if (this.$checkRes(res)) {
+        this.$set(this, `columnInfo`, res.data);
+      }
+    },
+    async deleteData(item) {
+      const res = await this.delete(item.id);
+      this.$checkRes(res, '删除成功', '删除失败');
+      this.search();
+    },
+    handleList({ data }) {
+      this.$set(this, `leftId`, data.id);
+      this.searchRight();
+    },
+    async searchRight({ skip = 0, limit = 10, column_id } = {}) {
+      const res = await this.queryList({ skip, limit, column_id: this.leftId });
+      for (const val of res.data) {
+        const result = await this.fetch(val.column_id);
+        val.column_name = result.data.name;
+      }
+      this.$set(this, `message`, res.data);
+      this.$set(this, `total`, res.total);
+    },
+    async deleteMess(item) {
+      const res = await this.deleteList(item.id);
+      this.$checkRes(res, '删除成功', '删除失败');
+      this.search();
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.main {
+  padding: 20px;
+  margin: 10px 20px;
+  border: 1px solid #ccc;
+  width: 96%;
+}
+.column {
+  width: 258px;
+  min-height: 500px;
+  border: 1px solid #ccc;
+  margin: 0 20px 0 0;
+}
+.message {
+  border: 1px solid #ccc;
+  min-height: 500px;
+  width: 715px;
+}
+</style>

+ 92 - 0
src/views/serve/messageInfoDetail.vue

@@ -0,0 +1,92 @@
+<template>
+  <div id="messageInfoDetail">
+    <el-row>
+      <el-col :span="24" class="top">
+        <topInfo :topTitle="topTitle"></topInfo>
+      </el-col>
+      <el-col :span="24" class="main">
+        <message :form="form" :columnList="columnList" @submitDate="onSubmit" :loading="loading"></message>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import topInfo from '@/layout/public/top.vue';
+import message from '@/layout/serve/messageDetail.vue';
+import { createNamespacedHelpers, mapGetters } from 'vuex';
+const { mapActions: mapColumn } = createNamespacedHelpers('serveColumn');
+const { mapActions: mapNews } = createNamespacedHelpers('serveNews');
+export default {
+  name: 'messageInfoDetail',
+  props: {},
+  components: {
+    message,
+    topInfo,
+  },
+  data: () => ({
+    topTitle: '添加信息',
+    form: {},
+    columnList: [],
+    loading: true,
+  }),
+  created() {
+    this.search();
+    this.searchColumn();
+  },
+  computed: {
+    id() {
+      return this.$route.query.id;
+    },
+    keyWord() {
+      let meta = this.$route.meta;
+      let main = meta.title || '';
+      return main;
+    },
+  },
+  methods: {
+    ...mapNews(['fetch', 'create', 'update']),
+    ...mapColumn({ queryList: 'query' }),
+    async search() {
+      this.loading = false;
+      if (this.$route.query.id) {
+        const res = await this.fetch(this.id);
+        this.$set(this, `form`, res.data);
+      }
+      this.loading = true;
+    },
+    async onSubmit(form) {
+      let data = this.form;
+      console.log(data);
+      let res;
+      let msg;
+      if (data.id) {
+        res = await this.update(data);
+        msg = `${this.keyWord}修改成功`;
+      } else {
+        res = await this.create(data);
+        msg = `${this.keyWord}添加成功`;
+      }
+      if (this.$checkRes(res, msg)) this.$router.push({ path: '/serve/index' });
+    },
+    async searchColumn({ ...info } = {}) {
+      const res = await this.queryList({ ...info });
+      if (this.$checkRes(res)) {
+        this.$set(this, `columnList`, res.data);
+      }
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.top {
+  padding: 0 0 10px 0;
+}
+.main {
+  padding: 20px;
+  margin: 10px 20px;
+  border: 1px solid #ccc;
+  width: 96%;
+}
+</style>

+ 10 - 0
vue.config.js

@@ -39,6 +39,16 @@ module.exports = {
         target: 'http://10.16.9.108:9003',
         changeOrigin: true,
         ws: true,
+      },
+      '/api/record': {
+        target: 'http://10.16.9.108:9005',
+        changeOrigin: true,
+        ws: true,
+      },
+      '/api/serve': {
+        target: 'http://10.16.9.108:9006',
+        changeOrigin: true,
+        ws: true,
         // pathRewrite: { '^/api/affairs': '/api' },
       },
     },