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

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> </q-popup-edit>
</div> </div>
<div v-else> <div v-else>
<q-popup-edit v-model="props.row.value"> <q-popup-edit
<q-select ref="popup_edit"
:options="modes"
option-label="name"
option-value="uuid"
emit-value
map-options
v-model="props.row.value" v-model="props.row.value"
> >
</q-select> <q-tree
ref="tree"
:nodes="$store.state.mode_tree"
node-key="uuid"
labelKey="name"
default-expand-all
>
<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> </q-popup-edit>
{{ {{
modes.find( modes.find(
@ -565,7 +612,7 @@ export default defineComponent({
i += 2 i += 2
) { ) {
const item = datas.value[i]; const item = datas.value[i];
console.log(item);
if (item && item.key.startsWith("operator_")) { if (item && item.key.startsWith("operator_")) {
const item_value = GlobalData.getInstance().modes.find( const item_value = GlobalData.getInstance().modes.find(
(element) => element && element.uuid == item.value (element) => element && element.uuid == item.value

View File

@ -96,16 +96,56 @@
</q-popup-edit> </q-popup-edit>
</div> </div>
<div v-else> <div v-else>
<q-popup-edit v-model="props.row.value"> <q-popup-edit
<q-select ref="popup_edit"
:options="signals"
option-label="name"
option-value="uuid"
emit-value
map-options
v-model="props.row.value" v-model="props.row.value"
> >
</q-select> <q-tree
ref="tree"
:nodes="$store.state.signal_source_tree"
node-key="uuid"
labelKey="name"
default-expand-all
>
<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> </q-popup-edit>
{{ {{
signals.find( signals.find(
@ -192,8 +232,7 @@ import GlobalData from "src/common/GlobalData";
import { useQuasar } from "quasar"; import { useQuasar } from "quasar";
import { useI18n } from "vue-i18n"; import { useI18n } from "vue-i18n";
import { StringKeyValueEntity } from "src/entities/StringKeyValueEntity"; import { StringKeyValueEntity } from "src/entities/StringKeyValueEntity";
import { PlanEntity } from "src/entities/PlanEntity"; import { Common } from "src/common/Common";
import { resolve } from "dns";
const __MIN_DELAY = 10; const __MIN_DELAY = 10;
@ -333,6 +372,9 @@ export default defineComponent({
} catch {} } catch {}
loading.value = false; loading.value = false;
}, },
getItemIcon(item_type: string) {
return Common.getSignalSourceIcon(item_type);
},
}; };
}, },
}); });