inl-ui 0.1.30 → 0.1.32

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.
Files changed (37) hide show
  1. package/README.md +49 -49
  2. package/dist/components/index.cjs +163 -146
  3. package/dist/components/index.js +163 -146
  4. package/dist/components/style.css +1 -1
  5. package/dist/iconfont.js +1 -1
  6. package/dist/index.cjs +164 -147
  7. package/dist/index.d.ts +1 -1
  8. package/dist/index.js +164 -147
  9. package/dist/style.css +2 -2
  10. package/dist/theme/index.js +70 -70
  11. package/dist/theme/scripts/dark-vars.js +21 -21
  12. package/dist/theme/scripts/default-vars.js +25 -25
  13. package/dist/theme/scripts/light-vars.js +22 -22
  14. package/dist/theme/style/color/bezierEasing.less +110 -110
  15. package/dist/theme/style/color/colorPalette.less +81 -81
  16. package/dist/theme/style/color/colors.less +162 -162
  17. package/dist/theme/style/color/tinyColor.less +1184 -1184
  18. package/dist/theme/style/compact.less +4 -4
  19. package/dist/theme/style/dark.less +4 -4
  20. package/dist/theme/style/default.less +4 -4
  21. package/dist/theme/style/index.less +2 -2
  22. package/dist/theme/style/index.tsx +2 -2
  23. package/dist/theme/style/themes/compact.less +295 -295
  24. package/dist/theme/style/themes/dark.less +790 -790
  25. package/dist/theme/style/themes/default.less +1067 -1067
  26. package/dist/theme/style/themes/index.less +7 -7
  27. package/dist/theme/style/themes/var-dark.less +343 -343
  28. package/dist/theme/style/themes/var-default.less +184 -184
  29. package/dist/theme/style/themes/variable.less +1122 -1122
  30. package/dist/theme/style/variable.less +4 -4
  31. package/dist/video/index.cjs +128 -112
  32. package/dist/video/index.js +128 -112
  33. package/dist/video/style.css +1 -1
  34. package/dist/videoMobile/index.cjs +10 -3
  35. package/dist/videoMobile/index.js +10 -3
  36. package/dist/videoMobile/style.css +1 -1
  37. package/package.json +1 -1
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
+
@@ -8738,9 +8738,6 @@ const VideoPlayerV2 = vue.defineComponent({
8738
8738
  };
8739
8739
  }, 500);
8740
8740
  };
8741
- _context.expose({
8742
- videoFull
8743
- });
8744
8741
  const videoInfo2 = vue.ref({});
8745
8742
  const stopPlay = () => {
8746
8743
  if (play) {
@@ -8777,6 +8774,15 @@ const VideoPlayerV2 = vue.defineComponent({
8777
8774
  videoElement.load();
8778
8775
  }
8779
8776
  };
8777
+ const releaseUrl = vue.ref("");
8778
+ const release = async () => {
8779
+ const res = await axios__default["default"].get(releaseUrl.value);
8780
+ return res;
8781
+ };
8782
+ _context.expose({
8783
+ videoFull,
8784
+ release
8785
+ });
8780
8786
  const getVideoDetail = async camera => {
8781
8787
  let uuid2 = "";
8782
8788
  if (camera && Object.keys(camera).length && typeof camera === "object") {
@@ -8803,6 +8809,7 @@ const VideoPlayerV2 = vue.defineComponent({
8803
8809
  } = detailRes;
8804
8810
  if (res.data.data[0]) {
8805
8811
  data.data.webrtcTemplateMerged = res.data.data[0];
8812
+ releaseUrl.value = res.data.data[1];
8806
8813
  data.data.mediaServerPo.url = res.data.data[2];
8807
8814
  videoInfo2.value = {
8808
8815
  ...data.data,
@@ -9268,7 +9275,7 @@ const VideoBoxV2 = vue.defineComponent({
9268
9275
  streams.value = JSON.parse(camera.value.brandTypePo?.streamTypeDict || "[]");
9269
9276
  };
9270
9277
  let timeout;
9271
- let show = vue.ref(true);
9278
+ vue.ref(true);
9272
9279
  vue.onBeforeUnmount(() => {});
9273
9280
  const fill = vue.ref("fill");
9274
9281
  vue.watch(() => _prop.camera, val => {
@@ -9298,7 +9305,7 @@ const VideoBoxV2 = vue.defineComponent({
9298
9305
  };
9299
9306
  return () => vue.createVNode("div", {
9300
9307
  "class": ["videoBox", _prop.alarm ? "alarm" : ""]
9301
- }, [show.value ? vue.createVNode(VideoPlayerV2, {
9308
+ }, [camera.value.brandTypeCode !== "MP4" ? vue.createVNode(VideoPlayerV2, {
9302
9309
  "ref": player,
9303
9310
  "camera": camera.value,
9304
9311
  "cameraConfig": cameraConfig.value,
@@ -9308,7 +9315,14 @@ const VideoBoxV2 = vue.defineComponent({
9308
9315
  streamType: streamHistory.value || camera.value.streamType
9309
9316
  };
9310
9317
  }
9311
- }, null) : "", showInfo.value ? vue.createVNode("div", {
9318
+ }, null) : vue.createVNode("video", {
9319
+ "class": "videoStatic",
9320
+ "src": camera.value.mp4ResourcesPath,
9321
+ "controls": true,
9322
+ "autoplay": true,
9323
+ "loop": true,
9324
+ "muted": true
9325
+ }, null), camera.value.brandTypeCode !== "MP4" && showInfo.value ? vue.createVNode("div", {
9312
9326
  "class": "selectFields"
9313
9327
  }, [[0, 1, 2, 3, 4, 5].map(index => {
9314
9328
  let info = {};
@@ -9329,113 +9343,115 @@ const VideoBoxV2 = vue.defineComponent({
9329
9343
  }, [vue.createVNode("span", null, [camera.value?.name])]), vue.createVNode("div", {
9330
9344
  "class": "tool"
9331
9345
  }, [_prop.btns.map(btn => {
9332
- switch (btn) {
9333
- case "fill":
9334
- return vue.createVNode("img", {
9335
- "title": "\u62C9\u4F38/\u539F\u59CB\u5C3A\u5BF8",
9336
- "onClick": e => {
9337
- if (fill.value === "fill") {
9338
- fill.value = "contain";
9339
- localStorage.setItem(camera.value.uuid, fill.value);
9340
- } else {
9341
- fill.value = "fill";
9342
- localStorage.setItem(camera.value.uuid, fill.value);
9343
- }
9344
- },
9345
- "src": "/micro-assets/inl/video/controls/fill.svg"
9346
- }, null);
9347
- case "look":
9348
- return vue.createVNode("img", {
9349
- "title": "\u6253\u5F00/\u5173\u95ED\u5C5E\u6027\u663E\u793A",
9350
- "onClick": e => {
9351
- showInfo.value = !showInfo.value;
9352
- },
9353
- "src": "/micro-assets/inl/video/controls/show.png"
9354
- }, null);
9355
- case "stream":
9356
- return vue.createVNode(vue.resolveComponent("a-popover"), {
9357
- "title": "\u5207\u6362\u7801\u6D41",
9358
- "content": vue.createVNode("div", null, [streams.value.map(stream => {
9359
- return vue.createVNode("div", {
9360
- "class": "btn",
9361
- "onClick": () => {
9362
- changeStream(stream.code);
9363
- streamHistory.value = stream.code;
9346
+ if (!(camera.value.brandTypeCode === "MP4" && btn !== "close")) {
9347
+ switch (btn) {
9348
+ case "fill":
9349
+ return vue.createVNode("img", {
9350
+ "title": "\u62C9\u4F38/\u539F\u59CB\u5C3A\u5BF8",
9351
+ "onClick": e => {
9352
+ if (fill.value === "fill") {
9353
+ fill.value = "contain";
9354
+ localStorage.setItem(camera.value.uuid, fill.value);
9355
+ } else {
9356
+ fill.value = "fill";
9357
+ localStorage.setItem(camera.value.uuid, fill.value);
9364
9358
  }
9365
- }, [stream.name]);
9366
- })])
9367
- }, {
9368
- default: () => [vue.createVNode("img", {
9369
- "src": "/micro-assets/inl/video/stream.png"
9370
- }, null)]
9371
- });
9372
- case "direction":
9373
- return vue.createVNode(vue.resolveComponent("a-popover"), {
9374
- "title": "\u63A7\u5236\u5668",
9375
- "content": vue.createVNode("div", {
9376
- "class": "videoControls"
9377
- }, [vue.createVNode("div", {
9378
- "class": "videoControl"
9379
- }, [vue.createVNode("img", {
9380
- "class": "bg",
9381
- "src": "/micro-assets/inl/video/controls/circle.png"
9382
- }, null), videoBtns.map(ele => {
9383
- return vue.createVNode("div", null, [ele.map(btn2 => {
9384
- return vue.createVNode("img", {
9385
- "class": btn2.text,
9386
- "src": "/micro-assets/inl/video/controls/up.svg",
9387
- "onClick": e => videoMove(btn2.signal)
9388
- }, null);
9389
- })]);
9390
- })]), vue.createVNode("div", {
9391
- "class": "flex"
9392
- }, [vue.createVNode("div", {
9393
- "class": "flex1 btns"
9394
- }, [vue.createVNode("img", {
9395
- "src": "/micro-assets/inl/video/controls/smaller.svg",
9396
- "onClick": e => videoMove(16)
9397
- }, null), vue.createVNode("img", {
9398
- "src": "/micro-assets/inl/video/controls/bigger.svg",
9399
- "onClick": e => videoMove(15)
9400
- }, null)]), vue.createVNode("div", {
9401
- "class": "flex1 btns"
9402
- }, [vue.createVNode("img", {
9403
- "src": "/micro-assets/inl/video/controls/go.svg",
9404
- "onClick": e => videoMove(14)
9405
- }, null), vue.createVNode("img", {
9406
- "src": "/micro-assets/inl/video/controls/back.svg",
9407
- "onClick": e => videoMove(13)
9408
- }, null)])]), vue.createVNode("div", {
9409
- "class": "flex"
9410
- }, [vue.createVNode("div", {
9411
- "class": "flex1 btns"
9412
- }, [vue.createVNode("img", {
9413
- "src": "/micro-assets/inl/video/controls/light.svg",
9414
- "onClick": e => videoMove(2)
9415
- }, null), vue.createVNode("img", {
9416
- "src": "/micro-assets/inl/video/controls/rain.svg",
9417
- "onClick": e => videoMove(3)
9418
- }, null)])])])
9419
- }, {
9420
- default: () => [vue.createVNode("img", {
9421
- "src": "/micro-assets/inl/video/control.png"
9422
- }, null)]
9423
- });
9424
- case "fullScreen":
9425
- return vue.createVNode("img", {
9426
- "onClick": e => {
9427
- e.stopPropagation();
9428
- player.value.videoFull();
9429
- },
9430
- "src": "/micro-assets/inl/video/putUp.png"
9431
- }, null);
9432
- case "close":
9433
- return vue.createVNode("img", {
9434
- "onClick": e => {
9435
- _context.emit("close");
9436
- },
9437
- "src": "/micro-assets/inl/video/close.png"
9438
- }, null);
9359
+ },
9360
+ "src": "/micro-assets/inl/video/controls/fill.svg"
9361
+ }, null);
9362
+ case "look":
9363
+ return vue.createVNode("img", {
9364
+ "title": "\u6253\u5F00/\u5173\u95ED\u5C5E\u6027\u663E\u793A",
9365
+ "onClick": e => {
9366
+ showInfo.value = !showInfo.value;
9367
+ },
9368
+ "src": "/micro-assets/inl/video/controls/show.png"
9369
+ }, null);
9370
+ case "stream":
9371
+ return vue.createVNode(vue.resolveComponent("a-popover"), {
9372
+ "title": "\u5207\u6362\u7801\u6D41",
9373
+ "content": vue.createVNode("div", null, [streams.value.map(stream => {
9374
+ return vue.createVNode("div", {
9375
+ "class": "btn",
9376
+ "onClick": () => {
9377
+ changeStream(stream.code);
9378
+ streamHistory.value = stream.code;
9379
+ }
9380
+ }, [stream.name]);
9381
+ })])
9382
+ }, {
9383
+ default: () => [vue.createVNode("img", {
9384
+ "src": "/micro-assets/inl/video/stream.png"
9385
+ }, null)]
9386
+ });
9387
+ case "direction":
9388
+ return vue.createVNode(vue.resolveComponent("a-popover"), {
9389
+ "title": "\u63A7\u5236\u5668",
9390
+ "content": vue.createVNode("div", {
9391
+ "class": "videoControls"
9392
+ }, [vue.createVNode("div", {
9393
+ "class": "videoControl"
9394
+ }, [vue.createVNode("img", {
9395
+ "class": "bg",
9396
+ "src": "/micro-assets/inl/video/controls/circle.png"
9397
+ }, null), videoBtns.map(ele => {
9398
+ return vue.createVNode("div", null, [ele.map(btn2 => {
9399
+ return vue.createVNode("img", {
9400
+ "class": btn2.text,
9401
+ "src": "/micro-assets/inl/video/controls/up.svg",
9402
+ "onClick": e => videoMove(btn2.signal)
9403
+ }, null);
9404
+ })]);
9405
+ })]), vue.createVNode("div", {
9406
+ "class": "flex"
9407
+ }, [vue.createVNode("div", {
9408
+ "class": "flex1 btns"
9409
+ }, [vue.createVNode("img", {
9410
+ "src": "/micro-assets/inl/video/controls/smaller.svg",
9411
+ "onClick": e => videoMove(16)
9412
+ }, null), vue.createVNode("img", {
9413
+ "src": "/micro-assets/inl/video/controls/bigger.svg",
9414
+ "onClick": e => videoMove(15)
9415
+ }, null)]), vue.createVNode("div", {
9416
+ "class": "flex1 btns"
9417
+ }, [vue.createVNode("img", {
9418
+ "src": "/micro-assets/inl/video/controls/go.svg",
9419
+ "onClick": e => videoMove(14)
9420
+ }, null), vue.createVNode("img", {
9421
+ "src": "/micro-assets/inl/video/controls/back.svg",
9422
+ "onClick": e => videoMove(13)
9423
+ }, null)])]), vue.createVNode("div", {
9424
+ "class": "flex"
9425
+ }, [vue.createVNode("div", {
9426
+ "class": "flex1 btns"
9427
+ }, [vue.createVNode("img", {
9428
+ "src": "/micro-assets/inl/video/controls/light.svg",
9429
+ "onClick": e => videoMove(2)
9430
+ }, null), vue.createVNode("img", {
9431
+ "src": "/micro-assets/inl/video/controls/rain.svg",
9432
+ "onClick": e => videoMove(3)
9433
+ }, null)])])])
9434
+ }, {
9435
+ default: () => [vue.createVNode("img", {
9436
+ "src": "/micro-assets/inl/video/control.png"
9437
+ }, null)]
9438
+ });
9439
+ case "fullScreen":
9440
+ return vue.createVNode("img", {
9441
+ "onClick": e => {
9442
+ e.stopPropagation();
9443
+ player.value.videoFull();
9444
+ },
9445
+ "src": "/micro-assets/inl/video/putUp.png"
9446
+ }, null);
9447
+ case "close":
9448
+ return vue.createVNode("img", {
9449
+ "onClick": e => {
9450
+ _context.emit("close");
9451
+ },
9452
+ "src": "/micro-assets/inl/video/close.png"
9453
+ }, null);
9454
+ }
9439
9455
  }
9440
9456
  })])])]);
9441
9457
  }
@@ -12686,7 +12702,6 @@ async function audioToText(file) {
12686
12702
  function _isSlot(s) {
12687
12703
  return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !vue.isVNode(s);
12688
12704
  }
12689
- let stream;
12690
12705
  const SpeechRecognition = vue.defineComponent({
12691
12706
  emits: ["change", "close"],
12692
12707
  setup(props, {
@@ -12697,40 +12712,42 @@ const SpeechRecognition = vue.defineComponent({
12697
12712
  const text = vue.ref("");
12698
12713
  const boxRef = vue.inject("boxRef");
12699
12714
  const startRecord = () => {
12700
- if (!stream) return;
12701
- text.value = "";
12702
- mediaRecorder = new MediaRecorder(stream);
12703
- mediaRecorder.start();
12704
- recording.value = true;
12705
- mediaRecorder.ondataavailable = e => {
12706
- const blob = new Blob([e.data], {
12707
- type: "audio/mp4"
12708
- });
12709
- const file = new File([blob], "recordedAudio.m4a", {
12710
- type: blob.type
12711
- });
12712
- audioToText(file).then(str => {
12713
- text.value = str;
12714
- }).catch(() => {
12715
- antDesignVue.message.error("\u8BED\u97F3\u8F6C\u6587\u5B57\u5931\u8D25");
12716
- });
12717
- };
12718
- mediaRecorder.onstop = () => recording.value = false;
12719
- };
12720
- vue.onMounted(() => {
12721
- if (!stream) {
12722
- navigator.mediaDevices.getUserMedia({
12723
- audio: true
12724
- }).then(s => {
12725
- stream = s;
12726
- startRecord();
12727
- }).catch(() => {
12728
- antDesignVue.message.warn("\u8BF7\u5F00\u542F\u5F55\u97F3\u6743\u9650");
12729
- });
12730
- } else {
12731
- startRecord();
12715
+ if (!navigator.mediaDevices) {
12716
+ antDesignVue.message.error("\u4E0D\u652F\u6301mediaDevices");
12717
+ return;
12732
12718
  }
12733
- });
12719
+ navigator.mediaDevices.getUserMedia({
12720
+ audio: true
12721
+ }).then(stream => {
12722
+ if (!MediaRecorder) {
12723
+ antDesignVue.message.error("\u4E0D\u652F\u6301MediaRecorder");
12724
+ }
12725
+ text.value = "";
12726
+ mediaRecorder = new MediaRecorder(stream);
12727
+ mediaRecorder.start();
12728
+ recording.value = true;
12729
+ mediaRecorder.ondataavailable = e => {
12730
+ const blob = new Blob([e.data], {
12731
+ type: "audio/mp4"
12732
+ });
12733
+ const file = new File([blob], "recordedAudio.m4a", {
12734
+ type: blob.type
12735
+ });
12736
+ audioToText(file).then(str => {
12737
+ text.value = str;
12738
+ }).catch(() => {
12739
+ antDesignVue.message.error("\u8BED\u97F3\u8F6C\u6587\u5B57\u5931\u8D25");
12740
+ });
12741
+ };
12742
+ mediaRecorder.onstop = () => {
12743
+ recording.value = false;
12744
+ stream.getTracks().forEach(track => track.stop());
12745
+ };
12746
+ }).catch(e => {
12747
+ antDesignVue.message.warn("\u8BF7\u5F00\u542F\u5F55\u97F3\u6743\u9650");
12748
+ });
12749
+ };
12750
+ vue.onMounted(startRecord);
12734
12751
  const handleStop = () => {
12735
12752
  if (mediaRecorder) {
12736
12753
  mediaRecorder.stop();