Bladeren bron

南岸纠错后台管理前端

zwq 2 jaren geleden
bovenliggende
commit
2089894d62

+ 22 - 0
nngkxxdp/src/main/resources/static/naqwzsjtj/naqwzsjtj/src/api/rectification.js

@@ -0,0 +1,22 @@
+import request from '../utils/request'
+
+export default {
+  rectificationInfo(data) {
+    return request.get('rectification/info', data)
+  },
+  rectificationList() {
+    return request.get('rectification/list')
+  },
+  rectificationPage(data) {
+    return request.get('rectification/page', data)
+  },
+  rectificationAdd(data) {
+    return request.post('rectification/add', data)
+  },
+  rectificationUpdate(data) {
+    return request.post('rectification/update', data)
+  },
+  rectificationDelete(data) {
+    return request.post('rectification/delete', data)
+  }
+}

+ 21 - 1
nngkxxdp/src/main/resources/static/naqwzsjtj/naqwzsjtj/src/router/index.js

@@ -29,6 +29,7 @@ import SupplyTimeManage from '../views/canteen/SupplyTimeManage' // 供应时间
 import EvaluationManage from '../views/canteen/EvaluationManage'
 import Comments from "../views/comments/Comments"; // 评价管理
 import PolicyDelivery from '@/views/policyDelivery/PolicyDeliveryIndex' //政策兑现
+import Rectification from '@/views/rectification/RectificationIndex' //纠错管理
 
 export const constantRoutes = [{
     path: '/redirect',
@@ -314,7 +315,26 @@ export const constantRoutes = [{
         }
       }
     ]
-  }
+  },
+	{
+	  path: '/rectification',
+	  component: Layout,
+	  redirect: '/rectification/index',
+	  name: 'rectification',
+	  meta: {
+	    title: '纠错管理',
+	    icon: 'el-icon-star-off'
+	  },
+	  children: [{
+	      path: 'index',
+	      component: Rectification,
+	      name: 'Rectification',
+	      meta: {
+	        title: '纠错管理'
+	      }
+	    }
+	  ]
+	}
 ]
 
 export const asyncRoutes = []

+ 9 - 0
nngkxxdp/src/main/resources/static/naqwzsjtj/naqwzsjtj/src/utils/tool.js

@@ -1,5 +1,14 @@
 import moment from 'moment'
 
