Explorar el Código

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

wangguoyu hace 5 años
padre
commit
21f8a6899f

+ 43 - 0
src/api/youqinglianjie.js

@@ -0,0 +1,43 @@
+import request           from '@/utils/request';
+
+const pre = `/links`
+
+export function getLinksAdd(data = {}) {
+    return request({
+                       url:    `${pre}/add`,
+                       method: 'post',
+                       data,
+                   });
+}
+
+export function getLinksDelete(data = {}) {
+    return request({
+                       url:    `${pre}/delete`,
+                       method: 'post',
+                       data,
+                   });
+}
+
+export function getLinksInfo(data = {}) {
+    return request({
+                       url:    `${pre}/info`,
+                       method: 'post',
+                       data,
+                   });
+}
+
+export function getLinksList(data = {}) {
+    return request({
+                       url:    `${pre}/list`,
+                       method: 'post',
+                       data,
+                   });
+}
+
+export function getLinksUpdate(data = {}) {
+    return request({
+                       url:    `${pre}/update`,
+                       method: 'post',
+                       data,
+                   });
+}

+ 1 - 1
src/router.js

@@ -98,7 +98,7 @@ const router = new Router({
                                               },
                                               isAdminMenu: true,
                                               component: () => {
-                                                  return import(/* webpackChunkName: "HangYeZiXun" */ './views/management/HangYeZiXun/YouQingLianJie/index.vue');
+                                                  return import(/* webpackChunkName: "HangYeZiXun" */ './views/management/YouQingLianJie/index.vue');
                                               },
                                           },
                                       ],

+ 0 - 1
src/views/management/HangYeZiXun/HangYeZiXunConfig/components/uploadFile.vue

