LiuJ 1 nedēļu atpakaļ
vecāks
revīzija
9e72d24d77

+ 4 - 4
src/views/news/GoodList.vue

@@ -7,7 +7,7 @@
           <el-col :span="8">
             <div class="searchBox">
               <div class="searchTitle">发布类型:</div>
-              <el-select v-model="getApiData.type_id" placeholder="请选择..">
+              <el-select v-model="getApiData.type_id" placeholder="请选择发布类型..">
                 <el-option label="供应商品" value="1"></el-option>
                 <el-option label="求购商品" value="2"></el-option>
               </el-select>
@@ -31,8 +31,8 @@
         <el-row>
           <el-col :span="8">
             <div class="searchBox">
-              <div class="searchTitle">导航名称:</div>
-              <el-input placeholder="请输入网站名称" autocomplete="off" v-model="getApiData.category_name" />
+              <div class="searchTitle">栏目名称:</div>
+              <el-input placeholder="请输入栏目名称" autocomplete="off" v-model="getApiData.category_name" />
             </div>
           </el-col>
           <!-- <el-col :span="8">
@@ -82,7 +82,7 @@
             <el-table-column prop="website_name" label="网站名称" width="">
 
             </el-table-column>
-            <el-table-column prop="category_name" label="导航池名称" width=""></el-table-column>
+            <el-table-column prop="category_name" label="栏目名称" width=""></el-table-column>
             <el-table-column prop="status" label="审核状态" width="">
               <template slot-scope="scope">
                 <span v-if="scope.row.status == 1">

+ 2 - 2
src/views/news/GoodListApply.vue

@@ -31,8 +31,8 @@
         <el-row>
           <el-col :span="8">
             <div class="searchBox">
-              <div class="searchTitle">导航名称:</div>
-              <el-input placeholder="请输入网站名称" autocomplete="off" v-model="getApiData.category_name" />
+              <div class="searchTitle">栏目名称:</div>
+              <el-input placeholder="请输入栏目名称" autocomplete="off" v-model="getApiData.category_name" />
             </div>
           </el-col>
           <!-- <el-col :span="8">

+ 1 - 0
src/views/news/NewList.vue

@@ -71,6 +71,7 @@
               </template>
             </el-table-column>
             <el-table-column prop="category_name" label="栏目名称" width="100"></el-table-column>
+            <el-table-column prop="alias" label="展示名称" width="100"></el-table-column>
             <!-- <el-table-column prop="islink" label="是否引用外链" width=""></el-table-column>
             <el-table-column prop="linkurl" label="是否为原创" width="">
               <template slot-scope="scope">

+ 652 - 0
src/views/news/addComplaint.vue

