mirror of
https://github.com/jumpserver/lina.git
synced 2025-08-17 14:27:18 +00:00
Merge branch 'master' of https://github.com/jumpserver/lina
This commit is contained in:
commit
d4e5db9df2
@ -35,7 +35,6 @@ export default {
|
|||||||
type: Object,
|
type: Object,
|
||||||
default: () => ({})
|
default: () => ({})
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
<slot v-for="item in fields" :slot="`$id:${item.id}`" :name="`$id:${item.id}`" />
|
<slot v-for="item in fields" :slot="`$id:${item.id}`" :name="`$id:${item.id}`" />
|
||||||
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button v-for="button in moreButtons" :key="button.title" size="small" v-bind="button" @click="button.callback">{{ button.title }}</el-button>
|
<el-button v-for="button in moreButtons" :key="button.title" size="small" v-bind="button" @click="handleClick(button)">{{ button.title }}</el-button>
|
||||||
<el-button v-if="defaultButton" size="small" @click="resetForm('form')">{{ $tc('Reset') }}</el-button>
|
<el-button v-if="defaultButton" size="small" @click="resetForm('form')">{{ $tc('Reset') }}</el-button>
|
||||||
<el-button v-if="defaultButton" size="small" type="primary" @click="submitForm('form')">{{ $tc('Submit') }}</el-button>
|
<el-button v-if="defaultButton" size="small" type="primary" @click="submitForm('form')">{{ $tc('Submit') }}</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@ -66,6 +66,14 @@ export default {
|
|||||||
// 重置表单
|
// 重置表单
|
||||||
resetForm(formName) {
|
resetForm(formName) {
|
||||||
this.$refs[formName].resetFields()
|
this.$refs[formName].resetFields()
|
||||||
|
},
|
||||||
|
handleClick(button) {
|
||||||
|
const callback = button.callback || function(values, form) {
|
||||||
|
console.log('Click ', button.title, ': ', values)
|
||||||
|
}
|
||||||
|
const form = this.$refs['form']
|
||||||
|
const values = form.getFormValue()
|
||||||
|
callback(values, form)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
:initial="object"
|
:initial="object"
|
||||||
:update-success-next-route="successUrl"
|
:update-success-next-route="successUrl"
|
||||||
:clean-form-value="cleanFormValue"
|
:clean-form-value="cleanFormValue"
|
||||||
:object="object"
|
:object.sync="object"
|
||||||
:fields-meta="fieldsMeta"
|
:fields-meta="fieldsMeta"
|
||||||
:get-method="getMethod"
|
:get-method="getMethod"
|
||||||
/>
|
/>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<GenericCreateUpdatePage v-bind="$data" />
|
<GenericCreateUpdatePage v-bind="$data" @validate="console.log('hello')" />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
@ -55,8 +55,8 @@ export default {
|
|||||||
moreButtons: [
|
moreButtons: [
|
||||||
{
|
{
|
||||||
title: 'Test',
|
title: 'Test',
|
||||||
callback: function() {
|
callback: function(values) {
|
||||||
vm.$log.debug('hello')
|
vm.$log.debug('hello: ', values)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
Loading…
Reference in New Issue
Block a user