Browse Source

修改bug

lipengtao 6 years ago
parent
commit
fe99896502

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

@ -3,6 +3,7 @@
3 3
    <el-select v-model="input" filterable remote reserve-keyword :placeholder="relevant.placeholder" :remote-method="remoteMethod"
4 4
      :loading="loading" @change='change(input)'>
5 5
      <el-option v-for="item in optionsList" :key="item.value" :label="item.label" :value="item.value">
6
        <span>{{item.label}}</span><span style="float:right;" v-if="item.title">{{item.title}}</span>
6 7
      </el-option>
7 8
    </el-select>
8 9
  </el-form-item>
@ -47,7 +48,7 @@ export default {
47 48
              })
48 49
            }
49 50
          })
50
        } else {
51
        } else if (that.relevant.prop === 'orgs') {
51 52
          request.get(kexiuUrl + that.relevant.url, {
52 53
            pid: that.platid,
53 54
            rows: 200
@ -62,6 +63,46 @@ export default {
62 63
              })
63 64
            }
64 65
          })
66
        } else {
67
          request.get(kexiuUrl + that.relevant.url, {
68
            pid: that.platid,
69
            rows: 200
70
          }, function(res) {
71
            that.loading = false
72
            if (res.success && res.data) {
73
              const obj = res.data
74
              let j = 0
75
              const info = obj.map(item => {
76
                return { value: item.id, label: item.name }
77
              }).filter(ont => {
78
                return ont.label.toLowerCase().indexOf(query.toLowerCase()) > -1
79
              })
80
              for (let i = 0; i < info.length; i++) {
81
                j++
82
                request.get(kexiuUrl + '/ajax/professor/baseInfo/' + info[i].value, {}, function(res) {
83
                  j--
84
                  if (res.success && res.data) {
85
                    const response = res.data
86
                    let title = response.title || response.office || ''
87
                    const job = response.orgName || ''
88
                    if (title) {
89
                      if (job) {
90
                        title = title + ',' + job
91
                      }
92
                    } else {
93
                      if (job) {
94
                        title = job
95
                      }
96
                    }
97
                    info[i].title = title
98
                    if (j === 0) {
99
                      that.optionsList = info
100
                    }
101
                  }
102
                })
103
              }
104
            }
105
          })
65 106
        }
66 107
      } else {
67 108
        that.optionsList = []

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

@ -88,7 +88,7 @@ export default {
88 88
      if (!isLt2M) {
89 89
        this.$message.error('图片大小不能超过2MB,请重新上传')
90 90
      }
91
      return isJPG && isLt2M
91
      return (isJPG || isPNG) && isLt2M
92 92
    }
93 93
  }
94 94
}

+ 2 - 2
src/router/index.js

@ -102,7 +102,7 @@ export const asyncRouterMap = [
102 102
          component: () => import('@/views/contentPub/index'),
103 103
          name: 'content',
104 104
          redirect: '/content/pubList',
105
          meta: { title: '内容发布列表' },
105
          meta: { title: '' },
106 106
          children: [
107 107
            {
108 108
              path: 'pubList',
@ -130,7 +130,7 @@ export const asyncRouterMap = [
130 130
          component: () => import('@/views/contentPub/index'),
131 131
          name: 'recycle',
132 132
          redirect: '/recycle/recycleBinList',
133
          meta: { title: '内容回收站列表' },
133
          meta: { title: '' },
134 134
          children: [
135 135
            {
136 136
              path: 'recycleBinList',

+ 1 - 1
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:deleteFun="deleteFun" v-on:jump="jump" v-on:current="current" v-on:edit="edit"></complex-table>
17
        v-on:deleteFun="deleteFun" :jump="'content'" v-on:current="current" v-on:edit="edit"></complex-table>
18 18
    </div>
19 19
  </div>
20 20
</template>

+ 5 - 20
src/views/contentPub/pubList.vue

@ -74,11 +74,11 @@
74 74
            tit: '发布时间',
75 75
            width: '160'
76 76
          },
77
          {
78
            prop: 'num',
79
            tit: '浏览数量',
80
            width: '160'
81
          },
77
          // {
78
          //   prop: 'num',
79
          //   tit: '浏览数量',
80
          //   width: '160'
81
          // },
82 82
          {
83 83
            operate: 'edit',
84 84
            width: '200'
@ -103,20 +103,6 @@
103 103
        this.publishList()
104 104
      },
105 105
      publishList() { //  内容发布中的列表
106
        const arr = [
107
          {
108
            num: 1
109
          },
110
          {
111
            num: 2
112
          },
113
          {
114
            num: 3
115
          },
116
          {
117
            num: 4
118
          }
119
        ]
120 106
        this.$http.get(pageInquireUrl, this.info, (response) => { //  拉去发布内容信息列表,tableData存每一页的信息
121 107
          if (response.success && response.data) {
122 108
            const res = response.data
@ -125,7 +111,6 @@
125 111
            for (let i = 0; i < epData.length; i++) {
126 112
              epData[i].modifyTime = parseTime(epData[i].modifyTime).substr(0, 16)
127 113
              epData[i].catalog = type[epData[i].catalog]
128
              Object.assign(epData[i], arr[i])
129 114
              j++
130 115
              cacheModule.Judge(epData[i].creator, info => {
131 116
                j--

+ 6 - 1
src/views/contentPub/publish.vue

@ -31,7 +31,7 @@
31 31
          </el-col>
32 32
        </el-row>
33 33
        <el-form-item label="文章正文" prop="cnt" class="editBox">
34
          <UE :id="artUe" :contentText="ruleForm2.cnt" ref="ueBox"></UE>
34
          <UE :id="artUe" :contentText="ruleForm2.cnt" ref="ueBox" v-if="UEflag"></UE>
35 35
        </el-form-item>
36 36
        <el-form-item class="traftButton">
37 37
          <el-button type="info" @click="draft">保存草稿</el-button>
@ -58,6 +58,9 @@
58 58
    data() {
59 59
      var checkTitle = (rule, value, callback) => {
60 60
        if (!value) {
61
          if (this.draftFlag && this.ruleForm2.catalog === '') {
62
            return callback('请选择该内容所属栏目分类&&请填写标题')
63
          }
61 64
          return callback(new Error('请填写标题'))
62 65
        } else {
63 66
          if (this.draftFlag && this.ruleForm2.catalog === '') {
@ -81,6 +84,7 @@
81 84
        }
82 85
      }
83 86
      return {
87
        UEflag: false,
84 88
        modifyTime: '',
85 89
        draftFlag: true,
86 90
        upImgsStr: '',
@ -149,6 +153,7 @@
149 153
              orgs: [],
150 154
              comps: []
151 155
            }
156
            this.UEflag = true
152 157
            this.upImgsStr = info.imgUrl
153 158
            if (this.id) {
154 159
              this.modifyTime = parseTime(info.modifyTime).substr(0, 19)

+ 1 - 1
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:deleteFun="deleteFun" v-on:jump="jump" v-on:current="current" v-on:restore="restore"></complex-table>
20
        v-on:deleteFun="deleteFun" :jump="'content'" v-on:current="current" v-on:restore="restore"></complex-table>
21 21
    </div>
22 22
  </div>
23 23
</template>