Browse Source

修正代码

lipengtao 6 years ago
parent
commit
478e16bc54

+ 3 - 0
src/api/accountSettings.js

@ -0,0 +1,3 @@
1
export const url = '/ajax/sys/manager'
2
export const modifyUrl = '/ajax/sys/manager' // 修改个人信息
3
export const passUrl = '/ajax/sys/manager/changepasswd' //  重置密码

+ 3 - 96
src/api/login.js

@ -1,96 +1,3 @@
1
import request from '@/utils/request'
2
3
export function login(account, pw, vc) {
4
  return request({
5
    url: '/ajax/sys/login',
6
    method: 'post',
7
    data: {
8
      account,
9
      pw
10
    }
11
  })
12
}
13
14
export function getInfo() {
15
  return request({
16
    url: '/ajax/sys/user',
17
    method: 'get'
18
  })
19
}
20
21
export function logout() {
22
  return request({
23
    url: '/ajax/sys/logout',
24
    method: 'get'
25
  })
26
}
27
28
export function isReg(params) {
29
  return request({
30
    url: '/ajax/sys/check',
31
    method: 'get',
32
    params
33
  })
34
}
35
36
// 找回密码
37
export function getResetMsgPhone(params) {
38
  return request({
39
    url: '/ajax/sys/resetPwMobile',
40
    method: 'get',
41
    params
42
  })
43
}
44
45
export function resetPwdByTel(pw, vc) {
46
  return request({
47
    url: '/ajax/sys/resetPasswordWithMobilePhone',
48
    method: 'post',
49
    data: {
50
      pw,
51
      vc
52
    }
53
  })
54
}
55
56
// 修改密码
57
export function changePw(params) {
58
  return request({
59
    url: '/ajax/sys/changePw',
60
    method: 'post',
61
    data: params
62
  })
63
}
64
65
// 获取修改个人信息
66
export function getMyself(params) {
67
  return request({
68
    url: '/ajax/sys/qo',
69
    method: 'get',
70
    params
71
  })
72
}
73
74
export function updateMyself(params) {
75
  return request({
76
    url: '/ajax/sys/update',
77
    method: 'post',
78
    data: params
79
  })
80
}
81
82
// 获取公告信息
83
export function getNotice() {
84
  return request({
85
    url: '/ajax/sys/notice',
86
    method: 'get'
87
  })
88
}
89
90
export function updateNotice(params) {
91
  return request({
92
    url: '/ajax/sys/notice',
93
    method: 'post',
94
    data: params
95
  })
96
}
1
export const loginUrl = '/ajax/sys/login'
2
export const getInfoUrl = '/ajax/sys/manager'
3
export const logoutUrl = '/ajax/sys/logout'

+ 0 - 3
src/api/loginnew.js

@ -1,3 +0,0 @@
1
export const loginUrl = '/ajax/sys/login'
2
export const getInfoUrl = '/ajax/sys/manager'
3
export const logoutUrl = '/ajax/sys/logout'

+ 0 - 2
src/api/modifyAccountInformation.js

@ -1,2 +0,0 @@
1
export const url = '/ajax/sys/manager'
2
export const modifyUrl = '/ajax/sys/manager'

+ 0 - 1
src/api/modifyPassword.js

@ -1 +0,0 @@
1
export default '/ajax/sys/manager/changepasswd' //  重置密码

+ 0 - 5
src/api/pictureVc.js

@ -1,5 +0,0 @@
1
import { comUrl } from '@/utils/index'
2
3
export function getPictureVC(flag) {
4
  return comUrl + '/ajax/PictureVC?t=' + new Date().getTime() + '&flag=' + flag + '&__timeout=' + 3 * 1000 * 60
5
}

+ 1 - 1
src/components/searchBar/index.vue

@ -30,7 +30,7 @@
30 30
    },
