Browse Source

修改bug

lipengtao 6 years ago
parent
commit
fe99896502

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

3
    <el-select v-model="input" filterable remote reserve-keyword :placeholder="relevant.placeholder" :remote-method="remoteMethod"
3
    <el-select v-model="input" filterable remote reserve-keyword :placeholder="relevant.placeholder" :remote-method="remoteMethod"
4
      :loading="loading" @change='change(input)'>
4
      :loading="loading" @change='change(input)'>
5
      <el-option v-for="item in optionsList" :key="item.value" :label="item.label" :value="item.value">
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
      </el-option>
7
      </el-option>
7
    </el-select>
8
    </el-select>
8
  </el-form-item>
9
  </el-form-item>
47
              })
48
              })
48
            }
49
            }
49
          })
50
          })
50
        } else {
51
        } else if (that.relevant.prop === 'orgs') {
51
          request.get(kexiuUrl + that.relevant.url, {
52
          request.get(kexiuUrl + that.relevant.url, {
52
            pid: that.platid,
53
            pid: that.platid,
53
            rows: 200
54
            rows: 200
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
      } else {
107
      } else {
67
        that.optionsList = []
108
        that.optionsList = []

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

88
      if (!isLt2M) {
88
      if (!isLt2M) {
89
        this.$message.error('图片大小不能超过2MB,请重新上传')
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
          component: () => import('@/views/contentPub/index'),
102
          component: () => import('@/views/contentPub/index'),
103
          name: 'content',
103
          name: 'content',
104
          redirect: '/content/pubList',
104
          redirect: '/content/pubList',
105
          meta: { title: '内容发布列表' },
105
          meta: { title: '' },
106
          children: [
106
          children: [
107
            {
107
            {
108
              path: 'pubList',
108
              path: 'pubList',
130
          component: () => import('@/views/contentPub/index'),
130
          component: () => import('@/views/contentPub/index'),
131
          name: 'recycle',
131
          name: 'recycle',
132
          redirect: '/recycle/recycleBinList',
132
          redirect: '/recycle/recycleBinList',
133
          meta: { title: '内容回收站列表' },
133
          meta: { title: '' },
134
          children: [
134
          children: [
135
            {
135
            {
136
              path: 'recycleBinList',
136
              path: 'recycleBinList',

+ 1 - 1
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: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
    </div>
18
    </div>
19
  </div>
19
  </div>
20
</template>
20
</template>

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

74
            tit: '发布时间',
74
            tit: '发布时间',
75
            width: '160'
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
            operate: 'edit',
83
            operate: 'edit',
84
            width: '200'
84
            width: '200'
103
        this.publishList()
103
        this.publishList()
104
      },
104
      },
105
      publishList() { //  内容发布中的列表
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
        this.$http.get(pageInquireUrl, this.info, (response) => { //  拉去发布内容信息列表,tableData存每一页的信息
106
        this.$http.get(pageInquireUrl, this.info, (response) => { //  拉去发布内容信息列表,tableData存每一页的信息
121
          if (response.success && response.data) {
107
          if (response.success && response.data) {
122
            const res = response.data
108
            const res = response.data
125
            for (let i = 0; i < epData.length; i++) {
111
            for (let i = 0; i < epData.length; i++) {
126
              epData[i].modifyTime = parseTime(epData[i].modifyTime).substr(0, 16)
112
              epData[i].modifyTime = parseTime(epData[i].modifyTime).substr(0, 16)
127
              epData[i].catalog = type[epData[i].catalog]
113
              epData[i].catalog = type[epData[i].catalog]
128
              Object.assign(epData[i], arr[i])
129
              j++
114
              j++
130
              cacheModule.Judge(epData[i].creator, info => {
115
              cacheModule.Judge(epData[i].creator, info => {
131
                j--
116
                j--

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

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

+ 1 - 1
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: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
    </div>
21
    </div>
22
  </div>
22
  </div>
23
</template>
23
</template>