Browse Source

修正程序

lipengtao 6 years ago
parent
commit
3e75f3de77

+ 6 - 1
config/index.js

@ -8,7 +8,12 @@ module.exports = {
8 8
    // Paths
9 9
    assetsSubDirectory: 'static',
10 10
    assetsPublicPath: '/',
11
    proxyTable: {},
11
    proxyTable: {
12
      '/api': {
13
        target: 'http://www.ekexiu.com',  //目标接口域名
14
        changeOrigin: true,  //是否跨域
15
      }
16
    },
12 17
13 18
    // Various Dev Server settings
14 19
    host: 'localhost', // can be overwritten by process.env.HOST

BIN
src/assets/defaultPhoto/defaultAgency.jpg


BIN
src/assets/defaultPhoto/defaultProfessor.jpg


+ 62 - 0
src/utils/CrossDomain.js

@ -0,0 +1,62 @@
1
import request from './request'
2
import defaultProfessor from '../assets/defaultPhoto/defaultProfessor.jpg'
3
import defaultAgency from '../assets/defaultPhoto/defaultAgency.jpg'
4
import { orgType } from './index'
5
const baseUrl = 'http://www.ekexiu.com'
6
const professorUrl = baseUrl + '/ajax/professor/editBaseInfo/'
7
const agencyUrl = baseUrl + '/ajax/org/'
8
9
const cacheModule = {
10
  catchProfessor: {},
11
  catchAgency: {},
12
  getUserInfo(id, callback) {
13
    if (this.catchProfessor[id]) {
14
      if (this.catchProfessor[id].hasHeadImage) {
15
        this.catchProfessor[id].img = `${baseUrl}/images/head/${id}_l.jpg`
16
      } else {
17
        this.catchProfessor[id].img = defaultProfessor
18
      }
19
      callback(this.catchProfessor[id])
20
    } else {
21
      request.get(professorUrl + id, {}, response => {
22
        if (response.success && response.data) {
23
          const info = response.data
24
          if (info.hasHeadImage) {
25
            info.img = `${baseUrl}/images/head/${id}_l.jpg`
26
          } else {
27
            info.img = defaultProfessor
28
          }
29
          this.catchProfessor[id] = info
30
          callback(info)
31
        }
32
      })
33
    }
34
  },
35
  getAgencyInfo(id, callback) {
36
    if (this.catchAgency[id]) {
37
      if (this.catchAgency[id].hasOrgLogo) {
38
        this.catchAgency[id].img = `${baseUrl}/images/org/${id}.jpg`
39
      } else {
40
        this.catchAgency[id].img = defaultAgency
41
      }
42
      this.catchAgency[id].orgType = orgType[this.catchAgency[id].orgType]
43
      callback(this.catchAgency[id])
44
    } else {
45
      request.get(agencyUrl + id, {}, response => {
46
        if (response.success && response.data) {
47
          const info = response.data
48
          if (info.hasOrgLogo) {
49
            info.img = `${baseUrl}/images/org/${id}.jpg`
50
          } else {
51
            info.img = defaultAgency
52
          }
53
          info.orgType = orgType[info.orgType]
54
          this.catchProfessor[id] = info
55
          callback(info)
56
        }
57
      })
58
    }
59
  }
60
}
61
62
export default cacheModule

+ 13 - 0
src/utils/index.js

@ -65,3 +65,16 @@ export const type = {
65 65
  '3': '政策法规',
66 66
  '4': '通知公告'
67 67
}
68
export const orgType = {
69
  '2': '上市企业',
70
  '3': '外资企业',
71
  '4': '合资企业',
72
  '5': '资企业',
73
  '6': '个体经营',
74
  '7': '政府机构',
75
  '8': '公益组织',
76
  '9': '协会学会',
77
  '10': '新闻媒体',
78
  '11': '教育机构',
79
  'undefined': ''
80
}

+ 18 - 7
src/views/contentPub/draftList.vue

@ -93,20 +93,31 @@
93 93
          if (response.success && response.data) {
94 94
            const res = response.data
95 95
            const epData = res.data
96
            let j = 0
96 97
            for (let i = 0; i < epData.length; i++) {
98
              j++
97 99
              epData[i].modifyTime = parseTime(epData[i].modifyTime).substr(0, 16)
98 100
              epData[i].catalog = type[epData[i].catalog]
99 101
              cacheModule.Judge(epData[i].modifier, info => {
102
                j--
100 103
                epData[i].modifier = info.name
104
                if (j === 0) {
105
                  this.total = res.total
106
                  if (epData.length === 20) {
107
                    this.tableData = epData
108
                  } else {
109
                    const array = epData
110
                    if (epData.length !== 0) {
111
                      ret.gapFilling(array)
112
                    }
113
                    this.tableData = array
114
                  }
115
                }
101 116
              })
102 117
            }
103
            this.total = res.total
104
            if (epData.length === 20) {
105
              this.tableData = epData
106
            } else {
107
              const array = epData
108
              ret.gapFilling(array)
109
              this.tableData = array
118
            if (epData.length === 0) {
119
              this.total = 0
120
              this.tableData = []
110 121
            }
111 122
          } else {
112 123
            this.total = 0

+ 16 - 7
src/views/contentPub/pubList.vue

@ -121,21 +121,30 @@
121 121
          if (response.success && response.data) {
122 122
            const res = response.data
123 123
            const epData = res.data
124
            let j = 0
124 125
            for (let i = 0; i < epData.length; i++) {
125 126
              epData[i].createTime = parseTime(epData[i].createTime).substr(0, 16)
126 127
              epData[i].catalog = type[epData[i].catalog]
127 128
              Object.assign(epData[i], arr[i])
129
              j++
128 130
              cacheModule.Judge(epData[i].creator, info => {
131
                j--
129 132
                epData[i].creator = info.name
133
                if (j === 0) {
134
                  this.total = res.total
135
                  if (epData.length === 20) {
136
                    this.tableData = epData
137
                  } else {
138
                    const array = epData
139
                    ret.gapFilling(array)
140
                    this.tableData = array
141
                  }
142
                }
130 143
              })
131 144
            }
132
            this.total = res.total
133
            if (epData.length === 20) {
134
              this.tableData = epData
135
            } else {
136
              const array = epData
137
              ret.gapFilling(array)
138
              this.tableData = array
145
            if (epData.length === 0) {
146
              this.total = 0
147
              this.tableData = []
139 148
            }
140 149
          } else {
141 150
            this.total = 0

+ 27 - 7
src/views/contentPub/recycleBin.vue

@ -103,24 +103,44 @@
103 103
          if (response.success && response.data) {
104 104
            const res = response.data
105 105
            const epData = res.data
106
            let j = 0
106 107
            for (let i = 0; i < epData.length; i++) {
107 108
              epData[i].createTime = parseTime(epData[i].createTime).substr(0, 16)
108 109
              epData[i].invalidTime = parseTime(epData[i].invalidTime).substr(0, 16)
109 110
              epData[i].catalog = type[epData[i].catalog]
111
              j += 2
110 112
              cacheModule.Judge(epData[i].creator, info => {
113
                j--
111 114
                epData[i].creator = info.name
115
                if (j === 0) {
116
                  this.total = res.total
117
                  if (epData.length === 20) {
118
                    this.tableData = epData
119
                  } else {
120
                    const array = epData
121
                    ret.gapFilling(array)
122
                    this.tableData = array
123
                  }
124
                }
112 125
              })
113 126
              cacheModule.Judge(epData[i].invalidOperator, info => {
127
                j--
114 128
                epData[i].invalidOperator = info.name
129
                if (j === 0) {
130
                  this.total = res.total
131
                  if (epData.length === 20) {
132
                    this.tableData = epData
133
                  } else {
134
                    const array = epData
135
                    ret.gapFilling(array)
136
                    this.tableData = array
137
                  }
138
                }
115 139
              })
116 140
            }
117
            this.total = res.total
118
            if (epData.length === 20) {
119
              this.tableData = epData
120
            } else {
121
              const array = epData
122
              ret.gapFilling(array)
123
              this.tableData = array
141
            if (epData.length === 0) {
142
              this.total = 0
143
              this.tableData = []
124 144
            }
125 145
          } else {
126 146
            this.total = 0

+ 7 - 6
src/views/cooperationAgency/agencySort.vue

@ -2,17 +2,19 @@
2 2
  <el-dialog title="合作机构排序" :visible.sync="dialogFormVisible" width="600px">
3 3
    <div class="box">
4 4
      <div class="t-left">
5
        <div class="headPhoto"></div>
5
        <div class="headPhoto">
6
          <img :src="form.img" alt="">
7
        </div>
6 8
      </div>
7 9
      <el-form :model="form" class="form-el" ref="form" :rules="rules2">
8 10
        <el-form-item :label-width="formLabelWidth">
9 11
          {{form.name}}
10 12
        </el-form-item>
11 13
        <el-form-item :label-width="formLabelWidth">
12
          {{form.type}}
14
          {{form.orgType}}
13 15
        </el-form-item>
14 16
        <el-form-item :label-width="formLabelWidth">
15
          {{form.name}}
17
          {{form.city}}
16 18
        </el-form-item>
17 19
        <el-form-item :label-width="formLabelWidth" prop="level">
18 20
          <div class='labelBox'>合作机构平台序号</div></span>
@ -88,12 +90,11 @@
88 90
    float: left
89 91
  }
90 92
91
  .headPhoto {
93
  .headPhoto img {
92 94
    width: 100px;
93 95
    height: 100px;
94
    border: 1px solid red;
96
    border: 1px solid #e5e5e5;
95 97
  }
96
97 98
  .form-el {
98 99
    float: left
99 100
  }

+ 25 - 36
src/views/cooperationAgency/index.vue

@ -17,6 +17,7 @@
17 17
  import { agencyListUrl } from '@/api/cooperationAgency' //  agencyUserUrl
18 18
  import { parseTime } from '@/utils/index'
19 19
  import ret from '@/utils/comTable'
20
  import crossDomin from '@/utils/CrossDomain'
20 21
  export default {
21 22
    data() {
22 23
      return {
@ -44,22 +45,17 @@
44 45
            active: 'active' // 点击加颜色,加此选项
45 46
          },
46 47
          {
47
            prop: 'type',
48
            prop: 'orgType',
48 49
            tit: '机构类型',
49 50
            width: '160'
50 51
          },
51 52
          {
52
            prop: 'linkman',
53
            tit: '联系人',
54
            width: '160'
55
          },
56
          {
57
            prop: 'linkphone',
53
            prop: 'contactNum',
58 54
            tit: '联系电话',
59 55
            width: '160'
60 56
          },
61 57
          {
62
            prop: 'linkemail',
58
            prop: 'email',
63 59
            tit: '联系邮箱',
64 60
            width: '160'
65 61
          },
@ -84,40 +80,33 @@
84 80
    },
85 81
    methods: {
86 82
      agencyList() {
87
        const arr = [
88
          {
89
            name: '北京科袖科技有限公司',
90
            type: '上市公司',
91
            linkman: '张女士',
92
            linkphone: '13526256369',
93
            linkemail: '280716069@qq.com'
94
          },
95
          {
96
            name: '北京佳木斯科技有限公司',
97
            type: '国有企业',
98
            linkman: '李朋涛',
99
            linkphone: '1352569',
100
            linkemail: '280716890@qq.com'
101
          }
102
        ]
103 83
        this.$http.get(agencyListUrl, '', (response) => { //  拉去专家信息列表,总数据存在dataList,tableData存每一页的信息
104 84
          if (response.success && response.data) {
105 85
            const epData = response.data
86
            let j = 0
106 87
            for (let i = 0; i < epData.length; i++) {
107 88
              epData[i].assTime = parseTime(epData[i].assTime).substr(0, 10)
108
              Object.assign(epData[i], arr[i])
109
              // this.$http.get(agencyUserUrl, {id: epData[i].id}, (response ) => {
110
              //   console.log(response)
111
              // })
89
              j++
90
              crossDomin.getAgencyInfo(epData[i].id, data => {
91
                j--
92
                Object.assign(epData[i], data)
93
                if (j === 0) {
94
                  this.dataList = epData
95
                  this.total = epData.length
96
                  if (this.total >= 20) {
97
                    this.tableData = this.dataList.slice(0, 20)
98
                  } else {
99
                    const array = this.dataList
100
                    ret.gapFilling(array)
101
                    this.tableData = array
102
                  }
103
                }
104
              })
112 105
            }
113
            this.dataList = epData
114
            this.total = epData.length
115
            if (this.total >= 20) {
116
              this.tableData = this.dataList.slice(0, 20)
117
            } else {
118
              const array = this.dataList
119
              ret.gapFilling(array)
120
              this.tableData = array
106
            if (epData.length === 0) {
107
              this.dataList = []
108
              this.tableData = []
109
              this.total = 0
121 110
            }
122 111
          } else {
123 112
            this.$sort.total = 0

+ 10 - 4
src/views/specialExperts/expertSort.vue

@ -2,17 +2,19 @@
2 2
  <el-dialog title="专家排序" :visible.sync="dialogFormVisible" width="600px">
3 3
    <div class="box">
4 4
      <div class="t-left">
5
        <div class="headPhoto"></div>
5
        <div class="headPhoto">
6
          <img :src="form.img" alt="">
7
        </div>
6 8
      </div>
7 9
      <el-form :model="form" class="form-el" ref="form" :rules="rules2">
8 10
        <el-form-item :label-width="formLabelWidth">
9 11
          {{form.name}}
10 12
        </el-form-item>
11 13
        <el-form-item :label-width="formLabelWidth">
12
          {{form.job}}
14
          {{form.title}}
13 15
        </el-form-item>
14 16
        <el-form-item :label-width="formLabelWidth">
15
          {{form.comp}}
17
          {{form.orgName}}
16 18
        </el-form-item>
17 19
        <el-form-item :label-width="formLabelWidth" prop="level">
18 20
          <div class='labelBox'>专家平台序号</div></span>
@ -90,9 +92,13 @@
90 92
  }
91 93
92 94
  .headPhoto {
95
    
96
    
97
  }
98
  .headPhoto img {
93 99
    width: 100px;
94 100
    height: 100px;
95
    border: 1px solid red;
101
    border: 1px solid #E5E5E5;
96 102
    border-radius: 50%;
97 103
  }
98 104

+ 27 - 33
src/views/specialExperts/index.vue

@ -17,6 +17,7 @@
17 17
  import { expertListUrl } from '@/api/specialExpert' //  expertUserUrl
18 18
  import { parseTime } from '@/utils/index'
19 19
  import ret from '@/utils/comTable'
20
  import crossDomin from '@/utils/CrossDomain'
20 21
  export default {
21 22
    data() {
22 23
      return {
@ -44,17 +45,17 @@
44 45
            active: 'active' // 点击加颜色,加此选项
45 46
          },
46 47
          {
47
            prop: 'job',
48
            prop: 'title',
48 49
            tit: '职称',
49 50
            width: '160'
50 51
          },
51 52
          {
52
            prop: 'comp',
53
            prop: 'orgName',
53 54
            tit: '所在机构',
54 55
            width: '160'
55 56
          },
56 57
          {
57
            prop: 'city',
58
            prop: 'address',
58 59
            tit: '所在城市',
59 60
            width: '160'
60 61
          },
@ -89,42 +90,35 @@
89 90
    },
90 91
    methods: {
91 92
      expertList() {
92
        const arr = [
93
          {
94
            name: '张波',
95
            job: '教授',
96
            comp: '河南科技学院',
97
            city: '郑州',
98
            phone: '13526256369',
99
            email: '280716069@qq.com'
100
          },
101
          {
102
            name: '李朋涛',
103
            job: '讲师',
104
            comp: '北京大学',
105
            city: '北京',
106
            phone: '15623569685',
107
            email: '280715983@qq.com'
108
          }
109
        ]
110 93
        this.$http.get(expertListUrl, '', (response) => { //  拉去专家信息列表,总数据存在dataList,tableData存每一页的信息
111 94
          if (response.success && response.data) {
112 95
            const epData = response.data
96
            let j = 0
113 97
            for (let i = 0; i < epData.length; i++) {
114 98
              epData[i].assTime = parseTime(epData[i].assTime).substr(0, 16)
115
              Object.assign(epData[i], arr[i])
116
              // this.$http.get(expertUserUrl, {id: epData[i].id}, (response ) => {
117
              //   console.log(response)
118
              // })
99
              j++
100
              crossDomin.getUserInfo(epData[i].id, data => {
101
                j--
102
                Object.assign(epData[i], data)
103
                if (j === 0) {
104
                  this.dataList = epData
105
                  this.total = epData.length
106
                  if (this.total >= 20) {
107
                    this.tableData = this.dataList.slice(0, 20)
108
                  } else {
109
                    const array = this.dataList
110
                    if (epData.length !== 0) {
111
                      ret.gapFilling(array)
112
                    }
113
                    this.tableData = array
114
                  }
115
                }
116
              })
119 117
            }
120
            this.dataList = epData
121
            this.total = epData.length
122
            if (this.total >= 20) {
123
              this.tableData = this.dataList.slice(0, 20)
124
            } else {
125
              const array = this.dataList
126
              ret.gapFilling(array)
127
              this.tableData = array
118
            if (epData.length === 0) {
119
              this.dataList = []
120
              this.tableData = []
121
              this.total = 0
128 122
            }
129 123
          } else {
130 124
            this.$sort.total = 0