| | |
| | | export const useAreaStore = defineStore('area', { |
| | | state: () => { |
| | | return { |
| | | locations: {}, |
| | | sceneType: {}, |
| | | time: '', |
| | | area: { |
| | | provincecode: undefined, |
| | | provincename: undefined, |
| | |
| | | this.area.cityname = location.cName |
| | | this.area.districtcode = location.dCode |
| | | this.area.districtname = location.dName |
| | | |
| | | this.locations = { |
| | | pCode: location.pCode, |
| | | pName: location.pName, |
| | | cCode: location.cCode, |
| | | cName: location.cName, |
| | | dCode: location.dCode, |
| | | dName: location.dName |
| | | } |
| | | }, |
| | | setTimePeriod(time, type) { |
| | | const d = time ? dayjs(time) : dayjs() |
| | | this.time = time ? time : new Date() |
| | | const d = dayjs(this.time) |
| | | this.area.starttime = d.startOf(type).format('YYYY-MM-DD HH:mm:ss') |
| | | this.area.endtime = d.endOf(type).format('YYYY-MM-DD HH:mm:ss') |
| | | }, |
| | |
| | | }, |
| | | // 设置场景类型 |
| | | setSceneType(t) { |
| | | this.area.scensetypeid = t |
| | | this.sceneType = t |
| | | this.area.scensetypeid = t.value |
| | | } |
| | | } |
| | | }) |