@@ -0,0 +1,652 @@
+<template>
+  <div class="mainBox">
+    <div class="layerBox">
+      <tableTitle :name="tableDivTitle" />
+      <el-form :model="form" ref="form" :rules="formRules" label-position="left" label-width="120px">
+        <div class="formDiv">
+
+          <el-form-item label="标题:" prop="title" class="custom-align-right">
+            <el-input v-model="form.title" autocomplete="off" placeholder="请输入标题"></el-input>
+          </el-form-item>
+          <el-form-item label="类型:" prop="type" class="custom-align-right">
+            <el-radio-group v-model="form.type">
+              <el-radio :label="1">公告</el-radio>
+              <el-radio :label="2">通知</el-radio>
+            </el-radio-group>
+          </el-form-item>
+          <el-form-item label="级别:" prop="level" class="custom-align-right">
+            <el-radio-group v-model="form.level">
+              <el-radio :label="1">常规</el-radio>
+              <el-radio :label="2">紧急</el-radio>
+              <el-radio :label="3">特急</el-radio>
+            </el-radio-group>
+          </el-form-item>
+          <el-form-item label="内容:" prop="content" class="custom-align-right">
+            <el-input v-model="form.content" maxlength="500" autocomplete="off" placeholder="请输入内容" type="textarea"
+              rows="10"></el-input>
+          </el-form-item>
+          <el-form-item label="发布范围:" prop="city_arr_id" class="custom-align-right">
+            <el-cascader :key="cascaderKey" v-model="form.city_arr_id" placeholder="请选择发布范围" :props="cityData"
+              filterable clearable></el-cascader>
+          </el-form-item>
+          <el-form-item label="行政职能:"  prop="department_arr_id" class="custom-align-right">
+            <el-cascader :key="searchDepartmentKey" v-model="form.department_arr_id" placeholder="请选择行政职能"
+              popper-class="my_cascader" :props="searchDepartmentData" filterable clearable></el-cascader>
+          </el-form-item>
+          <el-form-item label="发布日期:" prop="timeList" class="custom-align-right">
+            <el-date-picker v-model="form.time" type="daterange" range-separator="至" start-placeholder="开始日期"
+              end-placeholder="结束日期" :picker-options="pickerOptions">
+            </el-date-picker>
+          </el-form-item>
+        
+          <el-form-item label="附件:" class="custom-align-right" prop="">
+            <div class="uploaderBox" @mouseenter="hovering = true" mouseleave="hovering = false">
+              <el-upload class="avatar-uploader" action="#" :show-file-list="false" :before-upload="beforeAvatarUpload">
+                <!-- 预览图片 -->
+                <img v-if="file && (fileType == 'jpeg' || fileType =='png' )" :src="file" class="avatar">
+                <div v-if="file && (fileType == 'pdf' || fileType =='word' )" class="chooseImgDiv1">
+                  <div>
+                    <div>{{file}}</div>
+                  </div>
+                </div>
+                <div v-else class="chooseImgDiv">
+                  <div>
+                    <img src="@/assets/public/upload/noImage.png">
+                    <div>选择文档</div>
+                  </div>
+                </div>
+              </el-upload>
+              <input type="hidden" v-model="form.imgurl">
+              <span class="photo_tips">支持文件形式pdf,word,jpg,文件最大2M。</span>
+              <div v-if="hovering && imgUrl" class="delete-button" @click="handleDelete">
+                <i class="el-icon-delete"></i>
+              </div>
+            </div>
+          </el-form-item>
+          <el-form-item label="建立群聊:" prop="is_group" class="custom-align-right">
+              <el-radio-group v-model="form.is_group" :disabled="this.$route.query.id!=undefined"> 
+                <el-radio :label="1">是</el-radio>
+                <el-radio :label="0">否</el-radio>
+              </el-radio-group>
+            </el-form-item>
+
+          <el-form-item label="群聊名称:" prop="group_name" class="custom-align-right" v-if="form.is_group == 1" :disabled="this.$route.query.id!=undefined">
+                <el-input v-model="form.group_name" autocomplete="off" placeholder="请输入群聊名称"></el-input>
+          </el-form-item>
+        </div>
+      </el-form>
+    </div>
+    <div class="bottomBtnBox">
+      <el-button type="info" @click="returnPage">返回</el-button>
+      <el-button type="primary" @click="editToServe" v-if="editStatus == true">确定</el-button>
+      <el-button type="primary" @click="addToServe" v-else>发布通知</el-button>
+    </div>
+  </div>
+</template>
+
+<script>
+//表格标题
+import tableTitle from './components/tableTitle';
+//引入公用样式
+import '@/styles/global.less';
+//格式化时间
+import { formatLocalDate } from '@/utils/public';
+
+export default {
+  components: {
+    tableTitle
+  },
+  data() {
+    //0.全局操作 start ------------------------------------------------------------>
+    //表单验证
+    const validateNull = (rule, value, callback) => {
+      console.log(value, '-------------------------------')
+      if (value == '' || value == undefined || value == null) {
+        callback(new Error('该项不能为空!'))
+      } else {
+        callback()
+      }
+    }
+    const validateEmpty = (rule, value, callback) => {
+      console.log(value, '-------------------------------')
+      if (value.length == 0) {
+        callback(new Error('该项不能为空!'))
+      } else {
+        callback()
+      }
+    }
+    const validateArray = (rule, value, callback) => {
+      if (value.length == 0) {
+        callback(new Error('该项不能为空!'))
+      } else {
+        callback()
+      }
+    }
+    let self = this;
+    //0.全局操作 end ------------------------------------------------------------>
+    return {
+      formLabelWidth: '80px',//表单的长度
+      //1.表单项 start ------------------------------------------------------------>
+      editStatus: false,
+      tableDivTitle: "添加通知",
+      searchCascaderKey: 0, //列表缓存key
+      website_id: 2,
+      file: '',
+      pickerOptions: {
+        selectableRange: '1900-01-01 to 2100-12-31', // 允许选择的日期范围
+        // disabledDate(time) {
+        //   return time.getTime() < Date.now() - 86400000; // 禁用今天之前的日期
+        // },
+      },
+
+      //提交表单
+      form: {
+        //1.1使用了外链
+        title: '',//通知标题
+        type: 1,//类型:1:公告,2:通知
+        level: 1,//级别:1:常规,2:紧急,3:特急
+        city_arr_id: [],//行政区划
+        city_id: '',//城市id
+        content: "",
+        timelist: "",
+        file: "",//文件路径
+        department_arr_id: [],//部门id
+        department_id: '',//部门id
+        is_group: 0,//是否创建群聊:1:是,0:否
+        group_name: '',//群聊名称
+      },
+      //1.2 表单验证规则
+      formRules: {
+        title: [{ required: true, trigger: 'blur', validator: validateEmpty }],
+        type: [{ required: true, trigger: 'blur', validator: validateEmpty }],
+        city_arr_id: [{ required: true, trigger: 'blur', validator: validateArray }],
+        department_arr_id: [{ required: true, trigger: 'blur', validator: validateArray }],
+        level: [{ required: true, trigger: 'blur', validator: validateEmpty }],
+        content: [{ required: true, trigger: 'blur', validator: validateEmpty }],
+        address: [{ required: true, trigger: 'blur', validator: validateEmpty }],
+        is_group: [{ required: true, trigger: 'blur', validator: validateEmpty }],
+      },
+      //1.3富文本编辑器配置
+      showHtml: false, //用于保存源码内容
+      editorHtml: '',
+      cascaderKey: 0,//弹窗用的key
+      websiteData: {
+        lazy: true,
+        checkStrictly: true,
+        async lazyLoad(node, resolve) {
+          const { level, data } = node;
+          if (data && data.children && data.children.length !== 0) {
+            return resolve(node)
+          }
+          console.log(level)
+          let parentId = level == 0 ? 0 : data.value
+          let parames = {
+            'page': 1,
+            'pageSize': 1000,
+          }
+          self.$store.dispatch('news/websiteList', parames).then(res => {
+            if (res.data) {
+              const nodes = res.data.rows.map(item => ({
+                value: item.id,
+                label: item.website_name,
+                leaf: level >= 3,
+                children: []
+              }))
+
+              console.log(nodes, 'leaf')
+              resolve(nodes)
+            }
+          })
+        },
+      },
+
+      cityData: {
+        checkStrictly: true,
+        lazy: true,
+        async lazyLoad(node, resolve) {
+          const { level, data } = node;
+          if (data && data.children && data.children.length !== 0) {
+            return resolve(node)
+          }
+          console.log(level, '====level-----')
+          let parentId = level == 0 ? 0 : data.value
+          let parames = {
+            'pid': parentId
+          }
+          self.$store.dispatch('pool/getcityList', parames).then(res => {
+            if (res.data) {
+              const nodes = res.data.map(item => ({
+                value: item.id,
+                label: item.name,
+                leaf: level >= 3,
+                children: []
+              }))
+              resolve(nodes)
+            }
+          })
+        }
+      },
+
+      imgurl: [],
+      //获取父级导航池
+      parentKey: 0,//获取父级导航
+      parentData: {
+        checkStrictly: true,
+        lazy: true,
+        async lazyLoad(node, resolve) {
+          console.log(resolve, 'node')
+          const { level, data } = node;
+          if (data && data.children && data.children.length !== 0) {
+            return resolve(node)
+          }
+          console.log(level, 'level--1--');
+          let pid = level == 0 ? 0 : data.value
+          let website_id = self.form.website_id == '' ? 2 : self.form.website_id;
+          console.log(website_id, 'website_id--111-----');
+          let parames = {
+            'website_id': website_id,
+            'pid': pid
+          }
+          self.$store.dispatch('news/getWebsiteNavList', parames).then(res => {
+            if (res.data) {
+              const nodes = res.data.map(item => ({
+                value: item.category_id,
+                label: item.name,
+                leaf: level >= 3,
+                children: []
+              }))
+              resolve(nodes)
+            } else {
+              //输出报错原因
+              console.log(res.msg, 'getWebsiteNavList--1--');
+
+            }
+          })
+        }
+      },
+      //行政职能部门
+      searchDepartmentKey: 0, //列表缓存key
+      searchDepartmentData: {
+        checkStrictly: true,
+        lazy: true,
+        async lazyLoad(node, resolve) {
+          const { level, data } = node;
+          if (data && data.children && data.children.length !== 0) {
+            return resolve(node)
+          }
+          console.log(level)
+          let parentId = level == 0 ? 0 : data.value
+          let parames = {
+            'pid': parentId
+          }
+          self.$store.dispatch('pool/getDepartment', parames).then(res => {
+            if (res.data) {
+              const nodes = res.data.map(item => ({
+                value: item.id,
+                label: item.name,
+                leaf: level >= 3,
+                children: []
+              }))
+              resolve(nodes)
+            }
+          })
+        }
+      },
+      inputList: [
+        { value: '' }
+      ]
+      //表单项 end ------------------------------------------------------------>
+    };
+  },
+  methods: {
+    async fetchWebsiteOptions() {
+      try {
+        const response = await this.$store.dispatch('news/websiteList', { page: 1, pageSize: 1000 });
+        if (response && response.data) {
+          this.websiteOptions = response.data.rows.map(item => ({
+            value: item.id,
+            label: item.website_name,
+          }));
+        }
+      } catch (error) {
+        console.error('获取网站列表失败:', error);
+      }
+    },
+    //获取用户身份信息
+    getUserInfo() {
+      this.$store.dispatch('public/getInfo').then(res => {
+        console.log(res)
+        this.userType = res.data.type_id;
+
+        //个人会员=1 政务会员=2 企业会员=3 调研员=4 管理员=10000 游客=20000
+      }).catch(() => {
+        this.$message({
+          type: 'info',
+          message: '网络错误,请重试!'
+        });
+      })
+    },
+    //1.提交表单 start ------------------------------------------------------------>
+    beforeAvatarUpload(file) {
+      const isJPG = file.type === 'image/jpeg';
+      const isPNG = file.type === 'image/png';
+      //word  pdf
+      const isWord = file.type === 'application/msword' || file.type === 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' || file.type === 'application/vnd.ms-word' || file.type === 'doc';
+      const isPdf = file.type === 'application/pdf' || file.type === 'application/x-pdf' || file.type === 'application/acrobat' || file.type === 'pdf' || file.type === 'text/x-pdf' || file.type === 'application/x-download' || file.type === 'application/octet-stream';
+      const isLt2M = file.size / 1024 / 1024 < 2;
+      console.log(this.imgurl.length, '-0--------------------------------')
+      if (this.imgurl.length > 4) {
+        this.$message.warning('只能上传5张图片');
+        return false;
+      }
+
+      if (!isJPG && !isPNG && !isWord && !isPdf) {
+        this.$message.error('上传文件只能是 JPG、PNG、WORD、PDF 格式!');
+        return false;
+      }
+      if (!isLt2M) {
+        this.$message.error('上传缩略图大小不能超过 2MB!');
+        return false;
+      }
+
+      const formData = new FormData();
+      formData.append('file', file);
+
+      this.$store.dispatch('pool/uploadFile', formData).then(res => {
+        this.file = res.data.imgUrl;//提供表单地址
+        this.fileType = res.data.fileType;
+        this.oldFileName = res.data.oldFileName;
+        this.form.file.push(res.data.imgUrl);//提供表单地址
+        console.log(res.data.imgUrl, '00000')
+      })
+      // 阻止默认的上传行为
+      return false;
+    },
+    deleteImage(index) { // 删除图片
+      this.file.splice(index, 1);
+    },
+    //1.2 提交表单
+    addToServe() {
+      //先进行验证
+      this.$refs.form.validate(valid => {
+        console.log(this.form.validity, 'this.form.validity-----------------')
+        if (valid) {
+          if (this.form.validity) {
+            this.form.validity = formatLocalDate(this.form.validity);
+          }
+          if (this.form.department_arr_id.length == 0) {
+            this.form.department_id = 0;
+          }
+          if (this.form.city_arr_id.length == 0) {
+            this.form.city_id = 0;
+          }
+          console.log(typeof this.form.city_arr_id, '---=-==-=')
+          if (typeof this.form.city_arr_id == 'object') {
+            this.form.city_id = this.form.city_arr_id.at(-1) || 0;
+            this.form.city_arr_id = JSON.stringify(this.form.city_arr_id);
+          }
+          if (typeof this.form.department_arr_id == 'object') {
+            this.form.department_id = this.form.department_arr_id.at(-1) || 0;
+            this.form.department_arr_id = JSON.stringify(this.form.department_arr_id);
+          }
+          console.log(typeof this.form.time, '---=-==-=')
+          console.log(this.form.time.length, '---=-==-=')
+          if (typeof this.form.time=='object' && this.form.time.length > 0) {
+            this.form.start = this.formatDate(this.form.time[0]);
+            this.form.end = this.formatDate(this.form.time[1]);
+            delete this.form.time;
+          }
+          delete this.form.cat_arr_id;
+          delete this.form.timelist;
+          delete this.form.catid;
+          this.form.file = this.file;
+          console.log(this.form, 'this.form-----------------')
+          this.$store.dispatch('news/addNotice', this.form).then(res => {
+            if (res.code == 200) {
+              //汇报结果
+              this.$message({
+                type: 'success',
+                message: '已成功添加通知!'
+              });
+              this.cleatForm();
+              //返回列表页
+              this.returnPage()
+            } else {
+              this.$message({
+                type: 'error',
+                message: "通知发布失败,请稍后再试!"
+              });
+            }
+          })
+        }
+      })
+    },
+    formatDate(date) {
+      if (date instanceof Date) {
+        return date.toISOString().slice(0, 19).replace('T', ' ');
+      } else if (typeof date === 'string') {
+        // 将 ISO 8601 格式的字符串转换为 MySQL 期望的格式
+        const parsedDate = new Date(date);
+        return parsedDate.toISOString().slice(0, 19).replace('T', ' ');
+      } else {
+        return date;
+      }
+    },
+    //1.3 清理表单
+    cleatForm() {
+    },
+    //提交表单 end ------------------------------------------------------------>
+
+    //2.跳转操作 start ------------------------------------------------------------>
+    returnPage() {
+      this.$router.push({
+        path: '/noticeList',
+      });
+    },
+    //跳转操作 end ------------------------------------------------------------>
+
+    //3.回显操作 ------------------------------------------------------------>
+    //3.1回显数据
+    getMainData() {
+      let data = {
+        id: this.$route.query.id
+      };
+      this.$store.dispatch('news/getNoticeInfo', data).then(res => {
+        console.log(res);
+        this.form.name = res.data.name;
+        // 回显导航池
+        this.form.cat_arr_id = Array.isArray(res.data.cat_arr_id) ? res.data.cat_arr_id : JSON.parse(res.data.cat_arr_id);
+        this.form.city_arr_id = Array.isArray(res.data.city_arr_id) ? res.data.city_arr_id : JSON.parse(res.data.city_arr_id);
+        this.parentKey += 1; // 触发级联选择器重新加载
+        this.loadCascaderPath(this.form.cat_arr_id); // 加载路径数据
+        //回显推荐等级
+
+        this.form.title = res.data.title;
+        this.form.type = res.data.type;
+        this.form.website_id = res.data.website_id;
+        this.form.level = res.data.level;
+        this.form.content = res.data.content;
+        this.form.department_arr_id = Array.isArray(res.data.department_arr_id) ? res.data.department_arr_id : JSON.parse(res.data.department_arr_id);
+        this.form.city_id = res.data.city_id;
+        this.form.department_id = res.data.department_id;
+        this.form.cat_id = res.data.cat_id;
+        this.form.time = [res.data.start, res.data.end];
+        this.form.file = res.data.file;
+        this.file = res.data.file; 
+        const filePath = res.data.file;
+        const fileExtension = filePath.split('.').pop().toLowerCase();
+        this.fileType = fileExtension; // 设置文件类型
+        this.form.is_group = parseInt(res.data.is_group );
+        this.form.group_name = res.data.group_name;
+      })
+    },
+    async loadCascaderPath(path) {
+      for (let i = 0; i < path.length; i++) {
+        const parentId = path[i - 1] || 0; // 获取当前层级的父级ID
+        const level = i; // 当前层级的索引
+        // self.$store.dispatch('news/getWebsiteNavList', parames).then(res => {
+        //     if (res.data) {
+        //       const nodes = res.data.map(item => ({
+        //         value: item.category_id,
+        //         label: item.name,
+        //         leaf: level >= 3,
+        //         children: []
+        //       }))
+        //       resolve(nodes)
+        await this.$store.dispatch('pool/categoryList', { pid: parentId })
+          .then((res) => {
+            const nodes = res.data.map(item => ({
+              value: item.id,
+              label: item.name,
+              leaf: level >= 3, // 假设4层结构,设置叶子节点标记
+            }));
+            // 级联选择器加载数据
+            if (level === path.length - 1) {
+              this.form.cat_arr_id = path; // 确保最后一级路径正确设置
+              this.parentKey += 1; // 强制刷新 cascader
+            }
+          });
+      }
+    },
+    //1.3提交修改
+    editToServe() {
+      console.log(this.form)
+      //添加要修改的id
+      this.form.id = this.editId;
+      //先进行验证
+      if (this.form.islong == 1 && this.form.validity == null) {
+        this.form.validity = '1970-01-01 00:00:00';
+      }
+      this.$refs.form.validate(valid => {
+
+        if (valid) {
+          if (this.form.validity) {
+            this.form.validity = formatLocalDate(this.form.validity);
+          }
+          if (this.form.department_arr_id.length == 0) {
+            this.form.department_id = 0;
+          }
+          if (this.form.city_arr_id.length == 0) {
+            this.form.city_id = 0;
+          }
+          console.log(typeof this.form.city_arr_id, '---=-==-=')
+          if (typeof this.form.city_arr_id == 'object') {
+            this.form.city_id = this.form.city_arr_id.at(-1) || 0;
+            this.form.city_arr_id = JSON.stringify(this.form.city_arr_id);
+          }
+          if (typeof this.form.department_arr_id == 'object') {
+            this.form.department_id = this.form.department_arr_id.at(-1) || 0;
+            this.form.department_arr_id = JSON.stringify(this.form.department_arr_id);
+          }
+          console.log(typeof this.form.time, '---=-==-=')
+          if (typeof this.form.time=='object' && this.form.time.length > 0) {
+            this.form.start = this.formatDate(this.form.time[0]);
+            this.form.end = this.formatDate(this.form.time[1]);
+            delete this.form.time;
+          }
+          delete this.form.cat_arr_id;
+          delete this.form.timelist;
+          delete this.form.catid;
+          this.form.file = this.file;
+          console.log(this.form, 'this.form-----------------')
+          this.$store.dispatch('news/updateNotice', this.form).then(res => {
+            if (res.code != 200) {
+              this.$message.error("修改失败,请稍后再试!");
+            } else {
+              //汇报结果
+              this.$message({
+                type: 'success',
+                message: '已成功编辑通知!'
+              });
+              this.cleatForm();
+              //返回列表页
+              this.returnPage()
+            }
+          }).catch(() => {
+            this.$message({
+              type: 'info',
+              message: '网络错误,请重试!'
+            });
+          })
+        }
+      })
+    },
+    //跳转操作 end ------------------------------------------------------------>
+    //4.富文本编辑器 start ------------------------------------------------------------>
+    //4.1 编辑器点击上传图片
+    //4.2 图片粘贴上传
+    // 处理从网页粘贴的图片 URL
+    //富文本编辑器 end ------------------------------------------------------------>
+
+  },
+  watch: {
+  },
+  mounted() {
+    //1.判断是新建还是回显
+    if (this.$route.query.id != undefined) {
+      this.editId = this.$route.query.id;
+      this.editStatus = true;
+      this.tableDivTitle = "编辑通知";
+
+      console.log("编辑通知")
+      this.getMainData();
+    } else {
+      this.editStatus = false;
+      console.log("添加通知!")
+    }
+    this.fetchWebsiteOptions();
+    this.getUserInfo();
+    //复制内容到富文本 start ------------------------------------------------------------>
+    //复制富文本 end ------------------------------------------------------------>
+  },
+};
+</script>
+<style scoped lang="less">
+
+
+//执行v-deep穿透scope选择器 start------------------------------------------------------------>*/
+::v-deep .custom-form-item>.el-form-item__label {
+  line-height: 140px !important;
+}
+
+::v-deep .custom-textarea .el-textarea__inner {
+  resize: none;
+  /* 禁止用户拖拽调整大小 */
+}
+
+::v-deep .custom-align-right .el-form-item__label {
+  text-align: right;
+  /* 设置标签文字右对齐 */
+}
+
+::v-deep .el-select {
+  width: 100%;
+  /* 禁止用户拖拽调整大小 */
+}
+
+::v-deep .el-input-group__prepend {
+  color: black !important;
+}
+
+.formLabelFloatBox {
+  margin-bottom: 10px;
+  position: relative;
+
+  .formLabeladdIcon {
+    position: absolute;
+    right: 45px;
+    top: 5px;
+    width: 38px;
+    height: 24px;
+  }
+
+  .formLabelDelIcon {
+    position: absolute;
+    right: 5px;
+    top: 5px;
+    width: 38px;
+    height: 24px;
+  }
+}
+
+//执行v-deep穿透scope选择器 end------------------------------------------------------------>*/</style>

