inl-ui 0.1.45 → 0.1.47
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 +49 -49
- package/dist/components/index.cjs +373 -28
- package/dist/components/index.d.ts +2 -1
- package/dist/components/index.js +376 -31
- package/dist/iconfont.js +1 -1
- package/dist/index.cjs +374 -29
- package/dist/index.d.ts +3 -2
- package/dist/index.js +375 -30
- package/dist/style.css +1 -1
- package/dist/theme/index.js +70 -70
- package/dist/theme/scripts/dark-vars.js +21 -21
- package/dist/theme/scripts/default-vars.js +25 -25
- package/dist/theme/scripts/light-vars.js +22 -22
- package/dist/theme/style/color/bezierEasing.less +110 -110
- package/dist/theme/style/color/colorPalette.less +81 -81
- package/dist/theme/style/color/colors.less +162 -162
- package/dist/theme/style/color/tinyColor.less +1184 -1184
- package/dist/theme/style/compact.less +4 -4
- package/dist/theme/style/dark.less +4 -4
- package/dist/theme/style/default.less +4 -4
- package/dist/theme/style/index.less +2 -2
- package/dist/theme/style/index.tsx +2 -2
- package/dist/theme/style/themes/compact.less +295 -295
- package/dist/theme/style/themes/dark.less +790 -790
- package/dist/theme/style/themes/default.less +1067 -1067
- package/dist/theme/style/themes/index.less +7 -7
- package/dist/theme/style/themes/var-dark.less +343 -343
- package/dist/theme/style/themes/var-default.less +184 -184
- package/dist/theme/style/themes/variable.less +1122 -1122
- package/dist/theme/style/variable.less +4 -4
- package/dist/video/index.cjs +333 -13
- package/dist/video/index.d.ts +2 -1
- package/dist/video/index.js +335 -15
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,49 +1,49 @@
|
|
|
1
|
-
# 工业PC ui库
|
|
2
|
-
|
|
3
|
-
前端通用库,包括组件、hooks、utils等。
|
|
4
|
-
|
|
5
|
-
### 运行
|
|
6
|
-
|
|
7
|
-
+ 开发模式 yarn dev
|
|
8
|
-
+ 生产打包 yarn build
|
|
9
|
-
+ 生成文档 yarn build:docs
|
|
10
|
-
+ 打包图扑工具 yarn buildtp
|
|
11
|
-
|
|
12
|
-
### 使用方法
|
|
13
|
-
|
|
14
|
-
```javascript
|
|
15
|
-
import inl from 'inl-ui';
|
|
16
|
-
import 'inl-ui/dist/style.css';
|
|
17
|
-
|
|
18
|
-
vue.use(inl)
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
### 激活主题
|
|
24
|
-
|
|
25
|
-
**vite.config.ts**
|
|
26
|
-
|
|
27
|
-
```javascript
|
|
28
|
-
const additionalData = require("inl-ui/dist/theme").default;
|
|
29
|
-
|
|
30
|
-
...
|
|
31
|
-
|
|
32
|
-
css: {
|
|
33
|
-
preprocessorOptions: {
|
|
34
|
-
less: {
|
|
35
|
-
javascriptEnabled: true,
|
|
36
|
-
additionalData,
|
|
37
|
-
},
|
|
38
|
-
},
|
|
39
|
-
},
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
### 文档链接
|
|
43
|
-
|
|
44
|
-
##### [组件文档](./src/components/README.md)
|
|
45
|
-
|
|
46
|
-
##### [hooks文档](./src/hooks/README.md)
|
|
47
|
-
|
|
48
|
-
##### [Utils文档](./src/utils/README.md)
|
|
49
|
-
|
|
1
|
+
# 工业PC ui库
|
|
2
|
+
|
|
3
|
+
前端通用库,包括组件、hooks、utils等。
|
|
4
|
+
|
|
5
|
+
### 运行
|
|
6
|
+
|
|
7
|
+
+ 开发模式 yarn dev
|
|
8
|
+
+ 生产打包 yarn build
|
|
9
|
+
+ 生成文档 yarn build:docs
|
|
10
|
+
+ 打包图扑工具 yarn buildtp
|
|
11
|
+
|
|
12
|
+
### 使用方法
|
|
13
|
+
|
|
14
|
+
```javascript
|
|
15
|
+
import inl from 'inl-ui';
|
|
16
|
+
import 'inl-ui/dist/style.css';
|
|
17
|
+
|
|
18
|
+
vue.use(inl)
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
### 激活主题
|
|
24
|
+
|
|
25
|
+
**vite.config.ts**
|
|
26
|
+
|
|
27
|
+
```javascript
|
|
28
|
+
const additionalData = require("inl-ui/dist/theme").default;
|
|
29
|
+
|
|
30
|
+
...
|
|
31
|
+
|
|
32
|
+
css: {
|
|
33
|
+
preprocessorOptions: {
|
|
34
|
+
less: {
|
|
35
|
+
javascriptEnabled: true,
|
|
36
|
+
additionalData,
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### 文档链接
|
|
43
|
+
|
|
44
|
+
##### [组件文档](./src/components/README.md)
|
|
45
|
+
|
|
46
|
+
##### [hooks文档](./src/hooks/README.md)
|
|
47
|
+
|
|
48
|
+
##### [Utils文档](./src/utils/README.md)
|
|
49
|
+
|
|
@@ -267,7 +267,7 @@ function useActiveMenu(menuList, extraPages, isNav = false, watchOnce = false, i
|
|
|
267
267
|
return menu;
|
|
268
268
|
}
|
|
269
269
|
|
|
270
|
-
function _isSlot$
|
|
270
|
+
function _isSlot$d(s) {
|
|
271
271
|
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !vue.isVNode(s);
|
|
272
272
|
}
|
|
273
273
|
const Header$1 = vue.defineComponent({
|
|
@@ -362,7 +362,7 @@ const Header$1 = vue.defineComponent({
|
|
|
362
362
|
"selectedKeys": acitveMenuKey.value,
|
|
363
363
|
"onUpdate:selectedKeys": $event => acitveMenuKey.value = $event,
|
|
364
364
|
"onSelect": handleMenuSelected
|
|
365
|
-
}, _isSlot$
|
|
365
|
+
}, _isSlot$d(_slot = props.menu.map(item => vue.createVNode(antDesignVue.MenuItem, {
|
|
366
366
|
"key": item.id,
|
|
367
367
|
"title": item.name
|
|
368
368
|
}, {
|
|
@@ -430,7 +430,7 @@ const Header$1 = vue.defineComponent({
|
|
|
430
430
|
}
|
|
431
431
|
});
|
|
432
432
|
|
|
433
|
-
function _isSlot$
|
|
433
|
+
function _isSlot$c(s) {
|
|
434
434
|
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !vue.isVNode(s);
|
|
435
435
|
}
|
|
436
436
|
const renderMenuItem = item => {
|
|
@@ -512,7 +512,7 @@ const SideMenu$1 = vue.defineComponent({
|
|
|
512
512
|
"onUpdate:openKeys": $event => expandKeys.value = $event,
|
|
513
513
|
"selectedKeys": activeMenu.value,
|
|
514
514
|
"onSelect": handleMenuSelect
|
|
515
|
-
}, _isSlot$
|
|
515
|
+
}, _isSlot$c(_slot = props.menu.map(item => renderMenuItem(item))) ? _slot : {
|
|
516
516
|
default: () => [_slot]
|
|
517
517
|
});
|
|
518
518
|
};
|
|
@@ -6542,7 +6542,7 @@ function getOpenUrl(url) {
|
|
|
6542
6542
|
|
|
6543
6543
|
const closeTabMagicKey = "control_shift_q";
|
|
6544
6544
|
const TabList = vue.defineComponent({
|
|
6545
|
-
emits: ["update:activeKey", "update:list", "tabSelect", "closeExtraPage", "closeIframePage", "fullscreen", "refreshIframe", "refreshExtraPage"],
|
|
6545
|
+
emits: ["update:activeKey", "update:list", "tabSelect", "closeExtraPage", "closeIframePage", "fullscreen", "refreshIframe", "refreshExtraPage", "mouseLeave"],
|
|
6546
6546
|
props: {
|
|
6547
6547
|
list: {
|
|
6548
6548
|
type: Array,
|
|
@@ -6550,13 +6550,21 @@ const TabList = vue.defineComponent({
|
|
|
6550
6550
|
},
|
|
6551
6551
|
activeKey: {
|
|
6552
6552
|
type: String
|
|
6553
|
-
}
|
|
6553
|
+
},
|
|
6554
|
+
containerRef: Object
|
|
6554
6555
|
},
|
|
6555
6556
|
setup(props, {
|
|
6556
6557
|
emit,
|
|
6557
6558
|
expose
|
|
6558
6559
|
}) {
|
|
6559
6560
|
const qiankunState = vue.inject("qiankunState");
|
|
6561
|
+
const tabListRef = vue.ref();
|
|
6562
|
+
const {
|
|
6563
|
+
isOutside
|
|
6564
|
+
} = core.useMouseInElement(tabListRef);
|
|
6565
|
+
vue.watchEffect(() => {
|
|
6566
|
+
if (isOutside.value) emit("mouseLeave");
|
|
6567
|
+
});
|
|
6560
6568
|
const tabContainerRef = vue.ref();
|
|
6561
6569
|
const tabList = core.useVModel(props, "list", emit);
|
|
6562
6570
|
const activeTabKey = core.useVModel(props, "activeKey", emit);
|
|
@@ -6721,7 +6729,8 @@ const TabList = vue.defineComponent({
|
|
|
6721
6729
|
closeTab
|
|
6722
6730
|
});
|
|
6723
6731
|
return () => vue.createVNode("div", {
|
|
6724
|
-
"class": "tab-list"
|
|
6732
|
+
"class": "tab-list",
|
|
6733
|
+
"ref": tabListRef
|
|
6725
6734
|
}, [vue.createVNode("div", {
|
|
6726
6735
|
"class": "tabs-container",
|
|
6727
6736
|
"ref": tabContainerRef,
|
|
@@ -6730,7 +6739,8 @@ const TabList = vue.defineComponent({
|
|
|
6730
6739
|
"key": getTabUniqueKey(item),
|
|
6731
6740
|
"placement": "bottomLeft",
|
|
6732
6741
|
"trigger": ["contextmenu"],
|
|
6733
|
-
"overlayClassName": "tabs-search-dropdown"
|
|
6742
|
+
"overlayClassName": "tabs-search-dropdown",
|
|
6743
|
+
"getPopupContainer": () => props.containerRef.value
|
|
6734
6744
|
}, {
|
|
6735
6745
|
default: () => [vue.createVNode(antDesignVue.Tooltip, {
|
|
6736
6746
|
"title": item.name,
|
|
@@ -7061,7 +7071,21 @@ const PageContent = vue.defineComponent({
|
|
|
7061
7071
|
const {
|
|
7062
7072
|
isFullscreen,
|
|
7063
7073
|
enter
|
|
7064
|
-
} = core.useFullscreen(
|
|
7074
|
+
} = core.useFullscreen(containerRef);
|
|
7075
|
+
const {
|
|
7076
|
+
elementY
|
|
7077
|
+
} = core.useMouseInElement(containerRef);
|
|
7078
|
+
const isTabsShow = vue.ref(false);
|
|
7079
|
+
vue.watchEffect(() => {
|
|
7080
|
+
if (isFullscreen.value) {
|
|
7081
|
+
isTabsShow.value = false;
|
|
7082
|
+
}
|
|
7083
|
+
});
|
|
7084
|
+
vue.watchEffect(() => {
|
|
7085
|
+
if (elementY.value < 10) {
|
|
7086
|
+
isTabsShow.value = true;
|
|
7087
|
+
}
|
|
7088
|
+
});
|
|
7065
7089
|
const isPadding = vue.computed(() => {
|
|
7066
7090
|
let iframePadding = false;
|
|
7067
7091
|
if (activeKey.value) {
|
|
@@ -7129,19 +7153,21 @@ const PageContent = vue.defineComponent({
|
|
|
7129
7153
|
return () => vue.createVNode("div", {
|
|
7130
7154
|
"class": "page-content",
|
|
7131
7155
|
"ref": containerRef
|
|
7132
|
-
}, [props.showTabList && vue.createVNode(TabList, {
|
|
7156
|
+
}, [props.showTabList && vue.withDirectives(vue.createVNode(TabList, {
|
|
7133
7157
|
"ref": tabListRef,
|
|
7134
7158
|
"activeKey": activeKey.value,
|
|
7135
7159
|
"onUpdate:activeKey": $event => activeKey.value = $event,
|
|
7136
7160
|
"list": tabList.value,
|
|
7137
7161
|
"onUpdate:list": $event => tabList.value = $event,
|
|
7162
|
+
"containerRef": containerRef,
|
|
7138
7163
|
"onTabSelect": onTabSelect,
|
|
7139
7164
|
"onCloseExtraPage": handleExtraPageClose,
|
|
7140
7165
|
"onCloseIframePage": handleIframePageClose,
|
|
7141
7166
|
"onFullscreen": handleFullscreen,
|
|
7142
7167
|
"onRefreshIframe": handleRefreshIframe,
|
|
7143
|
-
"onRefreshExtraPage": handleRefreshExtraPage
|
|
7144
|
-
|
|
7168
|
+
"onRefreshExtraPage": handleRefreshExtraPage,
|
|
7169
|
+
"onMouseLeave": () => isTabsShow.value = false
|
|
7170
|
+
}, null), [[vue.vShow, !isFullscreen.value || isTabsShow.value]]), vue.createVNode("div", {
|
|
7145
7171
|
"class": ["page-container", {
|
|
7146
7172
|
padding: isPadding.value,
|
|
7147
7173
|
fullscreen: isFullscreen.value
|
|
@@ -7992,7 +8018,7 @@ const Header = vue.defineComponent({
|
|
|
7992
8018
|
});
|
|
7993
8019
|
var table = installComponent(Header, "layout-table");
|
|
7994
8020
|
|
|
7995
|
-
function _isSlot$
|
|
8021
|
+
function _isSlot$b(s) {
|
|
7996
8022
|
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !vue.isVNode(s);
|
|
7997
8023
|
}
|
|
7998
8024
|
const SideMenu = vue.defineComponent({
|
|
@@ -8065,7 +8091,7 @@ const SideMenu = vue.defineComponent({
|
|
|
8065
8091
|
"icon": menu.icon && vue.createVNode(IconFont$1, {
|
|
8066
8092
|
"type": menu.icon
|
|
8067
8093
|
}, null)
|
|
8068
|
-
}, _isSlot$
|
|
8094
|
+
}, _isSlot$b(_slot = menu.subList.map(item => renderMenu(item))) ? _slot : {
|
|
8069
8095
|
default: () => [_slot]
|
|
8070
8096
|
});
|
|
8071
8097
|
}
|
|
@@ -8087,7 +8113,7 @@ const SideMenu = vue.defineComponent({
|
|
|
8087
8113
|
"mode": "inline",
|
|
8088
8114
|
"selectedKeys": activeMenu.value,
|
|
8089
8115
|
"onSelect": handleMenuSelect
|
|
8090
|
-
}, _isSlot$
|
|
8116
|
+
}, _isSlot$b(_slot2 = props.menuList.map(item => renderMenu(item))) ? _slot2 : {
|
|
8091
8117
|
default: () => [_slot2]
|
|
8092
8118
|
});
|
|
8093
8119
|
};
|
|
@@ -9136,6 +9162,293 @@ const VideoBox = vue.defineComponent({
|
|
|
9136
9162
|
});
|
|
9137
9163
|
var videoBox = installComponent(VideoBox, "video-box");
|
|
9138
9164
|
|
|
9165
|
+
function _isSlot$a(s) {
|
|
9166
|
+
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !vue.isVNode(s);
|
|
9167
|
+
}
|
|
9168
|
+
let dataList = [];
|
|
9169
|
+
const generateList = (data, obj) => {
|
|
9170
|
+
for (let i = 0; i < data.length; i++) {
|
|
9171
|
+
const node = _.cloneDeep(data[i]);
|
|
9172
|
+
delete node.children;
|
|
9173
|
+
obj.push({
|
|
9174
|
+
...node
|
|
9175
|
+
});
|
|
9176
|
+
if (data[i].children) {
|
|
9177
|
+
generateList(data[i].children, obj);
|
|
9178
|
+
}
|
|
9179
|
+
}
|
|
9180
|
+
};
|
|
9181
|
+
const generateUniqueField = list => {
|
|
9182
|
+
list.forEach(item => {
|
|
9183
|
+
const parentUuid = item.parentUuid || 0;
|
|
9184
|
+
item.uniqueField = `${parentUuid}-${item.uuid}`;
|
|
9185
|
+
if (item.children?.length > 0) {
|
|
9186
|
+
generateUniqueField(item.children);
|
|
9187
|
+
}
|
|
9188
|
+
});
|
|
9189
|
+
return list;
|
|
9190
|
+
};
|
|
9191
|
+
var Tree = vue.defineComponent({
|
|
9192
|
+
components: {},
|
|
9193
|
+
props: {
|
|
9194
|
+
groupFix: {
|
|
9195
|
+
type: Number
|
|
9196
|
+
},
|
|
9197
|
+
checkable: {
|
|
9198
|
+
type: Boolean,
|
|
9199
|
+
default: () => false
|
|
9200
|
+
},
|
|
9201
|
+
showCameraIcon: {
|
|
9202
|
+
type: Boolean,
|
|
9203
|
+
default: () => false
|
|
9204
|
+
},
|
|
9205
|
+
selectedKeys: {
|
|
9206
|
+
type: Array,
|
|
9207
|
+
default: () => []
|
|
9208
|
+
},
|
|
9209
|
+
checkedKeys: {
|
|
9210
|
+
type: Array,
|
|
9211
|
+
default: () => []
|
|
9212
|
+
}
|
|
9213
|
+
},
|
|
9214
|
+
emits: ["selectHandle", "checkChange"],
|
|
9215
|
+
setup(props, context) {
|
|
9216
|
+
const selectedKeys = vue.ref(props.selectedKeys);
|
|
9217
|
+
const checkedKeys = vue.ref(props.checkedKeys);
|
|
9218
|
+
const expandedKeys = vue.ref([]);
|
|
9219
|
+
const searchValue = vue.ref("");
|
|
9220
|
+
const autoExpandParent = vue.ref(true);
|
|
9221
|
+
const gData = vue.ref();
|
|
9222
|
+
const treeRef = vue.ref();
|
|
9223
|
+
let treeDataRecord;
|
|
9224
|
+
let initDataPromise;
|
|
9225
|
+
const data = vue.reactive({
|
|
9226
|
+
titleType: props.groupFix || 0,
|
|
9227
|
+
list: []
|
|
9228
|
+
});
|
|
9229
|
+
const getQueryGroup = async params => {
|
|
9230
|
+
return new Promise(async resolve => {
|
|
9231
|
+
const res = await axios__default["default"].get("/api/vms/v1/cameraGroup/tree", {
|
|
9232
|
+
headers: {
|
|
9233
|
+
token: sessionStorage.getItem("token") || ""
|
|
9234
|
+
},
|
|
9235
|
+
params: {
|
|
9236
|
+
groupTypeUuid: params.uuid,
|
|
9237
|
+
cameraName: params.cameraName
|
|
9238
|
+
}
|
|
9239
|
+
});
|
|
9240
|
+
dataList = [];
|
|
9241
|
+
treeDataRecord = generateUniqueField(res.data.data);
|
|
9242
|
+
generateList(treeDataRecord, dataList);
|
|
9243
|
+
gData.value = filterTree(JSON.parse(JSON.stringify(treeDataRecord)), searchValue.value).arr;
|
|
9244
|
+
resolve(true);
|
|
9245
|
+
});
|
|
9246
|
+
};
|
|
9247
|
+
const getGroup = async () => {
|
|
9248
|
+
return new Promise(async resolve => {
|
|
9249
|
+
const res = await axios__default["default"].get("/api/vms/v1/cameraGroupType/findAll", {
|
|
9250
|
+
headers: {
|
|
9251
|
+
token: sessionStorage.getItem("token") || ""
|
|
9252
|
+
}
|
|
9253
|
+
});
|
|
9254
|
+
data.list = res.data.data;
|
|
9255
|
+
getQueryGroup(data.list[data.titleType]).then(() => {
|
|
9256
|
+
resolve(true);
|
|
9257
|
+
});
|
|
9258
|
+
});
|
|
9259
|
+
};
|
|
9260
|
+
const titleTypeChange = index => {
|
|
9261
|
+
gData.value = [];
|
|
9262
|
+
getQueryGroup(data.list[index]);
|
|
9263
|
+
return true;
|
|
9264
|
+
};
|
|
9265
|
+
const onExpand = keys => {
|
|
9266
|
+
expandedKeys.value = keys;
|
|
9267
|
+
autoExpandParent.value = false;
|
|
9268
|
+
};
|
|
9269
|
+
const onSelect = async (keys, info) => {
|
|
9270
|
+
if (info.node.nodeType === "C") {
|
|
9271
|
+
if (info.selected) {
|
|
9272
|
+
selectedKeys.value = keys;
|
|
9273
|
+
context.emit("selectHandle", info.node.dataRef);
|
|
9274
|
+
}
|
|
9275
|
+
}
|
|
9276
|
+
};
|
|
9277
|
+
const deleteBfromA = (arrA, arrB) => {
|
|
9278
|
+
const obj = {};
|
|
9279
|
+
arrA.forEach(key => {
|
|
9280
|
+
obj[key] = key;
|
|
9281
|
+
});
|
|
9282
|
+
arrB.forEach(key => {
|
|
9283
|
+
delete obj[key];
|
|
9284
|
+
});
|
|
9285
|
+
return Object.keys(obj);
|
|
9286
|
+
};
|
|
9287
|
+
const onCheck = async (keys, e) => {
|
|
9288
|
+
let checkedNodes = [];
|
|
9289
|
+
let checkedList = [];
|
|
9290
|
+
generateList([e.node.dataRef], checkedList);
|
|
9291
|
+
const checkedUuidArr = checkedList.filter(item => item.nodeType === "C").map(ele => ele.uuid);
|
|
9292
|
+
const checkedKeyArr = uuidToKey([...new Set(checkedUuidArr)]);
|
|
9293
|
+
if (e.checked) {
|
|
9294
|
+
checkedKeys.value = [... /* @__PURE__ */new Set([...checkedKeys.value, ...checkedKeyArr])];
|
|
9295
|
+
} else {
|
|
9296
|
+
checkedKeys.value = deleteBfromA(checkedKeys.value, checkedKeyArr);
|
|
9297
|
+
}
|
|
9298
|
+
const uuids = checkedKeys.value.map(item => item.split("-")[1]);
|
|
9299
|
+
const uuidRes = [...new Set(uuids)];
|
|
9300
|
+
const treeList = [];
|
|
9301
|
+
generateList(treeDataRecord, treeList);
|
|
9302
|
+
treeList.forEach(element => {
|
|
9303
|
+
if (uuidRes.indexOf(element.uuid) >= 0) {
|
|
9304
|
+
checkedNodes.push({
|
|
9305
|
+
uuid: element.uuid,
|
|
9306
|
+
name: element.title
|
|
9307
|
+
});
|
|
9308
|
+
}
|
|
9309
|
+
});
|
|
9310
|
+
context.emit("checkChange", checkedNodes);
|
|
9311
|
+
};
|
|
9312
|
+
const removeChecked = value => {
|
|
9313
|
+
const uniqueFieldList = uuidToKey([value]);
|
|
9314
|
+
checkedKeys.value = checkedKeys.value.filter(key => !uniqueFieldList.includes(key));
|
|
9315
|
+
};
|
|
9316
|
+
const clearChecked = () => {
|
|
9317
|
+
checkedKeys.value = [];
|
|
9318
|
+
context.emit("checkChange", []);
|
|
9319
|
+
};
|
|
9320
|
+
const setCheckedKeys = arr => {
|
|
9321
|
+
initDataPromise.then(() => {
|
|
9322
|
+
checkedKeys.value = uuidToKey(arr);
|
|
9323
|
+
});
|
|
9324
|
+
};
|
|
9325
|
+
const uuidToKey = arr => {
|
|
9326
|
+
let list = [];
|
|
9327
|
+
arr.forEach(uuid => {
|
|
9328
|
+
const nodes = dataList.filter(item => item.uuid === uuid);
|
|
9329
|
+
nodes.forEach(node => {
|
|
9330
|
+
const parentUuid = node.parentUuid || 0;
|
|
9331
|
+
list.push(`${parentUuid}-${node.uuid}`);
|
|
9332
|
+
});
|
|
9333
|
+
});
|
|
9334
|
+
return list;
|
|
9335
|
+
};
|
|
9336
|
+
vue.watch(() => props.groupFix, n => {
|
|
9337
|
+
data.titleType = n;
|
|
9338
|
+
getQueryGroup(data.list[n]);
|
|
9339
|
+
});
|
|
9340
|
+
context.expose({
|
|
9341
|
+
removeChecked,
|
|
9342
|
+
clearChecked,
|
|
9343
|
+
setCheckedKeys,
|
|
9344
|
+
refreshTree: () => getQueryGroup(data.list[data.titleType])
|
|
9345
|
+
});
|
|
9346
|
+
vue.onMounted(() => {
|
|
9347
|
+
initDataPromise = getGroup();
|
|
9348
|
+
});
|
|
9349
|
+
const filterTree = (arr, key) => {
|
|
9350
|
+
let expandKeys = [];
|
|
9351
|
+
let res = "noHave";
|
|
9352
|
+
for (let i = 0; i < arr.length; i++) {
|
|
9353
|
+
const obj = arr[i];
|
|
9354
|
+
let childHave = "noHave";
|
|
9355
|
+
if (obj.children && obj.children.length != 0) {
|
|
9356
|
+
const {
|
|
9357
|
+
res: resSub,
|
|
9358
|
+
expandKeys: expandKeysSub
|
|
9359
|
+
} = filterTree(obj.children, key);
|
|
9360
|
+
childHave = resSub;
|
|
9361
|
+
expandKeys = expandKeys.concat(expandKeysSub);
|
|
9362
|
+
}
|
|
9363
|
+
if (obj.title.indexOf(key) === -1 && childHave === "noHave") {
|
|
9364
|
+
arr.splice(i, 1);
|
|
9365
|
+
i--;
|
|
9366
|
+
continue;
|
|
9367
|
+
} else {
|
|
9368
|
+
res = "have";
|
|
9369
|
+
if (key.trim()) expandKeys.push(obj.uuid);
|
|
9370
|
+
}
|
|
9371
|
+
}
|
|
9372
|
+
return {
|
|
9373
|
+
arr,
|
|
9374
|
+
res,
|
|
9375
|
+
expandKeys
|
|
9376
|
+
};
|
|
9377
|
+
};
|
|
9378
|
+
vue.watch(() => searchValue.value, value => {
|
|
9379
|
+
const {
|
|
9380
|
+
arr,
|
|
9381
|
+
expandKeys
|
|
9382
|
+
} = filterTree(JSON.parse(JSON.stringify(treeDataRecord)), searchValue.value);
|
|
9383
|
+
gData.value = arr;
|
|
9384
|
+
expandedKeys.value = expandKeys;
|
|
9385
|
+
});
|
|
9386
|
+
return () => {
|
|
9387
|
+
let _slot;
|
|
9388
|
+
return vue.createVNode("div", {
|
|
9389
|
+
"class": "tree-camera"
|
|
9390
|
+
}, [vue.createVNode("div", {
|
|
9391
|
+
"class": "search-box"
|
|
9392
|
+
}, [typeof props.groupFix !== "number" && vue.createVNode(vue.resolveComponent("a-select"), {
|
|
9393
|
+
"style": "width:100%",
|
|
9394
|
+
"onChange": e => titleTypeChange(e),
|
|
9395
|
+
"value": data.titleType,
|
|
9396
|
+
"onUpdate:value": $event => data.titleType = $event
|
|
9397
|
+
}, _isSlot$a(_slot = data.list.map((item, index) => {
|
|
9398
|
+
return vue.createVNode(vue.resolveComponent("a-select-option"), {
|
|
9399
|
+
"value": index
|
|
9400
|
+
}, {
|
|
9401
|
+
default: () => [item.name]
|
|
9402
|
+
});
|
|
9403
|
+
})) ? _slot : {
|
|
9404
|
+
default: () => [_slot]
|
|
9405
|
+
}), vue.withDirectives(vue.createVNode(vue.resolveComponent("a-input"), {
|
|
9406
|
+
"placeholder": "\u8F93\u5165\u76F8\u673A\u540D\u79F0",
|
|
9407
|
+
"value": searchValue.value,
|
|
9408
|
+
"onUpdate:value": $event => searchValue.value = $event
|
|
9409
|
+
}, {
|
|
9410
|
+
suffix: () => {
|
|
9411
|
+
return vue.createVNode(iconsVue.SearchOutlined, {
|
|
9412
|
+
"style": "color: rgba(0, 0, 0, 0.45)"
|
|
9413
|
+
}, null);
|
|
9414
|
+
}
|
|
9415
|
+
}), [[vue.vShow, data.list && data.list.length > 0]])]), vue.createVNode("div", {
|
|
9416
|
+
"class": "tree-wrap"
|
|
9417
|
+
}, [vue.createVNode(vue.resolveComponent("a-tree"), {
|
|
9418
|
+
"ref": treeRef,
|
|
9419
|
+
"class": "tree-mins",
|
|
9420
|
+
"showLine": true,
|
|
9421
|
+
"onCheck": onCheck,
|
|
9422
|
+
"onSelect": onSelect,
|
|
9423
|
+
"selectedKeys": selectedKeys.value,
|
|
9424
|
+
"checkedKeys": checkedKeys.value,
|
|
9425
|
+
"expandedKeys": expandedKeys.value,
|
|
9426
|
+
"autoExpandParent": autoExpandParent.value,
|
|
9427
|
+
"tree-data": gData.value,
|
|
9428
|
+
"onExpand": onExpand,
|
|
9429
|
+
"checkable": props.checkable,
|
|
9430
|
+
"fieldNames": {
|
|
9431
|
+
key: "uniqueField"
|
|
9432
|
+
}
|
|
9433
|
+
}, {
|
|
9434
|
+
title: item => {
|
|
9435
|
+
return vue.createVNode("div", {
|
|
9436
|
+
"class": "tree-icons-min flex"
|
|
9437
|
+
}, [props.showCameraIcon && vue.createVNode("div", {
|
|
9438
|
+
"class": "icons-min"
|
|
9439
|
+
}, [vue.withDirectives(vue.createVNode("img", {
|
|
9440
|
+
"class": "active-r",
|
|
9441
|
+
"src": item.onlineStatus === "ONLINE" ? "/micro-assets/inl/video/operation/cameraOnline.svg" : "/micro-assets/inl/video/operation/cameraOffline.svg",
|
|
9442
|
+
"alt": "\u5728\u7EBF"
|
|
9443
|
+
}, null), [[vue.vShow, item.nodeType === "C"]])]), vue.createVNode("span", {
|
|
9444
|
+
"class": ["xj", item.nodeType === "G" ? "gactive" : "", item.onlineStatus === "ONLINE" ? "yactive" : ""]
|
|
9445
|
+
}, [item.title])]);
|
|
9446
|
+
}
|
|
9447
|
+
})])]);
|
|
9448
|
+
};
|
|
9449
|
+
}
|
|
9450
|
+
});
|
|
9451
|
+
|
|
9139
9452
|
const props$6 = {
|
|
9140
9453
|
// 视频信息|视频源uuid
|
|
9141
9454
|
camera: {
|
|
@@ -9153,7 +9466,7 @@ const props$6 = {
|
|
|
9153
9466
|
// },
|
|
9154
9467
|
btns: {
|
|
9155
9468
|
type: Array,
|
|
9156
|
-
default: ["fill", "look", "stream", "magnify", "direction", "fullScreen", "close"]
|
|
9469
|
+
default: ["change", "fill", "look", "stream", "magnify", "direction", "fullScreen", "close"]
|
|
9157
9470
|
},
|
|
9158
9471
|
alarm: {
|
|
9159
9472
|
default: false,
|
|
@@ -9169,7 +9482,7 @@ const VideoBoxV2 = vue.defineComponent({
|
|
|
9169
9482
|
components: {
|
|
9170
9483
|
VideoPlayerV2
|
|
9171
9484
|
},
|
|
9172
|
-
emits: ["close"],
|
|
9485
|
+
emits: ["close", "change"],
|
|
9173
9486
|
setup(_prop, _context) {
|
|
9174
9487
|
const player = vue.ref();
|
|
9175
9488
|
const cameraConfig = vue.ref({});
|
|
@@ -9366,18 +9679,21 @@ const VideoBoxV2 = vue.defineComponent({
|
|
|
9366
9679
|
document?.addEventListener("mouseup", mouseupFun);
|
|
9367
9680
|
};
|
|
9368
9681
|
const fill = vue.ref("fill");
|
|
9682
|
+
const setNewCamera = val => {
|
|
9683
|
+
if (magnifyBtn.value) {
|
|
9684
|
+
setZoom();
|
|
9685
|
+
}
|
|
9686
|
+
camera.value = void 0;
|
|
9687
|
+
getVideoParams(val);
|
|
9688
|
+
getVideoDetail(val);
|
|
9689
|
+
const fillVal = localStorage.getItem(val);
|
|
9690
|
+
if (fillVal) {
|
|
9691
|
+
fill.value = fillVal;
|
|
9692
|
+
}
|
|
9693
|
+
};
|
|
9369
9694
|
vue.watch(() => _prop.camera, val => {
|
|
9370
9695
|
if (val && Object.keys(val).length != 0) {
|
|
9371
|
-
|
|
9372
|
-
setZoom();
|
|
9373
|
-
}
|
|
9374
|
-
camera.value = void 0;
|
|
9375
|
-
getVideoParams(val);
|
|
9376
|
-
getVideoDetail(val);
|
|
9377
|
-
const fillVal = localStorage.getItem(val);
|
|
9378
|
-
if (fillVal) {
|
|
9379
|
-
fill.value = fillVal;
|
|
9380
|
-
}
|
|
9696
|
+
setNewCamera(val);
|
|
9381
9697
|
}
|
|
9382
9698
|
}, {
|
|
9383
9699
|
deep: true,
|
|
@@ -9395,6 +9711,27 @@ const VideoBoxV2 = vue.defineComponent({
|
|
|
9395
9711
|
});
|
|
9396
9712
|
cameraConfig.value.webrtcTemplateMerged = res.data.data[0];
|
|
9397
9713
|
};
|
|
9714
|
+
const showChangeDialog = vue.ref(false);
|
|
9715
|
+
const checkChange = res => {
|
|
9716
|
+
showChangeDialog.value = false;
|
|
9717
|
+
setNewCamera(res[0].uuid);
|
|
9718
|
+
_context.emit("change", res[0].uuid);
|
|
9719
|
+
};
|
|
9720
|
+
const renderChangeCamera = () => {
|
|
9721
|
+
return vue.createVNode(vue.resolveComponent("a-modal"), {
|
|
9722
|
+
"title": "\u66F4\u6362\u6444\u50CF\u5934",
|
|
9723
|
+
"visible": showChangeDialog.value,
|
|
9724
|
+
"footer": null,
|
|
9725
|
+
"onCancel": () => {
|
|
9726
|
+
showChangeDialog.value = false;
|
|
9727
|
+
}
|
|
9728
|
+
}, {
|
|
9729
|
+
default: () => [showChangeDialog.value ? vue.createVNode(Tree, {
|
|
9730
|
+
"checkable": true,
|
|
9731
|
+
"onCheckChange": checkChange
|
|
9732
|
+
}, null) : ""]
|
|
9733
|
+
});
|
|
9734
|
+
};
|
|
9398
9735
|
return () => vue.createVNode("div", {
|
|
9399
9736
|
"id": "videoBox_" + uuid.value,
|
|
9400
9737
|
"class": ["videoBox", _prop.alarm ? "alarm" : ""]
|
|
@@ -9450,6 +9787,14 @@ const VideoBoxV2 = vue.defineComponent({
|
|
|
9450
9787
|
}, [_prop.btns.map(btn => {
|
|
9451
9788
|
if (!(camera.value?.brandTypeCode === "MP4" && btn !== "close" && btn !== "fullScreen" && btn !== "look")) {
|
|
9452
9789
|
switch (btn) {
|
|
9790
|
+
case "change":
|
|
9791
|
+
return vue.createVNode("img", {
|
|
9792
|
+
"title": "\u66F4\u6362\u6444\u50CF\u5934",
|
|
9793
|
+
"onClick": e => {
|
|
9794
|
+
showChangeDialog.value = true;
|
|
9795
|
+
},
|
|
9796
|
+
"src": "/micro-assets/inl/video/controls/change.svg"
|
|
9797
|
+
}, null);
|
|
9453
9798
|
case "fill":
|
|
9454
9799
|
return vue.createVNode("img", {
|
|
9455
9800
|
"title": "\u62C9\u4F38/\u539F\u59CB\u5C3A\u5BF8",
|
|
@@ -9568,7 +9913,7 @@ const VideoBoxV2 = vue.defineComponent({
|
|
|
9568
9913
|
}, null);
|
|
9569
9914
|
}
|
|
9570
9915
|
}
|
|
9571
|
-
})])])]);
|
|
9916
|
+
})])]), renderChangeCamera()]);
|
|
9572
9917
|
}
|
|
9573
9918
|
});
|
|
9574
9919
|
var VideoBoxV2$1 = installComponent(VideoBoxV2, "video-box-v2");
|
|
@@ -650,7 +650,7 @@ declare const _default$7: vue.DefineComponent<{
|
|
|
650
650
|
type: BooleanConstructor;
|
|
651
651
|
default: boolean;
|
|
652
652
|
};
|
|
653
|
-
}, () => vue_jsx_runtime.JSX.Element, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, "close"[], "close", vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, Readonly<vue.ExtractPropTypes<{
|
|
653
|
+
}, () => vue_jsx_runtime.JSX.Element, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, ("change" | "close")[], "change" | "close", vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, Readonly<vue.ExtractPropTypes<{
|
|
654
654
|
camera: {
|
|
655
655
|
require: boolean;
|
|
656
656
|
type: StringConstructor;
|
|
@@ -685,6 +685,7 @@ declare const _default$7: vue.DefineComponent<{
|
|
|
685
685
|
default: boolean;
|
|
686
686
|
};
|
|
687
687
|
}>> & {
|
|
688
|
+
onChange?: ((...args: any[]) => any) | undefined;
|
|
688
689
|
onClose?: ((...args: any[]) => any) | undefined;
|
|
689
690
|
}, {
|
|
690
691
|
intervalTime: number;
|