mirror of
https://github.com/jumpserver/lina.git
synced 2025-09-18 16:32:28 +00:00
[Update] 基本生成和创建
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<DataForm v-loading="loading" :fields="totalFields" v-bind="$attrs" v-on="$listeners">
|
||||
<slot v-for="item in totalFields" :slot="`id:${item.id}`" :name="`id:${item.id}`" />
|
||||
<slot v-for="item in totalFields" :slot="`$id:${item.id}`" :name="`$id:${item.id}`" />
|
||||
<slot v-for="item in fields" :slot="`id:${item}`" :name="`id:${item}`" />
|
||||
<slot v-for="item in fields" :slot="`$id:${item}`" :name="`$id:${item}`" />
|
||||
</DataForm>
|
||||
</template>
|
||||
|
||||
@@ -18,8 +18,7 @@ export default {
|
||||
props: {
|
||||
url: {
|
||||
type: String,
|
||||
// required: true,
|
||||
default: '/api/v1/users/users/'
|
||||
required: true,
|
||||
},
|
||||
method: {
|
||||
type: String,
|
||||
@@ -47,6 +46,7 @@ export default {
|
||||
},
|
||||
mounted() {
|
||||
this.optionUrlMeta()
|
||||
console.log('auto data form', this.$attrs)
|
||||
},
|
||||
methods: {
|
||||
optionUrlMeta() {
|
||||
|
@@ -3,7 +3,6 @@
|
||||
<div v-if="line" class="hr-line-dashed" />
|
||||
<h3>{{ title }}</h3>
|
||||
</div>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@@ -17,7 +16,6 @@ export default {
|
||||
type: Boolean,
|
||||
default: true
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
29
src/layout/components/GenericCreateUpdatePage/index.vue
Normal file
29
src/layout/components/GenericCreateUpdatePage/index.vue
Normal file
@@ -0,0 +1,29 @@
|
||||
<template>
|
||||
<Page>
|
||||
<IBox>
|
||||
<AutoDataForm v-bind="$attrs" v-on="$listeners">
|
||||
<slot v-for="item in $attrs.fields" :slot="`id:${item}`" :name="`id:${item}`" />
|
||||
<slot v-for="item in $attrs.fields" :slot="`$id:${item}`" :name="`$id:${item}`" />
|
||||
</AutoDataForm>
|
||||
</IBox>
|
||||
</Page>
|
||||
</template>
|
||||
<script>
|
||||
import { Page, IBox } from '@/layout/components'
|
||||
import AutoDataForm from '@/components/AutoDataForm'
|
||||
export default {
|
||||
name: 'GenericCreateUpdatePage',
|
||||
components: {
|
||||
Page, IBox, AutoDataForm
|
||||
},
|
||||
mounted() {
|
||||
console.log('generic', this.$attrs)
|
||||
console.log(this.$data)
|
||||
console.log(this.fields)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
@@ -8,3 +8,4 @@ export { default as SubMenuPage } from './SubMenuPage'
|
||||
export { default as Footer } from './Footer'
|
||||
export { default as IBox } from './IBox'
|
||||
export { default as GenericListPage } from './GenericListPage'
|
||||
export { default as GenericCreateUpdatePage } from './GenericCreateUpdatePage'
|
||||
|
@@ -1,31 +1,19 @@
|
||||
<template>
|
||||
<Page>
|
||||
<IBox>
|
||||
<AutoDataForm :form="form" :fields="fields" :fields-meta="fieldsMeta">
|
||||
<FormGroupHeader slot="id:name" title="账户" :line="false" />
|
||||
<FormGroupHeader slot="id:password_strategy" title="认证" :line="true" />
|
||||
<FormGroupHeader slot="id:role" title="角色安全" :line="true" />
|
||||
<FormGroupHeader slot="id:phone" title="认证" :line="true" />
|
||||
</AutoDataForm>
|
||||
</IBox>
|
||||
</Page>
|
||||
<GenericCreateUpdatePage :fields="fields" :form="form" :fields-meta="fieldsMeta" :url="url">
|
||||
<FormGroupHeader slot="id:name" title="账户" :line="false" />
|
||||
<FormGroupHeader slot="id:password_strategy" title="认证" :line="true" />
|
||||
<FormGroupHeader slot="id:role" title="角色安全" :line="true" />
|
||||
<FormGroupHeader slot="id:phone" title="认证" :line="true" />
|
||||
</GenericCreateUpdatePage>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
/* eslint-disable vue/no-unused-components */
|
||||
import FormGroupHeader from '@/components/formGroupHeader'
|
||||
import { Page, IBox } from '@/layout/components'
|
||||
import DataForm from '@/components/DataForm'
|
||||
import AutoDataForm from '@/components/AutoDataForm'
|
||||
import Select2 from '@/components/Select2'
|
||||
import { GenericCreateUpdatePage } from '@/layout/components'
|
||||
export default {
|
||||
components: {
|
||||
Page,
|
||||
IBox,
|
||||
DataForm,
|
||||
Select2,
|
||||
FormGroupHeader,
|
||||
AutoDataForm
|
||||
GenericCreateUpdatePage,
|
||||
FormGroupHeader
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@@ -40,6 +28,7 @@ export default {
|
||||
'name', 'username', 'email', 'groups', 'password_strategy', 'password', 'mfa_level',
|
||||
'source', 'role', 'date_expired', 'phone', 'wechat', 'comment'
|
||||
],
|
||||
url: '/api/v1/users/users/',
|
||||
fieldsMeta: {
|
||||
password: {
|
||||
el: {
|
||||
|
Reference in New Issue
Block a user