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

打包除ts错误

parent a17f3d84
This diff is collapsed.
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