修复通过右键窗口添加轮询后,再次右键窗口修改轮询无数据的BUG

轮询、预案对话框输入延时时增加提示
This commit is contained in:
fangxiang 2022-06-22 17:51:20 +08:00
parent 4f9359875c
commit f097afcf1f
7 changed files with 103 additions and 36 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "media_player_client", "name": "media_player_client",
"version": "1.4.15", "version": "1.4.16",
"description": "A Quasar Framework app", "description": "A Quasar Framework app",
"productName": "MediaPlayerClient", "productName": "MediaPlayerClient",
"author": "fangxiang <fangxiang@cloudview.work>", "author": "fangxiang <fangxiang@cloudview.work>",

View File

@ -574,8 +574,7 @@ export default class RemoteDataExangeProcesser {
} }
} }
break; break;
case Protocol.Commands.kSetDeviceAttribute: case Protocol.Commands.kSetDeviceAttribute: {
{
const temp = JSON.parse( const temp = JSON.parse(
notify.data notify.data
) as Protocol.SetDeviceAttributeNotifyEntity; ) as Protocol.SetDeviceAttributeNotifyEntity;
@ -583,6 +582,33 @@ export default class RemoteDataExangeProcesser {
$store.commit("setDeviceAttribute", temp.attribute); $store.commit("setDeviceAttribute", temp.attribute);
} }
} }
case Protocol.Commands.kWindowPropertyValueChanged:
{
const temp = JSON.parse(
notify.data
) as Protocol.WindowPropertyValueChangeNotifyEntity;
if (temp) {
const window = $store.state.windows.find(
(element) => element && element.window_id == temp.window_id
);
if (window) {
if (temp.name == "polling_uuid") {
$store.commit("setWindowProperty", {
window,
property_name: temp.name,
value: temp.value,
});
} else {
console.error(
"kWindowPropertyValueChanged: name:" +
temp.name +
" .not support, value:" +
temp.value
);
}
}
}
}
break; break;
} }
} catch {} } catch {}

View File

@ -207,13 +207,31 @@
</div> </div>
<div v-else-if="props.col.name == 'delay'"> <div v-else-if="props.col.name == 'delay'">
{{ props.value }}{{ $t("s") }} {{ props.value }}{{ $t("s") }}
<q-popup-edit v-model="props.row.delay"> <q-popup-edit
v-model="props.row.delay"
:validate="
(val) => !isNaN(parseInt(val)) && parseInt(val) > 9
"
auto-save
v-slot="scope"
>
<q-input <q-input
type="number" type="number"
v-model="props.row.delay" v-model="scope.value"
:min="min_delay" :min="min_delay"
dense dense
autofocus autofocus
:rules="[
(val) =>
(val != null &&
val != undefined &&
val.toString().length > 0) ||
$t('Please type something'),
(val) =>
parseInt(val) >= 10 ||
$t('number must be greater than or equal to ') +
'10',
]"
> >
<template v-slot:append> <template v-slot:append>
<span>{{ $t("s") }}</span> <span>{{ $t("s") }}</span>

View File

@ -139,13 +139,31 @@
</div> </div>
<div v-else-if="props.col.name == 'delay'"> <div v-else-if="props.col.name == 'delay'">
{{ props.value }}{{ $t("s") }} {{ props.value }}{{ $t("s") }}
<q-popup-edit v-model="props.row.delay"> <q-popup-edit
<q-input
type="number"
v-model="props.row.delay" v-model="props.row.delay"
:validate="
(val) => !isNaN(parseInt(val)) && parseInt(val) > 9
"
auto-save
v-slot="scope"
>
<q-input
v-model="scope.value"
type="number"
:min="min_delay" :min="min_delay"
dense dense
autofocus autofocus
:rules="[
(val) =>
(val != null &&
val != undefined &&
val.toString().length > 0) ||
$t('Please type something'),
(val) =>
parseInt(val) >= 10 ||
$t('number must be greater than or equal to ') +
'10',
]"
> >
<template v-slot:append> <template v-slot:append>
<span>{{ $t("s") }}</span> <span>{{ $t("s") }}</span>

View File

