Browse Source

修正bug

lipengtao 6 years ago
parent
commit
c4faafef27

+ 0 - 2
src/components/searchBar/index.vue

@ -19,9 +19,7 @@ export default {
19 19
    return {
20 20
      platid: process.env.PLAT_ID,
21 21
      input: '',
22
      options4: [],
23 22
      optionsList: [],
24
      comList: [],
25 23
      loading: false
26 24
    }
27 25
  },

+ 57 - 8
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:eventName="expert"></searchTemplate>
24
            <searchTemplate :relevant="relevantInstitutions" v-on:eventName="institution"></searchTemplate>
25
            <searchTemplate :relevant="relevantCompanies" v-on:eventName="company"></searchTemplate>
23
            <searchTemplate :relevant="relevantExperts" v-on:eventName="expert" ref="sear1"></searchTemplate>
24
            <searchTemplate :relevant="relevantInstitutions" v-on:eventName="institution" ref="sear2"></searchTemplate>
25
            <searchTemplate :relevant="relevantCompanies" v-on:eventName="company" ref="sear3"></searchTemplate>
26 26
          </el-col>
27 27
          <el-col :span="12" v-if="ruleForm2.catalog === '1' || ruleForm2.catalog === '2'">
28 28
            <el-form-item style="text-align:right" prop="imgUrl">
@ -54,6 +54,8 @@
54 54
  import UE from '@/components/editorUE'
55 55
  import { parseTime } from '@/utils/index'
56 56
  import { uploadPhotoUrl, publishUrl, draftFirstUrl, draftUrl, draftPublishUrl, deleteUrl, inquireContentUrl } from '@/api/content'
57
  import request from '@/utils/request'
58
  import { kexiuUrl } from '@/utils'
57 59
  export default {
58 60
    data() {
59 61
      var checkTitle = (rule, value, callback) => {
@ -148,18 +150,63 @@
148 150
              cnt: info.cnt,
149 151
              title: info.title,
150 152
              source: info.source,
151
              imgUrl: info.imgUrl,
152
              professors: [],
153
              orgs: [],
154
              comps: []
153
              imgUrl: info.imgUrl
154
            }
155
            if (info.catalog === '1' || info.catalog === '2') {
156
              this.rules2.imgUrl.push({ message: '请上传封面图片', required: true, trigger: 'blur' })
157
            } else {
158
              this.rules2.imgUrl = []
155 159
            }
156 160
            this.UEflag = true
161
            if (info.professor) {
162
              this.ruleForm2.professors = [info.professor]
163
              request.get(kexiuUrl + '/ajax/professor/baseInfo/' + info.professor, {}, (res) => {
164
                if (res.success && res.data) {
165
                  const response = res.data
166
                  let title = response.title || response.office || ''
167
                  const job = response.orgName || ''
168
                  if (title) {
169
                    if (job) {
170
                      title = title + ',' + job
171
                    }
172
                  } else {
173
                    if (job) {
174
                      title = job
175
                    }
176
                  }
177
                  this.$refs.sear1.optionsList = [{ value: response.professor, label: response.name, title: title }]
178
                  this.$refs.sear1.input = response.professor
179
                }
180
              })
181
            }
182
            if (info.org) {
183
              this.ruleForm2.orgs = [info.org]
184
              request.get(kexiuUrl + '/ajax/org/' + info.org, {}, (res) => {
185
                if (res.success && res.data) {
186
                  const response = res.data
187
                  this.$refs.sear2.optionsList = [{ value: response.id, label: response.name }]
188
                  this.$refs.sear2.input = response.id
189
                }
190
              })
191
            }
192
            if (info.comp) {
193
              this.ruleForm2.comps = [info.comp]
194
              this.$http.get('/ajax/company/qo', { id: info.comp }, (res) => {
195
                if (response.success && response.data) {
196
                  const response = res.data
197
                  this.$refs.sear3.optionsList = [{ value: response.id, label: response.name }]
198
                  this.$refs.sear3.input = response.id
199
                }
200
              })
201
            }
157 202
            this.upImgsStr = info.imgUrl
158 203
            if (this.id) {
159 204
              this.modifyTime = parseTime(info.modifyTime).substr(0, 19)
160 205
            }
161 206
          }
162 207
        })
