relation相关的component移成页面
This commit is contained in:
parent
19fa6123d3
commit
035286911e
|
|
@ -1,5 +0,0 @@
|
|||
/// <reference types="react" />
|
||||
declare const _default: (props: import("../../..").ReactComponentProps<import("oak-domain/lib/types").EntityDict & import("oak-domain/lib/base-app-domain").EntityDict, string | number, true, {
|
||||
onEntityClicked: (entity: string) => undefined;
|
||||
}>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
||||
export default _default;
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
/// <reference types="wechat-miniprogram" />
|
||||
/// <reference types="react" />
|
||||
declare const _default: (props: import("../../..").ReactComponentProps<import("oak-domain/lib/types").EntityDict & import("oak-domain/lib/base-app-domain").EntityDict, string | number, true, WechatMiniprogram.Component.DataOption>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
||||
export default _default;
|
||||
|
|
@ -9,12 +9,13 @@ exports.default = OakComponent({
|
|||
links: links,
|
||||
};
|
||||
},
|
||||
properties: {
|
||||
onEntityClicked: function (entity) { return undefined; },
|
||||
},
|
||||
methods: {
|
||||
onEntityClicked: function (entity) {
|
||||
this.props.onEntityClicked(entity);
|
||||
}
|
||||
this.features.navigator.navigateTo({
|
||||
url: '/relation/entity',
|
||||
}, {
|
||||
entity: entity,
|
||||
});
|
||||
},
|
||||
}
|
||||
});
|
||||
|
|
@ -2,7 +2,5 @@
|
|||
declare const _default: (props: import("../../..").ReactComponentProps<import("oak-domain/lib/types").EntityDict & import("oak-domain/lib/base-app-domain").EntityDict, "relation", true, {
|
||||
entity: string | number;
|
||||
entityId: string;
|
||||
onActionClicked: (id: string, entity: string) => undefined;
|
||||
onRelationClicked: (id: string, entity: string, entityId: string) => undefined;
|
||||
}>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
||||
export default _default;
|
||||
|
|
@ -66,8 +66,24 @@ exports.default = OakComponent({
|
|||
properties: {
|
||||
entity: '',
|
||||
entityId: '',
|
||||
onActionClicked: function (id, entity) { return undefined; },
|
||||
onRelationClicked: function (id, entity, entityId) { return undefined; },
|
||||
},
|
||||
features: ['relationAuth'],
|
||||
methods: {
|
||||
onActionClicked: function (id, entity) {
|
||||
this.features.navigator.navigateTo({
|
||||
url: '/relation/actionAuthBySource',
|
||||
}, {
|
||||
relationId: id,
|
||||
entity: entity,
|
||||
});
|
||||
},
|
||||
onRelationClicked: function (id, entity) {
|
||||
this.features.navigator.navigateTo({
|
||||
url: '/relation/relationAuthBySource',
|
||||
}, {
|
||||
relationId: id,
|
||||
entity: entity,
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
@ -6,7 +6,8 @@ declare type ED = EntityDict & BaseEntityDict;
|
|||
export default function render(props: WebComponentProps<ED, 'relation', true, {
|
||||
relations: RowWithActions<ED, 'relation'>[];
|
||||
hasRelationEntites: string[];
|
||||
}, {
|
||||
onActionClicked: (id: string, entity: keyof ED) => void;
|
||||
onRelationClicked: (id: string, entity: keyof ED) => void;
|
||||
}, {}>): JSX.Element;
|
||||
}>): JSX.Element;
|
||||
export {};
|
||||
|
|
@ -2,11 +2,12 @@
|
|||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var tslib_1 = require("tslib");
|
||||
var jsx_runtime_1 = require("react/jsx-runtime");
|
||||
var list_1 = tslib_1.__importDefault(require("../../list"));
|
||||
var filterPanel_1 = tslib_1.__importDefault(require("../../filterPanel"));
|
||||
var list_1 = tslib_1.__importDefault(require("../../../components/list"));
|
||||
var filterPanel_1 = tslib_1.__importDefault(require("../../../components/filterPanel"));
|
||||
var assert_1 = tslib_1.__importDefault(require("assert"));
|
||||
function render(props) {
|
||||
var _a = props.data, relations = _a.relations, oakLoading = _a.oakLoading, oakFullpath = _a.oakFullpath, hasRelationEntites = _a.hasRelationEntites, onActionClicked = _a.onActionClicked, onRelationClicked = _a.onRelationClicked;
|
||||
var _a = props.data, relations = _a.relations, oakLoading = _a.oakLoading, oakFullpath = _a.oakFullpath, hasRelationEntites = _a.hasRelationEntites;
|
||||
var _b = props.methods, onActionClicked = _b.onActionClicked, onRelationClicked = _b.onRelationClicked;
|
||||
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(filterPanel_1.default, { entity: "relation", oakPath: oakFullpath, columns: [
|
||||
{
|
||||
attr: 'entity',
|
||||
|
|
@ -17,12 +17,11 @@ export default OakComponent({
|
|||
helps: {} as Record<string, string>, // Record<string, string>;
|
||||
entity: '' as keyof ED,
|
||||
attributes: [] as OakAbsAttrUpsertDef<ED, keyof ED>[],
|
||||
data: {} as ED[keyof ED]['Schema'],
|
||||
layout: 'horizontal' as 'horizontal' | 'vertical',
|
||||
mode: 'default' as 'default' | 'card',
|
||||
},
|
||||
formData() {
|
||||
const { data, entity } = this.props;
|
||||
formData({ data }) {
|
||||
const { entity } = this.props;
|
||||
const { transformer } = this.state;
|
||||
const renderData = transformer(data!);
|
||||
const renderData1 = renderData?.map((ele) => {
|
||||
|
|
@ -57,11 +56,6 @@ export default OakComponent({
|
|||
data: {
|
||||
transformer: (() => []) as DataUpsertTransformer<ED, keyof ED>,
|
||||
},
|
||||
listeners: {
|
||||
data() {
|
||||
this.reRender();
|
||||
},
|
||||
},
|
||||
lifetimes: {
|
||||
async attached() {
|
||||
const { attributes, entity } = this.props;
|
||||
|
|
|
|||
|
|
@ -35,10 +35,10 @@ function makeAttrInput<T extends keyof ED>(
|
|||
const [sl, setSl] = useState(false);
|
||||
const [poi, setPoi] = useState<
|
||||
| {
|
||||
poiName: string;
|
||||
coordinate: [number, number];
|
||||
areaId: string;
|
||||
}
|
||||
poiName: string;
|
||||
coordinate: [number, number];
|
||||
areaId: string;
|
||||
}
|
||||
| undefined
|
||||
>(undefined);
|
||||
const {
|
||||
|
|
@ -335,10 +335,6 @@ export default function render<T extends keyof ED>(
|
|||
<Form
|
||||
labelCol={{ span: 4 }}
|
||||
layout="horizontal"
|
||||
style={{
|
||||
margin: '0px auto',
|
||||
maxWidth: '100%',
|
||||
}}
|
||||
>
|
||||
{renderData.map((ele) => {
|
||||
// 因为i18n渲染机制的缘故,t必须放到这里来计算
|
||||
|
|
|
|||
|
|
@ -9,12 +9,13 @@ export default OakComponent({
|
|||
links,
|
||||
};
|
||||
},
|
||||
properties: {
|
||||
onEntityClicked: (entity: string) => undefined,
|
||||
},
|
||||
methods: {
|
||||
onEntityClicked(entity: string) {
|
||||
this.props.onEntityClicked!(entity);
|
||||
}
|
||||
this.features.navigator.navigateTo({
|
||||
url: '/relation/entity',
|
||||
}, {
|
||||
entity,
|
||||
});
|
||||
},
|
||||
}
|
||||
});
|
||||
|
|
@ -69,8 +69,24 @@ export default OakComponent({
|
|||
properties: {
|
||||
entity: '' as keyof ED,
|
||||
entityId: '',
|
||||
onActionClicked: (id: string, entity: string) => undefined,
|
||||
onRelationClicked: (id: string, entity: string, entityId: string) => undefined,
|
||||
},
|
||||
features: ['relationAuth'],
|
||||
methods: {
|
||||
onActionClicked(id: string, entity: string) {
|
||||
this.features.navigator.navigateTo({
|
||||
url: '/relation/actionAuthBySource',
|
||||
}, {
|
||||
relationId: id,
|
||||
entity,
|
||||
});
|
||||
},
|
||||
onRelationClicked(id: string, entity: string) {
|
||||
this.features.navigator.navigateTo({
|
||||
url: '/relation/relationAuthBySource',
|
||||
}, {
|
||||
relationId: id,
|
||||
entity,
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
import PureList from '../../list';
|
||||
import FilterPanel from '../../filterPanel';
|
||||
import PureList from '../../../components/list';
|
||||
import FilterPanel from '../../../components/filterPanel';
|
||||
import { RowWithActions, WebComponentProps } from '../../../types/Page';
|
||||
import { EntityDict } from 'oak-domain/lib/types/Entity';
|
||||
import { EntityDict as BaseEntityDict } from 'oak-domain/lib/base-app-domain';
|
||||
|
|
@ -15,15 +15,15 @@ export default function render(
|
|||
{
|
||||
relations: RowWithActions<ED, 'relation'>[];
|
||||
hasRelationEntites: string[];
|
||||
onActionClicked: (id: string, entity: keyof ED) => void;
|
||||
onRelationClicked: (id: string, entity: keyof ED) => void;
|
||||
},
|
||||
{
|
||||
|
||||
onActionClicked: (id: string, entity: keyof ED) => void;
|
||||
onRelationClicked: (id: string, entity: keyof ED) => void;
|
||||
}
|
||||
>
|
||||
) {
|
||||
const { relations, oakLoading, oakFullpath, hasRelationEntites, onActionClicked, onRelationClicked } = props.data;
|
||||
const { relations, oakLoading, oakFullpath, hasRelationEntites } = props.data;
|
||||
const { onActionClicked, onRelationClicked } = props.methods;
|
||||
return (
|
||||
<>
|
||||
<FilterPanel
|
||||
Loading…
Reference in New Issue