+ 114 - 104
src/views/news/examine.vue

@@ -7,19 +7,19 @@
           <el-col :span="8">
             <div class="searchBox">
               <div class="searchTitle">资讯题目:</div>
-              <el-input placeholder="请输入资讯题目" autocomplete="off" v-model="getApiData.title"/>
+              <el-input placeholder="请输入资讯题目" autocomplete="off" v-model="getApiData.title" />
             </div>
           </el-col>
           <el-col :span="8">
             <div class="searchBox">
               <div class="searchTitle">栏目名称:</div>
-              <el-input placeholder="请输入栏目名称" autocomplete="off" v-model="getApiData.category_name"/>
+              <el-input placeholder="请输入栏目名称" autocomplete="off" v-model="getApiData.category_name" />
             </div>
           </el-col>
           <el-col :span="8">
             <div class="searchBox">
               <div class="searchTitle">作者:</div>
-              <el-input placeholder="请输入作者姓名" autocomplete="off" v-model="getApiData.author"/>
+              <el-input placeholder="请输入作者姓名" autocomplete="off" v-model="getApiData.author" />
             </div>
           </el-col>
         </el-row>
@@ -47,7 +47,7 @@
         </el-row>
       </div>
     </div>
-    
+
     <div class="layerBoxNoBg">
       <div>
         <!-- <el-button type="primary" @click="goCreat">发布资讯</el-button> -->