@ -90,6 +90,10 @@ export namespace Protocol {
return Commands.PROTOCOL_PREFIX + "WindowOtherStateChanged"; return Commands.PROTOCOL_PREFIX + "WindowOtherStateChanged";
} }
public static get kWindowPropertyValueChanged() {
return Commands.PROTOCOL_PREFIX + "WindowPropertyValueChanged";
}
public static get kTopWindow() { public static get kTopWindow() {
return Commands.PROTOCOL_PREFIX + "TopWindow"; return Commands.PROTOCOL_PREFIX + "TopWindow";
} }
@ -325,7 +329,6 @@ export namespace Protocol {
public static get kPollingStateChanged() { public static get kPollingStateChanged() {
return Commands.PROTOCOL_PREFIX + "PollingStateChanged"; return Commands.PROTOCOL_PREFIX + "PollingStateChanged";
} }
public static get kDesktopResolutionChangedNotify() { public static get kDesktopResolutionChangedNotify() {
return Commands.PROTOCOL_PREFIX + "DesktopResolutionChangedNotify"; return Commands.PROTOCOL_PREFIX + "DesktopResolutionChangedNotify";
} }
@ -459,6 +462,7 @@ export namespace Protocol {
Commands.kTopWindow, Commands.kTopWindow,
Commands.kLowerWindow, Commands.kLowerWindow,
Commands.kWindowOtherStateChanged, Commands.kWindowOtherStateChanged,
Commands.kWindowPropertyValueChanged,
Commands.kRpcAddSignalSourceGroup, Commands.kRpcAddSignalSourceGroup,
Commands.kRpcDeleteSignalSourceGroup, Commands.kRpcDeleteSignalSourceGroup,
Commands.kRpcEditSignalSourceGroup, Commands.kRpcEditSignalSourceGroup,
@ -1995,7 +1999,6 @@ export namespace Protocol {
export class SetWindowPollingDataResponseEntity extends Protocol.PacketEntity { export class SetWindowPollingDataResponseEntity extends Protocol.PacketEntity {
success = false; success = false;
polling = false; polling = false;
new_polling_uuid = "";
constructor() { constructor() {
super(); super();
@ -2064,6 +2067,17 @@ export namespace Protocol {
} }
} }
export class WindowPropertyValueChangeNotifyEntity extends PacketEntity {
window_id = 0;
name = "";
value = "";
constructor() {
super();
this.command = Commands.kWindowPropertyValueChanged;
}
}
export class DesktopDisconnectNotifyEntity extends PacketEntity { export class DesktopDisconnectNotifyEntity extends PacketEntity {
timestamp: number = 0; timestamp: number = 0;

View File

@ -585,4 +585,5 @@ export default {
"load file error": "文件加载错误", "load file error": "文件加载错误",
"time format error": "时间格式错误", "time format error": "时间格式错误",
"input new file name": "输入新文件名", "input new file name": "输入新文件名",
"number must be greater than or equal to ": "数字必须大于等于 ",
}; };

View File

@ -1055,8 +1055,6 @@ export default defineComponent({
const polling = GlobalData.getInstance().pollings.find( const polling = GlobalData.getInstance().pollings.find(
(element) => element && element.uuid == window.polling_uuid (element) => element && element.uuid == window.polling_uuid
); );
console.log(GlobalData.getInstance().pollings);
console.log(window.polling_uuid);
const signal_source = GlobalData.getInstance().signal_source.find( const signal_source = GlobalData.getInstance().signal_source.find(
(element) => (element) =>
element && element.uuid == window.signal_source_table_uuid element && element.uuid == window.signal_source_table_uuid
@ -1072,14 +1070,7 @@ export default defineComponent({
const resposne = await GlobalData.getInstance() const resposne = await GlobalData.getInstance()
.getCurrentClient() .getCurrentClient()
?.setWindowPollingData(window_id, name, datas); ?.setWindowPollingData(window_id, name, datas);
if (resposne) { if (resposne && resposne.success) {
if (resposne.success) {
$store.commit("setWindowProperty", {
window,
property_name: "polling_uuid",
value: resposne.new_polling_uuid,
});
window.polling_uuid = resposne.new_polling_uuid;
$q.notify({ $q.notify({
color: "positive", color: "positive",
icon: "done", icon: "done",
@ -1096,7 +1087,6 @@ export default defineComponent({
timeout: 1500, timeout: 1500,
}); });
} }
}
} catch (e) { } catch (e) {
console.log(e); console.log(e);
} }