|
|
|
@ -23,7 +23,7 @@
@@ -23,7 +23,7 @@
|
|
|
|
|
<div |
|
|
|
|
v-for="(item, i) in navList" |
|
|
|
|
v-show="navList.length > 0" |
|
|
|
|
:key="i" |
|
|
|
|
:key="item.id" |
|
|
|
|
@click="onItemClick(item)" |
|
|
|
|
> |
|
|
|
|
<div |
|
|
|
@ -63,11 +63,19 @@
@@ -63,11 +63,19 @@
|
|
|
|
|
|
|
|
|
|
<script lang="ts" setup> |
|
|
|
|
import { useRouter } from "vue-router"; |
|
|
|
|
import { ref } from "vue"; |
|
|
|
|
import { getCurrentInstance, onBeforeMount, ref } from "vue"; |
|
|
|
|
import { TimingDto } from "@/dto/timing-dto"; |
|
|
|
|
import { Toast } from "vant"; |
|
|
|
|
|
|
|
|
|
const { proxy } = getCurrentInstance() as any; |
|
|
|
|
|
|
|
|
|
const router = useRouter(); |
|
|
|
|
let isCreat = false; |
|
|
|
|
const runFun = (index: any) => { |
|
|
|
|
Toast("删除角标" + index); |
|
|
|
|
navList.value.splice(index, 1); |
|
|
|
|
|
|
|
|
|
}; |
|
|
|
|
/** |
|
|
|
|
* 切换选中状态 |
|
|
|
|
*/ |
|
|
|
@ -92,12 +100,21 @@ const onClickAdd = () => {
@@ -92,12 +100,21 @@ const onClickAdd = () => {
|
|
|
|
|
* 删除定时 |
|
|
|
|
*/ |
|
|
|
|
const onItemDelete = (index: number) => { |
|
|
|
|
router.push("/timingSureDelete"); |
|
|
|
|
router.push({ |
|
|
|
|
path: "/timingSureDelete", |
|
|
|
|
query: { pageType: "timingSureDelete", index: index } |
|
|
|
|
}); |
|
|
|
|
// navList.value.splice(index, 1); |
|
|
|
|
// if (navList.value.length === 0) { |
|
|
|
|
// //显示无数据内容 |
|
|
|
|
// } |
|
|
|
|
}; |
|
|
|
|
onBeforeMount(() => { |
|
|
|
|
if (!isCreat) { |
|
|
|
|
isCreat = true; |
|
|
|
|
proxy.$eventBusService.on("timingDelete", runFun); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
const navList = ref([ |
|
|
|
|
{ |
|
|
|
@ -105,26 +122,31 @@ const navList = ref([
@@ -105,26 +122,31 @@ const navList = ref([
|
|
|
|
|
time: "2.5", |
|
|
|
|
name: "主卧空调", |
|
|
|
|
state: false, |
|
|
|
|
selectState: false, |
|
|
|
|
selectState: false |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
id: 1, |
|
|
|
|
time: "3.0", |
|
|
|
|
name: "次卧空调", |
|
|
|
|
state: true, |
|
|
|
|
selectState: false, |
|
|
|
|
selectState: false |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
id: 2, |
|
|
|
|
time: "4.0", |
|
|
|
|
name: "餐厅空调", |
|
|
|
|
state: false, |
|
|
|
|
selectState: false, |
|
|
|
|
}, |
|
|
|
|
selectState: false |
|
|
|
|
} |
|
|
|
|
]); |
|
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped> |
|
|
|
|
<style lang="scss"> |
|
|
|
|
.sy { |
|
|
|
|
width: 672px; |
|
|
|
|
background-color: rebeccapurple; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.base-timing-card { |
|
|
|
|
background-image: url("@/assets/imgs/show/bg_timing.png"); |
|
|
|
|
height: 100vh; |
|
|
|
|