|
@@ -1,138 +1,13 @@
|
|
|
import * as api from '@/api/index'
|
|
|
import { dictionary, dictionaryDefine } from './dictionary-define'
|
|
|
import { dictionaryOther, dictionaryOtherDefine } from './dictionary-other-define'
|
|
|
-import lan from "../plateColor/lan.png";
|
|
|
-import huang from "../plateColor/huang.png";
|
|
|
-import lv from "../plateColor/lv.png";
|
|
|
-import hei from "../plateColor/hei.png";
|
|
|
-import bai from "../plateColor/bai.png";
|
|
|
-import mhLv from "../plateColor/mhLv.png";
|
|
|
|
|
|
const state = {
|
|
|
...dictionary,
|
|
|
...dictionaryOther,
|
|
|
- caseTypeTree: [], // 案件类型级联
|
|
|
- caseTypeTreeMap: new Map(), // 案件类型级联
|
|
|
- cbglPersonDictionary: [], // 船籍港一级
|
|
|
- cbglPersonDictionaryMap: new Map(), // 船籍港一级
|
|
|
- portOfRegistryTwoList: [], // 船籍港二级
|
|
|
- portOfRegistryTwoMap: new Map(), // 船籍港二级
|
|
|
- cbglPersonTemporary: [], // 船籍港停泊点一级
|
|
|
- cbglPersonTemporaryMap: new Map(), // 船籍港停泊点一级
|
|
|
- residentMooringPointTwoList: [], // 船籍港停泊点二级
|
|
|
- residentMooringPointTwoMap: new Map(), // 船籍港停泊点二级
|
|
|
- listLibraryDeployTypePeopleList: [], // 人员名单库-布控类型一级
|
|
|
- listLibraryDeployTypePeopleMap: new Map(), // 人员名单库-布控类型一级
|
|
|
- listLibraryDeployTypeTwoPeopleList: [], // 人员名单库-布控类型二级
|
|
|
- listLibraryDeployTypeTwoPeopleMap: new Map(), // 人员布控类型-布控类型二级
|
|
|
- listLibraryDeployTypeCarList: [], // 车辆名单库-布控类型一级
|
|
|
- listLibraryDeployTypeCarMap: new Map(), // 车辆名单库-布控类型一级
|
|
|
- listLibraryDeployTypeTwoCarList: [], // 车辆名单库-布控类型二级
|
|
|
- listLibraryDeployTypeTwoCarMap: new Map(), // 车辆布控类型-布控类型二级
|
|
|
- ShipData: {
|
|
|
- ShipId:'',
|
|
|
- ShipStatus:'',
|
|
|
- getStatus:false
|
|
|
- },
|
|
|
- bayonetDeepCheckList: {
|
|
|
- all: [],
|
|
|
- car: [],
|
|
|
- face: []
|
|
|
- }, // 卡口深度核查-点位选择-地图框选卡口标点数据
|
|
|
- bayonetDeepCheckTree: {
|
|
|
- car: [],
|
|
|
- face: []
|
|
|
- }, // 卡口深度核查-点位选择-树弹窗选择数据
|
|
|
- bayonetDeepCheckTreeMap: {
|
|
|
- car: new Map(),
|
|
|
- face: new Map()
|
|
|
- }, // 卡口深度核查-点位选择-树弹窗选择数据-Map翻译
|
|
|
- videoList: [], // 视频监控
|
|
|
- videoMap: new Map(), // 视频监控
|
|
|
- portList: [], // 港口
|
|
|
- portMap: new Map(), // 港口
|
|
|
- meetEmergencyPlanTypeList: [], // 应急资源 > 预案管理 > 分类
|
|
|
- meetEmergencyPlanTypeMap: new Map(), // 应急资源 > 预案管理 > 分类
|
|
|
- plateColorImgList: [
|
|
|
- {
|
|
|
- colorImg: lan,
|
|
|
- colorFont: '#ffffff',
|
|
|
- dictValue: "蓝色",
|
|
|
- dictLabel: "琼·88888",
|
|
|
- },
|
|
|
- {
|
|
|
- colorImg: huang,
|
|
|
- colorFont: '#000000',
|
|
|
- dictValue: "黄色",
|
|
|
- dictLabel: "琼·88888",
|
|
|
- },
|
|
|
- {
|
|
|
- colorImg: lv,
|
|
|
- dictValue: "绿色",
|
|
|
- colorFont: '#000000',
|
|
|
- dictLabel: "琼·88888",
|
|
|
- },
|
|
|
- {
|
|
|
- colorImg: hei,
|
|
|
- colorFont: '#ffffff',
|
|
|
- dictValue: "黑色",
|
|
|
- dictLabel: "琼·88888",
|
|
|
- },
|
|
|
- {
|
|
|
- colorImg: bai,
|
|
|
- colorFont: '#000000',
|
|
|
- dictValue: "白色",
|
|
|
- dictLabel: "琼·88888",
|
|
|
- },
|
|
|
- {
|
|
|
- colorImg: mhLv,
|
|
|
- colorFont: '#ffffff',
|
|
|
- dictValue: "民航绿色",
|
|
|
- dictLabel: "民航·88888",
|
|
|
- },
|
|
|
- {
|
|
|
- colorImg: hei,
|
|
|
- colorFont: '#ffffff',
|
|
|
- dictValue: "民航黑色",
|
|
|
- dictLabel: "民航·88888",
|
|
|
- },
|
|
|
- {
|
|
|
- colorImg: "",
|
|
|
- colorFont: '',
|
|
|
- dictValue: "其他",
|
|
|
- dictLabel: "其他颜色",
|
|
|
- },
|
|
|
- ],
|
|
|
- warningYxxList: [
|
|
|
- {dictLabel: '有效', dictValue: 0},
|
|
|
- {dictLabel: '无效', dictValue: 1},
|
|
|
- ],
|
|
|
- warningLdjzList: [
|
|
|
- {dictLabel: '不需转发', dictValue: 0},
|
|
|
- {dictLabel: '需转发', dictValue: 1},
|
|
|
- ],
|
|
|
- warningCzfsList: [
|
|
|
- {dictLabel: '任务分派', dictValue: 0},
|
|
|
- {dictLabel: '线上处置', dictValue: 1},
|
|
|
- ],
|
|
|
}
|
|
|
|
|
|
const mutations = {
|
|
|
- SET_SHIPDATA_ID(state, data){
|
|
|
- switch (data.type) {
|
|
|
- case 'id':
|
|
|
- state.ShipData.ShipId=data.value
|
|
|
- state.ShipData.getStatus=false
|
|
|
- break
|
|
|
- case 'get':
|
|
|
- state.ShipData.ShipId=data.value
|
|
|
- state.ShipData.getStatus=true
|
|
|
- break
|
|
|
- case 'sta':
|
|
|
- state.ShipData.ShipStatus=data.value
|
|
|
- break
|
|
|
- }
|
|
|
- },
|
|
|
SET_DICT_LIST(state: any, { listName, mapName, objMapName, data }: any) {
|
|
|
const map = new Map()
|
|
|
const objMap = new Map()
|
|
@@ -148,163 +23,6 @@ const mutations = {
|
|
|
state[mapName] = map
|
|
|
state[objMapName] = objMap
|
|
|
},
|
|
|
- SET_CASE_TYPE_TREE(state: any, data: Array<any>) {
|
|
|
- const map = new Map()
|
|
|
- const deep = (arr: any) => {
|
|
|
- arr.forEach((v: any) => {
|
|
|
- map.set(v.value, v.label)
|
|
|
- if (v.children?.length > 0) {
|
|
|
- deep(v.children)
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
- deep(data)
|
|
|
- state.caseTypeTree = data
|
|
|
- state.caseTypeTreeMap = map
|
|
|
- },
|
|
|
- SET_PORT_OF_REGISTRY(state: any, {one, two}: any) {
|
|
|
- const mapOne = new Map()
|
|
|
- const mapTwo = new Map()
|
|
|
- one.forEach((v: any) => {
|
|
|
- mapOne.set(v.dictType, v.dictName)
|
|
|
- })
|
|
|
- two.forEach((v: any) => {
|
|
|
- mapTwo.set(v.dictValue, v.dictName)
|
|
|
- })
|
|
|
- state.cbglPersonDictionary = one
|
|
|
- state.cbglPersonDictionaryMap = mapOne
|
|
|
- state.portOfRegistryTwoList = two
|
|
|
- state.portOfRegistryTwoMap = mapTwo
|
|
|
- },
|
|
|
- SET_RESIDENT_MOORING_POINT(state: any, {one, two}: any) {
|
|
|
- const mapOne = new Map()
|
|
|
- const mapTwo = new Map()
|
|
|
- one.forEach((v: any) => {
|
|
|
- mapOne.set(v.dictType, v.dictName)
|
|
|
- })
|
|
|
- two.forEach((v: any) => {
|
|
|
- mapTwo.set(v.dictValue, v.dictName)
|
|
|
- })
|
|
|
- state.cbglPersonTemporary = one
|
|
|
- state.cbglPersonTemporaryMap = mapOne
|
|
|
- state.residentMooringPointTwoList = two
|
|
|
- state.residentMooringPointTwoMap = mapTwo
|
|
|
- },
|
|
|
- SET_LIST_LIBRARY_DEPLOY_TYPE_PEOPLE(state: any, {one, two}: any) {
|
|
|
- const mapOne = new Map()
|
|
|
- const mapTwo = new Map()
|
|
|
- one.forEach((v: any) => {
|
|
|
- mapOne.set(v.dictValue, v.dictLabel)
|
|
|
- })
|
|
|
- two.forEach((v: any) => {
|
|
|
- mapTwo.set(v.dictValue, v.dictLabel)
|
|
|
- })
|
|
|
- state.listLibraryDeployTypePeopleList = one
|
|
|
- state.listLibraryDeployTypePeopleMap = mapOne
|
|
|
- state.listLibraryDeployTypeTwoPeopleList = two
|
|
|
- state.listLibraryDeployTypeTwoPeopleMap = mapTwo
|
|
|
- },
|
|
|
- SET_LIST_LIBRARY_DEPLOY_TYPE_CAR(state: any, {one, two}: any) {
|
|
|
- const mapOne = new Map()
|
|
|
- const mapTwo = new Map()
|
|
|
- one.forEach((v: any) => {
|
|
|
- mapOne.set(v.dictValue, v.dictLabel)
|
|
|
- })
|
|
|
- two.forEach((v: any) => {
|
|
|
- mapTwo.set(v.dictValue, v.dictLabel)
|
|
|
- })
|
|
|
- state.listLibraryDeployTypeCarList = one
|
|
|
- state.listLibraryDeployTypeCarMap = mapOne
|
|
|
- state.listLibraryDeployTypeTwoCarList = two
|
|
|
- state.listLibraryDeployTypeTwoCarMap = mapTwo
|
|
|
- },
|
|
|
- SET_BAYONET_DEEP_CHECK(state, {carTree, faceTree, bayonetAll, bayonetCar, bayonetFace}) {
|
|
|
- const carTreeMap = new Map()
|
|
|
- const faceTreeMap = new Map()
|
|
|
- const deepTree = (map, arr, pObj: any = []) => {
|
|
|
- return arr.map(v => {
|
|
|
- v.cIds = []
|
|
|
- v.videoObjs = []
|
|
|
- if (!v.children && v.videos) {
|
|
|
- v.children = v.videos
|
|
|
- }
|
|
|
- v.videoNum = 0
|
|
|
- if (v.indexCode === undefined) {
|
|
|
- v.source = 'dept'
|
|
|
- v.treeName = v.deptName
|
|
|
- v.treeId = v.deptId + v.deptName
|
|
|
- } else {
|
|
|
- v.source = 'video'
|
|
|
- v.treeName = v.name
|
|
|
- v.treeId = v.name
|
|
|
- pObj.forEach((p, i) => {
|
|
|
- p.videoNum++
|
|
|
- p.videoObjs.push(v)
|
|
|
- if (i === pObj.length - 1) {
|
|
|
- p.lastDept = true
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
- v.pIds = pObj.map(p => {
|
|
|
- p.cIds.push(v.treeId)
|
|
|
- return p.treeId
|
|
|
- })
|
|
|
- if (v.children?.length > 0) {
|
|
|
- v.children = deepTree(map, v.children, [...pObj, v])
|
|
|
- }
|
|
|
- map.set(v.treeId, v)
|
|
|
- return v
|
|
|
- })
|
|
|
- }
|
|
|
- state.bayonetDeepCheckList.all = bayonetAll
|
|
|
- state.bayonetDeepCheckList.car = bayonetCar
|
|
|
- state.bayonetDeepCheckList.face = bayonetFace
|
|
|
- state.bayonetDeepCheckTree.car = deepTree(carTreeMap, carTree)
|
|
|
- state.bayonetDeepCheckTreeMap.car = carTreeMap
|
|
|
- state.bayonetDeepCheckTree.face = deepTree(faceTreeMap, faceTree)
|
|
|
- state.bayonetDeepCheckTreeMap.face = faceTreeMap
|
|
|
- },
|
|
|
- SET_VIDEO(state, data) {
|
|
|
- const map = new Map()
|
|
|
- data.forEach(v => {
|
|
|
- if (v.equipmentNumber) {
|
|
|
- map.set(v.equipmentNumber, v)
|
|
|
- }
|
|
|
- })
|
|
|
- state.videoMap = map
|
|
|
- state.videoList = data
|
|
|
- },
|
|
|
- SET_PORT (state, data) {
|
|
|
- const map = new Map()
|
|
|
- data.forEach(v => {
|
|
|
- map.set(v.id, v)
|
|
|
- })
|
|
|
- state.portList = data
|
|
|
- state.portMap = map
|
|
|
- },
|
|
|
- // 船籍港一级
|
|
|
- SET_VBGLPEESON(state,{type,data}){
|
|
|
- const map = new Map()
|
|
|
- data.forEach(v => {
|
|
|
- map.set(v.dictType, v.dictName)
|
|
|
- })
|
|
|
- state[type] = data;
|
|
|
- state[type + 'Map'] = map;
|
|
|
- },
|
|
|
- SET_MEET_EMERGENCY_PLAN_TYPE(state, data) {
|
|
|
- const map = new Map()
|
|
|
- const deep = (arr: any) => {
|
|
|
- arr.forEach((v: any) => {
|
|
|
- map.set(v.id, v.typeName)
|
|
|
- if (v.children?.length > 0) {
|
|
|
- deep(v.children)
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
- deep(data)
|
|
|
- state.meetEmergencyPlanTypeList = data
|
|
|
- state.meetEmergencyPlanTypeMap = map
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
const actions = {
|
|
@@ -328,369 +46,6 @@ const actions = {
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- LOAD_DICT_OTHER({ commit }: any, {data, label, value, type}) {
|
|
|
- return new Promise((resolve, reject) => {
|
|
|
- if (state[dictionaryOtherDefine[type][0]].length === 0) {
|
|
|
- commit('SET_DICT_LIST', {
|
|
|
- listName: dictionaryOtherDefine[type][0],
|
|
|
- mapName: dictionaryOtherDefine[type][1],
|
|
|
- objMapName: dictionaryOtherDefine[type]?.[2],
|
|
|
- data: data.map(v => {
|
|
|
- v.dictLabel = v[label]
|
|
|
- v.dictValue = v[value]
|
|
|
- return v
|
|
|
- })
|
|
|
- })
|
|
|
- resolve(state[dictionaryOtherDefine[type][0]])
|
|
|
- } else {
|
|
|
- resolve(state[dictionaryOtherDefine[type][0]])
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- LOAD_CASE_TYPE({ commit }: any, refresh = false) {
|
|
|
- return new Promise((resolve, reject) => {
|
|
|
- if (state.caseTypeTree?.length > 0 && !refresh) {
|
|
|
- resolve(state.caseTypeTree)
|
|
|
- } else {
|
|
|
- api.default.getCaseTypeTree({
|
|
|
- caseTypeSource: 'xjz'
|
|
|
- }).then((res: any) => {
|
|
|
- if (res.code === 200) {
|
|
|
- commit('SET_CASE_TYPE_TREE', res.data)
|
|
|
- } else {
|
|
|
- reject(null)
|
|
|
- }
|
|
|
- }).catch(() => {
|
|
|
- reject(null)
|
|
|
- })
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- // 船籍港
|
|
|
- LOAD_PORT_OF_REGISTRY({ commit }: any, refresh = false) {
|
|
|
- return new Promise((resolve, reject) => {
|
|
|
- if (state.cbglPersonDictionary?.length > 0 && !refresh) {
|
|
|
- if (state.portOfRegistryTwoList?.length > 0) {
|
|
|
- resolve(state.cbglPersonDictionary)
|
|
|
- } else {
|
|
|
- const one: any = state.cbglPersonDictionary
|
|
|
- Promise.all([
|
|
|
- ...one.map((v: any) => api.default.cbglPersonDictionary2(v.dictType))
|
|
|
- ]).then((res) => {
|
|
|
- const two: any = []
|
|
|
- res.forEach((v: any, i: number) => {
|
|
|
- if (v.code === 200) {
|
|
|
- two.push(...v.data.map((s: any) => {
|
|
|
- s.parent = one[i].dictType
|
|
|
- return s
|
|
|
- }))
|
|
|
- } else {
|
|
|
- two.push([])
|
|
|
- }
|
|
|
- })
|
|
|
- commit('SET_PORT_OF_REGISTRY', {one, two})
|
|
|
- resolve({one, two})
|
|
|
- }).catch(() => {
|
|
|
- reject(null)
|
|
|
- })
|
|
|
- }
|
|
|
- } else {
|
|
|
- api.default.cbglPersonDictionary().then((res: any) => {
|
|
|
- if (res.code === 200) {
|
|
|
- const one = res.data
|
|
|
- Promise.all([
|
|
|
- ...one.map((v: any) => api.default.cbglPersonDictionary2(v.dictType))
|
|
|
- ]).then((res) => {
|
|
|
- const two: any = []
|
|
|
- res.forEach((v: any, i: number) => {
|
|
|
- if (v.code === 200) {
|
|
|
- two.push(...v.data.map((s: any) => {
|
|
|
- s.parent = one[i].dictType
|
|
|
- return s
|
|
|
- }))
|
|
|
- } else {
|
|
|
- two.push([])
|
|
|
- }
|
|
|
- })
|
|
|
- commit('SET_PORT_OF_REGISTRY', {one, two})
|
|
|
- resolve({one, two})
|
|
|
- }).catch(() => {
|
|
|
- reject(null)
|
|
|
- })
|
|
|
- } else {
|
|
|
- reject(null)
|
|
|
- }
|
|
|
- }).catch(() => {
|
|
|
- reject(null)
|
|
|
- })
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- // 船籍港停泊点
|
|
|
- LOAD_RESIDENT_MOORING_POINT({ commit }: any, refresh = false) {
|
|
|
- return new Promise((resolve, reject) => {
|
|
|
- if (state.cbglPersonTemporary?.length > 0 && !refresh) {
|
|
|
- if (state.residentMooringPointTwoList?.length > 0) {
|
|
|
- resolve(state.cbglPersonTemporary)
|
|
|
- } else {
|
|
|
- const one: any = state.cbglPersonTemporary
|
|
|
- Promise.all([
|
|
|
- ...one.map((v: any) => api.default.cbglPersonTemporary2(v.dictType))
|
|
|
- ]).then((res) => {
|
|
|
- const two: any = []
|
|
|
- res.forEach((v: any, i: number) => {
|
|
|
- if (v.code === 200) {
|
|
|
- two.push(...v.data.map((s: any) => {
|
|
|
- s.parent = one[i].dictType
|
|
|
- return s
|
|
|
- }))
|
|
|
- } else {
|
|
|
- two.push([])
|
|
|
- }
|
|
|
- })
|
|
|
- commit('SET_RESIDENT_MOORING_POINT', {one, two})
|
|
|
- resolve({one, two})
|
|
|
- }).catch(() => {
|
|
|
- reject(null)
|
|
|
- })
|
|
|
- }
|
|
|
- } else {
|
|
|
- api.default.cbglPersonTemporary().then((res: any) => {
|
|
|
- if (res.code === 200) {
|
|
|
- const one = res.data
|
|
|
- Promise.all([
|
|
|
- ...one.map((v: any) => api.default.cbglPersonTemporary2(v.dictType))
|
|
|
- ]).then((res) => {
|
|
|
- const two: any = []
|
|
|
- res.forEach((v: any, i: number) => {
|
|
|
- if (v.code === 200) {
|
|
|
- two.push(...v.data.map((s: any) => {
|
|
|
- s.parent = one[i].dictType
|
|
|
- return s
|
|
|
- }))
|
|
|
- } else {
|
|
|
- two.push([])
|
|
|
- }
|
|
|
- })
|
|
|
- commit('SET_RESIDENT_MOORING_POINT', {one, two})
|
|
|
- resolve({one, two})
|
|
|
- }).catch(() => {
|
|
|
- reject(null)
|
|
|
- })
|
|
|
- } else {
|
|
|
- reject(null)
|
|
|
- }
|
|
|
- }).catch(() => {
|
|
|
- reject(null)
|
|
|
- })
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- // 人员名单库
|
|
|
- LOAD_LIST_LIBRARY_DEPLOY_TYPE_PEOPLE({ commit }: any, refresh = false) {
|
|
|
- return new Promise((resolve, reject) => {
|
|
|
- if (state.listLibraryDeployTypePeopleList?.length > 0 && !refresh) {
|
|
|
- if (state.listLibraryDeployTypeTwoPeopleList?.length > 0) {
|
|
|
- resolve(state.listLibraryDeployTypePeopleList)
|
|
|
- } else {
|
|
|
- const one: any = state.listLibraryDeployTypePeopleList
|
|
|
- Promise.all([
|
|
|
- ...one.map((v: any) => api.default.dicDeptDictList(v.dictValue))
|
|
|
- ]).then((res) => {
|
|
|
- const two: any = []
|
|
|
- res.forEach((v: any, i: number) => {
|
|
|
- if (v.code === 200) {
|
|
|
- two.push(...v.data.map((s: any) => {
|
|
|
- s.parent = one[i].dictValue
|
|
|
- return s
|
|
|
- }))
|
|
|
- } else {
|
|
|
- two.push([])
|
|
|
- }
|
|
|
- })
|
|
|
- commit('SET_LIST_LIBRARY_DEPLOY_TYPE_PEOPLE', {one, two})
|
|
|
- resolve({one, two})
|
|
|
- }).catch(() => {
|
|
|
- reject(null)
|
|
|
- })
|
|
|
- }
|
|
|
- } else {
|
|
|
- api.default.dicDeptDictList('warning_list_library_type').then((res: any) => {
|
|
|
- if (res.code === 200) {
|
|
|
- const one = res.data
|
|
|
- Promise.all([
|
|
|
- ...one.map((v: any) => api.default.dicDeptDictList(v.dictValue))
|
|
|
- ]).then((res) => {
|
|
|
- const two: any = []
|
|
|
- res.forEach((v: any, i: number) => {
|
|
|
- if (v.code === 200) {
|
|
|
- two.push(...v.data.map((s: any) => {
|
|
|
- s.parent = one[i].dictValue
|
|
|
- return s
|
|
|
- }))
|
|
|
- } else {
|
|
|
- two.push([])
|
|
|
- }
|
|
|
- })
|
|
|
- commit('SET_LIST_LIBRARY_DEPLOY_TYPE_PEOPLE', {one, two})
|
|
|
- resolve({one, two})
|
|
|
- }).catch(() => {
|
|
|
- reject(null)
|
|
|
- })
|
|
|
- } else {
|
|
|
- reject(null)
|
|
|
- }
|
|
|
- }).catch(() => {
|
|
|
- reject(null)
|
|
|
- })
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- // 车辆名单库
|
|
|
- LOAD_LIST_LIBRARY_DEPLOY_TYPE_CAR({ commit }: any, refresh = false) {
|
|
|
- return new Promise((resolve, reject) => {
|
|
|
- if (state.listLibraryDeployTypeCarList?.length > 0 && !refresh) {
|
|
|
- if (state.listLibraryDeployTypeTwoCarList?.length > 0) {
|
|
|
- resolve(state.listLibraryDeployTypeCarList)
|
|
|
- } else {
|
|
|
- const one: any = state.listLibraryDeployTypeCarList
|
|
|
- Promise.all([
|
|
|
- ...one.map((v: any) => api.default.dicDeptDictList(v.dictValue))
|
|
|
- ]).then((res) => {
|
|
|
- const two: any = []
|
|
|
- res.forEach((v: any, i: number) => {
|
|
|
- if (v.code === 200) {
|
|
|
- two.push(...v.data.map((s: any) => {
|
|
|
- s.parent = one[i].dictValue
|
|
|
- return s
|
|
|
- }))
|
|
|
- } else {
|
|
|
- two.push([])
|
|
|
- }
|
|
|
- })
|
|
|
- commit('SET_LIST_LIBRARY_DEPLOY_TYPE_CAR', {one, two})
|
|
|
- resolve({one, two})
|
|
|
- }).catch(() => {
|
|
|
- reject(null)
|
|
|
- })
|
|
|
- }
|
|
|
- } else {
|
|
|
- api.default.dicDeptDictList('warning_list_library_car_type').then((res: any) => {
|
|
|
- if (res.code === 200) {
|
|
|
- const one = res.data
|
|
|
- Promise.all([
|
|
|
- ...one.map((v: any) => api.default.dicDeptDictList(v.dictValue))
|
|
|
- ]).then((res) => {
|
|
|
- const two: any = []
|
|
|
- res.forEach((v: any, i: number) => {
|
|
|
- if (v.code === 200) {
|
|
|
- two.push(...v.data.map((s: any) => {
|
|
|
- s.parent = one[i].dictValue
|
|
|
- return s
|
|
|
- }))
|
|
|
- } else {
|
|
|
- two.push([])
|
|
|
- }
|
|
|
- })
|
|
|
- commit('SET_LIST_LIBRARY_DEPLOY_TYPE_CAR', {one, two})
|
|
|
- resolve({one, two})
|
|
|
- }).catch(() => {
|
|
|
- reject(null)
|
|
|
- })
|
|
|
- } else {
|
|
|
- reject(null)
|
|
|
- }
|
|
|
- }).catch(() => {
|
|
|
- reject(null)
|
|
|
- })
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- // 卡口深度核查-卡口数据
|
|
|
- LOAD_BAYONET_DEEP_CHECK({commit}, refresh = false){
|
|
|
- return new Promise((resolve, reject) => {
|
|
|
- if (state.bayonetDeepCheckList.all.length === 0 || refresh) {
|
|
|
- // api请求数据
|
|
|
- Promise.all([
|
|
|
- api.default.getVideoHKTree('car'),
|
|
|
- api.default.getVideoHKTree('face'),
|
|
|
- api.default.getVideoMap(),
|
|
|
- api.default.getVideoMap(`type=car`),
|
|
|
- api.default.getVideoMap(`type=face`),
|
|
|
- ]).then(([carTreeRes, faceTreeRes, bayonetAllRes, bayonetCarRes, bayonetFaceRes]) => {
|
|
|
- commit('SET_BAYONET_DEEP_CHECK', {
|
|
|
- carTree: [carTreeRes.data] || [],
|
|
|
- faceTree: [faceTreeRes.data] || [],
|
|
|
- bayonetAll: bayonetAllRes.data || [],
|
|
|
- bayonetCar: bayonetCarRes.data || [],
|
|
|
- bayonetFace: bayonetFaceRes.data || []
|
|
|
- })
|
|
|
- resolve('')
|
|
|
- })
|
|
|
- } else {
|
|
|
- resolve('')
|
|
|
- }
|
|
|
- })
|
|
|
-
|
|
|
- },
|
|
|
- // 视频监控数据
|
|
|
- LOAD_VIDEO({commit}, deptId, refresh = false){
|
|
|
- return new Promise((resolve, reject) => {
|
|
|
- if (state.videoList.length === 0 || refresh) {
|
|
|
- api.default.monitoringList(`pageNum=1&pageSize=5000&deptId=${deptId}`).then(res => {
|
|
|
- if (res.code === 200 && res.rows?.length > 0) {
|
|
|
- commit('SET_VIDEO', res.rows)
|
|
|
- }
|
|
|
- resolve(state.videoList)
|
|
|
- })
|
|
|
- } else {
|
|
|
- resolve(state.videoList)
|
|
|
- }
|
|
|
- })
|
|
|
-
|
|
|
- },
|
|
|
- LOAD_PORT ({ commit }, refresh = false) {
|
|
|
- return new Promise((resolve, reject) => {
|
|
|
- if (state.portList.length === 0 || refresh) {
|
|
|
- api.default
|
|
|
- .portList()
|
|
|
- .then(res => {
|
|
|
- commit('SET_PORT', res.rows)
|
|
|
- resolve(res.rows)
|
|
|
- })
|
|
|
- .catch(() => {
|
|
|
- reject('获取港岙口列表错误')
|
|
|
- })
|
|
|
- } else {
|
|
|
- resolve(null)
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- // 获取船籍港和船籍港停泊点一级
|
|
|
- LOAD_VBGLPEESON({commit},type){
|
|
|
- if(state[type].length<1){
|
|
|
- api.default[type]().then(res=>{
|
|
|
- commit("SET_VBGLPEESON",{data:res.data,type})
|
|
|
- })
|
|
|
- }
|
|
|
- },
|
|
|
- LOAD_MEET_EMERGENCY_PLAN_TYPE({ commit }: any, refresh = false) {
|
|
|
- return new Promise((resolve, reject) => {
|
|
|
- if (state.meetEmergencyPlanTypeList?.length > 0 && !refresh) {
|
|
|
- resolve(state.meetEmergencyPlanTypeList)
|
|
|
- } else {
|
|
|
- api.default.prePlanQueryTypeTree().then((res: any) => {
|
|
|
- if (res.code === 200) {
|
|
|
- commit('SET_MEET_EMERGENCY_PLAN_TYPE', res.data)
|
|
|
- } else {
|
|
|
- reject(null)
|
|
|
- }
|
|
|
- }).catch(() => {
|
|
|
- reject(null)
|
|
|
- })
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
}
|
|
|
|
|
|
export default {
|