Browse Source

修改bug

修改bug
dangyunlong 8 months ago
parent
commit
b00b69952a

+ 17 - 1
src/router/modules/zx.js

@@ -295,6 +295,22 @@ const zx= [
                 }
             }
         ]
-    }
+    },
+    {
+        path: '/NewPermission',
+        component: Layout,
+        children: [
+            {
+            name: '',
+            path: '',
+            component: () => import('@/views/news/NewPermission'),
+            meta: {
+                title: '网站权限',
+                hidden: true,
+                breadcrumb: true
+            }
+            }
+        ]
+    },
 ]
 export default zx

+ 0 - 1100
src/views/advertise/advertiseList - 副本.vue

@@ -1,1100 +0,0 @@
-<template>
-    <!-- 广告列表 -->
-    <div>
-        <!-- 提示信息 -->
-        <div class="tips">
-            <el-row>
-                <el-col :span="24">
-                    <i class="tipsIcon"></i>
-                    <span class="tipsText">24小时内,若运营没有操作用户的申请,则用户申请的时间、信息等将会释放。</span>
-                </el-col>
-            </el-row>
-        </div>
-        <!-- 头部搜索框部分 -->
-        <div class="title">
-            <el-row>
-                <el-col :span="6" class="left">
-                    <div class="searchBox">
-                        <div class="searchTitle">工单编号</div>
-                        <el-input class="input" v-model="order_code" clearable placeholder="请输入工单编号"></el-input>
-                    </div>
-                </el-col>
-
-                <el-col :span="6" class="left">
-                    <div class="searchBox">
-                        <div class="searchTitle">订单状态</div>
-                        <el-select v-model="order_status" clearable placeholder="请选择订单状态">
-                            <el-option v-for="item in order" :key="item.value" :label="item.label" :value="item.value">
-                            </el-option>
-                        </el-select>
-                    </div>
-                </el-col>
-
-                <el-col :span="6" class="left">
-                    <div class="searchBox">
-                        <div class="searchTitle">广告尺寸</div>xx
-                        <el-select v-model="advert_rule_model" clearable placeholder="请选择广告尺寸">
-                            <el-option v-for="item in advert_arr" :key="item.value" :label="item.label" :value="item.value">
-                            </el-option>
-                        </el-select>
-                    </div>xx
-                </el-col>
-
-
-
-                <el-col :span="8" class="right">
-                    <div class="btnList">
-                        <button class="search" @click="goSearch">搜索</button>
-                        <button class="reset" @click="goReset">重置</button>
-                    </div>
-                </el-col>
-            </el-row>
-        </div>
-        <!--表格内容 start------------------------------------------------------------>
-        <div class="layerBox">
-            <tableTitle :name="tableDivTitle" />
-            <el-row>
-                <template>
-                    <el-table class="my-table" :data="tableData" style="width: 100%">
-                        <el-table-column fixed prop="id" label="编号" width="80">
-                        </el-table-column>
-                        <el-table-column prop="order_num" label="工单编号" width="175">
-                        </el-table-column>
-                        <el-table-column prop="name" label="广告名称" width="160">
-                        </el-table-column>
-                        <el-table-column prop="orderStatus" label="订单状态" width="100">
-                        </el-table-column>
-                        <el-table-column prop="sttime" label="开始时间" width="">
-                        </el-table-column>
-                        <el-table-column prop="edtime" label="结束时间" width="">
-                        </el-table-column>
-                        <el-table-column prop="cttime" label="创建时间" width="">
-                        </el-table-column>
-                        <el-table-column prop="price" label="总金额" width="110">
-                        </el-table-column>
-                        <el-table-column fixed="right" label="操作" width="330">
-                            <template slot-scope="scope">
-                                <div class="listBtnBox">
-                                    <div class="listDeleteBtn" @click="deleteRow(scope.row.id)"><i
-                                            class="el-icon-delete"></i>删除</div>
-                                    <div class="listEditBtn" @click="goEdit(scope.row.id, scope.row)"><i
-                                            class="el-icon-edit-outline"></i>编辑</div>
-                                    <div class="listReviewBtn" @click="goReview(scope.row.id, scope.row)"><i
-                                            class="review"></i>审核</div>
-                                </div>
-                            </template>
-                        </el-table-column>
-                    </el-table>
-                </template>
-            </el-row>
-        </div>
-        <!--分页 start------------------------------------------------------------>
-        <div class="alignBox">
-            <el-row>
-                <el-col :span="24">
-                    <el-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange"
-                        :current-page="page" :page-size="pageSize" layout="total, prev, pager, next, jumper"
-                        :total="total">
-                    </el-pagination>
-                </el-col>
-            </el-row>
-        </div>
-        <!--分页 end------------------------------------------------------------>
-        <!--表格内容 end------------------------------------------------------------>
-
-        <!-- 弹出框 编辑 start----------------------------------------------------------->
-        <el-dialog :title="dialogName" :visible.sync="dialogTableVisible" width="56%" top="8vh">
-            <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm">
-                <div class="dialogText">
-                    <el-form-item label="广告名称:" prop="">
-                        <el-input v-model="ruleForm.name" disabled placeholder="请输入网站名称"></el-input>
-                    </el-form-item>
-                    <el-form-item label="广告网址:" prop="">
-                        <el-input v-model="ruleForm.ad_url" disabled placeholder="请输入网站名称"></el-input>
-                    </el-form-item>
-                    <el-form-item label="广告图:" prop="">
-                        <div class="adImage">
-                            <img :src="ruleForm.adImg" v-if="this.ruleForm.adImg" alt="">
-                            <img :src="'../../assets/advertise/404.png'" v-else-if="this.ruleForm.adImg = ''" alt="">
-                        </div>
-                    </el-form-item>
-                    <el-form-item label="持续时间:" prop="">
-                        <el-date-picker v-model="ruleForm.time" type="datetimerange" range-separator="至"
-                            start-placeholder="开始日期" end-placeholder="结束日期" format="yyyy-MM-dd HH:mm:ss"
-                            value-format="yyyy-MM-dd HH:mm:ss" :picker-options="startTimeOptions"
-                            @change="changeStartTime">
-                        </el-date-picker>
-                        <!-- <el-col :span="11">
-                            <el-date-picker v-model="ruleForm.startTime" type="datetime" placeholder="选择日期时间"
-                                format="yyyy-MM-dd HH:00:00" value-format="yyyy-MM-dd HH:00:00"
-                                :picker-options="startTimeOptions" @change="changeStartTime">
-                            </el-date-picker>
-                        </el-col>
-                        <el-col :span="2" class="zhi">
-                            至
-                        </el-col>
-                        <el-col :span="11">
-                            <el-date-picker v-model="ruleForm.endTime" type="datetime" placeholder="选择日期时间"
-                                format="yyyy-MM-dd HH:00:00" value-format="yyyy-MM-dd HH:00:00"
-                                :picker-options="endTimeOptions">
-                            </el-date-picker>
-                        </el-col> -->
-                    </el-form-item>
-                    <el-form-item label="广告尺寸:" prop="">xx
-                        <el-radio v-model="ruleForm.radio" v-for="(item,index) in adSizeList" :key="index" disabled :label=item.id>{{ item.width+'x'+item.height }}</el-radio>
-                    </el-form-item>
-
-                    <el-form-item label="价格:" prop="price">
-                        <div class="price">
-                            <el-col :span="6">
-                                <el-input v-model="ruleForm.price" placeholder="请输入价格"></el-input>
-                            </el-col>
-                            <el-col :span="2" class="zhi">
-                                元 x
-                            </el-col>
-                            <el-col :span="6">
-                                <el-input v-model="ruleForm.days" disabled placeholder="请输入天数"></el-input>
-                            </el-col>
-                            <el-col :span="2" class="zhi">
-                                天 x
-                            </el-col>
-                            <el-col :span="6">
-                                <el-input v-model="ruleForm.num" disabled placeholder="请输入个数"></el-input>
-                            </el-col>
-                            <el-col :span="2" class="zhi">
-                                个
-                            </el-col>
-                        </div>
-                    </el-form-item>
-                    <el-form-item label="广告位置:" prop="">
-                        <span class="example" @click="goGraph">查看示例图</span>
-                        <div>
-                            <el-button disabled v-for="item in ruleForm.adPlace" class="el_btnList">{{ item
-                            }}</el-button>
-                        </div>
-                    </el-form-item>
-                </div>
-                <div class="dialogBtn">
-                    <button class="cancel" @click="cancelForm">取消</button>
-                    <button class="submit" @click="submitForm">提交</button>
-                </div>
-            </el-form>
-        </el-dialog>
-        <!-- 弹出框 编辑 end----------------------------------------------------------->
-
-        <!-- 弹出框 广告位示例图 start----------------------------------------------------------->
-        <el-dialog title="广告位示例图" :visible.sync="dialogVisible" width="60%" top="10vh">
-            <div class="graph">
-                <el-carousel indicator-position="outside" autoplay loop>
-                    <el-carousel-item>
-                        <img src="../../assets/advertise/001.png" alt="" class="shilitu">
-                    </el-carousel-item>
-                    <el-carousel-item>
-                        <img src="../../assets/advertise/002.png" alt="" class="shilitu">
-                    </el-carousel-item>
-                </el-carousel>
-            </div>
-        </el-dialog>
-        <!-- 弹出框 广告位示例图 end----------------------------------------------------------->
-
-        <!-- 弹出框 审核 start----------------------------------------------------------->
-        <el-dialog title="审核状态" :visible.sync="dialogFormVisible" width="35%" top="25vh">
-            <template slot="title">
-                <div style="display: flex; align-items: center;">
-                    <span>审核状态</span>
-                    <span class="redTips">(确定后,审核状态不可再次更改.请确认好再审核)</span>
-                </div>
-            </template>
-            <el-form ref="form" :model="form" label-width="80px">
-                <div class="radioGroup">
-                    <el-radio-group v-model="status_radio">
-                        <el-radio :label="3">通过</el-radio>
-                        <el-radio :label="6">驳回</el-radio>
-                    </el-radio-group>
-                    <el-form-item v-show="this.status_radio == 6" label="驳回原因:" :label-width="formLabelWidth"
-                        prop="name">
-                        <el-input v-model="textarea" type="textarea" resize="none" :rows="3" placeholder="请输入内容">
-                        </el-input>
-                    </el-form-item>
-                </div>
-            </el-form>
-            <div slot="footer" class="dialog-footer">
-                <el-button @click="dialogFormVisible = false">取 消</el-button>
-                <el-button type="primary" @click="subimtStatus">确 定</el-button>
-            </div>
-        </el-dialog>
-        <!-- 弹出框 审核 end----------------------------------------------------------->
-    </div>
-
-</template>
-
-<script>
-//表格标题
-import tableTitle from './components/tableTitle.vue';
-
-//引入公用样式
-import '@/styles/global.less';
-import { getStatus, getOrderList, getOrderListAdmin, getOrderDetail, getOrderDetailAdmin, applyOrderStatusAdmin, editOrderAdmin, rejectOrderAdmin, endOrderAdmin, delOrderAdmin,getSize } from '@/api/advertise'
-export default {
-    components: {
-        tableTitle,//表格标题-
-    },
-    data() {
-        return {
-            tableDivTitle: "广告列表",  //列表标题
-            dialogTableVisible: false,      //编辑弹框
-            dialogName: '编辑', //编辑弹窗名称
-            dialogFormVisible: false,     //审核弹框
-            dialogVisible: false,  //示例图弹窗
-            form: {},  //审核状态的ref属性名称
-            tableData: [],//表格数据
-            ad_img: 'http://183.131.25.186:9501/image/20250102/1735810611310322.png', //广告图
-            // 搜索框相关
-            order_code: '', //工单编号 
-            order_status: '',//订单状态
-            order: [ //订单状态数据
-                {
-                    value: 1,
-                    label: '已通过'
-                },
-                {
-                    value: 2,
-                    label: '已驳回'
-                },
-                {
-                    value: 3,
-                    label: '已取消'
-                },
-                {
-                    value: 5,
-                    label: '已过期'
-                },
-                {
-                    value: 6,
-                    label: '待审核'
-                },
-                {
-                    value: 7,
-                    label: '已完成'
-                }
-            ],
-
-            advert_rule_model:"",    
-            advert_arr: [ //广告尺寸xx
-                {
-                    value: 1,
-                    label: '1已通过'
-                },
-                {
-                    value: 2,
-                    label: '2已驳回'
-                } 
-            ],
-
-
-            //活动id
-            activeid: "",
-            // 分页相关
-            page: 1,
-            pageSize: 10,
-            total: 0,
-            orderads: [],
-            // 审核弹窗相关
-            status_radio: "",   //审核状态
-            textarea: '',    //驳回原因
-            formLabelWidth: '',
-            adSizeList: '', //广告尺寸
-            ruleForm: {
-                name: '', //广告名称xx
-                ad_url: '', //广告网址
-                adImg: '', //广告图
-                radio: '',//广告尺寸
-                time: [], //持续时间
-                startTime: '', //开始时间
-                endTime: '',   //结束时间
-                price: '',  //价格
-                days: '',   //天数
-                num: '',   //个数
-                adPlace: [] //广告位
-            },
-            rules: {
-                name: [
-                    { required: true, message: '请输入网站名称', trigger: 'blur' },
-                ],
-                price: [
-                    { required: true, message: '请输入要修改的价格', trigger: 'change' }
-                ]
-            },
-            //时间选择器
-            //日期选择器方法
-            startTimeOptions: {
-                disabledDate(time) {
-                    return time.getTime() < Date.now() - 8.64e7; // 禁用今天之前的日期
-                }
-            },
-            endTimeOptions: {
-                disabledDate(time) {
-                    return time.getTime() < Date.now() - 8.64e7; // 禁用今天之前的日期
-                }
-            },
-        }
-    },
-    methods: {
-        //1.列表和分页相关 start ------------------------------------------------------------>
-        //1.1 开始请求列表信息方法
-        getData() {
-            if (this.order_code == '' || this.order_status == '') {
-
-                let data = new FormData()
-                data.append('page', this.page)
-                data.append('pageSize', this.pageSize)
-                data.append('status', this.order_status)
-                data.append('order_num', this.order_code)
-
-                getOrderListAdmin(data).then(data => {
-                    console.log(data);
-                    this.tableData = data.data.rows
-                    this.total = data.data.count1
-                    for (let item of this.tableData) {
-                        if (item.status == 1) {
-                            item.orderStatus = '已通过'
-                        } else if (item.status == 7) {
-                            item.orderStatus = '已完成'
-                        } else if (item.status == 2) {
-                            item.orderStatus = '已驳回'
-                        } else if (item.status == 3) {
-                            item.orderStatus = '已取消'
-                        } else if (item.status == 5) {
-                            item.orderStatus = '已过期'
-                        } else if (item.status == 6) {
-                            item.orderStatus = '待审核'
-                        }
-                    }
-                })
-            } else {
-
-                let data = new FormData()
-                data.append('page', this.page)
-                data.append('pageSize', this.pageSize)
-                console.log(data);
-                getOrderListAdmin(data).then(data => {
-                    console.log("getOrderListAdmin", data);
-                    this.tableData = data.data.rows
-                    this.total = data.data.count1
-                    for (let item of this.tableData) {
-                        if (item.status == 1) {
-                            item.orderStatus = '已通过'
-                        } else if (item.status == 7) {
-                            item.orderStatus = '已完成'
-                        } else if (item.status == 2) {
-                            item.orderStatus = '已驳回'
-                        } else if (item.status == 3) {
-                            item.orderStatus = '已取消'
-                        } else if (item.status == 5) {
-                            item.orderStatus = '已过期'
-                        } else if (item.status == 6) {
-                            item.orderStatus = '待审核'
-                        }
-                    }
-                })
-            }
-
-        },
-
-        //1.2 删除内容
-        deleteRow(id) {
-            console.log(id);
-            let data = new FormData()
-            data.append('id', id)
-
-            this.$confirm('注意:删除后,该条信息及其绑定关系全部删除', '是否确认删除该条信息?', {
-                confirmButtonText: '确定',
-                cancelButtonText: '取消',
-            }).then(() => {
-                console.log("当前删除:" + id)
-                let data = new FormData()
-                data.append('id', id)
-                console.log(data);
-
-                delOrderAdmin(data).then(data => {
-                    console.log(data);
-                    if (data.code == 0) {
-                        this.$message({
-                            message: data.message,
-                            type: 'error'
-                        })
-                    }
-                    if (data.code == 200) {
-                        this.$message({
-                            type: 'success',
-                            message: '删除成功!'
-                        });
-                    }
-                    this.getData()
-                })
-            }).catch(() => {
-                this.$message({
-                    type: 'warning',
-                    message: '已取消删除'
-                });
-            });
-        },
-        //1.3 查看示例图
-        goGraph() {
-            this.dialogVisible = true
-        },
-
-        //1.4 列表内容分页
-        //直接跳转
-        handleSizeChange(val) {
-            this.page = val;
-            this.getData();
-        },
-        //1.5 点击分页
-        handleCurrentChange(val) {
-            this.page = val;
-            this.getData();
-        },
-        // 1.6 搜索按钮xx
-        goSearch() {
-            console.log(this.status);
-
-            let data = new FormData()
-            data.append('page', this.page)
-            data.append('pageSize', this.pageSize)
-            data.append('status', this.order_status)
-            data.append('order_num', this.order_code)
-            console.log(data);
-
-            getOrderListAdmin(data).then(data => {
-                console.log(data);
-                this.tableData = data.data.rows
-                this.total = data.data.count1
-                for (let item of this.tableData) {
-                    if (item.status == 1) {
-                        item.orderStatus = '已通过'
-                    } else if (item.status == 7) {
-                        item.orderStatus = '已完成'
-                    } else if (item.status == 2) {
-                        item.orderStatus = '已驳回'
-                    } else if (item.status == 3) {
-                        item.orderStatus = '已取消'
-                    } else if (item.status == 5) {
-                        item.orderStatus = '已过期'
-                    } else if (item.status == 6) {
-                        item.orderStatus = '待审核'
-                    }
-                }
-            })
-        },
-        //1.7 重置按钮
-        goReset() {
-            this.order_code = ''
-            this.order_status = ''
-            this.page = 1
-            this.pageSize = 10
-            this.getData();
-        },
-        //列表和分页相关 end ------------------------------------------------------------>
-
-        //1.9 编辑
-        goEdit(id, val) {
-            console.log(id, val);
-            this.activeid = id
-            this.dialogTableVisible = true
-            this.ruleForm.name = val.name
-            if (val.width == 1200 && val.height == 90) {
-                this.ruleForm.radio = 1
-            } else if(val.width == 830 && val.height == 110) {
-                this.ruleForm.radio = 2
-            } else if(val.width == 450 && val.height == 290) {
-                this.ruleForm.radio = 3
-            }
-            this.ruleForm.startTime = val.sttime
-            this.ruleForm.endTime = val.edtime
-            this.ruleForm.days = val.days
-
-            let data = new FormData()
-            data.append('id', id)
-
-            //查看列表详情
-            getOrderDetailAdmin(data).then(data => {
-                // console.log('详情', data);
-                console.log('详情', data.data.ad[0]?.image_url);
-
-                this.ruleForm.ad_url = data.data.ad[0]?.image_url //广告链接
-                this.ruleForm.adImg = data.data.ad[0]?.image_src //广告图
-                this.ruleForm.num = data.data.ad.length //广告个数
-                this.ruleForm.price = val.price / val.days / this.ruleForm.num //广告价格
-                this.ruleForm.startTime = val.sttime//持续时间开始
-                this.ruleForm.endTime = val.edtime//持续时间结束
-                this.ruleForm.time = [val.sttime, val.edtime] //持续时间
-
-                let adPlace = data.data.ad
-
-                this.ruleForm.adPlace = []
-
-                for (let item of adPlace) {
-                    this.ruleForm.adPlace.push(item.ad_name)//广告位名称
-                }
-                console.log(this.ruleForm.adPlace);
-            })
-        },
-
-        //2.0 审核
-        goReview(id, val) {
-            this.activeid = id
-            this.activeid = id
-            if (val.status != 6) {
-                this.$message({
-                    message: '该广告已经审核,不能再次审核',
-                    type: 'warning'
-                })
-                this.dialogFormVisible = false
-            } else {
-                this.dialogFormVisible = true
-            }
-        },
-
-        //审核中的确定
-        subimtStatus() {
-            if (this.status_radio == '3') {
-                let data = new FormData()
-                data.append('id', this.activeid)
-                applyOrderStatusAdmin(data).then(data => {
-                    console.log(data);
-                    if (data.code == 200) {
-                        this.$message({
-                            message: '已修改审核状态',
-                            type: 'success'
-                        })
-                        this.dialogFormVisible = false
-                        this.getData()
-                    }
-                    if (data.code == 0) {
-                        this.$message({
-                            message: data.message,
-                            type: 'error'
-                        })
-                    }
-                })
-            }
-            if (this.status_radio == '6') {
-                let data = new FormData()
-                data.append('id', this.activeid)
-                data.append('reason', this.textarea)
-                rejectOrderAdmin(data).then(data => {
-                    console.log(data);
-                    if (data.code == 200) {
-                        this.$message({
-                            message: '修改成功',
-                            type: 'success'
-                        })
-                        this.dialogFormVisible = false
-                        this.getData()
-                    }
-                    if (data.code == 0) {
-                        this.$message({
-                            message: data.message,
-                            type: 'error'
-                        })
-                    }
-                })
-            }
-
-        },
-        // 弹出层相关方法
-        // 提交表单
-        submitForm() {
-            let total = this.ruleForm.price * this.ruleForm.days * this.ruleForm.num
-            let data = new FormData()
-            data.append('id', this.activeid)
-            data.append('price', total.toFixed(2))
-            data.append('sttime', this.ruleForm.startTime)
-            data.append('edtime', this.ruleForm.endTime)
-            editOrderAdmin(data).then(data => {
-                console.log(data);
-                if (data.code == 200) {
-                    this.dialogTableVisible = false
-                    this.$message({
-                        message: '修改成功',
-                        type: 'success'
-                    })
-                    this.getData()
-                }
-                if (data.code == 0) {
-                    this.$message({
-                        message: data.message,// + ',需要保留两位小数',
-                        type: 'error'
-                    })
-                }
-            })
-        },
-        //获取天数
-        getDays() {
-            let total = this.ruleForm.price * this.ruleForm.days * this.ruleForm.num
-            let data = new FormData()
-            data.append('id', this.activeid)
-            data.append('price', total.toFixed(2))
-            data.append('sttime', this.ruleForm.startTime)
-            data.append('edtime', this.ruleForm.endTime)
-            editOrderAdmin(data).then(data => {
-                console.log(data);
-                // if (data.code == 200) {
-                //     // this.dialogTableVisible = false
-                //     this.$message({
-                //         message: '修改成功',
-                //         type: 'success'
-                //     })
-                //     this.getData()
-                // }
-                // if (data.code == 0) {
-                //     this.$message({
-                //         message: data.message,// + ',需要保留两位小数',
-                //         type: 'error'
-                //     })
-                // }
-            })
-        },
-        //取消添加或编辑
-        cancelForm() {
-            this.dialogTableVisible = false
-        },
-        // 时间选择器相关方法
-        changeStartTime(val) {
-            // console.log('1111111111111111111', val);
-
-            // 先格式化传入的时间,选择的时间为下一个整数小时 0 分 0 秒
-            let time1 = new Date(new Date(val[0]).setMinutes(0, 0, 0) + 60 * 60 * 1000).getTime();
-            let time2 = new Date(new Date(val[1]).setMinutes(0, 0, 0) + 60 * 60 * 1000).getTime();
-            // 同样的道理,获取当前时间的下一个整数小时 0 分 0 秒
-            let currentTimestamp = new Date(new Date().setMinutes(0, 0, 0) + 60 * 60 * 1000).getTime();
-
-            if (time1 < currentTimestamp) {
-                this.$message.error('时间选择错误,已为您自动重设!');
-                // 第一步,将时间戳转换为本地时间
-                let localTime = new Date(currentTimestamp).toLocaleString('zh-CN', {
-                    year: 'numeric',
-                    month: '2-digit',
-                    day: '2-digit',
-                    hour: '2-digit',
-                    minute: '2-digit',
-                    second: '2-digit'
-                }).replace(/\//g, '-');
-                // 第二步,将当前时间加 24 小时
-                let twoHoursLocalTime = new Date(currentTimestamp + 24 * 60 * 60 * 1000).toLocaleString('zh-CN', {
-                    year: 'numeric',
-                    month: '2-digit',
-                    day: '2-digit',
-                    hour: '2-digit',
-                    minute: '2-digit',
-                    second: '2-digit'
-                }).replace(/\//g, '-');
-
-                // 第三步,将当前时间赋值给 ruleForm.time[0]
-
-                this.ruleForm.time[0] = localTime;
-                this.ruleForm.time[1] = twoHoursLocalTime;
-                this.ruleForm.startTime = localTime;
-                this.ruleForm.endTime = twoHoursLocalTime;
-
-                const time1 = new Date(this.ruleForm.endTime);
-                const time2 = new Date(this.ruleForm.startTime);
-                const diff = time1.getTime() - time2.getTime();
-                this.ruleForm.days = diff / (1000 * 60 * 60 * 24);
-
-
-            } else {
-                // 第二种情况,传入的时间戳大于当前时间
-                // 但是时间间隔小于 24 小时
-                if (time2 - time1 < 24 * 60 * 60 * 1000) {
-                    this.$message.error('广告持续时间不得低于 24 小时,已为您自动重设!');
-                    // 第一步,将时间戳转换为本地时间
-                    let localTime = new Date(currentTimestamp).toLocaleString('zh-CN', {
-                        year: 'numeric',
-                        month: '2-digit',
-                        day: '2-digit',
-                        hour: '2-digit',
-                        minute: '2-digit',
-                        second: '2-digit'
-                    }).replace(/\//g, '-');
-                    // 第二步,将当前时间加 24 小时
-                    let twoHoursLocalTime = new Date(currentTimestamp + 24 * 60 * 60 * 1000).toLocaleString('zh-CN', {
-                        year: 'numeric',
-                        month: '2-digit',
-                        day: '2-digit',
-                        hour: '2-digit',
-                        minute: '2-digit',
-                        second: '2-digit'
-                    }).replace(/\//g, '-');
-
-
-                    // 第三步,将当前时间赋值给 ruleForm.time[0]
-                    this.ruleForm.time[0] = localTime;
-                    this.ruleForm.time[1] = twoHoursLocalTime;
-                    this.ruleForm.startTime = localTime;
-                    this.ruleForm.endTime = twoHoursLocalTime;
-
-                    const time1 = new Date(this.ruleForm.endTime);
-                    const time2 = new Date(this.ruleForm.startTime);
-                    const diff = time1.getTime() - time2.getTime();
-                    this.ruleForm.days = diff / (1000 * 60 * 60 * 24);
-
-                } else {
-                    // 第三种情况,用户时间选择正确,无需操作
-                    this.ruleForm.startTime = val[0];
-                    this.ruleForm.endTime = val[1];
-
-                    const time1 = new Date(this.ruleForm.endTime);
-                    const time2 = new Date(this.ruleForm.startTime);
-                    const diff = time1.getTime() - time2.getTime();
-                    this.ruleForm.days = diff / (1000 * 60 * 60 * 24);
-
-                }
-            }
-
-            // 第四种情况,使广告立即生效,请注释上面的 if 直接使用下面这一段
-            // this.ruleForm.startTime = val[0];
-            // this.ruleForm.endTime = val[1];
-            // // 获取广告尺寸
-            // this.getAdSize();
-            // // 创建购物车
-            // axios.post("/order/addShoppingCart").then(response => {
-            //   // console.log("创建购物车", response.data);
-            //   this.shopCode = response.data;
-            //   console.log('shopCode', this.shopCode);
-            // });
-        },
-        getAdSize() {
-
-            getSize().then(res => {
-            //     console.log("广告尺寸==", res.data);
-                this.adSizeList = res.data;
-                 
-                for(let item of this.adSizeList){
-                      ad_size=item.width+'x'+item.height;
-                } 
-            })
-        },
-
-        getAdSize_2() {//xx
-            getSize().then(res => {
-            //     console.log("广告尺寸==", res.data);
-                this.advert_arr = res.data;
-                console.log("this.advert_arr===1", this.advert_arr)  
-                for(var i=0;i<this.advert_arr.length;i++){
-                        this.advert_arr[i]={value:i,label:this.advert_arr[i].width+'x'+this.advert_arr[i].height}
-                        console.log("this.advert_arr===2",this.advert_arr[i])
-                   
-                } 
-                 
-            })}
-
-    },
-    mounted() {
-        this.getAdSize()
-        this.getAdSize_2()
-        this.getData()
-    },
-}
-</script>
-
-<style scoped lang="less">
-.redTips {
-    color: red;
-    display: inline-block;
-    margin-left: 20px;
-    font-size: 14px;
-}
-
-// 提示信息
-.tips {
-    margin: 30px;
-    background-color: #e9ecf9;
-    border-radius: 11px;
-
-    .tipsIcon {
-        margin: 10px 15px;
-        display: inline-block;
-        width: 24px;
-        height: 24px;
-        background: url("../../assets/advertise/Info Circle.png") no-repeat;
-        vertical-align: middle;
-    }
-
-    .tipsText {
-        font-size: 14px;
-        color: #666666;
-    }
-}
-
-// 头部
-.title {
-    margin: 30px 30px 20px 30px;
-    padding: 30px 30px 40px 30px;
-    background-color: #fff;
-    border-radius: 20px 20px 20px 20px;
-    border: 1px solid #E9EDF7;
-
-    .left {
-        float: left;
-    }
-
-    .right {
-        float: right;
-    }
-
-
-    .searchBox {
-        ::v-deep .el-input {
-            position: relative;
-            font-size: 14px;
-            display: inline-block;
-            width: 90%;
-        }
-
-        .searchTitle {
-            padding-bottom: 10px;
-            font-family: Microsoft YaHei, Microsoft YaHei;
-            font-weight: 400;
-            font-size: 14px;
-            color: #999999;
-            line-height: 16px;
-        }
-
-        .el-select {
-            width: 100%;
-            display: inline-block;
-            position: relative;
-        }
-    }
-
-
-    .btnList {
-        float: right;
-        padding-top: 28px;
-
-        button {
-            height: 38px;
-            border: none;
-            border-radius: 8px;
-            padding: 0 20px;
-        }
-
-        .search {
-            background-color: #5570f1;
-            color: #fff;
-            margin-right: 20px;
-        }
-
-        .reset {
-            font-family: Microsoft YaHei, Microsoft YaHei;
-            font-weight: 400;
-            font-size: 16px;
-            color: #333333;
-            background: #F5F7FB;
-            border-radius: 8px 8px 8px 8px;
-            border: 1px solid rgba(85, 112, 241, 0.11);
-        }
-    }
-}
-
-.layerBox {
-    padding: 30px 20px;
-    position: relative;
-
-    .btn {
-        position: absolute;
-        top: 30px;
-        right: 20px;
-        height: 38px;
-        color: #fff;
-        background-color: #5570f1;
-        border: none;
-        border-radius: 8px;
-        padding: 8px 28px 9px;
-        box-sizing: border-box;
-    }
-
-    .listBtnBox {
-        justify-content: left;
-    }
-
-
-    .listDeleteBtn,
-    .listEditBtn,
-    .listReviewBtn {
-        margin-left: 0px;
-        padding-left: 0px;
-        margin-right: 20px;
-        width: 76px;
-        height: 36px;
-        line-height: 36px;
-    }
-
-
-    .listReviewBtn {
-        text-align: center;
-        border-radius: 8px;
-        cursor: pointer;
-        color: #519C66;
-        background-color: rgba(81, 156, 102, 0.16);
-
-        >.review {
-            display: inline-block;
-            width: 20px;
-            height: 20px;
-            background: url("../../assets/advertise/Shield.png");
-            margin-right: 6px;
-            vertical-align: -6px;
-        }
-    }
-
-    ::v-deep .el-form-item {
-        margin-bottom: 50px;
-    }
-
-    ::v-deep .el-select {
-        width: 100%;
-    }
-
-    ::v-deep .el-input--medium,
-    ::v-deep .el-form-item__label {
-        line-height: 36px;
-        font-size: 16px;
-    }
-}
-
-// 弹出层内容
-.dialogText {
-    margin: 0 7px 0 3px;
-    padding-bottom: 1px;
-    padding: 0px 60px 1px 20px;
-
-    .zhi {
-        text-align: center;
-    }
-
-    .adImage {
-        width: 140px;
-        height: 140px;overflow:hidden;
-        // line-height: 210px;
-        border-radius: 12px;
-        border: 1px solid rgba(85, 112, 241, 0.11);
-
-        img {
-            display:block;
-            height:100%;width:100%;
-
-            //width: 140px;
-            // height: 80px;
-        }
-    }
-
-    // .price {
-    //     ::v-deep .el-input {
-    //         width: 29%;
-    //     }
-    // }
-
-    .example {
-        font-family: Microsoft YaHei;
-        color: #5570F1;
-    }
-
-    .el_btnList {
-        margin-right: 15px;
-        margin-top: 20px;
-    }
-
-    //日期时间选择器的宽
-    ::v-deep .el-date-editor.el-input {
-        width: 100%;
-    }
-
-    ::v-deep .el-button+.el-button {
-        margin-left: 0px;
-    }
-
-    ::v-deep .el-range-editor.el-input__inner {
-        width: 100%;
-    }
-}
-
-// 弹出层按钮
-.dialogBtn {
-    text-align: center;
-    margin: 50px auto 20px;
-
-    button {
-        width: 184px;
-        padding: 16px;
-        font-family: Microsoft YaHei, Microsoft YaHei;
-        font-weight: 400;
-        font-size: 20px;
-        border: none;
-        border-radius: 12px 12px 12px 12px;
-    }
-
-    // 取消
-    .cancel {
-        color: #333333;
-        background-color: #f5f7fb;
-        border: 2px solid rgba(85, 112, 241, 0.11);
-    }
-
-    // 提交
-    .submit {
-        color: #fff;
-        background-color: #5570F1;
-        margin-left: 40px;
-    }
-}
-
-//审核弹出框
-.radioGroup {
-    ::v-deep .el-form-item {
-        margin-top: 40px;
-        margin-bottom: 0;
-    }
-}
-
-.graph {
-    width: 100%;
-    margin: 0 auto;
-    overflow: hidden;
-
-    .shilitu {
-        width: 100%;
-        height: 600px;
-        z-index: 100000;
-    }
-
-}
-
-
-::v-deep .el-carousel__container {
-    position: relative;
-    height: 600px;
-}
-
-/* 自定义指示器样式 */
-::v-deep .el-carousel__indicators .el-carousel__indicator button {
-    width: 12px;
-    /* 宽度 */
-    height: 12px;
-    /* 高度 */
-    border-radius: 50%;
-    /* 圆形 */
-}
-
-/* 可选:更改当前项指示器的颜色 */
-::v-deep .el-carousel__indicators .el-carousel__indicator.is-active button {
-    background-color: #33b023;
-    /* 当前项颜色 */
-}
-
-.dialog-footer {
-    margin: 0 auto;
-}
-</style>

+ 14 - 6
src/views/news/NewList.vue

@@ -44,7 +44,6 @@
         </el-row>
       </div>
     </div>
-
     <div class="layerBoxNoBg">
       <div>
         <el-button type="primary" @click="goCreat">发布资讯</el-button>
@@ -369,12 +368,12 @@ export default {
     //3.编辑新闻 start ------------------------------------------------------------>
     //3.1 打开反选窗口
     selectRow(cid, row) {
-      console.log(row)
-      this.selectStatusWindow = true;
+      //console.log(row)
+      //this.selectStatusWindow = true;
       //给与编辑的id
-      this.editId = row.id;
+      //this.editId = row.id;
       //给与编辑的状态
-      this.editStatus = row.status;
+      //this.editStatus = row.status;
       //把cid转换成数组,然后取出最后一位
 
       let cidLast = "";
@@ -385,7 +384,16 @@ export default {
       } else {
         cidLast = cid[cid.length - 1];
       }
-      this.getWebsiteNavPoolSite(cidLast, row)
+      //this.getWebsiteNavPoolSite(cidLast, row)
+      //跳转到新页面进行编辑
+      this.$router.push({
+        path: '/NewPermission',
+        query: {
+          id: row.id,
+          cid: cidLast,
+          status : row.status
+        }
+      })
     },
     //3.2 获取可选网站列表
     getWebsiteNavPoolSite(cid, row) {

+ 368 - 0
src/views/news/NewPermission.vue

@@ -0,0 +1,368 @@
+<template>
+    <div class="mainBox">
+        <!--搜索功能 start------------------------------------------------------------>
+        <div class="layerBox_search">
+        <div class="layerBoxLine">
+            <el-row>
+            <el-col :span="8">
+                <div class="searchBox">
+                <div class="searchTitle">网站名称:</div>
+                <el-input placeholder="请输入网站名称" autocomplete="off" v-model="getApiData.title" />
+                </div>
+            </el-col>
+            <el-col :span="15">
+                <div class="tag_webSite_head_btn_box">
+                    <div class="searchTitle">标识组名称:</div>
+                    <el-button @click="clearSearchList">重置</el-button>
+                    <el-button type="primary" @click="getData('search')">搜索</el-button>
+                </div>
+            </el-col>
+            </el-row>
+        </div>
+        </div>
+        <!--搜索功能 end------------------------------------------------------------>
+        <!--表格内容 start------------------------------------------------------------>
+        <div class="layerBox">
+            <tableTitle :name="tableDivTitle" />
+            <el-row>
+                <el-table 
+                    v-loading="loading" 
+                    ref="multipleTable" 
+                    :data="webSiteData" 
+                    tooltip-effect="dark"
+                    style="width: 100%" 
+                    @selection-change="handleSelectionChange"
+                >
+                    <el-table-column type="selection" width="55"></el-table-column>
+                    <el-table-column prop="website_id" label="网站id"></el-table-column>
+                    <el-table-column prop="website_name" label="网站名称"></el-table-column>
+                    <el-table-column prop="c_show_time" label="C端展示时间"></el-table-column>
+                </el-table>
+            </el-row>
+        </div>
+        <div class="layerButtonBox">
+            <el-button @click="goBack">取消</el-button>
+            <el-button type="primary" @click="selectWebSiteToServe">确定</el-button>
+        </div>
+        <!--表格内容 end------------------------------------------------------------>
+    </div>
+</template>
+
+<script>
+//表格标题
+import tableTitle from './components/tableTitle';
+//引入公用样式
+import '@/styles/global.less';
+//获得用户身份
+import { getUseType, getWebSiteId } from '@/utils/auth'
+
+export default {
+    components: {
+        tableTitle,//表格标题
+    },
+    data() {
+        return {
+            //1.列表和分页相关 start ------------------------------------------------------------>
+            tableDivTitle: "网站权限",
+            tableData: [],//内容
+            webSiteData: [],//可选网站列表
+            creatNews_user_type: 0,//用户类型
+            //选择要发布的网站
+            webSiteForm: {
+                ignore_ids: []
+            },
+            ids: [],//待选网站列表
+            loading: false,//loading
+            editId: 0,//要修改的网站id
+            selectStatusWindow: false,//反选窗口
+            getApiData: {
+                id: "",//id
+                title: "",//标题
+                category_name: "",//导航池id
+                author: "",//作者
+                islink: "",//是否使用外链
+                status: 1,//资讯状态
+                page: 1,//当前是第几页
+                pageSize: 10,//一共多少条
+            },
+            editStatus: 0,//信息状态
+            allCount: 0,//总条数
+            webSiteId: getWebSiteId(),//当前网站id
+            userId: '',
+            //分页相关 end ------------------------------------------------------------>
+        }
+    },
+    methods: {
+        //1.列表和分页相关 start ------------------------------------------------------------>
+        //1.1 开始请求列表信息方法
+        getData(type) {
+            if (type == "search") {
+                this.getApiData.page = 1;
+            }
+            this.$store.dispatch('news/getArticleList', this.getApiData).then(res => {
+                //格式化:islink=0为不使用外面 islink=1为使用外链
+                //status=1为显示 status=2为不显示
+                let data = [];
+                for (let item of res.data.rows) {
+                    // if(item.status==0){item.status="隐藏"}
+                    // if(item.status==1){item.status="显示"}
+                    // if(item.status==404){item.status="已删除"}
+                    if (item.islink == 0) { item.islink = "否" }
+                    if (item.islink == 1) { item.islink = "是" }
+                    item.alias = item.website_category.alias;
+                }
+                console.log(data)
+                this.tableData = res.data.rows; //给与内容
+                this.allCount = res.data.count; //给与总条数
+            }).catch(() => {
+                this.$message({
+                type: 'warning',
+                message: '网络错误,请重试!'
+                });
+            })
+        },
+        getUserInfo() {
+            this.$store.dispatch('userMember/getUserInfo').then(res => {
+                this.userId = res.data.id;
+            })
+        },
+        //1.2 删除内容
+        deleteRow(id) {
+            this.$confirm('此操作将永久删除该条数据, 是否继续?', '提示', {
+                confirmButtonText: '确定',
+                cancelButtonText: '取消',
+                type: 'warning'
+            }).then(() => {
+                console.log("当前删除:" + id)
+                this.$store.dispatch('news/delArticle', { id: id }).then(res => {
+                    this.getData();
+                    this.$message({
+                        type: 'success',
+                        message: '删除成功!'
+                    });
+                }).catch(() => {
+                    this.$message({
+                        type: 'warning',
+                        message: '网络错误,请重试!'
+                    });
+                })
+            }).catch(() => {
+                this.$message({
+                    type: 'warning',
+                    message: '已取消删除'
+                });
+            });
+        },
+        //1.3 修改网站状态
+        upRow(id, status) {
+            let data = {
+                id: id,
+                status: status
+            }
+            this.$store.dispatch('news/upArticleStatus', data).then(res => {
+                if (res.code == 200) {
+                this.$message({
+                    type: 'success',
+                    message: '资讯状态已修改!'
+                });
+                }
+            }).catch(() => {
+                this.$message({
+                type: 'warning',
+                message: '已取消删除'
+                });
+            });
+        },
+        //1.4 列表内容分页
+        //直接跳转
+        handleSizeChange(val) {
+            this.getApiData.page = val;
+            this.getData();
+        },
+        //1.5 点击分页
+        handleCurrentChange(val) {
+            this.getApiData.page = val;
+            this.getData();
+        },
+        //1.6 重置按钮
+        clearSearchList() {
+            this.tableData = [];
+            this.getApiData.id = "";
+            this.getApiData.title = "";
+            this.getApiData.category_name = "";
+            this.getApiData.author = "";
+            this.getApiData.islink = "";
+            this.getApiData.status = "";
+            this.getApiData.page = 1;
+            this.getApiData.pageSize = 10;
+            this.getData();
+        },
+        //列表和分页相关 end ------------------------------------------------------------>
+        //2.添加新闻 start ------------------------------------------------------------>
+        //跳转到资讯发布页面
+        goBack() {
+            this.$router.push({
+                path: '/articleList',
+            });
+        },
+        //添加新闻 end ------------------------------------------------------------>
+        //3.编辑新闻 start ------------------------------------------------------------>
+        //3.1 打开反选窗口
+        selectRow(cid, row) {
+            //this.selectStatusWindow = true;
+            //给与编辑的id
+            this.editId = row.id;
+            //给与编辑的状态
+            this.editStatus = parseInt(this.$route.query.status);
+            //把cid转换成数组,然后取出最后一位
+            let cidLast = cid;
+            // 判断cid是否为数组
+            //   if (!Array.isArray(cid)) {
+            //     let cidArr = cid.replace(/[\[\]]/g, '').split(',');
+            //     cidLast = cidArr[cidArr.length - 1];
+            //   } else {
+            //     cidLast = cid[cid.length - 1];
+            //   }
+            this.getWebsiteNavPoolSite(cidLast, row)
+        },
+        //3.2 获取可选网站列表
+        getWebsiteNavPoolSite(cid, row) {
+            console.log('cid and row', cid, row);
+            this.loading = true;
+            let ignoreIds = JSON.parse(row.ignore_ids);
+            this.webSiteData = [];
+            this.$store.dispatch('news/getWebsiteNavPoolSite', { category_id: cid, article_id: row.id }).then(res => {
+                //this.webSiteData = res.data;
+                for (let item of res.data) {
+                    if (item.website_name != null) {
+                        this.webSiteData.push(item)
+                    }
+                }
+            //延迟一会返显,否则可能显示不了
+                if (res.data.length > 0 && ignoreIds != null) {
+                    setTimeout(() => {
+                        for (let index in this.webSiteData) {
+                            if (ignoreIds.includes(this.webSiteData[index].website_id)) {
+                                //调用回显方法
+                                this.toggleSelection([this.webSiteData[index]])
+                            }
+                        }
+                        this.loading = false;
+                    }, 500)
+                } else {
+                    this.loading = false;
+                }
+            })
+        },
+        //3.3 回显 选中的方法 
+        toggleSelection(rows) {
+            console.log(rows)
+            if (rows) {
+                rows.forEach(row => {
+                    this.$refs.multipleTable.toggleRowSelection(row);
+                });
+            } else {
+                this.$refs.multipleTable.clearSelection();
+            }
+        },
+        //3.4 把选择的网站保存到待选择的网站列表
+        handleSelectionChange(val) {
+            console.log(val)
+            this.ids = val;
+        },
+        //3.5 提交选择的网站列表
+        selectWebSiteToServe() {
+            let id = this.$route.query.id;
+            let ids = [];
+            for (let item of this.ids) {
+                ids.push(item.website_id)
+            }
+            //把数组转换为字符串
+            //let idsStr = ids.join(',');
+            //把数组转换为字符串
+            let idsStr = JSON.stringify(ids);
+
+            if (idsStr.length == 0) {
+                this.$message.error("至少需要选择一个网站!")
+                return;
+            } else {
+                let data = {
+                    id: id,
+                    ignore_ids: idsStr,
+                    status: this.editStatus
+                }
+                this.$store.dispatch('news/upArticleStatus', data).then(res => {
+                    console.log(res)
+                    if (res.code == 200) {
+                        this.$message.success('资讯绑定网站成功!');
+                        //this.selectStatusWindow = false;
+                        //this.getData();
+                        this.goBack();
+                    } else {
+                        this.$message.error(res.data.msg)
+                    }
+                })
+            }
+        },
+        //3.6 撤回审核
+        returnRow(id) {
+            this.$confirm('确定要撤回吗?', '提示', {
+                confirmButtonText: '撤回',
+                cancelButtonText: '取消',
+                type: 'warning'
+            }).then(() => {
+                //撤回,把文章状态修改为0,重新进行审核
+                this.upRow(id, 0)
+            })
+        },
+        //3.5 修改文章状态
+        upRow(id, status) {
+            let data = {
+                id: id,
+                status: status
+            }
+            this.$store.dispatch('news/upArticleStatus', data).then(res => {
+                if (res.code == 200) {
+                    this.$message({
+                        type: 'success',
+                        message: '操作成功!'
+                    });
+                    this.getData();
+                }
+            })
+        },
+        //3.编辑新闻 end ------------------------------------------------------------>
+    },
+    mounted() {
+        // this.creatNews_user_type = getUseType()
+        // //1.获得初始数据
+        // this.getData();
+        // //2.获得用户信息
+        // this.getUserInfo();
+        let row = {
+            id: this.$route.query.id,
+            ignore_ids: null
+        }
+        let cid = this.$route.query.cid;
+        this.selectRow(cid,row);
+    }
+}
+</script>
+
+<style scoped lang="less">
+.titleWidth {
+    width: 350px;
+    white-space: nowrap;
+    overflow: hidden;
+    text-overflow: ellipsis;
+}
+.tag_webSite_head_btn_box {
+    text-align: right;
+    .searchTitle {
+        opacity: 0;
+    }
+}
+.layerButtonBox {
+    text-align: center;
+}
+</style>

+ 115 - 120
src/views/news/creatNews.vue

@@ -601,128 +601,123 @@ export default {
     },
     //1.2 提交表单
     addToServe() {
-      //判断是否为外链
-      if (this.form.islink == false) {
-        if (this.form.is_survey == 1) {
-          const hasEmptyInput = this.inputList.some(input => input.value === '');
-          if (hasEmptyInput) {
-            // 如果有输入框为空,弹出提示信息
-            this.$message.error('请确保所有输入框都有内容');
-            return;
-          }
-          const inputLists = this.inputList.map(input => input.value);
-          const allowList = [this.checked ? 1 : 0, ""];
-          if (this.checked) {
-            inputLists.push(allowList);
-          }
-          if (inputLists.length < 2) {
-            this.$message.error('投票选项不少于2条');
-            return;
-          }
-          this.form.suvey_array = JSON.stringify(inputLists);
-        }
-      }
-      if (this.form.islink == true) {
-        this.form.islink = 1;
-        this.cleatForm(1)
-      } else {
-        this.form.islink = 0;
-      }
-      //取出行政职能和行政区划数组的最后一个数字
-      if (this.form.department_arr_id == "[]" || this.form.department_arr_id == null) {
-        this.form.department_arr_id = '[]'
-        this.form.department_id = 0;
-      } else {
-        if (JSON.parse(this.form.department_arr_id.length == 0)) {
-          this.form.department_id = 0;
-        } else {
-          this.form.department_id = this.form.department_arr_id[this.form.department_arr_id.length - 1];
-        }
-        this.form.department_arr_id = JSON.stringify(this.form.department_arr_id);
-
-      }
-      if (this.form.city_arr_id == "[]" || this.form.city_arr_id == null) {
-        this.form.city_arr_id = '[]'
-        this.form.city_id = 0;
-      } else {
-        if (JSON.parse(this.form.city_arr_id.length == 0)) {
-          this.form.city_id = 0;
-        } else {
-          this.form.city_id = this.form.city_arr_id[this.form.city_arr_id.length - 1];
-        }
-        this.form.city_arr_id = JSON.stringify(this.form.city_arr_id);
-      }
-
-      //判断用户身份
-      if (this.creatNews_user_type == 10000) {
-        console.log("用户身份为管理员,无需审核直接发布!")
-        this.form.status = 1;
-        this.form.web_site_id = this.form.web_site_id ? this.form.web_site_id : this.websiteid;
-      } else {
-        console.log("用户身份为其他用户,提交到审核!")
-        this.form.status = 0;
-        this.form.web_site_id = this.websiteid;
-        //如果是普通用户 推荐等级设置为0 
-        this.form.level = "[0]";
-      }
-
-      //先进行验证
-      // console.log( "this.form==", this.form);
-
-      this.$refs.form.validate(valid => {
-        if (valid) {
-          //如果推荐等级为空,则设置为0
-          if (this.form.level == "" || this.form.level == "[0]") {
-            this.form.level = "[0]";
-          } else {
-            this.form.level = JSON.stringify(this.form.level);
-          }
-          //console.log(this.form)
-          const formData = { ...this.form };
-          if (formData.commend_id != undefined && formData.commend_id.length > 0) {
-            formData.commend_id = JSON.stringify(formData.commend_id); // 提取推荐ID
-          }
-          if (formData.commend_id.length == 0) {
-            formData.commend_id = '[]';
-          }
-
-          this.$store.dispatch('news/addArticle', formData).then(res => {//
-            if (res.code == 200) {
-              console.log("资讯发布成功!200")
-              //汇报结果
-              if (this.creatNews_user_type == 10000) {
-                this.$message({
-                  type: 'success',
-                  message: '已成功添加资讯!'
-                });
-                this.cleatForm(2);
-                //返回列表页
-                this.returnPage()
-              } else {
-                this.$message({
-                  type: 'success',
-                  message: '待管理员审核!'
-                });
-                this.cleatForm(2);
-                //返回列表页
-                this.returnPage()
-              }
-            } else {
-              this.$message({
-                type: 'error',
-                message: res.message
-              });
-
+        this.$refs.form.validate(valid => {
+            if (valid) {
+                //判断是否为外链
+                if (this.form.islink == false) {
+                    if (this.form.is_survey == 1) {
+                        const hasEmptyInput = this.inputList.some(input => input.value === '');
+                        if (hasEmptyInput) {
+                            // 如果有输入框为空,弹出提示信息
+                            this.$message.error('请确保所有输入框都有内容');
+                            return;
+                        }
+                        const inputLists = this.inputList.map(input => input.value);
+                        const allowList = [this.checked ? 1 : 0, ""];
+                        if (this.checked) {
+                            inputLists.push(allowList);
+                        }
+                        if (inputLists.length < 2) {
+                            this.$message.error('投票选项不少于2条');
+                            return;
+                        }
+                        this.form.suvey_array = JSON.stringify(inputLists);
+                    }
+                }
+                if (this.form.islink == true) {
+                    this.form.islink = 1;
+                    this.cleatForm(1)
+                } else {
+                    this.form.islink = 0;
+                }
+                //取出行政职能和行政区划数组的最后一个数字
+                if (this.form.department_arr_id == "[]" || this.form.department_arr_id == null) {
+                    this.form.department_arr_id = '[]'
+                    this.form.department_id = 0;
+                } else {
+                    if (JSON.parse(this.form.department_arr_id.length == 0)) {
+                        this.form.department_id = 0;
+                    } else {
+                        this.form.department_id = this.form.department_arr_id[this.form.department_arr_id.length - 1];
+                    }
+                    this.form.department_arr_id = JSON.stringify(this.form.department_arr_id);
+                }
+                if (this.form.city_arr_id == "[]" || this.form.city_arr_id == null) {
+                    this.form.city_arr_id = '[]'
+                    this.form.city_id = 0;
+                } else {
+                    if (JSON.parse(this.form.city_arr_id.length == 0)) {
+                        this.form.city_id = 0;
+                    } else {
+                        this.form.city_id = this.form.city_arr_id[this.form.city_arr_id.length - 1];
+                    }
+                    this.form.city_arr_id = JSON.stringify(this.form.city_arr_id);
+                }
+                //判断用户身份
+                if (this.creatNews_user_type == 10000) {
+                    console.log("用户身份为管理员,无需审核直接发布!")
+                    this.form.status = 1;
+                    this.form.web_site_id = this.form.web_site_id ? this.form.web_site_id : this.websiteid;
+                } else {
+                    console.log("用户身份为其他用户,提交到审核!")
+                    this.form.status = 0;
+                    this.form.web_site_id = this.websiteid;
+                    //如果是普通用户 推荐等级设置为0 
+                    this.form.level = "[0]";
+                }
+                //先进行验证
+                // console.log( "this.form==", this.form);
+    
+                //如果推荐等级为空,则设置为0
+                if (this.form.level == "" || this.form.level == "[0]") {
+                    this.form.level = "[0]";
+                } else {
+                    this.form.level = JSON.stringify(this.form.level);
+                }
+                //console.log(this.form)
+                const formData = { ...this.form };
+                if (formData.commend_id != undefined && formData.commend_id.length > 0) {
+                    formData.commend_id = JSON.stringify(formData.commend_id); // 提取推荐ID
+                }
+                if (formData.commend_id.length == 0) {
+                    formData.commend_id = '[]';
+                }
 
+                this.$store.dispatch('news/addArticle', formData).then(res => {//
+                    if (res.code == 200) {
+                    console.log("资讯发布成功!200")
+                    //汇报结果
+                    if (this.creatNews_user_type == 10000) {
+                        this.$message({
+                            type: 'success',
+                            message: '已成功添加资讯!'
+                        });
+                        this.cleatForm(2);
+                        //返回列表页
+                        this.returnPage()
+                    } else {
+                        this.$message({
+                            type: 'success',
+                            message: '待管理员审核!'
+                        });
+                        this.cleatForm(2);
+                        //返回列表页
+                        this.returnPage()
+                    }
+                    } else {
+                        this.$message({
+                            type: 'error',
+                            message: res.message
+                        });
+                    }
+                }).catch(() => {
+                    this.$message({
+                        type: 'info',
+                        message: '网络错误,请重试!'
+                    });
+                })
             }
-          }).catch(() => {
-            this.$message({
-              type: 'info',
-              message: '网络错误,请重试!'
-            });
-          })
-        }
-      })
+        })
     },
     //1.3 清理表单
     cleatForm(type) {

+ 23 - 13
src/views/website/WebsiteList.vue

@@ -85,8 +85,15 @@
             <el-table-column prop="updated_at" label="修改时间"></el-table-column>
             <el-table-column prop="status" label="网站状态" width="">
               <template slot-scope="scope">
-                <el-switch v-model="scope.row.status" :active-value="1" :inactive-value="0"
-                  @change="upRow(scope.row.id, scope.row.status)"></el-switch>
+                    <div v-if="scope.row.id==139">AI控制</div>
+                    <div v-else>
+                        <el-switch 
+                            v-model="scope.row.status" 
+                            :active-value="1" 
+                            :inactive-value="0"
+                            @change="upRow(scope.row.id, scope.row.status)">
+                        </el-switch>
+                    </div>
               </template>
             </el-table-column>
             <el-table-column fixed="right" label="操作" width="200" header-align="center">
@@ -94,18 +101,21 @@
                 <div class="listBtnBox">
                   <!-- <div class="listDeleteBtn" @click="deleteData(scope.row.id, tableData)"><i
                       class="el-icon-delete"></i>删除</div> -->
-                    <div class="listEditBtn" @click="getDataMain(scope.row, tableData)">
-                        <i class="el-icon-edit-outline"></i>编辑
-                    </div>
-                    <div v-if="ifOfficial(scope.row)">
-                        <div 
-                            class="listUpBtn" 
-                            v-if="scope.row.website_column_arr_id && !scope.row.website_column_arr_id.includes(3)"
-                            @click="cloneWebsite(scope.row.id, tableData)"
-                        >
-                            <i class="el-icon-copy-document"></i>克隆
+                        <div v-if="scope.row.id==139">AI控制</div>
+                        <div v-else>
+                            <div class="listEditBtn" @click="getDataMain(scope.row, tableData)">
+                                <i class="el-icon-edit-outline"></i>编辑
+                            </div>
+                            <div v-if="ifOfficial(scope.row)">
+                                <div 
+                                    class="listUpBtn" 
+                                    v-if="scope.row.website_column_arr_id && !scope.row.website_column_arr_id.includes(3)"
+                                    @click="cloneWebsite(scope.row.id, tableData)"
+                                >
+                                    <i class="el-icon-copy-document"></i>克隆
+                                </div>
+                            </div>
                         </div>
-                    </div>
                   <!-- <div class="listMainBtn" @click="creatWebsite(scope.row.id)"><i class="el-icon-brush"></i>模板</div> -->
                 </div>
                 <!-- <div class="listMainBtn"><i class="el-icon-view"></i>详情</div> -->

+ 9 - 5
src/views/website/editNavigation.vue

@@ -36,6 +36,7 @@
                 <span v-else-if="scope.row.type == 5">求职</span>
                 <span v-else-if="scope.row.type == 6">企业</span>
                 <span v-else-if="scope.row.type == 7">项目</span>
+                <span v-else-if="scope.row.type == 8">单页</span>
               </template>
             </el-table-column>
             <el-table-column label="排序" width="95">
@@ -46,12 +47,15 @@
             </el-table-column>
             <el-table-column prop="path" label="path路径" width=""></el-table-column>
             <el-table-column prop="updated_at" label="修改时间" width=""></el-table-column>
-
-            <el-table-column fixed="right" label="是否显示在首页" width="150" header-align="center" align="center"
-              v-if="!website_column_arr_id.includes(3)">
+            <el-table-column fixed="right" label="是否显示在首页" width="150" header-align="center" align="center" v-if="!website_column_arr_id.includes(3)">
               <template slot-scope="scope">
-                <el-checkbox v-model="scope.row.checked"
-                  @change="handleChange(scope.row, scope.row.checked)"></el-checkbox>
+                <!--单页类型不显示复选框-->
+                <el-checkbox 
+                    v-model="scope.row.checked" 
+                    @change="handleChange(scope.row, scope.row.checked)"
+                    v-if="scope.row.type!=8"
+                >
+                </el-checkbox>
               </template>
             </el-table-column>
             <el-table-column fixed="right" label="操作" width="120" header-align="center">