@@ -61,20 +61,21 @@
 
     <!--表格内容 start------------------------------------------------------------>
     <div class="layerBox">
-      <tableTitle :name="tableDivTitle"/>
+      <tableTitle :name="tableDivTitle" />
       <el-row>
         <template>
           <el-table :data="tableData" style="width: 100%">
             <el-table-column fixed prop="id" label="编号" width="50"></el-table-column>
             <el-table-column prop="title" label="资讯题目" width=""></el-table-column>
             <el-table-column prop="category_name" label="栏目名称" width=""></el-table-column>
+            <el-table-column prop="alias" label="展示名称" width="100"></el-table-column>
             <el-table-column prop="islink" label="是否引用外链" width=""></el-table-column>
             <el-table-column prop="linkurl" label="是否为原创" width="">
               <template slot-scope="scope">
-                <span v-if="scope.row.is_original==1">
+                <span v-if="scope.row.is_original == 1">
                 </span>
-                <span v-if="scope.row.is_original==0">
+                <span v-if="scope.row.is_original == 0">
                 </span>
               </template>
@@ -92,28 +93,35 @@
                   :inactive-value="0"
                   @change="upRow(scope.row.id,scope.row.status)"
                 ></el-switch> -->
-                <span v-if="scope.row.status==0">待审核</span>
-                <span v-if="scope.row.status==1">已审核</span>
-                <span v-if="scope.row.status==2">已拒绝</span>
+                <span v-if="scope.row.status == 0">待审核</span>
+                <span v-if="scope.row.status == 1">已审核</span>
+                <span v-if="scope.row.status == 2">已拒绝</span>
               </template>
             </el-table-column>
