Skip to content

Commit

Permalink
fix: element select, see https://sonic-cloud.wiki/d/3293-v255
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhouYixun committed Jun 9, 2023
1 parent ebbde60 commit 7541d02
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 39 deletions.
77 changes: 46 additions & 31 deletions src/components/ElementSelect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ onMounted(() => {
filterable
style="width: 100%"
value-key="id"
:placeholder="$t('element.namePlace')"
@visible-change="findByProjectIdAndEleType"
>
<template #prefix>
Expand All @@ -130,39 +129,55 @@ onMounted(() => {
}}</span>
</template>
<template #empty>
<div style="text-align: center; margin: 5px 0">
<el-select v-model="moduleId" size="small" @change="findByModule">
<el-option
v-for="item in moduleList"
:key="item.name"
:value="item.id"
:label="item.name"
>
</el-option>
</el-select>
<div style="text-align: center; margin: 5px">
<el-input
v-model="name"
:placeholder="$t('element.namePlace')"
@input="findByName"
>
<template #prepend>
<el-select
v-model="moduleId"
style="width: 115px"
size="small"
@change="findByModule"
>
<el-option
v-for="item in moduleList"
:key="item.name"
:value="item.id"
:label="item.name"
>
</el-option>
</el-select>
</template>
</el-input>
</div>
<el-empty />
</template>
<div
style="
display: flex;
justify-content: center;
align-items: center;
margin: 5px 0;
"
>
<span style="font-size: 14px; color: #99a9bf; margin: 0 10px">{{
$t('element.modelFilter')
}}</span>
<el-select v-model="moduleId" size="small" @change="findByModule">
<el-option
v-for="item in moduleList"
:key="item.name"
:value="item.id"
:label="item.name"
>
</el-option>
</el-select>
<div style="text-align: center; margin: 5px">
<el-input
v-model="name"
:placeholder="$t('element.namePlace')"
@input="findByName"
>
<template #prepend>
<el-select
v-model="moduleId"
style="width: 115px"
size="small"
@change="findByModule"
>
<el-option
v-for="item in moduleList"
:key="item.name"
:value="item.id"
:label="item.name"
>
</el-option>
</el-select>
</template>
</el-input>
</div>
<el-option
v-for="item in pageData['content']"
Expand Down
16 changes: 8 additions & 8 deletions src/views/Devices.vue
Original file line number Diff line number Diff line change
Expand Up @@ -140,13 +140,13 @@ const openHub = () => {
};
watch(dialogAgent, (newValue, oldValue) => {
if (!newValue) {
agent.value = {
id: 0,
name: '',
highTemp: 45,
highTempTime: 15,
robotSecret: '',
robotToken: '',
agent.value = {
id: 0,
name: '',
highTemp: 45,
highTempTime: 15,
robotSecret: '',
robotToken: '',
robotType: 1,
};
}
Expand Down Expand Up @@ -1013,7 +1013,7 @@ onUnmounted(() => {
</el-form-item>
<el-form-item prop="alertRobotIds" :label="$t('agent.ui.alertRobotIds')">
<el-checkbox
:label="$t('agent.ui.defaultAlertRobotIds')"
:label="$t('agent.ui.defaultAlertRobotIds')"
:checked="agent.alertRobotIds == null"
class="mb-2"
@change="
Expand Down

0 comments on commit 7541d02

Please sign in to comment.