Browse Source

Merge remote-tracking branch 'origin/麦塔' into 麦塔

# Conflicts:
#	src/views/client/newsInforDetails.vue
tanxue 5 years ago
parent
commit
df78a45f96
30 changed files with 1371 additions and 704 deletions
  1. 6 6
      src/api/hangyezixun.js
  2. 10 2
      src/api/login.js
  3. 56 0
      src/api/newsClassify.js
  4. 48 0
      src/components/client/common/Cframe.vue
  5. 86 24
      src/components/client/common/footer.vue
  6. 60 526
      src/components/client/common/header.vue
  7. 116 29
      src/router.js
  8. 1 12
      src/views/client/CourseDev.vue
  9. 12 6
      src/views/client/Index.vue
  10. 34 0
      src/views/client/aboutUs.vue
  11. 34 0
      src/views/client/examPlatform.vue
  12. 34 0
      src/views/client/helpCenter.vue
  13. 34 0
      src/views/client/newsInfor.vue
  14. 0 1
      src/views/client/newsInforDetails.vue
  15. 34 0
      src/views/client/peixunPlatform.vue
  16. 80 26
      src/views/management/HangYeZiXun/HangYeZiXunConfig/index.vue
  17. 12 9
      src/views/management/HangYeZiXun/components/Pagination.vue
  18. 69 0
      src/views/management/HangYeZiXun/components/Select.vue
  19. 7 2
      src/views/management/HangYeZiXun/components/Table.vue
  20. 85 20
      src/views/management/HangYeZiXun/index.vue
  21. 78 0
      src/views/management/XinWenFenLei/components/Pagination.vue
  22. 113 0
      src/views/management/XinWenFenLei/components/Table.vue
  23. 0 0
      src/views/management/XinWenFenLei/components/paginationData.js
  24. 0 0
      src/views/management/XinWenFenLei/components/tableData.js
  25. 324 0
      src/views/management/XinWenFenLei/index.vue
  26. 14 8
      src/views/management/YouQingLianJie/components/Pagination.vue
  27. 1 1
      src/views/management/YouQingLianJie/components/Table.vue
  28. 0 14
      src/views/management/YouQingLianJie/components/paginationData.js
  29. 0 11
      src/views/management/YouQingLianJie/components/tableData.js
  30. 23 7
      src/views/management/YouQingLianJie/index.vue

+ 6 - 6
src/api/hangyezixun.js

@@ -1,36 +1,36 @@
 import request           from '@/utils/request';
 
-const pre = `/industry`
+const pre = `/news`
 
