This commit is contained in:
aoli.qu 2022-02-25 11:58:26 +08:00
parent ded566478b
commit 87564e9c81
4 changed files with 62 additions and 11 deletions

View File

@ -20,9 +20,9 @@
UEDITOR_HOME_URL: '/static/plugins/ueditor/', UEDITOR_HOME_URL: '/static/plugins/ueditor/',
// serverUrl: '//ueditor.szcloudplus.com/cos' // serverUrl: '//ueditor.szcloudplus.com/cos'
serverUrl: process.env.VUE_APP_API_BASE_URL + '/sys/ueditor/config', serverUrl: process.env.VUE_APP_API_BASE_URL + '/sys/ueditor/config',
headers: { // headers: {
Authorization: storage.get(ACCESS_TOKEN) // Authorization: storage.get(ACCESS_TOKEN)
} // }
}, },
} }
}, },

View File

@ -153,6 +153,12 @@
title: '公告类型', title: '公告类型',
dataIndex: 'type', dataIndex: 'type',
scopedSlots: { customRender: 'type' } scopedSlots: { customRender: 'type' }
},
{
title: '操作',
width: 200,
dataIndex: 'action',
scopedSlots: { customRender: 'action' }
} }
], ],
// Promise // Promise

View File

@ -6,6 +6,7 @@
:confirmLoading="confirmLoading" :confirmLoading="confirmLoading"
@ok="handleSubmit" @ok="handleSubmit"
@cancel="handleCancel" @cancel="handleCancel"
:destroyOnClose="true"
> >
<a-spin :spinning="formLoading"> <a-spin :spinning="formLoading">
<a-form :form="form"> <a-form :form="form">
@ -62,11 +63,35 @@
label="类型" label="类型"
> >
<a-radio-group v-decorator="['type',{rules: [{ required: true, message: '请选择类型' }]}]" > <a-radio-group v-decorator="['type',{rules: [{ required: true, message: '请选择类型' }]}]" >
<a-radio :value="1" :checked="true">{{ orgType === 1 ? '单位' : '项目' }}</a-radio> <a-radio @click="typeFunc(1)" :value="1" :checked="true">{{ orgType === 1 ? '单位' : '项目' }}</a-radio>
<a-radio :value="2">部门</a-radio> <a-radio @click="typeFunc(2)" :value="2">部门</a-radio>
</a-radio-group> </a-radio-group>
</a-form-item> </a-form-item>
<div v-show="companyDiv">
<a-form-item
:labelCol="labelCol"
:wrapperCol="wrapperCol"
label="企业信息"
>
<a-textarea :rows="4" placeholder="请输入企业信息" v-decorator="['companyInfo']"></a-textarea>
</a-form-item>
<a-form-item
:labelCol="labelCol"
:wrapperCol="wrapperCol"
label="社会信用代码"
>
<a-input v-decorator="['socialCreditCode']" />
</a-form-item>
<a-form-item
:labelCol="labelCol"
:wrapperCol="wrapperCol"
label="邀请码"
>
<a-input disabled v-decorator="['invitationCode']" />
</a-form-item>
</div>
<a-form-item <a-form-item
:labelCol="labelCol" :labelCol="labelCol"
:wrapperCol="wrapperCol" :wrapperCol="wrapperCol"
@ -118,7 +143,8 @@
value: 'id' value: 'id'
}, },
form: this.$form.createForm(this), form: this.$form.createForm(this),
orgType: 1 orgType: 1,
companyDiv: false
} }
}, },
methods: { methods: {
@ -127,6 +153,11 @@
this.visible = true this.visible = true
this.modalTitle = '新增' this.modalTitle = '新增'
this.orgType = orgType this.orgType = orgType
if (this.orgType == 1 ) {
this.companyDiv = true
} else {
this.companyDiv = false
}
this.getOrgTree() this.getOrgTree()
}, },
// //
@ -134,6 +165,11 @@
this.visible = true this.visible = true
this.modalTitle = '编辑' this.modalTitle = '编辑'
this.orgType = record.orgType this.orgType = record.orgType
if (this.orgType == 1 && record.type == 1){
this.companyDiv = true
} else {
this.companyDiv = false
}
this.getOrgTree() this.getOrgTree()
setTimeout(() => { setTimeout(() => {
this.form.setFieldsValue( this.form.setFieldsValue(
@ -144,7 +180,10 @@
type: record.type, type: record.type,
sort: record.sort, sort: record.sort,
pid: record.pid, pid: record.pid,
remark: record.remark remark: record.remark,
companyInfo: record.companyInfo,
socialCreditCode: record.socialCreditCode,
invitationCode: record.invitationCode
} }
) )
}, 100) }, 100)
@ -177,7 +216,13 @@
}] }]
}) })
}, },
typeFunc (type) {
if (this.orgType === 1 && type === 1) {
this.companyDiv = true
} else {
this.companyDiv = false
}
},
handleSubmit () { handleSubmit () {
const { form: { validateFields } } = this const { form: { validateFields } } = this
this.confirmLoading = true this.confirmLoading = true

View File

@ -183,11 +183,11 @@ export default {
this.meneTypeFunc(record.type.toString()) this.meneTypeFunc(record.type.toString())
// //
const visibleDef = false let visibleDef = false
if (record.visible == 1) { if (record.visible == 1) {
this.visibleDef = true visibleDef = true
} }
this.form.getFieldDecorator('visible', { valuePropName: 'checked', initialValue: this.visibleDef }) this.form.getFieldDecorator('visible', { valuePropName: 'checked', initialValue: visibleDef })
this.treeSelDefaultValue = record.pid this.treeSelDefaultValue = record.pid
setTimeout(() => { setTimeout(() => {