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