Commit c36f5a75 authored by 郭铭瑶's avatar 郭铭瑶 🤘

工作站页面对接部分接口

parent bbbd85a7
...@@ -10,7 +10,6 @@ switch (process.env.NODE_ENV) { ...@@ -10,7 +10,6 @@ switch (process.env.NODE_ENV) {
export default { export default {
BASE_URL, BASE_URL,
GET_BUILDING: '/service-basicdatasync-ddd/building', // 门牌幢列表 GET_BUILDING: '/service-basicdatasync-ddd/building', // 门牌幢列表
GET_STATION: '/service-special-nandong/workstations', // 工作站列表
GET_INDUSTRY_AUTHORITY: '/service-basicdatasync-ddd/indCous', // 业委会列表 GET_INDUSTRY_AUTHORITY: '/service-basicdatasync-ddd/indCous', // 业委会列表
GET_COMMITTEE: '/service-basicdatasync-ddd/residentsCommittees', // 居委会列表 GET_COMMITTEE: '/service-basicdatasync-ddd/residentsCommittees', // 居委会列表
GET_COMPANY: '/service-basicdatasync-ddd/propCompanies', // 物业列表 GET_COMPANY: '/service-basicdatasync-ddd/propCompanies', // 物业列表
...@@ -34,4 +33,13 @@ export default { ...@@ -34,4 +33,13 @@ export default {
GET_COMMUNITY_FACILITY: '/service-special-nandong/communityRelations', // 小区设施 GET_COMMUNITY_FACILITY: '/service-special-nandong/communityRelations', // 小区设施
GET_ISSUE_LIST: '/service-special-nandong/management/factors', // 管理要素列表 GET_ISSUE_LIST: '/service-special-nandong/management/factors', // 管理要素列表
GET_COMBINE_LIST: '/service-special-nandong/league/linkage', // 联勤联动列表 GET_COMBINE_LIST: '/service-special-nandong/league/linkage', // 联勤联动列表
/** 工作站 */
GET_STATION: '/service-special-nandong/workstations', // 工作站信息
GET_DUTY_SUM: '/service-special-nandong/workStation/dutyNum', // 勤务统计数
GET_DUTY_LIST: '/service-special-nandong/workStation/dutyList', // 勤务列表
GET_DUTY_RANK: '/service-special-nandong/compair/getRanking', // 勤务分析 - 事件类型
GET_DUTY_EVENTS: '/service-special-nandong/compair/getRanking/cmt', // 勤务分析 - 居委事件数量
GET_DUTY_PLACES: '/service-special-nandong/compair/getRanking/addr', // 勤务分析 - 多发地点
GET_DUTY_RANKING: '/service-special-nandong/compair/getRanking/all', // 勤务分析 - 排行
} }
...@@ -11,7 +11,7 @@ Axios.interceptors.request.use( ...@@ -11,7 +11,7 @@ Axios.interceptors.request.use(
(config) => { (config) => {
// 添加token // 添加token
config.headers.Authorization = config.headers.Authorization =
'bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjoiMCIsImVuYWJsZSI6dHJ1ZSwic2NvcGUiOlsicmVhZCIsIndyaXRlIiwidHJ1c3QiXSwiZXhwIjoxNjE4Mzg1MjgxLCJqdGkiOiI5ZTEyOTE0Zi1lNWJlLTRiZjktOTY4Zi0yYzk3ZjMwNmM0OWQiLCJjbGllbnRfaWQiOiJzc28iLCJ0aW1lc3RhbXAiOjE2MTgzNzgwODE2MTR9.PZQbXEaYoKqhZbpvan4rSCJNCJwYRr2Y9fAp_bj3l5FpAORHp6QDDHIBcFfdbQtBEOBOIFhqhji5DicD2-wJeqgEczfEUnWI_XGVTkw-aWBx7Qh4JTOeXOV2Gp1n_mY2tv4xGopoIOdfT2V9U19HyPJ25AtB0NZBzSxNfQtIw5Lt7PJX-jQf_W3b_N5U3cbU7qXtiGZSs-YxnoU-d65cXTIkODW5sU61jBg0RRAtBXeSlyznCrdTqrYIESp3ZgXUs7ie4MUxGurzNBDVCgplP6GRyLU1bQZlgxIi4ZnJPwxFKLMjIdko6JB6soNGIQu4WLyx3acK4zZo14Uk4_F8WQ' 'bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjoiMCIsImVuYWJsZSI6dHJ1ZSwic2NvcGUiOlsicmVhZCIsIndyaXRlIiwidHJ1c3QiXSwiZXhwIjoxNjE4NDE3MTQ0LCJqdGkiOiIxOTZhNGE1ZS0yNzI3LTQ5ZTctOWIxOC02Y2U4OTAzNTQ2YWIiLCJjbGllbnRfaWQiOiJzc28iLCJ0aW1lc3RhbXAiOjE2MTg0MDk5NDQyNjd9.S2L88SbCklTArdG7jFPRw3xZ_xTNSk0r2fqI3ta92w23pFgi3aXazc-AQsno2lNF67eCT7K1KbXrqRa0-jHCT4iLyETPyzDj072QwgB06YzPtb1CqsYZLSAZUO8GH_MUB6Gqxp9Z2jLHJDDyfQF2EaWAaPtONbXxf_0Nsgq_pJDAJG84LSL8j8RyFZJ1ZtYRoCkyVGZvq06AeLTmZdwSqt1k8LKkFWsi9XTL_WVaQsvkZs4oJM7nZokvO70ISSIq7EUNLDUstFtMWwyrv6dnhsa2fkagoDkd4CGInGh3d35E5hXHsR_SD8zMfqzrzdgHzonf58mVhyvzQViNPQfKsw'
return config return config
}, },
(error) => { (error) => {
......
...@@ -44,7 +44,7 @@ export default defineComponent({ ...@@ -44,7 +44,7 @@ export default defineComponent({
...props.config, ...props.config,
}).on(SMap.MapEvent.maploaded, () => { }).on(SMap.MapEvent.maploaded, () => {
ctx.emit('complete', map) ctx.emit('complete', map)
hideCommunity() // hideCommunity()
addListener() addListener()
// map.getLayer('model_white_zw').visible = true // map.getLayer('model_white_zw').visible = true
// map.getLayer('model_white_WEIHAI33').visible = true // map.getLayer('model_white_WEIHAI33').visible = true
...@@ -170,10 +170,18 @@ export default defineComponent({ ...@@ -170,10 +170,18 @@ export default defineComponent({
}: PointProp) { }: PointProp) {
if (!map) return if (!map) return
const points = getMapPoints({ data, key, labelKey, icon, size, color }) const points = getMapPoints({ data, key, labelKey, icon, size, color })
console.log(points)
map.add(points) map.add(points)
return points return points
} }
// 删除点
function remove(points: any) {
if (!map || !points) return
map.remove(points)
}
return { return {
focus, focus,
hideCommunity, hideCommunity,
...@@ -181,6 +189,7 @@ export default defineComponent({ ...@@ -181,6 +189,7 @@ export default defineComponent({
addBoundary, addBoundary,
rotate, rotate,
addPoint, addPoint,
remove,
} }
}, },
}) })
......
...@@ -32,11 +32,11 @@ export default { ...@@ -32,11 +32,11 @@ export default {
commit('SET_CASE_LIST', content) commit('SET_CASE_LIST', content)
}, },
// 工作站列表 // // 工作站列表
async getStation({ commit }: { commit: Commit }): Promise<void> { // async getStation({ commit }: { commit: Commit }): Promise<void> {
const { content } = (await ajax.get({ url: api.GET_STATION })).data // const { content } = (await ajax.get({ url: api.GET_STATION })).data
commit('SET_STATION_LIST', content) // commit('SET_STATION_LIST', content)
}, // },
// 公共服务 - 门岗值守 - 社会物业和直管公房数据 // 公共服务 - 门岗值守 - 社会物业和直管公房数据
async GET_PUBLICSAFE_NEWFIND({ commit }: { commit: Commit }): Promise<void> { async GET_PUBLICSAFE_NEWFIND({ commit }: { commit: Commit }): Promise<void> {
...@@ -249,9 +249,19 @@ export default { ...@@ -249,9 +249,19 @@ export default {
dispatch('getIssueList', id) dispatch('getIssueList', id)
dispatch('getCombineList', id) dispatch('getCombineList', id)
}, },
async getCommunityInfo({ commit }: { commit: Commit }): Promise<void> { async getCommunityInfo(
const { content } = (await ajax.get({ url: api.GET_COMMUNITY_INFO })).data { commit }: { commit: Commit },
commit('SET_COMMUNITY_INFO', content[1]) id: string
): Promise<void> {
const { content } = (
await ajax.get({
url: api.GET_COMMUNITY_INFO,
})
).data
commit(
'SET_COMMUNITY_INFO',
content.find((item: any) => item.id === id)
)
}, },
async getIssueList( async getIssueList(
{ commit }: { commit: Commit }, { commit }: { commit: Commit },
...@@ -277,4 +287,93 @@ export default { ...@@ -277,4 +287,93 @@ export default {
).data ).data
commit('SET_COMBINE_DATA', content) commit('SET_COMBINE_DATA', content)
}, },
/** 工作站 */
initStationData({ dispatch }: { dispatch: Dispatch }, id: string): void {
if (!id) return
dispatch('getStationById', id)
dispatch('getDutySum', id)
},
async getStationById(
{ commit }: { commit: Commit },
id: string
): Promise<void> {
const { content } = (
await ajax.get({ url: api.GET_STATION, params: { id } })
).data
commit('SET_STATION', content && content[0])
},
async getDutySum(
{ commit }: { commit: Commit },
gridId: string
): Promise<void> {
const { content } = (
await ajax.get({ url: api.GET_DUTY_SUM, params: { gridId } })
).data
commit('SET_DUTY_SUM', content)
},
async getDutyList(
{ commit }: { commit: Commit },
params: { [key: string]: string }
): Promise<void> {
if (!params.gridId) return
const { content } = (
await ajax.get({
url: api.GET_DUTY_LIST,
params,
})
).data
commit('SET_DUTY_LIST', content)
},
async getDutyRank(
{ commit }: { commit: Commit },
params: { [key: string]: string }
): Promise<void> {
if (!params.gridId) return
const { content } = (
await ajax.get({
url: api.GET_DUTY_RANK,
params,
})
).data
commit('SET_DUTY_RANK', content)
},
async getDutyEvents(
{ commit }: { commit: Commit },
params: { [key: string]: string }
): Promise<void> {
if (!params.gridId) return
const { content } = (
await ajax.get({
url: api.GET_DUTY_EVENTS,
params,
})
).data
commit('SET_DUTY_EVENTS', content)
},
async getDutyPlaces(
{ commit }: { commit: Commit },
params: { [key: string]: string }
): Promise<void> {
if (!params.gridId) return
const { content } = (
await ajax.get({
url: api.GET_DUTY_PLACES,
params,
})
).data
commit('SET_DUTY_PLACES', content)
},
async getDutyRanking(
{ commit }: { commit: Commit },
params: { [key: string]: string }
): Promise<void> {
if (!params.gridId) return
const { content } = (
await ajax.get({
url: api.GET_DUTY_RANKING,
params,
})
).data
commit('SET_DUTY_RANKING', content)
},
} }
...@@ -7,6 +7,7 @@ export type ThemeType = 'manage' | 'service' | 'safety' ...@@ -7,6 +7,7 @@ export type ThemeType = 'manage' | 'service' | 'safety'
export interface ViewType { export interface ViewType {
name: string name: string
type: 'street' | 'work1' | 'work2' | 'work3' | 'community' type: 'street' | 'work1' | 'work2' | 'work3' | 'community'
id?: string
} }
export interface CommunityInfoProp { export interface CommunityInfoProp {
...@@ -35,6 +36,22 @@ export interface CombineProp { ...@@ -35,6 +36,22 @@ export interface CombineProp {
[key: string]: { [key: string]: any }[] [key: string]: { [key: string]: any }[]
} }
export interface DutySumProp {
comprehensiveNum: number //综合管理数量
comprehensiveEndNum: number //综合管理已结数量
streetNum: number //街面管理数量
streetEndNum: number //街面管理已结数量
communityEndNum: number //小区管理已结数量
communityNum: number //小区管理数量
}
export interface DutyDataProp {
week: { [key: string]: unknown }[]
month: { [key: string]: unknown }[]
day: { [key: string]: unknown }[]
[key: string]: { [key: string]: any }[]
}
export interface GlobalStateProps { export interface GlobalStateProps {
showLoading: boolean showLoading: boolean
curView: ViewType curView: ViewType
...@@ -42,7 +59,6 @@ export interface GlobalStateProps { ...@@ -42,7 +59,6 @@ export interface GlobalStateProps {
curTheme: ThemeType curTheme: ThemeType
propertySummary: { [key: string]: number } propertySummary: { [key: string]: number }
caseList: unknown[] caseList: unknown[]
stationList: unknown[]
pubulicSafeGateSenteryShehuiwuye: { [key: string]: number } pubulicSafeGateSenteryShehuiwuye: { [key: string]: number }
pubulicSafeGateSenteryZhiguangongfang: { [key: string]: number } pubulicSafeGateSenteryZhiguangongfang: { [key: string]: number }
pubulicSafeMap: unknown[] pubulicSafeMap: unknown[]
...@@ -61,6 +77,15 @@ export interface GlobalStateProps { ...@@ -61,6 +77,15 @@ export interface GlobalStateProps {
communityInfo: Partial<CommunityInfoProp> communityInfo: Partial<CommunityInfoProp>
issueData: IssueProp[] issueData: IssueProp[]
combineData: CombineProp combineData: CombineProp
/** 工作站 */
stationInfo: { [key: string]: unknown }
dutySum: Partial<DutySumProp>
dutyList: { [key: string]: any }[]
dutyRank: Partial<DutyDataProp>
dutyEvents: Partial<DutyDataProp>
dutyPlaces: Partial<DutyDataProp>
dutyRanking: Partial<DutyDataProp>
} }
export default createStore<GlobalStateProps>({ export default createStore<GlobalStateProps>({
state, state,
......
...@@ -5,6 +5,8 @@ import { ...@@ -5,6 +5,8 @@ import {
CommunityInfoProp, CommunityInfoProp,
IssueProp, IssueProp,
CombineProp, CombineProp,
DutySumProp,
DutyDataProp,
} from './index' } from './index'
export default { export default {
...@@ -26,8 +28,8 @@ export default { ...@@ -26,8 +28,8 @@ export default {
SET_CASE_LIST(state: GlobalStateProps, data: unknown[]): void { SET_CASE_LIST(state: GlobalStateProps, data: unknown[]): void {
state.caseList = data state.caseList = data
}, },
SET_STATION_LIST(state: GlobalStateProps, data: unknown[]): void { SET_STATION(state: GlobalStateProps, data: { [key: string]: unknown }): void {
state.stationList = data state.stationInfo = data
}, },
SET_PUBLICSAFE_GATESENTRY_SHEHUIWUYE( SET_PUBLICSAFE_GATESENTRY_SHEHUIWUYE(
// 公共安全-门岗值守-社会物业 // 公共安全-门岗值守-社会物业
...@@ -131,4 +133,24 @@ export default { ...@@ -131,4 +133,24 @@ export default {
SET_COMBINE_DATA(state: GlobalStateProps, data: CombineProp): void { SET_COMBINE_DATA(state: GlobalStateProps, data: CombineProp): void {
state.combineData = data state.combineData = data
}, },
/** 工作站 */
SET_DUTY_SUM(state: GlobalStateProps, data: DutySumProp): void {
state.dutySum = data
},
SET_DUTY_LIST(state: GlobalStateProps, data: { [key: string]: any }[]): void {
state.dutyList = data
},
SET_DUTY_RANK(state: GlobalStateProps, data: DutyDataProp): void {
state.dutyRank = data
},
SET_DUTY_EVENTS(state: GlobalStateProps, data: DutyDataProp): void {
state.dutyEvents = data
},
SET_DUTY_PLACES(state: GlobalStateProps, data: DutyDataProp): void {
state.dutyPlaces = data
},
SET_DUTY_RANKING(state: GlobalStateProps, data: DutyDataProp): void {
state.dutyRanking = data
},
} }
...@@ -5,14 +5,14 @@ export default { ...@@ -5,14 +5,14 @@ export default {
curView: { name: '南京东路街道', type: 'street' }, curView: { name: '南京东路街道', type: 'street' },
viewOptions: [ viewOptions: [
{ name: '南京东路街道', type: 'street' }, { name: '南京东路街道', type: 'street' },
{ name: '第一工作站', type: 'work1' }, { name: '第一工作站', type: 'work1', id: '01001' },
{ name: '第二工作站', type: 'work2' }, { name: '第二工作站', type: 'work2', id: '01002' },
{ name: '第三工作站', type: 'work3' }, { name: '第三工作站', type: 'work3', id: '01003' },
], ],
curTheme: 'manage', curTheme: 'manage',
propertySummary: {}, propertySummary: {},
caseList: [], caseList: [],
stationList: [], stationInfo: {},
pubulicSafeGateSenteryShehuiwuye: {}, pubulicSafeGateSenteryShehuiwuye: {},
pubulicSafeGateSenteryZhiguangongfang: {}, pubulicSafeGateSenteryZhiguangongfang: {},
pubulicSafeMap: [], pubulicSafeMap: [],
...@@ -29,4 +29,10 @@ export default { ...@@ -29,4 +29,10 @@ export default {
communityInfo: {}, communityInfo: {},
issueData: [], issueData: [],
combineData: { cleanList: [], securityList: [], orderlyList: [] }, combineData: { cleanList: [], securityList: [], orderlyList: [] },
dutySum: {},
dutyList: [],
dutyRank: { day: [], week: [], month: [] },
dutyEvents: { day: [], week: [], month: [] },
dutyPlaces: { day: [], week: [], month: [] },
dutyRanking: { day: [], week: [], month: [] },
} as GlobalStateProps } as GlobalStateProps
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
rows="0.4rem auto" rows="0.4rem auto"
gap="0.05rem" gap="0.05rem"
> >
<m-title area="title">南东城运</m-title> <m-title area="title"> 南东城运{{ title }} </m-title>
<m-map <m-map
ref="map" ref="map"
:config="{ center: [-75.5563452697323, -718.3061904627932], zoom: 8 }" :config="{ center: [-75.5563452697323, -718.3061904627932], zoom: 8 }"
...@@ -24,56 +24,102 @@ ...@@ -24,56 +24,102 @@
<div class="btns"> <div class="btns">
<div <div
v-for="btn in btns" v-for="btn in btns"
:key="btn" :key="btn.key"
:class="{ on: btn === curBtn }" :class="{ on: btn.key === curBtn }"
@click="handleClick(btn)" @click="handleClick(btn.key)"
> >
<p>{{ btn }}</p> <p>{{ btn.name }}</p>
</div> </div>
</div> </div>
</m-grid> </m-grid>
</template> </template>
<script lang="ts"> <script lang="ts">
import { defineComponent, onMounted, ref } from 'vue' import { computed, defineComponent, onMounted, ref } from 'vue'
import LeftSection from '@/view/community/left-section.vue' import LeftSection from '@/view/community/left-section.vue'
import RightSection from '@/view/community/right-section.vue' import RightSection from '@/view/community/right-section.vue'
import store from '@/store' import store from '@/store'
import point from '@/assets/images/point.png' import point from '@/assets/images/point.png'
import point1 from '@/assets/images/point1.png'
import point2 from '@/assets/images/point2.png'
import point3 from '@/assets/images/point3.png'
import point4 from '@/assets/images/point4.png'
import point5 from '@/assets/images/point5.png'
import point6 from '@/assets/images/point6.png'
import point7 from '@/assets/images/point7.png'
import { useRoute } from 'vue-router' import { useRoute } from 'vue-router'
import { ajax, api } from '@/ajax'
export default defineComponent({ export default defineComponent({
name: 'Main', name: 'Main',
components: { LeftSection, RightSection }, components: { LeftSection, RightSection },
setup() { setup() {
const loading = ref(true) const loading = ref(true)
const title = computed(
() => store.state.communityInfo.bigscreenCommunityName
)
const route = useRoute()
const initData = (id: unknown) => { const initData = (id: unknown) => {
store.dispatch('initCommunityData', id || '527635870583459840') store.dispatch('initCommunityData', id || '527635870583459840')
} }
onMounted(() => { onMounted(() => {
initData(useRoute().query.id) initData(route.query.id)
}) })
store.commit('SET_CURRENT_VIEW', { name: '', type: 'community' }) // 使标题不显示公共的3个按钮 store.commit('SET_CURRENT_VIEW', { name: '', type: 'community' }) // 使标题不显示公共的3个按钮
const map = ref<any>(null) const map = ref<any>(null)
const initMap = () => { const points = ref<any>(null)
const points = map.value.addPoint({ const initMapPoints = (key: string, data: any[]) => {
key: 'test', const getIcon = (type: string) => {
if (type.indexOf('车棚') >= 0) return point2
if (type.indexOf('充电') >= 0) return point5
if (type.indexOf('电梯加装') >= 0) return point3
if (type.indexOf('垃圾箱') >= 0) return point6
if (type.indexOf('助老') >= 0) return point7 // TODO 看是否是“助老”
return point4 // 默认为美丽家园-微更新
}
const pointData = data.map((item: any) => {
const position = item.coordinate && item.coordinate.split(',')
return Object.assign({}, item, {
name: item.id,
x: position && +position[0],
y: position && +position[1],
// icon: getIcon(item.relationName),
})
})
console.log(pointData)
points.value = map.value.addPoint({
key: key,
size: [100, 500], size: [100, 500],
icon: point, data: [
data: [{ name: '测试', x: -275.5563452697323, y: -718.3061904627932 }], {
name: '测试',
x: -275.5563452697323,
y: -718.3061904627932,
icon: point4,
},
{
name: '测试',
x: -75.5563452697323,
y: -518.3061904627932,
icon: point,
},
],
}) })
console.log('points', points)
} }
const handleMapClick = (e: any) => { const handleMapClick = (e: any) => {
console.log('point-data: ', e) console.log('point-data: ', e)
} }
const handleComplete = (instance: any) => { const handleComplete = (instance: any) => {
instance.getLayer('model_white_zhenxing2').visible = true let center = [-75.5563452697323, -718.3061904627932]
instance.getLayer('model_white_zhenxing2').opacity = 0.8 if (route.query.id === '527635870583459841') {
// instance.getLayer('model_white_zw').visible = true instance.getLayer('model_white_WEIHAI33').visible = true
// instance.getLayer('model_white_WEIHAI33').visible = true instance.getLayer('model_white_WEIHAI33').opacity = 0.8
// instance.getLayer('model_white_zw').opacity = 0.8 center = [-75.5563452697323, -518.3061904627932]
// instance.getLayer('model_white_WEIHAI33').opacity = 0.8 } else {
instance.getLayer('model_white_zhenxing2').visible = true
instance.getLayer('model_white_zhenxing2').opacity = 0.8
}
let i = -90 let i = -90
map.value.rotate(i) map.value.rotate(i)
setTimeout(() => { setTimeout(() => {
...@@ -83,27 +129,53 @@ export default defineComponent({ ...@@ -83,27 +129,53 @@ export default defineComponent({
i += 2 i += 2
if (i > 0) { if (i > 0) {
setTimeout(() => { setTimeout(() => {
map.value.focus(-75.5563452697323, -718.3061904627932, 9) map.value.focus(...center, 9)
}, 500) }, 500)
clearInterval(timer) clearInterval(timer)
initMap()
} }
map.value.rotate(i) map.value.rotate(i)
}, 2) }, 2)
}, 1000) }, 1000)
}, 7000) }, 7000)
} }
const btns = ref(['微更新', '电梯加装', '智能监控', '楼宇安全']) const btns = ref([
{ name: '美丽家园', key: '微更新' },
{ name: '周边设施', key: '小区设施' },
{ name: '监控设施', key: '监控' },
])
if (route.query.id === '527635870583459841') {
btns.value = [
{ name: '美丽家园', key: '微更新' },
{ name: '加装电梯', key: '电梯加装' },
{ name: '周边设施', key: '小区设施' },
{ name: '监控设施', key: '监控' },
]
}
const curBtn = ref<string | null>(null) const curBtn = ref<string | null>(null)
const handleClick = (btn: string) => { const handleClick = async (key: string) => {
if (curBtn.value === btn) { map.value.remove(points.value)
if (curBtn.value === key) {
curBtn.value = null curBtn.value = null
map.value.showCommunity()
return return
} }
curBtn.value = btn const { content } = (
await ajax.get({
url: api.GET_COMMUNITY_FACILITY,
params: {
bigscreenCommunityId: route.query.id,
classification: key,
pageSize: 1000,
},
})
).data
initMapPoints(key, content)
map.value.hideCommunity()
curBtn.value = key
} }
return { return {
loading, loading,
title,
map, map,
handleComplete, handleComplete,
handleMapClick, handleMapClick,
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
:mode="2" :mode="2"
:limit="5" :limit="5"
:step="1.25" :step="1.25"
style="height: 5rem"
> >
<div v-for="(item, i) in list" :key="i" class="card"> <div v-for="(item, i) in list" :key="i" class="card">
<div class="title"> <div class="title">
...@@ -31,7 +32,7 @@ ...@@ -31,7 +32,7 @@
<Step :current="steps.indexOf(item.phase)" :steps="steps" /> <Step :current="steps.indexOf(item.phase)" :steps="steps" />
</div> </div>
</m-scroll> </m-scroll>
<m-empty v-else style="height:5rem;" /> <m-empty v-else style="height: 5rem" />
</div> </div>
</m-card> </m-card>
</template> </template>
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<div class="info"> <div class="info">
<div><img src="@/assets/images/zhenxing.png" /></div> <div><img src="@/assets/images/zhenxing.png" /></div>
<div> <div>
<h3>振兴小区</h3> <h3>{{ communityName }}</h3>
<div> <div>
<div> <div>
<img src="@/assets/images/p11.png" /> <img src="@/assets/images/p11.png" />
...@@ -23,11 +23,11 @@ ...@@ -23,11 +23,11 @@
</div> </div>
</div> </div>
</div> </div>
<div> <di v>
<Brief :list="summary.slice(0, 3)" size="0.32rem" /> <Brief :list="summary.slice(0, 3)" size="0.32rem" />
<h1></h1> <h1></h1>
<Brief :list="summary.slice(3)" size="0.32rem" /> <Brief :list="summary.slice(3)" size="0.32rem" />
</div> </di>
<div class="buildings"> <div class="buildings">
<div <div
v-for="item in buildingList" v-for="item in buildingList"
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
<i :style="`background:${getColor(item.classification)}`" /> <i :style="`background:${getColor(item.classification)}`" />
</div> </div>
</div> </div>
<div class="industry"> <div v-show="memberList.length > 0" class="industry">
<div class="title"> <div class="title">
<img src="@/assets/images/p9.png" /> <img src="@/assets/images/p9.png" />
业委会 业委会
...@@ -100,6 +100,7 @@ export default defineComponent({ ...@@ -100,6 +100,7 @@ export default defineComponent({
const curBuilding = ref<string | null>(null) const curBuilding = ref<string | null>(null)
const memberList = ref<unknown[]>([]) const memberList = ref<unknown[]>([])
const addrList = ref([]) const addrList = ref([])
const communityName = ref('')
watch( watch(
() => store.state.communityInfo, () => store.state.communityInfo,
...@@ -112,7 +113,9 @@ export default defineComponent({ ...@@ -112,7 +113,9 @@ export default defineComponent({
parkingSpace = 0, parkingSpace = 0,
totForOld = 0, totForOld = 0,
communityList = [], communityList = [],
bigscreenCommunityName = '',
} = cur } = cur
communityName.value = bigscreenCommunityName
summary.value = [ summary.value = [
{ name: '小区数', value: totCommunity, icon: p1 }, { name: '小区数', value: totCommunity, icon: p1 },
{ name: '总户数', value: totHous, icon: p2 }, { name: '总户数', value: totHous, icon: p2 },
...@@ -180,6 +183,7 @@ export default defineComponent({ ...@@ -180,6 +183,7 @@ export default defineComponent({
).icMember || [] ).icMember || []
} }
return { return {
communityName,
summary, summary,
buildingList, buildingList,
curBuilding, curBuilding,
...@@ -200,7 +204,7 @@ export default defineComponent({ ...@@ -200,7 +204,7 @@ export default defineComponent({
.info .info
display flex display flex
min-height .8rem min-height .8rem
margin-top .03rem margin .05rem 0
>div >div
flex 1 flex 1
color #ccc color #ccc
...@@ -240,6 +244,7 @@ export default defineComponent({ ...@@ -240,6 +244,7 @@ export default defineComponent({
.buildings .buildings
display flex display flex
justify-content space-between justify-content space-between
margin .05rem 0
>div >div
$center() $center()
width 23% width 23%
...@@ -272,6 +277,7 @@ export default defineComponent({ ...@@ -272,6 +277,7 @@ export default defineComponent({
.address .address
display flex display flex
flex-wrap wrap flex-wrap wrap
flex 1
>div >div
display flex display flex
flex-direction column flex-direction column
...@@ -286,7 +292,7 @@ export default defineComponent({ ...@@ -286,7 +292,7 @@ export default defineComponent({
border .01rem solid rgba(91,213,255,.1) border .01rem solid rgba(91,213,255,.1)
border-left .02rem solid transparent border-left .02rem solid transparent
overflow hidden overflow hidden
min-height .6rem height .6rem
>div >div
display flex display flex
align-items center align-items center
......
...@@ -57,7 +57,6 @@ export default defineComponent({ ...@@ -57,7 +57,6 @@ export default defineComponent({
@import '../../components/MyComponent/main.styl' @import '../../components/MyComponent/main.styl'
.brief-container .brief-container
display flex display flex
justify-content space-around
align-items center align-items center
.count .count
font-size .12rem font-size .12rem
...@@ -67,6 +66,8 @@ export default defineComponent({ ...@@ -67,6 +66,8 @@ export default defineComponent({
>div >div
display flex display flex
align-items center align-items center
flex 1
margin-left .05rem
>img >img
margin-right .05rem margin-right .05rem
>div >div
......
...@@ -25,7 +25,7 @@ export default defineComponent({ ...@@ -25,7 +25,7 @@ export default defineComponent({
}, },
}, },
setup() { setup() {
const getStyle = (type: string) => { const getStyle = (type: string | null) => {
switch (type) { switch (type) {
case '路段': case '路段':
return { return {
...@@ -46,7 +46,11 @@ export default defineComponent({ ...@@ -46,7 +46,11 @@ export default defineComponent({
background: 'rgba(250,100,0,.3)', background: 'rgba(250,100,0,.3)',
} }
default: default:
return {} return {
borderColor: '#F7B500',
color: '#F7B500',
background: 'rgba(247, 181, 0, 0.3)',
}
} }
} }
return { return {
...@@ -64,12 +68,14 @@ export default defineComponent({ ...@@ -64,12 +68,14 @@ export default defineComponent({
height 100% height 100%
background url('@/assets/images/border.png') 100% / 100% 100% no-repeat background url('@/assets/images/border.png') 100% / 100% 100% no-repeat
font-weight bold font-weight bold
padding .08rem .1rem padding .05rem .08rem
display flex
flex-direction column
justify-content space-around
>div >div
display flex display flex
align-items center align-items center
justify-content space-between justify-content space-between
margin-top .1rem
.count .count
font-size .14rem font-size .14rem
color $secondary-color color $secondary-color
......
...@@ -30,6 +30,7 @@ export default defineComponent({ ...@@ -30,6 +30,7 @@ export default defineComponent({
'SET_CURRENT_VIEW', 'SET_CURRENT_VIEW',
options.value.find((option) => type === option.type) options.value.find((option) => type === option.type)
) )
store.dispatch('initStationData', store.state.curView.id)
} }
return { return {
curViewType, curViewType,
......
...@@ -8,7 +8,11 @@ ...@@ -8,7 +8,11 @@
{{ item.name }} {{ item.name }}
</p> </p>
<p> <p>
<m-count class="count" :value="item.value" /> <m-count
class="count"
:value="item.value"
:decimal="item.decimal || 0"
/>
<span>{{ item.unit }}</span> <span>{{ item.unit }}</span>
</p> </p>
</div> </div>
...@@ -47,49 +51,110 @@ ...@@ -47,49 +51,110 @@
</template> </template>
<script lang="ts"> <script lang="ts">
import { defineComponent, ref } from 'vue' import { computed, defineComponent } from 'vue'
import pic1 from '@/assets/images/pic1.png' import pic1 from '@/assets/images/pic1.png'
import pic2 from '@/assets/images/pic2.png' import pic2 from '@/assets/images/pic2.png'
import pic3 from '@/assets/images/pic3.png' import pic3 from '@/assets/images/pic3.png'
import pic4 from '@/assets/images/pic4.png' import pic4 from '@/assets/images/pic4.png'
import avatar1 from '@/assets/images/avatar1.png' import avatar1 from '@/assets/images/avatar1.png'
import avatar2 from '@/assets/images/avatar2.png' import avatar2 from '@/assets/images/avatar2.png'
import store from '@/store'
export default defineComponent({ export default defineComponent({
name: 'ManageBasic', name: 'ManageBasic',
setup() { setup() {
const basicList = ref([ const stationInfo = computed(() => store.state.stationInfo)
{ name: '总面积', value: 241359, unit: '㎡', icon: pic1 }, const basicList = computed(() => {
{ name: '总户数', value: 341359, unit: '户', icon: pic2 }, const {
{ name: '总人口', value: 965334, unit: '人', icon: pic3 }, totalArea = 0,
{ name: '总单位', value: 5334, unit: '家', icon: pic4 }, totalHousehold = 0,
]) totalPopulation = 0,
const leaders = ref([ totalUnit = 0,
{ } = stationInfo.value
img: avatar1, return [
name: '姓名', {
type: '网格长', name: '总面积',
}, value: totalArea,
{ unit: 'k㎡',
img: avatar2, icon: pic1,
name: '姓名', decimal: 2,
type: '副网格长', },
}, {
{ name: '总户数',
img: avatar1, value: totalHousehold,
name: '姓名', unit: '户',
type: '警长', icon: pic2,
}, },
]) {
const gridList = ref([ name: '总人口',
{ department: '派出所', persons: '朱洪元副所长、于冰警长、警力25人' }, value: totalPopulation,
{ department: '市场所', persons: '王绍良、陈蕾、张敏' }, unit: '人',
{ department: '城管中队', persons: '尤懿副队长、城管队员8人' }, icon: pic3,
{ department: '城运中心', persons: '许俊' }, },
{ department: '建管中心', persons: '张沁园、车姝敏、杨姝敏' }, {
{ department: '党建联络员', persons: '方雅婷、秦雯、郭强' }, name: '总单位',
{ department: '服务企业人员', persons: '蓝俊' }, value: totalUnit,
]) unit: '家',
icon: pic4,
},
]
})
const leaders = computed(() => {
const {
gridId = '无',
viceGridId = '无',
sheriffId = '无',
} = stationInfo.value
return [
{
img: avatar1,
name: gridId,
type: '网格长',
},
{
img: avatar2,
name: viceGridId,
type: '副网格长',
},
{
img: avatar1,
name: sheriffId,
type: '警长',
},
]
})
const getName = (type: string) => {
switch (type) {
case 'pcs':
return '派出所'
case 'scs':
return '市场所'
case 'cgzd':
return '城管中队'
case 'wgzx':
return '网格中心'
case 'lhsrs':
return '绿化市容所'
case 'djlly':
return '党建联络员'
case 'fwqyry':
return '服务企业人员'
default:
return '无'
}
}
const gridList = computed(() => {
const gridPower =
stationInfo.value.gridPower &&
JSON.parse(stationInfo.value.gridPower as string)
if (!gridPower) return []
return Object.keys(gridPower).map((key: string) => {
return {
department: getName(key),
persons: gridPower[key],
}
})
})
return { return {
basicList, basicList,
leaders, leaders,
......
...@@ -106,8 +106,9 @@ export default defineComponent({ ...@@ -106,8 +106,9 @@ export default defineComponent({
console.log(res) console.log(res)
}) })
const handleMapComplete = () => { const handleMapComplete = (instance: any) => {
console.log('complete', map.value) instance.getLayer('model_white_zw').visible = true
instance.getLayer('model_white_zw').opacity = 0.8
map.value.addBoundary({ name: '南京东路街道', color: 'rgba(0,0,0,0)' }) map.value.addBoundary({ name: '南京东路街道', color: 'rgba(0,0,0,0)' })
} }
return { return {
......
<template> <template>
<m-card title="业务入口"> <m-card title="业务入口">
<div class="content"> <div class="content">
<div>民宿群租整治</div> <div @click="routeTo('527635870583459840')">振兴小区</div>
<div>小型工程纳管</div> <div @click="routeTo('527635870583459841')">威海路62弄小区</div>
</div> </div>
</m-card> </m-card>
</template> </template>
<script lang="ts"> <script lang="ts">
import { defineComponent } from 'vue' import { defineComponent } from 'vue'
import { useRouter } from 'vue-router'
export default defineComponent({ export default defineComponent({
name: 'BussinessEntry', name: 'BussinessEntry',
setup() {
const router = useRouter()
const routeTo = (id: string) => {
router.push({
name: 'community',
query: {
id,
},
})
}
return {
routeTo,
}
},
}) })
</script> </script>
...@@ -31,4 +45,10 @@ export default defineComponent({ ...@@ -31,4 +45,10 @@ export default defineComponent({
justify-content center justify-content center
font-size .12rem font-size .12rem
font-weight bold font-weight bold
cursor pointer
opacity 0.8
color #ccc
&:hover
color #fff
opacity 1
</style> </style>
...@@ -2,25 +2,26 @@ ...@@ -2,25 +2,26 @@
<m-card title="勤务分析"> <m-card title="勤务分析">
<div class="nav"> <div class="nav">
<div> <div>
<Tabs :list="tabs" horizontal /> <Tabs :list="tabs" horizontal @select="curTab = $event" />
</div> </div>
<div> <div>
<span <span
v-for="option in options" v-for="option in options"
:key="option" :key="option.key"
:class="{ on: curOption === option }" :class="{ on: curOption === option.key }"
@click="curOption = option" @click="curOption = option.key"
> >
{{ option }} {{ option.name }}
</span> </span>
</div> </div>
</div> </div>
<div> <div>
<SubTitle>事件类型</SubTitle> <SubTitle>事件类型</SubTitle>
<div class="duty-type"> <div class="duty-type">
<div v-if="showChart" class="chart"> <div v-if="showChart && pieData.source.length > 0" class="chart">
<m-pie :dataset="pieData" :option="pieOption" /> <m-pie :dataset="pieData" :option="pieOption" />
</div> </div>
<m-empty v-else />
<div class="legend"> <div class="legend">
<div v-for="(item, i) in pieData.source" :key="item.name"> <div v-for="(item, i) in pieData.source" :key="item.name">
<p> <p>
...@@ -28,8 +29,8 @@ ...@@ -28,8 +29,8 @@
{{ item.name }} {{ item.name }}
</p> </p>
<p> <p>
{{ ((item.value / total) * 100).toFixed(0) }}% {{ Math.ceil((item.value / total) * 100).toFixed(0) }}%
<m-count :value="item.value" /> <m-count :value="item.value" />
</p> </p>
</div> </div>
</div> </div>
...@@ -37,34 +38,39 @@ ...@@ -37,34 +38,39 @@
</div> </div>
<div> <div>
<SubTitle>居委事件数量</SubTitle> <SubTitle>居委事件数量</SubTitle>
<div v-if="showChart" class="chart"> <div v-if="showChart && barOption.series.length > 0" class="chart bar">
<m-bar :dataset="barData" :option="barOption" /> <m-bar :dataset="barData" :option="barOption" />
</div> </div>
<m-empty v-else />
</div> </div>
<div class="rank"> <div class="rank">
<SubTitle>分类排行</SubTitle> <SubTitle>分类排行</SubTitle>
<div class="content"> <div v-if="rankList.length > 0" class="content">
<m-progress <m-scroll :length="rankList.length" :limit="3">
v-for="rank in rankList" <m-progress
:key="rank.name" v-for="rank in rankList"
:value="rank.value" :key="rank.name"
:msg="rank" :value="rank.rate"
/> :msg="rank"
/>
</m-scroll>
</div> </div>
<m-empty v-else />
</div> </div>
<div class="place"> <div class="place">
<SubTitle>多发地点</SubTitle> <SubTitle>多发地点</SubTitle>
<div class="content"> <div v-if="placeList.length > 0" class="content">
<div v-for="item in placeList" :key="item.name"> <div v-for="item in placeList" :key="item.name">
<Place :data="item" /> <Place :data="item" />
</div> </div>
</div> </div>
<m-empty v-else />
</div> </div>
</m-card> </m-card>
</template> </template>
<script lang="ts"> <script lang="ts">
import { computed, defineComponent, ref } from 'vue' import { computed, defineComponent, ref, watch } from 'vue'
import Tabs, { TabsProp } from '../components/tabs.vue' import Tabs, { TabsProp } from '../components/tabs.vue'
import SubTitle from '../components/sub-title.vue' import SubTitle from '../components/sub-title.vue'
import Place, { PlaceProp } from '../components/place.vue' import Place, { PlaceProp } from '../components/place.vue'
...@@ -76,153 +82,130 @@ export default defineComponent({ ...@@ -76,153 +82,130 @@ export default defineComponent({
setup() { setup() {
const fontSize = computed(() => Math.floor((screen.height * 1.6) / 100)) const fontSize = computed(() => Math.floor((screen.height * 1.6) / 100))
const showChart = computed(() => store.state.curView.type !== 'street') const showChart = computed(() => store.state.curView.type !== 'street')
const curTab = ref('综合')
const tabs = ref<TabsProp[]>([ const tabs = ref<TabsProp[]>([
{ { name: '综合管理', key: '综合' },
key: 'all', { name: '街面管理', key: '街面' },
name: '综合管理', { name: '小区管理', key: '小区' },
},
{
key: 'street',
name: '街面管理',
},
{
key: 'community',
name: '小区管理',
},
]) ])
const options = ref(['日', '周', '月']) const options = ref([
const curOption = ref('月') { name: '日', key: 'day' },
const rankList = ref([ { name: '周', key: 'week' },
{ name: '分类1', value: 50 }, { name: '月', key: 'month' },
{ name: '分类2', value: 31 },
{ name: '分类3', value: 15 },
]) ])
const placeList = ref<PlaceProp[]>([ const curOption = ref('month')
{ name: '延安东路1292弄', value: 3, type: '路段' }, watch([() => curTab.value, () => store.state.curView.id], ([type, id]) => {
{ name: '延安东路1293弄', value: 5, type: '小区' }, if (!id) return
{ name: '延安东路1294弄', value: 8, type: '商业' }, store.dispatch('getDutyRank', {
]) gridId: id,
const barData = ref({ managementType: type,
dimensions: [ })
store.dispatch('getDutyEvents', {
gridId: id,
managementType: type,
})
store.dispatch('getDutyPlaces', {
gridId: id,
managementType: type,
})
store.dispatch('getDutyRanking', {
gridId: id,
managementType: type,
})
})
const rankList = computed(() => {
const data = store.state.dutyRanking[curOption.value] || []
const total = data.reduce((acc, cur) => acc + cur.num, 0)
return data.map((item: any) => ({
name: item.businsessType || item.businessType,
rate: +Math.ceil((item.num / total) * 100).toFixed(0),
value: item.num,
unit: '件',
}))
})
const placeList = computed(() => {
const data = store.state.dutyPlaces[curOption.value] || []
return data.map((item: any) => ({
name: item.address,
value: item.num,
type: '路段',
}))
})
const barData = computed(() => {
const data = store.state.dutyEvents[curOption.value] || []
const types: string[] = []
data.forEach((item: any) =>
types.push(
...item.data.map((e: any) => e.businsessType || e.businessType)
)
)
const dic: any = {}
const defaultData: any = {}
const dimensions = [
{ name: 'name', displayName: '居委' }, { name: 'name', displayName: '居委' },
{ name: 'data1', displayName: '类型1' }, ...Array.from(new Set(types)).map((item: string, i: number) => {
{ name: 'data2', displayName: '类型2' }, const name = `data${i + 1}`
{ name: 'data3', displayName: '类型3' }, dic[item] = name
{ name: 'data4', displayName: '类型4' }, defaultData[name] = 0
{ name: 'data5', displayName: '类型5' }, return {
], name,
source: [ displayName: item,
{ }
name: '均乐', }),
data1: 100, ]
data2: 100, return {
data3: 100, dimensions,
data4: 50, source: data.map((item: any) => {
data5: 50, const datas: { [key: string]: unknown } = {}
}, item.data.forEach((e: any) => {
{ datas[dic[e.businsessType || e.businessType]] = e.num || 0
name: '振兴', })
data1: 110, return {
data2: 110, name: item.cmtName,
data3: 120, ...defaultData,
data4: 10, ...datas,
data5: 20, }
}, }),
{ }
name: '顺天村',
data1: 120,
data2: 130,
data3: 140,
data4: 30,
data5: 40,
},
{
name: '江阴',
data1: 130,
data2: 140,
data3: 160,
data4: 40,
data5: 60,
},
{
name: '新昌',
data1: 140,
data2: 150,
data3: 180,
data4: 50,
data5: 80,
},
{
name: '长江',
data1: 150,
data2: 160,
data3: 190,
data4: 60,
data5: 90,
},
{
name: '定兴',
data1: 150,
data2: 160,
data3: 190,
data4: 60,
data5: 90,
},
{
name: '三德',
data1: 150,
data2: 160,
data3: 190,
data4: 60,
data5: 90,
},
],
}) })
const barOption = ref({ const barOption = computed(() => ({
color: ['#5BD5FF', '#6EB629', '#FFCE34', '#FF9D27', '#826AFA'], color: ['#5BD5FF', '#6EB629', '#FFCE34', '#FF9D27', '#826AFA'],
legend: { legend: {
left: '2%',
right: '2%', right: '2%',
itemWidth: fontSize.value * 0.6, itemWidth: fontSize.value * 0.6,
itemHeight: fontSize.value * 0.8, itemHeight: fontSize.value * 0.6,
}, },
grid: { top: '25%', right: '2%' },
series: [ series: [
{ ...new Array(barData.value.dimensions.length - 1 || 0).keys(),
type: 'bar', ].map(() => ({
barWidth: '18%', type: 'bar',
itemStyle: { borderRadius: 8 }, barWidth: '10%',
barGap: 0, itemStyle: { borderRadius: 8 },
stack: '总量', barGap: 0,
}, stack: '总量',
{ })),
type: 'bar', }))
barWidth: '18%',
itemStyle: { borderRadius: 8 }, const pieData = computed(() => {
barGap: 0, const data = store.state.dutyRank[curOption.value] || []
stack: '总量', return {
}, dimensions: [
{ { name: 'name', displayName: '类型' },
type: 'bar', { name: 'value', displayName: '数量' },
barWidth: '18%', ],
itemStyle: { borderRadius: 8 }, source: data.map((item: any) => ({
barGap: 0, name: item.businsessType,
stack: '总量', value: item.num,
}, })),
], }
}) })
const pieData = ref({ const total = computed(() => {
dimensions: [ if (!pieData.value.source) return 0
{ name: 'name', displayName: '类型名称' }, return pieData.value.source.reduce((acc, cur) => acc + cur.value, 0)
{ name: 'value', displayName: '数量' },
],
source: [
{ name: '事件类型1', value: 2939 },
{ name: '事件类型2', value: 4261 },
{ name: '事件类型3', value: 2204 },
{ name: '事件类型4', value: 2086 },
{ name: '事件类型5', value: 1910 },
],
}) })
const total = pieData.value.source.reduce((acc, cur) => acc + cur.value, 0)
const pieOption = ref({ const pieOption = ref({
color: ['#00BFFF', '#FFCE34', '#826AFA', '#589C20', '#F47C1F'], color: ['#00BFFF', '#FFCE34', '#826AFA', '#589C20', '#F47C1F'],
legend: { show: false }, legend: { show: false },
...@@ -240,6 +223,7 @@ export default defineComponent({ ...@@ -240,6 +223,7 @@ export default defineComponent({
return { return {
showChart, showChart,
total, total,
curTab,
tabs, tabs,
options, options,
curOption, curOption,
...@@ -280,16 +264,19 @@ export default defineComponent({ ...@@ -280,16 +264,19 @@ export default defineComponent({
border-color @color border-color @color
background rgba(50,197,255,.2) background rgba(50,197,255,.2)
.rank .rank
flex 1 >div
max-height .6rem
overflow hidden
.place .place
.content .content
display flex display flex
justify-content space-between justify-content space-between
>div >div
width 32% width 32%
height .6rem
.chart .chart
width 100% width 100%
height 1rem height 1.2rem
.duty-type .duty-type
width 100% width 100%
height .6rem height .6rem
...@@ -304,7 +291,8 @@ export default defineComponent({ ...@@ -304,7 +291,8 @@ export default defineComponent({
flex 1 flex 1
font-size .09rem font-size .09rem
>div >div
width 33.3% min-width 32%
margin-left .03rem
p p
span span
width .06rem width .06rem
......
<template> <template>
<m-card title="勤务"> <m-card title="勤务">
<Brief class="brief" :list="summary" /> <Brief class="brief" :list="summary" />
<Tabs class="tabs" :list="tabs" horizontal /> <Tabs class="tabs" :list="tabs" horizontal @select="curTab = $event" />
<div v-if="showTable" class="details"> <div class="details">
<m-scroll :limit="4" :length="caseList.length" :step="1.1" mode="2"> <m-scroll
<div v-for="(item, i) in caseList" :key="i" class="detail"> v-if="caseList.length > 0"
:limit="4"
:length="caseList.length"
:step="1.1"
mode="2"
>
<div v-for="item in caseList" :key="item.id" class="detail">
<div class="title"> <div class="title">
<p>{{ item.name }}</p> <p>{{ item.communityName }}</p>
<span /> <span />
<p>{{ item.type }}</p> <p>
{{
item.businsessTypeLv1.split('-')[2] || item.troublePhenomenon
}}
</p>
</div> </div>
<div class="msg"> <div class="msg">
<p>{{ item.address }}</p> <p>{{ item.address }}</p>
<p>{{ item.date }}</p> <p>{{ item.acceptTime }}</p>
</div> </div>
<m-step :steps="steps" :current="item.cur" /> <m-step :steps="steps" :current="steps.indexOf(item.phase)" />
</div> </div>
</m-scroll> </m-scroll>
<m-empty v-else />
</div> </div>
</m-card> </m-card>
</template> </template>
<script lang="ts"> <script lang="ts">
import { computed, defineComponent, ref } from 'vue' import { computed, defineComponent, ref, watch } from 'vue'
import Brief, { BriefProp } from '../components/brief.vue' import Brief from '../components/brief.vue'
import Tabs, { TabsProp } from '../components/tabs.vue' import Tabs, { TabsProp } from '../components/tabs.vue'
import store from '@/store' import store from '@/store'
import icon6 from '@/assets/images/icon6.png' import icon6 from '@/assets/images/icon6.png'
...@@ -34,63 +45,55 @@ export default defineComponent({ ...@@ -34,63 +45,55 @@ export default defineComponent({
name: 'Duty', name: 'Duty',
components: { Brief, Tabs }, components: { Brief, Tabs },
setup() { setup() {
const showTable = computed(() => store.state.curView.type !== 'street') const summary = computed(() => {
const summary = ref<BriefProp[]>([ const {
{ comprehensiveNum = 0,
name: '综合管理', comprehensiveEndNum = 0,
value: [36, 468], streetNum = 0,
icon: icon6, streetEndNum = 0,
}, communityNum = 0,
{ communityEndNum = 0,
name: '街面管理', } = store.state.dutySum
value: [64, 261], return [
icon: icon7, {
}, name: '综合管理',
{ value: [comprehensiveNum, comprehensiveEndNum],
name: '小区管理', icon: icon6,
value: [57, 154], },
icon: icon8, {
}, name: '街面管理',
]) value: [streetNum, streetEndNum],
icon: icon7,
},
{
name: '小区管理',
value: [communityNum, communityEndNum],
icon: icon8,
},
]
})
const curTab = ref('综合')
const tabs = ref<TabsProp[]>([ const tabs = ref<TabsProp[]>([
{ name: '综合管理', key: 'all' }, { name: '综合管理', key: '综合' },
{ name: '街面管理', key: 'street' }, { name: '街面管理', key: '街面' },
{ name: '小区管理', key: 'community' }, { name: '小区管理', key: '小区' },
]) ])
const steps = ref(['发现', '立案', '派遣', '处置', '核查', '结案']) const steps = ref(['发现', '立案', '派遣', '处置', '核查', '结案'])
const caseList = ref([ const caseList = computed(() => store.state.dutyList)
{ watch(
name: '均乐小区', [() => curTab.value, () => store.state.curView.id],
type: '电梯困人', ([type, id]) => {
address: '上海市黄浦区延安东路1292弄6~40号', if (!id) return
date: '2020-02-13 13:23:08', store.dispatch('getDutyList', {
cur: 5, gridId: id,
managementType: type,
})
}, },
{ { immediate: true }
name: '均乐小区', )
type: '电梯困人',
address: '上海市黄浦区延安东路1292弄6~40号',
date: '2020-02-13 13:23:08',
cur: 4,
},
{
name: '均乐小区',
type: '电梯困人',
address: '上海市黄浦区延安东路1292弄6~40号',
date: '2020-02-13 13:23:08',
cur: 3,
},
{
name: '均乐小区',
type: '电梯困人',
address: '上海市黄浦区延安东路1292弄6~40号',
date: '2020-02-13 13:23:08',
cur: 2,
},
])
return { return {
showTable,
summary, summary,
curTab,
tabs, tabs,
caseList, caseList,
steps, steps,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment