|
@@ -23,7 +23,7 @@
|
|
<a-col :span="12">
|
|
<a-col :span="12">
|
|
<a-form-item label="地址">
|
|
<a-form-item label="地址">
|
|
<a-input
|
|
<a-input
|
|
- v-decorator="['address', { rules: [{ required: true, message: '请输入地址' }] }]"
|
|
|
|
|
|
+ v-decorator="['link', { rules: [{ required: true, message: '请输入地址' }] }]"
|
|
placeholder="请输入地址"
|
|
placeholder="请输入地址"
|
|
/>
|
|
/>
|
|
</a-form-item>
|
|
</a-form-item>
|
|
@@ -60,7 +60,11 @@
|
|
<a-row :gutter="24">
|
|
<a-row :gutter="24">
|
|
<a-col :span="12">
|
|
<a-col :span="12">
|
|
<a-form-item label="创建人">
|
|
<a-form-item label="创建人">
|
|
- <a-input disabled placeholder="回显创建人" />
|
|
|
|
|
|
+ <!-- <a-input disabled placeholder="回显创建人" /> -->
|
|
|
|
+ <a-input
|
|
|
|
+ v-decorator="['createBy', { rules: [{ required: false, message: '请输入创建人' }] }]"
|
|
|
|
+ disabled
|
|
|
|
+ />
|
|
</a-form-item>
|
|
</a-form-item>
|
|
</a-col>
|
|
</a-col>
|
|
|
|
|
|
@@ -73,6 +77,7 @@
|
|
format="YYYY-MM-DD HH:mm:ss"
|
|
format="YYYY-MM-DD HH:mm:ss"
|
|
@change="createTimeChange"
|
|
@change="createTimeChange"
|
|
@ok="createTimeOk"
|
|
@ok="createTimeOk"
|
|
|
|
+ v-decorator="['createTime', { rules: [{ required: false, message: '请选择紧创建日期' }] }]"
|
|
/>
|
|
/>
|
|
</a-form-item>
|
|
</a-form-item>
|
|
</a-col>
|
|
</a-col>
|
|
@@ -83,7 +88,7 @@
|
|
<a-col :span="12">
|
|
<a-col :span="12">
|
|
<a-form-item label="简介:" style="marginBottom:0;">
|
|
<a-form-item label="简介:" style="marginBottom:0;">
|
|
<a-textarea
|
|
<a-textarea
|
|
- v-decorator="['memo', { rules: [{ required: true, message: '请输入入简介' }] }]"
|
|
|
|
|
|
+ v-decorator="['briefIntroduction', { rules: [{ required: true, message: '请输入入简介' }] }]"
|
|
placeholder="请输入简介"
|
|
placeholder="请输入简介"
|
|
style="minHeight:200px;width:1200px;"
|
|
style="minHeight:200px;width:1200px;"
|
|
/>
|
|
/>
|
|
@@ -119,26 +124,58 @@ export default {
|
|
data () {
|
|
data () {
|
|
return {
|
|
return {
|
|
addLinkform: this.$form.createForm(this),
|
|
addLinkform: this.$form.createForm(this),
|
|
- title: '', // 弹框标题
|
|
|
|
confirmLoading: false,
|
|
confirmLoading: false,
|
|
addLinksModVis: false,
|
|
addLinksModVis: false,
|
|
- linkInfo: {} // 表单数据(回显)
|
|
|
|
|
|
+ linkInfo: {}, // 表单数据(回显)
|
|
|
|
+ title: '' // 弹框标题
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ // 接收父组件查询友情链接的方法
|
|
|
|
+ props: {
|
|
|
|
+ fatherGetList: {
|
|
|
|
+ type: Function,
|
|
|
|
+ default: null
|
|
}
|
|
}
|
|
},
|
|
},
|
|
created () {},
|
|
created () {},
|
|
methods: {
|
|
methods: {
|
|
- // 弹框确定
|
|
|
|
|
|
+ // 回显表单
|
|
|
|
+ getLinkInfo () {
|
|
|
|
+ this.$nextTick(() => {
|
|
|
|
+ // 判断是否回显(创建人、创建日期)
|
|
|
|
+ if (this.title == '新增友情链接') {
|
|
|
|
+ this.addLinkform.setFieldsValue({
|
|
|
|
+ name: this.linkInfo.name,
|
|
|
|
+ link: this.linkInfo.link,
|
|
|
|
+ // createBy: this.linkInfo.createBy,
|
|
|
|
+ // createTime: this.linkInfo.createTime,
|
|
|
|
+ briefIntroduction: this.linkInfo.briefIntroduction,
|
|
|
|
+ isRelease: this.linkInfo.isRelease
|
|
|
|
+ })
|
|
|
|
+ } else {
|
|
|
|
+ this.addLinkform.setFieldsValue({
|
|
|
|
+ name: this.linkInfo.name,
|
|
|
|
+ link: this.linkInfo.link,
|
|
|
|
+ briefIntroduction: this.linkInfo.briefIntroduction,
|
|
|
|
+ isRelease: this.linkInfo.isRelease,
|
|
|
|
+ createBy: this.linkInfo.createBy,
|
|
|
|
+ createTime: moment(this.linkInfo.createTime, 'YYYY-MM-DD HH:mm:ss')
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ // 弹框确定
|
|
onSubmit () {
|
|
onSubmit () {
|
|
this.addLinkform.validateFields((err, res) => {
|
|
this.addLinkform.validateFields((err, res) => {
|
|
console.log('err, res', err, res)
|
|
console.log('err, res', err, res)
|
|
- if (res) {
|
|
|
|
|
|
+ if (res && res !== '') {
|
|
console.log('>>>>>>', res)
|
|
console.log('>>>>>>', res)
|
|
var linkObj = {}
|
|
var linkObj = {}
|
|
linkObj.name = res.name
|
|
linkObj.name = res.name
|
|
- linkObj.address = res.address
|
|
|
|
|
|
+ linkObj.link = res.link
|
|
linkObj.createBy = res.createBy
|
|
linkObj.createBy = res.createBy
|
|
linkObj.isRelease = res.isRelease
|
|
linkObj.isRelease = res.isRelease
|
|
- linkObj.memo = this.memo
|
|
|
|
|
|
+ linkObj.briefIntroduction = res.briefIntroduction // 简要介绍
|
|
// 编辑--------------------------------------
|
|
// 编辑--------------------------------------
|
|
if (this.linkInfo.id) {
|
|
if (this.linkInfo.id) {
|
|
linkObj.id = this.linkInfo.id
|
|
linkObj.id = this.linkInfo.id
|
|
@@ -159,7 +196,7 @@ export default {
|
|
this.addLinksModVis = false
|
|
this.addLinksModVis = false
|
|
this.$message.success('新增成功')
|
|
this.$message.success('新增成功')
|
|
this.addLinkform.resetFields() // 清空
|
|
this.addLinkform.resetFields() // 清空
|
|
- this.memo = '' // 清空富文本
|
|
|
|
|
|
+ this.briefIntroduction = '' // 简要介绍
|
|
this.fatherGetList()
|
|
this.fatherGetList()
|
|
}
|
|
}
|
|
})
|
|
})
|
|
@@ -177,6 +214,9 @@ export default {
|
|
},
|
|
},
|
|
handleCancel () {
|
|
handleCancel () {
|
|
this.close()
|
|
this.close()
|
|
|
|
+ // this.$emit('close')
|
|
|
|
+ // this.visible = false
|
|
|
|
+ // this.addLinkform.resetFields() // 清空表单
|
|
},
|
|
},
|
|
createTimeChange (value, dateString) {
|
|
createTimeChange (value, dateString) {
|
|
console.log('选择的时间:', value)
|
|
console.log('选择的时间:', value)
|