-            <el-table-column fixed="right" label="操作" width="360" header-align="center" v-if="creatNews_user_type == 10000">
+            <el-table-column fixed="right" label="操作" width="360" header-align="center"
+              v-if="creatNews_user_type == 10000">
               <template slot-scope="scope">
                 <div class="listBtnBox">
-                  <div class="listMainBtn" @click="getUpRow(scope.row.id, tableData)"><i class="el-icon-check"></i>审核</div>
-                  <div class="listDeleteBtn" @click="deleteRow(scope.row.id, tableData)"><i class="el-icon-delete"></i>删除</div>
-                  <div class="listEditBtn" @click="goEdit(scope.row.id, tableData)"><i class="el-icon-edit-outline"></i>编辑</div>
+                  <div class="listMainBtn" @click="getUpRow(scope.row.id, tableData)"><i class="el-icon-check"></i>审核
+                  </div>
+                  <div class="listDeleteBtn" @click="deleteRow(scope.row.id, tableData)"><i
+                      class="el-icon-delete"></i>删除</div>
+                  <div class="listEditBtn" @click="goEdit(scope.row.id, tableData)"><i
+                      class="el-icon-edit-outline"></i>编辑</div>
                 </div>
               </template>
             </el-table-column>
-            <el-table-column fixed="right" label="操作" width="360" header-align="center" v-if="creatNews_user_type != 10000">
+            <el-table-column fixed="right" label="操作" width="360" header-align="center"
+              v-if="creatNews_user_type != 10000">
               <template slot-scope="scope">
                 <div class="listBtnBox">
                   <!-- <div class="listLinkBtn" @click="selectRow(scope.row.cat_arr_id, scope.row)"><i class="el-icon-full-screen"></i>站点选择</div>
                   <div class="listMainBtn" @click="getUpRow(scope.row.id, tableData)" v-if="scope.row.status==0"><i class="el-icon-check"></i>审核</div>
                   <div class="listUpBtn" @click="returnRow(scope.row.id, tableData)" v-else><i class="el-icon-refresh-right"></i>撤回</div> -->
-                  <div class="listDeleteBtn" @click="deleteRow(scope.row.id, tableData)"><i class="el-icon-delete"></i>删除</div>
-                  <div class="listEditBtn" @click="goEdit(scope.row.id, tableData)"><i class="el-icon-edit-outline"></i>编辑</div>
+                  <div class="listDeleteBtn" @click="deleteRow(scope.row.id, tableData)"><i
+                      class="el-icon-delete"></i>删除</div>
+                  <div class="listEditBtn" @click="goEdit(scope.row.id, tableData)"><i
+                      class="el-icon-edit-outline"></i>编辑</div>
                 </div>
               </template>
             </el-table-column>
@@ -126,7 +134,9 @@
     <div class="alignBox">
       <el-row>
         <el-col :span="24">
-          <el-pagination @size-change="handleSizeChange" :current-page="getApiData.page" @current-change="handleCurrentChange" :page-size="10" layout="total, prev, pager, next, jumper" :total="allCount"></el-pagination>
+          <el-pagination @size-change="handleSizeChange" :current-page="getApiData.page"
+            @current-change="handleCurrentChange" :page-size="10" layout="total, prev, pager, next, jumper"
+            :total="allCount"></el-pagination>
         </el-col>
       </el-row>
     </div>
@@ -138,13 +148,14 @@
       <el-form :model="form" ref="form" :rules="formRules" label-position="left">
         <div class="formDiv">
           <el-form-item label="驳回原因:" :label-width="formLabelWidth" prop="reason" class="custom-align-right">
-            <el-input type="textarea" v-model="form.reason" class="custom-textarea" placeholder="请输入驳回原因" :rows="3"></el-input>
+            <el-input type="textarea" v-model="form.reason" class="custom-textarea" placeholder="请输入驳回原因"
+              :rows="3"></el-input>
           </el-form-item>
         </div>
       </el-form>
       <div slot="footer" class="dialog-footer">
         <div>
-          <el-button type="info" @click="examineWindow=false">取消</el-button>
+          <el-button type="info" @click="examineWindow = false">取消</el-button>
           <el-button type="primary" @click="examineToServe">确定</el-button>
         </div>
       </div>
@@ -153,9 +164,10 @@
 
     <!--弹出框2:选择要发布的网站 start------------------------------------------------------------>
     <el-dialog title="请选择不要发布的网站" :visible.sync="selectStatusWindow" :close-on-click-modal="false">
-      <el-form label-position="left" >
+      <el-form label-position="left">
         <div class="formDiv">
-          <el-table v-loading="loading" ref="multipleTable" :data="webSiteData" tooltip-effect="dark" style="width: 100%" @selection-change="handleSelectionChange">
+          <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>
@@ -164,13 +176,13 @@
       </el-form>
       <div slot="footer" class="dialog-footer">
         <div>
-          <el-button type="info" @click="selectStatusWindow=false">取消</el-button>
+          <el-button type="info" @click="selectStatusWindow = false">取消</el-button>
           <el-button type="primary" @click="selectWebSiteToServe">确定</el-button>
         </div>
       </div>
     </el-dialog>
     <!--弹出框2:选择要发布的网站 end------------------------------------------------------------>
-    
+
   </div>
 </template>
 
