|
@ -22,9 +22,9 @@ export default { |
|
|
data () { |
|
|
data () { |
|
|
return { |
|
|
return { |
|
|
visible: false, |
|
|
visible: false, |
|
|
dataForm: {; |
|
|
dataForm: { |
|
|
#foreach($column in $columns) |
|
|
#foreach($column in $columns) |
|
|
${column.attrname}: ''#if($velocityCount != $columns.size()),;#end |
|
|
${column.attrname}: ''#if($velocityCount != $columns.size()),#end |
|
|
|
|
|
|
|
|
#end |
|
|
#end |
|
|
} |
|
|
} |
|
@ -32,12 +32,12 @@ export default { |
|
|
}, |
|
|
}, |
|
|
computed: { |
|
|
computed: { |
|
|
dataRule () { |
|
|
dataRule () { |
|
|
return {; |
|
|
return { |
|
|
#foreach($column in $columns) |
|
|
#foreach($column in $columns) |
|
|
#if($column.columnName != $pk.columnName) |
|
|
#if($column.columnName != $pk.columnName) |
|
|
${column.attrname}: [ |
|
|
${column.attrname}: [ |
|
|
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|
|
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|
|
]#if($velocityCount != $columns.size()),;#end |
|
|
]#if($velocityCount != $columns.size()),#end |
|
|
|
|
|
|
|
|
#end |
|
|
#end |
|
|
#end |
|
|
#end |
|
@ -46,19 +46,19 @@ export default { |
|
|
}, |
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
init () { |
|
|
init () { |
|
|
this.visible = true; |
|
|
this.visible = true |
|
|
this.$nextTick(() => { |
|
|
this.$nextTick(() => { |
|
|
this.$refs['dataForm'].resetFields() |
|
|
this.$refs['dataForm'].resetFields() |
|
|
if (this.dataForm.${pk.attrname}); { |
|
|
if (this.dataForm.${pk.attrname}) { |
|
|
this.getInfo() |
|
|
this.getInfo() |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
// 获取信息 |
|
|
// 获取信息 |
|
|
getInfo () { |
|
|
getInfo () { |
|
|
#[[this.$http.get(]];#`/${moduleName}/${pathName}/#[[${]]#this.dataForm.${pk.attrname}}`;).then(({ data: res }) => { |
|
|
#[[this.$http.get(]]#`/${moduleName}/${pathName}/#[[${]]#this.dataForm.${pk.attrname}}`).then(({ data: res }) => { |
|
|
if (res.code !== 0) { |
|
|
if (res.code !== 0) { |
|
|
#[[;return this.$message.error(res.msg);]]# |
|
|
#[[return this.$message.error(res.msg)]]# |
|
|
} |
|
|
} |
|
|
this.dataForm = { |
|
|
this.dataForm = { |
|
|
...this.dataForm, |
|
|
...this.dataForm, |
|
@ -69,19 +69,19 @@ export default { |
|
|
// 表单提交 |
|
|
// 表单提交 |
|
|
dataFormSubmitHandle: debounce(function () { |
|
|
dataFormSubmitHandle: debounce(function () { |
|
|
#[[this.$refs['dataForm'].validate((valid) => {]]# |
|
|
#[[this.$refs['dataForm'].validate((valid) => {]]# |
|
|
if (!valid); { |
|
|
if (!valid) { |
|
|
return false |
|
|
return false |
|
|
} |
|
|
} |
|
|
#[[this.$http]];#[!this.dataForm.$;{pk.attrname} ? 'post' : 'put';]('/${moduleName}/${pathName}/', this.dataForm).then(({ data: res }) => { |
|
|
#[[this.$http]]#[!this.dataForm.${pk.attrname} ? 'post' : 'put']('/${moduleName}/${pathName}/', this.dataForm).then(({ data: res }) => { |
|
|
if (res.code !== 0) { |
|
|
if (res.code !== 0) { |
|
|
#[[;return this.$message.error(res.msg);]]# |
|
|
#[[return this.$message.error(res.msg)]]# |
|
|
} |
|
|
} |
|
|
this.$message({; |
|
|
this.$message({ |
|
|
#[[message;: this.$t('prompt.success'),;]]# |
|
|
#[[message: this.$t('prompt.success'),]]# |
|
|
type;: 'success', |
|
|
type: 'success', |
|
|
duration;: 500, |
|
|
duration: 500, |
|
|
onClose;: () => { |
|
|
onClose: () => { |
|
|
this.visible = false; |
|
|
this.visible = false |
|
|
this.$emit('refreshDataList') |
|
|
this.$emit('refreshDataList') |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|