从简单到复杂完善组织架构

This commit is contained in:
2025-04-18 18:24:08 +08:00
parent e615aefaee
commit c73a7b48fa
14 changed files with 78 additions and 238 deletions

View File

@@ -11,6 +11,7 @@
"dependencies": {
"@ant-design/icons-vue": "^7.0.1",
"ant-design-vue": "4.x",
"licia": "^1.48.0",
"vue": "^3.5.13",
"vue-router": "4"
},

8
client/pnpm-lock.yaml generated
View File

@@ -14,6 +14,9 @@ importers:
ant-design-vue:
specifier: 4.x
version: 4.2.6(vue@3.5.13)
licia:
specifier: ^1.48.0
version: 1.48.0
vue:
specifier: ^3.5.13
version: 3.5.13
@@ -681,6 +684,9 @@ packages:
libphonenumber-js@1.12.5:
resolution: {integrity: sha512-DOjiaVjjSmap12ztyb4QgoFmUe/GbgnEXHu+R7iowk0lzDIjScvPAm8cK9RYTEobbRb0OPlwlZUGTTJPJg13Kw==}
licia@1.48.0:
resolution: {integrity: sha512-bBWiT5CSdEtwuAHiYTJ74yItCjIFdHi4xiFk6BRDfKa+sdCpkUHp69YKb5udNOJlHDzFjNjcMgNZ/+wQIHrB8A==}
lodash-es@4.17.21:
resolution: {integrity: sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==}
@@ -1489,6 +1495,8 @@ snapshots:
libphonenumber-js@1.12.5: {}
licia@1.48.0: {}
lodash-es@4.17.21: {}
lodash@4.17.21: {}

View File

@@ -1,3 +1,5 @@
import {isArr} from "licia";
const information = {
debug: true,
baseUrl: 'http://localhost:8080',
@@ -17,4 +19,23 @@ export function amisRender(target, amisJson) {
enableAMISDebug: information.debug,
},
)
}
}
function parseEdges (edges) {
if (isArr(edges)) {
}
}
export function amisElideGraphQLAdaptor(payload, response, api, context) {
// console.log(payload, response, api, context)
let result = []
console.log(payload)
if (payload.data) {
let items = payload.data[Object.keys(payload.data)[0]]['edges']
for(let item of items) {
result.push(item.node)
}
}
return result
}

View File

@@ -28,17 +28,23 @@ onMounted(() => {
type: 'form',
api: {
method: 'post',
url: `${information.baseUrl}/graphql`,
dataType: 'application/json',
url: `${information.baseUrl}/jsonapi`,
data: {
// language=GraphQL
query: 'mutation {\n organization(op: UPSERT, data: {\n organizationName: "苹果"\n }) {\n edges {\n node {\n organizationId\n organizationName\n }\n }\n }\n}',
data: {
type: 'organization',
attributes: {
name: '${name}'
}
}
},
headers: {
'Content-Type': 'application/vnd.api+json'
}
},
body: [
{
type: 'input-text',
name: 'organizationName',
name: 'name',
label: '组织名称',
required: true,
},
@@ -47,6 +53,16 @@ onMounted(() => {
},
},
],
api: {
method: 'get',
url: `${information.baseUrl}/jsonapi/organization`,
data: {
page: {
size: '${perPage|default:undefined}',
number: '${page|default:undefined}',
}
},
},
columns: [
{
name: 'organizationId',