开始尝试进行业务化模板

This commit is contained in:
2025-03-27 23:42:53 +08:00
parent 7c6c387a07
commit dd9f966597
11 changed files with 166 additions and 34 deletions

View File

@@ -0,0 +1,78 @@
<script setup>
import {onMounted} from 'vue'
import {amisRender} from '@/utils.js'
onMounted(() => {
amisRender(
'#amis-organization',
information => {
return {
type: 'page',
body: [
{
type: 'tpl',
tpl: '${baseUrl}1',
},
{
type: 'crud',
syncLocation: false,
headerToolbar: [
{
type: 'action',
label: '新增组织',
level: 'primary',
actionType: 'dialog',
dialog: {
title: '新增组织',
body: {
type: 'form',
api: {
method: 'post',
url: `${information.baseUrl}/jsonapi/organization`,
dataType: 'application/vnd.api+json',
headers: {
'Content-Type': 'application/vnd.api+json',
},
data: {
type: 'user',
attributes: {
organizationName: '${organizationName}',
},
},
},
body: [
{
type: 'input-text',
name: 'organizationName',
label: '组织名称',
required: true,
},
],
},
},
},
],
columns: [
{
name: 'organizationId',
label: '组织编号',
},
{
name: 'organizationName',
label: '组织名称',
},
],
},
],
}
},
)
})
</script>
<template>
<div id="amis-organization"></div>
</template>
<style scoped>
</style>