Explorar o código

Merge branch 'master' of http://git.cc-lotus.info/service-platform/admin-cms

guhongwei %!s(int64=5) %!d(string=hai) anos
pai
achega
f5ef718bd7

+ 75 - 0
src/layout/technical/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: '/technical/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: '/technical/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>

+ 68 - 0
src/layout/technical/columnDetail.vue

@@ -0,0 +1,68 @@
+<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="ztyt"></el-option>
+                <el-option label="专家问诊" value="zjwz"></el-option>
+                <el-option label="行业研究" value="hyyj"></el-option>
+                <el-option label="教育培训" value="jypx"></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: '/technical/index' });
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.top {
+  padding: 15px 0;
+}
+.top .topTitle {
+  text-align: left;
+}
+.top .topBtn {
+  text-align: right;
+  padding: 0 5px;
+}
+</style>

+ 100 - 0
src/layout/technical/messageDetail.vue

@@ -0,0 +1,100 @@
+<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" :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="所属栏目" 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="标题简介">
+              <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-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: () => ({
+    rules: {
+      title: [
+        { required: true, message: '请输入信息标题', trigger: 'blur' },
+        { min: 3, max: 5, message: '长度在 0 到 50 个字符', trigger: 'blur' },
+      ],
+    },
+  }),
+  created() {},
+  computed: {},
+  methods: {
+    returnBtn() {
+      this.$router.push({ path: '/technical/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) {
+        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>

+ 93 - 0
src/layout/technical/messageInfo.vue

@@ -0,0 +1,93 @@
+<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: '/technical/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"
+                :page-size="pageSize"
+              >
+              </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,
+    pageSize: 10,
+  }),
+  created() {},
+  computed: {},
+  methods: {
+    handleSizeChange(val) {
+      console.log(`每页 ${val} 条`);
+    },
+
+    handleCurrentChange(currentPage) {
+      this.$emit('page', { skip: (currentPage - 1) * this.pageSize, limit: this.pageSize, currentPage });
+    },
+    addData() {
+      this.$router.push({ path: '/technical/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>

+ 24 - 0
src/router/index.js

@@ -48,6 +48,30 @@ const routes = [
     meta: { title: '部门管理' },
     component: () => import('../views/department/index.vue'),
   },
+  //技术培训
+  {
+    path: '/technical/index',
+    meta: { title: '技术培训' },
+    component: () => import('../views/technical/index.vue'),
+  },
+
+  // 技术培训-栏目列表
+  {
+    path: '/technical/columnDetail',
+    component: () => import('../views/technical/columnDetail.vue'),
+  },
+  // 技术培训-信息列表
+  {
+    path: '/technical/messageInfoDetail',
+    component: () => import('../views/technical/messageInfoDetail.vue'),
+  },
+
+  //字典管理
+  {
+    path: '/dictionary/index',
+    meta: { title: '字典管理' },
+    component: () => import('../views/dictionary/index.vue'),
+  },
 ];
 
 const router = new VueRouter({

+ 38 - 0
src/store/codeCategory.js

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

+ 38 - 0
src/store/codeitem.js

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

+ 9 - 0
src/store/index.js

@@ -3,6 +3,10 @@ import Vuex from 'vuex';
 import login from '@common/store/login';
 import * as ustate from '@common/store/user/state';
 import * as umutations from '@common/store/user/mutations';
+import codeitem from './codeitem';
+import codeCategory from './codeCategory';
+import liveTechnicalColumn from './liveTechnicalColumn';
+import liveTechnicalNews from './liveTechnicalNews';
 // 个人&企业
 import users from './user';
 Vue.use(Vuex);
@@ -10,6 +14,11 @@ Vue.use(Vuex);
 export default new Vuex.Store({
   modules: {
     login,
+
+    codeitem, //字典表
+    codeCategory, //字典表类别
+    liveTechnicalColumn, //技术培训类别
+    liveTechnicalNews, //技术培训内容
     users,
   },
   state: { ...ustate },

+ 42 - 0
src/store/liveTechnicalColumn.js

@@ -0,0 +1,42 @@
+import Vue from 'vue';
+import Vuex from 'vuex';
+import _ from 'lodash';
+Vue.use(Vuex);
+const api = {
+  columnInfo: `/api/live/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,
+};

+ 43 - 0
src/store/liveTechnicalNews.js

@@ -0,0 +1,43 @@
+import Vue from 'vue';
+import Vuex from 'vuex';
+import _ from 'lodash';
+Vue.use(Vuex);
+const api = {
+  newsInfo: `/api/live/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,
+};

+ 68 - 0
src/views/dictionary/index.vue

@@ -0,0 +1,68 @@
+<template>
+  <div id="index">
+    <el-row>
+      <el-col :span="24" class="info">
+        <el-col :span="24" class="top">
+          <topInfo :topTitle="pageTitle"></topInfo>
+        </el-col>
+        <el-col :span="24" class="main">
+          <el-col :span="7" class="column">
+            <column @setCategory="data => (category = data)" @setList="data => (categoryList = data)"></column>
+          </el-col>
+          <el-col :span="17" class="message">
+            <item-list :category="category" :categoryList="categoryList"></item-list>
+          </el-col>
+        </el-col>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import topInfo from '@/layout/public/top.vue';
+import column from './parts/column.vue';
+import itemList from './parts/itemList.vue';
+import dataTable from '@/components/data-table.vue';
+import { mapState, createNamespacedHelpers } from 'vuex';
+export default {
+  name: 'index',
+  props: {},
+  components: { topInfo, column, itemList },
+  data: () => {
+    return {
+      category: undefined,
+      categoryList: [],
+    };
+  },
+  created() {},
+  methods: {},
+  computed: {
+    ...mapState(['user']),
+    pageTitle() {
+      return `${this.$route.meta.title}`;
+    },
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.main {
+  padding: 20px;
+  margin: 10px 20px;
+  border: 1px solid #ccc;
+  width: 96%;
+}
+.column {
+  width: 27%;
+  min-height: 500px;
+  border: 1px solid #ccc;
+  margin: 0 20px 0 0;
+}
+.message {
+  border: 1px solid #ccc;
+  min-height: 500px;
+}
+</style>

+ 124 - 0
src/views/dictionary/parts/column.vue

@@ -0,0 +1,124 @@
+<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="toAdd()"><i class="el-icon-plus"></i></el-button>
+          </el-col>
+        </el-col>
+        <el-col :span="24" class="list">
+          <data-table :fields="fields" @delete="toDelete" :data="list" :opera="opera" @edit="toEdit" @rowClick="rowClick" :usePage="false"></data-table>
+        </el-col>
+      </el-col>
+      <el-drawer title="字典类别" :visible.sync="drawer" direction="rtl" @closed="handleClose" :destroy-on-close="true">
+        <data-form :fields="fields" :data="form" :rules="{}" @save="drawerSave" :isNew="drawerIsNew"></data-form>
+      </el-drawer>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import dataForm from '@/components/form.vue';
+import dataTable from '@/components/data-table.vue';
+import { mapActions, mapState, createNamespacedHelpers } from 'vuex';
+const { mapActions: codeCategory } = createNamespacedHelpers('codeCategory');
+export default {
+  name: 'column',
+  props: {
+    columnInfo: null,
+  },
+  components: { dataTable, dataForm },
+  data: () => ({
+    drawer: false,
+    form: {},
+    drawerIsNew: true,
+    opera: [
+      {
+        label: '编辑',
+        icon: 'el-icon-edit',
+        method: 'edit',
+      },
+      {
+        label: '删除',
+        icon: 'el-icon-delete',
+        method: 'delete',
+        confirm: true,
+      },
+    ],
+    fields: [
+      { label: '名称', prop: 'name', model: 'name' },
+      { label: '代码', prop: 'code', model: 'code' },
+    ],
+    list: [],
+    total: 0,
+  }),
+  created() {
+    this.search();
+  },
+  computed: {},
+  methods: {
+    ...codeCategory(['query', 'create', 'update', 'delete']),
+    async search({ skip = 0, limit = 10, ...info } = {}) {
+      const res = await this.query({ ...info });
+      if (this.$checkRes(res)) {
+        this.$set(this, `list`, res.data);
+        this.$set(this, `total`, res.total);
+        this.$emit('setList', res.data);
+      }
+    },
+    toAdd() {
+      this.drawer = true;
+    },
+    toEdit({ data }) {
+      this.$set(this, 'form', data);
+      this.drawer = true;
+      this.drawerIsNew = false;
+    },
+    async drawerSave({ data, isNew }) {
+      let res;
+      let msg;
+      if (isNew) {
+        res = await this.create(data);
+        msg = '字典类别创建成功';
+      } else {
+        res = await this.update(data);
+        msg = '字典类别修改成功';
+      }
+      if (this.$checkRes(res, msg, res.errmsg)) {
+        this.handleClose();
+        this.search();
+      }
+    },
+    async toDelete({ data }) {
+      const res = await this.delete(data.id);
+      if (this.$checkRes(res, '删除成功', res.errmsg || '删除失败')) this.search();
+    },
+    handleClose() {
+      this.drawer = false;
+      this.form = {};
+      this.drawerIsNew = true;
+    },
+    rowClick(row) {
+      this.$emit('setCategory', row.code);
+    },
+  },
+};
+</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>

+ 161 - 0
src/views/dictionary/parts/itemList.vue

@@ -0,0 +1,161 @@
+<template>
+  <div id="itemList">
+    <el-row>
+      <el-col :span="24" class="info">
+        <el-col :span="24" class="top">
+          <el-col :span="12" class="topTitle">
+            <span>{{ pageTitle }}</span>
+          </el-col>
+          <el-col :span="12" class="topAdd">
+            <el-button type="primary" size="mini" @click="toAdd()"><i class="el-icon-plus"></i></el-button>
+          </el-col>
+        </el-col>
+        <el-col :span="24" class="list">
+          <data-table :fields="fields" @delete="toDelete" :data="list" :total="total" :opera="opera" @edit="toEdit" :usePage="true"></data-table>
+        </el-col>
+      </el-col>
+      <el-drawer title="字典项" :visible.sync="drawer" direction="rtl" @closed="handleClose" :destroy-on-close="true">
+        <data-form :fields="fields" :data="form" :rules="{}" @save="drawerSave" :isNew="drawerIsNew">
+          <template #options="{item}">
+            <template v-if="item.model === 'category'">
+              <el-option v-for="(i, index) in categoryList" :key="index" :label="i.name" :value="i.code"></el-option>
+            </template>
+          </template>
+        </data-form>
+      </el-drawer>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import dataForm from '@/components/form.vue';
+import dataTable from '@/components/data-table.vue';
+import { mapActions, mapState, createNamespacedHelpers } from 'vuex';
+const { mapActions: codeitem } = createNamespacedHelpers('codeitem');
+const { mapActions: codeCategory } = createNamespacedHelpers('codeCategory');
+export default {
+  name: 'itemList',
+  props: {
+    category: String,
+    categoryList: Array,
+  },
+  components: { dataTable, dataForm },
+  data: () => {
+    return {
+      pageTitle: '字典项',
+      drawer: false,
+      form: {},
+      drawerIsNew: true,
+      opera: [
+        {
+          label: '编辑',
+          icon: 'el-icon-edit',
+          method: 'edit',
+        },
+        {
+          label: '删除',
+          icon: 'el-icon-delete',
+          method: 'delete',
+          confirm: true,
+        },
+      ],
+      fields: [
+        { label: '名称', prop: 'name', model: 'name' },
+        { label: '代码', prop: 'code', model: 'code' },
+        { label: '类别代码', prop: 'category', model: 'category', type: 'select' },
+      ],
+      list: [],
+      total: 0,
+    };
+  },
+  created() {},
+  methods: {
+    ...codeitem(['query', 'create', 'update', 'delete']),
+    async search({ skip = 0, category = this.category, limit = 10, ...info } = {}) {
+      // ...info, category: this.category
+      const res = await this.query(({ skip = 0, limit = 10, ...info } = {}));
+      console.log(res.total);
+
+      if (this.$checkRes(res)) {
+        this.$set(this, `list`, res.data);
+        this.$set(this, `total`, res.total);
+      }
+    },
+    toAdd() {
+      this.drawer = true;
+    },
+    toEdit({ data }) {
+      this.$set(this, 'form', data);
+      this.drawer = true;
+      this.drawerIsNew = false;
+    },
+    async drawerSave({ data, isNew }) {
+      let res;
+      let msg;
+      if (isNew) {
+        res = await this.create(data);
+        msg = '字典项创建成功';
+      } else {
+        res = await this.update(data);
+        msg = '字典项修改成功';
+      }
+      if (this.$checkRes(res, msg, res.errmsg)) {
+        this.handleClose();
+        this.search();
+      }
+    },
+    async toDelete({ data }) {
+      const res = await this.delete(data.id);
+      if (this.$checkRes(res, '删除成功', res.errmsg || '删除失败')) this.search();
+    },
+    handleClose() {
+      this.drawer = false;
+      this.form = {};
+      if (this.category) this.form.category = this.category;
+      this.drawerIsNew = true;
+    },
+    async getOtherList() {
+      let res = await this.getCategoryList();
+      if (this.$checkRes(res)) this.$set(this, `categoryList`, res.data);
+    },
+  },
+  watch: {
+    category: {
+      handler(val) {
+        if (val) {
+          this.search();
+          this.$set(this.form, `category`, val);
+          let res = this.categoryList.find(f => f.code == val);
+          console.log(res);
+          if (res) this.$set(this, `pageTitle`, res.name);
+        }
+      },
+      immediate: true,
+    },
+  },
+  computed: {
+    ...mapState(['user']),
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+};
+</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>

+ 76 - 0
src/views/technical/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/technical/columnDetail.vue';
+import { createNamespacedHelpers } from 'vuex';
+const { mapActions } = createNamespacedHelpers('liveTechnicalColumn');
+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: '/technical/index' });
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.main {
+  padding: 20px;
+  margin: 10px 20px;
+  border: 1px solid #ccc;
+  width: 96%;
+}
+</style>

+ 105 - 0
src/views/technical/index.vue

@@ -0,0 +1,105 @@
+<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" @page="pages"></messageInfo>
+        </el-col>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import topInfo from '@/layout/public/top.vue';
+import column from '@/layout/technical/column.vue';
+import messageInfo from '@/layout/technical/messageInfo.vue';
+import { createNamespacedHelpers, mapGetters } from 'vuex';
+const { mapActions: liveTechnicalColumn } = createNamespacedHelpers('liveTechnicalColumn');
+const { mapActions: liveTechnicalNews } = createNamespacedHelpers('liveTechnicalNews');
+export default {
+  name: 'index',
+  props: {},
+  components: {
+    topInfo, //头部信息
+    column, //栏目列表
+    messageInfo, //信息列表
+  },
+  data: () => ({
+    topTitle: '技术培训',
+    columnInfo: [],
+    message: [],
+    total: 0,
+    leftId: null,
+    skip: '',
+  }),
+  created() {
+    this.search();
+  },
+  computed: {},
+  methods: {
+    ...liveTechnicalColumn(['query', 'delete', 'fetch']),
+    ...liveTechnicalNews({ 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 } = {}) {
+      skip = this.skip;
+      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();
+    },
+    async pages({ skip, limit, currentPage }) {
+      console.log('ccc');
+      this.$set(this, `skip`, skip);
+      this.searchRight();
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.main {
+  padding: 20px;
+  margin: 10px 20px;
+  border: 1px solid #ccc;
+  width: 96%;
+}
+.column {
+  width: 27%;
+  min-height: 500px;
+  border: 1px solid #ccc;
+  margin: 0 20px 0 0;
+}
+.message {
+  border: 1px solid #ccc;
+  min-height: 500px;
+}
+</style>

+ 97 - 0
src/views/technical/messageInfoDetail.vue

@@ -0,0 +1,97 @@
+<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/technical/messageDetail.vue';
+import { createNamespacedHelpers, mapGetters, mapState } from 'vuex';
+const { mapActions: liveTechnicalColumn } = createNamespacedHelpers('liveTechnicalColumn');
+const { mapActions: liveTechnicalNews } = createNamespacedHelpers('liveTechnicalNews');
+export default {
+  name: 'messageInfoDetail',
+  props: {},
+  components: {
+    message,
+    topInfo,
+  },
+  data: () => ({
+    topTitle: '添加信息',
+    form: {},
+    columnList: [],
+    loading: true,
+  }),
+  created() {
+    this.search();
+    this.searchColumn();
+  },
+  computed: {
+    ...mapState(['user']),
+    id() {
+      return this.$route.query.id;
+    },
+    keyWord() {
+      let meta = this.$route.meta;
+      let main = meta.title || '';
+      return main;
+    },
+  },
+  methods: {
+    ...liveTechnicalNews(['fetch', 'create', 'update']),
+    ...liveTechnicalColumn({ 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;
+      console.log(this.user.uid);
+
+      data.uid = this.user.uid;
+      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: '/technical/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>