轮询选择信号源,预案选择模式列表弹窗改为树形弹窗

This commit is contained in:
fangxiang 2022-03-10 19:27:14 +08:00
parent b27110075f
commit 740dee767d
2 changed files with 110 additions and 21 deletions

View File

@ -160,16 +160,63 @@
</q-popup-edit>
</div>
<div v-else>
<q-popup-edit v-model="props.row.value">
<q-select
:options="modes"
option-label="name"
option-value="uuid"
emit-value
map-options
v-model="props.row.value"
<q-popup-edit
ref="popup_edit"
v-model="props.row.value"
>
<q-tree
ref="tree"
:nodes="$store.state.mode_tree"
node-key="uuid"
labelKey="name"
default-expand-all
>
</q-select>
<template v-slot:default-header="prop">
<q-item
class="full-width"
:clickable="!prop.node.is_group"
@click="
(evt) => {
props.row.value =
prop.node.item_data.uuid;
$refs.popup_edit.hide();
}
"
:style="{
border:
props.row.value ==
prop?.node?.item_data?.uuid
? '1px solid #aacceec2'
: 'none',
}"
>
<q-item-section avatar>
<q-icon
:name="
prop.node.is_group
? 'img:source_icon/group.png'
: 'img:source_icon/hdmi.png'
"
color="orange"
size="28px"
class="q-mr-sm"
/>
</q-item-section>
<q-item-section>
<div class="text-weight-bold text-primary">
<span
v-if="
prop.node.item_data &&
!prop.node.is_group
"
>({{ prop.node.item_data?.number }})
</span>
&nbsp;&nbsp;{{ prop.node.name }}
</div>
</q-item-section>
</q-item>
</template>
</q-tree>
</q-popup-edit>
{{
modes.find(
@ -565,7 +612,7 @@ export default defineComponent({
i += 2
) {
const item = datas.value[i];
console.log(item);
if (item && item.key.startsWith("operator_")) {
const item_value = GlobalData.getInstance().modes.find(
(element) => element && element.uuid == item.value

View File

@ -96,16 +96,56 @@
</q-popup-edit>
</div>
<div v-else>
<q-popup-edit v-model="props.row.value">
<q-select
:options="signals"
option-label="name"
option-value="uuid"
emit-value
map-options
v-model="props.row.value"
<q-popup-edit
ref="popup_edit"
v-model="props.row.value"
>
<q-tree
ref="tree"
:nodes="$store.state.signal_source_tree"
node-key="uuid"
labelKey="name"
default-expand-all
>
</q-select>
<template v-slot:default-header="prop">
<q-item
class="full-width"
:clickable="!prop.node.is_group"
@click="
(evt) => {
props.row.value = prop.node.uuid;
$refs.popup_edit.hide();
}
"
:style="{
border:
props.row.value == prop.node.uuid
? '1px solid #aacceec2'
: 'none',
}"
>
<q-item-section avatar>
<q-icon
:name="
prop.node.is_group
? 'img:source_icon/group.png'
: getItemIcon(
prop.node.item_data?.window_type
)
"
color="orange"
size="28px"
class="q-mr-sm"
/>
</q-item-section>
<q-item-section>
<div class="text-weight-bold text-primary">
{{ prop.node.name }}
</div>
</q-item-section>
</q-item>
</template>
</q-tree>
</q-popup-edit>
{{
signals.find(
@ -192,8 +232,7 @@ import GlobalData from "src/common/GlobalData";
import { useQuasar } from "quasar";
import { useI18n } from "vue-i18n";
import { StringKeyValueEntity } from "src/entities/StringKeyValueEntity";
import { PlanEntity } from "src/entities/PlanEntity";
import { resolve } from "dns";
import { Common } from "src/common/Common";
const __MIN_DELAY = 10;
@ -333,6 +372,9 @@ export default defineComponent({
} catch {}
loading.value = false;
},
getItemIcon(item_type: string) {
return Common.getSignalSourceIcon(item_type);
},
};
},
});