-export function getIndustryAdd(data = {}) {
+export function getNewsAdd(data = {}) {
     return request({
                        url:    `${pre}/add`,
                        method: 'post',
                        data,
                    });
 }
-export function getIndustryDelete(data = {}) {
+export function getNewsDelete(data = {}) {
     return request({
                        url:    `${pre}/delete`,
                        method: 'post',
                        data,
                    });
 }
-export function getIndustryInfo(data = {}) {
+export function getNewsInfo(data = {}) {
     return request({
                        url:    `${pre}/info`,
                        method: 'post',
                        data,
                    });
 }
-export function getIndustryList(data = {}) {
+export function getNewsList(data = {}) {
     return request({
                        url:    `${pre}/list`,
                        method: 'post',
                        data,
                    });
 }
-export function getIndustryUpdate(data = {}) {
+export function getNewsUpdate(data = {}) {
     return request({
                        url:    `${pre}/update`,
                        method: 'post',

+ 10 - 2
src/api/login.js

@@ -20,7 +20,7 @@ export function getOrgList(data = {}) {
 //  describe: 【前台】行业资讯 : Client Industry Controlle author: Wgy date:2020-08-05
 export function homeIndustryList(data = {}) {
     return request({
-                       url:    `/home/industry/list`,
+                       url:    `/home/news/carousel`,
                        method: 'post',
                        data,
                    });
@@ -28,7 +28,15 @@ export function homeIndustryList(data = {}) {
 //  describe: 【前台】行业资讯 : Client Industry Controlle author: Wgy date:2020-08-05
 export function homeIndustryInfo(data = {}) {
     return request({
-                       url:    `/home/industry/info`,
+                       url:    `/home/news/info`,
+                       method: 'post',
+                       data,
+                   });
+}
+//  describe:【前台】友情链接 :  author: Wgy date:2020-08-06
+export function homeLinksList(data = {}) {
+    return request({
+                       url:    `/home/links/list`,
                        method: 'post',
                        data,
                    });

+ 56 - 0
src/api/newsClassify.js

@@ -0,0 +1,56 @@
+import request           from '@/utils/request';
+
+const pre = `/news/classify`
+
+export function getNewsClassifyAdd(data = {}) {
+    return request({
+                       url:    `${pre}/add`,
+                       method: 'post',
+                       data,
+                   });
+}
+
+
+export function getNewsClassifyDelete(data = {}) {
+    return request({
+                       url:    `${pre}/delete`,
+                       method: 'post',
+                       data,
+                   });
+}
+
+
+export function getNewsClassifyInfo(data = {}) {
+    return request({
+                       url:    `${pre}/info`,
+                       method: 'post',
+                       data,
+                   });
+}
+
+
+export function getNewsClassifyList(data = {}) {
+    return request({
+                       url:    `${pre}/list`,
+                       method: 'post',
+                       data,
+                   });
+}
+
+
+export function getNewsClassifySearch(data = {}) {
+    return request({
+                       url:    `${pre}/search`,
+                       method: 'post',
+                       data,
+                   });
+}
+
+
+export function getNewsClassifyUpdate(data = {}) {
+    return request({
+                       url:    `${pre}/update`,
+                       method: 'post',
+                       data,
+                   });
+}

+ 48 - 0
src/components/client/common/Cframe.vue

@@ -0,0 +1,48 @@
+<template>
+    <el-container class="mta-Cframe" direction="vertical">
+        <!-- header -->
+        <mta-header></mta-header>
+        <!-- main -->
+        <el-container class="mta-home-box">
+            <div class="mta-home-box-c">
+                <router-view/>
+            </div>
+        </el-container>
+        <mta-footer></mta-footer>
+    </el-container>
+</template>
+<script>
+    import { mapGetters }                            from 'vuex';
+    import MtaHeader                                 from '@/components/client/common/header.vue';
+    import MtaFooter                                 from '@/components/client/common/footer.vue';
+    import { initThemeColor, handleLocalstorgeData } from '@/utils/theme';
+    import * as Initialization                       from '@/utils/initializationConfig';
+
+
+    export default {
+        name:       'cframe',
+        components: {
+            MtaHeader,
+            MtaFooter,
+        },
+        data() {
+            return {
+                // activeNav: '/c/Exam/full'
+            };
+        },
+        computed:   {
+            ...mapGetters(['getAuth', 'getThemeColor']),
+        },
+        methods:    {},
+        created() {
+            initThemeColor();
+            let typeface = handleLocalstorgeData('themeFont', 'data-fontsize', '');
+            handleLocalstorgeData('themeFont', 'data-fontsize', typeface);
+            // 初始化 系统标签logo
+            Initialization.initializationPageConfig();
+        },
+    };
+</script>
+<style lang="scss" scoped>
+
+</style>

+ 86 - 24
src/components/client/common/footer.vue

@@ -1,49 +1,111 @@
 <template>
-    <div class="mta-client-footer">
-        <el-row type="flex">
-            <el-col class="footer-col-wrap">
-                <!--版权所有2019 大连栋科软件工程有限公司-->
-                {{footText}}
-            </el-col>
-        </el-row>
+    <div class="website-footer">
+        <div class="website-container">
+            <div class="contact-box">
+                <div class="contact-left-box">
+                    <dl>
+                        <dt>产品服务</dt>
+                        <dd>考试平台</dd>
+                        <dd>培训平台</dd>
+                        <dd>课程开发</dd>
+                    </dl>
+                    <dl>
+                        <dt>关于栋科</dt>
+                        <dd>公司简介</dd>
+                        <dd>加入栋科</dd>
+                        <dd>联系我们</dd>
+                    </dl>
+                    <dl>
+                        <dt>帮助中心</dt>
+                        <dd>说明文档</dd>
+                        <dd>应用下载</dd>
+                    </dl>
+                    <dl>
+                        <dt>法律声明</dt>
+                        <dd>服务条款</dd>
+                        <dd>隐私声明</dd>
+                        <dd>知识维权</dd>
+                    </dl>
+                    <dl>
+                        <dt>关注我们</dt>
+                        <dd>微信公众号</dd>
+                        <dd>新浪微博</dd>
+                    </dl>
+                </div>
+                <div class="contact-right-box">
+                    <h3>400-052-2130</h3>
+                    <p>周一至周日9:00-18:00</p>
+                    <p>(仅收市话费)</p>
+                    <a>联系客服</a>
+                </div>
+            </div>
+            <div class="link-box">
+                <h4>友情链接</h4>
+                <div class="link-a-box">
+                    <div v-for="(item,index) in LinksData">
+                        <a @click="goToPage(item)">{{item.name}}</a>
+                    </div>
+               <!--     <a>物流软件</a>
+                    <a>免费erp管理系统</a>
+                    <a>物流软件</a>
+                    <a>免费erp管理系统</a>
+                    <a>物流软件</a>
+                    <a>免费erp管理系统</a>
+                    <a>物流软件</a>
+                    <a>免费erp管理系统</a>
+                    <a>物流软件</a>
+                    <a>新零售系统</a>
+                    <a>物流软件</a>
+                    <a>新零售系统</a>
+                    <a>物流软件</a>
+                    <a>新零售系统</a>
+                    <a>物流软件</a>
+                    <a>新零售系统</a>
+                    <a>物流软件</a>
+                    <a>新零售系统</a>
+                    <a>物流软件</a>
+                    <a>新零售系统</a>-->
+                </div>
+            </div>
+            <h5>Copyright © 2019 llisoft.com All rights reserved 大连栋科软件工程有限公司 版权所有 辽ICP备09022904号-19</h5>
+        </div>
     </div>
 </template>
 
 <script>
     import { mapGetters } from 'vuex'
+    import { homeLinksList } from '@/api/login.js';
     export default {
         name:    'mtaFooter',
         computed: {
-            footText() {
-                let str = 'Copyright © 2019 llisoft.com All rights reserved 大连栋科软件工程有限公司 版权所有 辽ICP备09022904号-19';
-                return this.getReplaceContext && this.getReplaceContext.footText ? this.getReplaceContext.footText : str;
-            },
-            ...mapGetters([
-                              'getReplaceContext'
-                          ])
+
         },
         props:   {
-            activeNav: { // 默认选中的 路径 与组件中的index相互对应
-                type:    String,
-                require: true,
-                default: '0',
-            },
+            activeNav: {},
         },
         data() {
             return {
+                LinksData:[]
             };
         },
         watch:   {
         },
         methods: {
-            /*handleSelect(key, keyPath) {
-                this.$emit('navSelectChange', {
-                    key: key,
-                    keyPath: keyPath
+
+            getLinksData(){
+                homeLinksList().then(res=>{
+                       if(res.code===0){
+                           console.log(res.data.data);
+                           this.linksData = res.data.data||[]
+                       }
                 })
-            }*/
+            },
+            goToPage(item){
+                window.location.href = item.url
+            }
         },
         created() {
+            this.getLinksData()
         }
     };
 </script>

+ 60 - 526
src/components/client/common/header.vue

@@ -1,389 +1,105 @@
 <template>
-    <div class="mta-client-header">
-        <el-row type="flex" class="header-wrap">
-            <el-col class="header-col-wrap">
-                <!-- logo -->
-                <div class="header-col-logo">
-                    <img :src="logoImg" alt="logo">
-                </div>
-                <!-- nav -->
-                <div class="header-col-nav">
-                    <el-menu
-                            :default-active="activeIndex"
-                            class="menu-client-header"
-                            :router="true"
-                            mode="horizontal"
-                            background-color="#1E1D22"
-                            text-color="#fff"
-                            :active-text-color="getThemeColor(0)">
-                        <template v-for="(item,index) in headerArr">
-                            <el-submenu :index="`${item.keyPath}`" v-if="item.children && item.children.length > 0"
-                                        popper-class="mta-menu-two">
-                                <template slot="title">{{item.content}}</template>
-                                <el-menu-item :index="`${child.keyPath}`" v-for="child of item.children"
-                                              :key="child.keyPath">{{child.content}}
-                                </el-menu-item>
-                            </el-submenu>
-                            <el-menu-item :index="`${item.keyPath}`" v-else>
-                                {{item.content}}
+    <nav class="website-head">
+        <div class="website-container head-layout">
+            <div class="head-left">
+                <a></a>
+                <el-menu
+                        :default-active="activeIndex"
+                        class="el-menu-demo"
+                        :router="true"
+                        mode="horizontal"
+                       >
+                    <template v-for="(item,index) in headerArr">
+                        <el-submenu :index="`${item.keyPath}`" v-if="item.children && item.children.length > 0" popper-class="mta-menu-two">
+                            <template slot="title">{{item.content}}</template>
+                            <el-menu-item :index="`${child.keyPath}`" v-for="child of item.children"
+                                          :key="child.keyPath">{{child.content}}
                             </el-menu-item>
-                        </template>
-                    </el-menu>
-                    <nav>
-                        <ul>
-                            <li>
-                                <el-popover
-                                        popper-class="nav-popover"
-                                        placement="bottom"
-                                        width="160"
-                                        trigger="click"
-                                >
-                                    <ul class="userControl">
-                                        <li>
-                                            <el-button type="text" icon="el-icon-key" @click="changePassword">
-                                                修改密码
-                                            </el-button>
-                                        </li>
-                                        <li v-if="!(getTenantCode === 'admin')">
-                                            <el-button type="text" icon="el-icon-s-order" @click="changeInformation">
-                                                修改资料
-                                            </el-button>
-                                        </li>
-                                        <li>
-                                            <el-button type="text" icon="el-icon-setting" @click="exitSystem">退出系统
-                                            </el-button>
-                                        </li>
-                                    </ul>
-                                    <span class="h-right-img" slot="reference">
-                                  <img :src="headerImg" alt="头像">
-                                  <span></span>
-                                </span>
-                                </el-popover>
-                            </li>
-                        </ul>
-                    </nav>
-                </div>
-            </el-col>
-        </el-row>
-        <el-dialog
-                title="修改密码"
-                :visible.sync="headerPasswordDialog"
-                :close-on-click-modal="false"
-                class="response-small-dialog"
-                @close="closePassDl"
-                center>
-            <el-form :model="HeaderPassChangeDate" status-icon :rules="HeaderPassRules" ref="ruleHeaderForm"
-                     class="demo-ruleForm2" label-width="100px">
-                <el-form-item label="原始密码:" prop="orgPass">
-                    <el-input v-model="HeaderPassChangeDate.orgPass"></el-input>
-                </el-form-item>
-                <el-form-item label="新的密码:" prop="pass">
-                    <el-input type="password" v-model="HeaderPassChangeDate.pass" autocomplete="off"></el-input>
-                </el-form-item>
-                <el-form-item label="确认密码:" prop="checkPass">
-                    <el-input type="password" v-model="HeaderPassChangeDate.checkPass" autocomplete="off"></el-input>
-                </el-form-item>
-            </el-form>
+                        </el-submenu>
+                        <el-menu-item :index="`${item.keyPath}`" v-else>
+                            {{item.content}}
+                        </el-menu-item>
+                    </template>
+                </el-menu>
 
-            <span slot="footer" class="dialog-footer">
-                <el-button @click="headerPasswordDialog = false">取 消</el-button>
-                <el-button type="primary" @click="saveHeaderPass">确 定</el-button>
-            </span>
-        </el-dialog>
-        <el-dialog
-                title="资料编辑"
-                :visible.sync="editorMessage"
-                :close-on-click-modal="false"
-                @close="ClosePassDl2('editorUserInfo')"
-                class="response-big-dialog"
-                center>
-            <el-form ref="formUserInfor" :rules="formRules3" status-icon :model="userInfoData" label-width="85px">
-                <div class="editorUserWrap">
-                    <div>
-                        <el-form-item label="用户名:" prop="userName">
-                            <el-input v-model="userInfoData.userName"
-                                      @blur="formatDataFun(userInfoData.userName)"></el-input>
-                        </el-form-item>
-                        <el-form-item label="真实姓名:" prop="realName">
-                            <el-input v-model="userInfoData.realName"></el-input>
-                        </el-form-item>
-                        <el-form-item label="出生年月:" prop="birthday">
-                            <el-date-picker
-                                    v-model="userInfoData.birthday"
-                                    type="date"
-                                    :default-value="userInfoData.defaultBirthday"
-                                    format="yyyy-MM-dd"
-                                    value-format="yyyy-MM-dd"
-                                    placeholder="选择日期">
-                            </el-date-picker>
-                        </el-form-item>
-                        <el-form-item label="电话号码:" prop="tel">
-                            <el-input v-model="userInfoData.tel"></el-input>
-                        </el-form-item>
-                    </div>
-                    <div>
-                        <el-form-item label="性别:" prop="gender" label-width="90px">
-                            <el-radio-group v-model="userInfoData.gender">
-                                <el-radio border :label="1">男</el-radio>
-                                <el-radio border :label="2">女</el-radio>
-                            </el-radio-group>
-                        </el-form-item>
-                        <el-form-item label="邮箱:" prop="email" label-width="90px">
-                            <el-input v-model="userInfoData.email"></el-input>
-                        </el-form-item>
-                        <el-form-item label="身份证号:" prop="idcard" label-width="90px">
-                            <el-input v-model="userInfoData.idcard"></el-input>
-                        </el-form-item>
-
-                    </div>
-                    <div>
-                        <!--<mta-upload-al-cloud :imageUrl="imageUrl"
-                                             @uploadFileStart="uploadFileStart"></mta-upload-al-cloud>-->
-                        <upload-file :imageUrl="imageUrl" :showBtnFlag="false"
-                                     @getFileUrl="getImageUrl"></upload-file>
-                        <h5 class="picture-size-h5">(最佳尺寸为65*65像素)</h5>
-                    </div>
-                </div>
-            </el-form>
-            <span slot="footer" class="dialog-footer">
-        <el-button @click="cancelSaveUserInfo">取 消</el-button>
-        <el-button type="primary" @click="saveUserInfo">确 定</el-button>
-      </span>
-        </el-dialog>
-    </div>
+            </div>
+            <div class="head-right">
+                <i></i><span>4000-522-130</span>
+            </div>
+        </div>
+    </nav>
 </template>
 
 <script>
-    import { getUploadImg }        from '@/api/AlCloud';
     import MtaUploadAlCloud
                                    from '@/components/management/Layout/UploadAlCloud/UploadAlCloud';
     import axios                   from 'axios';
     import { mapGetters }          from 'vuex';
     import { setAuth, removeAuth } from '@/utils/auth';
-    import {
-        getAdminUserMypass,
-        getClientUserMyUpdate,
-        getClentUserMyInfo,
-        getExitStatus,
-    }                              from '@/api/user';
-    import {
-        setUserIcon,
-        checkUrlIsNotHttpUrl,
-        getTrimData,
-    }                              from '@/utils/common';
+
+    import { setUserIcon, checkUrlIsNotHttpUrl, getTrimData, }                              from '@/utils/common';
     import { initThemeColor }      from '@/utils/theme';
-    import uploadFile              from '@/components/management/Layout/UploadAlCloud/uploadFile';
 
     export default {
         name:       'mtaHeader',
         props:      {
-            activeNav: { // 默认选中的 路径 与组件中的index相互对应
+            activeNav: {
                 type:    String,
                 require: true,
                 default: '0',
             },
         },
         components: {
-            MtaUploadAlCloud,
-            uploadFile,
         },
         data() {
-            const validatePass2 = (rule, value, callback) => {
-                if (value === '') {
-                    callback(new Error('请再次输入密码'));
-                } else if (value !== this.HeaderPassChangeDate.pass) {
-                    callback(new Error('两次输入密码不一致!'));
-                } else {
-                    callback();
-                }
-            };
             return {
                 activeIndex:          this.activeNav,
                 headerArr:            [
                     {
                         content: '首页',
-                        keyPath: '/c/Index',
+                        keyPath: '/index',
                     },
-                    {
-                        content: '首页',
-                        keyPath: '/c/IndexPeixun',
-                    },
-                    {
-                        content:  '课程中心',
+                /*    {
+                        content:  '考试平台',
                         keyPath:  '/c/kecheng/lists',
                         children: [
                             {
-                                content:  '课程列表',
+                                content:  'xxxxxx',
                                 keyPath:  '/c/kecheng/lists',
-                                children: [
-                                    {
-                                        content: '课程',
-                                        keyPath: '/c/kecheng/do',
-                                    },
-                                ],
-                            },
-                        ],
-                    },
-                    {
-                        content:  '考试中心',
-                        keyPath:  '/c/exam/lists',
-                        children: [
-                            {
-                                content:  '考试列表',
-                                keyPath:  '/c/exam/lists',
-                                children: [
-                                    {
-                                        content: '考试',
-                                        keyPath: '/c/exam/do',
-                                    },
-                                ],
-                            },
-                        ],
-                    },
-                    {
-                        content:  '成绩中心',
-                        keyPath:  '/c/score/lists',
-                        children: [
-                            {
-                                content: '个人成绩',
-                                keyPath: '/c/score/lists',
-                            },
-                            {
-                                content: '课程成绩',
-                                keyPath: '/c/score/kechengLists',
-                            },
-                            {
-                                content: '学分统计',
-                                keyPath: '/c/score/credit',
                             },
                         ],
-                    },
+                    },*/
                     {
-                        content:  '自主练习',
-                        keyPath:  '/c/Practice/lists',
-                        children: [
-                            {
-                                content:  '练习列表',
-                                keyPath:  '/c/Practice/lists',
-                                children: [
-                                    {
-                                        content: '练习页面',
-                                        keyPath: '/c/Practice/do',
-                                    },
-                                ],
-                            },
-                        ],
-                    },
-                    /*{
-                        content:  '错题中心',
-                        keyPath:  '/c/cuotiCenter/lists',
-                        children: [
-                            {
-                                content:  '错题列表',
-                                keyPath:  '/c/cuotiCenter/lists',
-                                children: [
-                                    {
-                                        content: '错题页面',
-                                        keyPath: '/c/cuotiCenter/page',
-                                    },
-                                ],
-                            },
-                        ],
+                        content:  '考试平台',
+                        keyPath:  '/c/examPlatform',
+                        children: [],
                     },
                     {
-                        content:  '证书管理',
-                        keyPath:  '/c/cert/lists',
-                        children: [
-                            {
-                                content: '个人证书',
-                                keyPath: '/c/cert/lists',
-                            },
-                        ],
-                    },*/
-                    {
-                        content:  '公告管理',
-                        keyPath:  '/c/notice/lists',
-                        children: [
-                            {
-                                content: '公告中心',
-                                keyPath: '/c/notice/lists',
-                            },
-                        ],
+                        content:  '培训平台',
+                        keyPath:  '/c/peixunPlatform',
+                        children: [],
                     },
                     {
-                        content:  '资源库',
-                        keyPath:  '/c/resource/library',
+                        content:  '课程开发',
+                        keyPath:  '/c/courseDev',
                         children: [],
                     },
                     {
-                        content:  '互动问答',
-                        keyPath:  '/c/QuestionAndAnswer/lists',
+                        content:  '新闻资讯',
+                        keyPath:  '/c/newsInfor',
                         children: [],
                     },
                     {
-                        content:  '个人中心',
-                        keyPath:  '/c/personalCenter/lists',
-                        children: [
-                            {
-                                content: '个人信息',
-                                keyPath: '/c/personalCenter/lists',
-                            },
-                            {
-                                content:  '错题信息',
-                                keyPath:  '/c/cuotiCenter/lists',
-                                children: [
-                                    {
-                                        content: '错题页面',
-                                        keyPath: '/c/cuotiCenter/page',
-                                    },
-                                ],
-                            },
-                            {
-                                content: '证书信息',
-                                keyPath: '/c/cert/lists',
-                            },
-                        ],
+                        content:  '帮助中心',
+                        keyPath:  '/c/helpCenter',
+                        children: [],
+                    }, {
+                        content:  '关于我们',
+                        keyPath:  '/c/aboutUs',
+                        children: [],
                     },
+
                 ],
-                // 密码修改
-                headerPasswordDialog: false,
-                HeaderPassChangeDate: {
-                    orgPass:   '',
-                    pass:      '',
-                    checkPass: '',
-                },
-                HeaderPassRules:      {
-                    orgPass:   [
-                        { message: '请输入原始密码', trigger: 'blur', required: true },
-                    ],
-                    pass:      [
-                        { message: '请输入新密码', trigger: 'blur', required: true },
-                    ],
-                    checkPass: [
-                        { validator: validatePass2, trigger: 'blur', required: true },
-                    ],
-                },
-                /// 个人信息编辑
-                editorMessage:        false,
-                userInfoData:         {
-                    userName:        '',
-                    birthday:        '',
-                    defaultBirthday: '',
-                    email:           '',
-                    gender:          '',
-                    userId:          '',
-                    idcard:          '',
-                    realName:        '',
-                    tel:             '',
-                },
-                formRules3:           {
-                    userName: [
-                        { trigger: 'blur', required: true, message: '请输入用户名' },
-                    ],
-                },
-                imageUrl:             '',
-                headerimgUrl:         require('../../../assets/images/default/user-img.png'),
-                menuFlag:             '',
             };
         },
         watch:      {
@@ -392,151 +108,8 @@
             },
         },
         computed:   {
-            logoImg() {
-                if (this.getReplaceContext === null) {
-                    return;
-                }
-                return this.getReplaceContext.logoImg;
-            },
-            // 个人头像 待定
-            headerImg() {
-                return checkUrlIsNotHttpUrl(this.getReplaceIcon.headImg)
-                       ? this.headerimgUrl
-                       : this.getReplaceIcon.headImg;
-            },
-            // 个人头像 待定
-            ...mapGetters([
-                              'getReplaceContext',
-                              'getTenantCode',
-                              'getReplaceIcon',
-                              'getThemeColor',
-                          ]),
         },
-        methods:    {
-            getImageUrl(data) {
-                this.imageUrl = data;
-            },
-            // ************* 关窗清理 *****************
-            formatDataFun(data) {
-                this.userInfoData.userName = getTrimData(data);
-            },
-            ClosePassDl2() {
-                this.$refs.formUserInfor.resetFields();
-            },
-            // **************  弹窗事件 修改密码 *****************
-            // 密码修改
-            changePassword() {
-                this.headerPasswordDialog = true;
-            },
-            // 确认修改
-            saveHeaderPass() {
-                this.$refs.ruleHeaderForm.validate((valid) => {
-                    if (valid) {
-                        // 请求后台
-                        const options = {
-                            passwordNew: this.HeaderPassChangeDate.pass,
-                            passwordOld: this.HeaderPassChangeDate.orgPass,
-                        };
-
-                        getAdminUserMypass(options)
-                        .then(res => {
-
-                            if (res.code === 0 && res.data) {
-                                this.headerPasswordDialog = false;
-                                this.$message.success('修改成功');
-                            } else {
-                                this.$message.error('修改失败');
-                            }
-                        });
-                    } else {
-                        this.$message.error('请确定验证是否通过');
-                        return false;
-                    }
-                });
-            },
-            // 关闭修改密码
-            closePassDl() {
-                this.$refs.ruleHeaderForm.resetFields();
-            },
-            // *************  弹窗事件 帮助中心 **************
-            openHelpCenter() {
-
-            },
-            // ************** 弹窗事件 编辑信息 ****************
-            // 保存用户信息
-            saveUserInfo() {
-                const option = {
-                    birthday: this.userInfoData.birthday,
-                    email:    this.userInfoData.email,
-                    gender:   this.userInfoData.gender,
-                    icon:     this.imageUrl === undefined ? '' : this.imageUrl,
-                    idcard:   this.userInfoData.idcard,
-                    realName: this.userInfoData.realName,
-                    userId:   this.userInfoData.userId,
-                    userName: this.userInfoData.userName,
-                    tel:      this.userInfoData.tel,
-                };
-                const loading = this.loading();
-                // 请求后台
-                getClientUserMyUpdate(option)
-                .then(res => {
-                    if (res.data) {
-                        this.editorMessage = false;
-                        // 个人头像 待定
-                        const opt = {
-                            headImg: option.icon,
-                        };
-                        setUserIcon(opt);
-                        this.$message.success('修改成功');
-                        loading.close();
-                    }
-                }).catch(err => {
-                    // this.$message.error('请确定验证是否通过');
-                    loading.close();
-                    console.error('错误', err);
-                });
-            },
-            // 取消
-            cancelSaveUserInfo() {
-                this.editorMessage = false;
-            },
-            changeInformation() {
-                getClentUserMyInfo()
-                .then(res => {
-                    const userInfoObj = res.data;
-                    this.userInfoData.userName = userInfoObj.userName;
-                    this.userInfoData.birthday = userInfoObj.birthday === null
-                                                 ? new Date('1991-05-01')
-                                                 : new Date(userInfoObj.birthday);
-                    this.userInfoData.defaultBirthday = new Date(userInfoObj.birthday);
-                    this.imageUrl = userInfoObj.icon;
-                    this.userInfoData.email = userInfoObj.email;
-                    this.userInfoData.gender = userInfoObj.gender;
-                    this.userInfoData.idcard = userInfoObj.idcard;
-                    this.userInfoData.realName = userInfoObj.realName;
-                    this.userInfoData.tel = userInfoObj.tel;
-                    this.userInfoData.userId = userInfoObj.userId;
-                    this.editorMessage = true;
-                }).catch(err => {
-                    console.error('获取用户信息', err);
-                });
-            },
-
-            // ************** 退出 系统 **************************
-            exitSystem() {
-                getExitStatus().then(res => {
-                    if (res.code === 0 && res.data) {
-
-                        this.$router.push({ path: '/c/login' });
-
-                        setAuth();
-                        this.$message.success('系统退出成功');
-                    } else {
-                        this.$message.error('系统退出失败');
-                    }
-                });
-
-            },
+        methods:{
             // ************** 导航状态 ****************************
             activeIndexSync() {
                 const path = this.$route.path;
@@ -559,8 +132,9 @@
                     }
                 }
             },
+
             checkArray() {
-                if (JSON.parse(this.menuFlag) == 1) {
+              /*  if (JSON.parse(this.menuFlag) == 1) {
 
                     for (let i = this.headerArr.length - 1; i >= 0; i--) {
                         if (this.headerArr[i].content == '课程中心') {
@@ -585,55 +159,15 @@
                             this.headerArr.splice(i, 1);
                         }
                     }
-                }
+                }*/
                 this.activeIndexSync();
             },
-            /**
-             * 上传文件
-             */
-            uploadFileStart(params) {
-                if (!params) {
-                    return;
-                }
-                const suffixList = params.file.name.split('.').pop();
-                const options = {
-                    prefix: 'resource/',
-                    suffix: suffixList,
-                };
-                getUploadImg(options).then((res) => {
 
-                    if (res.code === 0) {
-                        // 二进制文件通过forData对象进行传递
-                        const FormDataForAl = new FormData();
-                        const multipartParams = Object.assign({}, res.data, {
-                            Filename:              `images/${params.filename}`,
-                            success_action_status: '200',
-                        });
-                        // 参数数据
-                        FormDataForAl.append('key', multipartParams.key);
-                        FormDataForAl.append('policy', multipartParams.policy);
-                        FormDataForAl.append('signature', multipartParams.signature);
-                        FormDataForAl.append('OSSAccessKeyId', multipartParams.accessid);
-                        FormDataForAl.append('success_action_status', multipartParams.success_action_status);
-                        // OSS要求, file放到最后
-                        FormDataForAl.append('file', params.file);
-
-                        axios.post(multipartParams.uploadUrl, FormDataForAl).then(alRes => {
-                            if (alRes.status === 200) {
-                                this.imageUrl = `${multipartParams.downloadUrl}/${multipartParams.key}`;
-                            }
-                        }).catch(alerr => {
-                            console.error('阿里云错误', alerr);
-                        });
-                    }
-                });
-            },
-        },
+        }
+        ,
         created() {
-            this.menuFlag = window.localStorage.getItem(`tenantFlag_key`);
+            console.log(this.activeIndex);
             this.checkArray();
-            /* activeIndex sync */
-            //this.activeIndexSync();
             initThemeColor();
         },
     };

+ 116 - 29
src/router.js

@@ -19,26 +19,13 @@ const router = new Router({
                                       redirect: '/index',
                                   },
                                   {
-                                      name:      '首页',
+                                      name:      'index',
                                       path:      '/index',
                                       component: () => {
                                           return import(/* webpackChunkName: "index" */ './views/client/Index.vue');
                                       },
                                   },
                                   {
-                                      name:      '课程开发',
-                                      path:      '/courseDev',
-                                      meta:      {
-                                          parentPath: 'croot',
-                                          breadcrumb: {
-                                              display: '课程列表',
-                                          },
-                                      },
-                                      component: () => {
-                                          return import(/* webpackChunkName: "index" */ './views/client/CourseDev.vue');
-                                      },
-                                  },
-                                  {
                                       name:      'Login',
                                       path:      '/login',
                                       component: () => {
@@ -46,18 +33,106 @@ const router = new Router({
                                       },
                                   },
                                   {
-                                      path: '/industryDetails',
-                                      name: 'industryDetails',
-                                      meta:      {
-                                          parentPath: 'croot',
-                                          breadcrumb: {
-                                              display: '行业详情',
+                                      path:'/c',
+                                      component: () => import(/* webpackChunkName: "Cframe" */ './components/client/common/Cframe.vue'),
+                                      children:  [
+                                          {
+                                              name:      '考试平台',
+                                              path:      'examPlatform',
+                                              meta:      {
+                                                  parentPath: 'croot',
+                                                  breadcrumb: {
+                                                      display: '考试平台',
+                                                  },
+                                              },
+                                              component: () => {
+                                                  return import(/* webpackChunkName: "index" */ './views/client/examPlatform.vue');
+                                              },
                                           },
-                                      },
-                                      component: () => {
-                                          return import(/* webpackChunkName: "index" */ './views/client/industryDetails.vue');
-                                      },
+                                          {
+                                              name:      '培训平台',
+                                              path:      'peixunPlatform',
+                                              meta:      {
+                                                  parentPath: 'croot',
+                                                  breadcrumb: {
+                                                      display: '培训平台',
+                                                  },
+                                              },
+                                              component: () => {
+                                                  return import(/* webpackChunkName: "index" */ './views/client/peixunPlatform.vue');
+                                              },
+                                          },
+                                          {
+                                              name:      '课程开发',
+                                              path:      'courseDev',
+                                              meta:      {
+                                                  parentPath: 'croot',
+                                                  breadcrumb: {
+                                                      display: '课程列表',
+                                                  },
+                                              },
+                                              component: () => {
+                                                  return import(/* webpackChunkName: "index" */ './views/client/CourseDev.vue');
+                                              },
+                                          },
+                                          {
+                                              name:      '新闻资讯',
+                                              path:      'newsInfor',
+                                              meta:      {
+                                                  parentPath: 'croot',
+                                                  breadcrumb: {
+                                                      display: '新闻资讯',
+                                                  },
+                                              },
+                                              component: () => {
+                                                  return import(/* webpackChunkName: "index" */ './views/client/newsInfor.vue');
+                                              },
+                                          },
+                                          {
+                                              name:      '帮助中心',
+                                              path:      'helpCenter',
+                                              meta:      {
+                                                  parentPath: 'croot',
+                                                  breadcrumb: {
+                                                      display: '帮助中心',
+                                                  },
+                                              },
+                                              component: () => {
+                                                  return import(/* webpackChunkName: "index" */ './views/client/helpCenter.vue');
+                                              },
+                                          },
+                                          {
+                                              name:      '关于我们',
+                                              path:      'aboutUs',
+                                              meta:      {
+                                                  parentPath: 'croot',
+                                                  breadcrumb: {
+                                                      display: '关于我们',
+                                                  },
+                                              },
+                                              component: () => {
+                                                  return import(/* webpackChunkName: "index" */ './views/client/aboutUs.vue');
+                                              },
+                                          },
+                                          {
+                                              path: 'newsInforDetails',
+                                              name: 'newsInforDetails',
+                                              meta:      {
+                                                  parentPath: 'croot',
+                                                  breadcrumb: {
+                                                      display: '行业详情',
+                                                  },
+                                              },
+                                              component: () => {
+                                                  return import(/* webpackChunkName: "index" */ './views/client/newsInforDetails.vue');
+                                              },
+                                          },
+                                      ],
+
                                   },
+
+
+
                                   {
                                       name:      'admin',
                                       path:      '/admin',
@@ -71,11 +146,11 @@ const router = new Router({
                                       },
                                       children:  [
                                           {
-                                              path: '/industry',
-                                              name: 'hangyezixun',
+                                              path: '/news',
+                                              name: 'news',
                                               meta: {
                                                   icon: "",
-                                                  title: "行业资讯"
+                                                  title: "新闻资讯"
                                               },
                                               isAdminMenu: true,
                                               component: () => {
@@ -83,8 +158,8 @@ const router = new Router({
                                               },
                                           },
                                           {
-                                              path: '/industry/config',
-                                              name: 'HangYeZiXunConfig',
+                                              path: '/news/config',
+                                              name: 'newsConfig',
                                               component: () => {
                                                   return import(/* webpackChunkName: "HangYeZiXun" */ './views/management/HangYeZiXun/HangYeZiXunConfig/index.vue');
                                               },
@@ -101,6 +176,18 @@ const router = new Router({
                                                   return import(/* webpackChunkName: "HangYeZiXun" */ './views/management/YouQingLianJie/index.vue');
                                               },
                                           },
+                                          {
+                                              path: '/newsClassify',
+                                              name: 'newsClassify',
+                                              meta: {
+                                                  icon: "",
+                                                  title: "新闻分类"
+                                              },
+                                              isAdminMenu: true,
+                                              component: () => {
+                                                  return import(/* webpackChunkName: "HangYeZiXun" */ './views/management/XinWenFenLei/index.vue');
+                                              },
+                                          },
                                       ],
                                   },
                               ],

+ 1 - 12
src/views/client/CourseDev.vue

@@ -1,16 +1,5 @@
 <template>
-    <div>
-        <el-menu :default-active="activeIndex" class="el-menu-demo" mode="horizontal" @select="handleSelect">
-            <el-menu-item index="首页">首页</el-menu-item>
-            <el-menu-item index="考试平台">考试平台</el-menu-item>
-            <el-menu-item index="培训平台">培训平台</el-menu-item>
-            <el-menu-item index="课程开发">课程开发</el-menu-item>
-            <el-menu-item index="新闻资讯">新闻资讯</el-menu-item>
-            <el-menu-item index="帮助中心">帮助中心</el-menu-item>
-            <el-menu-item index="关于我们">关于我们</el-menu-item>
-        </el-menu>
-        <MtaBreadcrumb style="margin-left: 0"></MtaBreadcrumb>
-    </div>
+
 </template>
 
 <script>

+ 12 - 6
src/views/client/Index.vue

@@ -1,7 +1,8 @@
 <template>
     <div class="website-index-page">
         <!-- 首页导航栏 -->
-        <nav class="website-head">
+        <mta-header></mta-header>
+   <!--     <nav class="website-head">
             <div class="website-container head-layout">
                 <div class="head-left">
                     <a></a>
@@ -20,7 +21,7 @@
                     <i></i><span>4000-522-130</span>
                 </div>
             </div>
-        </nav>
+        </nav>-->
 
         <!-- 首页banner栏 -->
         <div class="website-banner">
@@ -176,7 +177,8 @@
         </div>
 
         <!-- 底部footer -->
-        <div class="website-footer">
+        <mta-footer></mta-footer>
+      <!--  <div class="website-footer">
             <div class="website-container">
                 <div class="contact-box">
                     <div class="contact-left-box">
@@ -224,14 +226,15 @@
                 </div>
                 <h5>Copyright © 2019 llisoft.com All rights reserved 大连栋科软件工程有限公司 版权所有 辽ICP备09022904号-19</h5>
             </div>
-        </div>
+        </div>-->
 
     </div>
 </template>
 
 <script>
     import { homeIndustryList } from '@/api/login.js';
-
+    import MtaHeader                                 from '@/components/client/common/header.vue';
+    import MtaFooter                                 from '@/components/client/common/footer.vue';
     export default {
         name:       'index',
         props:      {},
@@ -285,7 +288,10 @@
                 topCarousels:  [],
             };
         },
-        components: {},
+        components: {
+            MtaHeader,
+            MtaFooter,
+        },
         computed:   {},
         methods:    {
             handleSelect(key, keyPath) {

+ 34 - 0
src/views/client/aboutUs.vue

@@ -0,0 +1,34 @@
+<template>
+
+</template>
+
+<script>
+    import MtaBreadcrumb    from '@/components/client/common/MtaBreadcrumb.vue';
+    export default {
+        name:       'courseDev',
+        props:      {
+        },
+        data() {
+            return {
+            };
+        },
+        components: {
+            MtaBreadcrumb
+        },
+        computed:   {},
+        methods:    {
+
+        },
+        created() {
+
+        },
+        mounted() {
+
+        },
+        beforeDestroy() {
+        },
+    };
+</script>
+<style>
+
+</style>

+ 34 - 0
src/views/client/examPlatform.vue

@@ -0,0 +1,34 @@
+<template>
+
+</template>
+
+<script>
+    import MtaBreadcrumb    from '@/components/client/common/MtaBreadcrumb.vue';
+    export default {
+        name:       'courseDev',
+        props:      {
+        },
+        data() {
+            return {
+            };
+        },
+        components: {
+            MtaBreadcrumb
+        },
+        computed:   {},
+        methods:    {
+
+        },
+        created() {
+
+        },
+        mounted() {
+
+        },
+        beforeDestroy() {
+        },
+    };
+</script>
+<style>
+
+</style>

+ 34 - 0
src/views/client/helpCenter.vue

@@ -0,0 +1,34 @@
+<template>
+
+</template>
+
+<script>
+    import MtaBreadcrumb    from '@/components/client/common/MtaBreadcrumb.vue';
+    export default {
+        name:       'courseDev',
+        props:      {
+        },
+        data() {
+            return {
+            };
+        },
+        components: {
+            MtaBreadcrumb
+        },
+        computed:   {},
+        methods:    {
+
+        },
+        created() {
+
+        },
+        mounted() {
+
+        },
+        beforeDestroy() {
+        },
+    };
+</script>
+<style>
+
+</style>

+ 34 - 0
src/views/client/newsInfor.vue

@@ -0,0 +1,34 @@
+<template>
+
+</template>
+
+<script>
+    import MtaBreadcrumb    from '@/components/client/common/MtaBreadcrumb.vue';
+    export default {
+        name:       'courseDev',
+        props:      {
+        },
+        data() {
+            return {
+            };
+        },
+        components: {
+            MtaBreadcrumb
+        },
+        computed:   {},
+        methods:    {
+
+        },
+        created() {
+
+        },
+        mounted() {
+
+        },
+        beforeDestroy() {
+        },
+    };
+</script>
+<style>
+
+</style>

+ 0 - 1
src/views/client/industryDetails.vue → src/views/client/newsInforDetails.vue

@@ -40,7 +40,6 @@
         },
         data() {
             return {
-                activeIndex:  '首页',
                 iiId:  '',
                 infoData:{}
             };

+ 34 - 0
src/views/client/peixunPlatform.vue

@@ -0,0 +1,34 @@
+<template>
+
+</template>
+
+<script>
+    import MtaBreadcrumb    from '@/components/client/common/MtaBreadcrumb.vue';
+    export default {
+        name:       'courseDev',
+        props:      {
+        },
+        data() {
+            return {
+            };
+        },
+        components: {
+            MtaBreadcrumb
+        },
+        computed:   {},
+        methods:    {
+
+        },
+        created() {
+
+        },
+        mounted() {
+
+        },
+        beforeDestroy() {
+        },
+    };
+</script>
+<style>
+
+</style>

+ 80 - 26
src/views/management/HangYeZiXun/HangYeZiXunConfig/index.vue

@@ -25,6 +25,12 @@
                 <el-form-item label="访问次数:" prop="visits">
                     <el-input :maxlength="9" placeholder="请输入访问次数" v-model="configData.visits"></el-input>
                 </el-form-item>
+                <el-form-item label="新闻分类:" prop="newsClassifyId">
+                    <mySelect label="name"
+                              id="newsClassifyId"
+                              @select-change="handleSelectDoChange"
+                              placeholder="请选择新闻分类"></mySelect>
+                </el-form-item>
                 <el-form-item label="图片:" prop="pic">
                     <upload-file :imageUrl="configData.pic"
                                  :showBtnFlag="false"
@@ -32,7 +38,7 @@
                     <h5 class="picture-size-h5">(最佳尺寸为400*400像素)</h5>
                 </el-form-item>
                 <el-form-item label="描述:" prop="intro">
-                    <el-input type="textarea" placeholder="请输入描述" :rows="9"
+                    <el-input type="textarea" placeholder="请输入描述" :rows="6"
                               v-model="configData.intro"></el-input>
                 </el-form-item>
             </el-form>
@@ -54,8 +60,8 @@
             >新增
             </el-button>
             <div v-else>
-                <el-button  type="primary"  @click="handleSave('HangYeZiXun')">保存</el-button>
-                <el-button  type="primary"  @click="back">关闭</el-button>
+                <el-button type="primary" @click="handleSave('HangYeZiXun')">保存</el-button>
+                <el-button type="primary" @click="back">关闭</el-button>
             </div>
 
         </div>
@@ -63,53 +69,80 @@
 </template>
 
 <script>
-    import uploadFile       from './components/uploadFile';
-    import MtaStQuillEditor from '@/components/management/QuillEditor.vue';
-    import * as commonTools from '@/utils/admin/tools';
-    import * as HYZXService from '@/api/hangyezixun';
+    import uploadFile           from './components/uploadFile';
+    import MtaStQuillEditor     from '@/components/management/QuillEditor.vue';
+    import mySelect             from '../components/Select';
+    import * as commonTools     from '@/utils/admin/tools';
+    import * as HYZXService     from '@/api/hangyezixun';
+    import * as NewsClassifyApi from '@/api/newsClassify';
+    import Vue                  from 'vue';
+
+    const selectData = {
+        options:        [],
+        newsClassifyId: null,
+        placeholder:    '请选择新闻资讯分类',
+    };
+    let selectServiceData = Vue.observable(selectData);
 
     export default {
         name:       'HangYeZiXunConfig',
         components: {
             uploadFile,
             MtaStQuillEditor,
+            mySelect,
+        },
+        provide:    {
+            selectServiceData: selectServiceData,
+        },
+        computed:   {
+            newsClassifyId() {
+                return selectServiceData.newsClassifyId;
+            },
         },
         data() {
             return {
                 defaultValue: new Date(),
                 configData:   {
-                    content:   '',
-                    intro:     '',
-                    pic:       '',
-                    startTime: '',
-                    title:     '',
-                    visits:    '',
+                    content:        '',
+                    intro:          '',
+                    pic:            '',
+                    startTime:      '',
+                    newsClassifyId: '',
+                    title:          '',
+                    visits:         '',
                 },
                 configRules:  {
-                    title:     [
+                    title:          [
                         { required: true, message: '标题不能为空', trigger: 'blur' },
                     ],
-                    startTime: [
+                    startTime:      [
                         { required: true, message: '开始时间不能为空', trigger: 'blur' },
                     ],
-                    intro:     [
+                    intro:          [
                         { required: true, message: '描述不能为空', trigger: 'blur' },
                     ],
-                    pic:       [
+                    pic:            [
                         { required: true, message: '图片不能为空', trigger: 'blur' },
                     ],
-                    visits:    [
+                    visits:         [
                         { required: true, message: '访问次数不能为空', trigger: 'blur' },
                     ],
-                    content:   [
+                    content:        [
                         { required: true, message: '行业详情不能为空', trigger: 'blur' },
                     ],
+                    newsClassifyId: [
+                        { required: true, message: '请选择新闻分类', trigger: 'blur' },
+                    ],
                 },
                 queryData:    null,
                 userId:       null,
             };
         },
-        methods: {
+        methods:    {
+            handleSelectDoChange(data) {
+                console.log('change', data);
+                this.configData.newsClassifyId = data;
+            },
             back() {
                 window.history.go(-1);
             },
@@ -140,7 +173,8 @@
                 });
             },
             initPageData(data) {
-                // this.configData.content = data.content;
+                selectServiceData.newsClassifyId = data.newsClassifyId;
+                this.configData.newsClassifyId = data.newsClassifyId;
                 this.$refs.editorQuill.setContent(data.content);
                 this.configData.intro = data.intro;
                 this.configData.pic = data.pic;
@@ -156,7 +190,13 @@
 
                 const loading = this.$loading({ background: 'rgba(0, 0, 0, 0.7)' });
                 try {
-                    const res = await HYZXService.getIndustryInfo(opt);
+
+                    // 新闻资讯分类
+                    const { data: newsClassifyArr } = await NewsClassifyApi.getNewsClassifySearch();
+
+                    selectServiceData.options = newsClassifyArr;
+
+                    const res = await HYZXService.getNewsInfo(opt);
                     if (res.code === 0) {
                         this.initPageData(res.data);
                     }
@@ -197,13 +237,25 @@
             },
             handleAddHangYeZiXun() {
                 const opt = this.getOptions();
-                return HYZXService.getIndustryAdd(opt);
+                return HYZXService.getNewsAdd(opt);
             },
             handleSaveHangYeZiXun() {
                 const opt = this.getOptions();
-                const newOpt = Object.assign(opt, {iiId: this.queryData.iiId})
-                return HYZXService.getIndustryUpdate(newOpt);
-            }
+                const newOpt = Object.assign(opt, { iiId: this.queryData.iiId });
+                return HYZXService.getNewsUpdate(newOpt);
+            },
+            async initPage() {
+                // 新闻资讯分类
+                const loading = this.$loading({ background: 'rgba(0, 0, 0, 0.7)' });
+                try {
+                    const { data: newsClassifyArr } = await NewsClassifyApi.getNewsClassifySearch();
+                    selectServiceData.options = newsClassifyArr;
+                    loading.close();
+                } catch (e) {
+                    loading.close();
+                }
+
+            },
         },
         created() {
             this.queryData = this.$route.query;
@@ -213,6 +265,8 @@
         mounted() {
             if (this.queryData.code === 'editor' && this.queryData.iiId) {
                 this.recoverPage();
+            } else {
+                this.initPage();
             }
         },
     };

+ 12 - 9
src/views/management/HangYeZiXun/components/Pagination.vue

@@ -11,17 +11,20 @@
 </template>
 
 <script>
-    import { paginationServiceData, defaultPageSizes } from './paginationData';
-
     export default {
         name:     'Pagination',
         props:    {
             pageSizes: {
                 type:    Array,
-                default: () => defaultPageSizes,
+                default: () => [],
             },
         },
         inject:   {
+            paginationServiceData: {
+                type:    Object,
+                default: () => {
+                },
+            },
             tableServiceData: {
                 type:    Object,
                 default: () => {
@@ -31,26 +34,26 @@
         computed: {
             page:  {
                 get() {
-                    return paginationServiceData.page;
+                    return this.paginationServiceData.page;
                 },
                 set(val) {
-                    paginationServiceData.page = val;
+                    this.paginationServiceData.page = val;
                 },
             },
             size:  {
                 get() {
-                    return paginationServiceData.size;
+                    return this.paginationServiceData.size;
                 },
                 set(val) {
-                    paginationServiceData.size = val;
+                    this.paginationServiceData.size = val;
                 },
             },
             total: {
                 get() {
-                    return paginationServiceData.total;
+                    return this.paginationServiceData.total;
                 },
                 set(val) {
-                    this.paginationServiceData.total = val;
+                    this.this.paginationServiceData.total = val;
                 },
             },
         },

+ 69 - 0
src/views/management/HangYeZiXun/components/Select.vue

@@ -0,0 +1,69 @@
+<template>
+    <el-select v-model="value" clearable :placeholder="placeholder" @change="selectChange">
+        <el-option
+                v-for="item in options"
+                :key="item[id]"
+                :label="item[label]"
+                :value="item[id]">
+        </el-option>
+    </el-select>
+</template>
+
+<script>
+    export default {
+        name: 'Select',
+
+        props: {
+            placeholder: {
+                type: String,
+                default: '请选择'
+            },
+            id: {
+                type: String,
+                default: 'id'
+            },
+            label: {
+                type: String,
+                default: 'name'
+            }
+        },
+
+        inject: {
+            selectServiceData: {
+                type:    Object,
+                default: () => {
+                },
+            },
+        },
+
+        computed: {
+            options() {
+                return this.selectServiceData.options;
+            },
+            value:   {
+                get() {
+                    return this.selectServiceData[this.id];
+                },
+                set(val) {
+                    console.log(val)
+                    this.selectServiceData[this.id] = val;
+                },
+            },
+        },
+
+        methods: {
+            selectChange(val) {
+                console.log(val)
+                this.$emit('select-change', val)
+            }
+        },
+
+        destroyed() {
+            this.selectServiceData[this.id] = null;
+        }
+    };
+</script>
+
+<style scoped>
+
+</style>

+ 7 - 2
src/views/management/HangYeZiXun/components/Table.vue

@@ -7,21 +7,25 @@
             style="width: 100%">
         <el-table-column
                 type="selection"
+                fixed
                 width="55">
         </el-table-column>
         <el-table-column
                 prop="title"
                 label="标题"
-                :show-overflow-tooltip="true"
                 width="360">
         </el-table-column>
         <el-table-column
                 prop="intro"
                 label="描述"
-                :show-overflow-tooltip="true"
                 width="360">
         </el-table-column>
         <el-table-column
+                prop="newsClassifyName"
+                label="新闻分类"
+                width="200">
+        </el-table-column>
+        <el-table-column
                 prop="pic"
                 label="图片"
                 width="300">
@@ -47,6 +51,7 @@
         </el-table-column>
         <el-table-column
                 label="操作"
+                fixed="right"
         >
             <template slot-scope="scope">
                 <el-button type="text" @click="handleEditor(scope.row)">编辑</el-button>

+ 85 - 20
src/views/management/HangYeZiXun/index.vue

@@ -2,8 +2,19 @@
     <div class="admin-hangyezixun-page">
         <div class="admin-hangyexuzhi">
             <div class="top">
-                <el-button class="btn-add" size="mini" type="primary" @click="handleAddHangYeZiXun">新增</el-button>
-                <el-button class="btn-add" size="mini" type="primary" @click="handleDeleteHangYeZiXun">删除</el-button>
+                <div>
+                    <mySelect
+                            label="name"
+                            id="newsClassifyId"
+                            placeholder="请选择新闻分类"
+                    ></mySelect>
+                    <el-button class="btn-search" size="mini" type="primary" @click="handleSearch">查询</el-button>
+                </div>
+                <div>
+                    <el-button size="mini" type="primary" @click="handleAddHangYeZiXun">新增</el-button>
+                    <el-button size="mini" type="primary" @click="handleDeleteHangYeZiXun">删除
+                    </el-button>
+                </div>
             </div>
             <myTable
                     @editor="handleEditor"
@@ -12,6 +23,7 @@
             />
             <myPagination
                     class="my-Pagination"
+                    :pageSizes="defaultPageSizes"
                     @size-change="handleSizeChange"
                     @current-page="handleCurrentPage"
             />
@@ -20,32 +32,55 @@
 </template>
 
 <script>
-    import { tableServiceData }      from './components/tableData';
-    import { paginationServiceData } from './components/paginationData';
     import myPagination              from './components/Pagination';
     import myTable                   from './components/Table';
     import * as HYZXApi              from '@/api/hangyezixun';
+    import * as NewsClassifyApi      from '@/api/newsClassify';
+    import mySelect                  from './components/Select';
+    import Vue                       from 'vue';
 
     const CHANGEPAGECODE = {
         add:    'add',
         editor: 'editor',
     };
+    const selectData = {
+        options:        [],
+        newsClassifyId: null,
+        placeholder:    '请选择新闻资讯分类',
+    };
+    const tableData = {
+        myData: []
+    }
+
+    const pagination = {
+        page:  1,
+        size:  10,
+        total: 0,
+    };
+
+    const defaultPageSizes = [10, 20, 30, 40];
+    const tableServiceData = Vue.observable(tableData);
+    const selectServiceData = Vue.observable(selectData);
+    const paginationServiceData = Vue.observable(pagination);
 
     export default {
         name:       'Hangyexuzhi',
         provide:    {
             tableServiceData,
             paginationServiceData,
+            selectServiceData,
         },
         data() {
             return {
-                curIiId:         null,
-                tableSelectData: [],
+                defaultPageSizes: defaultPageSizes,
+                curIiId:          null,
+                tableSelectData:  [],
             };
         },
         components: {
             myPagination,
             myTable,
+            mySelect,
         },
         computed:   {
             myPage() {
@@ -57,8 +92,15 @@
             myTotal() {
                 return paginationServiceData.total;
             },
+            newsClassifyId() {
+                return selectServiceData.newsClassifyId;
+            },
         },
         methods:    {
+
+            handleSearch() {
+                this.getHangYeZiXunData();
+            },
             handleEditor(data) {
                 this.curIiId = data.iiId;
                 this.changePage(CHANGEPAGECODE.editor);
@@ -93,13 +135,13 @@
                 };
                 const loading = this.$loading({ background: 'rgba(0, 0, 0, 0.7)' });
                 try {
-                    const res = await HYZXApi.getIndustryDelete(opt);
+                    const res = await HYZXApi.getNewsDelete(opt);
                     loading.close();
                     if (res.code === 0 && res.data) {
                         // 删除成功重置选择状态
                         this.tableSelectData = [];
                         const newOpt = this.getOption();
-                        const res = await HYZXApi.getIndustryList(newOpt);
+                        const res = await HYZXApi.getNewsList(newOpt);
                         if (res.code === 0) {
                             this.initPageData(res.data);
                         }
@@ -111,18 +153,19 @@
             },
             getOption() {
                 const opt = {
-                    page: this.myPage,
-                    size: this.mySize,
+                    page:           this.myPage,
+                    size:           this.mySize,
+                    newsClassifyId: this.newsClassifyId,
                 };
                 return opt;
             },
             changePage(code) {
                 switch (code) {
                     case CHANGEPAGECODE.add:
-                        this.$router.push({ name: 'HangYeZiXunConfig', query: { code: 'add' } });
+                        this.$router.push({ name: 'newsConfig', query: { code: 'add' } });
                         break;
                     case CHANGEPAGECODE.editor:
-                        this.$router.push({ name: 'HangYeZiXunConfig', query: { code: 'editor', iiId: this.curIiId } });
+                        this.$router.push({ name: 'newsConfig', query: { code: 'editor', iiId: this.curIiId } });
                         break;
                     default:
                         break;
@@ -134,7 +177,7 @@
                 const loading = this.$loading({ background: 'rgba(0, 0, 0, 0.7)' });
 
                 try {
-                    const res = await HYZXApi.getIndustryList(opt);
+                    const res = await HYZXApi.getNewsList(opt);
                     if (res.code === 0) {
                         // 渲染页面
                         this.initPageData(res.data);
@@ -148,10 +191,10 @@
             async getHangYeZiXunDelete(opt) {
                 const loading = this.$loading({ background: 'rgba(0, 0, 0, 0.7)' });
                 try {
-                    const res = await HYZXApi.getIndustryDelete(opt);
+                    const res = await HYZXApi.getNewsDelete(opt);
                     loading.close();
                     if (res.code === 0 && res.data) {
-                        const res = await HYZXApi.getIndustryList(opt);
+                        const res = await HYZXApi.getNewsList(opt);
                         if (res.code === 0) {
                             this.initPageData(res.data);
                         }
@@ -166,9 +209,31 @@
                 tableServiceData.myData = listData.data;
                 paginationServiceData.total = listData.total;
             },
+            // 修正初始化
+            async initPageService() {
+                const loading = this.$loading({ background: 'rgba(0, 0, 0, 0.7)' });
+                try {
+                    // 新闻资讯分类
+                    const { data: newsClassifyArr } = await NewsClassifyApi.getNewsClassifySearch();
+                    selectServiceData.options = newsClassifyArr;
+
+                    // 新闻资讯列表
+                    const opt = this.getOption();
+                    const { code, data } = await HYZXApi.getNewsList(opt);
+                    console.log(code, data);
+                    if (code === 0) {
+                        // 渲染页面
+                        this.initPageData(data);
+                    }
+
+                    loading.close();
+                } catch (e) {
+                    loading.close();
+                }
+            },
         },
         created() {
-            this.getHangYeZiXunData();
+            this.initPageService();
         },
     };
 </script>
@@ -179,16 +244,16 @@
 
         .top {
             display: flex;
-            justify-content: flex-end;
+            justify-content: space-between;
             margin-bottom: 10px;
 
-            .btn-add {
-
+            .btn-search {
+                margin-left: 20px;
             }
         }
 
         .my-Pagination {
-           margin-top: 20px;
+            margin-top: 20px;
         }
     }
 </style>

+ 78 - 0
src/views/management/XinWenFenLei/components/Pagination.vue

@@ -0,0 +1,78 @@
+<template>
+    <el-pagination
+            @size-change="handleSizeChange"
+            @current-change="handleCurrentChange"
+            :current-page.sync="page"
+            :page-sizes="pageSizes"
+            :page-size="size"
+            layout="total, sizes, prev, pager, next, jumper"
+            :total="total">
+    </el-pagination>
+</template>
+
+<script>
+    import { paginationServiceData, defaultPageSizes } from './paginationData';
+
+    export default {
+        name:     'Pagination',
+        props:    {
+            pageSizes: {
+                type:    Array,
+                default: () => defaultPageSizes,
+            },
+        },
+        inject:   {
+            tableServiceData: {
+                type:    Object,
+                default: () => {
+                },
+            },
+        },
+        computed: {
+            page:  {
+                get() {
+                    return paginationServiceData.page;
+                },
+                set(val) {
+                    paginationServiceData.page = val;
+                },
+            },
+            size:  {
+                get() {
+                    return paginationServiceData.size;
+                },
+                set(val) {
+                    paginationServiceData.size = val;
+                },
+            },
+            total: {
+                get() {
+                    return paginationServiceData.total;
+                },
+                set(val) {
+                    this.paginationServiceData.total = val;
+                },
+            },
+        },
+        watch:    {
+            total(newVal) {
+                if (newVal >= this.size && !this.tableServiceData.myData.length && this.page > 1) {
+                    this.page--;
+                    this.$emit('current-page', this.page);
+                }
+            },
+        },
+        methods:  {
+            handleSizeChange(val) {
+                this.$emit('size-change', val);
+            },
+            handleCurrentChange(val) {
+                this.$emit('current-page', val);
+            },
+        },
+    };
+</script>
+
+<style scoped>
+
+</style>

+ 113 - 0
src/views/management/XinWenFenLei/components/Table.vue

@@ -0,0 +1,113 @@
+<template>
+    <el-table
+            :data="tableData"
+            border
+            class="table"
+            @selection-change="handleSelectionChange"
+            style="width: 100%">
+        <el-table-column
+                type="selection"
+                width="55">
+        </el-table-column>
+        <el-table-column
+                prop="name"
+                label="新闻分类名称"
+                :show-overflow-tooltip="true"
+                width="360">
+        </el-table-column>
+        <el-table-column
+                prop="number"
+                label="序号"
+                :show-overflow-tooltip="true"
+                width="200">
+        </el-table-column>
+        <el-table-column
+                prop="createTime"
+                label="创建时间"
+                :show-overflow-tooltip="true"
+                width="200">
+        </el-table-column>
+        <el-table-column
+                prop="updateTime"
+                label="更新时间"
+                :show-overflow-tooltip="true"
+                width="200">
+        </el-table-column>
+        <el-table-column
+                prop="updateUserName"
+                label="更新者"
+                :show-overflow-tooltip="true"
+                width="200">
+        </el-table-column>
+        <el-table-column
+                prop="createUserName"
+                label="创建者"
+                :show-overflow-tooltip="true"
+                width="200">
+        </el-table-column>
+        <el-table-column
+                label="操作"
+        >
+            <template slot-scope="scope">
+                <el-button type="text" @click="handleEditor(scope.row)">编辑</el-button>
+            </template>
+        </el-table-column>
+    </el-table>
+</template>
+
+<script>
+    export default {
+        name:     'Table',
+        inject:   {
+            tableServiceData:      {
+                type:    Object,
+                default: () => {
+                },
+            },
+            paginationServiceData: {
+                type:    Object,
+                default: () => {
+                },
+            },
+        },
+        computed: {
+            tableData() {
+                return this.tableServiceData.myData;
+            },
+        },
+        methods:  {
+            handleSelectionChange(data) {
+                const arr = [];
+                data.forEach(item => {
+                    arr.push(item.newsClassifyId);
+                });
+                this.$emit('select-change', arr);
+            },
+            handleEditor(data) {
+                this.$emit('editor', data);
+            },
+        },
+    };
+</script>
+
+<style lang="scss" scoped>
+    .table {
+        ::v-deep .is-leaf {
+            .cell {
+                text-align: center;
+            }
+        }
+
+        ::v-deep .el-table-column--selection {
+            .cell {
+                text-align: center;
+            }
+        }
+
+        .table-link {
+            text-decoration: none;
+            color: #2C98F2;
+        }
+    }
+
+</style>

+ 0 - 0
src/views/management/HangYeZiXun/components/paginationData.js → src/views/management/XinWenFenLei/components/paginationData.js


+ 0 - 0
src/views/management/HangYeZiXun/components/tableData.js → src/views/management/XinWenFenLei/components/tableData.js


+ 324 - 0
src/views/management/XinWenFenLei/index.vue

@@ -0,0 +1,324 @@
+<template>
+    <div class="admin-YouQingLianJie">
+        <!--    搜索    -->
+        <div class="yqlj-search">
+            <div>
+                <el-input
+                        class="search-name"
+                        placeholder="请输入新闻分类名称"
+                        v-model="searchData"
+                        clearable>
+                </el-input>
+                <el-button size="mini" type="primary" @click="handleSearch">查询</el-button>
+            </div>
+            <div>
+                <el-button size="mini" plain @click="handleDelete">删除</el-button>
+                <el-button size="mini" type="primary" @click="handleOpenAdd">新增</el-button>
+            </div>
+        </div>
+        <!--    table    -->
+        <myTable
+                class="yqlj-table"
+                @editor="handleOpenEditor"
+                @delete="handleDelete"
+                @select-change="handleSelectChange" />
+
+        <!--    分页    -->
+        <myPagination
+                class="yqlj-pagination"
+                @size-change="handleSizeChange"
+                @current-page="handleCurrentPage" />
+
+        <!--    弹窗 新增   -->
+        <el-dialog
+                title="新增新闻分类"
+                :visible.sync="addDialogVisit"
+                width="30%"
+                @close="handleResetLinks('addForm')"
+                center>
+            <div class="add-dialog-content">
+                <el-form :model="addForm" :rules="addRules" ref="addForm" label-width="80px" class="demo-ruleForm">
+                    <el-form-item label="名称:" prop="name">
+                        <el-input v-model="addForm.name"></el-input>
+                    </el-form-item>
+                    <el-form-item label="序号:" prop="number">
+                        <el-input v-model="addForm.number"></el-input>
+                    </el-form-item>
+                </el-form>
+            </div>
+            <span slot="footer" class="dialog-footer">
+                <el-button size="mini" @click="addDialogVisit = false">取 消</el-button>
+                <el-button size="mini" type="primary" @click="handleAddLinks('addForm')">确 定</el-button>
+            </span>
+        </el-dialog>
+        <!--    弹窗 编辑   -->
+        <el-dialog
+                title="编辑新闻分类"
+                :visible.sync="editorDialogVisit"
+                width="30%"
+                @close="handleEditorReset('editorForm')"
+                @open="handleGetLinksInfo"
+                center>
+            <div class="add-dialog-content">
+                <el-form :model="editorForm" :rules="editorRules" ref="editorForm" label-width="80px"
+                         class="demo-ruleForm">
+                    <el-form-item label="名称:" prop="name">
+                        <el-input v-model="editorForm.name"></el-input>
+                    </el-form-item>
+                    <el-form-item label="序号:" prop="number">
+                        <el-input v-model="editorForm.number"></el-input>
+                    </el-form-item>
+                </el-form>
+            </div>
+            <span slot="footer" class="dialog-footer">
+                <el-button size="mini" @click="editorDialogVisit = false">取 消</el-button>
+                <el-button size="mini" type="primary" @click="handleEditorLinks('editorForm')">确 定</el-button>
+            </span>
+        </el-dialog>
+    </div>
+</template>
+
+<script>
+    import { tableServiceData }      from './components/tableData';
+    import { paginationServiceData } from './components/paginationData';
+    import myPagination              from './components/Pagination';
+    import myTable                   from './components/Table';
+    import * as NewsClassifyService  from '@/api/newsClassify';
+    import * as comminUtil           from '@/utils/admin/tools';
+
+    export default {
+        name:       'YouQingLianJie',
+        provide:    {
+            tableServiceData,
+            paginationServiceData,
+        },
+        components: {
+            myPagination,
+            myTable,
+        },
+        data() {
+            return {
+                addDialogVisit:    false,
+                editorDialogVisit: false,
+                searchData:        '',
+                tableSelectData:   [],
+                addForm:           {
+                    name:   '',
+                    number: 0,
+                },
+                addRules:          {
+                    name:   [
+                        { required: true, message: '友情链接名称不能为空', trigger: 'blur' },
+                    ],
+                    number: [
+                        { required: true, message: '序号不能为空', trigger: 'blur' },
+                    ],
+                },
+                editorForm:        {
+                    name:   '',
+                    number: 0,
+                },
+                editorRules:       {
+                    name:   [
+                        { required: true, message: '友情链接名称不能为空', trigger: 'blur' },
+                    ],
+                    number: [
+                        { required: true, message: '序号不能为空', trigger: 'blur' },
+                    ],
+                },
+                userId:            null,
+                selectRow:         null,
+            };
+        },
+        computed:   {
+            myPage() {
+                return paginationServiceData.page;
+            },
+            mySize() {
+                return paginationServiceData.size;
+            },
+            myTotal() {
+                return paginationServiceData.total;
+            },
+        },
+        methods:    {
+            handleResetLinks(formName) {
+                this.$refs[formName].resetFields();
+                this.addDialogVisit = false;
+            },
+            handleAddLinks(formName) {
+                this.$refs[formName].validate((valid) => {
+                    if (valid) {
+                        this.addLinksFun();
+                    } else {
+                        return false;
+                    }
+                });
+            },
+            async addLinksFun() {
+                const loading = this.$loading({ background: 'rgba(0, 0, 0, 0.7)' });
+                try {
+                    const opt = Object.assign({}, this.addForm, { userId: this.userId });
+                    const res = await NewsClassifyService.getNewsClassifyAdd(opt);
+                    if (res.code === 0) {
+                        this.addDialogVisit = false;
+                        const opt = this.getOption();
+                        const myData = await NewsClassifyService.getNewsClassifyList(opt);
+                        this.initPageData(myData.data);
+                        loading.close();
+                    }
+                } catch (e) {
+                    loading.close();
+                }
+                this.addDialogVisit = false;
+            },
+            handleGetLinksInfo() {
+                const opt = { newsClassifyId: this.selectRow.newsClassifyId };
+                const loading = this.$loading({ background: 'rgba(0, 0, 0, 0.7)' });
+                NewsClassifyService.getNewsClassifyInfo(opt)
+                           .then(res => {
+                               const { name, number } = res.data;
+                               this.editorForm.name = name;
+                               this.editorForm.number = number;
+                               loading.close();
+                           })
+                           .catch(err => {
+                               loading.close();
+                           });
+            },
+            handleEditorReset(formName) {
+                this.$refs[formName].resetFields();
+                this.addDialogVisit = false;
+            },
+            handleEditorLinks(formName) {
+                this.$refs[formName].validate((valid) => {
+                    if (valid) {
+                        this.editorLinksFun();
+                    } else {
+                        return false;
+                    }
+                });
+            },
+            async editorLinksFun() {
+                const loading = this.$loading({ background: 'rgba(0, 0, 0, 0.7)' });
+                try {
+                    const opt = Object.assign({}, this.editorForm, { userId: this.userId, newsClassifyId: this.selectRow.newsClassifyId });
+                    const res = await NewsClassifyService.getNewsClassifyUpdate(opt);
+                    if (res.code === 0) {
+                        this.editorDialogVisit = false;
+                        const opt = this.getOption();
+                        const myData = await NewsClassifyService.getNewsClassifyList(opt);
+                        this.initPageData(myData.data);
+                        loading.close();
+                    }
+
+                    loading.close();
+                } catch (e) {
+                    loading.close();
+                }
+                this.addDialogVisit = false;
+            },
+            getOption() {
+                const opt = {
+                    page: this.myPage,
+                    size: this.mySize,
+                    name: this.searchData,
+                };
+                return opt;
+            },
+            handleSearch() {
+                paginationServiceData.page = 1;
+                this.searchYouQingData();
+            },
+            handleOpenAdd() {
+                this.addDialogVisit = true;
+            },
+            handleOpenEditor(data) {
+                this.selectRow = data;
+                this.editorDialogVisit = true;
+            },
+            async handleDelete() {
+                if (!this.tableSelectData.length) {
+                    this.$message.warning('请选择至少一条需要删除的数据');
+                    return;
+                }
+                const opt = {
+                    newsClassifyIds: [...this.tableSelectData],
+                };
+                const loading = this.$loading({ background: 'rgba(0, 0, 0, 0.7)' });
+                try {
+                    const res = await NewsClassifyService.getNewsClassifyDelete(opt);
+                    loading.close();
+                    if (res.code === 0 && res.data) {
+                        // 删除成功重置选择状态
+                        this.tableSelectData = [];
+                        // 刷新页面
+                        const newOpt = this.getOption();
+                        const res = await NewsClassifyService.getNewsClassifyList(newOpt);
+                        if (res.code === 0) {
+                            this.initPageData(res.data);
+                        }
+                        loading.close();
+                    }
+                } catch (err) {
+                    loading.close();
+                }
+            },
+            searchYouQingData() {
+                const opt = this.getOption();
+                const loading = this.$loading({ background: 'rgba(0, 0, 0, 0.7)' });
+                NewsClassifyService.getNewsClassifyList(opt)
+                           .then(res => {
+                               this.initPageData(res.data);
+                               loading.close();
+                           })
+                           .catch(err => {
+                               loading.close();
+                           });
+            },
+            handleSizeChange(size) {
+                paginationServiceData.size = size;
+                this.searchYouQingData();
+            },
+            handleCurrentPage(page) {
+                paginationServiceData.page = page;
+                this.searchYouQingData();
+            },
+            handleSelectChange(data) {
+                this.tableSelectData = data;
+            },
+            initPageData(listData) {
+                tableServiceData.myData = listData.data;
+                paginationServiceData.total = listData.total;
+            },
+        },
+        created() {
+            const userAuth = comminUtil.getUserAuth();
+            this.userId = userAuth && userAuth.userId ? userAuth.userId : null;
+        },
+        mounted() {
+            this.searchYouQingData();
+        },
+    };
+</script>
+
+<style lang="scss" scoped>
+    .admin-YouQingLianJie {
+        padding: 20px;
+
+        .yqlj-search {
+            display: flex;
+            justify-content: space-between;
+            margin-bottom: 20px;
+
+            .search-name {
+                width: 220px;
+                margin-right: 10px;
+            }
+        }
+
+        .yqlj-pagination {
+            margin-top: 20px;
+        }
+    }
+</style>

+ 14 - 8
src/views/management/YouQingLianJie/components/Pagination.vue

@@ -11,17 +11,20 @@
 </template>
 
 <script>
-    import { paginationServiceData, defaultPageSizes } from './paginationData';
-
     export default {
         name:     'Pagination',
         props:    {
             pageSizes: {
                 type:    Array,
-                default: () => defaultPageSizes,
+                default: () => [],
             },
         },
         inject:   {
+            paginationServiceData: {
+                type:    Object,
+                default: () => {
+                },
+            },
             tableServiceData: {
                 type:    Object,
                 default: () => {
@@ -31,23 +34,23 @@
         computed: {
             page:  {
                 get() {
-                    return paginationServiceData.page;
+                    return this.paginationServiceData.page;
                 },
                 set(val) {
-                    paginationServiceData.page = val;
+                    this.paginationServiceData.page = val;
                 },
             },
             size:  {
                 get() {
-                    return paginationServiceData.size;
+                    return this.paginationServiceData.size;
                 },
                 set(val) {
-                    paginationServiceData.size = val;
+                    this.paginationServiceData.size = val;
                 },
             },
             total: {
                 get() {
-                    return paginationServiceData.total;
+                    return this.paginationServiceData.total;
                 },
                 set(val) {
                     this.paginationServiceData.total = val;
@@ -70,6 +73,9 @@
                 this.$emit('current-page', val);
             },
         },
+        beforeDestroy() {
+            // this.paginationServiceData.clearData();
+        }
     };
 </script>
 

+ 1 - 1
src/views/management/YouQingLianJie/components/Table.vue

@@ -11,7 +11,7 @@
         </el-table-column>
         <el-table-column
                 prop="name"
-                label="名称"
+                label="友情链接名称"
                 :show-overflow-tooltip="true"
                 width="200">
         </el-table-column>

+ 0 - 14
src/views/management/YouQingLianJie/components/paginationData.js

@@ -1,14 +0,0 @@
-import Vue from 'vue';
-
-const pagination = {
-    page: 1,
-    size: 10,
-    total: 0
-}
-const defaultPageSizes = [10, 20, 30, 40];
-const paginationServiceData = Vue.observable(pagination);
-
-export {
-    paginationServiceData,
-    defaultPageSizes
-}

+ 0 - 11
src/views/management/YouQingLianJie/components/tableData.js

@@ -1,11 +0,0 @@
-import Vue from 'vue';
-
-const tableData = {
-    myData: []
-}
-
-const tableServiceData = Vue.observable(tableData);
-
-export {
-    tableServiceData
-}

+ 23 - 7
src/views/management/YouQingLianJie/index.vue

@@ -5,7 +5,7 @@
             <div>
                 <el-input
                         class="search-name"
-                        placeholder="请输入内容"
+                        placeholder="请输入友情链接名称"
                         v-model="searchData"
                         clearable>
                 </el-input>
@@ -26,6 +26,7 @@
         <!--    分页    -->
         <myPagination
                 class="yqlj-pagination"
+                :pageSizes="defaultPageSizes"
                 @size-change="handleSizeChange"
                 @current-page="handleCurrentPage" />
 
@@ -79,16 +80,30 @@
 </template>
 
 <script>
-    import { tableServiceData }      from './components/tableData';
-    import { paginationServiceData } from './components/paginationData';
-    import myPagination              from './components/Pagination';
-    import myTable                   from './components/Table';
-    import * as YQLJService          from '@/api/youqinglianjie';
-    import * as comminUtil           from '@/utils/admin/tools';
+    import myPagination     from './components/Pagination';
+    import myTable          from './components/Table';
+    import * as YQLJService from '@/api/youqinglianjie';
+    import * as comminUtil  from '@/utils/admin/tools';
+    import Vue              from 'vue';
 
+    const tableData = {
+        myData: [],
+    };
+
+    const pagination = {
+        page:  1,
+        size:  10,
+        total: 0,
+    };
+
+    const defaultPageSizes = [10, 20, 30, 40];
+
+    const paginationServiceData = Vue.observable(pagination);
+    const tableServiceData = Vue.observable(tableData);
     export default {
         name:       'YouQingLianJie',
         provide:    {
+            defaultPageSizes,
             tableServiceData,
             paginationServiceData,
         },
@@ -98,6 +113,7 @@
         },
         data() {
             return {
+                defaultPageSizes:  defaultPageSizes,
                 addDialogVisit:    false,
                 editorDialogVisit: false,
                 searchData:        '',