@@ -200,60 +212,60 @@ export default {
     //0.全局操作 end ------------------------------------------------------------>
     return {
       //1.列表和分页相关 start ------------------------------------------------------------>
-      tableDivTitle:"资讯列表",
-      creatNews_user_type:0,//用户类型
-      tableData:[],//内容
+      tableDivTitle: "资讯列表",
+      creatNews_user_type: 0,//用户类型
+      tableData: [],//内容
       webSiteData: [],//可选网站列表
-      editId:0,//要修改的网站id
-      editStatus:0,//要修改的网站状态
-      selectStatusWindow:false,//反选窗口
-      examineWindow:false,//审核窗口
-      formLabelWidth:"120px",//表单label宽度
-      getApiData:{
-        title:"",//标题
-        category_name:"",//导航池id
-        author:"",//作者
-        islink:"",//是否使用外链
-        status:"",//资讯状态
-        status1:"[0,2]", //默认传递 - 如果不为空,表示获取所有未审核与已拒绝的
-        page:1,//当前是第几页
-        pageSize:10,//一共多少条
+      editId: 0,//要修改的网站id
+      editStatus: 0,//要修改的网站状态
+      selectStatusWindow: false,//反选窗口
+      examineWindow: false,//审核窗口
+      formLabelWidth: "120px",//表单label宽度
+      getApiData: {
+        title: "",//标题
+        category_name: "",//导航池id
+        author: "",//作者
+        islink: "",//是否使用外链
+        status: "",//资讯状态
+        status1: "[0,2]", //默认传递 - 如果不为空,表示获取所有未审核与已拒绝的
+        page: 1,//当前是第几页
+        pageSize: 10,//一共多少条
       },
       //提交驳回
-      form:{
-        reason:""
+      form: {
+        reason: ""
       },
       //选择要发布的网站
-      webSiteForm:{
-        ignore_ids:[]
+      webSiteForm: {
+        ignore_ids: []
       },
-      ids:[],//待选网站列表
-      loading:false,//loading
+      ids: [],//待选网站列表
+      loading: false,//loading
       formRules: {
         //导航池名称不能为空
         reason: [{ required: true, trigger: 'blur', validator: validateEmpty }],
       },
-      allCount:0,//总条数
+      allCount: 0,//总条数
       //分页相关 end ------------------------------------------------------------>
     }
   },
   methods: {
     //1.列表和分页相关 start ------------------------------------------------------------>
     //1.1 开始请求列表信息方法
-    getData(type){
-      if(type=="search"){
+    getData(type) {
+      if (type == "search") {
         this.getApiData.page = 1;
       }
-      this.$store.dispatch('news/getArticleList',this.getApiData).then(res=> {
+      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){
+        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="是"}
+          if (item.islink == 0) { item.islink = "否" }
+          if (item.islink == 1) { item.islink = "是" }
           data.push(item)
         }
         this.tableData = res.data.rows; //给与内容
@@ -266,14 +278,14 @@ export default {
       })
     },
     //1.2 删除内容
-    deleteRow(id){
+    deleteRow(id) {
       this.$confirm('此操作将永久删除该条数据, 是否继续?', '提示', {
         confirmButtonText: '确定',
         cancelButtonText: '取消',
         type: 'warning'
       }).then(() => {
         console.log("当前删除:" + id)
-        this.$store.dispatch('news/delArticle',{id:id}).then(res=> {
+        this.$store.dispatch('news/delArticle', { id: id }).then(res => {
           this.getData();
           this.$message({
             type: 'success',
@@ -283,18 +295,18 @@ export default {
       })
     },
     //1.3 撤回审核
-    returnRow(id){
+    returnRow(id) {
       this.$confirm('确定要撤回吗?', '提示', {
         confirmButtonText: '撤回',
         cancelButtonText: '取消',
         type: 'warning'
       }).then(() => {
         //撤回,把文章状态修改为0,重新进行审核
-        this.upRow(id,0)
+        this.upRow(id, 0)
       })
     },
     //1.4 审核温江
-    getUpRow(id){
+    getUpRow(id) {
       //设置待审核的id
       this.editId = id;
       console.log(id)
@@ -303,21 +315,21 @@ export default {
         cancelButtonText: '拒绝',
         type: 'warning'
       }).then(() => {
-        this.upRow(id,1)
+        this.upRow(id, 1)
       }).catch(() => {
-       //输入驳回理由
-       console.log("驳回")
-       this.examineWindow = true;
+        //输入驳回理由
+        console.log("驳回")
+        this.examineWindow = true;
       })
     },
     //1.5 修改文章状态
-    upRow(id,status){
+    upRow(id, status) {
       let data = {
-        id:id,
-        status:status
+        id: id,
+        status: status
       }
-      this.$store.dispatch('news/upArticleStatus',data).then(res=> {
-        if(res.code==200){
+      this.$store.dispatch('news/upArticleStatus', data).then(res => {
+        if (res.code == 200) {
           this.$message({
             type: 'success',
             message: '操作成功!'
@@ -327,16 +339,16 @@ export default {
       })
     },
     //提交驳回内容
-    examineToServe(id){
+    examineToServe(id) {
       this.$refs.form.validate(valid => {
         if (valid) {
           let data = {
-            id:this.editId,
-            status:2,//驳回status
-            reason:this.form.reason
+            id: this.editId,
+            status: 2,//驳回status
+            reason: this.form.reason
           }
-          this.$store.dispatch('news/upArticleStatus',data).then(res=> {
-            if(res.code==200){
+          this.$store.dispatch('news/upArticleStatus', data).then(res => {
+            if (res.code == 200) {
               this.$message({
                 type: 'success',
                 message: '操作成功!'
@@ -346,13 +358,13 @@ export default {
               this.examineWindow = false;
             }
           })
-        }else{
+        } else {
           this.$message.error("驳回理由不能为空!")
         }
       })
     },
     //1.6 打开反选窗口
-    selectRow(cid,row){
+    selectRow(cid, row) {
       console.log(row)
       this.selectStatusWindow = true;
       //给与编辑的id
@@ -363,7 +375,7 @@ export default {
       let cidArr = cid.replace(/[\[\]]/g, '').split(',');
       // 获取数组的最后一个元素
       let cidLast = cidArr[cidArr.length - 1];
-      this.getWebsiteNavPoolSite(cidLast,row)
+      this.getWebsiteNavPoolSite(cidLast, row)
     },
     //1.7 列表内容分页
     //直接跳转
@@ -377,7 +389,7 @@ export default {
       this.getData();
     },
     //1.9 重置按钮
-    clearSearchList(){
+    clearSearchList() {
       this.tableData = [];
       this.getApiData.title = "";
       this.getApiData.category_name = "";
@@ -389,11 +401,11 @@ export default {
       this.getData();
     },
     //1.10 获取可选网站列表
-    getWebsiteNavPoolSite(cid,row){
+    getWebsiteNavPoolSite(cid, row) {
       this.loading = true;
       let ignoreIds = JSON.parse(row.ignore_ids);
       this.webSiteData = [];
-      this.$store.dispatch('news/getWebsiteNavPoolSite',{category_id:cid}).then(res=>{
+      this.$store.dispatch('news/getWebsiteNavPoolSite', { category_id: cid }).then(res => {
         // for(let item of res.data){
         //   if(item.website_name!=null){
         //     this.webSiteData.push(item)
@@ -401,10 +413,10 @@ export default {
         // }
         this.webSiteData = res.data;
         //延迟一会返显,否则可能显示不了
-        if(res.data.length>0&&ignoreIds!=null){
-          setTimeout(()=>{
-            for(let index in this.webSiteData){
-              if(ignoreIds.includes(this.webSiteData[index].website_id)){
+        if (res.data.length > 0 && ignoreIds != null) {
+          setTimeout(() => {
+            for (let index in this.webSiteData) {
+              if (ignoreIds.includes(this.webSiteData[index].website_id)) {
                 console.log(1234656)
                 console.log(index)
                 //调用回显方法
@@ -412,16 +424,16 @@ export default {
               }
             }
             this.loading = false;
-          },500)
-        }else{
+          }, 500)
+        } else {
           this.loading = false;
         }
       })
     },
     //1.11 提交选择的网站列表
-    selectWebSiteToServe(id){
+    selectWebSiteToServe(id) {
       let ids = [];
-      for(let item of this.ids){
+      for (let item of this.ids) {
         ids.push(item.website_id)
       }
       //把数组转换为字符串
@@ -429,25 +441,25 @@ export default {
       //把数组转换为字符串
       let idsStr = JSON.stringify(ids);
 
-      if(idsStr.length==0){
+      if (idsStr.length == 0) {
         this.$message.error("至少需要选择一个网站!")
         return;
-      }else{
+      } else {
         let data = {
-          id:this.editId,
-          ignore_ids:idsStr,
-          status:this.editStatus
+          id: this.editId,
+          ignore_ids: idsStr,
+          status: this.editStatus
         }
-        this.$store.dispatch('news/upArticleStatus',data).then(res=>{
+        this.$store.dispatch('news/upArticleStatus', data).then(res => {
           console.log(res)
-          if(res.code==200){
+          if (res.code == 200) {
             this.$message({
               type: 'success',
               message: '资讯绑定网站成功!'
             });
             this.selectStatusWindow = false;
             this.getData();
-          }else{
+          } else {
             this.$message.error(res.data.msg)
           }
         })
@@ -473,15 +485,15 @@ export default {
 
     //2.添加新闻 start ------------------------------------------------------------>
     //跳转到资讯发布页面
-    goCreat(){
+    goCreat() {
       this.$router.push({
         path: '/creatNews',
       });
     },
-    goEdit(id){
+    goEdit(id) {
       let data = {
-        id:id,
-        to:"examine"
+        id: id,
+        to: "examine"
       }
       this.$router.push({
         path: '/creatNews',
@@ -490,7 +502,7 @@ export default {
     }
     //添加新闻 end ------------------------------------------------------------>
   },
-  mounted(){
+  mounted() {
     this.creatNews_user_type = getUseType()
     //1.获得初始数据
     this.getData();
@@ -498,6 +510,4 @@ export default {
 }
 </script>
 
-<style scoped lang="less">
-
-</style>
+<style scoped lang="less"></style>

+ 27 - 30
src/views/news/ncomplaintList.vue

@@ -7,17 +7,24 @@
 
           <el-col :span="8">
             <div class="searchBox">
-              <div class="searchTitle">题:</div>
-              <el-input placeholder="请输入题" autocomplete="off" v-model="getApiData.title" />
+              <div class="searchTitle">投诉主题:</div>
+              <el-input placeholder="请输入投诉主题" autocomplete="off" v-model="getApiData.title" />
             </div>
           </el-col>
           <el-col :span="8">
             <div class="searchBox">
-              <div class="searchTitle">公告级别:</div>
-              <el-select v-model="getApiData.level" placeholder="请选择..">
-                <el-option label="常规" value="1"></el-option>
-                <el-option label="紧急" value="2"></el-option>
-                <el-option label="特急" value="3"></el-option>
+              <div class="searchTitle">投诉类型:</div>
+              <el-input placeholder="请输入投诉类型" autocomplete="off" v-model="getApiData.title" />
+            </div>
+          </el-col>
+          <el-col :span="8">
+            <div class="searchBox">
+              <div class="searchTitle">处理状态:</div>
+              <el-select v-model="getApiData.deal" placeholder="请处理状态..">
+                <el-option label="未处理" value="1"></el-option>
+                <el-option label="处理中" value="2"></el-option>
+                <el-option label="已完结" value="3"></el-option>
+                <el-option label="不予处理" value="4"></el-option>
               </el-select>
             </div>
           </el-col>
@@ -28,7 +35,7 @@
 
     <div class="layerBoxNoBg">
       <div>
-        <el-button type="primary" @click="goCreat">发布通知</el-button>
+        <el-button type="primary" @click="goCreat">发布投诉举报</el-button>
       </div>
       <div>
         <el-button @click="clearSearchList">重置</el-button>
@@ -44,22 +51,13 @@
         <template>
           <el-table :data="tableData" style="width: 100%">
             <el-table-column fixed prop="id" label="编号" width="50"></el-table-column>
-            <el-table-column prop="title" label="标题" width="">
-
+            <el-table-column prop="title" label="投诉主题" width="">
             </el-table-column>
-            <el-table-column prop="type" label="类型" width="">
-
-
-              <template slot-scope="scope">
-                <span v-if="scope.row.type == 1">
-                  公告
-                </span>
-                <span v-if="scope.row.type == 2">
-                  通知
-                </span>
-              </template>
+            <el-table-column prop="title" label="投诉类型" width="">
+            </el-table-column>
+            <el-table-column prop="type" label="接收人" width="">
             </el-table-column>
-            <el-table-column prop="level" label="级别" width="">
+            <el-table-column prop="level" label="处理状态" width="">
               <template slot-scope="scope">
                 <span v-if="scope.row.level == 1">
                   常规
@@ -72,10 +70,9 @@
                 </span>
               </template>
             </el-table-column>
-            <el-table-column prop="start" label="开始时间" width="">
+            <el-table-column prop="start" label="投诉时间" width="">
 
             </el-table-column>
-            <el-table-column prop="end" label="到期时间" width=""></el-table-column>
             <el-table-column prop="created_at" label="创建时间" width=""></el-table-column>
 
             <el-table-column fixed="right" label="操作" width="200" header-align="center">
@@ -120,7 +117,7 @@ export default {
   data() {
     return {
       //1.列表和分页相关 start ------------------------------------------------------------>
-      tableDivTitle: "通知列表",
+      tableDivTitle: "投诉列表",
       tableData: [],//内容
       editId: 0,//要修改的网站id
       getApiData: {
@@ -145,7 +142,7 @@ export default {
         this.getApiData.page = 1;
       }
       console.log(this.getApiData, '---1--')
-      this.$store.dispatch('news/getNoticeList', this.getApiData).then(res => {
+      this.$store.dispatch('news/getComplaintList', this.getApiData).then(res => {
         console.log(this.getApiData, '---2-')
         let data = [];
         for (let item of res.data.rows) {
@@ -163,7 +160,7 @@ export default {
         type: 'warning'
       }).then(() => {
         console.log("当前删除:" + id)
-        this.$store.dispatch('news/deleteNotice', { id: id }).then(res => {
+        this.$store.dispatch('news/deleteComplaint', { id: id }).then(res => {
           this.getData();
           this.$message({
             type: 'success',
@@ -188,7 +185,7 @@ export default {
         id: id,
         status: status
       }
-      this.$store.dispatch('news/upArticleStatus', data).then(res => {
+      this.$store.dispatch('news/upComplaintStatus', data).then(res => {
         if (res.code == 200) {
           this.$message({
             type: 'success',
@@ -228,7 +225,7 @@ export default {
     //跳转到通知发布页面
     goCreat() {
       this.$router.push({
-        path: '/addNotice',
+        path: '/addComplaint',
       });
     },
     goEdit(id) {
@@ -236,7 +233,7 @@ export default {
         id: id
       }
       this.$router.push({
-        path: '/addNotice',
+        path: '/addComplaint',
         query: data
       });
     }