|
@@ -13,11 +13,18 @@
|
|
<el-row :gutter="15">
|
|
<el-row :gutter="15">
|
|
|
|
|
|
<el-col :span="21">
|
|
<el-col :span="21">
|
|
- <el-form-item label="知识分享类型" prop="typeName"
|
|
|
|
|
|
+ <el-form-item label="知识分享类型" prop="typeId"
|
|
:rules="[
|
|
:rules="[
|
|
{required: true, message:'分享类型不能为空', trigger:'blur'}
|
|
{required: true, message:'分享类型不能为空', trigger:'blur'}
|
|
]">
|
|
]">
|
|
- <el-input v-model="inputForm.typeName" @focus="openProgramPageForm()" placeholder="请选择知识分享类型"></el-input>
|
|
|
|
|
|
+ <el-select v-model="inputForm.typeId" placeholder="请选择" style="width:100%;">
|
|
|
|
+ <el-option
|
|
|
|
+ v-for="item in typeList"
|
|
|
|
+ :value="item.id"
|
|
|
|
+ :label="item.klgsType"
|
|
|
|
+ :key="item.id">
|
|
|
|
+ </el-option>
|
|
|
|
+ </el-select>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-col>
|
|
<el-col :span="21">
|
|
<el-col :span="21">
|
|
@@ -127,6 +134,7 @@
|
|
|
|
|
|
<script>
|
|
<script>
|
|
import KnowledgeShareInfoService from '@/api/sys/KnowledgeShareInfoService'
|
|
import KnowledgeShareInfoService from '@/api/sys/KnowledgeShareInfoService'
|
|
|
|
+ import KnowledgeShareTypeService from '@/api/sys/KnowledgeShareTypeService'
|
|
import UpLoadComponent from '@/views/common/UpLoadComponent'
|
|
import UpLoadComponent from '@/views/common/UpLoadComponent'
|
|
import UserService from '@/api/sys/UserService'
|
|
import UserService from '@/api/sys/UserService'
|
|
import KnowledgeShareTypePageForm from '@/views/modules/finance/invoice/KnowledgeShareTypePageForm'
|
|
import KnowledgeShareTypePageForm from '@/views/modules/finance/invoice/KnowledgeShareTypePageForm'
|
|
@@ -140,6 +148,7 @@
|
|
loading: false,
|
|
loading: false,
|
|
isAdmin: false,
|
|
isAdmin: false,
|
|
create: '',
|
|
create: '',
|
|
|
|
+ typeList: [],
|
|
inputForm: {
|
|
inputForm: {
|
|
id: '',
|
|
id: '',
|
|
typeId: '',
|
|
typeId: '',
|
|
@@ -156,7 +165,11 @@
|
|
userService: null,
|
|
userService: null,
|
|
created () {
|
|
created () {
|
|
this.knowledgeShareInfoService = new KnowledgeShareInfoService()
|
|
this.knowledgeShareInfoService = new KnowledgeShareInfoService()
|
|
|
|
+ this.knowledgeShareTypeService = new KnowledgeShareTypeService()
|
|
this.userService = new UserService()
|
|
this.userService = new UserService()
|
|
|
|
+ this.knowledgeShareTypeService.list().then(({data}) => {
|
|
|
|
+ this.typeList = data.records
|
|
|
|
+ })
|
|
},
|
|
},
|
|
components: {
|
|
components: {
|
|
UpLoadComponent,
|
|
UpLoadComponent,
|
|
@@ -189,6 +202,9 @@
|
|
this.visible = true
|
|
this.visible = true
|
|
this.loading = false
|
|
this.loading = false
|
|
this.$nextTick(() => {
|
|
this.$nextTick(() => {
|
|
|
|
+ if (method === 'add') {
|
|
|
|
+ this.$refs.contentEditor.enable()
|
|
|
|
+ }
|
|
if (method === 'edit' || method === 'view') { // 修改或者查看
|
|
if (method === 'edit' || method === 'view') { // 修改或者查看
|
|
this.loading = true
|
|
this.loading = true
|
|
// 富文本处理
|
|
// 富文本处理
|
|
@@ -198,7 +214,11 @@
|
|
this.$refs.inputForm.resetFields()
|
|
this.$refs.inputForm.resetFields()
|
|
this.knowledgeShareInfoService.findById(this.inputForm.id, method).then(({data}) => {
|
|
this.knowledgeShareInfoService.findById(this.inputForm.id, method).then(({data}) => {
|
|
// 富文本处理
|
|
// 富文本处理
|
|
- this.$refs.contentEditor.disable()
|
|
|
|
|
|
+ if (method === 'view') {
|
|
|
|
+ this.$refs.contentEditor.disable()
|
|
|
|
+ } else {
|
|
|
|
+ this.$refs.contentEditor.enable()
|
|
|
|
+ }
|
|
this.inputForm = this.recover(this.inputForm, data)
|
|
this.inputForm = this.recover(this.inputForm, data)
|
|
this.$refs.uploadComponent.newUpload(method, this.inputForm.files, 'knowledgeShare')
|
|
this.$refs.uploadComponent.newUpload(method, this.inputForm.files, 'knowledgeShare')
|
|
this.inputForm = JSON.parse(JSON.stringify(this.inputForm))
|
|
this.inputForm = JSON.parse(JSON.stringify(this.inputForm))
|
|
@@ -245,7 +265,7 @@
|
|
},
|
|
},
|
|
pushComment () {
|
|
pushComment () {
|
|
if (this.commonJS.isEmpty(this.inputForm.content)) {
|
|
if (this.commonJS.isEmpty(this.inputForm.content)) {
|
|
- this.$message.error("请输入评论内容")
|
|
|
|
|
|
+ this.$message.error('请输入评论内容')
|
|
return
|
|
return
|
|
}
|
|
}
|
|
this.commentForm = {
|
|
this.commentForm = {
|