Parcourir la source

update 横幅广告

15724580513 il y a 5 ans
Parent
commit
53b6e1309c

+ 43 - 0
src/api/banner.js

@@ -0,0 +1,43 @@
+import request           from '@/utils/request';
+
+const pre = `/banner`
+
+export function getBannerAdd(data = {}) {
+    return request({
+                       url:    `${pre}/add`,
+                       method: 'post',
+                       data,
+                   });
+}
+
+export function getBannerDelete(data = {}) {
+    return request({
+                       url:    `${pre}/delete`,
+                       method: 'post',
+                       data,
+                   });
+}
+
+export function getBannerInfo(data = {}) {
+    return request({
+                       url:    `${pre}/info`,
+                       method: 'post',
+                       data,
+                   });
+}
+
+export function getBannerList(data = {}) {
+    return request({
+                       url:    `${pre}/list`,
+                       method: 'post',
+                       data,
+                   });
+}
+
+export function getBannerUpdate(data = {}) {
+    return request({
+                       url:    `${pre}/update`,
+                       method: 'post',
+                       data,
+                   });
+}

+ 146 - 0
src/components/Admin/Common/uploadFile.vue

@@ -0,0 +1,146 @@
+<template>
+    <div class="admin-uploadAlCloud">
+        <el-upload
+                ref="upload"
+                action="action"
+                class="avatar-uploader"
+                :http-request="uploadFun"
+                :show-file-list="false">
+            <img v-if="imageUrl" :src="imageUrl" class="avatar" alt="头像">
+            <i v-else class="el-icon-plus avatar-uploader-icon"></i>
+        </el-upload>
+        <el-button v-if="showBtnFlag&&btnType==='delete'" type="primary" size="small" class="delete-btn" @click="btnClick(btnType)">删除</el-button>
+    </div>
+</template>
+
+<script>
+
+    import { getFilePolicy }           from '@/api/AlCloud.js';
+    //  describe: 上传组件 author: Wgy date:2020-03-30
+    /*
+    * showBtnFlag:是否显现按钮
+    * btnType:按钮类型 显示按钮 默认type为 'delete'
+    *imageUrl:入参图片
+    * 父页面 example:<upload-file  :imageUrl="imageUrl1" @btnFun="btnFun" @getFileUrl="getFileFun"></upload-file>
+    * */
+
+    export default {
+        name: "UploadAlCloud",
+        props: {
+            showBtnFlag: {
+                type: Boolean,
+                default: true
+            },
+            btnType: {
+                type: String,
+                default: 'delete',
+            },
+            imageUrl: {
+                type: String,
+                default: '',
+            },
+        },
+        data() {
+            return {
+                afterUploadImg: '',
+            };
+        },
+        methods: {
+            //按钮
+            btnClick(data){
+                let response ={
+                    type:data,
+                    imageUrl:this.imageUrl
+                }
+                this.$emit('btnFun', response);
+            },
+            // 自定义上传
+            uploadFun(params) {
+                if (!params) {
+                    return;
+                }
+                const suffixList = params.file.name.split('.').pop();
+                const options = {
+                    prefix: 'resource/portal/',
+                    suffix: suffixList,
+                };
+                const loading = this.$loading({background:"rgba(0, 0, 0, 0.7)"});
+                getFilePolicy(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);
+
+                        this.$axios.post(multipartParams.url, FormDataForAl).then(alRes => {
+                            if (alRes.status === 200) {
+                                this.afterUploadImg = `${multipartParams.url}/${multipartParams.key}`;
+                                this.$emit('getFileUrl', this.afterUploadImg);
+                                loading.close();
+                            }else {
+                                loading.close();
+                            }
+                        }).catch(e => {
+                            loading.close();
+                        });
+                    }else {
+                        loading.close();
+                    }
+                });
+            }
+        },
+    }
+</script>
+
+<style lang="scss">
+    .admin-uploadAlCloud {
+        display: block;
+
+        .avatar-uploader .el-upload {
+            background: #fff;
+            border: 1px dashed #d9d9d9;
+            border-radius: 6px;
+            cursor: pointer;
+            position: relative;
+            overflow: hidden;
+        }
+        .avatar-uploader .el-upload:hover {
+            border-color: #409EFF;
+        }
+        .avatar-uploader-icon {
+            font-size: 28px;
+            color: #8c939d;
+            width: 178px;
+            height: 178px;
+            line-height: 178px;
+            text-align: center;
+        }
+        .avatar {
+            width: 178px;
+            height: 178px;
+            display: block;
+        }
+        @media screen and (max-width: 1440px){
+            .avatar{
+                width: 140px; // 必须指定宽高
+                height: 140px;
+                line-height: 140px;
+            }
+            .avatar-uploader-icon{
+                width: 140px;
+                height: 140px;
+                line-height: 140px;
+            }
+        }
+    }
+</style>

