@tmesoft/data-screen-set 1.1.9 → 1.2.1
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/README.md +98 -23
- package/dist/data-screen-set-lib.d.ts +1 -1
- package/dist/data-screen-set-lib.es.js +5037 -5018
- package/dist/data-screen-set-lib.umd.js +48 -48
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,11 +1,24 @@
|
|
|
1
1
|
# data-screen-set
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
V1.1.0至V1.2.0之间版本为功能扩展过程中的产出,不建议使用,V1.2.0之后版本为正式发布版本
|
|
3
|
+
支持数据卡:用电排名、用电趋势、实验交流、实验成绩、仪器状态、安全、仪器使用、实验人次、实验报告、实验室运行、师资队伍、设备资产、预约开放、教研成果、通知公告(1.2.0新增);其他数据卡需在页面使用插槽编写
|
|
4
4
|
|
|
5
5
|
## 如何使用
|
|
6
6
|
用于渲染数据大屏设置
|
|
7
7
|
1. pnpm i @tmesoft/data-screen-set
|
|
8
8
|
|
|
9
|
+
## 版本说明
|
|
10
|
+
1.1.0以后的版本改动较大,新增加了theme主题,新增dataCardList入参替换原有dataCardIdListIds用于数据卡显示,如需升级请务必传入dataCardList,否则部分数据卡无法正常显示
|
|
11
|
+
|
|
12
|
+
## 更新说明
|
|
13
|
+
### V1.2.0
|
|
14
|
+
1. setDataCardListJson方法新增noRenderDataCardIds配置项(不需要渲染的数据卡id集合)
|
|
15
|
+
2. 新增dataCardList入参替换原有dataCardIdListIds用于数据卡显示
|
|
16
|
+
3. 增加theme主题风格适配(目前支持科技蓝、冰川青、香槟金配色)
|
|
17
|
+
4. 新增卡片-人员介绍自定义卡
|
|
18
|
+
5. 新增卡片-通知公告数据卡
|
|
19
|
+
6. 新增数据卡、自定义卡标题修改功能
|
|
20
|
+
7. 新增数据卡、自定义卡删除功能
|
|
21
|
+
|
|
9
22
|
## demo
|
|
10
23
|
|
|
11
24
|
[//]: # (App.vue文件)
|
|
@@ -51,12 +64,36 @@ dataScreenSetRef.value?.setDataCardListJson(
|
|
|
51
64
|
'实验人次':{id:7,idEditBtn:false},
|
|
52
65
|
'实验报告':{id:8,idEditBtn:false},
|
|
53
66
|
'实验成绩':{id:9,idEditBtn:false},
|
|
54
|
-
'实验交流':{id:10,idEditBtn:false}})})
|
|
67
|
+
'实验交流':{id:10,idEditBtn:false}})},[dataCardJson.今日课表.id, dataCardJson.开课情况.id])
|
|
55
68
|
// ------------------------------ 给子组件传递参数 ------------------------------
|
|
56
69
|
/**
|
|
57
70
|
* @description: 大屏标题
|
|
58
71
|
*/
|
|
59
72
|
const title = ref('智慧化实验室')
|
|
73
|
+
|
|
74
|
+
// 传入主题
|
|
75
|
+
const theme = ref('blue')
|
|
76
|
+
|
|
77
|
+
// 数据卡显示数据来源
|
|
78
|
+
const dataCardInfoData = ref<any>({})
|
|
79
|
+
// 所有的数据卡id集合
|
|
80
|
+
const dataCardList = ref<any[]>([
|
|
81
|
+
{
|
|
82
|
+
"id": 1,
|
|
83
|
+
"name": "师资队伍",
|
|
84
|
+
"type": 1
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
"id": 2,
|
|
88
|
+
"name": "科研成果",
|
|
89
|
+
"type": 1
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
"id": 3,
|
|
93
|
+
"name": "设备资产",
|
|
94
|
+
"type": 1
|
|
95
|
+
}
|
|
96
|
+
])
|
|
60
97
|
/**
|
|
61
98
|
* @description: 自定义卡列表坐标
|
|
62
99
|
*/
|
|
@@ -111,45 +148,83 @@ isEdit: false
|
|
|
111
148
|
const dataCardCoordinateList = ref([
|
|
112
149
|
{"id":1,"detail":{"left":0,"width":367,"top":75,"height":173}},
|
|
113
150
|
{"id":2,"detail":{"left":0,"width":365,"top":270,"height":172}},
|
|
114
|
-
{"id":3,"detail":{"left":0,"width":365,"top":455,"height":172}}
|
|
115
|
-
{"id":4,"detail":{"left":0,"width":379,"top":685,"height":179}},
|
|
116
|
-
{"id":5,"detail":{"left":370,"width":493,"top":75,"height":366}},
|
|
117
|
-
{"id":6,"detail":{"left":565,"width":540,"top":455,"height":158}},
|
|
118
|
-
{"id":7,"detail":{"left":865,"width":295,"top":70,"height":139}},
|
|
119
|
-
{"id":8,"detail":{"left":865,"width":365,"top":250,"height":172}},
|
|
120
|
-
{"id":9,"detail":{"left":1225,"width":276,"top":355,"height":131}},
|
|
121
|
-
{"id":10,"detail":{"left":895,"width":324,"top":695,"height":153}}])
|
|
151
|
+
{"id":3,"detail":{"left":0,"width":365,"top":455,"height":172}}])
|
|
122
152
|
// 当前拖拽卡片类型
|
|
123
153
|
const activeType = ref<CardType>()
|
|
124
154
|
// 当前拖拽卡片id
|
|
125
155
|
const activeId = ref<number>()
|
|
156
|
+
/**
|
|
157
|
+
* 修改自定义卡配置
|
|
158
|
+
* @param item 自定义卡
|
|
159
|
+
*/
|
|
160
|
+
const changeCustomCardConfig=(item: any) => {
|
|
161
|
+
return new Promise((resolve) => {
|
|
162
|
+
let index = customCardList.value.findIndex(itemItem => itemItem.id === item.id)
|
|
163
|
+
if (typeof item.name !== 'undefined') {
|
|
164
|
+
customCardList.value[index] = { ...customCardList.value[index], name: item.name }
|
|
165
|
+
}
|
|
166
|
+
if (typeof item.detail !== 'undefined') {
|
|
167
|
+
customCardList.value[index] = { ...customCardList.value[index], detail: item.detail }
|
|
168
|
+
}
|
|
169
|
+
console.log('修改成功', customCardList.value[index])
|
|
170
|
+
resolve(true)
|
|
171
|
+
})
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* 修改自定义卡配置
|
|
175
|
+
* @param item 自定义卡
|
|
176
|
+
*/
|
|
177
|
+
const changeDataCardConfig=(item: any) => {
|
|
178
|
+
return new Promise((resolve) => {
|
|
179
|
+
let index = dataCardList.value.findIndex(itemItem => itemItem.id === item.id)
|
|
180
|
+
if (typeof item.alias !== 'undefined') {
|
|
181
|
+
dataCardList.value[index] = { ...dataCardList.value[index], alias: item.alias }
|
|
182
|
+
}
|
|
183
|
+
if (typeof item.detail !== 'undefined') {
|
|
184
|
+
dataCardList.value[index] = { ...dataCardList.value[index], detail: item.detail }
|
|
185
|
+
}
|
|
186
|
+
resolve(true)
|
|
187
|
+
})
|
|
188
|
+
}
|
|
189
|
+
// 移除指定数据卡
|
|
190
|
+
const deleteBtnClick = (type: CardType, id: number) => {
|
|
191
|
+
}
|
|
192
|
+
|
|
126
193
|
<!--template-->
|
|
127
|
-
<data-screen-set :
|
|
194
|
+
<data-screen-set :activeId="activeId"
|
|
195
|
+
:activeType="activeType"
|
|
196
|
+
:changeCustomCardConfig="changeCustomCardConfig"
|
|
197
|
+
:changeDataCardConfig="changeDataCardConfig"
|
|
128
198
|
:customCardCoordinateList="customCardCoordinateList"
|
|
199
|
+
:customCardList="customCardList"
|
|
129
200
|
:dataCardCoordinateList="dataCardCoordinateList"
|
|
130
|
-
:
|
|
131
|
-
:
|
|
201
|
+
:dataCardList="dataCardList"
|
|
202
|
+
:theme="theme"
|
|
132
203
|
:title="title"
|
|
133
204
|
@addOrUpCoordinate="addOrUpCoordinate"
|
|
134
205
|
@changeActive="changeActive"
|
|
135
206
|
@editBtnClick="editBtnClick"
|
|
207
|
+
@deleteBtnClick="deleteBtnClick"
|
|
136
208
|
ref="dataScreenSetRef"
|
|
137
209
|
/>
|
|
138
210
|
```
|
|
139
211
|
|
|
140
212
|
## 方法
|
|
141
213
|
|
|
142
|
-
| Name
|
|
143
|
-
|
|
144
|
-
| setRootWidthHeight
|
|
145
|
-
| setDataCardListJson
|
|
214
|
+
| Name | Description | type |
|
|
215
|
+
|------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------|
|
|
216
|
+
| setRootWidthHeight | 设置大屏宽高 | object {width:number,height:number} |
|
|
217
|
+
| setDataCardListJson | dataCardJson: 数据卡配置数据卡json配置项(idEditBtn:是否显示右侧编辑按钮。id:数据卡唯一值。isShowRealData用于师资队伍,设备资产,科研成果代表是否显示真实图表数据,目前hps项目使用真实图表)<br/>noRenderDataCardIds: 不需要渲染的数据卡id集合 | |
|
|
218
|
+
| handleTextScroll | 文本组件滚动 | |
|
|
219
|
+
| handleNoticeInfoScroll | 通知公告滚动 | |
|
|
146
220
|
|
|
147
221
|
|
|
148
222
|
## 事件
|
|
149
223
|
|
|
150
|
-
| Name
|
|
151
|
-
|
|
224
|
+
| Name | Description |
|
|
225
|
+
|-------------------|-------------------|
|
|
152
226
|
| addOrUpCoordinate | 更新坐标信息 |
|
|
153
|
-
| changeActive
|
|
154
|
-
| editBtnClick
|
|
155
|
-
| handleTextScroll
|
|
227
|
+
| changeActive | 修改当前拖拽元素 |
|
|
228
|
+
| editBtnClick | 点击数据卡、自定义卡的编辑上传按钮 |
|
|
229
|
+
| handleTextScroll | 文字滚动 |
|
|
230
|
+
| deleteBtnClick | 点击数据卡、自定义卡的删除按钮 |
|
|
@@ -346,7 +346,7 @@ export declare interface CustomListPage {
|
|
|
346
346
|
swiperTime?: number;
|
|
347
347
|
isLoop?: boolean;
|
|
348
348
|
volume?: boolean;
|
|
349
|
-
isEdit
|
|
349
|
+
isEdit?: boolean;
|
|
350
350
|
}
|
|
351
351
|
|
|
352
352
|
export declare const DataScreenSet: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
|