+export const getTypeName = (value, types) => {
+		var item = types.find((t) => t.value === value)
+		if (item && item.label) {
+			return item.label
+		} else {
+			return '未知'
+		}
+}
+
 export const parseTime = (time) => {
   if (time) {
     return moment(time).format('YYYY-MM-DD HH:mm:ss')

+ 454 - 0
nngkxxdp/src/main/resources/static/naqwzsjtj/naqwzsjtj/src/views/rectification/RectificationIndex.vue

@@ -0,0 +1,454 @@
+<template>
+  <div class="yxnaContent">
+    <!-- 操作栏 -->
+    <div style="display: flex;justify-content: space-between;margin-bottom: 10px;height: 40px;">
+      <div>
+        <el-button type="primary" class="add" @click="showAddForm">新增</el-button>
+      </div>
+      <!-- 搜索参数需自行处理 -->
+      <div style="display: flex">
+        <el-form ref="searchForm" :model="searchForm" :inline="true">
+          <el-form-item prop="name" label="">
+            <el-input
+              v-model.trim="searchForm.name"
+              clearable
+              placeholder="请输入名称"
+              style="margin: 0 10px;width: 200px"
+            />
+          </el-form-item>
+          <el-form-item prop="status" label="">
+            <el-select v-model="searchForm.status" placeholder="请选择类型" style="margin-right: 10px;width: 200px">
+              <el-option
+                v-for="(item, index) in rectificationState"
+                :key="index"
+                :value="item.value"
+                :label="item.label"
+              />
+            </el-select>
+          </el-form-item>
+          <el-form-item>
+            <el-button type="primary" class="search" @click="submitSearch">搜索</el-button>
+            <el-button type="primary" class="search" style="margin-left: 5px" @click="resetSearch">重置</el-button>
+          </el-form-item>
+        </el-form>
+      </div>
+    </div>
+    <!-- 数据 -->
+    <div class="main-panel-table">
+      <el-table
+        ref="multipleTable"
+        v-loading="table.loading"
+        :data="table.data"
+        border
+        :height="tableH"
+        stripe
+        :header-cell-style="{ background: '#e5e8ed', color: '#666', textAlign: 'center' }"
+        :cell-style="tableStyle"
+        style="cursor: default"
+      >
+        <el-table-column width="50" label="序号">
+          <template slot-scope="scope">
+            {{ (sorts.page - 1) * sorts.limit + scope.$index + 1 }}
+          </template>
+        </el-table-column>
+        <el-table-column
+          v-for="(item, index) in filteredTableColumns"
+          :key="index"
+          :label="item.label"
+          :show-overflow-tooltip="true"
+          :width="item.width"
+          :min-width="item.minWidth"
+          :align="item.align"
+        >
+          <template slot-scope="scope">
+            <img v-if="item.img" :src="(scope.row[item.prop])" alt="" width="70" height="70">
+            <span v-else>
+              {{
+                item.transform
+                  ? item.transform(scope.row[item.prop], scope.row)
+                  : scope.row[item.prop] || ''
+              }}
+            </span>
+          </template>
+        </el-table-column>
+        <el-table-column :width="210" label="操作" align="center">
+          <template slot-scope="scope">
+            <el-button class="but" type="primary" @click="showEditForm(scope.row.id)">
+              编辑
+            </el-button>
+            <el-button class="but" type="danger" @click="del(scope.row.id)">
+              删除
+            </el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+      <!-- 分页 -->
+      <div class="block">
+        <el-pagination
+          :current-page="sorts.page"
+          :page-sizes="[10, 20, 30, 40, 50]"
+          :page-size="sorts.limit"
+          layout="prev, pager,next,jumper,total,sizes"
+          :total="sorts.total"
+          @size-change="handleSizeChange"
+          @current-change="handleCurrentChange"
+        >
+        </el-pagination>
+      </div>
+    </div>
+
+    <rectification-edit ref="refRectificationEdit" @update-table="getData" />
+  </div>
+</template>
+<script>
+import RectificationEdit from './components/RectificationEdit'
+import rectificationApi from '@/api/rectification'
+import { parseTime, getTypeName } from '@/utils/tool'
+import { rectificationState, questionType, equipmentType } from './constants/codeConsts'
+
+export default {
+  name: 'Rectification',
+  components: {
+    RectificationEdit
+  },
+  data() {
+    return {
+      searchForm: {
+        // 用于同步输入
+        name: '',
+        status: '' // 状态 【0:禁用 1:启用】
+      },
+      rectificationState,
+      tableH: 'calc(100vh - 230px)',
+      tableStyle: {
+        textAlign: 'center'
+      },
+      searchParams: {}, // 用于搜索的数据
+      table: {
+        data: [],
+        loading: false,
+        columns: [
+          {
+            label: '问题类型',
+            prop: 'questionType',
+						transform(value) {
+						  return getTypeName(value, questionType)
+						},
+            checked: true // 动态列
+          },
+          {
+            label: '问题页面网址',
+            prop: 'errorUrl',
+						width: 130,
+            checked: true // 动态列
+          },
+          {
+            label: '截图',
+            prop: 'picture',
+            checked: true // 动态列
+          },
+          {
+            label: '描述',
+            prop: 'questionDescription',
+            checked: true // 动态列
+          },
+          {
+            label: '办理状态',
+            prop: 'status',
+						transform(value) {
+						  return getTypeName(value, rectificationState)
+						},
+            checked: true // 动态列
+          },
+          {
+            label: '提交人',
+            prop: 'submitter',
+            checked: true // 动态列
+          },
+          {
+            label: '邮箱',
+            prop: 'mail',
+            checked: true // 动态列
+          },
+          {
+            label: '手机号',
+            prop: 'phone',
+            checked: true // 动态列
+          },
+          {
+            label: '设备类型',
+            prop: 'equipment',
+						transform(value) {
+						  return getTypeName(value, equipmentType)
+						},
+            checked: true // 动态列
+          },
+          {
+            label: '创建时间',
+            prop: 'createTime',
+            transform(value) {
+              return parseTime(value)
+            },
+            width: 160,
+            checked: true // 动态列
+          },
+          {
+            label: '办结时间',
+            prop: 'finishTime',
+						width: 160,
+            checked: true // 动态列
+          },
+        
+        ]
+      },
+      sorts: {
+        total: 0, // 条目总数
+        page: 1, // 当前页
+        limit: 10 // 每页条数
+      }
+    }
+  },
+  computed: {
+    filteredTableColumns() {
+      return this.table.columns.filter((item) => {
+        return item.checked === true
+      })
+    }
+  },
+  mounted() {
+    this.submitSearch()
+  },
+  methods: {
+    showAddForm() {
+      this.$refs.refRectificationEdit.showEditForm()
+    },
+    showEditForm(id) {
+      this.$refs.refRectificationEdit.showEditForm(id)
+    },
+    del(id) {
+      const message = '您确定要删除该数据吗'
+      this.$confirm(message, '提示', {
+        cancelButtonClass: 'btn-custom-cancel',
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      })
+        .then(() => {
+          rectificationApi.rectificationDelete(id).then(res => {
+            if (res.data.result) {
+              this.$message({
+                type: 'success',
+                message: '删除成功!'
+              })
+              this.getData()
+            } else {
+              this.$message({
+                type: 'info',
+                message: '删除失败!'
+              })
+            }
+          })
+        })
+        .catch(() => {})
+    },
+    submitSearch() {
+      this.searchParams = { ...this.searchForm }
+      this.sorts.page = 1
+      this.getData()
+    },
+    // 切换列表条数
+    handleSizeChange(pageSize) {
+      this.sorts.limit = pageSize
+      this.sorts.page = 1
+      this.getData()
+    },
+    // 切换页码
+    handleCurrentChange(currentPage) {
+      this.$refs.multipleTable.bodyWrapper.scrollTop = 0
+      this.sorts.page = currentPage
+      this.getData()
+    },
+    resetSearch() {
+      this.$refs.searchForm.resetFields()
+      this.submitSearch()
+    },
+    afterPageChange() {
+      this.getData()
+    },
+    getData() {
+      this.table.loading = true
+      const params = {
+        page: this.sorts.page,
+        limit: this.sorts.limit,
+        ...this.searchParams
+      }
+      rectificationApi.rectificationPage({ params }).then((data) => {
+        const ret = data.data || []
+        this.table.data = ret.data
+        this.sorts.total = Number(ret.count)
+      }).finally(() => {
+        this.table.loading = false
+      })
+    }
+  }
+}
+</script>
+
+<style>
+    /* 全局取消按钮 */
+    .btn-custom-cancel {
+        margin-left: 10px !important;
+        float: right;
+    }
+</style>
+
+<style scoped lang="less">
+    /* 禁用后的勾选*/
+    /deep/ .el-checkbox__input.is-disabled.is-checked .el-checkbox__inner::after {
+        border-color: #def5cb;
+    }
+
+    /deep/ .el-checkbox__input.is-disabled.is-checked .el-checkbox__inner {
+        background-color: #157de9;
+        border-color: #DCDFE6;
+    }
+
+    /deep/ .el-dialog__body {
+        // padding: 0 0 30px 20px;
+        color: #606266;
+        font-size: 14px;
+        word-break: break-all;
+    }
+
+    /deep/ .el-dialog {
+        margin: 0 auto 0;
+    }
+
+    /deep/ .el-form-item__label {
+        padding: 0;
+    }
+
+    .yxnaContent {
+        padding: 10px;
+    }
+
+    .addTitle {
+        font-size: 18px;
+        font-weight: bold;
+        margin-bottom: 10px;
+    }
+
+    .add {
+        width: 66px;
+        height: 38px;
+        margin-left: 0;
+    }
+
+    /deep/ .el-col-12 {
+        width: 50%;
+        text-align: left;
+    }
+
+    .search {
+        width: 66px;
+        height: 38px;
+        margin-left: 0;
+    }
+
+    /deep/ .el-form-item__label {
+        // height: 40px;
+        // width: 110px;
+        // background-color: #FAFAFA;
+        text-align: center;
+        // border: 1px solid #DCDFE6;
+        // border-radius: 2px 0 0 2px;
+    }
+
+    /deep/ .el-button.is-disabled {
+        color: #C0C4CC !important;
+    }
+
+    /deep/.el-button--primary.is-disabled {
+        color: #FFF !important;
+    }
+
+    /deep/ .el-input__inner {
+        border-radius: 2px 0 0 2px;
+    }
+
+    .el-select>.el-input {
+        width: 200px;
+    }
+
+    /deep/ .el-textarea__inner {
+        height: 100px;
+    }
+
+    /deep/ .el-dialog__title {
+        font-size: 14px;
+    }
+
+    /deep/ .el-pagination__total {
+        margin-left: 10px !important;
+    }
+
+    .el-pagination {
+        margin: 0;
+        margin-top: 10px;
+        /* position: fixed;
+        left: 13rem; */
+    }
+
+    /deep/ .el-table--scrollable-x .el-table__body-wrapper {
+        z-index: 2;
+    }
+
+    .but {
+        width: 36px;
+        height: 22px;
+        padding: 0;
+        font-size: 12px;
+    }
+
+    .el-checkbox {
+        margin: 0;
+        margin-right: 10px;
+    }
+
+    /deep/ .bewrite>.el-form-item__label {
+        width: 100%;
+        text-align: left;
+        padding-left: 21px;
+    }
+
+    /deep/ .el-form--inline .el-form-item {
+        margin-right: 0px;
+    }
+
+    /deep/ [data-v-2cde7735] .el-form-item__label {
+        border: 1px solid #DCDFE6;
+        /*border-right: transparent;*/
+    }
+
+    /*    空白框*/
+    /deep/ .formTempBox {
+        height: 38px;
+        border: 1px solid #DCDFE6;
+        width: 100%;
+        border-left: transparent;
+        background-color: #FAFAFA;
+    }
+
+    /deep/ .input-star>.el-form-item__label:before {
+        content: "*";
+        color: #f56c6c;
+        margin-right: 4px;
+    }
+
+    // 去除上传组件动画过渡效果
+    /deep/ .el-upload-list__item {
+        transition: none !important;
+    }
+</style>
+
+

+ 180 - 0
nngkxxdp/src/main/resources/static/naqwzsjtj/naqwzsjtj/src/views/rectification/components/RectificationEdit.vue

@@ -0,0 +1,180 @@
+<template>
+  <el-dialog title="" :close-on-click-modal="false" class="detailDialog" :modal-append-to-body="false" append-to-body width="40%" :visible.sync="dialog.visible" @closed="afterFormClosed">
+    <div slot="title" style="height: 10px;">
+      <div class="addTitle">{{ dialog.title }}</div>
+    </div>
+    <el-form ref="refForm" v-loading="form.loading" :model="form" :rules="rules" label-width="80px">
+      <el-form-item prop="questionType" label="问题类型">
+        <el-input v-model="form.questionType" placeholder="问题类型" maxlength="255" />
+      </el-form-item>
+      <el-form-item prop="errorUrl" label="问题页面网址">
+        <el-input v-model="form.errorUrl" placeholder="问题页面网址" maxlength="255" />
+      </el-form-item>
+      <el-form-item prop="picture" label="截图">
+        <el-input v-model="form.picture" placeholder="截图" maxlength="255" />
+      </el-form-item>
+      <el-form-item prop="questionDescription" label="描述">
+        <el-input v-model="form.questionDescription" placeholder="描述" maxlength="255" />
+      </el-form-item>
+      <el-form-item prop="status" label="办理状态">
+        <el-input v-model="form.status" placeholder="办理状态" maxlength="255" />
+      </el-form-item>
+      <el-form-item prop="submitter" label="提交人姓名">
+        <el-input v-model="form.submitter" placeholder="提交人姓名" maxlength="255" />
+      </el-form-item>
+      <el-form-item prop="mail" label="邮箱">
+        <el-input v-model="form.mail" placeholder="邮箱" maxlength="255" />
+      </el-form-item>
+      <el-form-item prop="phone" label="手机号">
+        <el-input v-model="form.phone" placeholder="手机号" maxlength="255" />
+      </el-form-item>
+      <el-form-item prop="equipment" label="设备类型">
+        <el-input v-model="form.equipment" placeholder="设备类型" maxlength="255" />
+      </el-form-item>
+      <el-form-item prop="finishTime" label="办结时间">
+        <el-input v-model="form.finishTime" placeholder="办结时间" maxlength="255" />
+      </el-form-item>
+    </el-form>
+    <div slot="footer">
+      <el-button type="primary" @click="submitForm">提交</el-button>
+      <el-button @click="dialog.visible = false">返回</el-button>
+    </div>
+  </el-dialog>
+</template>
+
+<script>
+import { isEmpty } from '@/utils/tool'
+import rectificationApi from '@/api/rectification'
+
+export default {
+  name: 'RectificationEdit',
+  components: {},
+  data() {
+    return {
+      data: [], // 数据
+      form: {
+        id: '', // id
+        questionType: '', // 问题类型【0:功能无法使用 1:内容无法访问 2:信息不更新 3:内容不准确 4:咨询互动不回应 5:错别字 6:虚假伪造内容 7:其它】
+        errorUrl: '', // 问题页面网址
+        picture: '', // 截图
+        questionDescription: '', // 描述
+        status: '', // 办理状态【0:未处理 1:已处理】
+        submitter: '', // 提交人姓名
+        mail: '', // 邮箱
+        phone: '', // 手机号
+        equipment: '', // 设备类型【0:首页 1:小程序 2:智能问答服务兜底问题 3:政策问答库提问】
+        finishTime: '', // 办结时间
+        loading: false
+      },
+      rules: {
+        name: [
+          { required: true, message: '请输入名称', trigger: 'blur' }
+        ]
+      },
+      dialog: {
+        title: '',
+        visible: false
+      }
+    }
+  },
+  computed: {},
+  methods: {
+    submitForm() {
+      this.$refs.refForm.validate().then(() => {
+        if (isEmpty(this.form.id)) {
+          rectificationApi.rectificationAdd({
+            ...this.form
+          }).then(res => {
+            if (res.data.result) {
+              this.$message({
+                type: 'success',
+                message: '添加成功!'
+              })
+              this.dialog.visible = false
+              this.$emit('update-table')
+            } else {
+              this.$message({
+                type: 'info',
+                message: res.data.msg
+              })
+            }
+          })
+        } else {
+          rectificationApi.rectificationUpdate({
+            ...this.form
+          }).then(res => {
+            if (res.data.result) {
+              this.$message({
+                type: 'success',
+                message: '修改成功!'
+              })
+              this.dialog.visible = false
+              this.$emit('update-table')
+            } else {
+              this.$message({
+                type: 'info',
+                message: res.data.msg
+              })
+            }
+          })
+        }
+      }).catch(() => {
+        console.log('验证失败')
+      })
+    },
+    showEditForm(id) {
+      this.dialog.visible = true
+      this.form.loading = true
+      this.form.loading = false
+      if (id) {
+        this.dialog.title = '编辑'
+        this.form.id = id
+        const params = {
+          id: id
+        }
+        rectificationApi.rectificationInfo({ params }).then((res) => {
+          const ret = res.data.data || []
+          this.form = ret
+        })
+      } else {
+        this.dialog.title = '新增'
+        this.form = {
+          id: '', // id
+          questionType: '', // 问题类型【0:功能无法使用 1:内容无法访问 2:信息不更新 3:内容不准确 4:咨询互动不回应 5:错别字 6:虚假伪造内容 7:其它】
+          errorUrl: '', // 问题页面网址
+          picture: '', // 截图
+          questionDescription: '', // 描述
+          status: '', // 办理状态【0:未处理 1:已处理】
+          submitter: '', // 提交人姓名
+          mail: '', // 邮箱
+          phone: '', // 手机号
+          equipment: '', // 设备类型【0:首页 1:小程序 2:智能问答服务兜底问题 3:政策问答库提问】
+          finishTime: '', // 办结时间
+          loading: false
+        }
+      }
+    },
+    afterFormClosed() {
+      this.$refs.refForm.resetFields()
+      this.form.id = null
+    }
+  }
+}
+</script>
+
+<style lang="less" scoped>
+.menu-edit {
+  .color {
+    position: absolute;
+    right: 2px;
+    top: 2px;
+    z-index: 3;
+  }
+}
+
+.addTitle {
+        font-size: 18px;
+        font-weight: bold;
+    }
+</style>
+

+ 69 - 0
nngkxxdp/src/main/resources/static/naqwzsjtj/naqwzsjtj/src/views/rectification/constants/codeConsts.js

@@ -0,0 +1,69 @@
+export const rectificationState = [
+  {
+    // 状态
+    value: 0,
+    label: '未处理'
+  },
+  {
+    value: 1,
+    label: '已处理'
+  }
+]
+
+// 问题类型
+export const questionType = [
+  {
+    // 状态
+    value: 0,
+    label: '功能无法使用'
+  },
+  {
+    value: 1,
+    label: '内容无法访问'
+  },
+  {
+    value: 2,
+    label: '信息不更新'
+  },
+  {
+    value: 3,
+    label: '内容不准确'
+  },
+  {
+    value: 4,
+    label: '咨询互动不回应'
+  },
+  {
+    value: 5,
+    label: '错别字'
+  },
+  {
+    value: 6,
+    label: '虚假伪造内容'
+  },
+  {
+    value: 7,
+    label: '其它'
+  }
+]
+
+// 设备来源
+export const equipmentType = [
+  {
+    // 状态
+    value: 0,
+    label: '首页'
+  },
+  {
+    value: 1,
+    label: '小程序'
+  },
+  {
+    value: 2,
+    label: '智能问答服务兜底问题'
+  },
+  {
+    value: 3,
+    label: '政策问答库提问'
+  }
+]