+ 4 - 4
src/router.js

@@ -190,15 +190,15 @@ const router = new Router({
                                               },
                                           },
                                           {
-                                              path: '/configPage',
-                                              name: 'configPage',
+                                              path: '/Advertising',
+                                              name: 'advertising',
                                               meta: {
                                                   icon: "",
-                                                  title: "系统配置"
+                                                  title: "横幅广告"
                                               },
                                               isAdminMenu: true,
                                               component: () => {
-                                                  return import(/* webpackChunkName: "HangYeZiXun" */ './views/management/XinWenFenLei/index.vue');
+                                                  return import(/* webpackChunkName: "HangYeZiXun" */ './views/management/Advertising/index.vue');
                                               },
                                           },
                                       ],

+ 93 - 0
src/views/management/Advertising/components/Pagination.vue

@@ -0,0 +1,93 @@
+<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>
+    export default {
+        name:     'Pagination',
+        props:    {
+            pageSizes: {
+                type:    Array,
+                default: () => [],
+            },
+            codePage: {
+                type: String,
+                default: 'page'
+            },
+            codeSize: {
+                type: String,
+                default: 'size'
+            },
+            codeTotal: {
+                type: String,
+                default: 'total'
+            }
+        },
+        inject:   {
+            paginationServiceData: {
+                type:    Object,
+                default: () => {
+                },
+            },
+            tableServiceData: {
+                type:    Object,
+                default: () => {
+                },
+            },
+        },
+        computed: {
+            page:  {
+                get() {
+                    return this.paginationServiceData[this.codePage];
+                },
+                set(val) {
+                    this.paginationServiceData[this.codePage] = val;
+                },
+            },
+            size:  {
+                get() {
+                    return this.paginationServiceData[this.codeSize];
+                },
+                set(val) {
+                    this.paginationServiceData[this.codeSize] = val;
+                },
+            },
+            total: {
+                get() {
+                    return this.paginationServiceData[this.codeTotal];
+                },
+                set(val) {
+                    this.this.paginationServiceData[this.codeTotal] = 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>

+ 67 - 0
src/views/management/Advertising/components/Select.vue

@@ -0,0 +1,67 @@
+<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'
+            },
+            codeOptions: {
+                type: String,
+                default: 'options'
+            }
+        },
+
+        inject: {
+            selectServiceData: {
+                type:    Object,
+                default: () => {
+                },
+            },
+        },
+
+        computed: {
+            options() {
+                return this.selectServiceData[this.codeOptions];
+            },
+            value:   {
+                get() {
+                    return this.selectServiceData[this.id];
+                },
+                set(val) {
+                    this.selectServiceData[this.id] = val;
+                },
+            },
+        },
+
+        methods: {
+            selectChange(val) {
+                this.$emit('select-change', val)
+            }
+        },
+    };
+</script>
+
+<style scoped>
+
+</style>

+ 133 - 0
src/views/management/Advertising/components/Table.vue

@@ -0,0 +1,133 @@
+<template>
+    <el-table
+            :data="tableData"
+            border
+            class="table"
+            @selection-change="handleSelectionChange"
+            style="width: 100%">
+        <el-table-column
+                type="selection"
+                fixed
+                width="55">
+        </el-table-column>
+        <el-table-column
+                prop="title"
+                label="标题"
+                width="360">
+        </el-table-column>
+        <el-table-column
+                prop="codeName"
+                label="菜单"
+                width="360">
+        </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="pic"
+                label="图片"
+                width="300">
+            <template slot-scope="scope">
+                <el-image
+                        style="width: 200px;height: 200px"
+                        :src="scope.row.pic"
+                        :lazy="true"
+                        :preview-src-list="scope.row.pic ? [scope.row.pic]: []"
+                        fit="contain"></el-image>
+            </template>
+        </el-table-column>
+        <el-table-column
+                prop="createTime"
+                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
+                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
+                label="操作"
+                fixed="right"
+        >
+            <template slot-scope="scope">
+                <el-button type="text" @click="handleEditor(scope.row)">编辑</el-button>
+                <el-button type="text" v-if="false" @click="handleDelete(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.bnId)
+                })
+                this.$emit('select-change', arr);
+            },
+            handleEditor(data) {
+                this.$emit('editor', data);
+            },
+            handleDelete(data) {
+                this.$emit('delete', 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;
+        }
+    }
+}
+</style>

