Browse Source

修正代码

lipengtao 6 years ago
parent
commit
478e16bc54

+ 3 - 0
src/api/accountSettings.js

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
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
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
export const url = '/ajax/sys/manager'
2
export const modifyUrl = '/ajax/sys/manager'

+ 0 - 1
src/api/modifyPassword.js

1
export default '/ajax/sys/manager/changepasswd' //  重置密码

+ 0 - 5
src/api/pictureVc.js

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
    },
30
    },
31
    methods: {
31
    methods: {
32
      change(value) {
32
      change(value) {
33
        this.$emit(this.relevant.fun, value)
33
        this.$emit('eventName', value)
34
      },
34
      },
35
      remoteMethod(query) {
35
      remoteMethod(query) {
36
        if (query !== '') {
36
        if (query !== '') {

+ 5 - 0
src/permission.js

23
              router.addRoutes(store.getters.addRouters) // 动态添加可访问路由表
23
              router.addRoutes(store.getters.addRouters) // 动态添加可访问路由表
24
              next({ ...to, replace: true })
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
        }).catch((err) => {
32
        }).catch((err) => {
28
          store.dispatch('FedLogOut').then(() => {
33
          store.dispatch('FedLogOut').then(() => {

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

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

+ 6 - 0
src/utils/index.js

59
    return strs
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

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
</template>
60
</template>
61
61
62
<script>
62
<script>
63
  import { url, modifyUrl } from '@/api/modifyAccountInformation'
63
  import { url, modifyUrl } from '@/api/accountSettings'
64
  export default {
64
  export default {
65
    data() {
65
    data() {
66
      var checkPhone = (rule, value, callback) => {
66
      var checkPhone = (rule, value, callback) => {
85
        },
85
        },
86
        rules2: {
86
        rules2: {
87
          account: [
87
          account: [
88
            { message: '请填写账号', required: true }
88
            { message: '请填写账号', required: true, trigger: 'blur' }
89
          ],
89
          ],
90
          name: [
90
          name: [
91
            { message: '请填写用户名', required: true }
91
            { message: '请填写用户名', required: true, trigger: 'blur' }
92
          ],
92
          ],
93
          phone: [
93
          phone: [
94
            { validator: checkPhone, trigger: 'blur', required: true }
94
            { validator: checkPhone, trigger: 'blur', required: true }
97
            { type: 'email', message: '联系邮箱格式有误,请检查后重新填写', trigger: 'blur' }
97
            { type: 'email', message: '联系邮箱格式有误,请检查后重新填写', trigger: 'blur' }
98
          ],
98
          ],
99
          job: [
99
          job: [
100
            { message: '请填写职位', required: true }
100
            { message: '请填写职位', required: true, trigger: 'blur' }
101
          ],
101
          ],
102
          dep: [
102
          dep: [
103
            { message: '请填写所在部门', required: true }
103
            { message: '请填写所在部门', required: true, trigger: 'blur' }
104
          ],
104
          ],
105
          comp: [
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
</template>
24
</template>
25
25
26
<script>
26
<script>
27
  import url from '@/api/modifyPassword'
27
  import { passUrl } from '@/api/accountSettings'
28
  export default {
28
  export default {
29
    data() {
29
    data() {
30
      var validatePass = (rule, value, callback) => {
30
      var validatePass = (rule, value, callback) => {
68
      submitForm(formName) {
68
      submitForm(formName) {
69
        this.$refs[formName].validate((valid) => {
69
        this.$refs[formName].validate((valid) => {
70
          if (valid) {
70
          if (valid) {
71
            this.$http.post(url, { npw: this.ruleForm2.pass }, (response) => {
71
            this.$http.post(passUrl, { npw: this.ruleForm2.pass }, (response) => {
72
              if (response.success) {
72
              if (response.success) {
73
                this.$confirm('密码已修改,快去登录吧!', '修改密码', {
73
                this.$confirm('密码已修改,快去登录吧!', '修改密码', {
74
                  confirmButtonText: '确定',
74
                  confirmButtonText: '确定',

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

14
        </el-select>
14
        </el-select>
15
      </div>
15
      </div>
16
      <complex-table :tableData="tableData" :tableItem="tableItem" :operatingList='operatingList' :total='total'
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
    </div>
18
    </div>
19
  </div>
19
  </div>
20
</template>
20
</template>
22
<script>
22
<script>
23
  import complexTable from '@/components/complexTable'
23
  import complexTable from '@/components/complexTable'
24
  import { pageInquireUrl, deleteUrl, inquireContentUrl } from '@/api/content'
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
  import ret from '@/utils/comTable'
26
  import ret from '@/utils/comTable'
27
  import cacheModule from '@/utils/queryName'
28
  export default {
28
  export default {
29
    data() {
29
    data() {
30
      return {
30
      return {
31
        searchText: '',
32
        selectMode: '',
31
        selectMode: '',
33
        info: {
32
        info: {
34
          title: '',
33
          title: '',
37
          pageSize: 20,
36
          pageSize: 20,
38
          pageNo: 1
37
          pageNo: 1
39
        },
38
        },
40
        type: {
41
          '1': '平台新闻',
42
          '2': '采访专栏',
43
          '3': '政策法规',
44
          '4': '通知公告'
45
        },
46
        formData: {},
47
        operatingList: [ // 在子组件中遍历事件
39
        operatingList: [ // 在子组件中遍历事件
48
          {
40
          {
49
            text: '编辑',
41
            text: '编辑',
52
          },
44
          },
53
          {
45
          {
54
            text: '删除',
46
            text: '删除',
55
            event: 'sortSingleExpert',
47
            event: 'deleteFun',
56
            icon: 'danger'
48
            icon: 'danger'
57
          }
49
          }
58
        ],
50
        ],
59
        dataList: [], //  拉去专家数据存到dataList这个数组里面
60
        tableData: [], //  每一页的存储的数据
51
        tableData: [], //  每一页的存储的数据
61
        total: 0, //  页码总数
52
        total: 0, //  页码总数
62
        tableItem: [ // 表头信息
53
        tableItem: [ // 表头信息
75
            width: '160'
66
            width: '160'
76
          },
67
          },
77
          {
68
          {
78
            prop: 'createTime',
79
            tit: '发布时间',
69
            prop: 'modifyTime',
70
            tit: '最后修改时间',
80
            width: '160'
71
            width: '160'
81
          },
72
          },
82
          {
73
          {
87
      }
78
      }
88
    },
79
    },
89
    created() {
80
    created() {
90
      this.publishList()
81
      this.draftList()
91
    },
82
    },
92
    components: {
83
    components: {
93
      complexTable //  表子页面
84
      complexTable //  表子页面
95
    methods: {
86
    methods: {
96
      change(value) {
87
      change(value) {
97
        this.info.catalog = value
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
          if (response.success && response.data) {
93
          if (response.success && response.data) {
103
            const epData = response.data.data
94
            const res = response.data
95
            const epData = res.data
104
            for (let i = 0; i < epData.length; i++) {
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
            } else {
106
            } else {
118
              const array = this.dataList
107
              const array = epData
119
              ret.gapFilling(array)
108
              ret.gapFilling(array)
120
              this.tableData = array
109
              this.tableData = array
121
            }
110
            }
122
          } else {
111
          } else {
123
            this.$sort.total = 0
112
            this.total = 0
124
            this.tableData = []
113
            this.tableData = []
125
          }
114
          }
126
        })
115
        })
127
      },
116
      },
128
      edit(obj) {
117
      edit(obj) { //  编辑草稿信息
129
        this.$router.push({ path: 'content/publish', query: { id: obj.id }})
118
        this.$router.push({ path: 'content/publish', query: { id: obj.id }})
130
      },
119
      },
131
      sortSingleExpert(obj) { //  点击单个特约专家信息
120
      deleteFun(obj) { //  点击删除单个草稿内容信息
132
        this.$confirm('确定删除该条内容?', '提示', {
121
        this.$confirm('确定删除该条内容?', '提示', {
133
          confirmButtonText: '确定',
122
          confirmButtonText: '确定',
134
          cancelButtonText: '取消',
123
          cancelButtonText: '取消',
138
          this.$http.get(deleteUrl, { id: obj.id }, response => {
127
          this.$http.get(deleteUrl, { id: obj.id }, response => {
139
            if (response.success) {
128
            if (response.success) {
140
              if (response.data) {
129
              if (response.data) {
141
                this.publishList()
130
                this.draftList()
142
                this.$message({
131
                this.$message({
143
                  message: '删除成功',
132
                  message: '删除成功',
144
                  type: 'success'
133
                  type: 'success'
162
        })
151
        })
163
      },
152
      },
164
      jump(id) { // 点击超练级跳转
153
      jump(id) { // 点击超练级跳转
165
        console.log(id)
154
        this.$router.push({ path: 'content/publish', query: { id }})
166
      },
155
      },
167
      current(val) { // 点击页码
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
        </el-select>
22
        </el-select>
23
      </div>
23
      </div>
24
      <complex-table :tableData="tableData" :tableItem="tableItem" :operatingList='operatingList' :total='total'
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
    </div>
26
    </div>
27
  </div>
27
  </div>
28
</template>
28
</template>
30
<script>
30
<script>
31
  import complexTable from '@/components/complexTable'
31
  import complexTable from '@/components/complexTable'
32
  import { pageInquireUrl, deleteUrl, inquireContentUrl } from '@/api/content'
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
  import ret from '@/utils/comTable'
34
  import ret from '@/utils/comTable'
35
  import cacheModule from '@/utils/queryName'
36
  export default {
36
  export default {
37
    data() {
37
    data() {
38
      return {
38
      return {
39
        searchText: '',
39
        searchText: '', //  搜索文字
40
        selectMode: '',
40
        selectMode: '',
41
        info: {
41
        info: {
42
          title: '',
42
          title: '',
45
          pageSize: 20,
45
          pageSize: 20,
46
          pageNo: 1
46
          pageNo: 1
47
        },
47
        },
48
        type: {
49
          '1': '平台新闻',
50
          '2': '采访专栏',
51
          '3': '政策法规',
52
          '4': '通知公告'
53
        },
54
        formData: {},
55
        operatingList: [ // 在子组件中遍历事件
48
        operatingList: [ // 在子组件中遍历事件
56
          {
49
          {
57
            text: '删除',
50
            text: '删除',
58
            event: 'sortSingleExpert',
51
            event: 'deleteFun',
59
            icon: 'danger'
52
            icon: 'danger'
60
          }
53
          }
61
        ],
54
        ],
62
        dataList: [], //  拉去专家数据存到dataList这个数组里面
63
        tableData: [], //  每一页的存储的数据
55
        tableData: [], //  每一页的存储的数据
64
        total: 0, //  页码总数
56
        total: 0, //  页码总数
65
        tableItem: [ // 表头信息
57
        tableItem: [ // 表头信息
102
    },
94
    },
103
    methods: {
95
    methods: {
104
      change(value) {
96
      change(value) {
105
        console.log(value)
106
        this.info.catalog = value
97
        this.info.catalog = value
98
        this.searchText = this.info.title
107
        this.publishList()
99
        this.publishList()
108
      },
100
      },
109
      search() {
101
      search() {
110
        this.info.title = this.searchText
102
        this.info.title = this.searchText
111
        this.publishList()
103
        this.publishList()
112
      },
104
      },
113
      publishList() {
105
      publishList() { //  内容发布中的列表
114
        const arr = [
106
        const arr = [
115
          {
107
          {
116
            num: 1
108
            num: 1
125
            num: 4
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
          if (response.success && response.data) {
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
            for (let i = 0; i < epData.length; i++) {
124
            for (let i = 0; i < epData.length; i++) {
133
              epData[i].createTime = parseTime(epData[i].createTime).substr(0, 16)
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
              Object.assign(epData[i], arr[i])
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
            } else {
135
            } else {
147
              const array = this.dataList
136
              const array = epData
148
              ret.gapFilling(array)
137
              ret.gapFilling(array)
149
              this.tableData = array
138
              this.tableData = array
150
            }
139
            }
151
          } else {
140
          } else {
152
            this.$sort.total = 0
141
            this.total = 0
153
            this.tableData = []
142
            this.tableData = []
154
          }
143
          }
155
        })
144
        })
156
      },
145
      },
157
      sortSingleExpert(obj) { //  点击单个特约专家信息
146
      deleteFun(obj) { // 点击删除单个内容
158
        this.$confirm('确定删除该条内容?', '提示', {
147
        this.$confirm('确定删除该条内容?', '提示', {
159
          confirmButtonText: '确定',
148
          confirmButtonText: '确定',
160
          cancelButtonText: '取消',
149
          cancelButtonText: '取消',
192
        console.log(id)
181
        console.log(id)
193
      },
182
      },
194
      current(val) { // 点击页码
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
            <el-form-item label="作者/来源" prop="source">
20
            <el-form-item label="作者/来源" prop="source">
21
              <el-input v-model.number="ruleForm2.source" placeholder="请填写作者/来源" maxlength=20></el-input>
21
              <el-input v-model.number="ruleForm2.source" placeholder="请填写作者/来源" maxlength=20></el-input>
22
            </el-form-item>
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
          </el-col>
26
          </el-col>
27
          <el-col :span="12">
27
          <el-col :span="12">
28
            <el-form-item style="text-align:right" prop="imgUrl">
28
            <el-form-item style="text-align:right" prop="imgUrl">
36
        <el-form-item class="traftButton">
36
        <el-form-item class="traftButton">
37
          <el-button type="info" @click="draft">保存草稿</el-button>
37
          <el-button type="info" @click="draft">保存草稿</el-button>
38
        </el-form-item>
38
        </el-form-item>
39
        <el-form-item class="traftButton" v-if="$route.query.id">
40
          最后修改时间:{{modifyTime}}
41
        </el-form-item>
39
        <el-form-item class="publishButton">
42
        <el-form-item class="publishButton">
40
          <el-button type="primary" @click="submitForm('ruleForm2')">发布</el-button>
43
          <el-button type="primary" @click="submitForm('ruleForm2')">发布</el-button>
41
          <el-button type="danger" @click="deleteContent" v-if="$route.query.id">删除</el-button>
44
          <el-button type="danger" @click="deleteContent" v-if="$route.query.id">删除</el-button>
49
  import searchTemplate from '@/components/searchBar'
52
  import searchTemplate from '@/components/searchBar'
50
  import uploadFile from '@/components/uploadFile'
53
  import uploadFile from '@/components/uploadFile'
51
  import UE from '@/components/editorUE'
54
  import UE from '@/components/editorUE'
55
  import { parseTime } from '@/utils/index'
52
  import { uploadPhotoUrl, publishUrl, draftFirstUrl, draftUrl, draftPublishUrl, deleteUrl, inquireContentUrl } from '@/api/content'
56
  import { uploadPhotoUrl, publishUrl, draftFirstUrl, draftUrl, draftPublishUrl, deleteUrl, inquireContentUrl } from '@/api/content'
53
  export default {
57
  export default {
54
    data() {
58
    data() {
77
        }
81
        }
78
      }
82
      }
79
      return {
83
      return {
84
        modifyTime: '',
80
        draftFlag: true,
85
        draftFlag: true,
81
        upImgsStr: '',
86
        upImgsStr: '',
82
        id: '',
87
        id: '',
89
        relevantExperts: {
94
        relevantExperts: {
90
          url: '',
95
          url: '',
91
          placeholder: '请选择关联专家',
96
          placeholder: '请选择关联专家',
92
          fun: 'expert',
93
          label: '相关专家',
97
          label: '相关专家',
94
          prop: 'professors'
98
          prop: 'professors'
95
        },
99
        },
96
        relevantInstitutions: {
100
        relevantInstitutions: {
97
          url: '',
101
          url: '',
98
          placeholder: '请选择关联机构',
102
          placeholder: '请选择关联机构',
99
          fun: 'institution',
100
          label: '相关机构',
103
          label: '相关机构',
101
          prop: 'orgs'
104
          prop: 'orgs'
102
        },
105
        },
103
        relevantCompanies: {
106
        relevantCompanies: {
104
          url: '',
107
          url: '',
105
          placeholder: '请选择关联企业',
108
          placeholder: '请选择关联企业',
106
          fun: 'company',
107
          label: '相关企业',
109
          label: '相关企业',
108
          prop: 'comps'
110
          prop: 'comps'
109
        },
111
        },
148
              comps: []
150
              comps: []
149
            }
151
            }
150
            this.upImgsStr = info.imgUrl
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
          this.$refs.ruleForm2.validateField('title')
180
          this.$refs.ruleForm2.validateField('title')
176
        }
181
        }
177
        if (value === '1' || value === '2') {
182
        if (value === '1' || value === '2') {
178
          console.log(value, typeof value)
179
          console.log(this.rules2)
180
          this.rules2.imgUrl.push({ message: '请上传封面图片', required: true, trigger: 'blur' })
183
          this.rules2.imgUrl.push({ message: '请上传封面图片', required: true, trigger: 'blur' })
181
        } else {
184
        } else {
182
          this.rules2.imgUrl = []
185
          this.rules2.imgUrl = []
305
            }).catch(() => {
308
            }).catch(() => {
306
            })
309
            })
307
          } else {
310
          } else {
308
            console.log('error submit!!')
309
            return false
311
            return false
310
          }
312
          }
311
        })
313
        })

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

17
        </el-select>
17
        </el-select>
18
      </div>
18
      </div>
19
      <complex-table :tableData="tableData" :tableItem="tableItem" :operatingList='operatingList' :total='total'
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
    </div>
21
    </div>
22
  </div>
22
  </div>
23
</template>
23
</template>
25
<script>
25
<script>
26
  import complexTable from '@/components/complexTable'
26
  import complexTable from '@/components/complexTable'
27
  import { thoroughDeleteAll, thoroughDeleteSingleUrl, recycleBinInquireUrl, restoreUrl, inquireContentUrl } from '@/api/content'
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
  import ret from '@/utils/comTable'
29
  import ret from '@/utils/comTable'
30
  import cacheModule from '@/utils/queryName'
31
  export default {
31
  export default {
32
    data() {
32
    data() {
33
      return {
33
      return {
34
        searchText: '',
35
        selectMode: '',
34
        selectMode: '',
36
        info: {
35
        info: {
37
          catalog: '',
36
          catalog: '',
38
          pageSize: 20,
37
          pageSize: 20,
39
          pageNo: 1
38
          pageNo: 1
40
        },
39
        },
41
        type: {
42
          '1': '平台新闻',
43
          '2': '采访专栏',
44
          '3': '政策法规',
45
          '4': '通知公告'
46
        },
47
        formData: {},
40
        formData: {},
48
        operatingList: [ // 在子组件中遍历事件
41
        operatingList: [ // 在子组件中遍历事件
49
          {
42
          {
50
            text: '恢复',
43
            text: '恢复',
51
            event: 'edit',
44
            event: 'restore',
52
            icon: 'primary'
45
            icon: 'primary'
53
          },
46
          },
54
          {
47
          {
55
            text: '彻底删除',
48
            text: '彻底删除',
56
            event: 'sortSingleExpert',
49
            event: 'deleteFun',
57
            icon: 'danger'
50
            icon: 'danger'
58
          }
51
          }
59
        ],
52
        ],
60
        dataList: [], //  拉去专家数据存到dataList这个数组里面
61
        tableData: [], //  每一页的存储的数据
53
        tableData: [], //  每一页的存储的数据
62
        total: 0, //  页码总数
54
        total: 0, //  页码总数
63
        tableItem: [ // 表头信息
55
        tableItem: [ // 表头信息
96
      }
88
      }
97
    },
89
    },
98
    created() {
90
    created() {
99
      this.publishList()
91
      this.recycleBinList()
100
    },
92
    },
101
    components: {
93
    components: {
102
      complexTable //  表子页面
94
      complexTable //  表子页面
104
    methods: {
96
    methods: {
105
      change(value) {
97
      change(value) {
106
        this.info.catalog = value
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
          if (response.success && response.data) {
103
          if (response.success && response.data) {
112
            const epData = response.data.data
104
            const res = response.data
105
            const epData = res.data
113
            for (let i = 0; i < epData.length; i++) {
106
            for (let i = 0; i < epData.length; i++) {
114
              epData[i].createTime = parseTime(epData[i].createTime).substr(0, 16)
107
              epData[i].createTime = parseTime(epData[i].createTime).substr(0, 16)
115
              epData[i].invalidTime = parseTime(epData[i].invalidTime).substr(0, 16)
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
            } else {
120
            } else {
128
              const array = this.dataList
121
              const array = epData
129
              ret.gapFilling(array)
122
              ret.gapFilling(array)
130
              this.tableData = array
123
              this.tableData = array
131
            }
124
            }
132
          } else {
125
          } else {
133
            this.$sort.total = 0
126
            this.total = 0
134
            this.tableData = []
127
            this.tableData = []
135
          }
128
          }
136
        })
129
        })
137
      },
130
      },
138
      edit(obj) {
139
        console.log(obj)
131
      restore(obj) {
140
        this.$confirm(`确定恢复${obj.title}内容?`, '提示', {
132
        this.$confirm(`确定恢复${obj.title}内容?`, '提示', {
141
          confirmButtonText: '确定',
133
          confirmButtonText: '确定',
142
          cancelButtonText: '取消',
134
          cancelButtonText: '取消',
146
          this.$http.get(restoreUrl, { id: obj.id }, response => {
138
          this.$http.get(restoreUrl, { id: obj.id }, response => {
147
            if (response.success) {
139
            if (response.success) {
148
              if (response.data) {
140
              if (response.data) {
149
                this.publishList()
141
                this.recycleBinList()
150
                this.$message({
142
                this.$message({
151
                  message: '恢复成功成功',
143
                  message: '恢复成功',
152
                  type: 'success'
144
                  type: 'success'
153
                })
145
                })
154
              } else {
146
              } else {
169
        }).catch(() => {
161
        }).catch(() => {
170
        })
162
        })
171
      },
163
      },
172
      deleteAll() {
164
      deleteAll() { //  删除全部回收站信息
173
        this.$confirm('确定全部彻底删除回收站内容?', '提示', {
165
        this.$confirm('确定全部彻底删除回收站内容?', '提示', {
174
          confirmButtonText: '确定',
166
          confirmButtonText: '确定',
175
          cancelButtonText: '取消',
167
          cancelButtonText: '取消',
178
        }).then(() => {
170
        }).then(() => {
179
          this.$http.get(thoroughDeleteAll, '', response => {
171
          this.$http.get(thoroughDeleteAll, '', response => {
180
            if (response.success) {
172
            if (response.success) {
181
              this.publishList()
173
              this.recycleBinList()
182
              this.$message({
174
              this.$message({
183
                message: '全部删除成功',
175
                message: '全部删除成功',
184
                type: 'success'
176
                type: 'success'
188
        }).catch(() => {
180
        }).catch(() => {
189
        })
181
        })
190
      },
182
      },
191
      sortSingleExpert(obj) { //  点击单个特约专家信息
183
      deleteFun(obj) { //  彻底删除单个内容信息
192
        console.log(obj)
184
        console.log(obj)
193
        this.$confirm('确定彻底删除该条回收站内容?', '提示', {
185
        this.$confirm('确定彻底删除该条回收站内容?', '提示', {
194
          confirmButtonText: '确定',
186
          confirmButtonText: '确定',
198
        }).then(() => {
190
        }).then(() => {
199
          this.$http.get(thoroughDeleteSingleUrl, { id: obj.id }, response => {
191
          this.$http.get(thoroughDeleteSingleUrl, { id: obj.id }, response => {
200
            if (response.success) {
192
            if (response.success) {
201
              this.publishList()
193
              this.recycleBinList()
202
              this.$message({
194
              this.$message({
203
                message: '删除成功',
195
                message: '删除成功',
204
                type: 'success'
196
                type: 'success'
212
        this.$router.push({ path: 'viewRecycling', query: { id }})
204
        this.$router.push({ path: 'viewRecycling', query: { id }})
213
      },
205
      },
214
      current(val) { // 点击页码
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
        <el-form-item label="文章正文" prop="cnt" class="editBox">
25
        <el-form-item label="文章正文" prop="cnt" class="editBox">
26
          <div class="editContent" v-html="ruleForm2.cnt"></div>
26
          <div class="editContent" v-html="ruleForm2.cnt"></div>
27
        </el-form-item>
27
        </el-form-item>
28
        <el-form-item class="deleTime">
29
          最后删除时间:{{modifyTime}}
30
        </el-form-item>
28
        <el-form-item class="publishButton">
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
        </el-form-item>
34
        </el-form-item>
32
      </el-form>
35
      </el-form>
33
      <div class="fileBox">
36
      <div class="fileBox">
39
</template>
42
</template>
40
43
41
<script>
44
<script>
42
  import { inquireContentUrl } from '@/api/content'
45
  import { inquireContentUrl, restoreUrl, thoroughDeleteSingleUrl } from '@/api/content'
46
  import { parseTime } from '@/utils/index'
43
  export default {
47
  export default {
44
    data() {
48
    data() {
45
      return {
49
      return {
50
        modifyTime: '',
51
        id: '',
46
        ruleForm2: {
52
        ruleForm2: {
47
          title: '',
53
          title: '',
48
          source: '',
54
          source: '',
57
    },
63
    },
58
    created() {
64
    created() {
59
      const id = this.$route.query.id
65
      const id = this.$route.query.id
66
      this.id = id
60
      this.$http.get(inquireContentUrl, { id }, (response) => {
67
      this.$http.get(inquireContentUrl, { id }, (response) => {
61
        if (response.success && response.data) {
68
        if (response.success && response.data) {
62
          const info = response.data
69
          const info = response.data
70
            orgs: '',
77
            orgs: '',
71
            comps: ''
78
            comps: ''
72
          }
79
          }
80
          this.modifyTime = parseTime(info.modifyTime).substr(0, 19)
73
        }
81
        }
74
      })
82
      })
75
    },
83
    },
76
    methods: {
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
</script>
139
</script>
93
140
94
<style rel="stylesheet/scss" lang="scss" scoped>
141
<style rel="stylesheet/scss" lang="scss" scoped>
142
  .deleTime {
143
    text-align: right
144
  }
145
95
  .formTable {
146
  .formTable {
96
    width: 943px
147
    width: 943px
97
  }
148
  }

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

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

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

21
          <svg-icon icon-class="password-view" v-show="falg" /></span>
21
          <svg-icon icon-class="password-view" v-show="falg" /></span>
22
      </el-form-item>
22
      </el-form-item>
23
      <el-form-item>
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
      </el-form-item>
25
      </el-form-item>
26
    </el-form>
26
    </el-form>
27
  </div>
27
  </div>

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

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