208
      } else {
209
        this.UEflag = true
163 210
      }
164 211
    },
165 212
    components: {
@ -243,7 +290,9 @@
243 290
              this.draftFlag = true
244 291
              if (response.success && response.data) {
245 292
                const info = response.data
246
                this.id = info
293
                if (!this.id) {
294
                  this.id = info
295
                }
247 296
              } else {
248 297
                if (this.id) {
249 298
                  this.$http.get(inquireContentUrl, { id: this.id }, (response) => {

+ 11 - 5
src/views/cooperationAgency/agencySort.vue

@ -18,7 +18,7 @@
18 18
        </el-form-item>
19 19
        <el-form-item :label-width="formLabelWidth" prop="level">
20 20
          <div class='labelBox'>合作机构平台序号</div></span>
21
          <el-input type="level" v-model="form.level" placeholder="最多三位数字" class="conBox" maxlength="3"></el-input>
21
          <el-input type="number" v-model.number="form.level" placeholder="最多三位数字" class="conBox" maxlength="3"></el-input>
22 22
        </el-form-item>
23 23
        <el-form-item class="modiaB">
24 24
          <el-button type="primary" @click="submitForm('form')">确定</el-button>
@ -33,14 +33,20 @@
33 33
    data() {
34 34
      //  校验排序字段
35 35
      const checkAge = (rule, value, callback) => {
36
        const par = /^\d{0,3}$/
36
        const par = /^[0-9]*[1-9][0-9]*$/
37 37
        if (!value) {
38
          return callback()
38
          if (value === 0) {
39
            return callback('填写数字大于0')
40
          }
41
          return callback('请填写数字')
39 42
        } else {
40 43
          if (par.test(value)) {
44
            if (value > 999) {
45
              return callback('请最多填写三位正整数数字')
46
            }
41 47
            return callback()
42 48
          } else {
43
            callback('请填写数字')
49
            callback('请最多填写三位正整数数字')
44 50
          }
45 51
        }
46 52
      }
@ -51,7 +57,7 @@
51 57
        },
52 58
        rules2: {
53 59
          level: [
54
            { validator: checkAge, trigger: 'blur' }
60
            { validator: checkAge, required: true }
55 61
          ]
56 62
        },
57 63
        formLabelWidth: '20px'

+ 11 - 5
src/views/specialExperts/expertSort.vue

@ -18,7 +18,7 @@
18 18
        </el-form-item>
19 19
        <el-form-item :label-width="formLabelWidth" prop="level">
20 20
          <div class='labelBox'>专家平台序号</div></span>
21
          <el-input type="level" v-model="form.level" placeholder="最多三位数字" class="conBox" maxlength="3"></el-input>
21
          <el-input type="number" v-model.number="form.level" placeholder="最多三位数字" class="conBox" min="0" max="999" ></el-input>
22 22
        </el-form-item>
23 23
        <el-form-item class="modiaB">
24 24
          <el-button type="primary" @click="submitForm('form')">确定</el-button>
@ -34,14 +34,20 @@
34 34
    data() {
35 35
      //  校验排序字段
36 36
      const checkAge = (rule, value, callback) => {
37
        const par = /^\d{0,3}$/
37
        const par = /^[0-9]*[1-9][0-9]*$/
38 38
        if (!value) {
39
          return callback()
39
          if (value === 0) {
40
            return callback('填写数字大于0')
41
          }
42
          return callback('请填写数字')
40 43
        } else {
41 44
          if (par.test(value)) {
45
            if (value > 999) {
46
              return callback('请最多填写三位正整数数字')
47
            }
42 48
            return callback()
43 49
          } else {
44
            callback('请填写数字')
50
            callback('请最多填写三位正整数数字')
45 51
          }
46 52
        }
47 53
      }
@ -52,7 +58,7 @@
52 58
        },
53 59
        rules2: {
54 60
          level: [
55
            { validator: checkAge, trigger: 'blur' }
61
            { validator: checkAge, required: true }
56 62
          ]
57 63
        },
58 64
        formLabelWidth: '20px'