明梦爽
2022-04-17 5529b7077126be368abd444d45ec085d8c7779e3
eslint语法规范
35个文件已修改
5个文件已添加
1个文件已删除
10514 ■■■■ 已修改文件
.eslintrc.js 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
package-lock.json 7231 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
package.json 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/App.vue 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/api.js 40 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/Administrator/AdEdit.vue 127 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/Administrator/AdMain.vue 448 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/Administrator/AdminHome.vue 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/Administrator/Edit copy.vue 66 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/Administrator/Edit.vue 193 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/Administrator/EditLunBo.vue 170 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/Administrator/Main copy.vue 405 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/Administrator/Main.vue 444 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/Administrator/Welcome.vue 61 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/Home.vue 47 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/Login.vue 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/NotFound.vue 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/globalTitle.vue 29 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/page/News.vue 54 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/page/banShiZhiNan.vue 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/page/index.vue 80 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/page/introduce.vue 103 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/page/kePuFengCai.vue 110 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/page/keXieXiangMu.vue 63 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/page/telephone.vue 50 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/page/xueShuJiaoLiu.vue 110 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/page/xueXiaoShouYe.vue 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/page/zhengce.vue 116 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main.js 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/router.js 155 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/request.js 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/homePage/moreMessage.vue 170 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/notice.vue 43 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/other.vue 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/school.vue 48 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/work.vue 54 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
后端API接口服务/static/images/036dc279-73bb-4f9c-9a8c-80c3d7b32408.png 补丁 | 查看 | 原始文档 | blame | 历史
后端API接口服务/static/images/1273facb-e9c9-415e-949a-4c71853c8785.png 补丁 | 查看 | 原始文档 | blame | 历史
后端API接口服务/static/images/349d3ef1-f9d7-46c0-8e17-37daf863c87f.png 补丁 | 查看 | 原始文档 | blame | 历史
后端API接口服务/static/images/4913f227-7009-4bf1-8c07-eb69156f09ce.png 补丁 | 查看 | 原始文档 | blame | 历史
后端API接口服务/static/images/62cefc6b-54a8-4e8c-a250-0e0cd4ba4e20.png 补丁 | 查看 | 原始文档 | blame | 历史
.eslintrc.js
File was deleted
package-lock.json
Diff too large
package.json
@@ -21,13 +21,9 @@
  },
  "devDependencies": {
    "@vue/cli-plugin-babel": "^3.4.0",
    "@vue/cli-plugin-eslint": "^3.4.0",
    "@vue/cli-service": "^3.4.0",
    "@vue/eslint-config-standard": "^4.0.0",
    "babel-eslint": "^10.0.1",
    "babel-plugin-component": "^1.1.1",
    "eslint": "^5.8.0",
    "eslint-plugin-vue": "^5.0.0",
    "less": "^3.9.0",
    "less-loader": "^4.1.0",
    "quill-image-extend-module": "^1.1.2",
src/App.vue
@@ -11,5 +11,4 @@
}
</script>
<style>
</style>
<style></style>
src/api/api.js
@@ -1,6 +1,6 @@
//用于写接口
// ç”¨äºŽå†™æŽ¥å£
import request from "../utils/request";
import request from '../utils/request'
// // å¯¼èˆªæ åˆ—表
// export const getNavList = data => {
//   return request({
@@ -9,53 +9,53 @@
//     params:data,
//   })
// }
//获取小标题
// èŽ·å–å°æ ‡é¢˜
export const getMinTitle = data => {
  return request({
    method: 'GET',
    url: `/news_category/list/${data}`,
    url: `/news_category/list/${data}`
  })
}
//获取新闻列表
// èŽ·å–æ–°é—»åˆ—è¡¨
export const getNewsList = data => {
  return request({
    method: 'POST',
    url: '/news/list',
    params: data,
    params: data
  })
}
//获取只有一篇新闻
// èŽ·å–åªæœ‰ä¸€ç¯‡æ–°é—»
export const getnew = data => {
  return request({
    method: 'GET',
    url: `/news/main/${data}`
  })
}
//修改新闻
// ä¿®æ”¹æ–°é—»
export const update = data => {
  return request({
    method: 'POST',
    url: '/news/update',
    params: data,
    params: data
  })
}
//删除新闻
// åˆ é™¤æ–°é—»
export const deleteNew = data => {
  return request({
    method: 'POST',
    url: '/news/delete',
    params: data,
    params: data
  })
}
//模糊查询
// æ¨¡ç³ŠæŸ¥è¯¢
export const fuzzy = data => {
  return request({
    method: 'POST',
    url: '/news/fuzzy',
    params: data,
    params: data
  })
}
//添加新闻
// æ·»åŠ æ–°é—»
export const add = (data, fd) => {
  return request({
    method: 'POST',
@@ -64,7 +64,7 @@
    data: fd
  })
}
//登录
// ç™»å½•
export const login = data => {
  return request({
    method: 'POST',
@@ -72,14 +72,14 @@
    params: data
  })
}
//获取普通管理员列表
// èŽ·å–æ™®é€šç®¡ç†å‘˜åˆ—è¡¨
export const getmain = () => {
  return request({
    method: 'GET',
    url: '/admin/list'
  })
}
//超管修改普管账号密码
// è¶…管修改普管账号密码
export const editAccount = data => {
  return request({
    method: 'POST',
@@ -87,7 +87,7 @@
    params: data
  })
}
//删除普通管理员
// åˆ é™¤æ™®é€šç®¡ç†å‘˜
export const deleteAd = data => {
  return request({
    method: 'POST',
@@ -95,7 +95,7 @@
    params: data
  })
}
//注册普通管理员
// æ³¨å†Œæ™®é€šç®¡ç†å‘˜
export const addAd = data => {
  return request({
    method: 'POST',
@@ -103,7 +103,7 @@
    params: data
  })
}
//文件上传
// æ–‡ä»¶ä¸Šä¼ 
export const fileUpload = fd => {
  return request({
    method: 'POST',
src/components/Administrator/AdEdit.vue
@@ -1,24 +1,16 @@
<template>
  <div>
    <el-card class="box-card">
      <el-button type="primary" @click="add()" icon="el-icon-circle-plus" class='add'>注册新的管理员账号</el-button>
      <el-button type="primary" @click="add()" icon="el-icon-circle-plus" class="add">注册新的管理员账号</el-button>
      <!-- æ–°é—»è¡¨æ ¼åŒºåŸŸ -->
      <el-table
        :data="tableData"
        border
        style="width: 100%"
        :header-cell-style="{textAlign: 'center'}"
        :cell-style="{ textAlign: 'center' }"
      >
      <el-table :data="tableData" border style="width: 100%" :header-cell-style="{ textAlign: 'center' }" :cell-style="{ textAlign: 'center' }">
        <el-table-column type="index" label="序号" width="50">
          <!-- <template slot-scope="scope">
            <span>{{ (currentPage-1)*pageSize+scope.$index+1 }}</span>
          </template> -->
        </el-table-column>
        <el-table-column prop="username" label="普通管理员账号" width="" >
        </el-table-column>
        <el-table-column prop="id" label="id" width="">
        </el-table-column>
        <el-table-column prop="username" label="普通管理员账号" width=""> </el-table-column>
        <el-table-column prop="id" label="id" width=""> </el-table-column>
        <el-table-column label="操作" width="">
          <template slot-scope="scope">
            <!-- {{ scope.row.id }} -->
@@ -27,18 +19,13 @@
              <el-button type="danger" @click="deleteAds(scope.row.id)" icon="el-icon-delete"></el-button>
            </div>
          </template>
        </el-table-column>
      </el-table>
    </el-card>
    <!-- ä¿®æ”¹è´¦æˆ·çš„对话框 -->
    <el-dialog
      title="修改普通管理员密码"
      :visible.sync="editDialogVisible"
      width="50%"
      @close="editClose">
    <el-dialog title="修改普通管理员密码" :visible.sync="editDialogVisible" width="50%" @close="editClose">
      <!-- rules表单验证规则,ref当前表单的验证对象 -->
      <el-form ref="editFormRef" :model="editForm"  label-width="80px" status-icon>
      <el-form ref="editFormRef" :model="editForm" label-width="80px" status-icon>
        <el-form-item label="用户名:">
          <el-input v-model="editForm.username" prefix-icon="iconfont icon-user" placeholder="请输入账号" clearable=""></el-input>
        </el-form-item>
@@ -55,13 +42,9 @@
      </span>
    </el-dialog>
    <!-- æ·»åŠ ç®¡ç†å‘˜å¯¹è¯æ¡† -->
    <el-dialog
      title="添加普通管理员"
      :visible.sync="addDialogVisible"
      width="50%"
      @close="addClose">
    <el-dialog title="添加普通管理员" :visible.sync="addDialogVisible" width="50%" @close="addClose">
      <!-- rules表单验证规则,ref当前表单的验证对象 -->
      <el-form ref="addFormRef" :model="addForm"  label-width="80px" status-icon>
      <el-form ref="addFormRef" :model="addForm" label-width="80px" status-icon>
        <el-form-item label="用户名:">
          <el-input v-model="addForm.username" prefix-icon="iconfont icon-user" placeholder="请输入账号" clearable=""></el-input>
        </el-form-item>
@@ -78,65 +61,65 @@
</template>
<script>
import { getmain,editAccount,deleteAd,addAd } from '../../api/api'
import { getmain, editAccount, deleteAd, addAd } from '../../api/api'
export default {
  data() {
    return {
      tableData:[], //普通管理员列表
      editDialogVisible:false,
      addDialogVisible:false,
      editForm:{ username:'',oldPassword:'',password:'' },  //修改表单对象
      addForm:{ username:'',password:'' }  //添加管理对象
      tableData: [], //普通管理员列表
      editDialogVisible: false,
      addDialogVisible: false,
      editForm: { username: '', oldPassword: '', password: '' }, //修改表单对象
      addForm: { username: '', password: '' } //添加管理对象
    }
  },
  created(){
  created() {
    this.ready()
  },
  methods:{
  methods: {
    //获取铺管列表
    ready(){
    ready() {
      getmain().then(res => {
        // console.log(res);
        if(res.code == 200){
        if (res.code == 200) {
          this.tableData = res.data
        }
      })
    },
    //展示编辑对话框
    showEditDialog(){
    showEditDialog() {
      this.editDialogVisible = true
    },
    editClose(){
      this.editForm.username = '';
      this.editForm.oldPassword = '';
      this.editForm.password = '';
    editClose() {
      this.editForm.username = ''
      this.editForm.oldPassword = ''
      this.editForm.password = ''
    },
    cancel(){
      this.editForm.username = '';
      this.editForm.oldPassword = '';
      this.editForm.password = '';
    cancel() {
      this.editForm.username = ''
      this.editForm.oldPassword = ''
      this.editForm.password = ''
      this.editDialogVisible = false
    },
    //编辑确定事件
    subEdit(){
    subEdit() {
      const data = {
        username:this.editForm.username,
        oldPassword:this.editForm.oldPassword,
        password:this.editForm.password
        username: this.editForm.username,
        oldPassword: this.editForm.oldPassword,
        password: this.editForm.password
      }
      editAccount(data).then(res => {
        // console.log(res);
        if(res.code == 200){
        if (res.code == 200) {
          this.$message.success('账户修改成功')
          this.editDialogVisible = false
          this.ready()
        }else{
        } else {
          this.$message.error('账户修改失败')
        }
      })
    },
    //删除普通管理员
    async deleteAds(id){
    async deleteAds(id) {
      // console.log(id);
      const res = await this.$confirm('此操作将永久删除该管理账号, æ˜¯å¦ç»§ç»­?', '提示', {
        confirmButtonText: '确定',
@@ -147,63 +130,61 @@
      })
      //如果用户点击确定则返回confirm
      //如果用户点击取消则返回cancel
      console.log(res);
      if(res !== 'confirm'){
      console.log(res)
      if (res !== 'confirm') {
        return this.$message.info('已取消删除~')
      }else{
      } else {
        // console.log(id);
        const data = {
          id:id
          id: id
        }
        //参数data è¦ä»¥å¯¹è±¡çš„形式传入
        deleteAd(data).then(res => {
          // console.log('>>>'+res);
          if(res.code == 200){
          if (res.code == 200) {
            this.$message.success('删除成功!')
            this.ready()
          }else{
          } else {
            return this.$message.error('删除失败!')
          }
        })
      }
    },
    add(){
    add() {
      this.addDialogVisible = true
    },
    //注册取消清空
    canceladd(){
      this.addForm.username = '';
      this.addForm.password = '';
    canceladd() {
      this.addForm.username = ''
      this.addForm.password = ''
      this.addDialogVisible = false
    },
    addClose(){
      this.addForm.username = '';
      this.addForm.password = '';
    addClose() {
      this.addForm.username = ''
      this.addForm.password = ''
    },
    //注册提交
    addEdit(){
    addEdit() {
      const data = {
        username:this.addForm.username,
        password:this.addForm.password
        username: this.addForm.username,
        password: this.addForm.password
      }
      addAd(data).then(res => {
        if(res.code == 200){
        if (res.code == 200) {
          this.$message.success('注册成功')
          this.addDialogVisible = false
          this.ready()
        }else{
        } else {
          this.$message.error('注册失败')
        }
      })
    }
  }
}
</script>
<style lang="less" scoped>
.add{
.add {
  margin-bottom: 10px;
}
</style>
</style>
src/components/Administrator/AdMain.vue
@@ -3,14 +3,7 @@
    <!-- çº§è”选择器 -->
    <el-row class="block">
      <el-col :span="4">
        <el-cascader
          v-model="value"
          :options="options"
          clearable
          filterable
          :getCheckedNodes="true"
          @change="handleChange">
        </el-cascader>
        <el-cascader v-model="value" :options="options" clearable filterable :getCheckedNodes="true" @change="handleChange"> </el-cascader>
      </el-col>
      <el-col :span="5">
        <el-button type="primary" icon="el-icon-edit" @click="goAdEdit()">点击对普通管理员进行管理</el-button>
@@ -25,29 +18,25 @@
          </el-col>
          <el-col :span="10">
            <!-- æ–°é—»æœç´¢ -->
            <el-input clearable placeholder="请输入所要查询的新闻标题" v-model="search" class="input-with-select">
            </el-input>
            <el-input clearable placeholder="请输入所要查询的新闻标题" v-model="search" class="input-with-select"> </el-input>
          </el-col>
        </el-row>
        <!-- æ–°é—»è¡¨æ ¼åŒºåŸŸ -->
        <el-table
        <el-table
          :data="tableData.filter(data => !search || data.title.toLowerCase().includes(search.toLowerCase()))"
          border
          style="width: 100%"
          :header-cell-style="{textAlign: 'center'}"
          border
          style="width: 100%"
          :header-cell-style="{ textAlign: 'center' }"
          :cell-style="{ textAlign: 'center' }"
        >
          <el-table-column type="index" label="序号" width="50">
            <template slot-scope="scope">
              <span>{{ (currentPage-1)*pageSize+scope.$index+1 }}</span>
              <span>{{ (currentPage - 1) * pageSize + scope.$index + 1 }}</span>
            </template>
          </el-table-column>
          <el-table-column prop="releaseTime" label="日期" width="" >
          </el-table-column>
          <el-table-column prop="title" label="新闻标题" width="">
          </el-table-column>
          <el-table-column prop="id" label="id" width="">
          </el-table-column>
          <el-table-column prop="releaseTime" label="日期" width=""> </el-table-column>
          <el-table-column prop="title" label="新闻标题" width=""> </el-table-column>
          <el-table-column prop="id" label="id" width=""> </el-table-column>
          <el-table-column label="操作" width="">
            <template slot-scope="scope">
              <!-- {{ scope.row.id }} -->
@@ -57,7 +46,6 @@
                <el-button type="info" @click="deleteNews(scope.row.id)">删除</el-button>
              </div>
            </template>
          </el-table-column>
        </el-table>
        <!-- åˆ†é¡µ -->
@@ -68,22 +56,19 @@
              @size-change="handleSizeChange"
              @current-change="handleCurrentChange"
              :current-page="currentPage"
              :page-sizes="[6,12, 18,]"
              :page-sizes="[6, 12, 18]"
              :page-size="100"
              layout="total, sizes, prev, pager, next, jumper"
              :total="total">
              :total="total"
            >
            </el-pagination>
          </div>
        </div>
      </el-card>
      <!-- ä¿®æ”¹æ–°é—»çš„对话框 -->
      <el-dialog
        title="修改新闻"
        :visible.sync="editDialogVisible"
        width="50%"
        :before-close="handleClose">
      <el-dialog title="修改新闻" :visible.sync="editDialogVisible" width="50%" :before-close="handleClose">
        <!-- rules表单验证规则,ref当前表单的验证对象 -->
        <el-form ref="editFormRef" :model="editForm"  label-width="80px" status-icon>
        <el-form ref="editFormRef" :model="editForm" label-width="80px" status-icon>
          <el-form-item label="id:">
            <el-input v-model="editForm.id" disabled></el-input>
          </el-form-item>
@@ -91,13 +76,7 @@
            <el-input v-model="editForm.title"></el-input>
          </el-form-item>
          <el-form-item label="发布日期:">
            <el-date-picker
              v-model="editForm.releaseTime"
              type="date"
              placeholder="请选择发布日期"
              format="yyyy å¹´ MM æœˆ dd æ—¥"
              value-format="yyyy-MM-dd"
            ></el-date-picker>
            <el-date-picker v-model="editForm.releaseTime" type="date" placeholder="请选择发布日期" format="yyyy å¹´ MM æœˆ dd æ—¥" value-format="yyyy-MM-dd"></el-date-picker>
          </el-form-item>
        </el-form>
        <span slot="footer" class="dialog-footer">
@@ -110,211 +89,226 @@
</template>
<script>
import { getNewsList,getnew,update,deleteNew,fuzzy } from '../../api/api'
import { getNewsList, getnew, update, deleteNew, fuzzy } from '../../api/api'
export default {
  data() {
    return {
      search:'',
      getShow:true, //获取分页的显示(布尔值)
      gettable:true,  //获取表格的显示
      search: '',
      getShow: true, //获取分页的显示(布尔值)
      gettable: true, //获取表格的显示
      visible: false,
      editDialogVisible:false,  //控制修改对话框的布尔值
      AdDialogVisible:false,  //超管登录对话框
      Ad:{ username:'',password:'' }, //超管对象
      editForm:{},  //查询到的新闻对象,目前仅供修改使用
      newsCategoryId:1, //先存一个小标题id
      tableData:[],   //新闻列表对象
      fuzzytableData:[],  //模糊查询列表对象
      pageSize:6,     //每页条数
      currentPage:1,  //当前页
      total:0,        //新闻总条数
      fuzzyShow:false,  //模糊查询分页的显示(布尔值)
      fuzzytable:false, //模糊查询表格的显示
      fuzzyForm:{ fuzzytitle:'',fuzzytotal:0,fuzzycurrent:1,fuzzysize:6 },  //模糊查询列表对象
      editDialogVisible: false, //控制修改对话框的布尔值
      AdDialogVisible: false, //超管登录对话框
      Ad: { username: '', password: '' }, //超管对象
      editForm: {}, //查询到的新闻对象,目前仅供修改使用
      newsCategoryId: 1, //先存一个小标题id
      tableData: [], //新闻列表对象
      fuzzytableData: [], //模糊查询列表对象
      pageSize: 6, //每页条数
      currentPage: 1, //当前页
      total: 0, //新闻总条数
      fuzzyShow: false, //模糊查询分页的显示(布尔值)
      fuzzytable: false, //模糊查询表格的显示
      fuzzyForm: { fuzzytitle: '', fuzzytotal: 0, fuzzycurrent: 1, fuzzysize: 6 }, //模糊查询列表对象
      value: [],
      options: [{
        value: 1,
        label: '首页',
        children: [{
          value:42,
          label: '通知公告',
        },
      options: [
        {
          value:43,
          label: '工作动态',
          value: 1,
          label: '首页',
          children: [
            {
              value: 42,
              label: '通知公告'
            },
            {
              value: 43,
              label: '工作动态'
            },
            {
              value: 44,
              label: '学院动态'
            },
            {
              value: 45,
              label: '轮播图'
            }
          ]
        },
        {
          value:44,
          label: '学院动态',
        },
        {
          value:45,
          label: '轮播图',
        }],
      },{
          value: 22,
          label: '科协概况',
          children: [{
            value:27,
            label: '简介',
          },
          {
            value:28,
            label: '章程',
          },
          {
            value:29,
            label: '组织结构',
          },
          {
            value:30,
            label: '工作职责',
          },
          {
            value:31,
            label: '专职人员',
          }],
          children: [
            {
              value: 27,
              label: '简介'
            },
            {
              value: 28,
              label: '章程'
            },
            {
              value: 29,
              label: '组织结构'
            },
            {
              value: 30,
              label: '工作职责'
            },
            {
              value: 31,
              label: '专职人员'
            }
          ]
        },
        {
          value: 23,
          label: '政策法规',
          children: [{
            value:35,
            label: '中国科协政策文件',
          },
          {
            value:36,
            label: '地方科协政策文件',
          },
          {
            value:37,
            label: '社团管理文件',
          }],
          children: [
            {
              value: 35,
              label: '中国科协政策文件'
            },
            {
              value: 36,
              label: '地方科协政策文件'
            },
            {
              value: 37,
              label: '社团管理文件'
            }
          ]
        },
        {
          value: 25,
          label: '学术交流',
          children: [{
            value:38,
            label: '学术信息',
          },
          {
            value:39,
            label: '科技竞赛',
          }],
          children: [
            {
              value: 38,
              label: '学术信息'
            },
            {
              value: 39,
              label: '科技竞赛'
            }
          ]
        },
        {
          value: 27,
          label: '科普风采',
          children: [{
            value:40,
            label: '平顶山学院科普活动',
          },
          {
            value:41,
            label: '平顶山市政协科普活动',
          }],
      }]
          children: [
            {
              value: 40,
              label: '平顶山学院科普活动'
            },
            {
              value: 41,
              label: '平顶山市政协科普活动'
            }
          ]
        }
      ]
    }
  },
  created(){
  },
  mounted(){
  },
  created() {},
  mounted() {},
  methods: {
    //修改对话框关闭的方法
    handleClose(done) {
      this.$confirm('确认关闭?')
        .then(_ => {
          done();
          done()
        })
        .catch(_ => {});
        .catch(_ => {})
    },
    //跳转普通管理列表
    goAdEdit(){
      this.$router.push({path:'adedit'})
    goAdEdit() {
      this.$router.push({ path: 'adedit' })
    },
    //级联选择器的方法
    handleChange(value) {
      // console.log(value);
      // console.log(value[1]);
      this.currentPage = 1;
      this.newsCategoryId = value[1]; //将得到的小标题id存放起来
      this.query(this.newsCategoryId);
      this.currentPage = 1
      this.newsCategoryId = value[1] //将得到的小标题id存放起来
      this.query(this.newsCategoryId)
    },
    query(newsCategoryId){
    query(newsCategoryId) {
      const data = {
        current:this.currentPage,
        newsCategoryId:newsCategoryId,
        size:this.pageSize
      };
      getNewsList(data).then(res=>{
        // console.log(res);
        if (res.code !== 200) {
          return this.$message.error('获取新闻列表失败')
        }else{
          this.tableData = res.data.records
          this.total = res.data.total
        }
      }).catch(err => {
        console.log(err);
      })
        current: this.currentPage,
        newsCategoryId: newsCategoryId,
        size: this.pageSize
      }
      getNewsList(data)
        .then(res => {
          // console.log(res);
          if (res.code !== 200) {
            return this.$message.error('获取新闻列表失败')
          } else {
            this.tableData = res.data.records
            this.total = res.data.total
          }
        })
        .catch(err => {
          console.log(err)
        })
    },
    //展示修改对话框
    showEditDialog(id){
    showEditDialog(id) {
      getnew(id).then(res => {
        // console.log(res);
        if (res.code == 200) {
          this.editForm = res.data
        }
        }
      })
      this.editDialogVisible = true;
      this.editDialogVisible = true
    },
    //确定修改表单提交,验证发起请求
    editNew(){
    editNew() {
      const data = {
        id: this.editForm.id,
        releaseTime: this.editForm.releaseTime,
        title:this.editForm.title
        title: this.editForm.title
      }
      update(data).then(res=>{
        console.log('dsadasas',res);
      update(data).then(res => {
        console.log('dsadasas', res)
        if (res.code == 200) {
          this.editDialogVisible =false;
          this.editDialogVisible = false
          this.$message.success('修改新闻成功!')
          this.query(this.newsCategoryId);
          this.query(this.newsCategoryId)
        }
      })
    },
    //模糊查询
    fuzzyList(title){
    fuzzyList(title) {
      // console.log(title);
      if(title == ''){
        return  this.$message.error('请先输入查询新闻标题!')
      if (title == '') {
        return this.$message.error('请先输入查询新闻标题!')
      }
      this.fuzzyShow = true //模糊分页显示
      this.getShow = false  //获取分页隐藏
      this.getShow = false //获取分页隐藏
      this.gettable = false
      this.fuzzytable = true
      const data = {
        current: this.fuzzyForm.fuzzycurrent,
        size: this.fuzzyForm.fuzzysize,
        title:title
        title: title
      }
      fuzzy(data).then(res => {
        // console.log(res);
        if (res.code !== 200) {
          return this.$message.error('查询新闻列表失败')
        }else{
          this.fuzzytableData = res.data.records
          this.fuzzyForm.fuzzytotal = res.data.total
        }
      }).catch(err => {
        console.log(err);
      })
      fuzzy(data)
        .then(res => {
          // console.log(res);
          if (res.code !== 200) {
            return this.$message.error('查询新闻列表失败')
          } else {
            this.fuzzytableData = res.data.records
            this.fuzzyForm.fuzzytotal = res.data.total
          }
        })
        .catch(err => {
          console.log(err)
        })
    },
    //清空查询列表内容
    qingKong(){
    qingKong() {
      this.tableData = []
      this.fuzzytableData = []
      this.fuzzyForm.fuzzytotal = 0
@@ -324,7 +318,7 @@
      this.gettable = true
    },
    //根据id删除新闻
    async deleteNews(id){
    async deleteNews(id) {
      // console.log(id);
      const res = await this.$confirm('此操作将永久删除该条新闻, æ˜¯å¦ç»§ç»­?', '提示', {
        confirmButtonText: '确定',
@@ -335,98 +329,114 @@
      })
      //如果用户点击确定则返回confirm
      //如果用户点击取消则返回cancel
      console.log(res);
      if(res !== 'confirm'){
      console.log(res)
      if (res !== 'confirm') {
        return this.$message.info('已取消删除~')
      }else{
        console.log(id);
      } else {
        console.log(id)
        const data = {
          id:id
          id: id
        }
        //参数data è¦ä»¥å¯¹è±¡çš„形式传入
        deleteNew(data).then(res => {
          console.log('>>>'+res);
          if(res.code == 200){
          console.log('>>>' + res)
          if (res.code == 200) {
            this.$message.success('删除新闻成功!')
            this.query(this.newsCategoryId);
          }else{
            this.query(this.newsCategoryId)
          } else {
            return this.$message.error('删除新闻失败!')
          }
        })
      }
    },
    //查看
    look(id){
      this.$router.push({path:'news',query:{id:id}})
    look(id) {
      this.$router.push({ path: 'news', query: { id: id } })
    },
    //超管登录对话框
    showAdDialog(){
    showAdDialog() {
      this.AdDialogVisible = true
    },
    handleCurrentChange(val) {
      // console.log(`当前页: ${val}`);
      this.currentPage = val;
      this.currentPage = val
      this.query(this.newsCategoryId)
    },
    handleSizeChange(val) {
      // console.log(`每页 ${val} æ¡`);
      this.pageSize = val;
      this.pageSize = val
      this.query(this.newsCategoryId)
    },
    handleCurrentChangefuzzy(val){
    handleCurrentChangefuzzy(val) {
      this.fuzzyForm.fuzzycurrent = val
      this.fuzzyList(this.fuzzyForm.fuzzytitle) //模糊查询
    },
    handleSizeChangefuzzy(val){
    handleSizeChangefuzzy(val) {
      this.fuzzyForm.fuzzysize = val
      this.fuzzyList(this.fuzzyForm.fuzzytitle) //模糊查询
    },
    //去往添加编辑页面
    goEdit(id){
      let title = '';
      console.log(this.value);
      if (this.value.length = 2) {
        let t = this.value[0];
        let i = this.value[1];
        this.options.forEach( item => {
          if(item.value == t){
            title += item.label+'/'
            item.children.forEach( e => {
              if(e.value == i) title += e.label;
    goEdit(id) {
      let title = ''
      console.log(this.value)
      if ((this.value.length = 2)) {
        let t = this.value[0]
        let i = this.value[1]
        this.options.forEach(item => {
          if (item.value == t) {
            title += item.label + '/'
            item.children.forEach(e => {
              if (e.value == i) title += e.label
            })
          }
        })
      }
      if (this.newsCategoryId==27&&this.total==1||this.newsCategoryId==28&&this.total==1||this.newsCategoryId==29&&this.total==1||
      this.newsCategoryId==30&&this.total==1||this.newsCategoryId==31&&this.total==1) {
      if (
        (this.newsCategoryId == 27 && this.total == 1) ||
        (this.newsCategoryId == 28 && this.total == 1) ||
        (this.newsCategoryId == 29 && this.total == 1) ||
        (this.newsCategoryId == 30 && this.total == 1) ||
        (this.newsCategoryId == 31 && this.total == 1)
      ) {
        this.$message.error('该新闻标题下只能存在一篇新闻')
      }else if(this.newsCategoryId==27||this.newsCategoryId==28||this.newsCategoryId==29||this.newsCategoryId==30||
      this.newsCategoryId==31||this.newsCategoryId == 35||this.newsCategoryId==36||this.newsCategoryId==37||
      this.newsCategoryId==38||this.newsCategoryId==39||this.newsCategoryId==40||
      this.newsCategoryId==41||this.newsCategoryId==42||this.newsCategoryId==43||
      this.newsCategoryId==44){
        this.$router.push({path:'/administrator/edit',query:{id:id,title:title}})
        console.log(this.newsCategoryId);
      }else if(this.newsCategoryId==45){
        this.$router.push({path:'/administrator/editlunbo',query:{id:id,title:title}})
      } else if (
        this.newsCategoryId == 27 ||
        this.newsCategoryId == 28 ||
        this.newsCategoryId == 29 ||
        this.newsCategoryId == 30 ||
        this.newsCategoryId == 31 ||
        this.newsCategoryId == 35 ||
        this.newsCategoryId == 36 ||
        this.newsCategoryId == 37 ||
        this.newsCategoryId == 38 ||
        this.newsCategoryId == 39 ||
        this.newsCategoryId == 40 ||
        this.newsCategoryId == 41 ||
        this.newsCategoryId == 42 ||
        this.newsCategoryId == 43 ||
        this.newsCategoryId == 44
      ) {
        this.$router.push({ path: '/administrator/edit', query: { id: id, title: title } })
        console.log(this.newsCategoryId)
      } else if (this.newsCategoryId == 45) {
        this.$router.push({ path: '/administrator/editlunbo', query: { id: id, title: title } })
        // console.log(this.newsCategoryId);
      }else{
      } else {
        this.$message.error('请先选择新闻标题')
      }
    }
  },
  }
}
</script>
<style lang="less">
.add{
.add {
  margin-bottom: 10px !important;
}
.block{
.block {
  margin-bottom: 10px;
}
.el-pagination{
.el-pagination {
  margin-top: 10px;
}
</style>
</style>
src/components/Administrator/AdminHome.vue
@@ -18,18 +18,16 @@
<script>
export default {
  data() {
    return {
    }
    return {}
  },
  created() {
  },
  created() {},
  methods: {
    logout() {
      //清空token
      window.sessionStorage.clear()
      //跳转到登录页
      this.$router.push('/login')
    },
    }
  }
}
</script>
src/components/Administrator/Edit copy.vue
@@ -1,11 +1,11 @@
<template>
  <div class="box">
    <el-row>{{ $route.query.title }}</el-row>
    æ–°é—»æ ‡é¢˜ï¼š<el-input v-model="title" placeholder="请输入新闻标题"></el-input><br/><br/>
    å‘布日期:<el-date-picker  format="yyyy å¹´ MM æœˆ dd æ—¥" value-format="yyyy-MM-dd" v-model="releaseTime" placeholder="请选择新闻发布日期"></el-date-picker><br/><br/>
    æ–°é—»æ ‡é¢˜ï¼š<el-input v-model="title" placeholder="请输入新闻标题"></el-input><br /><br />
    å‘布日期:<el-date-picker format="yyyy å¹´ MM æœˆ dd æ—¥" value-format="yyyy-MM-dd" v-model="releaseTime" placeholder="请选择新闻发布日期"></el-date-picker><br /><br />
    æ–°é—»å†…容:<quill-editor ref="text" v-model="content" class="myQuillEditor" :options="editorOption" />
    <el-row style="margin-top:50px;">
      <el-button  type="success" @click="submit">发布</el-button>
      <el-button type="success" @click="submit">发布</el-button>
    </el-row>
  </div>
</template>
@@ -16,45 +16,45 @@
import 'quill/dist/quill.snow.css'
import 'quill/dist/quill.bubble.css'
export default {
  components:{ quillEditor },
  data(){
  components: { quillEditor },
  data() {
    return {
      title:'', //标题内容
      releaseTime:'', //发布日期
      content: '',  //新闻内容
      newsCategoryId:2,
      title: '', //标题内容
      releaseTime: '', //发布日期
      content: '', //新闻内容
      newsCategoryId: 2,
      editorOption: {
        placeholder: "请输入正文",
        placeholder: '请输入正文',
        // editorOption里是放图片上传配置参数用的,例如:
        action:  '/api/product/richtext_img_upload.do',  // å¿…填参数 å›¾ç‰‡ä¸Šä¼ åœ°å€
        methods: 'POST',  // å¿…填参数 å›¾ç‰‡ä¸Šä¼ æ–¹å¼
        token: '',  // å¯é€‰å‚æ•° å¦‚果需要token验证,假设你的token有存放在sessionStorage
        name: 'upload_file',  // å¿…填参数 æ–‡ä»¶çš„参数名
        size: 10000000,  // å¯é€‰å‚æ•°   å›¾ç‰‡å¤§å°ï¼Œå•位为Kb, 1M = 1024Kb
        accept: 'multipart/form-data, image/png, image/gif, image/jpeg, image/bmp, image/x-icon,image/jpg'  // å¯é€‰ å¯ä¸Šä¼ çš„图片格式
      } ,  //编辑器新闻对象
      fileList:[],
        action: '/api/product/richtext_img_upload.do', // å¿…填参数 å›¾ç‰‡ä¸Šä¼ åœ°å€
        methods: 'POST', // å¿…填参数 å›¾ç‰‡ä¸Šä¼ æ–¹å¼
        token: '', // å¯é€‰å‚æ•° å¦‚果需要token验证,假设你的token有存放在sessionStorage
        name: 'upload_file', // å¿…填参数 æ–‡ä»¶çš„参数名
        size: 10000000, // å¯é€‰å‚æ•°   å›¾ç‰‡å¤§å°ï¼Œå•位为Kb, 1M = 1024Kb
        accept: 'multipart/form-data, image/png, image/gif, image/jpeg, image/bmp, image/x-icon,image/jpg' // å¯é€‰ å¯ä¸Šä¼ çš„图片格式
      }, //编辑器新闻对象
      fileList: []
    }
  },
  created(){
  created() {
    // console.log('>>>>>>>',this.$route.query.id);
    this.newsCategoryId = this.$route.query.id
  },
  methods:{
    submit(){
  methods: {
    submit() {
      const data = {
        newsCategoryId:this.newsCategoryId,
        content:this.content,
        title:this.title,
        releaseTime:this.releaseTime
        newsCategoryId: this.newsCategoryId,
        content: this.content,
        title: this.title,
        releaseTime: this.releaseTime
      }
      add(data).then(res => {
        console.log(res);
        if(res.code !== 200){
        console.log(res)
        if (res.code !== 200) {
          return this.$message.error('发布新闻失败,请重试!')
        }else{
        } else {
          this.$message.success('新闻发布成功!')
          console.log(this.content);
          console.log(this.content)
          this.$router.go(-1)
        }
      })
@@ -64,16 +64,16 @@
</script>
<style lang="less" scoped>
.box{
.box {
  width: 1200px;
  margin: 0 auto;
}
.myQuillEditor{
.myQuillEditor {
  height: 350px;
}
.btn{
.btn {
  position: absolute;
  bottom: 20px;
  left: 168px;
}
</style>
</style>
src/components/Administrator/Edit.vue
@@ -1,154 +1,137 @@
<template>
  <div class="box">
    <el-row><h3 style="margin-top: 0px">{{ $route.query.title }}</h3></el-row>
    æ–°é—»æ ‡é¢˜ï¼š<el-input v-model="title" placeholder="请输入新闻标题"></el-input><br/><br/>
    å‘布日期:<el-date-picker  format="yyyy å¹´ MM æœˆ dd æ—¥" value-format="yyyy-MM-dd" v-model="releaseTime" placeholder="请选择新闻发布日期"></el-date-picker><br/><br/>
    <el-row
      ><h3 style="margin-top: 0px">{{ $route.query.title }}</h3></el-row
    >
    æ–°é—»æ ‡é¢˜ï¼š<el-input v-model="title" placeholder="请输入新闻标题"></el-input><br /><br />
    å‘布日期:<el-date-picker format="yyyy å¹´ MM æœˆ dd æ—¥" value-format="yyyy-MM-dd" v-model="releaseTime" placeholder="请选择新闻发布日期"></el-date-picker><br /><br />
    æ–°é—»å†…容:<quill-editor ref="text" v-model="content" class="myQuillEditor" :options="editorOption" />
    <el-row style="margin-top:50px;">
      <el-button  type="success" @click="submit">发布</el-button>
      <!-- <input type="file" @change="chooseFile"/><br/><br/>
      <el-button  type="success" @click="tijiao">提交</el-button><br/><br/>
      <img :src="'http://localhost:7070/'+this.photo" style="width: 400px"> -->
      <el-button type="success" @click="submit">发布</el-button>
    </el-row>
  </div>
</template>
<script>
import axios from 'axios'
import { add,fileUpload, login } from '../../api/api'
import {quillEditor,Quill} from 'vue-quill-editor'
// import axios from 'axios'
import { add, fileUpload, login } from '../../api/api'
import { quillEditor, Quill } from 'vue-quill-editor'
import 'quill/dist/quill.core.css'
import 'quill/dist/quill.snow.css'
import 'quill/dist/quill.bubble.css'
import { container, ImageExtend,QuillWatch } from 'quill-image-extend-module'
import { container, ImageExtend, QuillWatch } from 'quill-image-extend-module'
Quill.register('modules/ImageExtend', ImageExtend)
axios.defaults.withCredentials = true;
// axios.defaults.withCredentials = true
export default {
  components:{ quillEditor },
  data(){
  components: { quillEditor },
  data() {
    return {
      title:'', //标题内容
      releaseTime:'', //发布日期
      content: '',  //新闻内容
      picture:null,
      photo:'',
      newsCategoryId:2,
      title: '', // æ ‡é¢˜å†…容
      releaseTime: '', // å‘布日期
      content: '', // æ–°é—»å†…容
      picture: null,
      photo: '',
      newsCategoryId: 2,
      editorOption: {
        placeholder: "请输入正文",
        placeholder: '请输入正文',
        modules: {
            ImageExtend: {  // å¦‚果不作设置,即{}  åˆ™ä¾ç„¶å¼€å¯å¤åˆ¶ç²˜è´´åŠŸèƒ½ä¸”ä»¥base64插入
                name: 'file',  // å›¾ç‰‡å‚数名
                loading: true,
                size: 10,  // å¯é€‰å‚æ•° å›¾ç‰‡å¤§å°ï¼Œå•位为M,1M = 1024kb
                action:'http://localhost:7070/uploading',
                response: (res) => {
                  console.log(res);
                    return 'http://localhost:7070/'+res.data
                },
                headers: (xhr) => {
                  // axios.defaults.withCredentials = true;
                  // xhr.setRequestHeader('Cookie','NMTID=00OVM6QOJcTDVhqDUtvgSnd-5FBxLcAAAF9nTiDHg; JSESSIONID=5ACC52D29A2434E09450CB975E08C288')
                },  // å¯é€‰å‚æ•° è®¾ç½®è¯·æ±‚头部
                sizeError: () => {},  // å›¾ç‰‡è¶…过大小的回调
                start: () => {},  // å¯é€‰å‚æ•° è‡ªå®šä¹‰å¼€å§‹ä¸Šä¼ è§¦å‘事件
                end: () => {},  // å¯é€‰å‚æ•° è‡ªå®šä¹‰ä¸Šä¼ ç»“束触发的事件,无论成功或者失败
                error: () => {},  // å¯é€‰å‚æ•° ä¸Šä¼ å¤±è´¥è§¦å‘的事件
                success: () => {},  // å¯é€‰å‚æ•°  ä¸Šä¼ æˆåŠŸè§¦å‘çš„äº‹ä»¶
                change: (xhr, formData) => {
                // formData.append('token', 'myToken')
                } // å¯é€‰å‚æ•° æ¯æ¬¡é€‰æ‹©å›¾ç‰‡è§¦å‘,也可用来设置头部,但比headers多了一个参数,可设置formData
          ImageExtend: {
            // å¦‚果不作设置,即{}  åˆ™ä¾ç„¶å¼€å¯å¤åˆ¶ç²˜è´´åŠŸèƒ½ä¸”ä»¥base64插入
            name: 'file', // å›¾ç‰‡å‚数名
            loading: true,
            size: 10, // å¯é€‰å‚æ•° å›¾ç‰‡å¤§å°ï¼Œå•位为M,1M = 1024kb
            action: 'http://localhost:7070/uploading',
            response: res => {
              console.log(res)
              return 'http://localhost:7070/' + res.data
            },
            toolbar:{
                container:[
                    ['bold', 'italic', 'underline', 'strike'],        //加粗,斜体,下划线,删除线
                    ['blockquote', 'code-block'],         //引用,代码块
                    [{ 'header': 1 }, { 'header': 2 }],               // æ ‡é¢˜ï¼Œé”®å€¼å¯¹çš„形式;1、2表示字体大小
                    [{ 'list': 'ordered'}, { 'list': 'bullet' }],          //列表
                    [{ 'script': 'sub'}, { 'script': 'super' }],      // ä¸Šä¸‹æ ‡
                    [{ 'indent': '-1'}, { 'indent': '+1' }],          // ç¼©è¿›
                    [{ 'direction': 'rtl' }],                         // æ–‡æœ¬æ–¹å‘
                    [{ 'size': ['small', false, 'large', 'huge'] }],  // å­—体大小
                    [{ 'header': [1, 2, 3, 4, 5, 6, false] }],         //几级标题
                    [{ 'color': [] }, { 'background': [] }],          // å­—体颜色,字体背景颜色
                    [{ 'font': [] }],         //字体
                    [{ 'align': [] }],        //对齐方式
                    ['clean'],        //清除字体样式
                    ['image']        //上传图片、上传视频
                ],
                handlers: {
                    'image': function () {  // åŠ«æŒåŽŸæ¥çš„å›¾ç‰‡ç‚¹å‡»æŒ‰é’®äº‹ä»¶
                        QuillWatch.emit(this.quill.id)
                    }
                }
            },
        },
      } ,  //编辑器新闻对象
      fileList:[],
            headers: xhr => {
              // axios.defaults.withCredentials = true;
              // xhr.setRequestHeader('Cookie','NMTID=00OVM6QOJcTDVhqDUtvgSnd-5FBxLcAAAF9nTiDHg; JSESSIONID=5ACC52D29A2434E09450CB975E08C288')
            }, // å¯é€‰å‚æ•° è®¾ç½®è¯·æ±‚头部
            sizeError: () => {}, // å›¾ç‰‡è¶…过大小的回调
            start: () => {}, // å¯é€‰å‚æ•° è‡ªå®šä¹‰å¼€å§‹ä¸Šä¼ è§¦å‘事件
            end: () => {}, // å¯é€‰å‚æ•° è‡ªå®šä¹‰ä¸Šä¼ ç»“束触发的事件,无论成功或者失败
            error: () => {}, // å¯é€‰å‚æ•° ä¸Šä¼ å¤±è´¥è§¦å‘的事件
            success: () => {}, // å¯é€‰å‚æ•°  ä¸Šä¼ æˆåŠŸè§¦å‘çš„äº‹ä»¶
            change: (xhr, formData) => {
              // formData.append('token', 'myToken')
            } // å¯é€‰å‚æ•° æ¯æ¬¡é€‰æ‹©å›¾ç‰‡è§¦å‘,也可用来设置头部,但比headers多了一个参数,可设置formData
          },
          toolbar: {
            container: [
              ['bold', 'italic', 'underline', 'strike'], // åŠ ç²—ï¼Œæ–œä½“ï¼Œä¸‹åˆ’çº¿ï¼Œåˆ é™¤çº¿
              ['blockquote', 'code-block'], // å¼•用,代码块
              [{ header: 1 }, { header: 2 }], // æ ‡é¢˜ï¼Œé”®å€¼å¯¹çš„形式;1、2表示字体大小
              [{ list: 'ordered' }, { list: 'bullet' }], // åˆ—表
              [{ script: 'sub' }, { script: 'super' }], // ä¸Šä¸‹æ ‡
              [{ indent: '-1' }, { indent: '+1' }], // ç¼©è¿›
              [{ direction: 'rtl' }], // æ–‡æœ¬æ–¹å‘
              [{ size: ['small', false, 'large', 'huge'] }], // å­—体大小
              [{ header: [1, 2, 3, 4, 5, 6, false] }], // å‡ çº§æ ‡é¢˜
              [{ color: [] }, { background: [] }], // å­—体颜色,字体背景颜色
              [{ font: [] }], // å­—体
              [{ align: [] }], // å¯¹é½æ–¹å¼
              ['clean'], // æ¸…除字体样式
              ['image'] // ä¸Šä¼ å›¾ç‰‡ã€ä¸Šä¼ è§†é¢‘
            ],
            handlers: {
              image: function() {
                // åŠ«æŒåŽŸæ¥çš„å›¾ç‰‡ç‚¹å‡»æŒ‰é’®äº‹ä»¶
                QuillWatch.emit(this.quill.id)
              }
            }
          }
        }
      }, // ç¼–辑器新闻对象
      fileList: []
    }
  },
  created(){
  created() {
    // console.log('>>>>>>>',this.$route.query.id);
    this.newsCategoryId = this.$route.query.id
  },
  mounted(){
  },
  methods:{
    // chooseFile(file){
    //   this.picture = file.target.files[0];
    //   console.log(this.picture)
    //   return false;
    // },
    // tijiao(){
    //   const fd = new FormData()
    //   fd.append('file',this.picture)
    //   fileUpload(fd).then(res => {
    //     console.log(res)
    //     if(res.code == 200){
    //       this.photo = res.data
    //       console.log(this.photo);
    //     }
    //   })
    // },
    submit(){
  mounted() {},
  methods: {
    submit() {
      const data = {
        newsCategoryId:this.newsCategoryId,
        content:this.content,
        title:this.title,
        releaseTime:this.releaseTime
        newsCategoryId: this.newsCategoryId,
        content: this.content,
        title: this.title,
        releaseTime: this.releaseTime
      }
      console.log(this.content);
      console.log(this.content)
      // console.log(this.newsCategoryId);
      add(data).then(res => {
        console.log(res);
        if(res.code !== 200){
        console.log(res)
        if (res.code !== 200) {
          return this.$message.error('发布新闻失败,请重试!')
        }else{
        } else {
          this.$message.success('新闻发布成功!')
          console.log(this.content);
          console.log(this.content)
          this.$router.go(-1)
        }
      })
    },
    }
  }
}
</script>
<style lang="less" scoped>
.box{
.box {
  width: 1200px;
  margin: 0 auto;
}
.myQuillEditor{
.myQuillEditor {
  height: 350px;
}
.btn{
.btn {
  position: absolute;
  bottom: 20px;
  left: 168px;
}
.ql-editor img{
.ql-editor img {
  width: 100px !important;
  height: 100px !important;
}
</style>
</style>
src/components/Administrator/EditLunBo.vue
@@ -1,115 +1,119 @@
<template>
  <div class="box">
    <el-row><h3 style="margin-top: 0px">{{ $route.query.title }}</h3></el-row>
    æ–°é—»æ ‡é¢˜ï¼š<el-input v-model="title" placeholder="请输入新闻标题"></el-input><br/><br/>
    å‘布日期:<el-date-picker  format="yyyy å¹´ MM æœˆ dd æ—¥" value-format="yyyy-MM-dd" v-model="releaseTime" placeholder="请选择新闻发布日期"></el-date-picker><br/><br/>
    <input type="file" @change="chooseFile"/><br/><br/>
    <el-row
      ><h3 style="margin-top: 0px">{{ $route.query.title }}</h3></el-row
    >
    æ–°é—»æ ‡é¢˜ï¼š<el-input v-model="title" placeholder="请输入新闻标题"></el-input><br /><br />
    å‘布日期:<el-date-picker format="yyyy å¹´ MM æœˆ dd æ—¥" value-format="yyyy-MM-dd" v-model="releaseTime" placeholder="请选择新闻发布日期"></el-date-picker><br /><br />
    <input type="file" @change="chooseFile" /><br /><br />
    æ–°é—»å†…容:<quill-editor ref="text" v-model="content" class="myQuillEditor" :options="editorOption" />
    <el-row style="margin-top:50px;">
      <el-button  type="success" @click="submit">发布</el-button>
      <el-button type="success" @click="submit">发布</el-button>
    </el-row>
  </div>
</template>
<script>
import { add,fileUpload, login } from '../../api/api'
import {quillEditor,Quill} from 'vue-quill-editor'
import { add, fileUpload, login } from '../../api/api'
import { quillEditor, Quill } from 'vue-quill-editor'
import 'quill/dist/quill.core.css'
import 'quill/dist/quill.snow.css'
import 'quill/dist/quill.bubble.css'
import { container, ImageExtend,QuillWatch } from 'quill-image-extend-module'
import { container, ImageExtend, QuillWatch } from 'quill-image-extend-module'
Quill.register('modules/ImageExtend', ImageExtend)
// axios.defaults.withCredentials = true;
export default {
  components:{ quillEditor },
  data(){
  components: { quillEditor },
  data() {
    return {
      title:'', //标题内容
      releaseTime:'', //发布日期
      content: '',  //新闻内容
      newsCategoryId:45,
      title: '', //标题内容
      releaseTime: '', //发布日期
      content: '', //新闻内容
      newsCategoryId: 45,
      editorOption: {
        placeholder: "请输入正文",
        placeholder: '请输入正文',
        modules: {
            ImageExtend: {  // å¦‚果不作设置,即{}  åˆ™ä¾ç„¶å¼€å¯å¤åˆ¶ç²˜è´´åŠŸèƒ½ä¸”ä»¥base64插入
                name: 'file',  // å›¾ç‰‡å‚数名
                loading: true,
                size: 10,  // å¯é€‰å‚æ•° å›¾ç‰‡å¤§å°ï¼Œå•位为M,1M = 1024kb
                action:'http://localhost:7070/uploading',
                response: (res) => {
                  console.log(res);
                    return 'http://localhost:7070/'+res.data
                },
                headers: (xhr) => {
                  // axios.defaults.withCredentials = true;
                  // xhr.setRequestHeader('Cookie','NMTID=00OVM6QOJcTDVhqDUtvgSnd-5FBxLcAAAF9nTiDHg; JSESSIONID=5ACC52D29A2434E09450CB975E08C288')
                },  // å¯é€‰å‚æ•° è®¾ç½®è¯·æ±‚头部
                sizeError: () => {},  // å›¾ç‰‡è¶…过大小的回调
                start: () => {},  // å¯é€‰å‚æ•° è‡ªå®šä¹‰å¼€å§‹ä¸Šä¼ è§¦å‘事件
                end: () => {},  // å¯é€‰å‚æ•° è‡ªå®šä¹‰ä¸Šä¼ ç»“束触发的事件,无论成功或者失败
                error: () => {},  // å¯é€‰å‚æ•° ä¸Šä¼ å¤±è´¥è§¦å‘的事件
                success: () => {},  // å¯é€‰å‚æ•°  ä¸Šä¼ æˆåŠŸè§¦å‘çš„äº‹ä»¶
                change: (xhr, formData) => {
                // formData.append('token', 'myToken')
                } // å¯é€‰å‚æ•° æ¯æ¬¡é€‰æ‹©å›¾ç‰‡è§¦å‘,也可用来设置头部,但比headers多了一个参数,可设置formData
          ImageExtend: {
            // å¦‚果不作设置,即{}  åˆ™ä¾ç„¶å¼€å¯å¤åˆ¶ç²˜è´´åŠŸèƒ½ä¸”ä»¥base64插入
            name: 'file', // å›¾ç‰‡å‚数名
            loading: true,
            size: 10, // å¯é€‰å‚æ•° å›¾ç‰‡å¤§å°ï¼Œå•位为M,1M = 1024kb
            action: 'http://localhost:7070/uploading',
            response: res => {
              console.log(res)
              return 'http://localhost:7070/' + res.data
            },
            toolbar:{
                container:[
                    ['bold', 'italic', 'underline', 'strike'],        //加粗,斜体,下划线,删除线
                    ['blockquote', 'code-block'],         //引用,代码块
                    [{ 'header': 1 }, { 'header': 2 }],               // æ ‡é¢˜ï¼Œé”®å€¼å¯¹çš„形式;1、2表示字体大小
                    [{ 'list': 'ordered'}, { 'list': 'bullet' }],          //列表
                    [{ 'script': 'sub'}, { 'script': 'super' }],      // ä¸Šä¸‹æ ‡
                    [{ 'indent': '-1'}, { 'indent': '+1' }],          // ç¼©è¿›
                    [{ 'direction': 'rtl' }],                         // æ–‡æœ¬æ–¹å‘
                    [{ 'size': ['small', false, 'large', 'huge'] }],  // å­—体大小
                    [{ 'header': [1, 2, 3, 4, 5, 6, false] }],         //几级标题
                    [{ 'color': [] }, { 'background': [] }],          // å­—体颜色,字体背景颜色
                    [{ 'font': [] }],         //字体
                    [{ 'align': [] }],        //对齐方式
                    ['clean'],        //清除字体样式
                    ['image']        //上传图片、上传视频
                ],
                handlers: {
                    'image': function () {  // åŠ«æŒåŽŸæ¥çš„å›¾ç‰‡ç‚¹å‡»æŒ‰é’®äº‹ä»¶
                        QuillWatch.emit(this.quill.id)
                    }
                }
            },
        },
      } ,  //编辑器新闻对象
      fileList:[],
            headers: xhr => {
              // axios.defaults.withCredentials = true;
              // xhr.setRequestHeader('Cookie','NMTID=00OVM6QOJcTDVhqDUtvgSnd-5FBxLcAAAF9nTiDHg; JSESSIONID=5ACC52D29A2434E09450CB975E08C288')
            }, // å¯é€‰å‚æ•° è®¾ç½®è¯·æ±‚头部
            sizeError: () => {}, // å›¾ç‰‡è¶…过大小的回调
            start: () => {}, // å¯é€‰å‚æ•° è‡ªå®šä¹‰å¼€å§‹ä¸Šä¼ è§¦å‘事件
            end: () => {}, // å¯é€‰å‚æ•° è‡ªå®šä¹‰ä¸Šä¼ ç»“束触发的事件,无论成功或者失败
            error: () => {}, // å¯é€‰å‚æ•° ä¸Šä¼ å¤±è´¥è§¦å‘的事件
            success: () => {}, // å¯é€‰å‚æ•°  ä¸Šä¼ æˆåŠŸè§¦å‘çš„äº‹ä»¶
            change: (xhr, formData) => {
              // formData.append('token', 'myToken')
            } // å¯é€‰å‚æ•° æ¯æ¬¡é€‰æ‹©å›¾ç‰‡è§¦å‘,也可用来设置头部,但比headers多了一个参数,可设置formData
          },
          toolbar: {
            container: [
              ['bold', 'italic', 'underline', 'strike'], //加粗,斜体,下划线,删除线
              ['blockquote', 'code-block'], //引用,代码块
              [{ header: 1 }, { header: 2 }], // æ ‡é¢˜ï¼Œé”®å€¼å¯¹çš„形式;1、2表示字体大小
              [{ list: 'ordered' }, { list: 'bullet' }], //列表
              [{ script: 'sub' }, { script: 'super' }], // ä¸Šä¸‹æ ‡
              [{ indent: '-1' }, { indent: '+1' }], // ç¼©è¿›
              [{ direction: 'rtl' }], // æ–‡æœ¬æ–¹å‘
              [{ size: ['small', false, 'large', 'huge'] }], // å­—体大小
              [{ header: [1, 2, 3, 4, 5, 6, false] }], //几级标题
              [{ color: [] }, { background: [] }], // å­—体颜色,字体背景颜色
              [{ font: [] }], //字体
              [{ align: [] }], //对齐方式
              ['clean'], //清除字体样式
              ['image'] //上传图片、上传视频
            ],
            handlers: {
              image: function() {
                // åŠ«æŒåŽŸæ¥çš„å›¾ç‰‡ç‚¹å‡»æŒ‰é’®äº‹ä»¶
                QuillWatch.emit(this.quill.id)
              }
            }
          }
        }
      }, //编辑器新闻对象
      fileList: []
    }
  },
  created(){
  created() {
    // console.log('>>>>>>>',this.$route.query.id);
    this.newsCategoryId = this.$route.query.id
  },
  methods:{
  methods: {
    chooseFile(file) {
      this.pictureFile = file.target.files[0];
      this.pictureFile = file.target.files[0]
      console.log(this.pictureFile)
      console.log(file);
      return false;
      console.log(file)
      return false
    },
    submit(){
      const fd = new FormData();
      fd.append('pictureFile',this.pictureFile);
    submit() {
      const fd = new FormData()
      fd.append('pictureFile', this.pictureFile)
      const data = {
        newsCategoryId:this.newsCategoryId,
        content:this.content,
        releaseTime:this.releaseTime,
        title:this.title
        newsCategoryId: this.newsCategoryId,
        content: this.content,
        releaseTime: this.releaseTime,
        title: this.title
      }
      // console.log(999)
      add(data,fd).then(res => {
        console.log(res);
        console.log(this.newsCategoryId);
      add(data, fd).then(res => {
        console.log(res)
        console.log(this.newsCategoryId)
        if (res.code != 200) {
          return this.$message.error('发布新闻失败,请重试!')
        }else{
        } else {
          this.$message.success('新闻发布成功!')
          console.log(this.content);
          console.log(this.content)
          this.$router.go(-1)
        }
      })
@@ -119,16 +123,16 @@
</script>
<style lang="less" scoped>
.box{
.box {
  width: 1200px;
  margin: 0 auto;
}
.myQuillEditor{
.myQuillEditor {
  height: 350px;
}
.btn{
.btn {
  position: absolute;
  bottom: 20px;
  left: 168px;
}
</style>
</style>
src/components/Administrator/Main copy.vue
@@ -1,14 +1,8 @@
<template>
  <div>
    <!-- çº§è”选择器 -->
     <div class="block">
      <el-cascader
        v-model="value"
        :options="options"
        clearable
        filterable
        @change="handleChange">
      </el-cascader>
    <div class="block">
      <el-cascader v-model="value" :options="options" clearable filterable @change="handleChange"> </el-cascader>
    </div>
    <div>
      <el-card class="box-card">
@@ -25,23 +19,19 @@
          </el-col>
        </el-row>
        <!-- æ–°é—»è¡¨æ ¼åŒºåŸŸ -->
        <el-table v-show="gettable" :data="tableData" border style="width: 100%" :header-cell-style="{textAlign: 'center'}" :cell-style="{ textAlign: 'center' }"
        >
        <el-table v-show="gettable" :data="tableData" border style="width: 100%" :header-cell-style="{ textAlign: 'center' }" :cell-style="{ textAlign: 'center' }">
          <!-- :header-cell-style="{textAlign: 'center'}"设置头部居中: -->
          <!-- :cell-style="{ textAlign: 'center' }"设置整个表格内容水平居中: -->
          <!-- é—®é¢˜ï¼šæ€Žä¹ˆèŽ·å–æ•°ç»„ä¸­æ¯ä¸ªå¯¹è±¡çš„key值(每条新闻的id)?
               è§£å†³ï¼šé€šè¿‡ä½œç”¨åŸŸæ’æ§½ slot-scope èŽ·å–æ¯ä¸ªå¯¹è±¡ -->
          <el-table-column type="index">
            <template slot-scope="scope">
              <span>{{ (currentPage-1)*pageSize+scope.$index+1 }}</span>
              <span>{{ (currentPage - 1) * pageSize + scope.$index + 1 }}</span>
            </template>
          </el-table-column>
          <el-table-column prop="releaseTime" label="日期" width="" >
          </el-table-column>
          <el-table-column prop="title" label="新闻标题" width="">
          </el-table-column>
          <el-table-column prop="id" label="id" width="">
          </el-table-column>
          <el-table-column prop="releaseTime" label="日期" width=""> </el-table-column>
          <el-table-column prop="title" label="新闻标题" width=""> </el-table-column>
          <el-table-column prop="id" label="id" width=""> </el-table-column>
          <el-table-column label="操作" width="">
            <template slot-scope="scope">
              <!-- {{ scope.row.id }} -->
@@ -51,22 +41,18 @@
                <el-button type="info" @click="deleteNews(scope.row.id)">删除</el-button>
              </div>
            </template>
          </el-table-column>
        </el-table>
        <!-- æ¨¡ç³ŠæŸ¥è¯¢çš„表格显示 -->
        <el-table v-show="fuzzytable" :data="fuzzytableData" border style="width: 100%" :header-cell-style="{textAlign: 'center'}" :cell-style="{ textAlign: 'center' }">
        <el-table v-show="fuzzytable" :data="fuzzytableData" border style="width: 100%" :header-cell-style="{ textAlign: 'center' }" :cell-style="{ textAlign: 'center' }">
          <el-table-column type="index">
            <template slot-scope="scope">
              <span>{{ (fuzzyForm.fuzzycurrent-1)*fuzzyForm.fuzzysize+scope.$index+1 }}</span>
              <span>{{ (fuzzyForm.fuzzycurrent - 1) * fuzzyForm.fuzzysize + scope.$index + 1 }}</span>
            </template>
          </el-table-column>
          <el-table-column prop="releaseTime" label="日期" width="" >
          </el-table-column>
          <el-table-column prop="title" label="新闻标题" width="">
          </el-table-column>
          <el-table-column prop="id" label="id" width="">
          </el-table-column>
          <el-table-column prop="releaseTime" label="日期" width=""> </el-table-column>
          <el-table-column prop="title" label="新闻标题" width=""> </el-table-column>
          <el-table-column prop="id" label="id" width=""> </el-table-column>
          <el-table-column label="操作" width="">
            <template slot-scope="scope">
              <div>
@@ -75,7 +61,6 @@
                <el-button type="info" @click="deleteNews(scope.row.id)">删除</el-button>
              </div>
            </template>
          </el-table-column>
        </el-table>
        <!-- åˆ†é¡µ -->
@@ -87,10 +72,11 @@
              @size-change="handleSizeChange"
              @current-change="handleCurrentChange"
              :current-page="currentPage"
              :page-sizes="[6,12, 18,]"
              :page-sizes="[6, 12, 18]"
              :page-size="100"
              layout="total, sizes, prev, pager, next, jumper"
              :total="total">
              :total="total"
            >
            </el-pagination>
          </div>
          <!-- æ¨¡ç³Šæ–°é—»åˆ—表分页 -->
@@ -100,22 +86,19 @@
              @size-change="handleSizeChangefuzzy"
              @current-change="handleCurrentChangefuzzy"
              :current-page="fuzzyForm.fuzzycurrent"
              :page-sizes="[6,10, 18,]"
              :page-sizes="[6, 10, 18]"
              :page-size="100"
              layout="total, sizes, prev, pager, next, jumper"
              :total="fuzzyForm.fuzzytotal">
              :total="fuzzyForm.fuzzytotal"
            >
            </el-pagination>
          </div>
        </div>
      </el-card>
      <!-- ä¿®æ”¹æ–°é—»çš„对话框 -->
      <el-dialog
        title="修改新闻"
        :visible.sync="editDialogVisible"
        width="50%"
        :before-close="handleClose">
      <el-dialog title="修改新闻" :visible.sync="editDialogVisible" width="50%" :before-close="handleClose">
        <!-- rules表单验证规则,ref当前表单的验证对象 -->
        <el-form ref="editFormRef" :model="editForm"  label-width="80px" status-icon>
        <el-form ref="editFormRef" :model="editForm" label-width="80px" status-icon>
          <el-form-item label="id:">
            <el-input v-model="editForm.id" disabled></el-input>
          </el-form-item>
@@ -136,199 +119,214 @@
</template>
<script>
import { getNewsList,getnew,update,deleteNew,fuzzy } from '../../api/api'
import { getNewsList, getnew, update, deleteNew, fuzzy } from '../../api/api'
export default {
  data() {
    return {
      getShow:true, //获取分页的显示(布尔值)
      gettable:true,  //获取表格的显示
      getShow: true, //获取分页的显示(布尔值)
      gettable: true, //获取表格的显示
      visible: false,
      editDialogVisible:false,  //控制修改对话框的布尔值
      editForm:{},  //查询到的新闻对象,目前仅供修改使用
      newsCategoryId:1, //先存一个小标题id
      tableData:[],   //新闻列表对象
      fuzzytableData:[],  //模糊查询列表对象
      pageSize:6,     //每页条数
      currentPage:1,  //当前页
      total:0,        //新闻总条数
      fuzzyShow:false,  //模糊查询分页的显示(布尔值)
      fuzzytable:false, //模糊查询表格的显示
      fuzzyForm:{ fuzzytitle:'',fuzzytotal:0,fuzzycurrent:1,fuzzysize:6 },  //模糊查询列表对象
      editDialogVisible: false, //控制修改对话框的布尔值
      editForm: {}, //查询到的新闻对象,目前仅供修改使用
      newsCategoryId: 1, //先存一个小标题id
      tableData: [], //新闻列表对象
      fuzzytableData: [], //模糊查询列表对象
      pageSize: 6, //每页条数
      currentPage: 1, //当前页
      total: 0, //新闻总条数
      fuzzyShow: false, //模糊查询分页的显示(布尔值)
      fuzzytable: false, //模糊查询表格的显示
      fuzzyForm: { fuzzytitle: '', fuzzytotal: 0, fuzzycurrent: 1, fuzzysize: 6 }, //模糊查询列表对象
      value: [],
      options: [{
        value: 1,
        label: '首页',
        children: [{
          value:42,
          label: '通知公告',
        },
      options: [
        {
          value:43,
          label: '工作动态',
          value: 1,
          label: '首页',
          children: [
            {
              value: 42,
              label: '通知公告'
            },
            {
              value: 43,
              label: '工作动态'
            },
            {
              value: 44,
              label: '学院动态'
            }
          ]
        },
        {
          value:44,
          label: '学院动态',
        }],
      },{
          value: 22,
          label: '科协概况',
          children: [{
            value:27,
            label: '简介',
          },
          {
            value:28,
            label: '章程',
          },
          {
            value:29,
            label: '组织结构',
          },
          {
            value:30,
            label: '工作职责',
          },
          {
            value:31,
            label: '专职人员',
          }],
          children: [
            {
              value: 27,
              label: '简介'
            },
            {
              value: 28,
              label: '章程'
            },
            {
              value: 29,
              label: '组织结构'
            },
            {
              value: 30,
              label: '工作职责'
            },
            {
              value: 31,
              label: '专职人员'
            }
          ]
        },
        {
          value: 23,
          label: '政策法规',
          children: [{
            value:35,
            label: '中国科协政策文件',
          },
          {
            value:36,
            label: '地方科协政策文件',
          },
          {
            value:37,
            label: '社团管理文件',
          }],
          children: [
            {
              value: 35,
              label: '中国科协政策文件'
            },
            {
              value: 36,
              label: '地方科协政策文件'
            },
            {
              value: 37,
              label: '社团管理文件'
            }
          ]
        },
        {
          value: 25,
          label: '学术交流',
          children: [{
            value:38,
            label: '学术信息',
          },
          {
            value:39,
            label: '科技竞赛',
          }],
          children: [
            {
              value: 38,
              label: '学术信息'
            },
            {
              value: 39,
              label: '科技竞赛'
            }
          ]
        },
        {
          value: 27,
          label: '科普风采',
          children: [{
            value:40,
            label: '平顶山学院科普活动',
          },
          {
            value:41,
            label: '平顶山市政协科普活动',
          }],
      }]
          children: [
            {
              value: 40,
              label: '平顶山学院科普活动'
            },
            {
              value: 41,
              label: '平顶山市政协科普活动'
            }
          ]
        }
      ]
    }
  },
  created(){
  },
  mounted(){
  },
  created() {},
  mounted() {},
  methods: {
    //修改对话框关闭的方法
    handleClose(done) {
      this.$confirm('确认关闭?')
        .then(_ => {
          done();
          done()
        })
        .catch(_ => {});
        .catch(_ => {})
    },
    //级联选择器的方法
    handleChange(value) {
      // console.log(value);
      // console.log(value[1]);
      this.newsCategoryId = value[1]; //将得到的小标题id存放起来
      this.query(this.newsCategoryId);
      this.newsCategoryId = value[1] //将得到的小标题id存放起来
      this.query(this.newsCategoryId)
    },
    query(newsCategoryId){
    query(newsCategoryId) {
      const data = {
        current:this.currentPage,
        newsCategoryId:newsCategoryId,
        size:this.pageSize
      };
      getNewsList(data).then(res=>{
        // console.log(res);
        if (res.code !== 200) {
          return this.$message.error('获取新闻列表失败')
        }else{
          this.tableData = res.data.records
          this.total = res.data.total
        }
      }).catch(err => {
        console.log(err);
      })
        current: this.currentPage,
        newsCategoryId: newsCategoryId,
        size: this.pageSize
      }
      getNewsList(data)
        .then(res => {
          // console.log(res);
          if (res.code !== 200) {
            return this.$message.error('获取新闻列表失败')
          } else {
            this.tableData = res.data.records
            this.total = res.data.total
          }
        })
        .catch(err => {
          console.log(err)
        })
    },
    //展示修改对话框
    showEditDialog(id){
    showEditDialog(id) {
      getnew(id).then(res => {
        // console.log(res);
        if (res.code == 200) {
          this.editForm = res.data
        }
        }
      })
      this.editDialogVisible = true;
      this.editDialogVisible = true
    },
    //确定修改表单提交,验证发起请求
    editNew(){
    editNew() {
      const data = {
        id: this.editForm.id,
        releaseTime: this.editForm.releaseTime,
        title:this.editForm.title
        title: this.editForm.title
      }
      update(data).then(res=>{
      update(data).then(res => {
        // console.log('dsadasas',res);
        if (res.code == 200) {
          this.editDialogVisible =false;
          this.editDialogVisible = false
          this.$message.success('修改新闻成功!')
          this.query(this.newsCategoryId);
          this.query(this.newsCategoryId)
        }
      })
    },
    //模糊查询
    fuzzyList(title){
    fuzzyList(title) {
      // console.log(title);
      if(title == ''){
        return  this.$message.error('请先输入查询新闻标题!')
      if (title == '') {
        return this.$message.error('请先输入查询新闻标题!')
      }
      this.fuzzyShow = true //模糊分页显示
      this.getShow = false  //获取分页隐藏
      this.getShow = false //获取分页隐藏
      this.gettable = false
      this.fuzzytable = true
      const data = {
        current: this.fuzzyForm.fuzzycurrent,
        size: this.fuzzyForm.fuzzysize,
        title:title
        title: title
      }
      fuzzy(data).then(res => {
        // console.log(res);
        if (res.code !== 200) {
          return this.$message.error('查询新闻列表失败')
        }else{
          this.fuzzytableData = res.data.records
          this.fuzzyForm.fuzzytotal = res.data.total
        }
      }).catch(err => {
        console.log(err);
      })
      fuzzy(data)
        .then(res => {
          // console.log(res);
          if (res.code !== 200) {
            return this.$message.error('查询新闻列表失败')
          } else {
            this.fuzzytableData = res.data.records
            this.fuzzyForm.fuzzytotal = res.data.total
          }
        })
        .catch(err => {
          console.log(err)
        })
    },
    //清空查询列表内容
    qingKong(){
    qingKong() {
      this.tableData = []
      this.fuzzytableData = []
      this.fuzzyForm.fuzzytotal = 0
@@ -338,7 +336,7 @@
      this.gettable = true
    },
    //根据id删除新闻
    async deleteNews(id){
    async deleteNews(id) {
      // console.log(id);
      const res = await this.$confirm('此操作将永久删除该条新闻, æ˜¯å¦ç»§ç»­?', '提示', {
        confirmButtonText: '确定',
@@ -349,76 +347,93 @@
      })
      //如果用户点击确定则返回confirm
      //如果用户点击取消则返回cancel
      console.log(res);
      if(res !== 'confirm'){
      console.log(res)
      if (res !== 'confirm') {
        return this.$message.info('已取消删除~')
      }else{
        console.log(id);
      } else {
        console.log(id)
        const data = {
          id:id
          id: id
        }
        //参数data è¦ä»¥å¯¹è±¡çš„形式传入
        deleteNew(data).then(res => {
          console.log('>>>'+res);
          if(res.code == 200){
          console.log('>>>' + res)
          if (res.code == 200) {
            this.$message.success('删除新闻成功!')
            this.query(this.newsCategoryId);
          }else{
            this.query(this.newsCategoryId)
          } else {
            return this.$message.error('删除新闻失败!')
          }
        })
      }
    },
    //查看
    look(id){
      this.$router.push({path:'news',query:{id:id}})
    look(id) {
      this.$router.push({ path: 'news', query: { id: id } })
    },
    handleCurrentChange(val) {
      // console.log(`当前页: ${val}`);
      this.currentPage = val;
      this.currentPage = val
      this.query(this.newsCategoryId)
    },
    handleSizeChange(val) {
      // console.log(`每页 ${val} æ¡`);
      this.pageSize = val;
      this.pageSize = val
      this.query(this.newsCategoryId)
    },
    handleCurrentChangefuzzy(val){
    handleCurrentChangefuzzy(val) {
      this.fuzzyForm.fuzzycurrent = val
      this.fuzzyList(this.fuzzyForm.fuzzytitle) //模糊查询
    },
    handleSizeChangefuzzy(val){
    handleSizeChangefuzzy(val) {
      this.fuzzyForm.fuzzysize = val
      this.fuzzyList(this.fuzzyForm.fuzzytitle) //模糊查询
    },
    //去往添加编辑页面
    goEdit(id){
      if (this.newsCategoryId==27&&this.total==1||this.newsCategoryId==28&&this.total==1||this.newsCategoryId==29&&this.total==1||
      this.newsCategoryId==30&&this.total==1||this.newsCategoryId==31&&this.total==1) {
    goEdit(id) {
      if (
        (this.newsCategoryId == 27 && this.total == 1) ||
        (this.newsCategoryId == 28 && this.total == 1) ||
        (this.newsCategoryId == 29 && this.total == 1) ||
        (this.newsCategoryId == 30 && this.total == 1) ||
        (this.newsCategoryId == 31 && this.total == 1)
      ) {
        this.$message.error('该新闻标题下只能存在一篇新闻')
      }else if(this.newsCategoryId==27||this.newsCategoryId==28||this.newsCategoryId==29||this.newsCategoryId==30||
      this.newsCategoryId==31||this.newsCategoryId == 35||this.newsCategoryId==36||this.newsCategoryId==37||
      this.newsCategoryId==38||this.newsCategoryId==39||this.newsCategoryId==40||
      this.newsCategoryId==41||this.newsCategoryId==42||this.newsCategoryId==43||
      this.newsCategoryId==44){
        this.$router.push({path:'/administrator/edit',query:{id:id}})
        console.log(this.newsCategoryId);
      }else{
      } else if (
        this.newsCategoryId == 27 ||
        this.newsCategoryId == 28 ||
        this.newsCategoryId == 29 ||
        this.newsCategoryId == 30 ||
        this.newsCategoryId == 31 ||
        this.newsCategoryId == 35 ||
        this.newsCategoryId == 36 ||
        this.newsCategoryId == 37 ||
        this.newsCategoryId == 38 ||
        this.newsCategoryId == 39 ||
        this.newsCategoryId == 40 ||
        this.newsCategoryId == 41 ||
        this.newsCategoryId == 42 ||
        this.newsCategoryId == 43 ||
        this.newsCategoryId == 44
      ) {
        this.$router.push({ path: '/administrator/edit', query: { id: id } })
        console.log(this.newsCategoryId)
      } else {
        this.$message.error('请先选择新闻标题')
      }
      }
    }
  },
  }
}
</script>
<style lang="less">
.add{
.add {
  margin-bottom: 10px !important;
}
.block{
.block {
  margin-bottom: 10px;
}
.el-pagination{
.el-pagination {
  margin-top: 10px;
}
</style>
</style>
src/components/Administrator/Main.vue
@@ -3,14 +3,7 @@
    <!-- çº§è”选择器 -->
    <el-row class="block">
      <el-col :span="4">
        <el-cascader
          v-model="value"
          :options="options"
          clearable
          filterable
          :getCheckedNodes="true"
          @change="handleChange">
        </el-cascader>
        <el-cascader v-model="value" :options="options" clearable filterable :getCheckedNodes="true" @change="handleChange"> </el-cascader>
      </el-col>
    </el-row>
    <div>
@@ -22,29 +15,25 @@
          </el-col>
          <el-col :span="10">
            <!-- æ–°é—»æœç´¢ -->
            <el-input clearable placeholder="请输入所要查询的新闻标题" v-model="search" class="input-with-select">
            </el-input>
            <el-input clearable placeholder="请输入所要查询的新闻标题" v-model="search" class="input-with-select"> </el-input>
          </el-col>
        </el-row>
        <!-- æ–°é—»è¡¨æ ¼åŒºåŸŸ -->
        <el-table
        <el-table
          :data="tableData.filter(data => !search || data.title.toLowerCase().includes(search.toLowerCase()))"
          border
          style="width: 100%"
          :header-cell-style="{textAlign: 'center'}"
          border
          style="width: 100%"
          :header-cell-style="{ textAlign: 'center' }"
          :cell-style="{ textAlign: 'center' }"
        >
          <el-table-column type="index" label="序号" width="50">
            <template slot-scope="scope">
              <span>{{ (currentPage-1)*pageSize+scope.$index+1 }}</span>
              <span>{{ (currentPage - 1) * pageSize + scope.$index + 1 }}</span>
            </template>
          </el-table-column>
          <el-table-column prop="releaseTime" label="日期" width="" >
          </el-table-column>
          <el-table-column prop="title" label="新闻标题" width="">
          </el-table-column>
          <el-table-column prop="id" label="id" width="">
          </el-table-column>
          <el-table-column prop="releaseTime" label="日期" width=""> </el-table-column>
          <el-table-column prop="title" label="新闻标题" width=""> </el-table-column>
          <el-table-column prop="id" label="id" width=""> </el-table-column>
          <el-table-column label="操作" width="">
            <template slot-scope="scope">
              <!-- {{ scope.row.id }} -->
@@ -54,7 +43,6 @@
                <el-button type="info" @click="deleteNews(scope.row.id)">删除</el-button>
              </div>
            </template>
          </el-table-column>
        </el-table>
        <!-- åˆ†é¡µ -->
@@ -65,22 +53,19 @@
              @size-change="handleSizeChange"
              @current-change="handleCurrentChange"
              :current-page="currentPage"
              :page-sizes="[6,12, 18,]"
              :page-sizes="[6, 12, 18]"
              :page-size="100"
              layout="total, sizes, prev, pager, next, jumper"
              :total="total">
              :total="total"
            >
            </el-pagination>
          </div>
        </div>
      </el-card>
      <!-- ä¿®æ”¹æ–°é—»çš„对话框 -->
      <el-dialog
        title="修改新闻"
        :visible.sync="editDialogVisible"
        width="50%"
        :before-close="handleClose">
      <el-dialog title="修改新闻" :visible.sync="editDialogVisible" width="50%" :before-close="handleClose">
        <!-- rules表单验证规则,ref当前表单的验证对象 -->
        <el-form ref="editFormRef" :model="editForm"  label-width="80px" status-icon>
        <el-form ref="editFormRef" :model="editForm" label-width="80px" status-icon>
          <el-form-item label="id:">
            <el-input v-model="editForm.id" disabled></el-input>
          </el-form-item>
@@ -88,13 +73,7 @@
            <el-input v-model="editForm.title"></el-input>
          </el-form-item>
          <el-form-item label="发布日期:">
            <el-date-picker
              v-model="editForm.releaseTime"
              type="date"
              placeholder="请选择发布日期"
              format="yyyy å¹´ MM æœˆ dd æ—¥"
              value-format="yyyy-MM-dd"
            ></el-date-picker>
            <el-date-picker v-model="editForm.releaseTime" type="date" placeholder="请选择发布日期" format="yyyy å¹´ MM æœˆ dd æ—¥" value-format="yyyy-MM-dd"></el-date-picker>
          </el-form-item>
        </el-form>
        <span slot="footer" class="dialog-footer">
@@ -107,207 +86,222 @@
</template>
<script>
import { getNewsList,getnew,update,deleteNew,fuzzy } from '../../api/api'
import { getNewsList, getnew, update, deleteNew, fuzzy } from '../../api/api'
export default {
  data() {
    return {
      search:'',
      getShow:true, //获取分页的显示(布尔值)
      gettable:true,  //获取表格的显示
      search: '',
      getShow: true, //获取分页的显示(布尔值)
      gettable: true, //获取表格的显示
      visible: false,
      editDialogVisible:false,  //控制修改对话框的布尔值
      AdDialogVisible:false,  //超管登录对话框
      Ad:{ username:'',password:'' }, //超管对象
      editForm:{},  //查询到的新闻对象,目前仅供修改使用
      newsCategoryId:1, //先存一个小标题id
      tableData:[],   //新闻列表对象
      fuzzytableData:[],  //模糊查询列表对象
      pageSize:6,     //每页条数
      currentPage:1,  //当前页
      total:0,        //新闻总条数
      fuzzyShow:false,  //模糊查询分页的显示(布尔值)
      fuzzytable:false, //模糊查询表格的显示
      fuzzyForm:{ fuzzytitle:'',fuzzytotal:0,fuzzycurrent:1,fuzzysize:6 },  //模糊查询列表对象
      editDialogVisible: false, //控制修改对话框的布尔值
      AdDialogVisible: false, //超管登录对话框
      Ad: { username: '', password: '' }, //超管对象
      editForm: {}, //查询到的新闻对象,目前仅供修改使用
      newsCategoryId: 1, //先存一个小标题id
      tableData: [], //新闻列表对象
      fuzzytableData: [], //模糊查询列表对象
      pageSize: 6, //每页条数
      currentPage: 1, //当前页
      total: 0, //新闻总条数
      fuzzyShow: false, //模糊查询分页的显示(布尔值)
      fuzzytable: false, //模糊查询表格的显示
      fuzzyForm: { fuzzytitle: '', fuzzytotal: 0, fuzzycurrent: 1, fuzzysize: 6 }, //模糊查询列表对象
      value: [],
      options: [{
        value: 1,
        label: '首页',
        children: [{
          value:42,
          label: '通知公告',
        },
      options: [
        {
          value:43,
          label: '工作动态',
          value: 1,
          label: '首页',
          children: [
            {
              value: 42,
              label: '通知公告'
            },
            {
              value: 43,
              label: '工作动态'
            },
            {
              value: 44,
              label: '学院动态'
            },
            {
              value: 45,
              label: '轮播图'
            }
          ]
        },
        {
          value:44,
          label: '学院动态',
        },
        {
          value:45,
          label: '轮播图',
        }],
      },{
          value: 22,
          label: '科协概况',
          children: [{
            value:27,
            label: '简介',
          },
          {
            value:28,
            label: '章程',
          },
          {
            value:29,
            label: '组织结构',
          },
          {
            value:30,
            label: '工作职责',
          },
          {
            value:31,
            label: '专职人员',
          }],
          children: [
            {
              value: 27,
              label: '简介'
            },
            {
              value: 28,
              label: '章程'
            },
            {
              value: 29,
              label: '组织结构'
            },
            {
              value: 30,
              label: '工作职责'
            },
            {
              value: 31,
              label: '专职人员'
            }
          ]
        },
        {
          value: 23,
          label: '政策法规',
          children: [{
            value:35,
            label: '中国科协政策文件',
          },
          {
            value:36,
            label: '地方科协政策文件',
          },
          {
            value:37,
            label: '社团管理文件',
          }],
          children: [
            {
              value: 35,
              label: '中国科协政策文件'
            },
            {
              value: 36,
              label: '地方科协政策文件'
            },
            {
              value: 37,
              label: '社团管理文件'
            }
          ]
        },
        {
          value: 25,
          label: '学术交流',
          children: [{
            value:38,
            label: '学术信息',
          },
          {
            value:39,
            label: '科技竞赛',
          }],
          children: [
            {
              value: 38,
              label: '学术信息'
            },
            {
              value: 39,
              label: '科技竞赛'
            }
          ]
        },
        {
          value: 27,
          label: '科普风采',
          children: [{
            value:40,
            label: '平顶山学院科普活动',
          },
          {
            value:41,
            label: '平顶山市政协科普活动',
          }],
      }]
          children: [
            {
              value: 40,
              label: '平顶山学院科普活动'
            },
            {
              value: 41,
              label: '平顶山市政协科普活动'
            }
          ]
        }
      ]
    }
  },
  created(){
  },
  mounted(){
  },
  created() {},
  mounted() {},
  methods: {
    //修改对话框关闭的方法
    handleClose(done) {
      this.$confirm('确认关闭?')
        .then(_ => {
          done();
          done()
        })
        .catch(_ => {});
        .catch(_ => {})
    },
    //级联选择器的方法
    handleChange(value) {
      // console.log(value);
      // console.log(value[1]);
      this.currentPage = 1;
      this.newsCategoryId = value[1]; //将得到的小标题id存放起来
      this.query(this.newsCategoryId);
      this.currentPage = 1
      this.newsCategoryId = value[1] //将得到的小标题id存放起来
      this.query(this.newsCategoryId)
    },
    query(newsCategoryId){
    query(newsCategoryId) {
      const data = {
        current:this.currentPage,
        newsCategoryId:newsCategoryId,
        size:this.pageSize
      };
      getNewsList(data).then(res=>{
        // console.log(res);
        if (res.code !== 200) {
          return this.$message.error('获取新闻列表失败')
        }else{
          this.tableData = res.data.records
          this.total = res.data.total
        }
      }).catch(err => {
        console.log(err);
      })
        current: this.currentPage,
        newsCategoryId: newsCategoryId,
        size: this.pageSize
      }
      getNewsList(data)
        .then(res => {
          // console.log(res);
          if (res.code !== 200) {
            return this.$message.error('获取新闻列表失败')
          } else {
            this.tableData = res.data.records
            this.total = res.data.total
          }
        })
        .catch(err => {
          console.log(err)
        })
    },
    //展示修改对话框
    showEditDialog(id){
    showEditDialog(id) {
      getnew(id).then(res => {
        // console.log(res);
        if (res.code == 200) {
          this.editForm = res.data
        }
        }
      })
      this.editDialogVisible = true;
      this.editDialogVisible = true
    },
    //确定修改表单提交,验证发起请求
    editNew(){
    editNew() {
      const data = {
        id: this.editForm.id,
        releaseTime: this.editForm.releaseTime,
        title:this.editForm.title
        title: this.editForm.title
      }
      update(data).then(res=>{
        console.log('dsadasas',res);
      update(data).then(res => {
        console.log('dsadasas', res)
        if (res.code == 200) {
          this.editDialogVisible =false;
          this.editDialogVisible = false
          this.$message.success('修改新闻成功!')
          this.query(this.newsCategoryId);
          this.query(this.newsCategoryId)
        }
      })
    },
    //模糊查询
    fuzzyList(title){
    fuzzyList(title) {
      // console.log(title);
      if(title == ''){
        return  this.$message.error('请先输入查询新闻标题!')
      if (title == '') {
        return this.$message.error('请先输入查询新闻标题!')
      }
      this.fuzzyShow = true //模糊分页显示
      this.getShow = false  //获取分页隐藏
      this.getShow = false //获取分页隐藏
      this.gettable = false
      this.fuzzytable = true
      const data = {
        current: this.fuzzyForm.fuzzycurrent,
        size: this.fuzzyForm.fuzzysize,
        title:title
        title: title
      }
      fuzzy(data).then(res => {
        // console.log(res);
        if (res.code !== 200) {
          return this.$message.error('查询新闻列表失败')
        }else{
          this.fuzzytableData = res.data.records
          this.fuzzyForm.fuzzytotal = res.data.total
        }
      }).catch(err => {
        console.log(err);
      })
      fuzzy(data)
        .then(res => {
          // console.log(res);
          if (res.code !== 200) {
            return this.$message.error('查询新闻列表失败')
          } else {
            this.fuzzytableData = res.data.records
            this.fuzzyForm.fuzzytotal = res.data.total
          }
        })
        .catch(err => {
          console.log(err)
        })
    },
    //清空查询列表内容
    qingKong(){
    qingKong() {
      this.tableData = []
      this.fuzzytableData = []
      this.fuzzyForm.fuzzytotal = 0
@@ -317,7 +311,7 @@
      this.gettable = true
    },
    //根据id删除新闻
    async deleteNews(id){
    async deleteNews(id) {
      // console.log(id);
      const res = await this.$confirm('此操作将永久删除该条新闻, æ˜¯å¦ç»§ç»­?', '提示', {
        confirmButtonText: '确定',
@@ -328,98 +322,114 @@
      })
      //如果用户点击确定则返回confirm
      //如果用户点击取消则返回cancel
      console.log(res);
      if(res !== 'confirm'){
      console.log(res)
      if (res !== 'confirm') {
        return this.$message.info('已取消删除~')
      }else{
        console.log(id);
      } else {
        console.log(id)
        const data = {
          id:id
          id: id
        }
        //参数data è¦ä»¥å¯¹è±¡çš„形式传入
        deleteNew(data).then(res => {
          console.log('>>>'+res);
          if(res.code == 200){
          console.log('>>>' + res)
          if (res.code == 200) {
            this.$message.success('删除新闻成功!')
            this.query(this.newsCategoryId);
          }else{
            this.query(this.newsCategoryId)
          } else {
            return this.$message.error('删除新闻失败!')
          }
        })
      }
    },
    //查看
    look(id){
      this.$router.push({path:'news',query:{id:id}})
    look(id) {
      this.$router.push({ path: 'news', query: { id: id } })
    },
    //超管登录对话框
    showAdDialog(){
    showAdDialog() {
      this.AdDialogVisible = true
    },
    handleCurrentChange(val) {
      // console.log(`当前页: ${val}`);
      this.currentPage = val;
      this.currentPage = val
      this.query(this.newsCategoryId)
    },
    handleSizeChange(val) {
      // console.log(`每页 ${val} æ¡`);
      this.pageSize = val;
      this.pageSize = val
      this.query(this.newsCategoryId)
    },
    handleCurrentChangefuzzy(val){
    handleCurrentChangefuzzy(val) {
      this.fuzzyForm.fuzzycurrent = val
      this.fuzzyList(this.fuzzyForm.fuzzytitle) //模糊查询
    },
    handleSizeChangefuzzy(val){
    handleSizeChangefuzzy(val) {
      this.fuzzyForm.fuzzysize = val
      this.fuzzyList(this.fuzzyForm.fuzzytitle) //模糊查询
    },
    //去往添加编辑页面
    goEdit(id){
      let title = '';
      console.log(this.value);
      if (this.value.length = 2) {
        let t = this.value[0];
        let i = this.value[1];
        this.options.forEach( item => {
          if(item.value == t){
            title += item.label+'/'
            item.children.forEach( e => {
              if(e.value == i) title += e.label;
    goEdit(id) {
      let title = ''
      console.log(this.value)
      if ((this.value.length = 2)) {
        let t = this.value[0]
        let i = this.value[1]
        this.options.forEach(item => {
          if (item.value == t) {
            title += item.label + '/'
            item.children.forEach(e => {
              if (e.value == i) title += e.label
            })
          }
        })
      }
      if (this.newsCategoryId==27&&this.total==1||this.newsCategoryId==28&&this.total==1||this.newsCategoryId==29&&this.total==1||
      this.newsCategoryId==30&&this.total==1||this.newsCategoryId==31&&this.total==1) {
      if (
        (this.newsCategoryId == 27 && this.total == 1) ||
        (this.newsCategoryId == 28 && this.total == 1) ||
        (this.newsCategoryId == 29 && this.total == 1) ||
        (this.newsCategoryId == 30 && this.total == 1) ||
        (this.newsCategoryId == 31 && this.total == 1)
      ) {
        this.$message.error('该新闻标题下只能存在一篇新闻')
      }else if(this.newsCategoryId==27||this.newsCategoryId==28||this.newsCategoryId==29||this.newsCategoryId==30||
      this.newsCategoryId==31||this.newsCategoryId == 35||this.newsCategoryId==36||this.newsCategoryId==37||
      this.newsCategoryId==38||this.newsCategoryId==39||this.newsCategoryId==40||
      this.newsCategoryId==41||this.newsCategoryId==42||this.newsCategoryId==43||
      this.newsCategoryId==44){
        this.$router.push({path:'/administrator/edit',query:{id:id,title:title}})
        console.log(this.newsCategoryId);
      }else if(this.newsCategoryId==45){
        this.$router.push({path:'/administrator/editlunbo',query:{id:id,title:title}})
      } else if (
        this.newsCategoryId == 27 ||
        this.newsCategoryId == 28 ||
        this.newsCategoryId == 29 ||
        this.newsCategoryId == 30 ||
        this.newsCategoryId == 31 ||
        this.newsCategoryId == 35 ||
        this.newsCategoryId == 36 ||
        this.newsCategoryId == 37 ||
        this.newsCategoryId == 38 ||
        this.newsCategoryId == 39 ||
        this.newsCategoryId == 40 ||
        this.newsCategoryId == 41 ||
        this.newsCategoryId == 42 ||
        this.newsCategoryId == 43 ||
        this.newsCategoryId == 44
      ) {
        this.$router.push({ path: '/administrator/edit', query: { id: id, title: title } })
        console.log(this.newsCategoryId)
      } else if (this.newsCategoryId == 45) {
        this.$router.push({ path: '/administrator/editlunbo', query: { id: id, title: title } })
        // console.log(this.newsCategoryId);
      }else{
      } else {
        this.$message.error('请先选择新闻标题')
      }
    }
  },
  }
}
</script>
<style lang="less">
.add{
.add {
  margin-bottom: 10px !important;
}
.block{
.block {
  margin-bottom: 10px;
}
.el-pagination{
.el-pagination {
  margin-top: 10px;
}
</style>
</style>
src/components/Administrator/Welcome.vue
@@ -2,76 +2,63 @@
  <div>
    <h2>欢迎进入后台管理系统</h2>
    <el-upload
      ref="upload"
      action
      accept="image/*"
      :limit= 3
      :file-list='filelist'
      list-type="picture-card"
      :on-preview="handlePictureCardPreview"
      :on-remove="handleRemove"
      :http-request='upload'>
    <el-upload ref="upload" action accept="image/*" :limit="3" :file-list="filelist" list-type="picture-card" :on-preview="handlePictureCardPreview" :on-remove="handleRemove" :http-request="upload">
      <i class="el-icon-plus"></i>
    </el-upload>
    <el-dialog :visible.sync="dialogVisible">
      <img width="100%" :src="dialogImageUrl" alt="">
      <img width="100%" :src="dialogImageUrl" alt="" />
    </el-dialog>
    <el-button @click="save">保存</el-button>
  </div>
</template>
<script>
import {fileUpload, update} from '../../api/api'
import { fileUpload, update } from '../../api/api'
export default {
  data() {
    return {
      // fileList: []
      imageUrl:'',
      filelist:[],
      delList:[],
      dialogVisible:false,
      dialogImageUrl:'',
      imageUrl: '',
      filelist: [],
      delList: [],
      dialogVisible: false,
      dialogImageUrl: ''
    }
  },
  methods:{
    save(){
  methods: {
    save() {
      //取到图片集合
      let uploadImglist = this.$refs.upload.uploadFiles
      console.log(uploadImglist);
      let formData = new FormData();
      console.log(uploadImglist)
      let formData = new FormData()
      uploadImglist.forEach(item => {
        //ready状态的是未上传的 success是已经上传成功的,只需要添加未上传的即可
        if(item.status == "ready"){
          formData.append('file', item.raw);
        if (item.status == 'ready') {
          formData.append('file', item.raw)
        }
      });
      })
      formData.get('file')
      fileUpload(formData).then(res=>{
      fileUpload(formData).then(res => {
        //上传接口
        console.log(res);
        console.log(res)
      })
    },
    // é¢„览图片
    handlePictureCardPreview(file){
    handlePictureCardPreview(file) {
      this.dialogVisible = true
      this.dialogImageUrl=file.url
      console.log(this.dialogImageUrl);
      this.dialogImageUrl = file.url
      console.log(this.dialogImageUrl)
    },
    // åˆ é™¤å›¾ç‰‡
    handleRemove(file){
    handleRemove(file) {
      //判断状态,如果是上传成功的 éœ€è¦æŠŠid加到删除id集合里面
      if(file.status == 'success'){
      if (file.status == 'success') {
        this.delList.push(file.id)
      }
    },
    upload(){
    }
    upload() {}
  }
}
</script>
<style lang="less" scoped>
</style>
<style lang="less" scoped></style>
src/components/Home.vue
@@ -6,13 +6,13 @@
        <img src="../assets/xiaohui4.png" alt="" />
      </div>
      <div>
        <img src="../assets/bg.png" alt="">
        <img src="../assets/bg.png" alt="" />
      </div>
    </el-header>
    <!-- ä¸»é¡µå¯¼èˆªæ  -->
    <el-row>
      <el-menu mode="horizontal" background-color="rgb(64, 112, 186)" text-color="white" class="menu" active-text-color="#000000" :default-active="activeIndex" @select="handleSelect">
        <el-menu-item :key="index" v-for="(item, index) in menuList" :index="(item.id).toString()">
        <el-menu-item :key="index" v-for="(item, index) in menuList" :index="item.id.toString()">
          {{ item.name }}
        </el-menu-item>
      </el-menu>
@@ -28,17 +28,25 @@
</template>
<script>
import {getNavList} from '../api/api'
import { getNavList } from '../api/api'
import axios from 'axios'
export default {
  name: '',
  data() {
    return {
      activeIndex: '1',
      menuList: [{name: '首页',id: 1},{name: '科协概况',id: 22},{name: '政策法规',id: 23},{name: '科协项目',id: 24},
      {name: '学术交流',id: 25},{name: '办事指南',id: 26},{name: '科普风采',id: 27},{name: '学校首页',id: 28},
      {name: '联系我们',id: 29}],
      menuList2:[]
      menuList: [
        { name: '首页', id: 1 },
        { name: '科协概况', id: 22 },
        { name: '政策法规', id: 23 },
        { name: '科协项目', id: 24 },
        { name: '学术交流', id: 25 },
        { name: '办事指南', id: 26 },
        { name: '科普风采', id: 27 },
        { name: '学校首页', id: 28 },
        { name: '联系我们', id: 29 }
      ],
      menuList2: []
    }
  },
  created() {
@@ -46,12 +54,15 @@
  },
  mounted() {
    let api3 = 'http://localhost:7070/news_type/all'
    axios.get(api3).then((res)=>{
      // console.log(res);
      this.menuList2 = res.data.data
    }).catch((error)=>{
      console.log(error);
    })
    axios
      .get(api3)
      .then(res => {
        // console.log(res);
        this.menuList2 = res.data.data
      })
      .catch(error => {
        console.log(error)
      })
  },
  watch: {},
  methods: {
@@ -68,9 +79,9 @@
    //     console.log('err', err)
    //   })
    // },
    formatterTitle(t){
      switch(t){
    formatterTitle(t) {
      switch (t) {
        case '1':
          return 'index'
        case '22':
@@ -99,7 +110,7 @@
          path: '/home/' + this.formatterTitle(key),
          query: {
            title: this.formatterTitle(key),
            id:key
            id: key
          }
        })
      }
@@ -150,4 +161,4 @@
  width: 1200px;
  margin: 0 auto;
}
</style>
</style>
src/components/Login.vue
@@ -34,7 +34,7 @@
      loginForm: {
        username: '',
        password: ''
      },
      }
    }
  },
  methods: {
@@ -48,16 +48,16 @@
        password: this.loginForm.password
      }
      login(data).then(res => {
        console.log(res);
        if(res.code !== 200){
        console.log(res)
        if (res.code !== 200) {
          this.$message.error('登录失败!')
        }else if(res.data.role == '超级管理员'){
        } else if (res.data.role == '超级管理员') {
          this.$message.success('超管登录成功!')
          window.sessionStorage.setItem('token',res.cookie)
          window.sessionStorage.setItem('token', res.cookie)
          this.$router.push('/administrator/admain')
        }else{
        } else {
          this.$message.success('登录成功!')
          window.sessionStorage.setItem('token',res.cookie)
          window.sessionStorage.setItem('token', res.cookie)
          this.$router.push('/administrator/main')
        }
      })
src/components/NotFound.vue
@@ -1,22 +1,21 @@
<template>
  <div class="center">
    <img src="../assets/404.gif" alt="">
    <img src="../assets/404.gif" alt="" />
  </div>
</template>
<script>
export default {
};
export default {}
</script>
<style scoped>
.center{
.center {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%,-50%);
  transform: translate(-50%, -50%);
}
img{
img {
  width: 300px;
}
</style>
src/components/globalTitle.vue
@@ -2,7 +2,9 @@
  <div>
    <el-row>
      <div class="fl">
        <span><b>{{ getTitle(this.$route.query.title) }}</b></span>
        <span
          ><b>{{ getTitle(this.$route.query.title) }}</b></span
        >
      </div>
      <div class="fr">
        <el-breadcrumb separator-class="el-icon-arrow-right">
@@ -16,17 +18,16 @@
</template>
<script>
export default {
  name:'globalTitle',
  data(){
  name: 'globalTitle',
  data() {
    return {
      title:'',
      title: ''
    }
  },
  created(){
  },
  methods:{
    getTitle(v){
      switch(v){
  created() {},
  methods: {
    getTitle(v) {
      switch (v) {
        case 'introduce':
          return '科协概况'
        case 'zhengce':
@@ -50,8 +51,8 @@
</script>
<style scoped>
  .el-row {
    /* background-color: rgb(83, 168, 125); */
    border-bottom: 1px solid #0f99e9;
  }
</style>
.el-row {
  /* background-color: rgb(83, 168, 125); */
  border-bottom: 1px solid #0f99e9;
}
</style>
src/components/page/News.vue
@@ -3,40 +3,40 @@
    <!-- <p>{{ this.$route.query.id }}</p> -->
    <div class="header">
      <h2>{{ title }}</h2>
      <p>发布日期:{{ releaseTime }} ç‚¹å‡»é‡ï¼š[ {{(hits+1)/2}} ]</p>
      <p>发布日期:{{ releaseTime }} ç‚¹å‡»é‡ï¼š[ {{ (hits + 1) / 2 }} ]</p>
    </div>
    <hr>
    <hr />
    <div v-html="content" class="ql-editor"></div>
  </div>
</template>
<script>
import {getnew} from '../../api/api'
import { getnew } from '../../api/api'
export default {
  name:'noticeMessage',
  data(){
  name: 'noticeMessage',
  data() {
    return {
      content:'',
      hits:'',
      releaseTime:'',
      title:''
      content: '',
      hits: '',
      releaseTime: '',
      title: ''
    }
  },
  created(){
  created() {
    // console.log(">>>>>>>>",this.$route.query.id);
    this.getalone();
    this.getalone()
  },
  methods:{
    getalone(){
      const data = this.$route.query.id;
  methods: {
    getalone() {
      const data = this.$route.query.id
      getnew(data).then(res => {
        console.log(res);
        this.content = res.data.content;
        this.hits = res.data.hits;
        this.releaseTime = res.data.releaseTime;
        this.title = res.data.title;
        console.log(res)
        this.content = res.data.content
        this.hits = res.data.hits
        this.releaseTime = res.data.releaseTime
        this.title = res.data.title
      })
    },
  },
    }
  }
}
</script>
<style>
@@ -44,25 +44,25 @@
  width: 1200px;
  margin: 0 auto;
}
.header h2{
.header h2 {
  color: rgb(3, 73, 144);
  text-align: center;
}
.header p{
.header p {
  background-color: rgb(246, 246, 246);
  text-align: center;
  height: 35px;
  line-height: 35px;
}
.ql-editor{
.ql-editor {
  padding: 12px 0px !important;
}
.ql-editor p{
.ql-editor p {
  letter-spacing: 1px;
  line-height: 25px;
}
.ql-editor img{
.ql-editor img {
  width: 600px;
  height: 400px;
}
</style>
</style>
src/components/page/banShiZhiNan.vue
@@ -2,7 +2,7 @@
  <div>
    <globalTitle />
    <div>
      <img src="../../assets/keyanlixiangjieti.png" alt="">
      <img src="../../assets/keyanlixiangjieti.png" alt="" />
    </div>
  </div>
</template>
@@ -10,12 +10,9 @@
<script>
import globalTitle from '../globalTitle.vue'
export default {
  components: { globalTitle},
  name: 'banShiZhiNan',
  components: { globalTitle },
  name: 'banShiZhiNan'
}
</script>
<style lang="less" scoped>
</style>
<style lang="less" scoped></style>
src/components/page/index.vue
@@ -2,30 +2,30 @@
  <div calss="box">
    <!-- é¦–页上半部分 -->
    <el-row type="flex" class="row-bg" justify="space-between">
        <div class="block marr10">
          <el-carousel height="450px"  arrow="always" :interval="3000">
            <el-carousel-item v-for="(item,index) in imgList" :key="index">
              <div @click="gonew(item.id)" class="cursor" style="width:590px; height:450px">
                <img :src="'http://localhost:7070/'+item.picturePath"  alt="" style="width:100%; height:90%">
              </div>
            </el-carousel-item>
          </el-carousel>
        </div>
      <div class="block marr10">
        <el-carousel height="450px" arrow="always" :interval="3000">
          <el-carousel-item v-for="(item, index) in imgList" :key="index">
            <div @click="gonew(item.id)" class="cursor" style="width:590px; height:450px">
              <img :src="'http://localhost:7070/' + item.picturePath" alt="" style="width:100%; height:90%" />
            </div>
          </el-carousel-item>
        </el-carousel>
      </div>
      <notice class="notice" />
    </el-row>
    <!-- é¦–页下半部分 -->
    <el-row type="flex" class="row-bg" justify="space-between">
      <work class="work"/>
      <school class="school"/>
      <other class="other"/>
      <work class="work" />
      <school class="school" />
      <other class="other" />
    </el-row>
    <!-- å®šä½fixed -->
    <div class="fixed1">
      <a href="#"><img src="../../assets/gzh.jpg" alt=""></a>
      <a href="#"><img src="../../assets/gzh.jpg" alt=""/></a>
    </div>
    <div class="fixed2">
      <a href="#"><img src="../../assets/wb.jpg" alt=""></a>
      <a href="#"><img src="../../assets/wb.jpg" alt=""/></a>
    </div>
  </div>
</template>
@@ -35,42 +35,44 @@
import school from '../../views/school.vue'
import other from '../../views/other.vue'
import {getNewsList} from '../../api/api'
import { getNewsList } from '../../api/api'
export default {
  components: { notice, work, school, other },
  name: 'index',
  data(){
    return{
  data() {
    return {
      // imgList:[
      //   { path:require('../../assets/1.jpg'),index: 1},
      //   { path:require('../../assets/2.jpg'),index: 2},
      //   { path:require('../../assets/3.jpg'),index: 3},
      // ],
      imgList:[],
      imgList: []
    }
  },
  created(){
  created() {
    this.getnews()
  },
  methods:{
    getnews(){
      const data ={
        current:1,
        newsCategoryId:45,
        size:3
  methods: {
    getnews() {
      const data = {
        current: 1,
        newsCategoryId: 45,
        size: 3
      }
      getNewsList(data).then(res => {
        console.log(res);
        if(res.code == 200){
          this.imgList = res.data.records
        }
      }).catch(err => {
        console.log(err);
      })
      getNewsList(data)
        .then(res => {
          console.log(res)
          if (res.code == 200) {
            this.imgList = res.data.records
          }
        })
        .catch(err => {
          console.log(err)
        })
    },
    gonew(id){
      this.$router.push({path:'/home/news',query:{id:id}})
    gonew(id) {
      this.$router.push({ path: '/home/news', query: { id: id } })
    }
  }
}
@@ -86,7 +88,7 @@
    // object-fit:cover;
  }
}
.notice{
.notice {
  width: 50%;
}
.work {
@@ -102,12 +104,12 @@
}
.fixed1 {
  position: fixed;
  top:270px;
  top: 270px;
  right: 2px;
}
.fixed2 {
  position: fixed;
  top:340px;
  top: 340px;
  right: 2px;
}
</style>
</style>
src/components/page/introduce.vue
@@ -8,11 +8,11 @@
      <el-col :span="4" class="marr10">
        <ul>
          <li v-for="(item, index) in menuList" :key="index" class="liStylenone liPointer marb10" @click="changeMenu(item)">
            <b :class="cont == item.name ? 'ft-blue' : 'ft-black'">{{item.name}}</b>
            <b :class="cont == item.name ? 'ft-blue' : 'ft-black'">{{ item.name }}</b>
          </li>
        </ul>
      </el-col>
       <!-- æ–°é—»å†…容 -->
      <!-- æ–°é—»å†…容 -->
      <el-card class="box-card">
        <el-col>
          <div v-html="this.new.content" class="ql-editor"></div>
@@ -24,7 +24,7 @@
<script>
import globalTitle from '../globalTitle.vue'
import {getMinTitle,getNewsList,getnew} from '../../api/api'
import { getMinTitle, getNewsList, getnew } from '../../api/api'
export default {
  name: 'introduce',
  components: {
@@ -34,68 +34,73 @@
    return {
      cont: '',
      menuList: [],
      newsList:[],
      new:{}  //新闻对象
      newsList: [],
      new: {} //新闻对象
    }
  },
  created() {
  },
  created() {},
  mounted() {
    this.getTitle();
    this.getTitle()
  },
  watch: {
    menuList(n,o){
      this.cont =  this.menuList[0].name;
      this.getnews(this.menuList[0]); //改变对象,菜单栏的东西要写到监听属性里边
    menuList(n, o) {
      this.cont = this.menuList[0].name
      this.getnews(this.menuList[0]) //改变对象,菜单栏的东西要写到监听属性里边
    }
  },
  methods: {
    //获取小标题的id
    getTitle(){
      const data = Number(this.$route.query.id);
      getMinTitle(data).then(res => {
        // console.log(res);
        if(res.code == 200){
          this.menuList = res.data
        }
      }).catch(err => {
        console.log(err);
      })
    getTitle() {
      const data = Number(this.$route.query.id)
      getMinTitle(data)
        .then(res => {
          // console.log(res);
          if (res.code == 200) {
            this.menuList = res.data
          }
        })
        .catch(err => {
          console.log(err)
        })
    },
    //小标题菜单的球切换
    changeMenu(val) {
      this.cont = val.name;
      this.cont = val.name
      this.getnews(val)
    },
    //获取到了新闻列表,里边只有一个对象
    getnews(item){
    getnews(item) {
      const data = {
        current:1,
        newsCategoryId:item.id,
        size:5
      };
      getNewsList(data).then(res => {
        // console.log(res);
        if(res.code == 200){
          this.newsList = res.data.records
          this.getalone(this.newsList[0].id)
        }
      }).catch(error => {
        console.log(error);
      })
        current: 1,
        newsCategoryId: item.id,
        size: 5
      }
      getNewsList(data)
        .then(res => {
          // console.log(res);
          if (res.code == 200) {
            this.newsList = res.data.records
            this.getalone(this.newsList[0].id)
          }
        })
        .catch(error => {
          console.log(error)
        })
    },
    //获取新闻内容,得到一个新闻对象
    getalone(id){
      const data = id;
      getnew(data).then(res => {
        // console.log(res);
        if(res.code == 200){
          this.new = res.data;
          console.log(this.new.content);
        }
      }).catch(error => {
        console.log(error);
      })
    getalone(id) {
      const data = id
      getnew(data)
        .then(res => {
          // console.log(res);
          if (res.code == 200) {
            this.new = res.data
            console.log(this.new.content)
          }
        })
        .catch(error => {
          console.log(error)
        })
    }
  }
}
@@ -116,7 +121,7 @@
.ft-black {
  color: #000;
}
.ql-editor{
.ql-editor {
  padding: 12px 0px !important;
}
</style>
</style>
src/components/page/kePuFengCai.vue
@@ -8,14 +8,14 @@
      <el-col :span="4" class="marr10">
        <ul>
          <li v-for="(item, index) in menuList" :key="index" class="liStylenone liPointer marb10" @click="changeMenu(item)">
            <b :class="cont == item.name ? 'ft-blue' : 'ft-black'">{{item.name}}</b>
            <b :class="cont == item.name ? 'ft-blue' : 'ft-black'">{{ item.name }}</b>
          </li>
        </ul>
      </el-col>
       <!-- æ–°é—»å†…容 -->
      <!-- æ–°é—»å†…容 -->
      <el-card class="box-card">
        <p class="name">{{this.cont}}</p>
        <hr class="namehr">
        <p class="name">{{ this.cont }}</p>
        <hr class="namehr" />
        <el-col :span="24">
          <div>
            <el-row class="marb10" :key="index" v-for="(item, index) in newsList">
@@ -28,14 +28,7 @@
          </div>
          <!-- åˆ†é¡µ -->
          <div class="fenye">
            <el-pagination
              background
              @current-change="handleCurrentChange"
              :current-page.sync="currentPage"
              :page-size="pageSize"
              layout="prev, pager, next,total"
              :total="total">
            </el-pagination>
            <el-pagination background @current-change="handleCurrentChange" :current-page.sync="currentPage" :page-size="pageSize" layout="prev, pager, next,total" :total="total"> </el-pagination>
          </div>
        </el-col>
      </el-card>
@@ -53,66 +46,69 @@
    return {
      cont: '',
      menuList: [],
      newsList:[],
      pageSize:6,
      currentPage:1,
      total:0,
      item:{},
      newsList: [],
      pageSize: 6,
      currentPage: 1,
      total: 0,
      item: {}
    }
  },
  created() {
  },
  created() {},
  mounted() {
    this.getTitle();
    this.getTitle()
  },
  watch: {
    menuList(n,o){
      this.cont =  this.menuList[0].name
      this.item = this.menuList[0];
      this.getnews(this.menuList[0]);
    menuList(n, o) {
      this.cont = this.menuList[0].name
      this.item = this.menuList[0]
      this.getnews(this.menuList[0])
    }
  },
  methods: {
    handleCurrentChange(val) {
      console.log(`当前页: ${val}`);
      this.getnews(this.item);
      console.log(`当前页: ${val}`)
      this.getnews(this.item)
    },
    getTitle(){
      const data = Number(this.$route.query.id);
      getMinTitle(data).then(res => {
        console.log(res);
        if(res.code == 200){
          this.menuList = res.data
        }
      }).catch(err => {
        console.log(err);
      })
    getTitle() {
      const data = Number(this.$route.query.id)
      getMinTitle(data)
        .then(res => {
          console.log(res)
          if (res.code == 200) {
            this.menuList = res.data
          }
        })
        .catch(err => {
          console.log(err)
        })
    },
    changeMenu(val) {
      this.cont = val.name
      this.item = val
      this.currentPage = 1
      this.getnews(val);
      this.getnews(val)
    },
    getnews(item){
    getnews(item) {
      const data = {
        current:this.currentPage,
        newsCategoryId:item.id,
        size:this.pageSize
      };
      getNewsList(data).then(res => {
        console.log(res);
        if(res.code == 200){
          this.newsList = res.data.records
          this.total =  Number(res.data.total)
        }
      }).catch(error => {
        console.log(error);
      })
        current: this.currentPage,
        newsCategoryId: item.id,
        size: this.pageSize
      }
      getNewsList(data)
        .then(res => {
          console.log(res)
          if (res.code == 200) {
            this.newsList = res.data.records
            this.total = Number(res.data.total)
          }
        })
        .catch(error => {
          console.log(error)
        })
    },
    show(item){
    show(item) {
      // console.log(item.id);
      this.$router.push({path:'/home/news',query:{id:item.id}})
      this.$router.push({ path: '/home/news', query: { id: item.id } })
    }
  }
}
@@ -134,12 +130,12 @@
.ft-black {
  color: #000;
}
.box-card{
.box-card {
  height: 500px;
  position: relative;
  .fenye{
  .fenye {
    position: absolute;
    bottom: 10px;
  }
}
</style>
}
</style>
src/components/page/keXieXiangMu.vue
@@ -1,26 +1,19 @@
<template>
  <div>
    <globalTitle/>
    <globalTitle />
    <div>
      <el-card class="mart10">
        <h4>平顶山学院2021年度河南省科协立项列表</h4>
        <el-table :data="tableData" border style="width: 100%" :header-cell-style="{textAlign: 'center'}" :cell-style="{ textAlign: 'center' }">
        <el-table :data="tableData" border style="width: 100%" :header-cell-style="{ textAlign: 'center' }" :cell-style="{ textAlign: 'center' }">
          <!-- :header-cell-style="{textAlign: 'center'}"设置头部居中: -->
          <!-- :cell-style="{ textAlign: 'center' }"设置整个表格内容水平居中: -->
          <el-table-column prop="id" label="序号" width="" >
          </el-table-column>
          <el-table-column prop="bianhao" label="立项编号" width="">
          </el-table-column>
          <el-table-column prop="name" label="项目名称">
          </el-table-column>
          <el-table-column prop="xingshi" label="项目形式">
          </el-table-column>
          <el-table-column prop="fuzeren" label="项目负责人">
          </el-table-column>
          <el-table-column prop="time" label="结项时间">
          </el-table-column>
          <el-table-column prop="beizhu" label="备注">
          </el-table-column>
          <el-table-column prop="id" label="序号" width=""> </el-table-column>
          <el-table-column prop="bianhao" label="立项编号" width=""> </el-table-column>
          <el-table-column prop="name" label="项目名称"> </el-table-column>
          <el-table-column prop="xingshi" label="项目形式"> </el-table-column>
          <el-table-column prop="fuzeren" label="项目负责人"> </el-table-column>
          <el-table-column prop="time" label="结项时间"> </el-table-column>
          <el-table-column prop="beizhu" label="备注"> </el-table-column>
        </el-table>
      </el-card>
    </div>
@@ -34,36 +27,34 @@
  name: 'keXieXiangMu',
  data() {
    return {
      tableData:[{id:1,bianhao:'001',name:'苹果',xingshi:'线上操作',fuzeren:'老杨',time:'2022-1-8',beizhu:'无'},
        {id:1,bianhao:'001',name:'苹果',xingshi:'线上操作',fuzeren:'老杨',time:'2022-1-8',beizhu:'无'},
        {id:1,bianhao:'001',name:'苹果',xingshi:'线上操作',fuzeren:'老杨',time:'2022-1-8',beizhu:'无'},
        {id:1,bianhao:'001',name:'苹果',xingshi:'线上操作',fuzeren:'老杨',time:'2022-1-8',beizhu:'无'},
        {id:1,bianhao:'001',name:'苹果',xingshi:'线上操作',fuzeren:'老杨',time:'2022-1-8',beizhu:'无'},
        {id:1,bianhao:'001',name:'苹果',xingshi:'线上操作',fuzeren:'老杨',time:'2022-1-8',beizhu:'无'},
        {id:1,bianhao:'001',name:'苹果',xingshi:'线上操作',fuzeren:'老杨',time:'2022-1-8',beizhu:'无'},
        {id:1,bianhao:'001',name:'苹果',xingshi:'线上操作',fuzeren:'老杨',time:'2022-1-8',beizhu:'无'},
        {id:1,bianhao:'001',name:'苹果',xingshi:'线上操作',fuzeren:'老杨',time:'2022-1-8',beizhu:'无'},
        {id:1,bianhao:'001',name:'苹果',xingshi:'线上操作',fuzeren:'老杨',time:'2022-1-8',beizhu:'无'},
        {id:1,bianhao:'001',name:'苹果',xingshi:'线上操作',fuzeren:'老杨',time:'2022-1-8',beizhu:'无'},
        {id:1,bianhao:'001',name:'苹果',xingshi:'线上操作',fuzeren:'老杨',time:'2022-1-8',beizhu:'无'},
        {id:1,bianhao:'001',name:'苹果',xingshi:'线上操作',fuzeren:'老杨',time:'2022-1-8',beizhu:'无'},
      tableData: [
        { id: 1, bianhao: '001', name: '苹果', xingshi: '线上操作', fuzeren: '老杨', time: '2022-1-8', beizhu: '无' },
        { id: 1, bianhao: '001', name: '苹果', xingshi: '线上操作', fuzeren: '老杨', time: '2022-1-8', beizhu: '无' },
        { id: 1, bianhao: '001', name: '苹果', xingshi: '线上操作', fuzeren: '老杨', time: '2022-1-8', beizhu: '无' },
        { id: 1, bianhao: '001', name: '苹果', xingshi: '线上操作', fuzeren: '老杨', time: '2022-1-8', beizhu: '无' },
        { id: 1, bianhao: '001', name: '苹果', xingshi: '线上操作', fuzeren: '老杨', time: '2022-1-8', beizhu: '无' },
        { id: 1, bianhao: '001', name: '苹果', xingshi: '线上操作', fuzeren: '老杨', time: '2022-1-8', beizhu: '无' },
        { id: 1, bianhao: '001', name: '苹果', xingshi: '线上操作', fuzeren: '老杨', time: '2022-1-8', beizhu: '无' },
        { id: 1, bianhao: '001', name: '苹果', xingshi: '线上操作', fuzeren: '老杨', time: '2022-1-8', beizhu: '无' },
        { id: 1, bianhao: '001', name: '苹果', xingshi: '线上操作', fuzeren: '老杨', time: '2022-1-8', beizhu: '无' },
        { id: 1, bianhao: '001', name: '苹果', xingshi: '线上操作', fuzeren: '老杨', time: '2022-1-8', beizhu: '无' },
        { id: 1, bianhao: '001', name: '苹果', xingshi: '线上操作', fuzeren: '老杨', time: '2022-1-8', beizhu: '无' },
        { id: 1, bianhao: '001', name: '苹果', xingshi: '线上操作', fuzeren: '老杨', time: '2022-1-8', beizhu: '无' },
        { id: 1, bianhao: '001', name: '苹果', xingshi: '线上操作', fuzeren: '老杨', time: '2022-1-8', beizhu: '无' }
      ]
    }
  },
  created() {
  },
  methods: {
  }
  created() {},
  methods: {}
}
</script>
<style lang="less" scoped>
h4{
h4 {
  text-align: center;
  margin-top: 0;
}
.mart10{
.mart10 {
  margin-top: 10px;
}
</style>
src/components/page/telephone.vue
@@ -6,28 +6,23 @@
        <div class="left">
          <el-card style="" class="img">
            <p>微信公众号</p>
            <img src="../../assets/gongZhongHao.jpg" alt="">
            <img src="../../assets/gongZhongHao.jpg" alt="" />
          </el-card>
          <el-card style="" class="img">
            <p>新浪微博</p>
            <img src="../../assets/weiBo.jpg" alt="">
            <img src="../../assets/weiBo.jpg" alt="" />
          </el-card>
        </div>
        <div class="right">
          <el-table :data="tableData" border  :header-cell-style="{textAlign: 'center'}" :cell-style="{ textAlign: 'center' }">
          <el-table :data="tableData" border :header-cell-style="{ textAlign: 'center' }" :cell-style="{ textAlign: 'center' }">
            <!-- :header-cell-style="{textAlign: 'center'}"设置头部居中: -->
            <!-- :cell-style="{ textAlign: 'center' }"设置整个表格内容水平居中: -->
            <el-table-column prop="id" label="序号" width="60" >
            </el-table-column>
            <el-table-column prop="zhize" label="职责" width="">
            </el-table-column>
            <el-table-column prop="name" label="姓名">
            </el-table-column>
            <el-table-column prop="tel" label="联系电话">
            </el-table-column>
            <el-table-column prop="mail" label="邮箱" width="200">
            </el-table-column>
          </el-table>
            <el-table-column prop="id" label="序号" width="60"> </el-table-column>
            <el-table-column prop="zhize" label="职责" width=""> </el-table-column>
            <el-table-column prop="name" label="姓名"> </el-table-column>
            <el-table-column prop="tel" label="联系电话"> </el-table-column>
            <el-table-column prop="mail" label="邮箱" width="200"> </el-table-column>
          </el-table>
        </div>
      </div>
    </el-card>
@@ -41,12 +36,13 @@
  name: 'telephone',
  data() {
    return {
      tableData:[{id:1,zhize:'校长',name:'杨鸣',tel:'12345678910',mail:'12312312@qq.com'},
        {id:1,zhize:'校长',name:'杨鸣',tel:'12345678910',mail:'12312312@qq.com'},
        {id:1,zhize:'校长',name:'杨鸣',tel:'12345678910',mail:'12312312@qq.com'},
        {id:1,zhize:'校长',name:'杨鸣',tel:'12345678910',mail:'12312312@qq.com'},
        {id:1,zhize:'校长',name:'杨鸣',tel:'12345678910',mail:'12312312@qq.com'},
        {id:1,zhize:'校长',name:'杨鸣',tel:'12345678910',mail:'12312312@qq.com'},
      tableData: [
        { id: 1, zhize: '校长', name: '杨鸣', tel: '12345678910', mail: '12312312@qq.com' },
        { id: 1, zhize: '校长', name: '杨鸣', tel: '12345678910', mail: '12312312@qq.com' },
        { id: 1, zhize: '校长', name: '杨鸣', tel: '12345678910', mail: '12312312@qq.com' },
        { id: 1, zhize: '校长', name: '杨鸣', tel: '12345678910', mail: '12312312@qq.com' },
        { id: 1, zhize: '校长', name: '杨鸣', tel: '12345678910', mail: '12312312@qq.com' },
        { id: 1, zhize: '校长', name: '杨鸣', tel: '12345678910', mail: '12312312@qq.com' }
      ]
    }
  }
@@ -54,26 +50,26 @@
</script>
<style lang="less" scoped>
.card{
.card {
  margin-top: 10px;
}
.max{
.max {
  display: flex;
  justify-content: space-between;
}
p{
p {
  text-align: center;
}
.right{
.right {
  width: 800px;
}
.left{
.left {
  width: 200px;
}
.img{
.img {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
</style>
</style>
src/components/page/xueShuJiaoLiu.vue
@@ -8,14 +8,14 @@
      <el-col :span="4" class="marr10">
        <ul>
          <li v-for="(item, index) in menuList" :key="index" class="liStylenone liPointer marb10" @click="changeMenu(item)">
            <b :class="cont == item.name ? 'ft-blue' : 'ft-black'">{{item.name}}</b>
            <b :class="cont == item.name ? 'ft-blue' : 'ft-black'">{{ item.name }}</b>
          </li>
        </ul>
      </el-col>
       <!-- æ–°é—»å†…容 -->
      <!-- æ–°é—»å†…容 -->
      <el-card class="box-card">
        <p class="name">{{this.cont}}</p>
        <hr class="namehr">
        <p class="name">{{ this.cont }}</p>
        <hr class="namehr" />
        <el-col :span="24">
          <div>
            <el-row class="marb10" :key="index" v-for="(item, index) in newsList">
@@ -28,14 +28,7 @@
          </div>
          <!-- åˆ†é¡µ -->
          <div class="fenye">
            <el-pagination
              background
              @current-change="handleCurrentChange"
              :current-page.sync="currentPage"
              :page-size="pageSize"
              layout="prev, pager, next,total"
              :total="total">
            </el-pagination>
            <el-pagination background @current-change="handleCurrentChange" :current-page.sync="currentPage" :page-size="pageSize" layout="prev, pager, next,total" :total="total"> </el-pagination>
          </div>
        </el-col>
      </el-card>
@@ -53,67 +46,70 @@
    return {
      cont: '',
      menuList: [],
      newsList:[],
      pageSize:6,
      currentPage:1,
      total:0,
      item:{},
      newsList: [],
      pageSize: 6,
      currentPage: 1,
      total: 0,
      item: {}
    }
  },
  created() {
  },
  created() {},
  mounted() {
    this.getTitle();
    this.getTitle()
  },
  watch: {
    menuList(n,o){
      this.cont =  this.menuList[0].name
      this.item = this.menuList[0];
      this.getnews(this.menuList[0]);
    menuList(n, o) {
      this.cont = this.menuList[0].name
      this.item = this.menuList[0]
      this.getnews(this.menuList[0])
    }
  },
  methods: {
    handleCurrentChange(val) {
      console.log(`当前页: ${val}`);
      this.getnews(this.item);
      console.log(`当前页: ${val}`)
      this.getnews(this.item)
    },
    getTitle(){
      const data = Number(this.$route.query.id);
      getMinTitle(data).then(res => {
        console.log(res);
        if(res.code == 200){
          this.menuList = res.data
        }
      }).catch(err => {
        console.log(err);
      })
    getTitle() {
      const data = Number(this.$route.query.id)
      getMinTitle(data)
        .then(res => {
          console.log(res)
          if (res.code == 200) {
            this.menuList = res.data
          }
        })
        .catch(err => {
          console.log(err)
        })
    },
    changeMenu(val) {
      this.cont = val.name
      this.item = val
      this.currentPage = 1
      this.getnews(val);
      this.getnews(val)
    },
    getnews(item){
    getnews(item) {
      const data = {
        current:this.currentPage,
        newsCategoryId:item.id,
        size:this.pageSize
      };
      getNewsList(data).then(res => {
        console.log(res);
        if(res.code == 200){
          this.newsList = res.data.records
          this.total =  Number(res.data.total)
        }
      }).catch(error => {
        console.log(error);
      })
        current: this.currentPage,
        newsCategoryId: item.id,
        size: this.pageSize
      }
      getNewsList(data)
        .then(res => {
          console.log(res)
          if (res.code == 200) {
            this.newsList = res.data.records
            this.total = Number(res.data.total)
          }
        })
        .catch(error => {
          console.log(error)
        })
    },
    // è·³è½¬åˆ°æ–°é—»å±•示页面
    show(item){
    show(item) {
      // console.log(item.id);
      this.$router.push({path:'/home/news',query:{id:item.id}})
      this.$router.push({ path: '/home/news', query: { id: item.id } })
    }
  }
}
@@ -135,12 +131,12 @@
.ft-black {
  color: #000;
}
.box-card{
.box-card {
  height: 500px;
  position: relative;
  .fenye{
  .fenye {
    position: absolute;
    bottom: 10px;
  }
}
</style>
}
</style>
src/components/page/xueXiaoShouYe.vue
@@ -7,11 +7,9 @@
<script>
import globalTitle from '../globalTitle.vue'
export default {
  components: { globalTitle},
  components: { globalTitle },
  name: 'xueXiaoShouYe'
}
</script>
<style lang="less" scoped>
</style>
<style lang="less" scoped></style>
src/components/page/zhengce.vue
@@ -8,13 +8,13 @@
      <el-col :span="4" class="marr10">
        <ul>
          <li v-for="(item, index) in menuList" :key="index" class="liStylenone liPointer marb10" @click="changeMenu(item)">
            <b :class="cont == item.name ? 'ft-blue' : 'ft-black'">{{item.name}}</b>
            <b :class="cont == item.name ? 'ft-blue' : 'ft-black'">{{ item.name }}</b>
          </li>
        </ul>
      </el-col>
      <el-card class="box-card">
        <p class="name">{{this.cont}}</p>
        <hr class="namehr">
        <p class="name">{{ this.cont }}</p>
        <hr class="namehr" />
        <el-col :span="24">
          <div>
            <el-row class="marb10" :key="index" v-for="(item, index) in newsList">
@@ -27,14 +27,7 @@
          </div>
          <!-- åˆ†é¡µ -->
          <div class="fenye">
            <el-pagination
              background
              @current-change="handleCurrentChange"
              :current-page.sync="currentPage"
              :page-size="pageSize"
              layout="prev, pager, next,total"
              :total="total">
            </el-pagination>
            <el-pagination background @current-change="handleCurrentChange" :current-page.sync="currentPage" :page-size="pageSize" layout="prev, pager, next,total" :total="total"> </el-pagination>
          </div>
        </el-col>
      </el-card>
@@ -54,69 +47,72 @@
    return {
      cont: '', //小标题变色
      menuList: [],
      newsList:[],
      pageSize:6,
      currentPage:1,
      total:0,
      item:{},
      newsList: [],
      pageSize: 6,
      currentPage: 1,
      total: 0,
      item: {}
    }
  },
  created() {
  },
  created() {},
  mounted() {
    this.getTitle();
    this.getTitle()
  },
  watch: {
    menuList(n,o){
      this.cont =  this.menuList[0].name;
      this.item = this.menuList[0];
      this.getnews(this.menuList[0]);
    menuList(n, o) {
      this.cont = this.menuList[0].name
      this.item = this.menuList[0]
      this.getnews(this.menuList[0])
    }
  },
  methods: {
    getTitle(){
      const data = Number(this.$route.query.id);
      getMinTitle(data).then(res => {
        console.log(res);
        if(res.code == 200){
          this.menuList = res.data
        }
      }).catch(err => {
        console.log(err);
      })
    getTitle() {
      const data = Number(this.$route.query.id)
      getMinTitle(data)
        .then(res => {
          console.log(res)
          if (res.code == 200) {
            this.menuList = res.data
          }
        })
        .catch(err => {
          console.log(err)
        })
    },
    changeMenu(val) {
      this.cont = val.name
      this.item = val
      this.currentPage = 1
      this.getnews(val);
      this.getnews(val)
    },
    getnews(item){
    getnews(item) {
      const data = {
        current:this.currentPage,
        newsCategoryId:item.id,
        size:this.pageSize
      };
      getNewsList(data).then(res => {
        console.log(res);
        if(res.code == 200){
          this.newsList = res.data.records
          this.total =  Number(res.data.total)
        }
      }).catch(error => {
        console.log(error);
      })
        current: this.currentPage,
        newsCategoryId: item.id,
        size: this.pageSize
      }
      getNewsList(data)
        .then(res => {
          console.log(res)
          if (res.code == 200) {
            this.newsList = res.data.records
            this.total = Number(res.data.total)
          }
        })
        .catch(error => {
          console.log(error)
        })
    },
    handleCurrentChange(val) {
      console.log(`当前页: ${val}`);
      console.log(`当前页: ${val}`)
      // this.currentPage = val
      this.getnews(this.item);
      this.getnews(this.item)
    },
    // è·³è½¬åˆ°æ–°é—»å±•示页面
    show(item){
    show(item) {
      // console.log(item.id);
      this.$router.push({path:'/home/news',query:{id:item.id}})
    },
      this.$router.push({ path: '/home/news', query: { id: item.id } })
    }
  }
}
</script>
@@ -131,18 +127,18 @@
    text-align: center;
  }
}
.ft-blue{
  color:rgb(9, 143, 252);
.ft-blue {
  color: rgb(9, 143, 252);
}
.ft-black{
.ft-black {
  color: #000;
}
.box-card{
.box-card {
  height: 500px;
  position: relative;
  .fenye{
  .fenye {
    position: absolute;
    bottom: 10px;
  }
}
</style>
}
</style>
src/main.js
@@ -8,13 +8,12 @@
import './assets/css/global.css'
import './assets/css/my_style.css'
import axios from 'axios'
// é…ç½®è¯·æ±‚的跟路径
// axios.defaults.baseURL = 'http://8.140.68.52:8181'
// axios.defaults.baseURL = 'http://127.0.0.1:8888/api/private/v1'
axios.defaults.baseURL = 'http://localhost:7070/'
axios.defaults.withCredentials = true;
axios.defaults.withCredentials = true
axios.interceptors.request.use(config => {
  // console.log(config)
  config.headers.Authorization = window.sessionStorage.getItem('token')
src/router.js
@@ -22,94 +22,97 @@
import AdMain from './components/Administrator/AdMain.vue'
import AdEdit from './components/Administrator/AdEdit.vue'
Vue.use(Router)
const router = new Router({
  routes: [
    { path: '/', redirect: '/home' },
    { path: '/login', component: Login },
    { path:'/administrator',
    {
      path: '/administrator',
      component: Administrator,
      children: [{ path:'welcome',component:Welcome },
                { path:'main',component:Main },
                { path:'edit',component:Edit },
                { path:'news',component:News },
                { path:'editlunbo',component:EditLunBo },
                { path:'admain',component:AdMain },
                { path:'adedit',component:AdEdit }]
    },
    {
      path: '/home',
      component: Home ,
      children:[
        {
          path:'/home',
          redirect:'index'
        },
        {
          path:'index',
          component:index
        },
        {
          path:'introduce',
          name:'introduce',
          component:introduce
        },
        {
          path:'zhengce',
          name:'zhengce',
          component:zhengce
        },
        {
          path:'keXieXiangMu',
          name:'keXieXiangMu',
          component:keXieXiangMu
        },
        {
          path:'xueShuJiaoLiu',
          name:'xueShuJiaoLiu',
          component:xueShuJiaoLiu
        },
        {
          path:'banShiZhiNan',
          name:'banShiZhiNan',
          component:banShiZhiNan
        },
        {
          path:'kePuFengCai',
          name:'kePuFengCai',
          component:kePuFengCai
        },
        {
          path:'xueXiaoShouYe',
          name:'xueXiaoShouYe',
          component:xueXiaoShouYe
        },
        {
          path:'telephone',
          name:'telephone',
          component:telephone
        },
        {
          path:'moreMessage',
          name:'moreMessage',
          component:moreMessage
        },
        {
          path:'news',
          name:'News',
          component:News
        },
      children: [
        { path: 'welcome', component: Welcome },
        { path: 'main', component: Main },
        { path: 'edit', component: Edit },
        { path: 'news', component: News },
        { path: 'editlunbo', component: EditLunBo },
        { path: 'admain', component: AdMain },
        { path: 'adedit', component: AdEdit }
      ]
    },
    { path:'*',component:NotFound }
    {
      path: '/home',
      component: Home,
      children: [
        {
          path: '/home',
          redirect: 'index'
        },
        {
          path: 'index',
          component: index
        },
        {
          path: 'introduce',
          name: 'introduce',
          component: introduce
        },
        {
          path: 'zhengce',
          name: 'zhengce',
          component: zhengce
        },
        {
          path: 'keXieXiangMu',
          name: 'keXieXiangMu',
          component: keXieXiangMu
        },
        {
          path: 'xueShuJiaoLiu',
          name: 'xueShuJiaoLiu',
          component: xueShuJiaoLiu
        },
        {
          path: 'banShiZhiNan',
          name: 'banShiZhiNan',
          component: banShiZhiNan
        },
        {
          path: 'kePuFengCai',
          name: 'kePuFengCai',
          component: kePuFengCai
        },
        {
          path: 'xueXiaoShouYe',
          name: 'xueXiaoShouYe',
          component: xueXiaoShouYe
        },
        {
          path: 'telephone',
          name: 'telephone',
          component: telephone
        },
        {
          path: 'moreMessage',
          name: 'moreMessage',
          component: moreMessage
        },
        {
          path: 'news',
          name: 'News',
          component: News
        }
      ]
    },
    { path: '*', component: NotFound }
  ],
  scrollBehavior(to, from, savedPosition) { //页面跳转后自动回到顶部
  scrollBehavior(to, from, savedPosition) {
    //页面跳转后自动回到顶部
    if (savedPosition) {
        return savedPosition
      return savedPosition
    }
    return {x: 0, y: 0}
    return { x: 0, y: 0 }
  }
})
src/utils/request.js
@@ -1,19 +1,20 @@
//对axios的封装
// å¯¹axios的封装
import axios from 'axios'
let is_baseURL = 'http://localhost:7070/'//测试环境
//创建axios实例
// eslint-disable-next-line camelcase
let is_baseURL = 'http://localhost:7070/' // æµ‹è¯•环境
// åˆ›å»ºaxios实例
const request = axios.create({
  baseURL: is_baseURL,
  headers:{'Content-Type':'application/x-www-form-urlencoded'}
  headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
})
//response服务器响应拦截器
// response服务器响应拦截器
request.interceptors.response.use(
  response => {
    const res = response.data
    return res
  },
  error => {
    console.log('err',error)
    console.log('err', error)
  }
)
src/views/homePage/moreMessage.vue
@@ -18,13 +18,7 @@
          </ul>
          <!-- åˆ†é¡µ -->
          <div>
            <el-pagination
              background
              @current-change="handleCurrentChange1"
              :current-page="currentPagenotice"
              :page-size="pageSize"
              layout="prev, pager, next,total"
              :total="totalnotice">
            <el-pagination background @current-change="handleCurrentChange1" :current-page="currentPagenotice" :page-size="pageSize" layout="prev, pager, next,total" :total="totalnotice">
            </el-pagination>
          </div>
        </el-card>
@@ -44,21 +38,15 @@
            </ul>
            <!-- åˆ†é¡µ -->
            <div>
              <el-pagination
                background
                @current-change="handleCurrentChange2"
                :current-page.sync="currentPageschool"
                :page-size="pageSize"
                layout="prev, pager, next,total"
                :total="totalschool">
              <el-pagination background @current-change="handleCurrentChange2" :current-page.sync="currentPageschool" :page-size="pageSize" layout="prev, pager, next,total" :total="totalschool">
              </el-pagination>
            </div>
        </el-card>
          </el-card>
        </ul>
      </div>
      <div v-if="this.$route.query.type == '工作状态'">
         <ul>
           <el-card>
        <ul>
          <el-card>
            <ul class="ul">
              <li class="lieBiao liPointer flex-v flex-between" :key="index" v-for="(item, index) in workList">
                <div class="time">
@@ -71,23 +59,17 @@
            </ul>
            <!-- åˆ†é¡µ -->
            <div>
              <el-pagination
                background
                @current-change="handleCurrentChange3"
                :current-page.sync="currentPagework"
                :page-size="pageSize"
                layout="prev, pager, next,total"
                :total="totalwork">
              <el-pagination background @current-change="handleCurrentChange3" :current-page.sync="currentPagework" :page-size="pageSize" layout="prev, pager, next,total" :total="totalwork">
              </el-pagination>
            </div>
           </el-card>
          </el-card>
        </ul>
      </div>
    </div>
  </div>
</template>
<script>
import {getNewsList} from '../../api/api'
import { getNewsList } from '../../api/api'
export default {
  name: 'moreMessage',
  data() {
@@ -95,93 +77,99 @@
      noticeList: [],
      schoolList: [],
      workList: [],
      currentPagenotice:1,  //通知公告的当前页
      currentPageschool:1,  //学院动态的当前页
      currentPagework:1,  //工作动态的当前页
      pageSize:10,
      totalnotice:0,  //通知公告新闻的总条数
      totalschool:0,  //学院动态新闻的总条数
      totalwork:0,  //工作动态新闻的总条数
      currentPagenotice: 1, //通知公告的当前页
      currentPageschool: 1, //学院动态的当前页
      currentPagework: 1, //工作动态的当前页
      pageSize: 10,
      totalnotice: 0, //通知公告新闻的总条数
      totalschool: 0, //学院动态新闻的总条数
      totalwork: 0 //工作动态新闻的总条数
    }
  },
  mounted(){
    this.getnotice();
    this.getwork();
    this.getschool();
  mounted() {
    this.getnotice()
    this.getwork()
    this.getschool()
  },
  methods: {
    //通知公告的分页切换
    handleCurrentChange1(val){
    handleCurrentChange1(val) {
      // console.log(`当前页: ${val}`);
      this.currentPagenotice = val;
      this.getnotice();
      this.currentPagenotice = val
      this.getnotice()
    },
    //学院动态的分页切换
    handleCurrentChange2(val){
    handleCurrentChange2(val) {
      // console.log(`当前页: ${val}`);
      this.currentPageschool = val;
      this.getschool();
      this.currentPageschool = val
      this.getschool()
    },
    //工作动态的分页切换
    handleCurrentChange3(val){
    handleCurrentChange3(val) {
      // console.log(`当前页: ${val}`);
      this.currentPagework = val;
      this.getwork();
      this.currentPagework = val
      this.getwork()
    },
    //获取新闻列表
    getnotice(){
    getnotice() {
      const data = {
        current:this.currentPagenotice,
        newsCategoryId:42,
        size:this.pageSize
        current: this.currentPagenotice,
        newsCategoryId: 42,
        size: this.pageSize
      }
      getNewsList(data).then(res => {
        // console.log(res);
        if(res.code == 200){
          this.noticeList = res.data.records
          this.totalnotice =  res.data.total
        }
      }).catch(error => {
        console.log(error);
      })
      getNewsList(data)
        .then(res => {
          // console.log(res);
          if (res.code == 200) {
            this.noticeList = res.data.records
            this.totalnotice = res.data.total
          }
        })
        .catch(error => {
          console.log(error)
        })
    },
    getwork(){
    getwork() {
      const data = {
        current:this.currentPagework,
        newsCategoryId:43,
        size:this.pageSize
        current: this.currentPagework,
        newsCategoryId: 43,
        size: this.pageSize
      }
      getNewsList(data).then(res => {
        // console.log(res);
        if(res.code == 200){
          this.workList = res.data.records
          this.totalwork =  Number(res.data.total)
        }
      }).catch(error => {
        console.log(error);
      })
      getNewsList(data)
        .then(res => {
          // console.log(res);
          if (res.code == 200) {
            this.workList = res.data.records
            this.totalwork = Number(res.data.total)
          }
        })
        .catch(error => {
          console.log(error)
        })
    },
    getschool(){
    getschool() {
      const data = {
        current:this.currentPageschool,
        newsCategoryId:44,
        size:this.pageSize
        current: this.currentPageschool,
        newsCategoryId: 44,
        size: this.pageSize
      }
      getNewsList(data).then(res => {
        // console.log(res);
        if(res.code == 200){
          this.schoolList = res.data.records
          this.totalschool =  Number(res.data.total)
        }
      }).catch(error => {
        console.log(error);
      })
      getNewsList(data)
        .then(res => {
          // console.log(res);
          if (res.code == 200) {
            this.schoolList = res.data.records
            this.totalschool = Number(res.data.total)
          }
        })
        .catch(error => {
          console.log(error)
        })
    },
    toNoticeMsg(id) {
      this.$router.push({
        path: '/home/news',
        query: {
          id: id,
          id: id
        }
      })
      window.location.reload()
@@ -190,7 +178,7 @@
      this.$router.push({
        path: '/home/news',
        query: {
          id: id,
          id: id
        }
      })
      window.location.reload()
@@ -199,7 +187,7 @@
      this.$router.push({
        path: '/home/news',
        query: {
          id: id,
          id: id
        }
      })
      window.location.reload()
@@ -207,7 +195,7 @@
  }
}
</script>
<style >
<style>
.underline {
  border-bottom: 1px solid #0f99e9;
}
@@ -232,8 +220,8 @@
  /* // background-color: rgb(179, 19, 19); */
  padding: 0 0 0 10px;
}
.ul{
.ul {
  width: 1100px;
  margin: 0;
}
</style>
</style>
src/views/notice.vue
@@ -3,9 +3,7 @@
    <!-- é€šçŸ¥å…¬å‘Šå¯¼èˆªæ¡ -->
    <el-row type="flex" class="row-bg underline marb10" justify="space-between">
      <span class="color"><b>通知公告</b></span>
      <span @click="goMore('通知公告')" class="liPointer">
        æ›´å¤š<i class="el-icon-d-arrow-right"></i>
      </span>
      <span @click="goMore('通知公告')" class="liPointer"> æ›´å¤š<i class="el-icon-d-arrow-right"></i> </span>
    </el-row>
    <!-- é€šçŸ¥å…¬å‘Šæ–°é—»åˆ—表 -->
    <div style="max-height:382px;overflow:hidden;">
@@ -24,17 +22,16 @@
</template>
<script>
import axios from 'axios'
import {getMinTitle,getNewsList} from '../api/api'
import { getMinTitle, getNewsList } from '../api/api'
export default {
  name: 'notice',
  data() {
    return {
     noticeList: [],
      noticeList: []
    }
  },
  created() {
  },
  mounted(){
  created() {},
  mounted() {
    //获取小标题
    // axios.get('http://localhost:8080/news_category/list/1').then(res => {
    //   console.log(res);
@@ -48,27 +45,29 @@
  },
  methods: {
    //获取新闻列表
    getnews(){
    getnews() {
      const data = {
        current:1,
        newsCategoryId:42,
        size:6
        current: 1,
        newsCategoryId: 42,
        size: 6
      }
      getNewsList(data).then(res => {
        console.log(res);
        if(res.code == 200){
          this.noticeList = res.data.records
        }
      }).catch(error => {
        console.log(error);
      })
      getNewsList(data)
        .then(res => {
          console.log(res)
          if (res.code == 200) {
            this.noticeList = res.data.records
          }
        })
        .catch(error => {
          console.log(error)
        })
    },
    // åŽ»åˆ°æ–°é—»å±•ç¤ºé¡µ
    toNoticeMsg(id) {
      this.$router.push({
        path: '/home/news',
        query: {
          id:id,
          id: id
        }
      })
    },
@@ -114,4 +113,4 @@
  // background-color: rgb(179, 19, 19);
  padding: 0 0 0 10px;
}
</style>
</style>
src/views/other.vue
@@ -74,7 +74,8 @@
.bg2 {
  background: url('../assets/wbbg.png') no-repeat 20px 50px;
}
.bg,.bg2 {
.bg,
.bg2 {
  position: relative;
  height: 120px;
}
@@ -88,4 +89,4 @@
  top: 20px;
  left: 25px;
}
</style>
</style>
src/views/school.vue
@@ -2,9 +2,7 @@
  <div>
    <el-row type="flex" justify="space-between" class="underline">
      <span class="color"><b>学院动态</b></span>
      <span @click="goMore('学院动态')" class="liPointer"
        >更多<i class="el-icon-d-arrow-right"></i>
      </span>
      <span @click="goMore('学院动态')" class="liPointer">更多<i class="el-icon-d-arrow-right"></i> </span>
    </el-row>
    <div style="max-height:420px;overflow:hidden;">
      <ul>
@@ -18,39 +16,41 @@
  </div>
</template>
<script>
import {getNewsList} from '../api/api'
import { getNewsList } from '../api/api'
export default {
  name: 'school',
  data() {
    return {
      schoolList: [],
      schoolList: []
    }
  },
  created() {
    this.getnews()
  },
  methods:{
    getnews(){
  methods: {
    getnews() {
      const data = {
        current:1,
        newsCategoryId:44,
        size:6
        current: 1,
        newsCategoryId: 44,
        size: 6
      }
      getNewsList(data).then(res => {
        console.log(res);
        if(res.code == 200){
          this.schoolList = res.data.records
        }
      }).catch(error => {
        console.log(error);
      })
      getNewsList(data)
        .then(res => {
          console.log(res)
          if (res.code == 200) {
            this.schoolList = res.data.records
          }
        })
        .catch(error => {
          console.log(error)
        })
    },
    //前往更多信息页面
    goMore(val){
    goMore(val) {
      this.$router.push({
        path:'moreMessage',
        query:{
          type:val,
        path: 'moreMessage',
        query: {
          type: val
        }
      })
    },
@@ -59,7 +59,7 @@
      this.$router.push({
        path: '/home/news',
        query: {
          id:id
          id: id
        }
      })
    }
@@ -86,4 +86,4 @@
  height: 55px;
  line-height: 55px;
}
</style>
</style>
src/views/work.vue
@@ -2,9 +2,7 @@
  <div>
    <el-row type="flex" justify="space-between" class="underline row-bg">
      <span class="color"><b>工作动态</b></span>
      <span @click="goMore('工作状态')" class="liPointer"
        >更多<i class="el-icon-d-arrow-right"></i>
      </span>
      <span @click="goMore('工作状态')" class="liPointer">更多<i class="el-icon-d-arrow-right"></i> </span>
    </el-row>
    <div style="max-height:420px;overflow:hidden;">
      <ul>
@@ -18,47 +16,49 @@
  </div>
</template>
<script>
import {getNewsList} from '../api/api'
import { getNewsList } from '../api/api'
export default {
  name:'work',
  data(){
    return{
      workList: [],
  name: 'work',
  data() {
    return {
      workList: []
    }
  },
  created() {
    this.getnews()
  },
  methods:{
  methods: {
    //获取新闻列表
    getnews(){
    getnews() {
      const data = {
        current:1,
        newsCategoryId:43,
        size:6
        current: 1,
        newsCategoryId: 43,
        size: 6
      }
      getNewsList(data).then(res => {
        console.log(res);
        if(res.code == 200){
          this.workList = res.data.records
        }
      }).catch(error => {
        console.log(error);
      })
      getNewsList(data)
        .then(res => {
          console.log(res)
          if (res.code == 200) {
            this.workList = res.data.records
          }
        })
        .catch(error => {
          console.log(error)
        })
    },
    toWorkMsg(id) {
      this.$router.push({
        path:'/home/news',
        path: '/home/news',
        query: {
          id:id,
          id: id
        }
      })
    },
    goMore(val) {
      this.$router.push({
        path:'moreMessage',
        query:{
          type:val,
        path: 'moreMessage',
        query: {
          type: val
        }
      })
    }
@@ -85,4 +85,4 @@
  height: 55px;
  line-height: 55px;
}
</style>
</style>
ºó¶ËAPI½Ó¿Ú·þÎñ/static/images/036dc279-73bb-4f9c-9a8c-80c3d7b32408.png
ºó¶ËAPI½Ó¿Ú·þÎñ/static/images/1273facb-e9c9-415e-949a-4c71853c8785.png
ºó¶ËAPI½Ó¿Ú·þÎñ/static/images/349d3ef1-f9d7-46c0-8e17-37daf863c87f.png
ºó¶ËAPI½Ó¿Ú·þÎñ/static/images/4913f227-7009-4bf1-8c07-eb69156f09ce.png
ºó¶ËAPI½Ó¿Ú·þÎñ/static/images/62cefc6b-54a8-4e8c-a250-0e0cd4ba4e20.png