mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-05-09 23:49:27 +08:00
* feat: add map plugin * feat: update * feat: add Map.Designer * feat: support polygon and clear canvas * feat: improve and support linestring * feat: map type default * feat: support group order * feat: support register group * feat: improve named and logic * fix: rename * feat: better * refactor: move to use postgresSQL supported type * feat: support circle * feat: support mysql * chore: @nocobase/plugin-map * fix: some error in postgres * fix: line lose * fix: accessKey or securityCode is incorrect * fix: improve * fix: shake screen in modal * feat: support serviceHOST * feat: improve * feat: support view map in detail * feat: support patten in details * fix: something went wrong in edit mode * fix: field name incorrectly * feat: support sqlite * feat: support circle in mysql * feat: support map configuration * feat: support map configuration * fix: remove unused div * feat: support show map in details * fix: disabled in details * fix: unused * feat: improve readpretty * fix: schemaInitialize * feat: improve alert and search * fix: mysql polygon not work * test: add fields test * test: improve * test: update * fix: test error * feat: improve search and support zoom * fix: if success should reset err message * feat: add isOverride to confirm * feat: improve
34 lines
925 B
TypeScript
34 lines
925 B
TypeScript
import React from 'react';
|
|
import { registerField, registerGroup, useCurrentAppInfo } from '@nocobase/client';
|
|
import { generateNTemplate } from './locales';
|
|
import './locales';
|
|
import { fields } from './fields';
|
|
import { useEffect } from 'react';
|
|
|
|
export const useRegisterInterface = () => {
|
|
const { data } = useCurrentAppInfo() || {};
|
|
useEffect(() => {
|
|
const dialect = data?.database.dialect;
|
|
if (!dialect) return;
|
|
|
|
registerGroup(fields[0].group, {
|
|
label: generateNTemplate('Map-based geometry'),
|
|
order: 51,
|
|
});
|
|
|
|
fields.forEach((field) => {
|
|
if (Array.isArray(field.dialects)) {
|
|
if (!field.dialects.includes(dialect)) {
|
|
return;
|
|
}
|
|
}
|
|
registerField(field.group, field.title, field);
|
|
});
|
|
}, [data]);
|
|
};
|
|
|
|
export const Initialize: React.FC = (props) => {
|
|
useRegisterInterface();
|
|
return <React.Fragment>{props.children}</React.Fragment>;
|
|
};
|