+ 448 - 0
src/views/management/Advertising/index.vue

@@ -0,0 +1,448 @@
+<template>
+    <div class="advertising-banner">
+        <div class="top">
+            <div>
+                <mySelect
+                        label="name"
+                        id="id"
+                        placeholder="请选择菜单"
+                ></mySelect>
+                <el-button class="btn-search" size="mini" type="primary" @click="handleSearch">查询</el-button>
+            </div>
+            <div>
+                <el-button size="mini" type="primary" @click="handleAddNews">新增</el-button>
+                <el-button size="mini" type="primary" @click="handleDelete">删除
+                </el-button>
+            </div>
+        </div>
+        <myTable
+                @editor="handleEditor"
+                @select-change="handleSelectChange"
+        />
+        <myPagination
+                class="my-Pagination"
+                :pageSizes="defaultPageSizes"
+                @size-change="handleSizeChange"
+                @current-page="handleCurrentPage"
+        />
+
+        <!--    弹窗 新增   -->
+        <el-dialog
+                title="新增广告"
+                :visible.sync="addDialogVisit"
+                width="30%"
+                @close="handleResetAdvertising('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="code">
+                        <el-select v-model="addForm.code" placeholder="请选择页面">
+                            <el-option
+                                    v-for="item in myMenu"
+                                    :key="item.id"
+                                    :label="item.name"
+                                    :value="item.id">
+                            </el-option>
+                        </el-select>
+                    </el-form-item>
+                    <el-form-item label="标题:" prop="title">
+                        <el-input v-model="addForm.title"></el-input>
+                    </el-form-item>
+                    <el-form-item label="链接:" prop="url">
+                        <el-input v-model="addForm.url"></el-input>
+                    </el-form-item>
+                    <el-form-item label="链接:" prop="pic">
+                        <upload-file :imageUrl="addForm.pic"
+                                     :showBtnFlag="false"
+                                     @getFileUrl="getAddImageUrl"></upload-file>
+                        <h5 class="picture-size-h5">(最佳尺寸为?*?像素)</h5>
+                    </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="handleAddAdvertising('addForm')">确 定</el-button>
+            </span>
+        </el-dialog>
+
+        <!--    弹窗 编辑   -->
+        <el-dialog
+                title="编辑广告"
+                :visible.sync="editorDialogVisit"
+                width="30%"
+                @close="handleEditorResetAdvertising('editorForm')"
+                @open="handleGetAdvertisingInfo"
+                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="code">
+                        <el-select v-model="editorForm.code" placeholder="请选择页面">
+                            <el-option
+                                    v-for="item in myMenu"
+                                    :key="item.id"
+                                    :label="item.name"
+                                    :value="item.id">
+                            </el-option>
+                        </el-select>
+                    </el-form-item>
+                    <el-form-item label="标题:" prop="title">
+                        <el-input v-model="editorForm.title"></el-input>
+                    </el-form-item>
+                    <el-form-item label="链接:" prop="url">
+                        <el-input v-model="editorForm.url"></el-input>
+                    </el-form-item>
+                    <el-form-item label="链接:" prop="pic">
+                        <upload-file :imageUrl="editorForm.pic"
+                                     :showBtnFlag="false"
+                                     @getFileUrl="getEditorImageUrl"></upload-file>
+                        <h5 class="picture-size-h5">(最佳尺寸为?*?像素)</h5>
+                    </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="handleEditorAdvertising('editorForm')">确 定</el-button>
+            </span>
+        </el-dialog>
+    </div>
+</template>
+
+<script>
+    import uploadFile      from '@/components/Admin/Common/uploadFile';
+    import myPagination    from './components/Pagination';
+    import myTable         from './components/Table';
+    import mySelect        from './components/Select';
+    import * as HFGG       from '@/api/banner';
+    import * as comminUtil from '@/utils/admin/tools';
+    import Vue             from 'vue';
+
+    // 菜单
+    const menu = [
+        {
+            id:   1,
+            name: '首页',
+        },
+        {
+            id:   2,
+            name: '考试平台',
+        },
+        {
+            id:   3,
+            name: '培训平台',
+        },
+        {
+            id:   4,
+            name: '课程开发',
+        },
+        {
+            id:   5,
+            name: '新闻资讯',
+        },
+    ];
+    const CHANGEPAGECODE = {
+        add:    'add',
+        editor: 'editor',
+    };
+    const selectData = {
+        options: menu,
+        id:      null,
+    };
+    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:       'Advertising',
+        provide:    {
+            tableServiceData,
+            paginationServiceData,
+            selectServiceData,
+        },
+        components: {
+            myPagination,
+            myTable,
+            mySelect,
+            uploadFile,
+        },
+        data() {
+            return {
+                defaultPageSizes:  defaultPageSizes,
+                curIiId:           null,
+                tableSelectData:   [],
+                addDialogVisit:    false,
+                editorDialogVisit: false,
+                addForm:           {
+                    code:  null,
+                    title: '',
+                    url:   '',
+                    pic:   '',
+                },
+                addRules:          {
+                    pic: [
+                        { required: true, message: '图片不能为空', trigger: 'blur' },
+                    ],
+                },
+                editorForm:        {
+                    code:  null,
+                    title: '',
+                    url:   '',
+                    pic:   '',
+                },
+                editorRules:       {
+                    pic: [
+                        { required: true, message: '图片不能为空', trigger: 'blur' },
+                    ],
+                },
+                userId:            null,
+                selectRow:         null,
+            };
+        },
+        computed:   {
+            myMenu() {
+                return menu;
+            },
+            myPage() {
+                return paginationServiceData.page;
+            },
+            mySize() {
+                return paginationServiceData.size;
+            },
+            myTotal() {
+                return paginationServiceData.total;
+            },
+        },
+        methods:    {
+            handleSearch() {
+                paginationServiceData.page = 1;
+                this.searchAdvertisingData();
+            },
+            handleEditor(data) {
+                this.selectRow = data;
+                this.editorDialogVisit = true;
+            },
+            async handleDelete() {
+                if (!this.tableSelectData.length) {
+                    this.$message.warning('请选择至少一条需要删除的数据');
+                    return;
+                }
+
+                const opt = {
+                    bnIds: [...this.tableSelectData],
+                };
+
+                const loading = this.$loading({ background: 'rgba(0, 0, 0, 0.7)' });
+                try {
+                    const res = await HFGG.getBannerDelete(opt);
+                    loading.close();
+                    if (res.code === 0 && res.data) {
+                        // 删除成功重置选择状态
+                        this.tableSelectData = [];
+                        // 刷新页面
+                        const newOpt = this.getOption();
+                        const res = await HFGG.getBannerList(newOpt);
+                        if (res.code === 0) {
+                            this.initPageData(res.data);
+                        }
+                        loading.close();
+                    }
+                } catch (err) {
+                    loading.close();
+                }
+            },
+            handleSelectChange(data) {
+                this.tableSelectData = data;
+            },
+            handleAddNews() {
+                this.addDialogVisit = true;
+            },
+            searchAdvertisingData() {
+                const opt = this.getOption();
+                const loading = this.$loading({ background: 'rgba(0, 0, 0, 0.7)' });
+                HFGG.getBannerList(opt)
+                           .then(res => {
+                               this.initPageData(res.data);
+                               loading.close();
+                           })
+                           .catch(err => {
+                               loading.close();
+                           });
+            },
+            handleSizeChange(size) {
+                paginationServiceData.size = size;
+                this.searchAdvertisingData();
+            },
+            handleCurrentPage(page) {
+                paginationServiceData.page = page;
+                this.searchAdvertisingData();
+            },
+            handleEditorAdvertising(formName) {
+                this.$refs[formName].validate((valid) => {
+                    if (valid) {
+                        this.editorAdvertisingFun();
+                    } else {
+                        return false;
+                    }
+                });
+            },
+            async editorAdvertisingFun() {
+                const loading = this.$loading({ background: 'rgba(0, 0, 0, 0.7)' });
+                try {
+                    const opt = Object.assign({}, this.editorForm, { userId: this.userId, bnId: this.selectRow.bnId });
+                    const res = await HFGG.getBannerUpdate(opt);
+                    if (res.code === 0) {
+                        this.editorDialogVisit = false;
+                        const opt = this.getOption();
+                        const myData = await HFGG.getBannerList(opt);
+                        this.initPageData(myData.data);
+                    }
+                    loading.close();
+                } catch (e) {
+                    loading.close();
+                }
+                this.addDialogVisit = false;
+            },
+            handleEditorResetAdvertising(formName) {
+                this.$refs[formName].resetFields();
+                this.editorDialogVisit = false;
+            },
+            handleGetAdvertisingInfo() {
+                const opt = { bnId: this.selectRow.bnId };
+                const loading = this.$loading({ background: 'rgba(0, 0, 0, 0.7)' });
+                HFGG.getBannerInfo(opt)
+                    .then(res => {
+                        console.log(res);
+                        const { name, url, pic, title, code } = res.data;
+                        this.editorForm.name = name;
+                        this.editorForm.url = url;
+                        this.editorForm.pic = pic;
+                        this.editorForm.title = title;
+                        this.editorForm.code = code;
+                        loading.close();
+                    })
+                    .catch(err => {
+                        loading.close();
+                    });
+            },
+            getEditorImageUrl(url) {
+                this.editorForm.pic = url;
+            },
+            handleResetAdvertising(formName) {
+                this.$refs[formName].resetFields();
+                this.addDialogVisit = false;
+            },
+            handleAddAdvertising(formName) {
+                this.$refs[formName].validate((valid) => {
+                    if (valid) {
+                        this.addAdvertisingFun();
+                    } else {
+                        return false;
+                    }
+                });
+            },
+            async addAdvertisingFun() {
+                const loading = this.$loading({ background: 'rgba(0, 0, 0, 0.7)' });
+                try {
+                    const opt = Object.assign({}, this.addForm, { userId: this.userId });
+                    const res = await HFGG.getBannerAdd(opt);
+                    if (res.code === 0) {
+                        this.addDialogVisit = false;
+                        const opt = this.getOption();
+                        const myData = await HFGG.getBannerList(opt);
+                        this.initPageData(myData.data);
+                        loading.close();
+                    }
+                } catch (e) {
+                    loading.close();
+                }
+                this.addDialogVisit = false;
+            },
+            getOption() {
+                const opt = {
+                    code: selectServiceData.id,
+                    page: this.myPage,
+                    size: this.mySize,
+                };
+                return opt;
+            },
+            // 渲染页面
+            initPageData(listData) {
+                tableServiceData.myData = listData.data;
+                paginationServiceData.total = listData.total;
+            },
+            // 初始化页面
+            async initPageService() {
+                const loading = this.$loading({ background: 'rgba(0, 0, 0, 0.7)' });
+                try {
+                    // 新闻资讯列表
+                    const opt = this.getOption();
+                    const { code, data } = await HFGG.getBannerList(opt);
+                    loading.close();
+                    if (code === 0) {
+                        // 渲染页面
+                        this.initPageData(data);
+                    }
+                } catch (e) {
+                    loading.close();
+                }
+            },
+            clearPageData() {
+                selectServiceData.options = [];
+                selectServiceData.id = null;
+                tableServiceData.myData = [];
+                paginationServiceData.page = 1;
+                paginationServiceData.size = 10;
+                paginationServiceData.total = 0;
+            },
+            getAddImageUrl(url) {
+                this.addForm.pic = url;
+            },
+        },
+        created() {
+            const userAuth = comminUtil.getUserAuth();
+            this.userId = userAuth && userAuth.userId ? userAuth.userId : null;
+        },
+        mounted() {
+            this.initPageService();
+        },
+        beforeDestroy() {
+            this.clearPageData();
+
+        },
+    };
+</script>
+
+<style lang="scss" scoped>
+    .advertising-banner {
+        padding: 20px;
+
+        .top {
+            display: flex;
+            justify-content: space-between;
+            margin-bottom: 10px;
+
+            .btn-search {
+                margin-left: 20px;
+            }
+        }
+
+        .my-Pagination {
+            margin-top: 20px;
+        }
+
+        .add-dialog-content {
+            .el-select {
+                width: 100%;
+            }
+        }
+    }
+</style>

+ 1 - 1
src/views/management/XingWenZiXun/XinWenZiXunConfig/index.vue

@@ -69,7 +69,7 @@
 </template>
 
 <script>
-    import uploadFile           from './components/uploadFile';
+    import uploadFile           from '@/components/Admin/Common/uploadFile';
     import MtaStQuillEditor     from '@/components/management/QuillEditor.vue';
     import mySelect             from '../components/Select';
     import * as commonTools     from '@/utils/admin/tools';

+ 0 - 3
src/views/management/YouQingLianJie/index.vue

@@ -20,7 +20,6 @@
         <myTable
                 class="yqlj-table"
                 @editor="handleOpenEditor"
-                @delete="handleDelete"
                 @select-change="handleSelectChange" />
 
         <!--    分页    -->
@@ -224,9 +223,7 @@
                         const opt = this.getOption();
                         const myData = await YQLJService.getLinksList(opt);
                         this.initPageData(myData.data);
-                        loading.close();
                     }
-
                     loading.close();
                 } catch (e) {
                     loading.close();