|
@@ -30,7 +30,7 @@
|
|
|
</div>
|
|
|
</a-input>
|
|
|
</a-form-model-item>
|
|
|
- <a-form-model-item class="knowledgeAddUpdateLabel" label="编辑简介:" prop="summary" style="width:calc( 46.04vw );">
|
|
|
+ <a-form-model-item class="knowledgeAddUpdateLabel oneline" label="编辑简介:" prop="summary" style="width:calc( 46.04vw );">
|
|
|
<a-input @change='summaryChange' class="textareaBox" suffix="100" maxLength="100" v-model="knowledgeForm.summary" type="textarea" :autosize="{minRows: 3, maxRows: 6}" placeholder="请输入" >
|
|
|
</a-input>
|
|
|
<div class="rightText">
|
|
@@ -38,7 +38,7 @@
|
|
|
</div>
|
|
|
</a-form-model-item>
|
|
|
<a-form-model-item class="knowledgeAddUpdateLabel" label="编辑正文:" prop="content" style="width:calc( 46.04vw );">
|
|
|
- <editor :value.sync="knowledgeForm.content"></editor>
|
|
|
+ <editor class="editorBox" :value.sync="knowledgeForm.content"></editor>
|
|
|
</a-form-model-item>
|
|
|
<a-form-model-item class="knowledgeAddUpdateLabel" label="上传附件:" prop="accessory" style="margin-top: 2.4vw;" v-if="!knowledgeForm.attachment">
|
|
|
<a-upload-dragger
|
|
@@ -109,6 +109,7 @@ import editor from '../components/editor'
|
|
|
import vabOnlyOffice from '../components/onlyOffice'
|
|
|
import { getCategoryId } from './aJs/getClassifyTree'
|
|
|
import api from '@/api/knowledge/warehouseIndex'
|
|
|
+import contentData from '@/api/knowledge/contentData'
|
|
|
export default {
|
|
|
name: 'knowledgeAddUpdate',
|
|
|
components: {
|
|
@@ -173,6 +174,9 @@ export default {
|
|
|
],
|
|
|
titles: [
|
|
|
{ required: true, message: '请输入知识标题', trigger: 'blur' }
|
|
|
+ ],
|
|
|
+ summary: [
|
|
|
+ { required: true, message: '请输入编辑简介', trigger: 'blur' }
|
|
|
]
|
|
|
},
|
|
|
approverColumns: [
|
|
@@ -237,6 +241,9 @@ export default {
|
|
|
this.knowledgeForm.type = this.$route.query.type
|
|
|
this.knowledgeForm.bastype = this.$route.query.type
|
|
|
}
|
|
|
+ if(this.$route.query.categoryId) {
|
|
|
+ this.knowledgeForm.categoryId = this.$route.query.categoryId.split(',')
|
|
|
+ }
|
|
|
let pkId = this.$route.query.pkId
|
|
|
if(pkId) {
|
|
|
this.pkId = pkId
|
|
@@ -326,10 +333,24 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
+ },
|
|
|
+ // 处理分类数据展示
|
|
|
+ categoryData(data){
|
|
|
+ data.forEach(element => {
|
|
|
+ element.label=element.name
|
|
|
+ element.value=element.pkId
|
|
|
+ if(element.children!=null&&element.children.length!=0){
|
|
|
+ this.categoryData(element.children)
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
// 初始化数据
|
|
|
async init() {
|
|
|
- let res = await api.getKnowledgeCategory(0)
|
|
|
+ contentData.getAllKnowledgeCategory().then((res) =>{
|
|
|
+ this.categoryData(res.data)
|
|
|
+ this.classifyList=res.data
|
|
|
+ })
|
|
|
+ /*let res = await api.getKnowledgeCategory(0)
|
|
|
this.classifyList = res.data.children.map(item => {
|
|
|
if(!item.hasChild) {
|
|
|
item.isLeaf = true
|
|
@@ -338,7 +359,7 @@ export default {
|
|
|
}
|
|
|
delete item.children
|
|
|
return item
|
|
|
- })
|
|
|
+ })*/
|
|
|
},
|
|
|
// 分类懒加载
|
|
|
async loadData(selectedOptions) {
|
|
@@ -359,9 +380,9 @@ export default {
|
|
|
},
|
|
|
// 上传前文件过滤
|
|
|
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('.')
|
|
@@ -407,7 +428,8 @@ export default {
|
|
|
this.option.isEdit = false
|
|
|
this.option.lang = 'zh-CN'
|
|
|
// this.option.url = 'http://10.5.100.64:9900/api-system/system/core/sysFile/previewFile?fileId=1597050108435845121'
|
|
|
- this.option.url = 'http://10.5.100.101/api/api-system/system/core/sysFile/previewFile?fileId='+ this.knowledgeForm.attachment,
|
|
|
+ //this.option.url = 'http://10.5.100.101/api/api-system/system/core/sysFile/previewFile?fileId='+ this.knowledgeForm.attachment,
|
|
|
+ this.option.url = 'http://www.hkcqjy.com.cn:8088/api/api-system/system/core/sysFile/previewFile?fileId='+ this.knowledgeForm.attachment,
|
|
|
this.option.title = this.knowledgeForm.attachmentName
|
|
|
this.option.fileType = this.knowledgeForm.attachmentName.split('.').slice(-1)[0]
|
|
|
this.option.isPrint = false
|