瀏覽代碼

文章修改setContent,定时器问题,tags弹出关键词

luyanan 6 年之前
父節點
當前提交
15744b8da6

+ 17 - 9
src/components/bench-views/ArticleTemplate.vue

@ -2,7 +2,7 @@
2 2
  <div class="searchList">
3 3
    <ul>
4 4
      <li class="list-item" v-for="(item, index) in dataList" :key="index" @click="kexiuExpert(item.articleId)">
5
        <div class="list-head" :style="{ backgroundImage: 'url('+ imageDis+')'}" ></div>
5
        <div class="list-head" :style="{ backgroundImage: 'url('+ imageDis(item)+')'}" ></div>
6 6
        <div class="list-info">
7 7
          <div class="list-tit">{{item.articleTitle}}</div>
8 8
          <ul class="list-tag" v-if="flag!=1">
@ -60,7 +60,7 @@
60 60
        dataList: [],
61 61
        total: 0,
62 62
        orgDefaultImage: util.defaultSet.img.article,
63
        orgImageAddId: util.ImageUrl('article/', true),
63
        orgImageAddId: util.ImageUrl('article/'),
64 64
        platId: '',
65 65
        addText: '添加',
66 66
        ifDefault: false
@ -72,11 +72,6 @@
72 72
        this.expertList();
73 73
      }
74 74
    },
75
    computed: {
76
      imageDis: function (item) {
77
        return (item.hasOrgLogo) ? this.orgImageAddId + item.articleImg : this.orgDefaultImage;
78
      }
79
    },
80 75
    created() {
81 76
      this.platId = Cookies.get('platId');
82 77
      this.expertParameters = {
@ -95,7 +90,10 @@
95 90
    },
96 91
    methods: {
97 92
      revise(item) {
98
        this.$router.push({ path: '/PublishArticle?arId=' + item.articleId});
93
        this.$router.push({path: '/PublishArticle?arId=' + item.articleId});
94
      },
95
      imageDis: function (item) {
96
        return (item.articleImg) ? this.orgImageAddId + item.articleImg : this.orgDefaultImage;
99 97
      },
100 98
      comTime: util.dateChange,
101 99
      expertList() {
@ -157,7 +155,17 @@
157 155
              aid: id
158 156
          }).then((res) => {
159 157
            if (res.success) {
160
              this.dataList.splice(index, 1);
158
              this.$alert('确认删除该文章', '提示', {
159
                confirmButtonText: '确定',
160
                cancelButtonText: '取消',
161
                type: 'warning',
162
                center: true,
163
                callback: action => {
164
                  if (action === 'confirm') {
165
                    this.dataList.splice(index, 1);
166
                  };
167
                }
168
              });
161 169
            }
162 170
          });
163 171
      },

+ 4 - 6
src/components/bench-views/BusTemplate.vue

@ -1,7 +1,7 @@
1 1
<template>
2 2
  <ul>
3 3
    <li class="list-item" v-for="(item, index) in dataList" :key="index" @click="kexiuExpert(item.id)">
4
      <div class="list-head" :style="{ backgroundImage: 'url('+ imageDis+')'}"></div>
4
      <div class="list-head" :style="{ backgroundImage: 'url('+ imageDis(item)+')'}"></div>
5 5
      <div class="list-info">
6 6
        <div class="list-tit list-tig">
7 7
          {{(item.forShort) ? item.forShort : item.name}}
@ -48,11 +48,6 @@
48 48
        this.expertList();
49 49
      }
50 50
    },
51
    computed: {
52
      imageDis: function (item) {
53
        return (item.hasOrgLogo) ? this.orgImageAddId + item.id + '.jpg' : this.orgDefaultImage;
54
      }
55
    },
