Browse Source

提交代码

Zhang Li, BBF-411-2(Neusoft) 2 years ago
parent
commit
958977bbaf

+ 17 - 21
src/views/modules/knowledge/album/albumInfo.vue

@@ -27,7 +27,7 @@
               <div>
                 <span>阅读数量: {{ baseInfo.views }}</span>
                 <span>点评数量: {{ baseInfo.yelpTotal }}</span>
-                <span>发布状态: {{ baseInfo.versionState }}</span>
+                <span>发布状态: {{ baseInfo.versionStateName }}</span>
               </div>
             </div>
             <div>
@@ -142,7 +142,7 @@
                   <template v-else>
                     <div>无内容</div>
                   </template>
-                  <div v-if="item.replyCount > 2" class="show-return-info" @click="handleMoreClick(item.pkId)">
+                  <div v-if="item.replyCount > 2 && !item.isShowMore" class="show-return-info" @click="handleMoreClick(item.pkId)">
                     查看全部{{ item.replyCount - 2 }}条回复内容>
                   </div>
                 </a-collapse-panel>
@@ -293,7 +293,7 @@ export default {
     async init() {
       let detailData = await api.detail({pkId: this.pkId})
       let detailInfo = detailData.data
-      this.baseInfo = { ...detailInfo, versionState: this.getVersionStateName(detailInfo.versionState)}
+      this.baseInfo = { ...detailInfo }
       this.actionFlag = detailInfo.actionFlag
       this.tabsList = detailInfo.versions || []
       if(this.tabsList.length) {
@@ -302,6 +302,9 @@ export default {
         api.yelp({albumId: this.pkId}).then(res => {
           if(res.code == 200) {
             if(res.data.length) {
+              res.data.forEach(item => {
+                item.isShowMore = false
+              })
               this.yelpList = res.data
             }
           }
@@ -323,18 +326,6 @@ export default {
         }
       })
     },
-    getVersionStateName(state) {
-      switch (state) {
-        case 1:
-          return '审核中'
-        case 2:
-          return '发布中'
-        case 3:
-          return '无此状态'
-        case 4:
-          return '已驳回'
-      }
-    },
     // 关闭专辑
     handleSwitchClick() {
       this.saveLoading = true
@@ -415,6 +406,7 @@ export default {
       // if(!key.length) return
       // let repliesData = this.yelpList[key[0] - 1].replies
       // this.yelpIndexInfo = repliesData.length < 2 ? repliesData : repliesData.slice(0,2)
+      console.log(key)
     },
     // 显示更多回复
     handleMoreClick(yelpId) {
@@ -428,15 +420,19 @@ export default {
           // 专辑id
           albumId: this.pkId,
           // yelpId
-          yelpId: yelpId
+          yelpId: yelpId,
+          type: 1
         }
       }
+      console.log(this.collapseCheckKey)
       // 暂时还没写
-      // api.queryComment(query).then(res => {
-      //   if(res.code == 200) {
-      //     this.yelpList[parseInt(this.collapseCheckKey) - 1].replies.push(...res.data)
-      //   }
-      // })
+      api.queryComment(query).then(res => {
+        if(res.code == 200) {
+          let key = parseInt(this.collapseCheckKey.slice(-1)[0]) - 1
+          this.yelpList[key].replies.push(...res.result.data)
+          this.yelpList[key].isShowMore = true
+        }
+      })
     },
     // 添加要删除的知识
     setId(arg) {

+ 17 - 7
src/views/modules/knowledge/album/albumList.vue

@@ -253,13 +253,23 @@ export default {
     }
   },
   methods: {
-    async init() {
-      let yelp = await api.yelp()
-      this.yelpNum = yelp.data || 0
-      let approve = await api.approve()
-      this.approveNum = approve.data || 0
-      let res = await api.categories()
-      this.classifyLevelList = this.formatData(res.data)
+    init() {
+      api.yelp().then(res => {
+        if(res.code == 200) {
+          this.yelpNum = res.data || 0
+        }
+      })
+      api.approve().then(res => {
+        if(res.code == 200) {
+          this.approveNum = res.data || 0
+        }
+      })
+      api.categories().then(res => {
+        if(res.code == 200) {
+          this.classifyLevelList = this.formatData(res.data)
+        }
+      })
+      
     },
     formatData(data) {
       const that = this

+ 3 - 2
src/views/modules/knowledge/album/checkInfo.vue

@@ -37,7 +37,9 @@
                     </div>
                     <div>
                       <span>{{ childrenInfo.createTime }}</span>
-                      <span :style="{ color: childrenInfo.state == 1 == 1 ? 'green' : 'orange' }">{{ childrenInfo.state == 1 ? '审核通过' : '待审核' }}</span>  
+                      <span v-if="childrenInfo.state == 0" style="color:orange;">待审核</span>  
+                      <span v-else-if="childrenInfo.state == 1" style="color:green;">审核通过</span>  
+                      <span v-else style="color:red;">审核未通过</span>  
                     </div>
                   </div>
                 </a-collapse-panel>
@@ -184,7 +186,6 @@ export default {
       let detailData = await api.info({pkId: this.pkId})
       let detailInfo = detailData.data
       this.parentInfo = detailInfo.yelp
-      console.log(this.parentInfo)
       if(!this.parentInfo) {
         let collapseNode = document.querySelector('.ant-collapse-content')
         collapseNode.style.display = 'none'

+ 1 - 1
src/views/modules/knowledge/config/bannerAddEdit.vue

@@ -94,7 +94,7 @@
             </a-form-model>
           </div>
         </div>
-        <a-spin tip="Loading..." class="loadBox" v-show="loading"></a-spin>
+        <!-- <a-spin tip="Loading..." class="loadBox" v-show="loading"></a-spin> -->
       </div>
     </div> 
   </rx-layout>

+ 75 - 80
src/views/modules/knowledge/config/bannerList.vue

@@ -1,14 +1,63 @@
 <template>
   <rx-layout>
-    <div slot="center" style>
+    <div slot="center">
       <rx-fit>   
         <div slot="toolheader" border="false" foldbtn="false">
           <breadcrumb firstLevel="配置管理" lastLevel="banner配置" />
           <div class="mainContent">
-            <div class="body" :style="{'padding-right': $store.state.appSetting.collapsed ? '0px' : '20px' }">
+            <div class="body" style="padding-right:20px;">
               <div class="content">
-                <a-form ref="searchForm" layout="inline" style="display:flex;">
-                  <div style="width:80%;display:flex;flex-wrap:wrap;">
+                <a-form ref="searchForm" layout="inline" style="display:flex;flex-wrap: wrap;">
+                  <a-form-item
+                    class="form-item-style"
+                    label="名称"
+                    name="name">
+                    <a-input class="set-input" v-model="queryParam.name" placeholder="请输入"/>
+                  </a-form-item>
+                  <a-form-item
+                    class="form-item-style"
+                    label="类型"
+                    name="type">
+                    <a-select class="set-select" v-model="queryParam.type" placeholder="请选择" allowClear>
+                      <a-select-option v-for="(item,index) in typeList" :key="index" :value="item.value">
+                        {{item.label}}
+                      </a-select-option>
+                    </a-select>
+                  </a-form-item>
+                  <a-form-item
+                    class="form-item-style"
+                    label="上线/下线"
+                    name="online">
+                    <a-select class="set-select" v-model="queryParam.enabled" placeholder="请选择" allowClear>
+                      <a-select-option v-for="(item,index) in lineList" :key="index" :value="item.value">
+                        {{item.label}}
+                      </a-select-option>
+                    </a-select>
+                  </a-form-item>
+                  <a-form-item
+                    class="form-item-style"
+                    label="创建人"
+                    name="creator">
+                    <a-input class="set-input" v-model="queryParam.createBy" placeholder="请输入" />
+                  </a-form-item>
+                  <a-form-item
+                    class="form-item-style"
+                    label="创建时间"
+                    name="createTime">
+                    <a-range-picker v-model="createTime" 
+                                    class="set-range-picker" 
+                                    separator="→"
+                                    format="YYYY/MM/DD"
+                                    valueFormat="YYYY-MM-DD"
+                                    @change="handleClearTimeChange">
+                      <!-- <a-icon v-if="$store.state.appSetting.collapsed" slot="suffixIcon" type="calendar" /> -->
+                    </a-range-picker>
+                  </a-form-item>
+                  <div style="display:flex;justify-content:center;margin-top: 8px;">
+                    <a-button @click="handleResetClick">重置</a-button>
+                    <a-button type="primary" @click="handleSearchClick">查询</a-button>
+                   </div>
+                  <!-- <div style="width:80%;display:flex;flex-wrap:wrap;">
                     <div style="display:flex;flex-wrap:wrap;">
                       <a-form-item
                         style="width:320px;margin: 5px 40px 5px 0;"
@@ -79,81 +128,8 @@
                         </template>
                       </a-button>
                     </div>
-                  </div>
-                  <!-- <a-row :gutter="24" style="margin: 0;">
-                    <a-col :span="6" >
-                      <a-form-item
-                        label="名称"
-                        name="name"
-                      >
-                        <a-input v-model="queryParam.name" placeholder="请输入"/>
-                      </a-form-item>
-                    </a-col>
-                    <a-col :span="6" >
-                      <a-form-item
-                        label="类型"
-                        name="type"
-                      >
-                        <a-select v-model="queryParam.type" placeholder="请选择" allowClear>
-                          <a-select-option v-for="(item,index) in typeList" :key="index" :value="item.value">
-                            {{item.label}}
-                          </a-select-option>
-                        </a-select>
-                      </a-form-item>
-                    </a-col>
-                    <a-col :span="6" :push="6">
-                      <a-row :gutter="24" type="flex" justify="end">
-                        <a-button @click="handleResetClick">重置</a-button>
-                        <a-button type="primary" @click="handleSearchClick">查询</a-button>
-                        <a-button type="link" @click="extend = !extend">
-                          <template v-if="!extend">
-                            展开
-                            <a-icon type="down" />
-                          </template>
-                          <template v-else>
-                            收起
-                            <a-icon type="up" />
-                          </template>
-                        </a-button>
-                      </a-row>
-                    </a-col>
-                  </a-row>
-                  <a-row :gutter="24" style="margin: 0;margin-top: 15px;" v-if="extend" :class="{'show-other': extend}">
-                    <a-col :span="6" >
-                      <a-form-item
-                        label="上线/下线"
-                        name="online"
-                      >
-                        <a-select v-model="queryParam.enabled" placeholder="请选择" allowClear>
-                        <a-select-option v-for="(item,index) in lineList" :key="index" :value="item.value">
-                          {{item.label}}
-                        </a-select-option>
-                      </a-select>
-                      </a-form-item>
-                    </a-col>
-                    <a-col :span="6" >
-                      <a-form-item
-                        label="创建人"
-                        name="creator"
-                      >
-                        <a-input v-model="queryParam.createBy" placeholder="请输入" />
-                      </a-form-item>
-                    </a-col>
-                    <a-col :span="7">
-                      <a-form-item
-                        label="创建时间"
-                        name="createTime"
-                      >
-                        <a-range-picker v-model="createTime" 
-                                        separator="→"
-                                        format="YYYY/MM/DD"
-                                        valueFormat="YYYY-MM-DD"
-                                        @change="handleClearTimeChange">
-                          <a-icon v-if="$store.state.appSetting.collapsed" slot="suffixIcon" type="calendar" />
-                        </a-range-picker>
-                      </a-form-item>
-                    </a-col>
-                  </a-row> -->
+                  </div> -->
+
                 </a-form>
                 <rx-button alias="bannerAdd" :butn-icon="'none'" @click="$router.push('/knowledge/bannerAddEdit')">新增banner</rx-button>
               </div>
@@ -170,6 +146,7 @@
           :queryParam="queryParam"
           data-field="result.data"
           :defaultPageSize="10"
+          :heightAuto="true"
           :pageSizeOptions="['10','20','30','40']"
           idField="pkId"
         >
@@ -323,6 +300,9 @@ export default {
 .rx-fit {
   padding: 40px!important;
   background: @gary;
+  overflow-y: auto!important;
+  // height:calc( 100vh - 118px )!important;
+  display: block!important;
   .fit-header {
     .bread-crumb {
       position: relative;
@@ -353,7 +333,7 @@ export default {
   }
   .table-style {
     padding: 20px;
-
+    min-height: 400px;
     .clearBtn {
       background: none;
       color: #3294F7;
@@ -364,6 +344,18 @@ export default {
     }
   }
 }
+.form-item-style {
+  margin: 5px 20px 5px 0;
+}
+.set-input {
+  width:180px;
+}
+.set-select {
+  width:120px;
+}
+.set-range-picker {
+  width:230px!important;
+}
 .show-other{
 	width: 100%;
 	animation:show-other-search 0.8s;
@@ -376,6 +368,9 @@ export default {
 }
 </style>
 <style scoped>
+/deep/   .divdefault {
+  position: inherit!important;
+}
 /deep/.ant-btn > .anticon + span {
   margin-left: 0;
 }

+ 3 - 5
src/views/modules/knowledge/map/addUpdateMap.vue

@@ -594,19 +594,17 @@ export default {
           if(valid) {
             setTimeout(() => {
               if(this.learnForm.type == 1) {
-                this.tabRouteList[parseInt(this.tabsKeys)-1].contents.push({
+                this.tabRouteList[parseInt(this.tabsKeys)-1].contents.unshift({
                   ...this.learnForm
                 })
               } else {
-                this.tabRouteList[parseInt(this.tabsKeys)-1].contents.push({
+                this.tabRouteList[parseInt(this.tabsKeys)-1].contents.unshift({
                   ...this.learnForm,
                   ...this.knowledgeInfo
                 })
               }
               this.showLearnFlag = false
-            
-              },1000)
-
+            },1000)
           }
         } 
       )

+ 1 - 1
src/views/modules/knowledge/map/components/pageList.vue

@@ -7,7 +7,7 @@
         </template>
         <template v-else>
           <div>{{ item.titles }}</div>
-          <div class="classify">{{ item.category.join(" ") }}</div>
+          <div class="classify">{{ typeof(item.category) == 'string' ? item.category : item.category.join(" ")}}</div>
           <div>
             {{ item.summary }}
           </div>

+ 29 - 13
src/views/modules/knowledge/warehouse/knowledgeAddUpdate.vue

@@ -25,11 +25,11 @@
                 <a-input v-model="knowledgeForm.titles" placeholder="请输入" :disabled="!!pkId" />
               </a-form-model-item>
               <a-form-model-item prop="author">
-                <span slot="label">&emsp;&emsp;作者</span>
+                <span slot="label">&emsp;&emsp;&ensp;作者</span>
                 <a-input disabled v-model="knowledgeForm.author" placeholder="请输入" />
               </a-form-model-item>
               <!-- 知识管理与审核管理查看时 为true不可编辑-->
-              <a-form-model-item label="编辑简介:" prop="summary">
+              <a-form-model-item label="*编辑简介:" prop="summary">
                 <a-input v-model="knowledgeForm.summary" :disabled="!!$route.query.show" type="textarea" :autosize="{minRows: 3, maxRows: 6}" placeholder="请输入(建议100个汉字以内)" />
               </a-form-model-item>
               <!-- 知识管理与审核管理查看时 为true-->
@@ -201,6 +201,9 @@ export default {
         ],
         titles: [
           { required: true, message: '请输入知识标题', trigger: 'blur' }
+        ],
+        summary: [
+          { required: true, message: '请输入简介', trigger: 'blur' }
         ]
       },
       approverColumns: [
@@ -318,9 +321,9 @@ export default {
   },
   methods: {
     beforeUpload(file) {
-      const isLt2M = file.size / 1024 / 1024 < 6;
+      const isLt2M = file.size / 1024 / 1024 < 100;
       if (!isLt2M) {
-        this.$message.error('附件不能超过6M');
+        this.$message.error('附件不能超过100M');
         return false
       }
       const fileName = file.name.split('.')
@@ -350,7 +353,16 @@ export default {
     },
     // 下载文件
     handleFileDownloadClick() {
-      window.open("/api/api-system/system/core/sysFile/previewFile?fileId="+this.knowledgeForm.attachment)
+      // window.open("/api/api-system/system/core/sysFile/previewFile?fileId="+this.knowledgeForm.attachment)
+
+      const link = document.createElement('a')
+      link.style.display = 'none'
+      link.href = "/api/api-system/system/core/sysFile/previewFile?fileId="+this.knowledgeForm.attachment
+      // link.target = '_blank'
+      link.setAttribute('download', this.knowledgeForm.attachmentName)
+      document.body.appendChild(link)
+      link.click()
+      link.remove()
     },
     // 保存
     handleSaveClick() {
@@ -376,14 +388,18 @@ export default {
         // 从知识管理跳进
         this.saveLoading = true
         if(this.type == 'knowledgeManageList') {
-          api.save({...this.knowledgeForm, categoryId: this.knowledgeForm.categoryId.slice(-1)[0], pkId: this.pkId}).then(res => {
-          if(res.code == 200) {
-            setTimeout(() => 
-              {
-                this.$router.back()
-                this.saveLoading = false
-              }
-              ,1000)
+          this.$refs.knowledgeRef.validate(valid => {
+          if (valid) {
+            api.save({...this.knowledgeForm, categoryId: this.knowledgeForm.categoryId.slice(-1)[0], pkId: this.pkId}).then(res => {
+              if(res.code == 200) {
+                setTimeout(() => 
+                  {
+                    this.$router.back()
+                    this.saveLoading = false
+                  }
+                  ,1000)
+                }
+              })
             }
           })
         } else {