@voplus/morpho-document 6.0.44 → 6.0.46
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/data/tenant-service/TenantServiceStore.d.ts +23 -0
- package/es/data/tenant-service/TenantServiceStore.js +69 -0
- package/es/data/tenant-service/TenantServiceStore.js.map +1 -0
- package/es/data/tenant-service/hooks.d.ts +10 -0
- package/es/data/tenant-service/hooks.js +19 -0
- package/es/data/tenant-service/hooks.js.map +1 -0
- package/es/data/tenant-service/index.d.ts +4 -0
- package/es/data/tenant-service/index.js +5 -0
- package/es/data/tenant-service/index.js.map +1 -0
- package/es/data/tenant-service/interfaces.d.ts +17 -0
- package/es/data/tenant-service/interfaces.js +2 -0
- package/es/data/tenant-service/interfaces.js.map +1 -0
- package/es/data/tenant-service/types.d.ts +14 -0
- package/es/data/tenant-service/types.js +2 -0
- package/es/data/tenant-service/types.js.map +1 -0
- package/es/data/tenant-service-execution/TenantServiceExecutionStore.d.ts +21 -0
- package/es/data/tenant-service-execution/TenantServiceExecutionStore.js +61 -0
- package/es/data/tenant-service-execution/TenantServiceExecutionStore.js.map +1 -0
- package/es/data/tenant-service-execution/hooks.d.ts +10 -0
- package/es/data/tenant-service-execution/hooks.js +19 -0
- package/es/data/tenant-service-execution/hooks.js.map +1 -0
- package/es/data/tenant-service-execution/index.d.ts +4 -0
- package/es/data/tenant-service-execution/index.js +5 -0
- package/es/data/tenant-service-execution/index.js.map +1 -0
- package/es/data/tenant-service-execution/interfaces.d.ts +13 -0
- package/es/data/tenant-service-execution/interfaces.js +2 -0
- package/es/data/tenant-service-execution/interfaces.js.map +1 -0
- package/es/data/tenant-service-execution/types.d.ts +7 -0
- package/es/data/tenant-service-execution/types.js +2 -0
- package/es/data/tenant-service-execution/types.js.map +1 -0
- package/es/modules/tenant-service/components/TenantServiceHeader/index.d.ts +8 -0
- package/es/modules/tenant-service/components/TenantServiceHeader/index.js +19 -0
- package/es/modules/tenant-service/components/TenantServiceHeader/index.js.map +1 -0
- package/es/modules/tenant-service/components/TenantServiceHeader/index.less +12 -0
- package/es/modules/tenant-service/components/TenantServiceItem/index.d.ts +7 -0
- package/es/modules/tenant-service/components/TenantServiceItem/index.js +36 -0
- package/es/modules/tenant-service/components/TenantServiceItem/index.js.map +1 -0
- package/es/modules/tenant-service/components/TenantServiceItem/index.less +35 -0
- package/es/modules/tenant-service/components/TenantServiceList/index.d.ts +17 -0
- package/es/modules/tenant-service/components/TenantServiceList/index.js +68 -0
- package/es/modules/tenant-service/components/TenantServiceList/index.js.map +1 -0
- package/es/modules/tenant-service/components/TenantServiceList/index.less +12 -0
- package/es/modules/tenant-service/components/TenantServiceProperties/index.d.ts +22 -0
- package/es/modules/tenant-service/components/TenantServiceProperties/index.js +43 -0
- package/es/modules/tenant-service/components/TenantServiceProperties/index.js.map +1 -0
- package/es/modules/tenant-service/components/TenantServicePropertiesView/index.d.ts +9 -0
- package/es/modules/tenant-service/components/TenantServicePropertiesView/index.js +18 -0
- package/es/modules/tenant-service/components/TenantServicePropertiesView/index.js.map +1 -0
- package/es/modules/tenant-service/components/TenantServicePropertiesView/index.less +4 -0
- package/es/modules/tenant-service/components/TenantServiceQuickViewDialog/index.d.ts +8 -0
- package/es/modules/tenant-service/components/TenantServiceQuickViewDialog/index.js +13 -0
- package/es/modules/tenant-service/components/TenantServiceQuickViewDialog/index.js.map +1 -0
- package/es/modules/tenant-service/components/TenantServiceQuickViewDialog/index.less +7 -0
- package/es/modules/tenant-service/components/TenantServiceSelect/index.d.ts +12 -0
- package/es/modules/tenant-service/components/TenantServiceSelect/index.js +44 -0
- package/es/modules/tenant-service/components/TenantServiceSelect/index.js.map +1 -0
- package/es/modules/tenant-service/components/TenantServiceTabs/index.d.ts +8 -0
- package/es/modules/tenant-service/components/TenantServiceTabs/index.js +41 -0
- package/es/modules/tenant-service/components/TenantServiceTabs/index.js.map +1 -0
- package/es/modules/tenant-service/controls/TenantServiceMenu/index.d.ts +6 -0
- package/es/modules/tenant-service/controls/TenantServiceMenu/index.js +9 -0
- package/es/modules/tenant-service/controls/TenantServiceMenu/index.js.map +1 -0
- package/es/modules/tenant-service/pages/TenantServiceDefaultView/index.d.ts +3 -0
- package/es/modules/tenant-service/pages/TenantServiceDefaultView/index.js +36 -0
- package/es/modules/tenant-service/pages/TenantServiceDefaultView/index.js.map +1 -0
- package/es/modules/tenant-service/pages/TenantServiceDefaultView/index.less +17 -0
- package/es/pages/Signature/Envelope/EnvelopeRecipientView/index.js +42 -12
- package/es/pages/Signature/Envelope/EnvelopeRecipientView/index.js.map +1 -1
- package/es/pages/Signature/Envelope/EnvelopeRecipientView/index.less +77 -15
- package/es/pages/Signature/Envelope/EnvelopeRecipientView/state.d.ts +1 -0
- package/es/pages/Signature/Envelope/EnvelopeRecipientView/state.js +9 -0
- package/es/pages/Signature/Envelope/EnvelopeRecipientView/state.js.map +1 -1
- package/es/routes.d.ts +6 -0
- package/es/routes.js +14 -1
- package/es/routes.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ApiEndPoint } from "@voplus/api";
|
|
2
|
+
import { CountedMap, Store } from "@voplus/morpho-data";
|
|
3
|
+
import { EditTenantServiceOptions, LoadTenantServiceOptions } from "./types";
|
|
4
|
+
import { LoadDocumentListOptions } from "@voplus/morpho-document-core";
|
|
5
|
+
import { ITenantService } from "./interfaces";
|
|
6
|
+
/** Quotation store supply backend functions. */
|
|
7
|
+
export declare class TenantServiceStore extends Store {
|
|
8
|
+
readonly endpoint: ApiEndPoint;
|
|
9
|
+
/** Name of the store */
|
|
10
|
+
readonly name: string;
|
|
11
|
+
constructor(endpoint: ApiEndPoint);
|
|
12
|
+
/** All currently used corporate. */
|
|
13
|
+
readonly items: CountedMap<string, ITenantService>;
|
|
14
|
+
/** Edit an existing item on server. */
|
|
15
|
+
edit(id: string, options: EditTenantServiceOptions): Promise<void>;
|
|
16
|
+
/** Load a list of documents from server.
|
|
17
|
+
* @param {LoadDocumentListOptions}
|
|
18
|
+
*/
|
|
19
|
+
loadList(options?: LoadDocumentListOptions): Promise<ITenantService[]>;
|
|
20
|
+
load(id: string, options: LoadTenantServiceOptions): Promise<ITenantService>;
|
|
21
|
+
}
|
|
22
|
+
/** 响应钩子检索 IdentityStore */
|
|
23
|
+
export declare const useTenantServiceStore: () => TenantServiceStore;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { RequestBuilder } from "@voplus/api";
|
|
2
|
+
import { CountedMap, Store, useApplicationContext } from "@voplus/morpho-data";
|
|
3
|
+
import { observable } from "mobx";
|
|
4
|
+
const StoreName = "TenantServiceStore";
|
|
5
|
+
/** Quotation store supply backend functions. */
|
|
6
|
+
export class TenantServiceStore extends Store {
|
|
7
|
+
constructor(endpoint) {
|
|
8
|
+
super();
|
|
9
|
+
Object.defineProperty(this, "endpoint", {
|
|
10
|
+
enumerable: true,
|
|
11
|
+
configurable: true,
|
|
12
|
+
writable: true,
|
|
13
|
+
value: endpoint
|
|
14
|
+
});
|
|
15
|
+
/** Name of the store */
|
|
16
|
+
Object.defineProperty(this, "name", {
|
|
17
|
+
enumerable: true,
|
|
18
|
+
configurable: true,
|
|
19
|
+
writable: true,
|
|
20
|
+
value: StoreName
|
|
21
|
+
});
|
|
22
|
+
/** All currently used corporate. */
|
|
23
|
+
Object.defineProperty(this, "items", {
|
|
24
|
+
enumerable: true,
|
|
25
|
+
configurable: true,
|
|
26
|
+
writable: true,
|
|
27
|
+
value: new CountedMap((key) => ({ id: key, loaded: false }), observable.map([], { deep: true }))
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
/** Edit an existing item on server. */
|
|
31
|
+
async edit(id, options) {
|
|
32
|
+
await this.action(async () => {
|
|
33
|
+
const r = await this.endpoint.post(`/api/tenant/services/${id}`, new RequestBuilder().json(options.data));
|
|
34
|
+
const t = await r.json();
|
|
35
|
+
this.items.overwrite(t.id, t);
|
|
36
|
+
}, options);
|
|
37
|
+
}
|
|
38
|
+
/** Load a list of documents from server.
|
|
39
|
+
* @param {LoadDocumentListOptions}
|
|
40
|
+
*/
|
|
41
|
+
async loadList(options) {
|
|
42
|
+
let query = "";
|
|
43
|
+
if (options === null || options === void 0 ? void 0 : options.Includes) {
|
|
44
|
+
query = query.concat(`includes=${options.Includes}`);
|
|
45
|
+
}
|
|
46
|
+
if (query)
|
|
47
|
+
query = "?".concat(query);
|
|
48
|
+
const r = await this.endpoint.post(`/api/tenant/services${query}`, new RequestBuilder().json(options ? options : { Filters: [] }));
|
|
49
|
+
return (await r.json());
|
|
50
|
+
}
|
|
51
|
+
async load(id, options) {
|
|
52
|
+
let query = "";
|
|
53
|
+
if (options.includes)
|
|
54
|
+
query = query.concat(`includes=${options.includes}`);
|
|
55
|
+
if (query)
|
|
56
|
+
query = "?".concat(query);
|
|
57
|
+
const r = await this.endpoint.get(`/api/tenant/services/${id}${query}`);
|
|
58
|
+
return await r.json();
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
/** 响应钩子检索 IdentityStore */
|
|
62
|
+
export const useTenantServiceStore = () => {
|
|
63
|
+
const context = useApplicationContext();
|
|
64
|
+
if (!context.getService(StoreName)) {
|
|
65
|
+
context.registerService(new TenantServiceStore(context.api.currentEndPoint));
|
|
66
|
+
}
|
|
67
|
+
return context.getService(StoreName);
|
|
68
|
+
};
|
|
69
|
+
//# sourceMappingURL=TenantServiceStore.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TenantServiceStore.js","sourceRoot":"","sources":["../../../src/data/tenant-service/TenantServiceStore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,cAAc,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAG/E,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAIlC,MAAM,SAAS,GAAG,oBAAoB,CAAC;AAEvC,gDAAgD;AAChD,MAAM,OA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from "@voplus/morpho-document-core";
|
|
4
|
+
import { ITenantService } from "./interfaces";
|
|
5
|
+
/** React hook to retrieve a tenant service
|
|
6
|
+
* @param {string} id - id of the tenant service
|
|
7
|
+
* @param {LoadDocumentOptions} options - options
|
|
8
|
+
*/
|
|
9
|
+
export declare const useTenantService: (id: string, options?: LoadTenantServiceOptions) => ITenantService;
|
|
10
|
+
export declare const useTenantServiceListEffect: (list: ListDataContextState<ITenantService> | null, effect: (list: ITenantService[], total: number) => void, options?: LoadDocumentListOptions) => void;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { useLoadCountedMapItem } from "@voplus/morpho-data";
|
|
2
|
+
import { useListLoaderEffect } from "@voplus/morpho-ui/es/hooks";
|
|
3
|
+
import { useTenantServiceStore } from "./TenantServiceStore";
|
|
4
|
+
/** React hook to retrieve a tenant service
|
|
5
|
+
* @param {string} id - id of the tenant service
|
|
6
|
+
* @param {LoadDocumentOptions} options - options
|
|
7
|
+
*/
|
|
8
|
+
export const useTenantService = (id, options) => {
|
|
9
|
+
options = options ? options : {};
|
|
10
|
+
const store = useTenantServiceStore();
|
|
11
|
+
return useLoadCountedMapItem(id, store.items, (calculatedOptions) => store.load(id, calculatedOptions), options);
|
|
12
|
+
};
|
|
13
|
+
export const useTenantServiceListEffect = (list, effect, options) => {
|
|
14
|
+
const deps = options ? options : {};
|
|
15
|
+
const store = useTenantServiceStore();
|
|
16
|
+
// Call useListLoaderEffect and ensure won't load twice for same loading options.
|
|
17
|
+
return useListLoaderEffect(list, store.items, effect, () => store.loadList(options), [deps]);
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=hooks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hooks.js","sourceRoot":"","sources":["../../../src/data/tenant-service/hooks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAE5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAGjE,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAG7D;;;GAGG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,EAAU,EAAE,OAAkC,EAAE,EAAE;IAClF,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAE,EAA+B,CAAC;IAC/D,MAAM,KAAK,GAAG,qBAAqB,EAAE,CAAC;IACtC,OAAO,qBAAqB,CAC3B,EAAE,EACF,KAAK,CAAC,KAAK,EACX,CAAC,iBAAiB,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,iBAAiB,CAAC,EACxD,OAAO,CACP,CAAC;AACH,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,0BAA0B,GAAG,CACzC,IAAiD,EACjD,MAAuD,EACvD,OAAiC,EAChC,EAAE;IACH,MAAM,IAAI,GAAG,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAE,EAA8B,CAAC;IACjE,MAAM,KAAK,GAAG,qBAAqB,EAAE,CAAC;IAEtC,iFAAiF;IACjF,OAAO,mBAAmB,CAAC,IAAI,EAAE,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;AAC9F,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/data/tenant-service/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ILoadable } from "@voplus/morpho-data";
|
|
2
|
+
export interface ITenantService extends ILoadable {
|
|
3
|
+
/** id of the tenant service.
|
|
4
|
+
* 注意Alex给的是 id:number, 但如果是number有多个地方会报错
|
|
5
|
+
*/
|
|
6
|
+
id: string;
|
|
7
|
+
/** service id of the tenant service. */
|
|
8
|
+
serviceId: string;
|
|
9
|
+
/** name of the tenant service. */
|
|
10
|
+
name: string;
|
|
11
|
+
/** description of the tenant service. */
|
|
12
|
+
description: string;
|
|
13
|
+
/** is running of the tenant service. */
|
|
14
|
+
isRunning: boolean;
|
|
15
|
+
/** enable of the tenant service. */
|
|
16
|
+
enable?: boolean;
|
|
17
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/data/tenant-service/interfaces.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { LoadOptions, StoreActionOptions } from "@voplus/morpho-data";
|
|
2
|
+
import { ITenantService } from "./interfaces";
|
|
3
|
+
/** Custom load org contact options type */
|
|
4
|
+
export type LoadTenantServiceOptions = {
|
|
5
|
+
/** Comma separated include options e.g. path */
|
|
6
|
+
includes?: string;
|
|
7
|
+
} & LoadOptions<ITenantService>;
|
|
8
|
+
export type TenantServiceEditOptions = {
|
|
9
|
+
/** enable of the tenant service. */
|
|
10
|
+
Enable: boolean;
|
|
11
|
+
};
|
|
12
|
+
export type EditTenantServiceOptions = {
|
|
13
|
+
data: TenantServiceEditOptions;
|
|
14
|
+
} & StoreActionOptions;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/data/tenant-service/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ApiEndPoint } from "@voplus/api";
|
|
2
|
+
import { CountedMap, Store } from "@voplus/morpho-data";
|
|
3
|
+
import { LoadTenantServiceExecutionOptions } from "./types";
|
|
4
|
+
import { LoadDocumentListOptions } from "@voplus/morpho-document-core";
|
|
5
|
+
import { ITenantServiceExecution } from "./interfaces";
|
|
6
|
+
/** Quotation store supply backend functions. */
|
|
7
|
+
export declare class TenantServiceExecutionStore extends Store {
|
|
8
|
+
readonly endpoint: ApiEndPoint;
|
|
9
|
+
/** Name of the store */
|
|
10
|
+
readonly name: string;
|
|
11
|
+
constructor(endpoint: ApiEndPoint);
|
|
12
|
+
/** All currently used corporate. */
|
|
13
|
+
readonly items: CountedMap<string, ITenantServiceExecution>;
|
|
14
|
+
/** Load a list of documents from server.
|
|
15
|
+
* @param {LoadDocumentListOptions}
|
|
16
|
+
*/
|
|
17
|
+
loadList(options?: LoadDocumentListOptions): Promise<ITenantServiceExecution[]>;
|
|
18
|
+
load(id: string, options: LoadTenantServiceExecutionOptions): Promise<ITenantServiceExecution>;
|
|
19
|
+
}
|
|
20
|
+
/** 响应钩子检索 IdentityStore */
|
|
21
|
+
export declare const useTenantServiceExecutionStore: () => TenantServiceExecutionStore;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { RequestBuilder } from "@voplus/api";
|
|
2
|
+
import { CountedMap, Store, useApplicationContext } from "@voplus/morpho-data";
|
|
3
|
+
import { observable } from "mobx";
|
|
4
|
+
const StoreName = "TenantServiceExecutionStore";
|
|
5
|
+
/** Quotation store supply backend functions. */
|
|
6
|
+
export class TenantServiceExecutionStore extends Store {
|
|
7
|
+
constructor(endpoint) {
|
|
8
|
+
super();
|
|
9
|
+
Object.defineProperty(this, "endpoint", {
|
|
10
|
+
enumerable: true,
|
|
11
|
+
configurable: true,
|
|
12
|
+
writable: true,
|
|
13
|
+
value: endpoint
|
|
14
|
+
});
|
|
15
|
+
/** Name of the store */
|
|
16
|
+
Object.defineProperty(this, "name", {
|
|
17
|
+
enumerable: true,
|
|
18
|
+
configurable: true,
|
|
19
|
+
writable: true,
|
|
20
|
+
value: StoreName
|
|
21
|
+
});
|
|
22
|
+
/** All currently used corporate. */
|
|
23
|
+
Object.defineProperty(this, "items", {
|
|
24
|
+
enumerable: true,
|
|
25
|
+
configurable: true,
|
|
26
|
+
writable: true,
|
|
27
|
+
value: new CountedMap((key) => ({ id: key, loaded: false }), observable.map([], { deep: true }))
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
/** Load a list of documents from server.
|
|
31
|
+
* @param {LoadDocumentListOptions}
|
|
32
|
+
*/
|
|
33
|
+
async loadList(options) {
|
|
34
|
+
let query = "";
|
|
35
|
+
if (options === null || options === void 0 ? void 0 : options.Includes) {
|
|
36
|
+
query = query.concat(`includes=${options.Includes}`);
|
|
37
|
+
}
|
|
38
|
+
if (query)
|
|
39
|
+
query = "?".concat(query);
|
|
40
|
+
const r = await this.endpoint.post(`/api/tenant/services/execution${query}`, new RequestBuilder().json(options ? options : { Filters: [] }));
|
|
41
|
+
return (await r.json());
|
|
42
|
+
}
|
|
43
|
+
async load(id, options) {
|
|
44
|
+
let query = "";
|
|
45
|
+
if (options.includes)
|
|
46
|
+
query = query.concat(`includes=${options.includes}`);
|
|
47
|
+
if (query)
|
|
48
|
+
query = "?".concat(query);
|
|
49
|
+
const r = await this.endpoint.get(`/api/tenant/services/execution/${id}${query}`);
|
|
50
|
+
return await r.json();
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
/** 响应钩子检索 IdentityStore */
|
|
54
|
+
export const useTenantServiceExecutionStore = () => {
|
|
55
|
+
const context = useApplicationContext();
|
|
56
|
+
if (!context.getService(StoreName)) {
|
|
57
|
+
context.registerService(new TenantServiceExecutionStore(context.api.currentEndPoint));
|
|
58
|
+
}
|
|
59
|
+
return context.getService(StoreName);
|
|
60
|
+
};
|
|
61
|
+
//# sourceMappingURL=TenantServiceExecutionStore.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TenantServiceExecutionStore.js","sourceRoot":"","sources":["../../../src/data/tenant-service-execution/TenantServiceExecutionStore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,cAAc,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC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,IAAI,OAAO,CAAC,QAAQ;YAAE,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,YAAY,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;QAC3E,IAAI,KAAK;YAAE,KAAK,GAAG,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACrC,MAAM,CAAC,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,kCAAkC,EAAE,GAAG,KAAK,EAAE,CAAC,CAAC;QAClF,OAAO,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC;IACvB,CAAC;CACD;AAED,2BAA2B;AAC3B,MAAM,CAAC,MAAM,8BAA8B,GAAG,GAAG,EAAE;IAClD,MAAM,OAAO,GAAG,qBAAqB,EAAE,CAAC;IACxC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC;QACpC,OAAO,CAAC,eAAe,CAAC,IAAI,2BAA2B,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC,CAAC;IACvF,CAAC;IACD,OAAO,OAAO,CAAC,UAAU,CAAC,SAAS,CAAiC,CAAC;AACtE,CAAC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ListDataContextState } from "@voplus/morpho-ui/es/data";
|
|
2
|
+
import { LoadTenantServiceExecutionOptions } from ".";
|
|
3
|
+
import { LoadDocumentListOptions } from "@voplus/morpho-document-core";
|
|
4
|
+
import { ITenantServiceExecution } from "./interfaces";
|
|
5
|
+
/** React hook to retrieve a tenant service execution
|
|
6
|
+
* @param {string} id - id of the tenant service execution
|
|
7
|
+
* @param {LoadDocumentOptions} options - options
|
|
8
|
+
*/
|
|
9
|
+
export declare const useTenantServiceExecution: (id: string, options?: LoadTenantServiceExecutionOptions) => ITenantServiceExecution;
|
|
10
|
+
export declare const useTenantServiceListEffect: (list: ListDataContextState<ITenantServiceExecution> | null, effect: (list: ITenantServiceExecution[], total: number) => void, options?: LoadDocumentListOptions) => void;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { useLoadCountedMapItem } from "@voplus/morpho-data";
|
|
2
|
+
import { useListLoaderEffect } from "@voplus/morpho-ui/es/hooks";
|
|
3
|
+
import { useTenantServiceExecutionStore } from "./TenantServiceExecutionStore";
|
|
4
|
+
/** React hook to retrieve a tenant service execution
|
|
5
|
+
* @param {string} id - id of the tenant service execution
|
|
6
|
+
* @param {LoadDocumentOptions} options - options
|
|
7
|
+
*/
|
|
8
|
+
export const useTenantServiceExecution = (id, options) => {
|
|
9
|
+
options = options ? options : {};
|
|
10
|
+
const store = useTenantServiceExecutionStore();
|
|
11
|
+
return useLoadCountedMapItem(id, store.items, (calculatedOptions) => store.load(id, calculatedOptions), options);
|
|
12
|
+
};
|
|
13
|
+
export const useTenantServiceListEffect = (list, effect, options) => {
|
|
14
|
+
const deps = options ? options : {};
|
|
15
|
+
const store = useTenantServiceExecutionStore();
|
|
16
|
+
// Call useListLoaderEffect and ensure won't load twice for same loading options.
|
|
17
|
+
return useListLoaderEffect(list, store.items, effect, () => store.loadList(options), [deps]);
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=hooks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hooks.js","sourceRoot":"","sources":["../../../src/data/tenant-service-execution/hooks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAE5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAGjE,OAAO,EAAE,8BAA8B,EAAE,MAAM,+BAA+B,CAAC;AAG/E;;;GAGG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,CACxC,EAAU,EACV,OAA2C,EAC1C,EAAE;IACH,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAE,EAAwC,CAAC;IACxE,MAAM,KAAK,GAAG,8BAA8B,EAAE,CAAC;IAC/C,OAAO,qBAAqB,CAC3B,EAAE,EACF,KAAK,CAAC,KAAK,EACX,CAAC,iBAAiB,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,iBAAiB,CAAC,EACxD,OAAO,CACP,CAAC;AACH,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,0BAA0B,GAAG,CACzC,IAA0D,EAC1D,MAAgE,EAChE,OAAiC,EAChC,EAAE;IACH,MAAM,IAAI,GAAG,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAE,EAA8B,CAAC;IACjE,MAAM,KAAK,GAAG,8BAA8B,EAAE,CAAC;IAE/C,iFAAiF;IACjF,OAAO,mBAAmB,CAAC,IAAI,EAAE,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;AAC9F,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/data/tenant-service-execution/index.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAC;AAC9C,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ILoadable } from "@voplus/morpho-data";
|
|
2
|
+
export interface ITenantServiceExecution extends ILoadable {
|
|
3
|
+
/** id of the tenant service execution.
|
|
4
|
+
* 注意Alex给的是 id:number, 但如果是number有多个地方会报错
|
|
5
|
+
*/
|
|
6
|
+
id: string;
|
|
7
|
+
/** start time of the tenant service execution. */
|
|
8
|
+
startTime?: Date;
|
|
9
|
+
/** complete time of the tenant service execution. */
|
|
10
|
+
completeTime?: Date;
|
|
11
|
+
/** message of the tenant service execution. */
|
|
12
|
+
message?: string;
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/data/tenant-service-execution/interfaces.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { LoadOptions } from "@voplus/morpho-data";
|
|
2
|
+
import { ITenantServiceExecution } from "./interfaces";
|
|
3
|
+
/** Custom load org contact options type */
|
|
4
|
+
export type LoadTenantServiceExecutionOptions = {
|
|
5
|
+
/** Comma separated include options e.g. path */
|
|
6
|
+
includes?: string;
|
|
7
|
+
} & LoadOptions<ITenantServiceExecution>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/data/tenant-service-execution/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import "./index.less";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { ITenantService } from "../../../../data/tenant-service";
|
|
4
|
+
declare const TenantServiceHeader: (props: {
|
|
5
|
+
id: string;
|
|
6
|
+
data?: ITenantService;
|
|
7
|
+
}) => React.JSX.Element;
|
|
8
|
+
export default TenantServiceHeader;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import "./index.less";
|
|
2
|
+
import ToolBar from "../../../../controls/ToolBar/ToolBar2";
|
|
3
|
+
import { Open } from "../../../../controls/ToolBar/buttons";
|
|
4
|
+
import { observe } from "@voplus/morpho-ui";
|
|
5
|
+
import React from "react";
|
|
6
|
+
import Routes from "../../../../routes";
|
|
7
|
+
import TenantServiceMenu from "../../controls/TenantServiceMenu";
|
|
8
|
+
const TenantServiceHeader = (props) => {
|
|
9
|
+
const id = props.id;
|
|
10
|
+
// const tenantService = useTenantService(id);
|
|
11
|
+
const tenantService = props.data;
|
|
12
|
+
return observe(() => (React.createElement("div", { className: "tenant-service-header" },
|
|
13
|
+
React.createElement("div", null, tenantService.name),
|
|
14
|
+
React.createElement(ToolBar, { showMenu: false },
|
|
15
|
+
React.createElement(Open, { url: Routes.TenantService.getUrl(id) }),
|
|
16
|
+
React.createElement(TenantServiceMenu, { id: id, closeAside: true })))));
|
|
17
|
+
};
|
|
18
|
+
export default TenantServiceHeader;
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/tenant-service/components/TenantServiceHeader/index.tsx"],"names":[],"mappings":"AAAA,OAAO,cAAc,CAAC;AAEtB,OAAO,OAAO,MAAM,uCAAuC,CAAC;AAC5D,OAAO,EAAE,IAAI,EAAE,MAAM,sCAAsC,CAAC;AAC5D,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,MAAM,MAAM,oBAAoB,CAAC;AACxC,OAAO,iBAAiB,MAAM,kCAAkC,CAAC;AAEjE,MAAM,mBAAmB,GAAG,CAAC,KAA4C,EAAE,EAAE;IAC5E,MAAM,EAAE,GAAG,KAAK,CAAC,EAAE,CAAC;IACpB,8CAA8C;IAC9C,MAAM,aAAa,GAAG,KAAK,CAAC,IAAK,CAAC;IAElC,OAAO,OAAO,CAAC,GAAG,EAAE,CAAC,CACpB,6BAAK,SAAS,EAAC,uBAAuB;QACrC,iCAAM,aAAa,CAAC,IAAI,CAAO;QAC/B,oBAAC,OAAO,IAAC,QAAQ,EAAE,KAAK;YACvB,oBAAC,IAAI,IAAC,GAAG,EAAE,MAAM,CAAC,aAAa,CAAC,MAAM,CAAC,EAAE,CAAC,GAAI;YAC9C,oBAAC,iBAAiB,IAAC,EAAE,EAAE,EAAE,EAAE,UAAU,EAAE,IAAI,GAAI,CACtC,CACL,CACN,CAAC,CAAC;AACJ,CAAC,CAAC;AACF,eAAe,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import ToolBar from "../../../../controls/ToolBar/ToolBar2";
|
|
2
|
+
import { Open } from "../../../../controls/ToolBar/buttons";
|
|
3
|
+
import ItemFunction from "@voplus/morpho-org/es/controls/ItemFunction";
|
|
4
|
+
import { observe } from "@voplus/morpho-ui";
|
|
5
|
+
import { ColumnItem, ColumnItemCol } from "@voplus/morpho-ui/es/controls/ColumnItem";
|
|
6
|
+
import { Badge } from "antd";
|
|
7
|
+
import classnames from "classnames";
|
|
8
|
+
import React, { useState } from "react";
|
|
9
|
+
import Routes from "../../../../routes";
|
|
10
|
+
import TenantServiceMenu from "../../controls/TenantServiceMenu";
|
|
11
|
+
import PropertiesView from "../TenantServicePropertiesView";
|
|
12
|
+
import TenantServiceQuickViewDialog from "../TenantServiceQuickViewDialog";
|
|
13
|
+
import styles from "./index.less";
|
|
14
|
+
const TenantServiceItem = (props) => {
|
|
15
|
+
const { id } = props;
|
|
16
|
+
// const tenantService = useTenantService(id);
|
|
17
|
+
const tenantService = props.data;
|
|
18
|
+
const [hover, setHover] = useState(false);
|
|
19
|
+
return observe(() => (
|
|
20
|
+
// <Skeleton active loading={tenantService.loading}>
|
|
21
|
+
React.createElement(ItemFunction, { className: styles["tenant-service-item"], onMouseOver: () => setHover(true), onMouseLeave: () => setHover(false), propertiesView: React.createElement(PropertiesView, { id: id, data: tenantService }), quickViewDialog: (onCancel) => (React.createElement(TenantServiceQuickViewDialog, { id: id, visible: true, onCancel: onCancel })) },
|
|
22
|
+
React.createElement(ColumnItem, { className: "tenant-service-column-item" },
|
|
23
|
+
React.createElement(ColumnItemCol, { span: 18 },
|
|
24
|
+
React.createElement("div", { className: "tenant-service-item-name" }, `${tenantService.name}`),
|
|
25
|
+
React.createElement("div", { className: "text-gray-400 text-xs" }, tenantService.description)),
|
|
26
|
+
React.createElement(ColumnItemCol, { span: 6, align: "flex-end" },
|
|
27
|
+
React.createElement("div", { className: classnames("tenant-service-running", { hide: hover }) }, tenantService.isRunning ? React.createElement(Badge, { color: "green", text: "Running" }) : null),
|
|
28
|
+
React.createElement("div", { className: classnames("tenant-service-item-tool", { show: hover }) },
|
|
29
|
+
React.createElement(ToolBar, { showMenu: false },
|
|
30
|
+
React.createElement(Open, { url: Routes.TenantService.getUrl(id) }),
|
|
31
|
+
React.createElement(TenantServiceMenu, { id: id, closeAside: true }))))))
|
|
32
|
+
// </Skeleton>
|
|
33
|
+
));
|
|
34
|
+
};
|
|
35
|
+
export default TenantServiceItem;
|
|
36
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/tenant-service/components/TenantServiceItem/index.tsx"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,uCAAuC,CAAC;AAC5D,OAAO,EAAE,IAAI,EAAE,MAAM,sCAAsC,CAAC;AAC5D,OAAO,YAAY,MAAM,6CAA6C,CAAC;AACvE,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,0CAA0C,CAAC;AACrF,OAAO,EAAY,KAAK,EAAE,MAAM,MAAM,CAAC;AACvC,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAExC,OAAO,MAAM,MAAM,oBAAoB,CAAC;AACxC,OAAO,iBAAiB,MAAM,kCAAkC,CAAC;AACjE,OAAO,cAAc,MAAM,gCAAgC,CAAC;AAC5D,OAAO,4BAA4B,MAAM,iCAAiC,CAAC;AAC3E,OAAO,MAAM,MAAM,cAAc,CAAC;AAElC,MAAM,iBAAiB,GAAG,CAAC,KAA4C,EAAE,EAAE;IAC1E,MAAM,EAAE,EAAE,EAAE,GAAG,KAAK,CAAC;IACrB,8CAA8C;IAC9C,MAAM,aAAa,GAAG,KAAK,CAAC,IAAK,CAAC;IAClC,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAE1C,OAAO,OAAO,CAAC,GAAG,EAAE,CAAC;IACpB,oDAAoD;IACpD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E,EAAE,UAAU,EAAE,IAAI,GAAI,CACtC,CACL,CACS,CACJ,CACC;IACf,cAAc;KACd,CAAC,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
@import "~@voplus/morpho-theme/styles/index.less";
|
|
2
|
+
|
|
3
|
+
.tenant-service-item {
|
|
4
|
+
cursor: pointer;
|
|
5
|
+
|
|
6
|
+
&:hover {
|
|
7
|
+
background-color: #f5f8fd;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
:global {
|
|
11
|
+
.tenant-service-item-name {
|
|
12
|
+
color: #575757;
|
|
13
|
+
font-weight: 500;
|
|
14
|
+
word-break: break-all;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.tenant-service-running {
|
|
18
|
+
&.hide {
|
|
19
|
+
display: none;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.tenant-service-item-tool {
|
|
24
|
+
display: none;
|
|
25
|
+
|
|
26
|
+
&.show {
|
|
27
|
+
display: block;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.tenant-service-column-item {
|
|
32
|
+
padding: 10px 20px;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ITenantService } from "../../../../data/tenant-service";
|
|
3
|
+
declare const TenantServiceList: (props: {
|
|
4
|
+
/** filter by id */
|
|
5
|
+
centerId?: string | undefined;
|
|
6
|
+
/** title */
|
|
7
|
+
viewTitle?: React.ReactNode;
|
|
8
|
+
/** 是否显示 total */
|
|
9
|
+
total?: boolean | undefined;
|
|
10
|
+
/** 是否允在 listView 内部打开 aside */
|
|
11
|
+
asideable?: boolean | undefined;
|
|
12
|
+
/** Call back when received total number of tenant-service. */
|
|
13
|
+
onTotal?: ((total: number) => void) | undefined;
|
|
14
|
+
/** Call back when an item has been clicked on the list. */
|
|
15
|
+
onClickItem?: ((item: ITenantService) => void) | undefined;
|
|
16
|
+
}) => React.JSX.Element;
|
|
17
|
+
export default TenantServiceList;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { observe, useRenderOnChange } from "@voplus/morpho-ui";
|
|
2
|
+
import { ListDataContext, useCreateListDataState } from "@voplus/morpho-ui/es/data";
|
|
3
|
+
import React, { useState } from "react";
|
|
4
|
+
import { useTenantServiceListEffect } from "../../../../data/tenant-service";
|
|
5
|
+
import { Badge } from "antd";
|
|
6
|
+
import DocumentItemFrame from "../../../../controls/DocumentItemFrame";
|
|
7
|
+
import ListView from "@voplus/morpho-ui/es/components/layout/ListView/ListView2";
|
|
8
|
+
import TenantServiceItem from "../TenantServiceItem";
|
|
9
|
+
import styles from "./index.less";
|
|
10
|
+
const TenantServiceList = (props) => {
|
|
11
|
+
const { centerId, viewTitle, total, asideable } = props;
|
|
12
|
+
const [activeId, setActiveId] = useState("");
|
|
13
|
+
const [tenantServiceTotal, setTenantServiceTotal] = useState(0);
|
|
14
|
+
const list = useCreateListDataState({
|
|
15
|
+
filterDefaults: {
|
|
16
|
+
filters: [],
|
|
17
|
+
},
|
|
18
|
+
}, [centerId]);
|
|
19
|
+
useRenderOnChange(() => list.filters.options);
|
|
20
|
+
/** 把ListDataState传给useTenantServiceListEffect,使之可以自動更新loading, hasmore. */
|
|
21
|
+
useTenantServiceListEffect(list, (result, total) => {
|
|
22
|
+
var _a;
|
|
23
|
+
list.union(result);
|
|
24
|
+
setTenantServiceTotal(total);
|
|
25
|
+
(_a = props.onTotal) === null || _a === void 0 ? void 0 : _a.call(props, total);
|
|
26
|
+
}, {
|
|
27
|
+
Total: true,
|
|
28
|
+
...list.filters.options,
|
|
29
|
+
});
|
|
30
|
+
list.union([
|
|
31
|
+
{
|
|
32
|
+
id: "1",
|
|
33
|
+
serviceId: "123",
|
|
34
|
+
name: "Linked Sales Center",
|
|
35
|
+
description: "Principal manager endowed with full permissions, including the ability to change settings.Dedicated personnel tasked with the specific responsibility of invoice approval.",
|
|
36
|
+
isRunning: true,
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
id: "2",
|
|
40
|
+
serviceId: "234",
|
|
41
|
+
name: "Tenant Service 02",
|
|
42
|
+
description: "Personnel authorized to approve both invoices and bills.",
|
|
43
|
+
isRunning: false,
|
|
44
|
+
},
|
|
45
|
+
]);
|
|
46
|
+
return observe(() => (React.createElement(ListDataContext.Provider, { value: list },
|
|
47
|
+
React.createElement("div", { className: styles["tenant-service-list"] },
|
|
48
|
+
React.createElement(ListView, { headerProps: {
|
|
49
|
+
viewTitle: (React.createElement(React.Fragment, null,
|
|
50
|
+
React.createElement("span", { className: "margin-right-10" }, viewTitle || "Tenant Service"),
|
|
51
|
+
total && tenantServiceTotal ? (React.createElement(Badge, { count: tenantServiceTotal, overflowCount: 99 })) : null)),
|
|
52
|
+
addAble: false,
|
|
53
|
+
sortable: false,
|
|
54
|
+
quickSearch: true,
|
|
55
|
+
}, asideable: asideable, className: "tenant-service-list-content", renderItem: ({ item }) => (React.createElement(DocumentItemFrame, { key: item.id, frameProps: {
|
|
56
|
+
active: activeId === item.id,
|
|
57
|
+
hoverEffect: "none",
|
|
58
|
+
activeEffect: "border",
|
|
59
|
+
borderProps: { location: "right", color: "#1890ff ", size: "2px" },
|
|
60
|
+
}, onClick: () => {
|
|
61
|
+
var _a;
|
|
62
|
+
setActiveId(item.id);
|
|
63
|
+
(_a = props.onClickItem) === null || _a === void 0 ? void 0 : _a.call(props, item);
|
|
64
|
+
} },
|
|
65
|
+
React.createElement(TenantServiceItem, { id: item.id, data: item }))) })))));
|
|
66
|
+
};
|
|
67
|
+
export default TenantServiceList;
|
|
68
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/tenant-service/components/TenantServiceList/index.tsx"],"names":[],"mappings":"AAAA,OAAO,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