31 31
    methods: {
32 32
      change(value) {
33
        this.$emit(this.relevant.fun, value)
33
        this.$emit('eventName', value)
34 34
      },
35 35
      remoteMethod(query) {
36 36
        if (query !== '') {

+ 5 - 0
src/permission.js

@ -23,6 +23,11 @@ router.beforeEach((to, from, next) => {
23 23
              router.addRoutes(store.getters.addRouters) // 动态添加可访问路由表
24 24
              next({ ...to, replace: true })
25 25
            })
26
          } else {
27
            store.dispatch('FedLogOut').then(() => {
28
              Message.error('登录状态失效,请重新登录')
29
              router.push({ path: '/' })
30
            })
26 31
          }
27 32
        }).catch((err) => {
28 33
          store.dispatch('FedLogOut').then(() => {

+ 1 - 1
src/store/modules/user.js

@ -1,4 +1,4 @@
1
import { loginUrl, logoutUrl, getInfoUrl } from '@/api/loginnew'
1
import { loginUrl, logoutUrl, getInfoUrl } from '@/api/login'
2 2
import http from '@/utils/request'
3 3
import Cookies from 'js-cookie'
4 4

+ 6 - 0
src/utils/index.js

@ -59,3 +59,9 @@ export function arrToStr(arr) {
59 59
    return strs
60 60
  }
61 61
}
62
export const type = {
63
  '1': '平台新闻',
64
  '2': '采访专栏',
65
  '3': '政策法规',
66
  '4': '通知公告'
67
}

+ 33 - 0
src/utils/queryName.js

@ -0,0 +1,33 @@
1
import request from './request'
2
import { queryUserOne } from '@/api/sysSetting'
3
4
const cacheModule = {
5
  cache: {},
6
  temporaryStorage: {},
7
  getUserInfo(id) {
8
    const funArray = this.temporaryStorage[id]
9
    request.get(queryUserOne, { id }, response => {
10
      delete this.temporaryStorage[id]
11
      if (response.success && response.data) {
12
        this.cache[id] = response.data
13
        for (const fun of funArray.values()) {
14
          fun(this.cache[id])
15
        }
16
      }
17
    })
18
  },
19
  Judge(id, callback) {
20
    if (this.cache[id]) {
21
      callback(this.cache[id])
22
    } else {
23
      if (this.temporaryStorage[id]) {
24
        this.temporaryStorage[id].push(callback)
25
      } else {
26
        this.temporaryStorage[id] = [callback]
27
        this.getUserInfo(id)
28
      }
29
    }
30
  }
31
}
32
33
export default cacheModule

+ 6 - 6
src/views/accountSettings/modifyAccountInformation.vue

@ -60,7 +60,7 @@
60 60
</template>
61 61
62 62
<script>
63
  import { url, modifyUrl } from '@/api/modifyAccountInformation'
63
  import { url, modifyUrl } from '@/api/accountSettings'
64 64
  export default {
65 65
    data() {
66 66
      var checkPhone = (rule, value, callback) => {
@ -85,10 +85,10 @@
85 85
        },
86 86
        rules2: {
87 87
          account: [
88
            { message: '请填写账号', required: true }
88
            { message: '请填写账号', required: true, trigger: 'blur' }
89 89
          ],
90 90
          name: [
91
            { message: '请填写用户名', required: true }
91
            { message: '请填写用户名', required: true, trigger: 'blur' }
92 92
          ],
93 93
          phone: [
94 94
            { validator: checkPhone, trigger: 'blur', required: true }
@ -97,13 +97,13 @@
97 97
            { type: 'email', message: '联系邮箱格式有误,请检查后重新填写', trigger: 'blur' }
98 98
          ],
99 99
          job: [
100
            { message: '请填写职位', required: true }
100
            { message: '请填写职位', required: true, trigger: 'blur' }
101 101
          ],
102 102
          dep: [
103
            { message: '请填写所在部门', required: true }
103
            { message: '请填写所在部门', required: true, trigger: 'blur' }
104 104
          ],
105 105
          comp: [
106
            { message: '请填写所在机构', required: true }
106
            { message: '请填写所在机构', required: true, trigger: 'blur' }
107 107
          ]
108 108
        }
109 109
      }

+ 2 - 2
src/views/accountSettings/modifyPassword.vue

@ -24,7 +24,7 @@
24 24
</template>
25 25
26 26
<script>
27
  import url from '@/api/modifyPassword'
27
  import { passUrl } from '@/api/accountSettings'
28 28
  export default {
29 29
    data() {
30 30
      var validatePass = (rule, value, callback) => {
@ -68,7 +68,7 @@
68 68
      submitForm(formName) {
69 69
        this.$refs[formName].validate((valid) => {
70 70
          if (valid) {
71
            this.$http.post(url, { npw: this.ruleForm2.pass }, (response) => {
71
            this.$http.post(passUrl, { npw: this.ruleForm2.pass }, (response) => {
72 72
              if (response.success) {
73 73
                this.$confirm('密码已修改,快去登录吧!', '修改密码', {
74 74
                  confirmButtonText: '确定',

+ 27 - 43
src/views/contentPub/draftList.vue

@ -14,7 +14,7 @@
14 14
        </el-select>
15 15
      </div>
16 16
      <complex-table :tableData="tableData" :tableItem="tableItem" :operatingList='operatingList' :total='total'
17
        v-on:sortSingleExpert="sortSingleExpert" v-on:jump="jump" v-on:current="current" v-on:edit="edit"></complex-table>
17
        v-on:deleteFun="deleteFun" v-on:jump="jump" v-on:current="current" v-on:edit="edit"></complex-table>
18 18
    </div>
19 19
  </div>
20 20
</template>
@ -22,13 +22,12 @@
22 22
<script>
23 23
  import complexTable from '@/components/complexTable'
24 24
  import { pageInquireUrl, deleteUrl, inquireContentUrl } from '@/api/content'
25
  import { queryUserOne } from '@/api/sysSetting'
26
  import { parseTime } from '@/utils/index'
25
  import { parseTime, type } from '@/utils/index'
27 26
  import ret from '@/utils/comTable'
27
  import cacheModule from '@/utils/queryName'
28 28
  export default {
29 29
    data() {
30 30
      return {
31
        searchText: '',
32 31
        selectMode: '',
33 32
        info: {
34 33
          title: '',
@ -37,13 +36,6 @@
37 36
          pageSize: 20,
38 37
          pageNo: 1
39 38
        },
40
        type: {
41
          '1': '平台新闻',
42
          '2': '采访专栏',
43
          '3': '政策法规',
44
          '4': '通知公告'
45
        },
46
        formData: {},
47 39
        operatingList: [ // 在子组件中遍历事件
48 40
          {
49 41
            text: '编辑',
@ -52,11 +44,10 @@
52 44
          },
53 45
          {
54 46
            text: '删除',
55
            event: 'sortSingleExpert',
47
            event: 'deleteFun',
56 48
            icon: 'danger'
57 49
          }
58 50
        ],
59
        dataList: [], //  拉去专家数据存到dataList这个数组里面
60 51
        tableData: [], //  每一页的存储的数据
61 52
        total: 0, //  页码总数
62 53
        tableItem: [ // 表头信息
@ -75,8 +66,8 @@
75 66
            width: '160'
76 67
          },
77 68
          {
78
            prop: 'createTime',
79
            tit: '发布时间',
69
            prop: 'modifyTime',
70
            tit: '最后修改时间',
80 71
            width: '160'
81 72
          },
82 73
          {
@ -87,7 +78,7 @@
87 78
      }
88 79
    },
89 80
    created() {
90
      this.publishList()
81
      this.draftList()
91 82
    },
92 83
    components: {
93 84
      complexTable //  表子页面
@ -95,40 +86,38 @@
95 86
    methods: {
96 87
      change(value) {
97 88
        this.info.catalog = value
98
        this.publishList()
89
        this.draftList()
99 90
      },
100
      publishList() {
101
        this.$http.get(pageInquireUrl, this.info, (response) => { //  拉去专家信息列表,总数据存在dataList,tableData存每一页的信息
91
      draftList() {
92
        this.$http.get(pageInquireUrl, this.info, (response) => { //  拉去草稿信息列表,tableData存每一页的信息
102 93
          if (response.success && response.data) {
103
            const epData = response.data.data
94
            const res = response.data
95
            const epData = res.data
104 96
            for (let i = 0; i < epData.length; i++) {
105
              epData[i].createTime = parseTime(epData[i].createTime).substr(0, 16)
106
              epData[i].catalog = this.type[epData[i].catalog]
107
              this.$http.get(queryUserOne, { id: epData[i].modifier }, (response) => {
108
                if (response.success) {
109
                  epData[i].modifier = response.data.name
110
                }
97
              epData[i].modifyTime = parseTime(epData[i].modifyTime).substr(0, 16)
98
              epData[i].catalog = type[epData[i].catalog]
99
              cacheModule.Judge(epData[i].modifier, info => {
100
                epData[i].modifier = info.name
111 101
              })
112 102
            }
113
            this.dataList = epData
114
            this.total = Math.ceil(epData / 20)
115
            if (this.total > 1) {
116
              this.tableData = this.dataList.slice(0, 20)
103
            this.total = res.total
104
            if (epData.length === 20) {
105
              this.tableData = epData
117 106
            } else {
118
              const array = this.dataList
107
              const array = epData
119 108
              ret.gapFilling(array)
120 109
              this.tableData = array
121 110
            }
122 111
          } else {
123
            this.$sort.total = 0
112
            this.total = 0
124 113
            this.tableData = []
125 114
          }
126 115
        })
127 116
      },
128
      edit(obj) {
117
      edit(obj) { //  编辑草稿信息
129 118
        this.$router.push({ path: 'content/publish', query: { id: obj.id }})
130 119
      },
131
      sortSingleExpert(obj) { //  点击单个特约专家信息
120
      deleteFun(obj) { //  点击删除单个草稿内容信息
132 121
        this.$confirm('确定删除该条内容?', '提示', {
133 122
          confirmButtonText: '确定',
134 123
          cancelButtonText: '取消',
@ -138,7 +127,7 @@
138 127
          this.$http.get(deleteUrl, { id: obj.id }, response => {
139 128
            if (response.success) {
140 129
              if (response.data) {
141
                this.publishList()
130
                this.draftList()
142 131
                this.$message({
143 132
                  message: '删除成功',
144 133
                  type: 'success'
@ -162,16 +151,11 @@
162 151
        })
163 152
      },
164 153
      jump(id) { // 点击超练级跳转
165
        console.log(id)
154
        this.$router.push({ path: 'content/publish', query: { id }})
166 155
      },
167 156
      current(val) { // 点击页码
168
        if (val < this.total) {
169
          this.tableData = this.dataList.slice(20 * (val - 1), 20 * val)
170
        } else {
171
          const array = this.dataList.slice(20 * val)
172
          ret.gapFilling(array)
173
          this.tableData = array
174
        }
157
        this.info.pageNo = val
158
        this.draftList()
175 159
      }
176 160
    }
177 161
  }

+ 21 - 37
src/views/contentPub/pubList.vue

@ -22,7 +22,7 @@
22 22
        </el-select>
23 23
      </div>
24 24
      <complex-table :tableData="tableData" :tableItem="tableItem" :operatingList='operatingList' :total='total'
25
        v-on:sortSingleExpert="sortSingleExpert" v-on:jump="jump" v-on:current="current"></complex-table>
25
        v-on:deleteFun="deleteFun" v-on:jump="jump" v-on:current="current"></complex-table>
26 26
    </div>
27 27
  </div>
28 28
</template>
@ -30,13 +30,13 @@
30 30
<script>
31 31
  import complexTable from '@/components/complexTable'
32 32
  import { pageInquireUrl, deleteUrl, inquireContentUrl } from '@/api/content'
33
  import { queryUserOne } from '@/api/sysSetting'
34
  import { parseTime } from '@/utils/index'
33
  import { parseTime, type } from '@/utils/index'
35 34
  import ret from '@/utils/comTable'
35
  import cacheModule from '@/utils/queryName'
36 36
  export default {
37 37
    data() {
38 38
      return {
39
        searchText: '',
39
        searchText: '', //  搜索文字
40 40
        selectMode: '',
41 41
        info: {
42 42
          title: '',
@ -45,21 +45,13 @@
45 45
          pageSize: 20,
46 46
          pageNo: 1
47 47
        },
48
        type: {
49
          '1': '平台新闻',
50
          '2': '采访专栏',
51
          '3': '政策法规',
52
          '4': '通知公告'
53
        },
54
        formData: {},
55 48
        operatingList: [ // 在子组件中遍历事件
56 49
          {
57 50
            text: '删除',
58
            event: 'sortSingleExpert',
51
            event: 'deleteFun',
59 52
            icon: 'danger'
60 53
          }
61 54
        ],
62
        dataList: [], //  拉去专家数据存到dataList这个数组里面
63 55
        tableData: [], //  每一页的存储的数据
64 56
        total: 0, //  页码总数
65 57
        tableItem: [ // 表头信息
@ -102,15 +94,15 @@
102 94
    },
103 95
    methods: {
104 96
      change(value) {
105
        console.log(value)
106 97
        this.info.catalog = value
98
        this.searchText = this.info.title
107 99
        this.publishList()
108 100
      },
109 101
      search() {
110 102
        this.info.title = this.searchText
111 103
        this.publishList()
112 104
      },
113
      publishList() {
105
      publishList() { //  内容发布中的列表
114 106
        const arr = [
115 107
          {
116 108
            num: 1
@ -125,36 +117,33 @@
125 117
            num: 4
126 118
          }
127 119
        ]
128
        this.$http.get(pageInquireUrl, this.info, (response) => { //  拉去专家信息列表,总数据存在dataList,tableData存每一页的信息
120
        this.$http.get(pageInquireUrl, this.info, (response) => { //  拉去发布内容信息列表,tableData存每一页的信息
129 121
          if (response.success && response.data) {
130
            const epData = response.data.data
131
            console.log(epData)
122
            const res = response.data
123
            const epData = res.data
132 124
            for (let i = 0; i < epData.length; i++) {
133 125
              epData[i].createTime = parseTime(epData[i].createTime).substr(0, 16)
134
              epData[i].catalog = this.type[epData[i].catalog]
126
              epData[i].catalog = type[epData[i].catalog]
135 127
              Object.assign(epData[i], arr[i])
136
              this.$http.get(queryUserOne, { id: epData[i].creator }, (response) => {
137
                if (response.success) {
138
                  epData[i].creator = response.data.name
139
                }
128
              cacheModule.Judge(epData[i].creator, info => {
129
                epData[i].creator = info.name
140 130
              })
141 131
            }
142
            this.dataList = epData
143
            this.total = Math.ceil(epData / 20)
144
            if (this.total > 1) {
145
              this.tableData = this.dataList.slice(0, 20)
132
            this.total = res.total
133
            if (epData.length === 20) {
134
              this.tableData = epData
146 135
            } else {
147
              const array = this.dataList
136
              const array = epData
148 137
              ret.gapFilling(array)
149 138
              this.tableData = array
150 139
            }
151 140
          } else {
152
            this.$sort.total = 0
141
            this.total = 0
153 142
            this.tableData = []
154 143
          }
155 144
        })
156 145
      },
157
      sortSingleExpert(obj) { //  点击单个特约专家信息
146
      deleteFun(obj) { // 点击删除单个内容
158 147
        this.$confirm('确定删除该条内容?', '提示', {
159 148
          confirmButtonText: '确定',
160 149
          cancelButtonText: '取消',
@ -192,13 +181,8 @@
192 181
        console.log(id)
193 182
      },
194 183
      current(val) { // 点击页码
195
        if (val < this.total) {
196
          this.tableData = this.dataList.slice(20 * (val - 1), 20 * val)
197
        } else {
198
          const array = this.dataList.slice(20 * val)
199
          ret.gapFilling(array)
200
          this.tableData = array
201
        }
184
        this.info.pageNo = val
185
        this.publishList()
202 186
      }
203 187
    }
204 188
  }

+ 11 - 9
src/views/contentPub/publish.vue

@ -20,9 +20,9 @@
20 20
            <el-form-item label="作者/来源" prop="source">
21 21
              <el-input v-model.number="ruleForm2.source" placeholder="请填写作者/来源" maxlength=20></el-input>
22 22
            </el-form-item>
23
            <searchTemplate :relevant=relevantExperts v-on:expert="expert"></searchTemplate>
24
            <searchTemplate :relevant=relevantInstitutions v-on:institution="institution"></searchTemplate>
25
            <searchTemplate :relevant=relevantCompanies v-on:company="company"></searchTemplate>
23
            <searchTemplate :relevant=relevantExperts v-on:eventName="expert"></searchTemplate>
24
            <searchTemplate :relevant=relevantInstitutions v-on:eventName="institution"></searchTemplate>
25
            <searchTemplate :relevant=relevantCompanies v-on:eventName="company"></searchTemplate>
26 26
          </el-col>
27 27
          <el-col :span="12">
28 28
            <el-form-item style="text-align:right" prop="imgUrl">
@ -36,6 +36,9 @@
36 36
        <el-form-item class="traftButton">
37 37
          <el-button type="info" @click="draft">保存草稿</el-button>
38 38
        </el-form-item>
39
        <el-form-item class="traftButton" v-if="$route.query.id">
40
          最后修改时间:{{modifyTime}}
41
        </el-form-item>
39 42
        <el-form-item class="publishButton">
40 43
          <el-button type="primary" @click="submitForm('ruleForm2')">发布</el-button>
41 44
          <el-button type="danger" @click="deleteContent" v-if="$route.query.id">删除</el-button>
@ -49,6 +52,7 @@
49 52
  import searchTemplate from '@/components/searchBar'
50 53
  import uploadFile from '@/components/uploadFile'
51 54
  import UE from '@/components/editorUE'
55
  import { parseTime } from '@/utils/index'
52 56
  import { uploadPhotoUrl, publishUrl, draftFirstUrl, draftUrl, draftPublishUrl, deleteUrl, inquireContentUrl } from '@/api/content'
53 57
  export default {
54 58
    data() {
@ -77,6 +81,7 @@
77 81
        }
78 82
      }
79 83
      return {
84
        modifyTime: '',
80 85
        draftFlag: true,
81 86
        upImgsStr: '',
82 87
        id: '',
@ -89,21 +94,18 @@
89 94
        relevantExperts: {
90 95
          url: '',
91 96
          placeholder: '请选择关联专家',
92
          fun: 'expert',
93 97
          label: '相关专家',
94 98
          prop: 'professors'
95 99
        },
96 100
        relevantInstitutions: {
97 101
          url: '',
98 102
          placeholder: '请选择关联机构',
99
          fun: 'institution',
100 103
          label: '相关机构',
101 104
          prop: 'orgs'
102 105
        },
103 106
        relevantCompanies: {
104 107
          url: '',
105 108
          placeholder: '请选择关联企业',
106
          fun: 'company',
107 109
          label: '相关企业',
108 110
          prop: 'comps'
109 111
        },
@ -148,6 +150,9 @@
148 150
              comps: []
149 151
            }
150 152
            this.upImgsStr = info.imgUrl
153
            if (this.id) {
154
              this.modifyTime = parseTime(info.modifyTime).substr(0, 19)
155
            }
151 156
          }
152 157
        })
153 158
      }
@ -175,8 +180,6 @@
175 180
          this.$refs.ruleForm2.validateField('title')
176 181
        }
177 182
        if (value === '1' || value === '2') {
178
          console.log(value, typeof value)
179
          console.log(this.rules2)
180 183
          this.rules2.imgUrl.push({ message: '请上传封面图片', required: true, trigger: 'blur' })
181 184
        } else {
182 185
          this.rules2.imgUrl = []
@ -305,7 +308,6 @@
305 308
            }).catch(() => {
306 309
            })
307 310
          } else {
308
            console.log('error submit!!')
309 311
            return false
310 312
          }
311 313
        })

+ 31 - 44
src/views/contentPub/recycleBin.vue

@ -17,7 +17,7 @@
17 17
        </el-select>
18 18
      </div>
19 19
      <complex-table :tableData="tableData" :tableItem="tableItem" :operatingList='operatingList' :total='total'
20
        v-on:sortSingleExpert="sortSingleExpert" v-on:jump="jump" v-on:current="current" v-on:edit="edit"></complex-table>
20
        v-on:deleteFun="deleteFun" v-on:jump="jump" v-on:current="current" v-on:restore="restore"></complex-table>
21 21
    </div>
22 22
  </div>
23 23
</template>
@ -25,39 +25,31 @@
25 25
<script>
26 26
  import complexTable from '@/components/complexTable'
27 27
  import { thoroughDeleteAll, thoroughDeleteSingleUrl, recycleBinInquireUrl, restoreUrl, inquireContentUrl } from '@/api/content'
28
  import { queryUserOne } from '@/api/sysSetting'
29
  import { parseTime } from '@/utils/index'
28
  import { parseTime, type } from '@/utils/index'
30 29
  import ret from '@/utils/comTable'
30
  import cacheModule from '@/utils/queryName'
31 31
  export default {
32 32
    data() {
33 33
      return {
34
        searchText: '',
35 34
        selectMode: '',
36 35
        info: {
37 36
          catalog: '',
38 37
          pageSize: 20,
39 38
          pageNo: 1
40 39
        },
41
        type: {
42
          '1': '平台新闻',
43
          '2': '采访专栏',
44
          '3': '政策法规',
45
          '4': '通知公告'
46
        },
47 40
        formData: {},
48 41
        operatingList: [ // 在子组件中遍历事件
49 42
          {
50 43
            text: '恢复',
51
            event: 'edit',
44
            event: 'restore',
52 45
            icon: 'primary'
53 46
          },
54 47
          {
55 48
            text: '彻底删除',
56
            event: 'sortSingleExpert',
49
            event: 'deleteFun',
57 50
            icon: 'danger'
58 51
          }
59 52
        ],
60
        dataList: [], //  拉去专家数据存到dataList这个数组里面
61 53
        tableData: [], //  每一页的存储的数据
62 54
        total: 0, //  页码总数
63 55
        tableItem: [ // 表头信息
@ -96,7 +88,7 @@
96 88
      }
97 89
    },
98 90
    created() {
99
      this.publishList()
91
      this.recycleBinList()
100 92
    },
101 93
    components: {
102 94
      complexTable //  表子页面
@ -104,39 +96,39 @@
104 96
    methods: {
105 97
      change(value) {
106 98
        this.info.catalog = value
107
        this.publishList()
99
        this.recycleBinList()
108 100
      },
109
      publishList() {
110
        this.$http.get(recycleBinInquireUrl, this.info, (response) => { //  拉去专家信息列表,总数据存在dataList,tableData存每一页的信息
101
      recycleBinList() {
102
        this.$http.get(recycleBinInquireUrl, this.info, (response) => { //  拉去回收站信息列表,tableData存每一页的信息
111 103
          if (response.success && response.data) {
112
            const epData = response.data.data
104
            const res = response.data
105
            const epData = res.data
113 106
            for (let i = 0; i < epData.length; i++) {
114 107
              epData[i].createTime = parseTime(epData[i].createTime).substr(0, 16)
115 108
              epData[i].invalidTime = parseTime(epData[i].invalidTime).substr(0, 16)
116
              epData[i].catalog = this.type[epData[i].catalog]
117
              this.$http.get(queryUserOne, { id: epData[i].creator }, (response) => {
118
                if (response.success) {
119
                  epData[i].creator = response.data.name
120
                }
109
              epData[i].catalog = type[epData[i].catalog]
110
              cacheModule.Judge(epData[i].creator, info => {
111
                epData[i].creator = info.name
112
              })
113
              cacheModule.Judge(epData[i].invalidOperator, info => {
114
                epData[i].invalidOperator = info.name
121 115
              })
122 116
            }
123
            this.dataList = epData
124
            this.total = Math.ceil(epData / 20)
125
            if (this.total > 1) {
126
              this.tableData = this.dataList.slice(0, 20)
117
            this.total = res.total
118
            if (epData.length === 20) {
119
              this.tableData = epData
127 120
            } else {
128
              const array = this.dataList
121
              const array = epData
129 122
              ret.gapFilling(array)
130 123
              this.tableData = array
131 124
            }
132 125
          } else {
133
            this.$sort.total = 0
126
            this.total = 0
134 127
            this.tableData = []
135 128
          }
136 129
        })
137 130
      },
138
      edit(obj) {
139
        console.log(obj)
131
      restore(obj) {
140 132
        this.$confirm(`确定恢复${obj.title}内容?`, '提示', {
141 133
          confirmButtonText: '确定',
142 134
          cancelButtonText: '取消',
@ -146,9 +138,9 @@
146 138
          this.$http.get(restoreUrl, { id: obj.id }, response => {
147 139
            if (response.success) {
148 140
              if (response.data) {
149
                this.publishList()
141
                this.recycleBinList()
150 142
                this.$message({
151
                  message: '恢复成功成功',
143
                  message: '恢复成功',
152 144
                  type: 'success'
153 145
                })
154 146
              } else {
@ -169,7 +161,7 @@
169 161
        }).catch(() => {
170 162
        })
171 163
      },
172
      deleteAll() {
164
      deleteAll() { //  删除全部回收站信息
173 165
        this.$confirm('确定全部彻底删除回收站内容?', '提示', {
174 166
          confirmButtonText: '确定',
175 167
          cancelButtonText: '取消',
@ -178,7 +170,7 @@
178 170
        }).then(() => {
179 171
          this.$http.get(thoroughDeleteAll, '', response => {
180 172
            if (response.success) {
181
              this.publishList()
173
              this.recycleBinList()
182 174
              this.$message({
183 175
                message: '全部删除成功',
184 176
                type: 'success'
@ -188,7 +180,7 @@
188 180
        }).catch(() => {
189 181
        })
190 182
      },
191
      sortSingleExpert(obj) { //  点击单个特约专家信息
183
      deleteFun(obj) { //  彻底删除单个内容信息
192 184
        console.log(obj)
193 185
        this.$confirm('确定彻底删除该条回收站内容?', '提示', {
194 186
          confirmButtonText: '确定',
@ -198,7 +190,7 @@
198 190
        }).then(() => {
199 191
          this.$http.get(thoroughDeleteSingleUrl, { id: obj.id }, response => {
200 192
            if (response.success) {
201
              this.publishList()
193
              this.recycleBinList()
202 194
              this.$message({
203 195
                message: '删除成功',
204 196
                type: 'success'
@ -212,13 +204,8 @@
212 204
        this.$router.push({ path: 'viewRecycling', query: { id }})
213 205
      },
214 206
      current(val) { // 点击页码
215
        if (val < this.total) {
216
          this.tableData = this.dataList.slice(20 * (val - 1), 20 * val)
217
        } else {
218
          const array = this.dataList.slice(20 * val)
219
          ret.gapFilling(array)
220
          this.tableData = array
221
        }
207
        this.info.pageNo = val
208
        this.recycleBinList()
222 209
      }
223 210
    }
224 211
  }

+ 64 - 13
src/views/contentPub/viewRecyclingBins.vue

@ -25,9 +25,12 @@
25 25
        <el-form-item label="文章正文" prop="cnt" class="editBox">
26 26
          <div class="editContent" v-html="ruleForm2.cnt"></div>
27 27
        </el-form-item>
28
        <el-form-item class="deleTime">
29
          最后删除时间:{{modifyTime}}
30
        </el-form-item>
28 31
        <el-form-item class="publishButton">
29
          <el-button type="primary" @click="submitForm('ruleForm2')">恢复</el-button>
30
          <el-button @click="resetForm('ruleForm2')">彻底删除</el-button>
32
          <el-button type="primary" @click="restore">恢复</el-button>
33
          <el-button @click="completeDelete">彻底删除</el-button>
31 34
        </el-form-item>
32 35
      </el-form>
33 36
      <div class="fileBox">
@ -39,10 +42,13 @@
39 42
</template>
40 43
41 44
<script>
42
  import { inquireContentUrl } from '@/api/content'
45
  import { inquireContentUrl, restoreUrl, thoroughDeleteSingleUrl } from '@/api/content'
46
  import { parseTime } from '@/utils/index'
43 47
  export default {
44 48
    data() {
45 49
      return {
50
        modifyTime: '',
51
        id: '',
46 52
        ruleForm2: {
47 53
          title: '',
48 54
          source: '',
@ -57,6 +63,7 @@
57 63
    },
58 64
    created() {
59 65
      const id = this.$route.query.id
66
      this.id = id
60 67
      this.$http.get(inquireContentUrl, { id }, (response) => {
61 68
        if (response.success && response.data) {
62 69
          const info = response.data
@ -70,28 +77,72 @@
70 77
            orgs: '',
71 78
            comps: ''
72 79
          }
80
          this.modifyTime = parseTime(info.modifyTime).substr(0, 19)
73 81
        }
74 82
      })
75 83
    },
76 84
    methods: {
77
      submitForm(formName) {
78
        this.$refs[formName].validate((valid) => {
79
          if (valid) {
80
            alert('submit!')
81
          } else {
82
            console.log('error submit!!')
83
            return false
84
          }
85
      restore(formName) {
86
        this.$confirm(`确定恢复${this.ruleForm2.title}内容?`, '提示', {
87
          confirmButtonText: '确定',
88
          cancelButtonText: '取消',
89
          type: 'warning',
90
          center: true
91
        }).then(() => {
92
          this.$http.get(restoreUrl, { id: this.id }, response => {
93
            if (response.success) {
94
              if (response.data) {
95
                this.$router.go(-1)
96
                this.$message({
97
                  message: '恢复成功',
98
                  type: 'success'
99
                })
100
              } else {
101
                this.$http.get(inquireContentUrl, { id: this.id }, (response) => {
102
                  if (response.success && response.data) {
103
                    const info = response.data
104
                    if (!info.actived) {
105
                      this.$message({
106
                        message: '状态改变',
107
                        type: 'warning'
108
                      })
109
                    }
110
                  }
111
                })
112
              }
113
            }
114
          })
115
        }).catch(() => {
85 116
        })
86 117
      },
87
      resetForm(formName) {
88
        this.$refs[formName].resetFields()
118
      completeDelete() {
119
        this.$confirm('确定彻底删除该条回收站内容?', '提示', {
120
          confirmButtonText: '确定',
121
          cancelButtonText: '取消',
122
          type: 'warning',
123
          center: true
124
        }).then(() => {
125
          this.$http.get(thoroughDeleteSingleUrl, { id: this.id }, response => {
126
            if (response.success) {
127
              this.$router.go(-1)
128
              this.$message({
129
                message: '删除成功',
130
                type: 'success'
131
              })
132
            }
133
          })
134
        }).catch(() => {
135
        })
89 136
      }
90 137
    }
91 138
  }
92 139
</script>
93 140
94 141
<style rel="stylesheet/scss" lang="scss" scoped>
142
  .deleTime {
143
    text-align: right
144
  }
145
95 146
  .formTable {
96 147
    width: 943px
97 148
  }

+ 3 - 3
src/views/cooperationAgency/index.vue

@ -111,8 +111,8 @@
111 111
              // })
112 112
            }
113 113
            this.dataList = epData
114
            this.total = Math.ceil(epData / 20)
115
            if (this.total > 1) {
114
            this.total = epData.length
115
            if (this.total >= 20) {
116 116
              this.tableData = this.dataList.slice(0, 20)
117 117
            } else {
118 118
              const array = this.dataList
@ -136,7 +136,7 @@
136 136
        console.log(id)
137 137
      },
138 138
      current(val) { // 点击页码
139
        if (val < this.total) {
139
        if (val < Math.ceil(this.total / 20)) {
140 140
          this.tableData = this.dataList.slice(20 * (val - 1), 20 * val)
141 141
        } else {
142 142
          const array = this.dataList.slice(20 * val)

+ 1 - 1
src/views/login/index.vue

@ -21,7 +21,7 @@
21 21
          <svg-icon icon-class="password-view" v-show="falg" /></span>
22 22
      </el-form-item>
23 23
      <el-form-item>
24
        <el-button class="log-btn" type="primary" :loading="loading" @click.native.prevent="handleLogin">登录</el-button>
24
        <el-button class="log-btn" type="primary" :loading="loading" @click.native.prevent.enter="handleLogin">登录</el-button>
25 25
      </el-form-item>
26 26
    </el-form>
27 27
  </div>

+ 3 - 3
src/views/specialExperts/index.vue

@ -118,8 +118,8 @@
118 118
              // })
119 119
            }
120 120
            this.dataList = epData
121
            this.total = Math.ceil(epData / 20)
122
            if (this.total > 1) {
121
            this.total = epData.length
122
            if (this.total >= 20) {
123 123
              this.tableData = this.dataList.slice(0, 20)
124 124
            } else {
125 125
              const array = this.dataList
@ -143,7 +143,7 @@
143 143
        console.log(id)
144 144
      },
145 145
      current(val) { // 点击页码
146
        if (val < this.total) {
146
        if (val < Math.ceil(this.total / 20)) {
147 147
          this.tableData = this.dataList.slice(20 * (val - 1), 20 * val)
148 148
        } else {
149 149
          const array = this.dataList.slice(20 * val)