56 51
    created() {
57 52
      this.platId = Cookies.get('platId');
58 53
      this.expertParameters = {
@ -66,6 +61,9 @@
66 61
      this.expertList();
67 62
    },
68 63
    methods: {
64
      imageDis: function (item) {
65
        return (item.hasOrgLogo) ? this.orgImageAddId + item.id + '.jpg' : this.orgDefaultImage;
66
      },
69 67
      expertList() {
70 68
        this.dataList = [];
71 69
        this.$axios.get(util.ekexiuUrl + this.url, {

+ 23 - 30
src/components/bench-views/contentManagement/PublishArticle.vue

@ -1,7 +1,7 @@
1 1
<template>
2 2
  <div class="publishArticle block-wrapper main-content">
3 3
    <div class="wrapper-left content-wrapper">
4
      <el-form :model="ruleForm" :rules="rules" ref="ruleForm" class="form-main">
4
      <el-form :model="ruleFormArt" :rules="rules" ref="ruleFormArt" class="form-main">
5 5
        <el-form-item class="upload-fa">
6 6
          <div class="update-rw">
7 7
            <div class="up">
@ -16,38 +16,36 @@
16 16
            ref="uploadLogo"
17 17
            :on-success="handleAvatarSuccess"
18 18
            :before-upload="beforeAvatarUpload" prop="imageUrl">
19
            <div v-if="ruleForm.imageUrl" :style="{backgroundImage: 'url(' + ruleForm.imageUrl + ')'}" class="avatar"></div>
19
            <div v-if="ruleFormArt.imageUrl" :style="{backgroundImage: 'url(' + ruleFormArt.imageUrl + ')'}" class="avatar"></div>
20 20
            <i v-else class="el-icon-plus avatar-uploader-icon"></i>
21 21
          </el-upload>
22 22
        </el-form-item>
23 23
        <input type="hidden" v-model="articleId">
24 24
        <el-form-item label="文章标题" prop="artTit">
25
          <el-input v-model="ruleForm.artTit" placeholder="请填写文章标题"></el-input>
25
          <el-input v-model="ruleFormArt.artTit" placeholder="请填写文章标题"></el-input>
26 26
        </el-form-item>
27
        <dynamicTags :tagInfo="tagInfo" :industry="ruleForm.industry" ref="subjectTags" v-on:turnTags="turnTags($event)" :dy="dy" :dynamicTagsLength="5"></dynamicTags>
27
        <dynamicTags :tagInfo="tagInfo" :dyStr="ruleFormArt.industry" v-on:turnTags="turnTags($event)" :dynamicTagsLength="5"></dynamicTags>
28 28
        <el-form-item label="文章正文">
29
          <!-- <el-input type="textarea" :rows="4" v-model="ruleForm.artDesc" placeholder="
30
  请填写详细描述"></el-input> -->
31
          <UE :id="artUe" :text="ruleForm.artDesc" ref="ueBox"></UE>
29
          <UE :id="artUe" :contentText="ruleFormArt.artDesc" ref="ueBox"></UE>
32 30
        </el-form-item>
33 31
        <el-form-item></el-form-item>
34 32
      </el-form>
35 33
    </div>
36 34
    <div class="wrapper-right">
37 35
      <el-row class="content-wrapper operate-box">
38
        <el-col :span="8" @click.native="articleAdd('ruleForm')">
36
        <el-col :span="8" @click.native="articleAdd('ruleFormArt')">
39 37
          <em class="operateicon icon-issue"></em>
40 38
          <p style="color:#28b8fa">发布</p>
41 39
        </el-col>
42
        <el-col :span="8" @click.native="clickTiming('ruleForm')">
40
        <el-col :span="8" @click.native="clickTiming('ruleFormArt')">
43 41
          <em class="operateicon icon-timeissue"></em>
44 42
          <p>定时发布</p>
45 43
        </el-col>
46
        <el-col :span="8" @click.native="articleDraft('ruleForm', 2)">
44
        <el-col :span="8" @click.native="articleDraft('ruleFormArt', 2)">
47 45
          <em class="operateicon icon-preview"></em>
48 46
          <p>预览</p>
49 47
        </el-col>
50
        <el-col :span="8" @click.native="articleDraft('ruleForm', 1)">
48
        <el-col :span="8" @click.native="articleDraft('ruleFormArt', 1)">
51 49
          <em class="operateicon icon-draft"></em>
52 50
          <p>存草稿</p>
53 51
        </el-col>
@ -95,9 +93,7 @@
95 93
  export default {
96 94
    data() {
97 95
      return {
98
        dy:'',
99 96
        plf_user: '',
100
        platSource: '',
101 97
        tagInfo: {
102 98
          lableTit: '关键词',
103 99
          placeholder: '请填写相关的关键词,如:腐蚀防护、石墨烯、纳米材料'
@ -107,7 +103,7 @@
107 103
        articleId: '',
108 104
        timingDate: '',
109 105
        defaultTime: new Date().toISOString(),
110
        ruleForm: {
106
        ruleFormArt: {
111 107
          artTit: '',
112 108
          artDesc: '',
113 109
          industry: '',
@ -129,9 +125,7 @@
129 125
        this.getArticle();
130 126
      }
131 127
      this.plf_user = Cookies.get('plf_user');
132
      this.platSource = Cookies.get('platSource');
133 128
      this.ifDelete = true;
134
      // this.$refs.subjectTags
135 129
    },
136 130
    computed: {
137 131
      placeTime: function() {
@ -147,26 +141,25 @@
147 141
          }
148 142
        }).then((res) => {
149 143
          if (res.success) {
150
            this.ruleForm.artTit = res.data.articleTitle;
151
            this.ruleForm.imageUrl = util.ImageUrl('article/' + res.data.articleImg, false);
152
            this.ruleForm.industry = res.data.subject;
153
            this.dy = res.data.subject;
154
            this.$refs.ueBox.setUEContent(res.data.articleContent);
144
            this.ruleFormArt.artTit = res.data.articleTitle;
145
            this.ruleFormArt.imageUrl = util.ImageUrl('article/' + res.data.articleImg, false);
146
            this.ruleFormArt.industry = res.data.subject;
147
            this.ruleFormArt.artDesc = res.data.articleContent;
155 148
          }
156 149
        });
157 150
      },
158 151
      turnTags(msg) {
159
        this.ruleForm.industry = msg;
152
        this.ruleFormArt.industry = msg;
160 153
      },
161 154
      getDataParams(publishTime) {
162
        this.ruleForm.artDesc = this.$refs.ueBox.getUEContent(); // 调用子组件方法
155
        this.ruleFormArt.artDesc = this.$refs.ueBox.getUEContent(); // 调用子组件方法
163 156
        let $data = {};
164 157
        $data.ownerId = this.plf_user;
165 158
        $data.articleType = '3';
166
        $data.articleTitle = this.ruleForm.artTit;
167
        $data.articleContent = this.ruleForm.artDesc;
168
        $data.subject = this.ruleForm.industry;
169
        $data.articleImg = this.ruleForm.imgName;
159
        $data.articleTitle = this.ruleFormArt.artTit;
160
        $data.articleContent = this.ruleFormArt.artDesc;
161
        $data.subject = this.ruleFormArt.industry;
162
        $data.articleImg = this.ruleFormArt.imgName;
170 163
        $data.colNum = '7';
171 164
        if (this.articleId) {
172 165
          $data.articleId = this.articleId;
@ -177,7 +170,7 @@
177 170
        return $data;
178 171
      },
179 172
      validImgIfVoid() { // 判断图片是否上传
180
        if (!this.ruleForm.imageUrl) {
173
        if (!this.ruleFormArt.imageUrl) {
181 174
          this.$alert('请上传文章封面图片', '提示', {
182 175
            confirmButtonText: '确定',
183 176
            type: 'warning',
@ -315,8 +308,8 @@
315 308
      },
316 309
      // upload img
317 310
      handleAvatarSuccess(res, file) {
318
        this.ruleForm.imageUrl = URL.createObjectURL(file.raw);
319
        this.ruleForm.imgName = res.data[0].cacheKey;
311
        this.ruleFormArt.imageUrl = URL.createObjectURL(file.raw);
312
        this.ruleFormArt.imgName = res.data[0].cacheKey;
320 313
      },
321 314
      beforeAvatarUpload(file) {
322 315
        const isJPG = file.type === 'image/jpeg';

+ 7 - 23
src/components/bench-views/contentManagement/editorUE.vue

@ -4,10 +4,6 @@
4 4
  </div>
5 5
</template>
6 6
<script type="text/ecmascript-6">
7
  // import '../../../../static/ueditor/ueditor.config.js';
8
  // import '../../../../static/ueditor/ueditor.all.js';
9
  // import '../../../../static/ueditor/lang/zh-cn/zh-cn.js';
10
  // import '../../../../static/ueditor/ueditor.parse.js';
11 7
  import httpUrl from '@/libs/http';
12 8
13 9
  export default {
@ -16,7 +12,7 @@
16 12
      id: {
17 13
        type: String
18 14
      },
19
      text: {
15
      contentText: {
20 16
        type: String
21 17
      }
22 18
    },
@ -34,31 +30,19 @@
34 30
        serverUrl: httpUrl.kxQurey.editor,
35 31
        UEDITOR_HOME_URL: '/static/ueditor/' // 这个是静态资源的路径
36 32
      }); // 初始化UE
37
      this.editor.addListener('ready', function () {
38
        self.editor.setContent(''); // 确保UE加载完成后放入内容
33
      this.editor.addListener('ready', function () { // 确保UE加载完成后放入内容
34
        if (self.contentText) {
35
          self.editor.setContent(self.contentText);
36
        } else {
37
          self.editor.setContent('');
38
        }
39 39
      });
40
      console.log(this.text);
41 40
    },
42 41
    methods: {
43 42
      getUEContent() { // 获取内容方法
44 43
        return this.editor.getContent();
45
      },
46
      setUEContent(uhtml) { // 获取内容方法
47
        var self = this;
48
        this.editor.addListener('ready', function () {
49
          self.editor.setContent(uhtml); // 确保UE加载完成后放入内容
50
        });
51
      },
52
      testMsg() {
53
        const self = this;
54
        this.defaultMsg = this.text;
55
        console.log(this.defaultMsg);
56
        this.editor.setContent(self.defaultMsg); // 确保UE加载完成后放入内容
57 44
      }
58 45
    },
59
    watch: {
60
      'text': 'testMsg'
61
    },
62 46
    destroyed() {
63 47
      this.editor.destroy();
64 48
    }

+ 1 - 2
src/components/form-views/AccountSettings.vue

@ -102,7 +102,7 @@
102 102
      passxiu() {
103 103
        this.$router.push({ path: '/AccountSettings' });
104 104
      },
105
      mailUp(){
105
      mailUp() {
106 106
        this.$router.push({ path: '/BindAccount' });
107 107
      },
108 108
      open() {
@ -169,5 +169,4 @@
169 169
        margin-top: 0px
170 170
        border-top: none
171 171

172
    
173 172
</style>

+ 32 - 56
src/components/form-views/BindAccount.vue

@ -47,6 +47,7 @@
47 47
<script>
48 48
  import Cookies from 'js-cookie';
49 49
  import util from '@/libs/util';
50
  import httpUrl from '@/libs/http';
50 51
  export default {
51 52
    data() {
52 53
      return {
@ -62,68 +63,43 @@
62 63
      passxiu() {
63 64
        this.$router.push({ path: '/AccountSettings' });
64 65
      },
65
      mailUp(){
66
      mailUp() {
66 67
        this.$router.push({ path: '/BindAccount' });
67 68
      },
68 69
      loginMail() {
69
        var hash = {
70
              'qq.com': 'http://mail.qq.com',
71
              'gmail.com': 'http://mail.google.com',
72
              'sina.com': 'http://mail.sina.com.cn',
73
              '163.com': 'http://mail.163.com',
74
              '126.com': 'http://mail.126.com',
75
              'yeah.net': 'http://www.yeah.net/',
76
              'sohu.com': 'http://mail.sohu.com/',
77
              'tom.com': 'http://mail.tom.com/',
78
              'sogou.com': 'http://mail.sogou.com/',
79
              '139.com': 'http://mail.10086.cn/',
80
              'hotmail.com': 'http://www.hotmail.com',
81
              'live.com': 'http://login.live.com/',
82
              'live.cn': 'http://login.live.cn/',
83
              'live.com.cn': 'http://login.live.com.cn',
84
              '189.com': 'http://webmail16.189.cn/webmail/',
85
              'yahoo.com.cn': 'http://mail.cn.yahoo.com/',
86
              'yahoo.cn': 'http://mail.cn.yahoo.com/',
87
              'eyou.com': 'http://www.eyou.com/',
88
              '21cn.com': 'http://mail.21cn.com/',
89
              '188.com': 'http://www.188.com/',
90
              'ustb.edu.cn': 'http://mail.ustb.edu.cn/',
91
              'foxmail.coom': 'http://www.foxmail.com'
92
            };
93
            var url = this.emailName.split('@')[1];
94
            if (hash[url] === undefined) {
95
              location.href = 'http://mail.' + url;
96
            } else {
97
              location.href = hash[url];
98
            }
70
        var url = this.emailName.split('@')[1];
71
        if (util.mailHash[url] === undefined) {
72
          location.href = 'http://mail.' + url;
73
        } else {
74
          location.href = util.mailHash[url];
75
        }
99 76
      },
100 77
      cblur(ar) {
101
        var gunf = /^([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/;
102
        if (gunf.test(this.emailName.trim())) {
103
          this.$axios.get(util.ekexiuUrl + '/ajax/platform/checkEmail', {
104
                    params: {
105
                      email: this.emailName
106
                    }
107
                  }).then((res) => {
108
                    if (res.success) {
109
                      if (res.data === false) {
110
                          this.titler = '该邮箱已绑定账户,请使用其他邮箱';
111
                      } else {
112
                            if (ar === 1) {
113
                              this.dialogFormVisible = false;
114
                              this.$axios.post(util.ekexiuUrl + '/ajax/platform/reqBindMail', {
115
                                  id: this.platId,
116
                                  mail: this.emailName,
117
                                  url: 'http://localhost:7070/upMail?sc'
118
                              }).then((res) => {
119
                                if (res.success) {
120
                                  this.dias = true;
121
                                }
122
                              });
123
                            }
124
                      }
78
        if (util.regular(this.emailName.trim(), 'mail')) {
79
          this.$axios.get(httpUrl.platUrl + '/ajax/platform/checkEmail', {
80
            params: {
81
              email: this.emailName
82
            }
83
          }).then((res) => {
84
            if (res.success) {
85
              if (res.data === false) {
86
                  this.titler = '该邮箱已绑定账户,请使用其他邮箱';
87
              } else {
88
                    if (ar === 1) {
89
                      this.dialogFormVisible = false;
90
                      this.$axios.post(httpUrl.platUrl + '/ajax/platform/reqBindMail', {
91
                          id: this.platId,
92
                          mail: this.emailName,
93
                          url: 'http://localhost:7070/upMail?sc'
94
                      }).then((res) => {
95
                        if (res.success) {
96
                          this.dias = true;
97
                        }
98
                      });
125 99
                    }
126
                  });
100
              }
101
            }
102
          });
127 103
        } else {
128 104
           this.titler = '请输入正确的邮箱地址。';
129 105
        }

+ 17 - 18
src/components/form-views/DemandIssue.vue

@ -77,7 +77,11 @@
77 77
      <el-col :span="12">
78 78
        <el-form-item label="短信验证码" prop="msgVerifyCode">
79 79
          <el-input v-model="ruleFormDem.msgVerifyCode" placeholder="请输入短信验证码" class="shortW">
80
          <el-button slot="append" :disabled="phoneCodeBol" @click="getPhoneCode">{{phoneCodeBtn}}</el-button></el-input>
80
            <el-button slot="append" :disabled="phoneCodeBol" @click="getPhoneCode">
81
              <span v-if="sendMsgDisabled">{{seconds + '秒后获取'}}</span>
82
              <span v-if="!sendMsgDisabled">获取短信验证码</span>
83
            </el-button>
84
          </el-input>
81 85
        </el-form-item>
82 86
      </el-col>
83 87
      <el-col :span="24" ><el-form-item style="height:20px"></el-form-item></el-col>
@ -118,7 +122,8 @@
118 122
        kexiuLink: util.ekexiuUrl,
119 123
        platSource: '',
120 124
        phoneCodeBol: false,
121
        phoneCodeBtn: '获取短信验证码',
125
        sendMsgDisabled: false,
126
        seconds: 60,
122 127
        phoneResBack: '',
123 128
        imgVcUrl: httpUrl.kxQurey.sign.imgVC,
124 129
        optionsCity: provinceAndCityData,
@ -202,22 +207,16 @@
202 207
        }
203 208
      },
204 209
      clickMsgVc() {
205
        this.phoneCodeBtn = '60s后重新获取';
206
        this.phoneCodeBol = true;
207
        var clickTime = new Date().getTime();
208
        var Timer = setInterval(function() {
209
          var nowTime = new Date().getTime();
210
          var second = Math.ceil(60 - (nowTime - clickTime) / 1000);
211
          if (second > 0) {
212
            this.phoneCodeBtn = second + 's后重新获取';
213
            if (second === 1) {
214
              this.imgVcUrl = httpUrl.kxQurey.sign.imgVC + '?' + new Date().getTime();
215
            }
216
          } else {
217
            clearInterval(Timer);
218
            this.phoneCodeBtn = '获取短信验证码';
219
            this.phoneCodeBol = false;
220
          }
210
        let me = this;
211
        me.sendMsgDisabled = true;
212
        me.phoneCodeBol = true;
213
        let interval = window.setInterval(function() {
214
         if ((me.seconds--) <= 0) {
215
          me.seconds = 60;
216
          me.sendMsgDisabled = false;
217
          me.phoneCodeBol = false;
218
          window.clearInterval(interval);
219
         }
221 220
        }, 1000);
222 221
      },
223 222
      changeImgVc() {

+ 18 - 19
src/components/form-views/DemandIssueLogin.vue

@ -7,7 +7,11 @@
7 7
        </el-form-item>
8 8
        <el-form-item prop="msgVC">
9 9
          <el-input v-model="ruleLogin.msgVC" placeholder="请输入短信验证码" class="shortW">
10
          <el-button slot="append" :disabled="phoneCodeBolLogin" @click="clickMsgVcLogin">{{phoneCodeBtnLogin}}</el-button></el-input>
10
            <el-button slot="append" :disabled="phoneCodeBol" @click="clickMsgVcLogin">
11
              <span v-if="sendMsgDisabled">{{seconds + '秒后获取'}}</span>
12
              <span v-if="!sendMsgDisabled">获取短信验证码</span>
13
            </el-button>
14
         </el-input>
11 15
        </el-form-item>
12 16
        <el-form-item></el-form-item>
13 17
        <el-form-item>
@ -119,13 +123,11 @@
119 123
        ifLogin: true,
120 124
        kxUserId: '',
121 125
        phoneResBackLogin: '',
122
        phoneCodeBtnLogin: '获取短信验证码',
123
        phoneCodeBolLogin: false,
126
        phoneCodeBol: false,
127
        sendMsgDisabled: false,
128
        seconds: 60,
124 129
        kexiuLink: util.ekexiuUrl,
125 130
        platSource: '',
126
        phoneCodeBol: false,
127
        phoneCodeBtn: '获取短信验证码',
128
        phoneResBack: '',
129 131
        imgVcUrl: httpUrl.kxQurey.sign.imgVC,
130 132
        optionsCity: provinceAndCityData,
131 133
        selectCostRange: '',
@ -252,19 +254,16 @@
252 254
          });
253 255
        } else {
254 256
          this.userRegisterOk();
255
          this.phoneCodeBtnLogin = '60s后重新获取';
256
          this.phoneCodeBolLogin = true;
257
          var clickTime = new Date().getTime();
258
          var Timer = setInterval(function() {
259
            var nowTime = new Date().getTime();
260
            var second = Math.ceil(60 - (nowTime - clickTime) / 1000);
261
            if (second > 0) {
262
              this.phoneCodeBtnLogin = second + 's后重新获取';
263
            } else {
264
              clearInterval(Timer);
265
              this.phoneCodeBtnLogin = '获取短信验证码';
266
              this.phoneCodeBolLogin = false;
267
            }
257
          let me = this;
258
          me.sendMsgDisabled = true;
259
          me.phoneCodeBol = true;
260
          let interval = window.setInterval(function() {
261
           if ((me.seconds--) <= 0) {
262
            me.seconds = 60;
263
            me.sendMsgDisabled = false;
264
            me.phoneCodeBol = false;
265
            window.clearInterval(interval);
266
           }
268 267
          }, 1000);
269 268
          this.getPhoneLogin();
270 269
        };

+ 13 - 21
src/components/form-views/UpdateInfo.vue

@ -40,27 +40,7 @@
40 40
          <el-form-item label="官方网址" prop="website">
41 41
            <el-input v-model="ruleFormUpdate.website" placeholder="如:www.ekexiu.com"></el-input>
42 42
          </el-form-item>
43
          <el-form-item label="面向行业" prop="industry">
44
            <el-tag
45
              :key="tag"
46
              v-for="tag in dynamicTags"
47
              closable
48
              :disable-transitions="false"
49
              @close="handleClose(tag)">
50
              {{tag}}
51
            </el-tag>
52
            <el-input
53
              class="input-new-tag"
54
              v-if="inputVisible"
55
              v-model="inputValue"
56
              ref="saveTagInput"
57
              size="small"
58
              @keyup.enter.native="handleInputConfirm"
59
              @blur="handleInputConfirm"
60
            >
61
            </el-input>
62
            <el-button v-else class="button-new-tag" v-show="isShowAdd" size="small" @click="showInput">+ 请填写园区面向的行业,如:互联网/智能制造/新材料</el-button>
63
          </el-form-item>
43
          <dynamicTags :tagInfo="tagInfo" :dyStr="ruleFormUpdate.industry" v-on:turnTags="turnTags($event)" :dynamicTagsLength="10"></dynamicTags>
64 44
          <el-form-item label="平台介绍" prop="desc">
65 45
            <el-input type="textarea" :rows="8" v-model="ruleFormUpdate.desc" placeholder="请填写一个简单的介绍,让大家更好地了解平台"></el-input>
66 46
          </el-form-item>
@ -87,6 +67,8 @@
87 67
  import util from '@/libs/util';
88 68
  import httpUrl from '@/libs/http';
89 69
70
  import dynamicTags from '../sub-component/DynamicTags';
71
90 72
  export default {
91 73
    props: {
92 74
      plat: {
@ -95,6 +77,10 @@
95 77
    },
96 78
    data() {
97 79
      return {
80
        tagInfo: {
81
          lableTit: '面向行业',
82
          placeholder: '请填写园区面向的行业,如:互联网/智能制造/新材料'
83
        },
98 84
        plf_user: '',
99 85
        plf_name: '',
100 86
        imageUrl: '', // 临时地址
@ -149,6 +135,9 @@
149 135
      this.getPlatInfo(this.plf_user);
150 136
    },
151 137
    methods: {
138
      turnTags(msg) {
139
        this.ruleFormUpdate.industry = msg;
140
      },
152 141
      getPlatInfo(id) {
153 142
        this.$axios.get(httpUrl.hQuery.baseInfo.query, {
154 143
          params: {
@ -268,6 +257,9 @@
268 257
        this.inputValue = '';
269 258
      }
270 259
      // add tag
260
    },
261
    components: {
262
      dynamicTags
271 263
    }
272 264
  };
273 265
</script>

+ 1 - 1
src/components/main-views/TheFooter.vue

@ -48,7 +48,7 @@
48 48
        this.plf_user = Cookies.get('plf_user');
49 49
      },
50 50
      goWorkBench() {
51
        if (this.plf_user && this.plf_user != "null" && this.plf_user != null) {
51
        if (this.plf_user && this.plf_user !== 'null' && this.plf_user !== null) {
52 52
          this.$router.push({path: '/WorkHome'});
53 53
        } else {
54 54
          this.$router.push({path: '/loginPlat'});

+ 1 - 1
src/components/main-views/ViewFindResource.vue

@ -16,7 +16,7 @@
16 16
        </div> -->
17 17
        <div class="tab-contain">
18 18
          <div v-show="!ifDefault">
19
            <baseResource v-if="platResources.length" v-for="item in platResources" :key="item.index" :itemResources="item"></baseResource>
19
            <baseResource v-if="platResources.length" v-for="item in platResources" :key="item.index" :itemSingle="item"></baseResource>
20 20
            <Loading v-show="loadingModalShow" :loadingComplete="loadingComplete" :isLoading="isLoading" v-on:upup="searchLower"></Loading>
21 21
          </div>
22 22
          <defaultPage v-show="ifDefault"></defaultPage>

+ 1 - 1
src/components/main-views/ViewFindServe.vue

@ -16,7 +16,7 @@
16 16
				</div> -->
17 17
				<div class="tab-contain">
18 18
          <div v-show="!ifDefault">
19
            <baseService v-if="platServices.length" v-for="item in platServices" :key="item.index" :itemServices="item"></baseService>
19
            <baseService v-if="platServices.length" v-for="item in platServices" :key="item.index" :itemSingle="item"></baseService>
20 20
            <Loading v-show="loadingModalShow" :loadingComplete="loadingComplete" :isLoading="isLoading" v-on:upup="searchLower"></Loading>
21 21
          </div>
22 22
          <defaultPage v-show="ifDefault"></defaultPage>

+ 52 - 4
src/components/main-views/ViewHome.vue

@ -66,7 +66,7 @@
66 66
              <li v-for="item in orgTrends" :key="item.index">
67 67
                <a :href="linkArticle(item)">
68 68
                  <span class="topic">{{item.articleTitle}}</span>
69
                  <span class="owner">北京科技大学北京科技大学</span>
69
                  <span class="owner">{{item.ownerName}}</span>
70 70
                  <span class="time">{{formTime(item)}}</span>
71 71
                </a>
72 72
              </li>
@ -126,7 +126,7 @@
126 126
                <div class="item-text">
127 127
                  <p class="title">{{item.name}}</p>
128 128
                  <p class="desc">{{item.cnt}}</p>
129
                  <p class="owner">北京科袖科技有限公司北京科袖科技有限公司有限公司有限公司</p>
129
                  <p class="owner">{{item.ownerName}}</p>
130 130
                </div>
131 131
              </div>
132 132
            </a>
@ -160,7 +160,7 @@
160 160
                <div class="item-text">
161 161
                  <p class="title">{{item.name}}</p>
162 162
                  <p class="desc">{{item.cnt}}</p>
163
                  <p class="owner">北京科袖科技</p>
163
                  <p class="owner">{{item.ownerName}}</p>
164 164
                </div>
165 165
              </div>
166 166
            </a>
@ -307,7 +307,14 @@
307 307
          }
308 308
        }).then((res) => {
309 309
          if (res.success) {
310
            var _this = this;
310 311
            var $info = res.data;
312
            console.log(res);
313
            for (let i = 0; i < $info.length; i++) {
314
              (function(m) {
315
                _this.ownerByond($info[m], true);
316
              }(i));
317
            };
311 318
            this.orgTrends = $info;
312 319
          };
313 320
        });
@ -319,7 +326,6 @@
319 326
            rows: this.rows
320 327
          }
321 328
        }).then((res) => {
322
          console.log(res);
323 329
          if (res.success) {
324 330
            var $info = res.data;
325 331
            this.residentOrgs = $info;
@ -333,9 +339,15 @@
333 339
            rows: this.rows
334 340
          }
335 341
        }).then((res) => {
342
          var _this = this;
336 343
          console.log(res);
337 344
          if (res.success) {
338 345
            var $info = res.data;
346
            for (let i = 0; i < $info.length; i++) {
347
              (function(m) {
348
                _this.ownerByond($info[m]);
349
              }(i));
350
            };
339 351
            this.platResources = $info;
340 352
          };
341 353
        });
@ -347,9 +359,15 @@
347 359
            rows: this.rows
348 360
          }
349 361
        }).then((res) => {
362
          var _this = this;
350 363
          console.log(res);
351 364
          if (res.success) {
352 365
            var $info = res.data;
366
            for (let i = 0; i < $info.length; i++) {
367
              (function(m) {
368
                _this.ownerByond($info[m]);
369
              }(i));
370
            };
353 371
            this.platWares = $info;
354 372
          };
355 373
        });
@ -410,6 +428,36 @@
410 428
            type: 'warning'
411 429
          });
412 430
        }
431
      },
432
      ownerByond(item, flag) {
433
        var _this = this;
434
        var type, id;
435
        if (flag) {
436
          type = item.articleType;
437
          id = item.ownerId;
438
        } else {
439
          type = item.otype;
440
          id = item.oid;
441
        };
442
        if (type === '1') {
443
          _this.$axios.get(httpUrl.kxQurey.professor.query + id, {
444
            }).then((res) => {
445
            if (res.success) {
446
              let $info = res.data;
447
              item.ownerName = $info.name;
448
              _this.$forceUpdate();
449
            }
450
          });
451
        } else if (type === '2') {
452
          _this.$axios.get(httpUrl.kxQurey.org.query + id, {
453
            }).then((res) => {
454
            if (res.success) {
455
              let $info = res.data;
456
              item.ownerName = $info.forShort ? $info.forShort : $info.name;
457
              _this.$forceUpdate();
458
            }
459
          });
460
        }
413 461
      }
414 462
    },
415 463
    components: {

+ 2 - 2
src/components/main-views/ViewPlatTrendNews.vue

@ -1,6 +1,6 @@
1 1
<template>
2 2
	<div class="tab-contain">
3
		<baseArticle v-for="item in paltNews" :key="item.index" :itemInfo="item"></baseArticle>
3
		<baseArticle v-for="item in paltNews" :key="item.index" :itemSingle="item" :showOwner="false"></baseArticle>
4 4
		<Loading v-show="loadingModalShow" :loadingComplete="loadingComplete" :isLoading="isLoading" v-on:upup="loadLower"></Loading>
5 5
	</div>
6 6
</template>
@ -20,7 +20,7 @@
20 20
          bId: '',
21 21
          bTime: ''
22 22
        },
23
        paltNews: '',
23
        paltNews: [],
24 24
        loadingModalShow: true, // 是否显示按钮
25 25
        loadingComplete: false, // 是否全部加载
26 26
        isFormSearch: false, // 数据加载

+ 3 - 3
src/components/main-views/ViewPlatTrendTrends.vue

@ -1,6 +1,6 @@
1 1
<template>
2 2
	<div class="tab-contain">
3
		<baseArticle v-for="item in orgTrends" :key="item.index" :itemInfo="item"></baseArticle>
3
		<baseArticle v-for="item in orgTrends" :key="item.index" :itemSingle="item" :showOwner="true"></baseArticle>
4 4
		<Loading v-show="loadingModalShow" :loadingComplete="loadingComplete" :isLoading="isLoading" v-on:upup="loadLower"></Loading>
5 5
	</div>
6 6
</template>
@ -28,8 +28,8 @@
28 28
      };
29 29
    },
30 30
    created() {
31
       this.platId = Cookies.get('platId');
32
       this.queryOrgTrends();
31
      this.platId = Cookies.get('platId');
32
      this.queryOrgTrends();
33 33
    },
34 34
    methods: {
35 35
      queryOrgTrends(id) {

+ 53 - 24
src/components/sub-component/BaseArticle.vue

@ -1,14 +1,14 @@
1 1
<template>
2
  <a class="list-item" :href="linkArticle(itemInfo)">
3
    <div class="list-head" :style="{backgroundImage: 'url(' + articleUrl(itemInfo) + ')'}"></div>
2
  <a class="list-item" :href="linkway">
3
    <div class="list-head" :style="{backgroundImage: 'url(' + imgUrl + ')'}"></div>
4 4
    <div class="list-info">
5
      <div class="list-tit">{{itemInfo.articleTitle}}</div>
5
      <div class="list-tit">{{itemSingle.articleTitle}}</div>
6 6
      <ul class="list-tag">
7
        <li>发布者</li>
8
        <li>{{formTime(itemInfo)}}</li>
9
        <li>阅读量 1000</li>
10
        <li>赞 99</li>
11
        <li>留言 109</li>
7
        <li v-if="showOwner">{{ownerName}}</li>
8
        <li>{{formTime}}</li>
9
        <li v-if="itemSingle.pageViews>0">阅读量 {{itemSingle.pageViews}}</li>
10
        <li v-if="itemSingle.articleAgree>0">赞 {{itemSingle.articleAgree}}</li>
11
        <li v-if="leverNumber>0">留言 {{leverNumber}}</li>
12 12
      </ul>
13 13
    </div>
14 14
  </a>
@ -16,30 +16,59 @@
16 16
17 17
<script type="text/ecmascript-6">
18 18
  import util from '@/libs/util';
19
  import httpUrl from '@/libs/http';
19 20
20 21
  export default {
21 22
    props: {
22
      itemInfo: {
23
      itemSingle: {
23 24
        type: Object
25
      },
26
      showOwner: {
27
        type: Boolean
24 28
      }
25 29
    },
26
    // data() {
27
    //   return: {
28
    //     ownerInfo: util.ownerInfo(this, item.articleType, item.owmerId)
29
    //   };
30
    // },
30
    data() {
31
      return {
32
        linkway: util.pageUrl('a', this.itemSingle),
33
        imgUrl: this.itemSingle.articleImg ? util.ImageUrl('article/' + this.itemSingle.articleImg) : util.defaultSet.img.article,
34
        formTime: util.commenTime(this.itemSingle.publishTime),
35
        ownerName: '',
36
        leverNumber: ''
37
      };
38
    },
39
    created() {
40
      if (this.showOwner) {
41
        this.ownerByond(this.itemSingle);
42
      };
43
      this.leaveWordTotal(this.itemSingle);
44
    },
31 45
    methods: {
32
      articleUrl(item) {
33
        return item.articleImg ? util.ImageUrl('article/' + item.articleImg) : util.defaultSet.img.article;
34
      },
35
      linkArticle(item) {
36
        return util.pageUrl('a', item);
46
      leaveWordTotal(item) {
47
        var _this = this;
48
         this.$axios.get(httpUrl.kxQurey.leaveMsg.count, {
49
          params: {
50
            sid: item.articleId,
51
            stype: 1
52
          }
53
        }).then((res) => {
54
          if (res.success) {
55
            _this.leverNumber = res.data;
56
            _this.$forceUpdate();
57
          }
58
        });
37 59
      },
38
      // ownerBeyond(item) {
39
      //   return util.ownerInfo(this, item.articleType, item.owmerId);
40
      // },
41
      formTime(item) {
42
        return util.commenTime(item.publishTime);
60
      ownerByond(item) {
61
        var _this = this;
62
        if (item.articleType) {
63
          this.$axios.get(httpUrl.kxQurey.org.query + item.ownerId, {
64
            }).then((res) => {
65
            if (res.success) {
66
              let $info = res.data;
67
              _this.ownerName = $info.forShort ? $info.forShort : $info.name;
68
              _this.$forceUpdate();
69
            }
70
          });
71
        };
43 72
      }
44 73
    }
45 74
  };

+ 46 - 12
src/components/sub-component/BaseExpert.vue

@ -4,11 +4,8 @@
4 4
      <div class="show-head" :style="{backgroundImage:'url('+ headUrl(item) +')'}"></div>
5 5
      <div class="show-info">
6 6
        <div class="info-tit">{{item.name}}<em class="authicon" :class="headIcon(item)"></em></div>
7
        <div class="info-tag">职称/职位,所在机构</div>
8
        <div class="info-desc">
9
10
研究方向:研究方向A;研究方向B;研究方向C;研究方向A;研究方向B;研究方向C;研究方...
11
</div>
7
        <div class="info-tag">{{item.offt}}</div>
8
        <div class="info-desc" v-if="item.reserachs">研究方向:{{item.reserachs}}</div>
12 9
      </div>
13 10
    </a>
14 11
  </div>
@ -52,13 +49,50 @@
52 49
        }).then((res) => {
53 50
          console.log(res);
54 51
          if (res.success) {
55
            var $info = res.data;
56
            if ($info.length > 0) {
57
              this.dataO.bUid = $info[$info.length - 1].id;
58
              this.dataO.bTime = $info[$info.length - 1].buttedTime;
59
              this.userData = $info;
60
            };
61
            if ($info.length < this.rows) {
52
            var $data = res.data;
53
            if ($data.length > 0) {
54
              this.dataO.bUid = $data[$data.length - 1].id;
55
              this.dataO.bTime = $data[$data.length - 1].buttedTime;
56
              for (let i = 0; i < $data.length; i++) {
57
                if ($data[i].title) {
58
                  if ($data[i].orgName) {
59
                    $data[i].offt = $data[i].title + ',' + $data[i].orgName;
60
                  } else {
61
                    $data[i].offt = $data[i].title;
62
                  }
63
                } else {
64
                  if ($data[i].office) {
65
                    if ($data[i].orgName) {
66
                      $data[i].offt = $data[i].office + ',' + $data[i].orgName;
67
                    } else {
68
                      $data[i].offt = $data[i].office;
69
                    }
70
                  } else {
71
                    $data[i].offt = '';
72
                  }
73
                }
74
                $data[i].className = util.autho($data[i].authType, $data[i].orgAuth, $data[i].authStatus);
75
                if ($data[i].hasHeadImage) {
76
                  $data[i].image = util.ImageUrl('head/' + $data[i].id + '_l.jpg', true);
77
                } else {
78
                  $data[i].image = util.defaultSet.expert;
79
                }
80
                this.$axios.get(httpUrl.utilUrl + '/researchArea/' + $data[i].id).then(res => {
81
                  const $info = res.data;
82
                  let arr = [];
83
                  for (let j = 0; j < $info.length; j++) {
84
                    arr.push($info[i].caption);
85
                    if (j === $info.length - 1) {
86
                      $data[i].reserachs = arr.join(',');
87
                      this.$forceUpdate();
88
                    }
89
                  }
90
                  if ($info.lenth === 0) {
91
                    $data[i].reserachs = '';
92
                  }
93
                });
94
              }
95
              this.userData = $data;
62 96
            };
63 97
          };
64 98
        });

+ 38 - 11
src/components/sub-component/BaseResource.vue

@ -1,29 +1,56 @@
1 1
<template>
2
  <a class="list-item" :href="linkResource(itemResources)">
3
    <div class="list-head" :style="{backgroundImage: 'url(' + resourcesUrl(itemResources) + ')'}"></div>
2
  <a class="list-item" :href="linkway">
3
    <div class="list-head" :style="{backgroundImage: 'url(' + imgUrl + ')'}"></div>
4 4
    <div class="list-info">
5
      <div class="list-tit list-topic">{{itemResources.name}}</div>
6
      <div class="list-owner">发布者<em class="authicon icon-pro"></em></div>
7
      <div class="list-desc">用途:{{itemResources.cnt}}</div>
5
      <div class="list-tit list-topic">{{itemSingle.name}}</div>
6
      <div class="list-owner">{{ownerName}}<em class="authicon" :class="ownerAuth"></em></div>
7
      <div class="list-desc" v-if="itemSingle.cnt">用途:{{itemSingle.cnt}}</div>
8 8
    </div>
9 9
  </a>
10 10
</template>
11 11
12 12
<script type="text/ecmascript-6">
13 13
  import util from '@/libs/util';
14
  import httpUrl from '@/libs/http';
14 15
15 16
  export default {
16 17
    props: {
17
      itemResources: {
18
      itemSingle: {
18 19
        type: Object
19 20
      }
20 21
    },
22
    data() {
23
      return {
24
        linkway: util.defaultSet.link.resource + this.itemSingle.id,
25
        imgUrl: this.itemSingle.images ? util.ImageUrl('resource/' + this.itemSingle.images.split(',')[0]) : util.defaultSet.img.resource,
26
        ownerName: '',
27
        ownerAuth: ''
28
      };
29
    },
30
    created() {
31
      this.ownerByond(this.itemSingle);
32
    },
21 33
    methods: {
22
      resourcesUrl(item) {
23
        return item.images ? util.ImageUrl('resource/' + item.images.split(',')[0]) : util.defaultSet.img.resource;
24
      },
25
      linkResource(item) {
26
        return util.defaultSet.link.resource + item.id;
34
      ownerByond(item) {
35
        if (item.otype === '1') {
36
          this.$axios.get(httpUrl.kxQurey.professor.query + item.oid, {
37
            }).then((res) => {
38
            if (res.success) {
39
              let $info = res.data;
40
              this.ownerName = $info.name;
41
              this.ownerAuth = util.autho($info.authType, $info.orgAuth, $info.authStatus);
42
            }
43
          });
44
        } else if (item.otype === '2') {
45
          this.$axios.get(httpUrl.kxQurey.org.query + item.oid, {
46
            }).then((res) => {
47
            if (res.success) {
48
              let $info = res.data;
49
              this.ownerName = $info.forShort ? $info.forShort : $info.name;
50
              this.ownerAuth = $info.authStatus === '3' ? 'icon-com' : '';
51
            }
52
          });
53
        }
27 54
      }
28 55
    }
29 56
  };

+ 38 - 11
src/components/sub-component/BaseService.vue

@ -1,29 +1,56 @@
1 1
<template>
2
  <a class="list-item" :href="linkWare(itemServices)">
3
    <div class="list-head" :style="{backgroundImage: 'url(' + waresUrl(itemServices) + ')'}"></div>
2
  <a class="list-item" :href="linkway">
3
    <div class="list-head" :style="{backgroundImage: 'url(' + imgUrl + ')'}"></div>
4 4
    <div class="list-info">
5
      <div class="list-tit list-topic">{{itemServices.name}}</div>
6
      <div class="list-owner">发布者<em class="authicon icon-pro"></em></div>
7
      <div class="list-desc">内容:{{itemServices.cnt}}</div>
5
      <div class="list-tit list-topic">{{itemSingle.name}}</div>
6
      <div class="list-owner">{{ownerName}}<em class="authicon" :class="ownerAuth"></em></div>
7
      <div class="list-desc" v-if="itemSingle.cnt">内容:{{itemSingle.cnt}}</div>
8 8
    </div>
9 9
  </a>
10 10
</template>
11 11
12 12
<script type="text/ecmascript-6">
13 13
  import util from '@/libs/util';
14
  import httpUrl from '@/libs/http';
14 15
15 16
  export default {
16 17
    props: {
17
      itemServices: {
18
      itemSingle: {
18 19
        type: Object
19 20
      }
20 21
    },
22
    data() {
23
      return {
24
        linkway: util.defaultSet.link.service + this.itemSingle.id,
25
        imgUrl: this.itemSingle.images ? util.ImageUrl('ware/' + this.itemSingle.images.split(',')[0]) : util.defaultSet.img.service,
26
        ownerName: '',
27
        ownerAuth: ''
28
      };
29
    },
30
    created() {
31
      this.ownerByond(this.itemSingle);
32
    },
21 33
    methods: {
22
      waresUrl(item) {
23
        return item.images ? util.ImageUrl('ware/' + item.images.split(',')[0]) : util.defaultSet.img.service;
24
      },
25
      linkWare(item) {
26
        return util.defaultSet.link.service + item.id;
34
      ownerByond(item) {
35
        if (item.otype === '1') {
36
          this.$axios.get(httpUrl.kxQurey.professor.query + item.oid, {
37
            }).then((res) => {
38
            if (res.success) {
39
              let $info = res.data;
40
              this.ownerName = $info.name;
41
              this.ownerAuth = util.autho($info.authType, $info.orgAuth, $info.authStatus);
42
            }
43
          });
44
        } else if (item.otype === '2') {
45
          this.$axios.get(httpUrl.kxQurey.org.query + item.oid, {
46
            }).then((res) => {
47
            if (res.success) {
48
              let $info = res.data;
49
              this.ownerName = $info.forShort ? $info.forShort : $info.name;
50
              this.ownerAuth = $info.authStatus === '3' ? 'icon-com' : '';
51
            }
52
          });
53
        }
27 54
      }
28 55
    }
29 56
  };

+ 24 - 38
src/components/sub-component/DynamicTags.vue

@ -1,5 +1,5 @@
1 1
<template>
2
  <el-form-item :label="tagInfo.lableTit" prop="dynamicTags" ref="tagComponent">
2
  <el-form-item :label="tagInfo.lableTit" ref="tagComponent">
3 3
    <el-tag
4 4
      :key="tag"
5 5
      v-for="tag in dynamicTags"
@ -19,25 +19,24 @@
19 19
      :trigger-on-focus="false"
20 20
      @select="handleSelect"
21 21
      @keyup.enter.native="handleInputConfirm"
22
      @blur="handleInputConfirm"
23
    ></el-autocomplete>
22
    >
23
      <template slot-scope="{ item }">
24
        <div class="name">{{ item.caption }}</div>
25
      </template>
26
    </el-autocomplete>
24 27
    <el-button v-else class="button-new-tag" v-show="isShowAdd" size="medium" @click="showInput">+ {{tagInfo.placeholder}}</el-button>
25 28
  </el-form-item>
26 29
</template>
27 30
28 31
<script type="text/ecmascript-6">
29 32
  import httpUrl from '@/libs/http';
30
  // import util from '@/libs/util';
31 33
32 34
  export default {
33 35
    props: {
34 36
      tagInfo: {
35 37
        type: Object
36 38
      },
37
      industry: {
38
        type: String
39
      },
40
      dy: {
39
      dyStr: {
41 40
        type: String
42 41
      },
43 42
      dynamicTagsLength: {
@ -54,15 +53,14 @@
54 53
        loadAllKeys: []
55 54
      };
56 55
    },
57
    created() {
58
      this.dynamicTags = this.industry.split(',');
59
      if (this.dynamicTags.length === this.dynamicTagsLength) {
60
        this.isShowAdd = false;
61
      };
62
    },
63 56
    watch: {
64
      dy() {
65
        this.dynamicTags = this.dy.split(',');
57
      dyStr() {
58
        if (this.dyStr) {
59
          this.dynamicTags = this.dyStr.split(',');
60
          if (this.dynamicTags.length === this.dynamicTagsLength) {
61
            this.isShowAdd = false;
62
          };
63
        };
66 64
      }
67 65
    },
68 66
    methods: {
@ -70,7 +68,7 @@
70 68
      handleClose(tag) {
71 69
        this.dynamicTags.splice(this.dynamicTags.indexOf(tag), 1);
72 70
        this.$emit('turnTags', this.dynamicTags.join(',')); // 传给父组件
73
        if (this.dynamicTags.length < 10) {
71
        if (this.dynamicTags.length < this.dynamicTagsLength) {
74 72
          this.isShowAdd = true;
75 73
        }
76 74
      },
@ -88,7 +86,7 @@
88 86
        if (this.dynamicTags.length === this.dynamicTagsLength) {
89 87
          this.isShowAdd = false;
90 88
        }
91
        if (inputValue && inputValue.length < 15 && this.dynamicTags.length < 10) {
89
        if (inputValue && inputValue.length < 15 && this.dynamicTags.length < this.dynamicTagsLength) {
92 90
          this.dynamicTags.push(inputValue);
93 91
        }
94 92
        this.$emit('turnTags', this.dynamicTags.join(',')); // 传给父组件
@ -98,39 +96,27 @@
98 96
      // add tag
99 97
100 98
      querySearch(queryString, cb) {
101
        if (this.inputValue) {
102
          this.loadAllHotKey(this.inputValue);
103
          this.restaurants = this.loadAllKeys;
104
          var restaurants = this.restaurants;
105
          var results = queryString ? restaurants.filter(this.createFilter(queryString)) : restaurants;
106
          // 调用 callback 返回建议列表的数据
107
          cb(results);
108
        }
109
      },
110
      createFilter(queryString) {
111
        return (restaurant) => {
112
          return (restaurant.toLowerCase().indexOf(queryString.toLowerCase()) === 0);
113
        };
114
      },
115
      loadAllHotKey(key) {
116 99
        this.$axios.get(httpUrl.kxQurey.qaHotKey, {
117 100
          params: {
118
            key: key
101
            key: queryString
119 102
          }
120 103
        }).then((res) => {
121 104
          if (res.success) {
122 105
            var $info = res.data;
123 106
            var oSr = [];
124
            for (var i = 0; i < Math.min($info.length, 5); i++) {
125
               oSr.push($info[i].caption);
107
            for (let i = 0; i < Math.min($info.length, 5); i++) {
108
              oSr[i] = $info[i];
126 109
            };
127 110
            this.loadAllKeys = oSr;
128
            console.log(this.loadAllKeys);
111
            // if (this.loadAllKeys.length === 0) {
112
            //   this.loadAllKeys = [{caption: '暂无数据'}]
113
            // };
114
            cb(this.loadAllKeys);
129 115
          };
130 116
        });
131 117
      },
132 118
      handleSelect(item) {
133
        console.log(item);
119
        this.inputValue = item.caption;
134 120
      }
135 121
    }
136 122
  };

+ 6 - 2
src/libs/http.js

@ -83,10 +83,14 @@ http.kxQurey = {
83 83
      pqpublish: utilUrl + '/article/pqpublish' // 已发布的文章列表
84 84
    },
85 85
    professor: {
86
      info: utilUrl + '/professor/baseInfo/' // 专家基础信息
86
      query: utilUrl + '/professor/baseInfo/', // 专家基础信息
87
      researchArea: utilUrl + '/researchArea/' // 研究方向
87 88
    },
88 89
    org: {
89
      info: utilUrl + '/org/' // 企业基础信息
90
      query: utilUrl + '/org/' // 企业基础信息
91
    },
92
    leaveMsg: {
93
      count: utilUrl + '/leavemsg/count' // 留言数量
90 94
    },
91 95
    cachedFile: utilUrl + '/cachedFileUpload', // 上传缓存地址
92 96
    qaHotKey: utilUrl + '/dataDict/qaHotKey', // 检索关键词

+ 0 - 21
src/libs/util.js

@ -268,25 +268,4 @@ util.dateChange = function(startTime) { // 默认返回yyyy月MM日dd HH:mm
268 268
    }
269 269
};
270 270
271
/**
272
 * 获取ownerInfo(org\professor)
273
 * fl === 'professor' 或者 fl === 'org'
274
 */
275
util.ownerInfo = function(vm, type, ownerId) {
276
  var url;
277
  if (type === '1') {
278
    url = httpUrl.kxQurey.professor.query;
279
  } else if (type === '2') {
280
    url = httpUrl.kxQurey.org.query;
281
  };
282
283
  vm.$axios.get(url + '/' + ownerId, {
284
  }).then((res) => {
285
    if (res.success) {
286
      var $info = res.data;
287
      return $info;
288
    };
289
  });
290
};
291
292 271
export default util;