inl-app-manager 0.0.1-lb
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/.yarnrc +0 -0
- package/README.md +195 -0
- package/createMonacoTheme.js +1250 -0
- package/dist/clientUtils/index.d.ts +357 -0
- package/dist/clientUtils/index.js +340 -0
- package/dist/elements/index.d.ts +153 -0
- package/dist/elements/index.js +15064 -0
- package/dist/iconfont.js +147 -0
- package/dist/index.d.ts +569 -0
- package/dist/index.js +21047 -0
- package/dist/style.css +3 -0
- package/entry.js +14 -0
- package/package.json +78 -0
- package/rollup.config.ts +96 -0
- package/v2 +3 -0
- package/yarn-error.log +3442 -0
package/.yarnrc
ADDED
|
File without changes
|
package/README.md
ADDED
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
# inl-card 使用文档
|
|
2
|
+
|
|
3
|
+
## 编辑引用
|
|
4
|
+
|
|
5
|
+
## 用户自定义卡片
|
|
6
|
+
|
|
7
|
+
`main.ts`
|
|
8
|
+
``` ts
|
|
9
|
+
import { createApp } from "vue";
|
|
10
|
+
// 引入inl-cards
|
|
11
|
+
import cards from "inl-card-v2/cards";
|
|
12
|
+
import "inl-card-v2/style.css";
|
|
13
|
+
import "inl-card-v2/iconfont.js";
|
|
14
|
+
// 项目主页
|
|
15
|
+
import main from "./index";
|
|
16
|
+
// 用户自定义卡片
|
|
17
|
+
import customCards from "./customCards";
|
|
18
|
+
import "./index.css";
|
|
19
|
+
|
|
20
|
+
const app = createApp(main);
|
|
21
|
+
// 把自带卡片和自定义卡片同时注册进去
|
|
22
|
+
app.use(customCards).use(cards).mount("#inl-card");
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
> `customCards(文件夹)`
|
|
26
|
+
> > `index.ts`
|
|
27
|
+
>
|
|
28
|
+
``` ts
|
|
29
|
+
import { App } from "vue";
|
|
30
|
+
import { cardCompInfo } from "inl-card-v2";
|
|
31
|
+
import cc from "./customCard";
|
|
32
|
+
|
|
33
|
+
const comp = [cc];
|
|
34
|
+
const components: Record<string, cardCompInfo> = {};
|
|
35
|
+
for (let i of comp) {
|
|
36
|
+
components[i.linkName] = {
|
|
37
|
+
comp: i.comp,
|
|
38
|
+
cname: i.cname,
|
|
39
|
+
linkName: i.linkName,
|
|
40
|
+
tags: i.tags,
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
export default {
|
|
44
|
+
install(app: App) {
|
|
45
|
+
for (let i of comp) {
|
|
46
|
+
app.component(i.linkName, i.comp);
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
cards: components,
|
|
50
|
+
version: "0.0.1",
|
|
51
|
+
};
|
|
52
|
+
```
|
|
53
|
+
> >
|
|
54
|
+
> > `customCard.tsx`
|
|
55
|
+
> >
|
|
56
|
+
``` ts
|
|
57
|
+
import { defineComponent } from "vue";
|
|
58
|
+
// 引入相关类型和默认组件
|
|
59
|
+
import {
|
|
60
|
+
cardBox,
|
|
61
|
+
createCardProps,
|
|
62
|
+
cardDefComponent,
|
|
63
|
+
cardTags,
|
|
64
|
+
cardHead,
|
|
65
|
+
cardBody,
|
|
66
|
+
} from "inl-card-v2";
|
|
67
|
+
|
|
68
|
+
const linkName = "inl-card-cdc";
|
|
69
|
+
const componentDetail = {
|
|
70
|
+
cname: "用户自定义卡片一",
|
|
71
|
+
linkName,
|
|
72
|
+
tags: [cardTags.anquan],
|
|
73
|
+
};
|
|
74
|
+
const props = createCardProps({});
|
|
75
|
+
const customCard = defineComponent({
|
|
76
|
+
props,
|
|
77
|
+
components: {
|
|
78
|
+
cardBox,
|
|
79
|
+
cardHead,
|
|
80
|
+
cardBody,
|
|
81
|
+
},
|
|
82
|
+
setup(props, ctx) {
|
|
83
|
+
return () => (
|
|
84
|
+
<cardBox
|
|
85
|
+
vSlots={{
|
|
86
|
+
// 卡片身体部分
|
|
87
|
+
cardBody: () => (
|
|
88
|
+
<cardBody
|
|
89
|
+
vSlots={{
|
|
90
|
+
customCardBody: () => <>asd</>,
|
|
91
|
+
}}
|
|
92
|
+
/>
|
|
93
|
+
),
|
|
94
|
+
// 卡片头部
|
|
95
|
+
cardHead: () => <cardHead title={componentDetail.cname} />,
|
|
96
|
+
}}
|
|
97
|
+
/>
|
|
98
|
+
);
|
|
99
|
+
},
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
export default cardDefComponent(customCard, componentDetail);
|
|
103
|
+
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
`index.tsx`
|
|
108
|
+
``` ts
|
|
109
|
+
import { defineComponent } from "vue";
|
|
110
|
+
import { cardEditor } from "inl-card-v2";
|
|
111
|
+
import customCards from "./customCards";
|
|
112
|
+
const components: Record<string, any> = {
|
|
113
|
+
cardEditor,
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
export default defineComponent({
|
|
117
|
+
components,
|
|
118
|
+
setup() {
|
|
119
|
+
const save = () => {
|
|
120
|
+
console.info("保存回调");
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
return () => (
|
|
124
|
+
<>
|
|
125
|
+
<cardEditor
|
|
126
|
+
onSaveCallback={save}
|
|
127
|
+
customCards={customCards.cards}
|
|
128
|
+
currentRecord={{
|
|
129
|
+
id: "479278807188275200",
|
|
130
|
+
createUser: "2",
|
|
131
|
+
createDt: "2023-04-03T05:22:52.000+00:00",
|
|
132
|
+
updateUser: "2",
|
|
133
|
+
updateDt: "2023-04-03T05:53:34.000+00:00",
|
|
134
|
+
pageName: "页面名称77",
|
|
135
|
+
pageDetail: 'pagejson'
|
|
136
|
+
}}
|
|
137
|
+
/>
|
|
138
|
+
</>
|
|
139
|
+
);
|
|
140
|
+
},
|
|
141
|
+
});
|
|
142
|
+
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
## 预览引用
|
|
146
|
+
``` tsx
|
|
147
|
+
import {productionComponent, cardEditor, PageInfo} from 'inl-card-v2';
|
|
148
|
+
import {defineComponent} from 'vue';
|
|
149
|
+
|
|
150
|
+
// componentProps
|
|
151
|
+
const props = {
|
|
152
|
+
pageInfo: {
|
|
153
|
+
type: Object as PropType<pageInfo>,
|
|
154
|
+
},
|
|
155
|
+
customCards: {
|
|
156
|
+
type: Object as PropType<Record<string, cardCompInfo>>,
|
|
157
|
+
default: {},
|
|
158
|
+
},
|
|
159
|
+
}
|
|
160
|
+
// use
|
|
161
|
+
export default defineComponent({
|
|
162
|
+
components: {
|
|
163
|
+
defineComponent
|
|
164
|
+
},
|
|
165
|
+
setup() {
|
|
166
|
+
const pageInfo: PageInfo;
|
|
167
|
+
return <>
|
|
168
|
+
<defineComponent customCards={} pageInfo={pageInfo} />
|
|
169
|
+
</>
|
|
170
|
+
}
|
|
171
|
+
})
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
### 通过IU+PC查询点地址和点数据(接口一)
|
|
175
|
+
> 用于应用中心的动态表格和状态属性首次查询。
|
|
176
|
+
``` ts
|
|
177
|
+
export const getPointData = async (params: {
|
|
178
|
+
instanceIdList: string[];
|
|
179
|
+
propertyCodeList: string[];
|
|
180
|
+
thingCode?: string; // 只查询同一类物模型
|
|
181
|
+
}): Promise<
|
|
182
|
+
Array<{
|
|
183
|
+
instanceId: string;
|
|
184
|
+
propertyIdAndPointInfo: Record<
|
|
185
|
+
string,
|
|
186
|
+
{ pointCode: string | null; value: string | boolean }
|
|
187
|
+
>;
|
|
188
|
+
}>
|
|
189
|
+
> => {
|
|
190
|
+
return await instance.post(
|
|
191
|
+
"/mtip/thing/v2/thingInstAdapter/getPrePointCodeAndValueByIuPC",
|
|
192
|
+
params
|
|
193
|
+
);
|
|
194
|
+
};
|
|
195
|
+
```
|