@@ -56,7 +56,6 @@
             },
             // 自定义上传
             uploadFun(params) {
-                console.log(params);
                 if (!params) {
                     return;
                 }

+ 0 - 2
src/views/management/HangYeZiXun/HangYeZiXunConfig/index.vue

@@ -114,7 +114,6 @@
                 window.history.go(-1);
             },
             getImageUrl(data) {
-                console.log('data =>', data);
                 this.configData.pic = data;
             },
             syncValue(flg, content) {
@@ -159,7 +158,6 @@
                 try {
                     const res = await HYZXService.getIndustryInfo(opt);
                     if (res.code === 0) {
-                        console.log(res);
                         this.initPageData(res.data);
                     }
                     loading.close();

+ 0 - 15
src/views/management/HangYeZiXun/YouQingLianJie/index.vue

@@ -1,15 +0,0 @@
-<template>
-    <div>
-        友情链接
-    </div>
-</template>
-
-<script>
-    export default {
-        name: 'YouQingLianJie',
-    };
-</script>
-
-<style lang="scss" scoped>
-
-</style>

+ 37 - 18
src/views/management/HangYeZiXun/components/Pagination.vue

@@ -2,7 +2,7 @@
     <el-pagination
             @size-change="handleSizeChange"
             @current-change="handleCurrentChange"
-            :current-page="page"
+            :current-page.sync="page"
             :page-sizes="pageSizes"
             :page-size="size"
             layout="total, sizes, prev, pager, next, jumper"
@@ -14,29 +14,36 @@
     import { paginationServiceData, defaultPageSizes } from './paginationData';
 
     export default {
-        name: 'Pagination',
-        props: {
+        name:     'Pagination',
+        props:    {
             pageSizes: {
-                type: Array,
-                default: () => defaultPageSizes
-            }
+                type:    Array,
+                default: () => defaultPageSizes,
+            },
+        },
+        inject:   {
+            tableServiceData: {
+                type:    Object,
+                default: () => {
+                },
+            },
         },
         computed: {
-            page: {
-                get () {
+            page:  {
+                get() {
                     return paginationServiceData.page;
                 },
                 set(val) {
-                    paginationServiceData.size = val;
-                }
+                    paginationServiceData.page = val;
+                },
             },
-            size: {
-                get () {
+            size:  {
+                get() {
                     return paginationServiceData.size;
                 },
                 set(val) {
                     paginationServiceData.size = val;
-                }
+                },
             },
             total: {
                 get() {
@@ -44,13 +51,25 @@
                 },
                 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);
+            },
         },
-        methods: {
-            handleSizeChange() {},
-            handleCurrentChange() {},
-        }
     };
 </script>
 

+ 20 - 3
src/views/management/HangYeZiXun/components/Table.vue

@@ -2,6 +2,7 @@
     <el-table
             :data="tableData"
             border
+            class="table"
             @selection-change="handleSelectionChange"
             style="width: 100%">
         <el-table-column
@@ -11,11 +12,13 @@
         <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
@@ -26,17 +29,20 @@
                 <el-image
                         style="width: 200px;height: 200px"
                         :src="scope.row.pic"
+                        :preview-src-list="scope.row.pic ? [scope.row.pic]: []"
                         fit="contain"></el-image>
             </template>
         </el-table-column>
         <el-table-column
                 prop="startTime"
                 label="发布时间"
+                :show-overflow-tooltip="true"
                 width="200">
         </el-table-column>
         <el-table-column
                 prop="visits"
                 label="访问次数"
+                :show-overflow-tooltip="true"
                 width="200">
         </el-table-column>
         <el-table-column
@@ -44,7 +50,7 @@
         >
             <template slot-scope="scope">
                 <el-button type="text" @click="handleEditor(scope.row)">编辑</el-button>
-                <el-button type="text" @click="handleDelete(scope.row)">删除</el-button>
+                <el-button type="text" v-if="false" @click="handleDelete(scope.row)">删除</el-button>
             </template>
         </el-table-column>
     </el-table>
@@ -72,7 +78,6 @@
         },
         methods:  {
             handleSelectionChange(data) {
-                console.log(data);
                 const arr = [];
                 data.forEach(item => {
                     arr.push(item.iiId)
@@ -89,6 +94,18 @@
     };
 </script>
 
-<style scoped>
+<style lang="scss" scoped>
+.table {
+    ::v-deep .is-leaf {
+        .cell {
+            text-align: center;
+        }
+    }
 
+    ::v-deep .el-table-column--selection {
+        .cell {
+            text-align: center;
+        }
+    }
+}
 </style>

+ 21 - 7
src/views/management/HangYeZiXun/index.vue

@@ -3,14 +3,18 @@
         <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>
+                <el-button class="btn-add" size="mini" type="primary" @click="handleDeleteHangYeZiXun">删除</el-button>
             </div>
             <myTable
                     @editor="handleEditor"
                     @delete="handleDelete"
                     @select-change="handleSelectChange"
             />
-            <myPagination />
+            <myPagination
+                    class="my-Pagination"
+                    @size-change="handleSizeChange"
+                    @current-page="handleCurrentPage"
+            />
         </div>
     </div>
 </template>
@@ -18,9 +22,9 @@
 <script>
     import { tableServiceData }      from './components/tableData';
     import { paginationServiceData } from './components/paginationData';
-    import * as HYZXApi              from '@/api/hangyezixun';
     import myPagination              from './components/Pagination';
     import myTable                   from './components/Table';
+    import * as HYZXApi              from '@/api/hangyezixun';
 
     const CHANGEPAGECODE = {
         add:    'add',
@@ -56,12 +60,10 @@
         },
         methods:    {
             handleEditor(data) {
-                console.log('editor', data);
                 this.curIiId = data.iiId;
                 this.changePage(CHANGEPAGECODE.editor);
             },
             handleDelete(data) {
-                console.log('delete', data);
                 const opt = {
                     iiIds: [data.iiId],
                 };
@@ -73,6 +75,14 @@
             handleAddHangYeZiXun() {
                 this.changePage(CHANGEPAGECODE.add);
             },
+            handleSizeChange(size) {
+                paginationServiceData.size = size;
+                this.getHangYeZiXunData();
+            },
+            handleCurrentPage(page) {
+                paginationServiceData.page = page;
+                this.getHangYeZiXunData();
+            },
             async handleDeleteHangYeZiXun() {
                 if (!this.tableSelectData.length) {
                     this.$message.warning('请选择至少一条需要删除的数据');
@@ -88,8 +98,8 @@
                     if (res.code === 0 && res.data) {
                         // 删除成功重置选择状态
                         this.tableSelectData = [];
-
-                        const res = await HYZXApi.getIndustryList(opt);
+                        const newOpt = this.getOption();
+                        const res = await HYZXApi.getIndustryList(newOpt);
                         if (res.code === 0) {
                             this.initPageData(res.data);
                         }
@@ -176,5 +186,9 @@
 
             }
         }
+
+        .my-Pagination {
+           margin-top: 20px;
+        }
     }
 </style>

+ 43 - 5
src/views/management/Home/index.vue

@@ -12,7 +12,19 @@
             </el-header>
             <el-main>
                 <el-scrollbar style="height: 100%">
-                    <router-view></router-view>
+                    <transition
+                            name="fade"
+                            mode="out-in"
+                            appear
+                            enter-class="enter"
+                            enter-active-class="enterActive"
+                            enter-to-class="enterTo"
+                            leave-class="leave"
+                            leave-active-class="leaveActive"
+                            leave-to-class="leaveTo"
+                    >
+                        <router-view></router-view>
+                    </transition>
                 </el-scrollbar>
             </el-main>
             <el-footer>
@@ -23,10 +35,10 @@
 </template>
 
 <script>
-    import Asider       from './components/Asider';
-    import Footer       from './components/Footer';
-    import Header       from './components/Header';
-    import { getCache } from '@/utils/admin/tools';
+    import Asider        from './components/Asider';
+    import Footer        from './components/Footer';
+    import Header        from './components/Header';
+    import { getCache }  from '@/utils/admin/tools';
     import { USER_AUTH } from '@/utils/admin/ConstantConfig';
 
     export default {
@@ -83,9 +95,35 @@
             color: #333;
             /*padding: 30px 0 30px 30px;*/
             padding: 0;
+
             ::v-deep .el-scrollbar__wrap {
                 overflow-x: hidden;
             }
+            ::v-deep .el-scrollbar__bar.is-horizontal {
+                visibility: hidden;
+            }
+        }
+
+        .admin-home-transition {
+            overflow-x: hidden;
+        }
+
+        /**
+         * transform
+         */
+        ::v-deep .enterActive, ::v-deep .leaveActive {
+            transition: all .3s ease;
+        }
+
+        ::v-deep .enterTo, ::v-deep .leave {
+            opacity: 1;
+            left: 0;
+            transform: translate(0);
+        }
+
+        ::v-deep .enter, ::v-deep .leaveTo {
+            opacity: 0;
+            transform: translate(100px);
         }
     }
 </style>

+ 78 - 0
src/views/management/YouQingLianJie/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>

+ 116 - 0
src/views/management/YouQingLianJie/components/Table.vue

@@ -0,0 +1,116 @@
+<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="200">
+        </el-table-column>
+        <el-table-column
+                prop="url"
+                label="链接"
+                :show-overflow-tooltip="true"
+                width="360">
+            <template slot-scope="scope">
+                <a :href="scope.row.url" class="table-link" target="_blank">{{scope.row.url}}</a>
+            </template>
+        </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.hlId);
+                });
+                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>

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

@@ -0,0 +1,14 @@
+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
+}

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

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

+ 324 - 0
src/views/management/YouQingLianJie/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="url">
+                        <el-input v-model="addForm.url"></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="url">
+                        <el-input v-model="editorForm.url"></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 YQLJService          from '@/api/youqinglianjie';
+    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: '',
+                    url:  '',
+                },
+                addRules:          {
+                    name: [
+                        { required: true, message: '友情链接名称不能为空', trigger: 'blur' },
+                    ],
+                    url:  [
+                        { required: true, message: '友情链接不能为空', trigger: 'blur' },
+                    ],
+                },
+                editorForm:        {
+                    name: '',
+                    url:  '',
+                },
+                editorRules:       {
+                    name: [
+                        { required: true, message: '友情链接名称不能为空', trigger: 'blur' },
+                    ],
+                    url:  [
+                        { 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 YQLJService.getLinksAdd(opt);
+                    if (res.code === 0) {
+                        this.addDialogVisit = false;
+                        const opt = this.getOption();
+                        const myData = await YQLJService.getLinksList(opt);
+                        this.initPageData(myData.data);
+                        loading.close();
+                    }
+                } catch (e) {
+                    loading.close();
+                }
+                this.addDialogVisit = false;
+            },
+            handleGetLinksInfo() {
+                const opt = { hlId: this.selectRow.hlId };
+                const loading = this.$loading({ background: 'rgba(0, 0, 0, 0.7)' });
+                YQLJService.getLinksInfo(opt)
+                           .then(res => {
+                               const { name, url } = res.data;
+                               this.editorForm.name = name;
+                               this.editorForm.url = url;
+                               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, hlId: this.selectRow.hlId });
+                    const res = await YQLJService.getLinksUpdate(opt);
+                    if (res.code === 0) {
+                        this.editorDialogVisit = false;
+                        const opt = this.getOption();
+                        const myData = await YQLJService.getLinksList(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 = {
+                    hlIds: [...this.tableSelectData],
+                };
+                const loading = this.$loading({ background: 'rgba(0, 0, 0, 0.7)' });
+                try {
+                    const res = await YQLJService.getLinksDelete(opt);
+                    loading.close();
+                    if (res.code === 0 && res.data) {
+                        // 删除成功重置选择状态
+                        this.tableSelectData = [];
+                        // 刷新页面
+                        const newOpt = this.getOption();
+                        const res = await YQLJService.getLinksList(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)' });
+                YQLJService.getLinksList(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>