Commit 1a098da4162f96b5928ca16796306cd66e402b16

Authored by xp.Huang
1 parent a6ede4b9

fix/perf: :修复规则链相关bug,优化视频控制云台添加控制速度滑块

@@ -9,7 +9,7 @@ export default { @@ -9,7 +9,7 @@ export default {
9 ROUND: '小数', 9 ROUND: '小数',
10 USE_CACHE: '使用缓存获取最新值', 10 USE_CACHE: '使用缓存获取最新值',
11 TELL_FAILURE_IF_DELTA_IS_NEGATIVE: '如果delta为负数,则告知Failure【失败】', 11 TELL_FAILURE_IF_DELTA_IS_NEGATIVE: '如果delta为负数,则告知Failure【失败】',
12 - ADD_PERIOD_BETWEEN_MSGS: '在消息之间添加时间差值{单位:毫秒}', 12 + ADD_PERIOD_BETWEEN_MSGS: '在消息之间添加时间差值(单位:毫秒)',
13 PERIOD_VALUE_KEY: '期间值键', 13 PERIOD_VALUE_KEY: '期间值键',
14 }, 14 },
15 CustomerAttributesFieldsNameEnum: { 15 CustomerAttributesFieldsNameEnum: {
@@ -18,7 +18,7 @@ @@ -18,7 +18,7 @@
18 ZoomInOutlined, 18 ZoomInOutlined,
19 ZoomOutOutlined, 19 ZoomOutOutlined,
20 } from '@ant-design/icons-vue'; 20 } from '@ant-design/icons-vue';
21 - import { Button } from 'ant-design-vue'; 21 + import { Button, Slider } from 'ant-design-vue';
22 import { nextTick } from 'vue'; 22 import { nextTick } from 'vue';
23 import { controlling } from '/@/api/camera/cameraManager'; 23 import { controlling } from '/@/api/camera/cameraManager';
24 import { setVideoControl } from '/@/api/device/videoChannel'; 24 import { setVideoControl } from '/@/api/device/videoChannel';
@@ -88,6 +88,9 @@ @@ -88,6 +88,9 @@
88 return { width, height } as CSSProperties; 88 return { width, height } as CSSProperties;
89 }); 89 });
90 90
  91 + // 控制云台控制速度
  92 + const sliderValue = ref<number>(123);
  93 +
