Commit 7ef6e681 authored by 郭铭瑶's avatar 郭铭瑶 🤘

打包除ts错误

parent a17f3d84
let BASE_URL = ''
let TOKEN = null
const getCookie = (name: string): string | null => {
const reg: RegExp = new RegExp(`(^| )${name}=([^;]*)(;|$)`)
const arr: RegExpMatchArray | null = document.cookie.match(reg)
if (arr) {
return unescape(arr[2])
}
return null
}
switch (process.env.NODE_ENV) {
case 'production':
BASE_URL = ''
TOKEN = getCookie('__DM_TOKEN__') || localStorage.get('dm_token_')
break
default:
BASE_URL = ''
TOKEN = 'EwNgRgHMCsAsYFoDMIAMEG1U2CCcAZnkggIakCmAJiNNgOxIDGVQA'
}
export default {
TOKEN,
BASE_URL,
/**
* 党员详情
* @param memberId 必须
*/
GET_MEMBER_INFO: '/base/memberInfo',
/**
* 党组织详情
* @param orgId 必须
*/
GET_ORG_INFO: '/base/orgInfo',
/**
* 党组织分类
* @param organizationId | 否 | | 党组织唯一识别标识,确定本次查询是全街道、某一个组织下。没有默认全街道 |
* @param areaID | 否 | | 社区ID,默认不指定社区 |
* @param labelForOrg | 否 | | 组织标签,可多个,多个','拼接,默认无筛选标签 |
* @param labelForMemberIn | 否 | | 党员标签,可多个,多个','拼接,默认无筛选标签 |
* @param residentsID | 否 | | 社区ID,默认不指定居委 |
* @param communityID | 否 | | 小区ID,默认不指定小区 |
* @param buildingID | 否 | | 楼栋ID,默认不指定楼栋 |
* @param organizationType | 否 | | 党组类型(机关事业单位、居民区、两新),单选,默认无类型标签 |
*/
GET_ORG_TYPE: '/base/distribution/orgType',
/**
* 关系在街道党员年龄分布
* @param organizationId | 否 | | 党组织唯一识别标识,确定本次查询是全街道、某一个组织下。没有默认全街道 |
* @param areaID | 否 | | 社区ID,默认不指定社区 |
* @param labelForOrg | 否 | | 组织标签,可多个,多个','拼接,默认无筛选标签 |
* @param labelForMemberIn | 否 | | 党员标签,可多个,多个','拼接,默认无筛选标签 |
* @param residentsID | 否 | | 社区ID,默认不指定居委 |
* @param communityID | 否 | | 小区ID,默认不指定小区 |
* @param buildingID | 否 | | 楼栋ID,默认不指定楼栋 |
* @param organizationType | 否 | | 党组类型(机关事业单位、居民区、两新),单选,默认无类型标签 |
*/
GET_MEMBER_AGE: '/base/distribution/age',
/**
* 关系在街道党员分类
* @param organizationId | 否 | | 党组织唯一识别标识,确定本次查询是全街道、某一个组织下。没有默认全街道 |
* @param areaID | 否 | | 社区ID,默认不指定社区 |
* @param labelForOrg | 否 | | 组织标签,可多个,多个','拼接,默认无筛选标签 |
* @param labelForMemberIn | 否 | | 党员标签,可多个,多个','拼接,默认无筛选标签 |
* @param residentsID | 否 | | 社区ID,默认不指定居委 |
* @param communityID | 否 | | 小区ID,默认不指定小区 |
* @param buildingID | 否 | | 楼栋ID,默认不指定楼栋 |
* @param organizationType | 否 | | 党组类型(机关事业单位、居民区、两新),单选,默认无类型标签 |
*/
GET_MEMBER_TYPE: '/base/distribution/relation',
/**
* 基本情况统计
* @param organizationId | 否 | | 党组织唯一识别标识,确定本次查询是全街道、某一个组织下。没有默认全街道 |
* @param areaID | 否 | | 社区ID,默认不指定社区 |
* @param labelForOrg | 否 | | 组织标签,可多个,多个','拼接,默认无筛选标签 |
* @param labelForMemberIn | 否 | | 党员标签,可多个,多个','拼接,默认无筛选标签 |
* @param residentsID | 否 | | 社区ID,默认不指定居委 |
* @param communityID | 否 | | 小区ID,默认不指定小区 |
* @param buildingID | 否 | | 楼栋ID,默认不指定楼栋 |
* @param organizationType | 否 | | 党组类型(机关事业单位、居民区、两新),单选,默认无类型标签 |
*/
GET_BASIC_INFO: '/base/totalCount',
/**
* 按组织类型获取党组织GIS对象,含点位(组织搜索选中撒点、地理筛选撒点、组织类型切换撒点)
* @param organizationId | 否 | | 党组织唯一识别标识,确定本次查询是全街道、某一个组织下。没有默认全街道 |
* @param areaID | 否 | | 社区ID,默认不指定社区 |
* @param labelForOrg | 否 | | 组织标签,可多个,多个','拼接,默认无筛选标签 |
* @param residentsID | 否 | | 社区ID,默认不指定居委 |
* @param communityID | 否 | | 小区ID,默认不指定小区 |
* @param buildingID | 否 | | 楼栋ID,默认不指定楼栋 |
* @param organizationType | 否 | | 党组类型(机关事业单位、居民区、两新),单选,默认无类型标签 |
* @param pageSize | 是 | | 分页数 |
* @param pageNo | 是 | | 页码 |
*/
GET_ORG_GIS: '/gis/org',
/**
* 获取党员GIS对象,含点位(党员搜索选中撒点、标签筛选撒点)
* @param labelForMemberIn | 否 | | 党员标签,可多个,多个','拼接,默认无筛选标签 |
* @param memberId | 否 | | 需要定位的党员ID |
* @param pageSize | 是 | | 分页数 |
* @param pageNo | 是 | | 页码 |
*/
GET_MEMBER_GIS: '/gis/member',
/**
* 获取活动GIS对象,含点位(党组活动撒点)
* @param activityTypeIds |是 | |活动分类,可多个,多个','拼接
*/
GET_ACTIVITY_GIS: '/gis/activity',
/**
* 党员搜索
* @param name | 是 | | 模糊搜索 |
* @param pageSize | 是 | | |
* @param pageNo | 是 | | |
*/
SEARCH_MEMBER: '/search/member',
/**
* 党组织搜索
* @param name | 是 | | 模糊搜索 |
* @param pageSize | 是 | | |
* @param pageNo | 是 | | |
*/
SEARCH_ORG: '/search/org',
/**
* 综合搜索
* @param name | 是 | | 模糊搜索 |
*/
SEARCH_ALL: '/search/all',
/**
* 下载指定标签文件
* @param labelType | 是 | | 党组标签,或 党员标签 |
* @param labelId | 是 | | |
*/
GET_TAG_FILE: '/filter/label/getfile',
/**
* 获取全部标签
*/
GET_ALL_TAG: '/filter/label/all',
/**
* 获取指定小区下所有楼栋
* @param areaId | 是 | | 社区id |
* @param residentId | 是 | | 居委Id |
* @param communityId | 是 | | 小区id |
*/
GET_BUILDING: '/filter/building/all',
/**
* 获取指定居委下所有小区
* @param areaId | 是 | | 社区id |
* @param residentId | 是 | | 居委Id |
*/
GET_COMMUNITY: '/filter/community/all',
/**
* 获取指定楼栋下所有分户结构
* @param areaId | 是 | | 社区id |
* @param residentId | 是 | | 居委Id |
* @param communityId | 是 | | 小区id |
* @param buildingId | 是 | | 楼栋id |
*/
GET_HOUSE: '/filter/house/all',
/**
* 获取指定社区下所有居委清单
* @param areaId | 是 | | 社区id |
*/
GET_COMMITTEE: '/filter/resident/all',
/**
* 获取社区清单
*/
GET_AREA: '/filter/area/all',
/**
* 修改活动
* Content-Type=application/json
* body = {
activityId: '542180348126879744', // 活动Id
activityName: '542180348126879744', // 活动名称
orgId: '542180348126879744', //所属党组织ID
orgName: '542180348126879744', //所属党组织名称
activityDate: '542180348126879744', //活动开始时间
activityAddress: '542180348126879744', //活动地址
personActNum: '542180348126879744', //活动参与人数
personIgAll: '542180348126879744', //活动hulve人数
personAll: '542180348126879744', //活动总人数
present: '542180348126879744', //出席率
presentFile: {
//出勤记录文件
fileID: '',
fileType: 'photo / file',
},
content: '542180348126879744',
contentFile: {
//活动台账记录文件
fileID: '',
fileType: 'photo / file',
},
photos: [
{
// 活动照片
fileID: '',
fileType: 'photo / file',
},
{
fileID: '',
fileType: 'photo / file',
},
],
creatorID: null, // 创建者id
}
*/
PUT_ACTIVITY: '/activity',
/**
* 删除活动
* Content-Type=application/json
* body = {
activityId: '542180348126879744', // 活动Id
}
*/
DELETE_ACTIVITY: '/activity',
/**
* 新增活动
* Content-Type=application/json
* 参数同PUT_ACTIVITY
*/
POST_ACTIVITY: '/activity',
/**
* 活动分类筛选
* @param startDate | 否 | | 起始日期 |
* @param endDate | 否 | | 截止日期 |
*/
GET_ACTIVITY_TYPE: '/activityType/filter',
/**
* 活动列表
* @param startDate | 否 | | 起始日期 |
* @param endDate | 否 | | 截止日期 |
* @param activityTypeId | 否 | | 活动类型ID |
* @param presetS | 否 | | 最低出席率 |
* @param presetE | 否 | | 最高出席率 |
* @param pageSize | 是 | | |
* @param pageNo | 是 | | |
*/
GET_ACTIVITY: '/activities',
/**
* 活动详情
* @param activityId | 是 | | 活动id |
*/
GET_ACTIVITY_INFO: '/activity/info',
/**
* 获取活动文档导出地址
* @param activityId | 是 | | 活动id |
*/
GET_ACTIVITY_FILE: '/activity/downloadUrl',
/**
* 上传文件
* Content-Type=multipart/form-data
* @param file | file | 是 | | |
*/
POST_FILE: '/file/upload',
}
let BASE_URL = '' let BASE_URL: string = ''
let TOKEN = null let TOKEN: string = ''
const getCookie = (name: string): string | null => { const getCookie = (name: string): string | null => {
const reg: RegExp = new RegExp(`(^| )${name}=([^;]*)(;|$)`) const reg: RegExp = new RegExp(`(^| )${name}=([^;]*)(;|$)`)
const arr: RegExpMatchArray | null = document.cookie.match(reg) const arr: RegExpMatchArray | null = document.cookie.match(reg)
if (arr) { if (arr) return unescape(arr[2])
return unescape(arr[2])
}
return null return null
} }
...@@ -14,7 +12,7 @@ switch (process.env.NODE_ENV) { ...@@ -14,7 +12,7 @@ switch (process.env.NODE_ENV) {
case 'production': case 'production':
BASE_URL = 'https://survey.maicedata.com/api/data/' BASE_URL = 'https://survey.maicedata.com/api/data/'
TOKEN = LZString.decompressFromEncodedURIComponent( TOKEN = LZString.decompressFromEncodedURIComponent(
getCookie('__DM_TOKEN__') || localStorage.get('dm_token_'), getCookie('__DM_TOKEN__') || window.localStorage.getItem('dm_token_'),
) )
break break
default: default:
...@@ -37,4 +35,5 @@ export default { ...@@ -37,4 +35,5 @@ export default {
ATTACHMENT: '988fc63e-fa55-4729-851d-24c4355213f2', ATTACHMENT: '988fc63e-fa55-4729-851d-24c4355213f2',
TAG: '54344e11-c0d3-40d5-8f99-771066249328', TAG: '54344e11-c0d3-40d5-8f99-771066249328',
GET_AUTH: '988fc63e-fa55-4729-851d-24c4355213f2/storage/grant', GET_AUTH: '988fc63e-fa55-4729-851d-24c4355213f2/storage/grant',
GET_USER_ID: '/auth/user/bytoken',
} }
...@@ -74,7 +74,7 @@ const transRadarOption = ( ...@@ -74,7 +74,7 @@ const transRadarOption = (
const length = (source && source.length) || 0 const length = (source && source.length) || 0
const result = Object.assign({}, defaultOption) const result = Object.assign({}, defaultOption)
const seriesData = [] const seriesData: RadarSeriesOption[] = []
for (let index = 0; index < length; index++) { for (let index = 0; index < length; index++) {
const data: number[] = [] const data: number[] = []
Object.keys(source[index]).forEach((key) => { Object.keys(source[index]).forEach((key) => {
......
...@@ -30,7 +30,7 @@ export const toRGB = (c: string, opacity = 1): string => { ...@@ -30,7 +30,7 @@ export const toRGB = (c: string, opacity = 1): string => {
} }
color = newColor color = newColor
} }
const result = [] const result: number[] = []
for (let i = 1; i < 7; i += 2) { for (let i = 1; i < 7; i += 2) {
result.push(parseInt(`0x${color.slice(i, i + 2)}`)) result.push(parseInt(`0x${color.slice(i, i + 2)}`))
} }
......
...@@ -15,7 +15,7 @@ export default async function useAliOss(file: any) { ...@@ -15,7 +15,7 @@ export default async function useAliOss(file: any) {
const fr = new FileReader() const fr = new FileReader()
const filename = file.name const filename = file.name
return new Promise((resolve: any) => { return new Promise((resolve) => {
fr.readAsArrayBuffer(file) fr.readAsArrayBuffer(file)
fr.onload = async (e) => { fr.onload = async (e) => {
const buffer = new OSS.Buffer(e.target && e.target.result) const buffer = new OSS.Buffer(e.target && e.target.result)
......
...@@ -26,6 +26,7 @@ declare interface Window { ...@@ -26,6 +26,7 @@ declare interface Window {
dojoConfig: any dojoConfig: any
apiRoot: any apiRoot: any
map: any map: any
graphiclayer:any
sceneView: any sceneView: any
sceneLayer0: any sceneLayer0: any
modelHighlight: any modelHighlight: any
......
import { computed, defineComponent, PropType, ref } from 'vue'
export default defineComponent({
name: 'TsxComponent',
props: {
msg: {
type: String as PropType<string>,
default: 'Tsx',
},
},
setup(props) {
const count = ref(1)
const list = computed(() => {
const result = []
for (let i = 0; i < count.value; i++) {
result.push(i + 1)
}
return result
})
return () => (
<>
<h1>Hello, {props.msg}</h1>
<button onClick={() => (count.value += 1)}>
Add count: <b>{count.value}</b>
</button>
<ul>
{list.value.map((_, i) => (
<li>{i + 1}</li>
))}
</ul>
</>
)
},
})
...@@ -157,7 +157,7 @@ const typeOptions = computed(() => { ...@@ -157,7 +157,7 @@ const typeOptions = computed(() => {
watch( watch(
() => model.value, () => model.value,
(cur) => { (cur) => {
const query = [] const query: string[] = []
cur.dateStart && cur.dateStart &&
query.push( query.push(
`paths @ "活动日期" && number >= ${+(cur.dateStart + '').slice(0, 10)}`, `paths @ "活动日期" && number >= ${+(cur.dateStart + '').slice(0, 10)}`,
......
...@@ -285,7 +285,7 @@ onMounted(() => { ...@@ -285,7 +285,7 @@ onMounted(() => {
}) })
const getDetail = async (type: string, name: string) => { const getDetail = async (type: string, name: string) => {
let res = null let res = []
switch (type) { switch (type) {
case 'organization': case 'organization':
res = await useFetchOrg({ res = await useFetchOrg({
...@@ -319,8 +319,7 @@ const getDetail = async (type: string, name: string) => { ...@@ -319,8 +319,7 @@ const getDetail = async (type: string, name: string) => {
} }
const handleExport = async (type: string, key: string, name: string) => { const handleExport = async (type: string, key: string, name: string) => {
const res = await getDetail(type, key) const data = (await getDetail(type, key))?.map((item: any) => item.extra)
const data = res.map((item: any) => item.extra)
useExportFile(data, type === 'organization' ? '党组织名称' : '姓名', name) useExportFile(data, type === 'organization' ? '党组织名称' : '姓名', name)
} }
...@@ -332,7 +331,10 @@ watch( ...@@ -332,7 +331,10 @@ watch(
const result = await Promise.all( const result = await Promise.all(
keys.map((key) => getDetail('organization', key)), keys.map((key) => getDetail('organization', key)),
) )
result.forEach((item: any[]) => pointData.push(...item.map((e) => e.extra))) result.forEach((item: any[]) => {
if (!item || item.length === 0) return
pointData.push(...item.map((e) => e.extra))
})
console.log('organization撒点数据:', pointData) console.log('organization撒点数据:', pointData)
// TODO 撒点 // TODO 撒点
}, },
...@@ -346,7 +348,10 @@ watch( ...@@ -346,7 +348,10 @@ watch(
const result = await Promise.all( const result = await Promise.all(
keys.map((key) => getDetail('member', key)), keys.map((key) => getDetail('member', key)),
) )
result.forEach((item: any[]) => pointData.push(...item.map((e) => e.extra))) result.forEach((item: any[]) => {
if (!item || item.length === 0) return
pointData.push(...item.map((e) => e.extra))
})
console.log('member撒点数据:', pointData) console.log('member撒点数据:', pointData)
// TODO 撒点 // TODO 撒点
}, },
...@@ -448,7 +453,7 @@ const curPath = computed(() => { ...@@ -448,7 +453,7 @@ const curPath = computed(() => {
if (curGeo.value === '小区' && !curCommittee.value) if (curGeo.value === '小区' && !curCommittee.value)
return [curCommunity.value || '小区'] return [curCommunity.value || '小区']
const result = [] const result: string[] = []
curArea.value && result.push(curArea.value) curArea.value && result.push(curArea.value)
curCommittee.value curCommittee.value
? result.push(curCommittee.value) ? result.push(curCommittee.value)
...@@ -463,7 +468,7 @@ const checkPathThenFetchInfo = () => { ...@@ -463,7 +468,7 @@ const checkPathThenFetchInfo = () => {
const area = curArea.value const area = curArea.value
const committee = curCommittee.value const committee = curCommittee.value
const community = curCommunity.value const community = curCommunity.value
const query = [] const query: string[] = []
area && query.push(`paths @ "所属社区" && string == "${area}"`) area && query.push(`paths @ "所属社区" && string == "${area}"`)
committee && query.push(`paths @ "所属居委" && string == "${committee}"`) committee && query.push(`paths @ "所属居委" && string == "${committee}"`)
community && query.push(`paths @ "所属小区" && string == "${community}"`) community && query.push(`paths @ "所属小区" && string == "${community}"`)
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
"sourceMap": true, "sourceMap": true,
"baseUrl": ".", "baseUrl": ".",
"lib": ["esnext", "dom"], "lib": ["esnext", "dom"],
"noImplicitAny": false,
"paths": { "paths": {
"@/*": ["src/*"], "@/*": ["src/*"],
"@images/*": ["src/assets/images/*"] "@images/*": ["src/assets/images/*"]
......
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