91 const init = () => { 94 const init = () => {
92 if (unref(videoPlayInstance)) unref(videoPlayInstance)?.dispose(); 95 if (unref(videoPlayInstance)) unref(videoPlayInstance)?.dispose();
93 videoPlayInstance.value = videoJs(unref(videoPlayEl)!, unref(getOptions), () => { 96 videoPlayInstance.value = videoJs(unref(videoPlayEl)!, unref(getOptions), () => {
@@ -151,7 +154,7 @@ @@ -151,7 +154,7 @@
151 //长按开始 154 //长按开始
152 const moveStart = (action) => { 155 const moveStart = (action) => {
153 if (unref(getGBT)) { 156 if (unref(getGBT)) {
154 - handleGBTControl(action, '30'); 157 + handleGBTControl(action, unref(sliderValue));
155 return; 158 return;
156 } 159 }
157 handleControl(0, action); 160 handleControl(0, action);
@@ -160,7 +163,7 @@ @@ -160,7 +163,7 @@
160 // 长按结束 163 // 长按结束
161 const moveStop = (action) => { 164 const moveStop = (action) => {
162 if (unref(getGBT)) { 165 if (unref(getGBT)) {
163 - handleGBTControl('STOP', '30'); 166 + handleGBTControl('STOP', unref(sliderValue));
164 return; 167 return;
165 } 168 }
166 handleControl(1, action); 169 handleControl(1, action);
@@ -245,12 +248,15 @@ @@ -245,12 +248,15 @@
245 <Button class="circle" @click="handleClick" /> 248 <Button class="circle" @click="handleClick" />
246 </div> 249 </div>
247 </div> 250 </div>
  251 + <div class="mt-5" v-if="getGBT">
  252 + <Slider v-model:value="sliderValue" :min="0" :max="255" style="width: 130px" />
  253 + </div>
248 <div class="flex justify-center mt-8"> 254 <div class="flex justify-center mt-8">
249 <Button 255 <Button
250 class="button-icon" 256 class="button-icon"
251 @mousedown="moveStart('ZOOM_IN')" 257 @mousedown="moveStart('ZOOM_IN')"
252 @mouseup="moveStop('ZOOM_IN')" 258 @mouseup="moveStop('ZOOM_IN')"
253 - style="border-radius: :50%;" 259 + style="border-radius: 50%"
254 > 260 >
255 <ZoomInOutlined style="color: #315a9c; font-size: 1.5rem" /> 261 <ZoomInOutlined style="color: #315a9c; font-size: 1.5rem" />
256 </Button> 262 </Button>
@@ -258,7 +264,7 @@ @@ -258,7 +264,7 @@
258 class="ml-10 button-icon" 264 class="ml-10 button-icon"
259 @mousedown="moveStart('ZOOM_OUT')" 265 @mousedown="moveStart('ZOOM_OUT')"
260 @mouseup="moveStop('ZOOM_OUT')" 266 @mouseup="moveStop('ZOOM_OUT')"
261 - style="border-radius: :50%;" 267 + style="border-radius: 50%"
262 > 268 >
263 <ZoomOutOutlined style="color: #315a9c; font-size: 1.5rem" /> 269 <ZoomOutOutlined style="color: #315a9c; font-size: 1.5rem" />
264 </Button> 270 </Button>
@@ -380,4 +386,8 @@ @@ -380,4 +386,8 @@
380 border-radius: 0 0 5rem 0; 386 border-radius: 0 0 5rem 0;
381 background-color: #e2dede; 387 background-color: #e2dede;
382 } 388 }
  389 +
  390 + :deep(.ant-slider-track) {
  391 + background: #5586d4;
  392 + }
383 </style> 393 </style>
@@ -12,6 +12,7 @@ export const formSchemas: FormSchema[] = [ @@ -12,6 +12,7 @@ export const formSchemas: FormSchema[] = [
12 field: ClearAlarmFieldsEnum.ALARM_DETAILS_BUILD_JS, 12 field: ClearAlarmFieldsEnum.ALARM_DETAILS_BUILD_JS,
13 component: 'JavascriptEditorWithTestModal', 13 component: 'JavascriptEditorWithTestModal',
14 label: t(ClearAlarmFieldsNameEnum.ALARM_DETAILS_BUILD_JS), 14 label: t(ClearAlarmFieldsNameEnum.ALARM_DETAILS_BUILD_JS),
  15 + changeEvent: 'update:value',
15 componentProps: { 16 componentProps: {
16 javaScriptEditorProps: { 17 javaScriptEditorProps: {
17 functionName: 'Details', 18 functionName: 'Details',
1 -import { PerimeterTypeEnum, RangeUtilEnum, RangeUtilNameEnum } from '../../../enum/form'; 1 +import {
  2 + PerimeterTypeEnum,
  3 + RangeUtilEnum,
  4 + RangeUtilNameEnum,
  5 + TimeIntervalUnitEnum,
  6 + TimeIntervalUnitNameEnum,
  7 +} from '../../../enum/form';
2 import { 8 import {
3 GpsGeofencingEventsFieldsEnum, 9 GpsGeofencingEventsFieldsEnum,
4 GpsGeofencingEventsFieldsNameEnum, 10 GpsGeofencingEventsFieldsNameEnum,
@@ -183,8 +189,8 @@ export const formSchemas: FormSchema[] = [ @@ -183,8 +189,8 @@ export const formSchemas: FormSchema[] = [
183 }, 189 },
184 ], 190 ],
185 componentProps: { 191 componentProps: {
186 - options: Object.keys(RangeUtilEnum).map((value) => ({  
187 - label: RangeUtilNameEnum[value], 192 + options: Object.keys(TimeIntervalUnitEnum).map((value) => ({
  193 + label: TimeIntervalUnitNameEnum[value],
188 value, 194 value,
189 })), 195 })),
190 getPopupContainer: () => document.body, 196 getPopupContainer: () => document.body,
@@ -220,8 +226,8 @@ export const formSchemas: FormSchema[] = [ @@ -220,8 +226,8 @@ export const formSchemas: FormSchema[] = [
220 }, 226 },
221 ], 227 ],
222 componentProps: { 228 componentProps: {
223 - options: Object.keys(RangeUtilEnum).map((value) => ({  
224 - label: RangeUtilNameEnum[value], 229 + options: Object.keys(TimeIntervalUnitEnum).map((value) => ({
  230 + label: TimeIntervalUnitNameEnum[value],
225 value, 231 value,
226 })), 232 })),
227 getPopupContainer: () => document.body, 233 getPopupContainer: () => document.body,
@@ -13,7 +13,13 @@ export const formSchemas: FormSchema[] = [ @@ -13,7 +13,13 @@ export const formSchemas: FormSchema[] = [
13 field: CustomerDetailsFieldsEnum.DETAILS_LIST, 13 field: CustomerDetailsFieldsEnum.DETAILS_LIST,
14 component: 'Select', 14 component: 'Select',
15 label: t(CustomerDetailsFieldsNameEnum.DETAILS_LIST), 15 label: t(CustomerDetailsFieldsNameEnum.DETAILS_LIST),
16 - rules: [{ required: true, message: `请选择${t(CustomerDetailsFieldsNameEnum.DETAILS_LIST)}` }], 16 + rules: [
  17 + {
  18 + required: true,
  19 + message: `请选择${t(CustomerDetailsFieldsNameEnum.DETAILS_LIST)}`,
  20 + type: 'array',
  21 + },
  22 + ],
17 componentProps: { 23 componentProps: {
18 mode: 'multiple', 24 mode: 'multiple',
19 options: Object.keys(DetailsListEnum).map((item) => ({ 25 options: Object.keys(DetailsListEnum).map((item) => ({
@@ -8,59 +8,59 @@ import { useI18n } from '/@/hooks/web/useI18n'; @@ -8,59 +8,59 @@ import { useI18n } from '/@/hooks/web/useI18n';
8 const { t } = useI18n(); 8 const { t } = useI18n();
9 9
10 export const formSchemas: FormSchema[] = [ 10 export const formSchemas: FormSchema[] = [
11 - // {  
12 - // field: OriginatorAttributesEnum.TELL_FAILURE_IF_ABSENT,  
13 - // component: 'Checkbox',  
14 - // label: t(OriginatorAttributesNameEnum.TELL_FAILURE_IF_ABSENT),  
15 - // renderComponentContent: () => ({  
16 - // default: () =>  
17 - // 'If at least one selected key doesn\'t exist the outbound message will report "Failure".',  
18 - // }),  
19 - // },  
20 - // {  
21 - // field: OriginatorAttributesEnum.CLIENT_ATTRIBUTE_NAMES,  
22 - // component: 'Select',  
23 - // label: t(OriginatorAttributesNameEnum.CLIENT_ATTRIBUTE_NAMES),  
24 - // helpMessage: [  
25 - // `Hint: use \${metadataKey} for value from metadata, $[messageKey] for value from message body`,  
26 - // ],  
27 - // componentProps: {  
28 - // mode: 'tags',  
29 - // open: false,  
30 - // placeholder: `请输入${t(OriginatorAttributesNameEnum.CLIENT_ATTRIBUTE_NAMES)}`,  
31 - // },  
32 - // },  
33 - // {  
34 - // field: OriginatorAttributesEnum.SHARED_ATTRIBUTE_NAMES,  
35 - // component: 'Select',  
36 - // label: t(OriginatorAttributesNameEnum.SHARED_ATTRIBUTE_NAMES),  
37 - // helpMessage: [  
38 - // `Hint: use \${metadataKey} for value from metadata, $[messageKey] for value from message body`,  
39 - // ],  
40 - // componentProps: {  
41 - // mode: 'tags',  
42 - // open: false,  
43 - // placeholder: `请输入${t(OriginatorAttributesNameEnum.SHARED_ATTRIBUTE_NAMES)}`,  
44 - // },  
45 - // },  
46 - // {  
47 - // field: OriginatorAttributesEnum.SERVER_ATTRIBUTE_NAMES,  
48 - // component: 'Select',  
49 - // label: t(OriginatorAttributesNameEnum.SERVER_ATTRIBUTE_NAMES),  
50 - // helpMessage: [  
51 - // `Hint: use \${metadataKey} for value from metadata, $[messageKey] for value from message body`,  
52 - // ],  
53 - // componentProps: {  
54 - // mode: 'tags',  
55 - // open: false,  
56 - // placeholder: `请输入${t(OriginatorAttributesNameEnum.SERVER_ATTRIBUTE_NAMES)}`,  
57 - // },  
58 - // }, 11 + {
  12 + field: OriginatorAttributesEnum.TELL_FAILURE_IF_ABSENT,
  13 + component: 'Checkbox',
  14 + label: t(OriginatorAttributesNameEnum.TELL_FAILURE_IF_ABSENT),
  15 + renderComponentContent: () => ({
  16 + default: () =>
  17 + 'If at least one selected key doesn\'t exist the outbound message will report "Failure".',
  18 + }),
  19 + },
  20 + {
  21 + field: OriginatorAttributesEnum.CLIENT_ATTRIBUTE_NAMES,
  22 + component: 'Select',
  23 + label: t(OriginatorAttributesNameEnum.CLIENT_ATTRIBUTE_NAMES),
  24 + helpMessage: [
  25 + `Hint: use \${metadataKey} for value from metadata, $[messageKey] for value from message body`,
  26 + ],
  27 + componentProps: {
  28 + mode: 'tags',
  29 + open: false,
  30 + placeholder: `请输入${t(OriginatorAttributesNameEnum.CLIENT_ATTRIBUTE_NAMES)}`,
  31 + },
  32 + },
  33 + {
  34 + field: OriginatorAttributesEnum.SHARED_ATTRIBUTE_NAMES,
  35 + component: 'Select',
  36 + label: t(OriginatorAttributesNameEnum.SHARED_ATTRIBUTE_NAMES),
  37 + helpMessage: [
  38 + `Hint: use \${metadataKey} for value from metadata, $[messageKey] for value from message body`,
  39 + ],
  40 + componentProps: {
  41 + mode: 'tags',
  42 + open: false,
  43 + placeholder: `请输入${t(OriginatorAttributesNameEnum.SHARED_ATTRIBUTE_NAMES)}`,
  44 + },
  45 + },
  46 + {
  47 + field: OriginatorAttributesEnum.SERVER_ATTRIBUTE_NAMES,
  48 + component: 'Select',
  49 + label: t(OriginatorAttributesNameEnum.SERVER_ATTRIBUTE_NAMES),
  50 + helpMessage: [
  51 + `Hint: use \${metadataKey} for value from metadata, $[messageKey] for value from message body`,
  52 + ],
  53 + componentProps: {
  54 + mode: 'tags',
  55 + open: false,
  56 + placeholder: `请输入${t(OriginatorAttributesNameEnum.SERVER_ATTRIBUTE_NAMES)}`,
  57 + },
  58 + },
59 { 59 {
60 field: OriginatorAttributesEnum.LATEST_TS_KEY_NAMES, 60 field: OriginatorAttributesEnum.LATEST_TS_KEY_NAMES,
61 component: 'Select', 61 component: 'Select',
62 label: t(OriginatorAttributesNameEnum.LATEST_TS_KEY_NAMES), 62 label: t(OriginatorAttributesNameEnum.LATEST_TS_KEY_NAMES),
63 - required: true, 63 + // required: true,
64 helpMessage: [ 64 helpMessage: [
65 `Hint: use \${metadataKey} for value from metadata, $[messageKey] for value from message body`, 65 `Hint: use \${metadataKey} for value from metadata, $[messageKey] for value from message body`,
66 ], 66 ],
@@ -13,7 +13,13 @@ export const formSchemas: FormSchema[] = [ @@ -13,7 +13,13 @@ export const formSchemas: FormSchema[] = [
13 field: TenantDetailsFieldsEnum.DETAILS_LIST, 13 field: TenantDetailsFieldsEnum.DETAILS_LIST,
14 component: 'Select', 14 component: 'Select',
15 label: t(TenantDetailsFieldsNameEnum.DETAILS_LIST), 15 label: t(TenantDetailsFieldsNameEnum.DETAILS_LIST),
16 - rules: [{ required: true, message: `请选择${t(TenantDetailsFieldsNameEnum.DETAILS_LIST)}` }], 16 + rules: [
  17 + {
  18 + required: true,
  19 + message: `请选择${t(TenantDetailsFieldsNameEnum.DETAILS_LIST)}`,
  20 + type: 'array',
  21 + },
  22 + ],
17 componentProps: { 23 componentProps: {
18 mode: 'multiple', 24 mode: 'multiple',
19 options: Object.keys(DetailsListEnum).map((value) => ({ 25 options: Object.keys(DetailsListEnum).map((value) => ({
@@ -19,6 +19,7 @@ export const formSchemas: FormSchema[] = [ @@ -19,6 +19,7 @@ export const formSchemas: FormSchema[] = [
19 javaScriptEditorProps: { 19 javaScriptEditorProps: {
20 height: 230, 20 height: 230,
21 functionName: 'Switch', 21 functionName: 'Switch',
  22 + scriptType: 'switch',
22 paramsName: ['msg', 'metadata', 'msgType'], 23 paramsName: ['msg', 'metadata', 'msgType'],
23 }, 24 },
24 }, 25 },