提交 63297dac authored 作者: ZvonimirSun's avatar ZvonimirSun

chore: 调整配置,移除ts文件

上级 4301b95c
{
"globals": {
"Component": true,
"ComponentPublicInstance": true,
"ComputedRef": true,
"EffectScope": true,
"ExtractDefaultPropTypes": true,
"ExtractPropTypes": true,
"ExtractPublicPropTypes": true,
"InjectionKey": true,
"PropType": true,
"Ref": true,
"VNode": true,
"WritableComputedRef": true,
"acceptHMRUpdate": true,
"computed": true,
"createApp": true,
"createPinia": true,
"customRef": true,
"defineAsyncComponent": true,
"defineComponent": true,
"defineStore": true,
"effectScope": true,
"getActivePinia": true,
"getCurrentInstance": true,
"getCurrentScope": true,
"h": true,
"inject": true,
"isProxy": true,
"isReactive": true,
"isReadonly": true,
"isRef": true,
"mapActions": true,
"mapGetters": true,
"mapState": true,
"mapStores": true,
"mapWritableState": true,
"markRaw": true,
"nextTick": true,
"onActivated": true,
"onBeforeMount": true,
"onBeforeRouteLeave": true,
"onBeforeRouteUpdate": true,
"onBeforeUnmount": true,
"onBeforeUpdate": true,
"onDeactivated": true,
"onErrorCaptured": true,
"onMounted": true,
"onRenderTracked": true,
"onRenderTriggered": true,
"onScopeDispose": true,
"onServerPrefetch": true,
"onUnmounted": true,
"onUpdated": true,
"provide": true,
"reactive": true,
"readonly": true,
"ref": true,
"resolveComponent": true,
"setActivePinia": true,
"setMapStoreSuffix": true,
"shallowReactive": true,
"shallowReadonly": true,
"shallowRef": true,
"storeToRefs": true,
"toRaw": true,
"toRef": true,
"toRefs": true,
"toValue": true,
"triggerRef": true,
"unref": true,
"useAttrs": true,
"useCssModule": true,
"useCssVars": true,
"useLink": true,
"useRoute": true,
"useRouter": true,
"useSlots": true,
"watch": true,
"watchEffect": true,
"watchPostEffect": true,
"watchSyncEffect": true,
"diff": true,
"getNode": true,
"getParents": true,
"mitt": true,
"renameKeys": true
}
}
......@@ -15,3 +15,7 @@ dist-ssr
*.njsproj
*.sln
*.sw?
pnpm-lock.yaml
yarn.lock
package-lock.json
/* eslint-disable */
/* prettier-ignore */
// @ts-nocheck
// noinspection JSUnusedGlobalSymbols
// Generated by unplugin-auto-import
export {}
declare global {
const EffectScope: typeof import('vue')['EffectScope']
const acceptHMRUpdate: typeof import('pinia')['acceptHMRUpdate']
const computed: typeof import('vue')['computed']
const createApp: typeof import('vue')['createApp']
const createPinia: typeof import('pinia')['createPinia']
const customRef: typeof import('vue')['customRef']
const defineAsyncComponent: typeof import('vue')['defineAsyncComponent']
const defineComponent: typeof import('vue')['defineComponent']
const defineStore: typeof import('pinia')['defineStore']
const diff: typeof import('./src/utils/arrayUtil.js')['diff']
const effectScope: typeof import('vue')['effectScope']
const getActivePinia: typeof import('pinia')['getActivePinia']
const getCurrentInstance: typeof import('vue')['getCurrentInstance']
const getCurrentScope: typeof import('vue')['getCurrentScope']
const getNode: typeof import('./src/utils/treeUtil.js')['getNode']
const getParents: typeof import('./src/utils/treeUtil.js')['getParents']
const h: typeof import('vue')['h']
const inject: typeof import('vue')['inject']
const isProxy: typeof import('vue')['isProxy']
const isReactive: typeof import('vue')['isReactive']
const isReadonly: typeof import('vue')['isReadonly']
const isRef: typeof import('vue')['isRef']
const mapActions: typeof import('pinia')['mapActions']
const mapGetters: typeof import('pinia')['mapGetters']
const mapState: typeof import('pinia')['mapState']
const mapStores: typeof import('pinia')['mapStores']
const mapWritableState: typeof import('pinia')['mapWritableState']
const markRaw: typeof import('vue')['markRaw']
const mitt: typeof import('./src/utils/mitt.js')['default']
const nextTick: typeof import('vue')['nextTick']
const onActivated: typeof import('vue')['onActivated']
const onBeforeMount: typeof import('vue')['onBeforeMount']
const onBeforeRouteLeave: typeof import('vue-router')['onBeforeRouteLeave']
const onBeforeRouteUpdate: typeof import('vue-router')['onBeforeRouteUpdate']
const onBeforeUnmount: typeof import('vue')['onBeforeUnmount']
const onBeforeUpdate: typeof import('vue')['onBeforeUpdate']
const onDeactivated: typeof import('vue')['onDeactivated']
const onErrorCaptured: typeof import('vue')['onErrorCaptured']
const onMounted: typeof import('vue')['onMounted']
const onRenderTracked: typeof import('vue')['onRenderTracked']
const onRenderTriggered: typeof import('vue')['onRenderTriggered']
const onScopeDispose: typeof import('vue')['onScopeDispose']
const onServerPrefetch: typeof import('vue')['onServerPrefetch']
const onUnmounted: typeof import('vue')['onUnmounted']
const onUpdated: typeof import('vue')['onUpdated']
const provide: typeof import('vue')['provide']
const reactive: typeof import('vue')['reactive']
const readonly: typeof import('vue')['readonly']
const ref: typeof import('vue')['ref']
const renameKeys: typeof import('./src/utils/treeUtil.js')['renameKeys']
const resolveComponent: typeof import('vue')['resolveComponent']
const setActivePinia: typeof import('pinia')['setActivePinia']
const setMapStoreSuffix: typeof import('pinia')['setMapStoreSuffix']
const shallowReactive: typeof import('vue')['shallowReactive']
const shallowReadonly: typeof import('vue')['shallowReadonly']
const shallowRef: typeof import('vue')['shallowRef']
const storeToRefs: typeof import('pinia')['storeToRefs']
const toRaw: typeof import('vue')['toRaw']
const toRef: typeof import('vue')['toRef']
const toRefs: typeof import('vue')['toRefs']
const toValue: typeof import('vue')['toValue']
const triggerRef: typeof import('vue')['triggerRef']
const unref: typeof import('vue')['unref']
const useAttrs: typeof import('vue')['useAttrs']
const useCssModule: typeof import('vue')['useCssModule']
const useCssVars: typeof import('vue')['useCssVars']
const useLink: typeof import('vue-router')['useLink']
const useRoute: typeof import('vue-router')['useRoute']
const useRouter: typeof import('vue-router')['useRouter']
const useSlots: typeof import('vue')['useSlots']
const watch: typeof import('vue')['watch']
const watchEffect: typeof import('vue')['watchEffect']
const watchPostEffect: typeof import('vue')['watchPostEffect']
const watchSyncEffect: typeof import('vue')['watchSyncEffect']
}
// for type re-export
declare global {
// @ts-ignore
export type { Component, ComponentPublicInstance, ComputedRef, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InjectionKey, PropType, Ref, VNode, WritableComputedRef } from 'vue'
import('vue')
}
// for vue template auto import
import { UnwrapRef } from 'vue'
declare module 'vue' {
interface GlobalComponents {}
interface ComponentCustomProperties {
readonly EffectScope: UnwrapRef<typeof import('vue')['EffectScope']>
readonly acceptHMRUpdate: UnwrapRef<typeof import('pinia')['acceptHMRUpdate']>
readonly computed: UnwrapRef<typeof import('vue')['computed']>
readonly createApp: UnwrapRef<typeof import('vue')['createApp']>
readonly createPinia: UnwrapRef<typeof import('pinia')['createPinia']>
readonly customRef: UnwrapRef<typeof import('vue')['customRef']>
readonly defineAsyncComponent: UnwrapRef<typeof import('vue')['defineAsyncComponent']>
readonly defineComponent: UnwrapRef<typeof import('vue')['defineComponent']>
readonly defineStore: UnwrapRef<typeof import('pinia')['defineStore']>
readonly diff: UnwrapRef<typeof import('./src/utils/arrayUtil.js')['diff']>
readonly effectScope: UnwrapRef<typeof import('vue')['effectScope']>
readonly getActivePinia: UnwrapRef<typeof import('pinia')['getActivePinia']>
readonly getCurrentInstance: UnwrapRef<typeof import('vue')['getCurrentInstance']>
readonly getCurrentScope: UnwrapRef<typeof import('vue')['getCurrentScope']>
readonly getNode: UnwrapRef<typeof import('./src/utils/treeUtil.js')['getNode']>
readonly getParents: UnwrapRef<typeof import('./src/utils/treeUtil.js')['getParents']>
readonly h: UnwrapRef<typeof import('vue')['h']>
readonly inject: UnwrapRef<typeof import('vue')['inject']>
readonly isProxy: UnwrapRef<typeof import('vue')['isProxy']>
readonly isReactive: UnwrapRef<typeof import('vue')['isReactive']>
readonly isReadonly: UnwrapRef<typeof import('vue')['isReadonly']>
readonly isRef: UnwrapRef<typeof import('vue')['isRef']>
readonly mapActions: UnwrapRef<typeof import('pinia')['mapActions']>
readonly mapGetters: UnwrapRef<typeof import('pinia')['mapGetters']>
readonly mapState: UnwrapRef<typeof import('pinia')['mapState']>
readonly mapStores: UnwrapRef<typeof import('pinia')['mapStores']>
readonly mapWritableState: UnwrapRef<typeof import('pinia')['mapWritableState']>
readonly markRaw: UnwrapRef<typeof import('vue')['markRaw']>
readonly mitt: UnwrapRef<typeof import('./src/utils/mitt.js')['default']>
readonly nextTick: UnwrapRef<typeof import('vue')['nextTick']>
readonly onActivated: UnwrapRef<typeof import('vue')['onActivated']>
readonly onBeforeMount: UnwrapRef<typeof import('vue')['onBeforeMount']>
readonly onBeforeRouteLeave: UnwrapRef<typeof import('vue-router')['onBeforeRouteLeave']>
readonly onBeforeRouteUpdate: UnwrapRef<typeof import('vue-router')['onBeforeRouteUpdate']>
readonly onBeforeUnmount: UnwrapRef<typeof import('vue')['onBeforeUnmount']>
readonly onBeforeUpdate: UnwrapRef<typeof import('vue')['onBeforeUpdate']>
readonly onDeactivated: UnwrapRef<typeof import('vue')['onDeactivated']>
readonly onErrorCaptured: UnwrapRef<typeof import('vue')['onErrorCaptured']>
readonly onMounted: UnwrapRef<typeof import('vue')['onMounted']>
readonly onRenderTracked: UnwrapRef<typeof import('vue')['onRenderTracked']>
readonly onRenderTriggered: UnwrapRef<typeof import('vue')['onRenderTriggered']>
readonly onScopeDispose: UnwrapRef<typeof import('vue')['onScopeDispose']>
readonly onServerPrefetch: UnwrapRef<typeof import('vue')['onServerPrefetch']>
readonly onUnmounted: UnwrapRef<typeof import('vue')['onUnmounted']>
readonly onUpdated: UnwrapRef<typeof import('vue')['onUpdated']>
readonly provide: UnwrapRef<typeof import('vue')['provide']>
readonly reactive: UnwrapRef<typeof import('vue')['reactive']>
readonly readonly: UnwrapRef<typeof import('vue')['readonly']>
readonly ref: UnwrapRef<typeof import('vue')['ref']>
readonly renameKeys: UnwrapRef<typeof import('./src/utils/treeUtil.js')['renameKeys']>
readonly resolveComponent: UnwrapRef<typeof import('vue')['resolveComponent']>
readonly setActivePinia: UnwrapRef<typeof import('pinia')['setActivePinia']>
readonly setMapStoreSuffix: UnwrapRef<typeof import('pinia')['setMapStoreSuffix']>
readonly shallowReactive: UnwrapRef<typeof import('vue')['shallowReactive']>
readonly shallowReadonly: UnwrapRef<typeof import('vue')['shallowReadonly']>
readonly shallowRef: UnwrapRef<typeof import('vue')['shallowRef']>
readonly storeToRefs: UnwrapRef<typeof import('pinia')['storeToRefs']>
readonly toRaw: UnwrapRef<typeof import('vue')['toRaw']>
readonly toRef: UnwrapRef<typeof import('vue')['toRef']>
readonly toRefs: UnwrapRef<typeof import('vue')['toRefs']>
readonly toValue: UnwrapRef<typeof import('vue')['toValue']>
readonly triggerRef: UnwrapRef<typeof import('vue')['triggerRef']>
readonly unref: UnwrapRef<typeof import('vue')['unref']>
readonly useAttrs: UnwrapRef<typeof import('vue')['useAttrs']>
readonly useCssModule: UnwrapRef<typeof import('vue')['useCssModule']>
readonly useCssVars: UnwrapRef<typeof import('vue')['useCssVars']>
readonly useLink: UnwrapRef<typeof import('vue-router')['useLink']>
readonly useRoute: UnwrapRef<typeof import('vue-router')['useRoute']>
readonly useRouter: UnwrapRef<typeof import('vue-router')['useRouter']>
readonly useSlots: UnwrapRef<typeof import('vue')['useSlots']>
readonly watch: UnwrapRef<typeof import('vue')['watch']>
readonly watchEffect: UnwrapRef<typeof import('vue')['watchEffect']>
readonly watchPostEffect: UnwrapRef<typeof import('vue')['watchPostEffect']>
readonly watchSyncEffect: UnwrapRef<typeof import('vue')['watchSyncEffect']>
}
}
declare module '@vue/runtime-core' {
interface GlobalComponents {}
interface ComponentCustomProperties {
readonly EffectScope: UnwrapRef<typeof import('vue')['EffectScope']>
readonly acceptHMRUpdate: UnwrapRef<typeof import('pinia')['acceptHMRUpdate']>
readonly computed: UnwrapRef<typeof import('vue')['computed']>
readonly createApp: UnwrapRef<typeof import('vue')['createApp']>
readonly createPinia: UnwrapRef<typeof import('pinia')['createPinia']>
readonly customRef: UnwrapRef<typeof import('vue')['customRef']>
readonly defineAsyncComponent: UnwrapRef<typeof import('vue')['defineAsyncComponent']>
readonly defineComponent: UnwrapRef<typeof import('vue')['defineComponent']>
readonly defineStore: UnwrapRef<typeof import('pinia')['defineStore']>
readonly diff: UnwrapRef<typeof import('./src/utils/arrayUtil.js')['diff']>
readonly effectScope: UnwrapRef<typeof import('vue')['effectScope']>
readonly getActivePinia: UnwrapRef<typeof import('pinia')['getActivePinia']>
readonly getCurrentInstance: UnwrapRef<typeof import('vue')['getCurrentInstance']>
readonly getCurrentScope: UnwrapRef<typeof import('vue')['getCurrentScope']>
readonly getNode: UnwrapRef<typeof import('./src/utils/treeUtil.js')['getNode']>
readonly getParents: UnwrapRef<typeof import('./src/utils/treeUtil.js')['getParents']>
readonly h: UnwrapRef<typeof import('vue')['h']>
readonly inject: UnwrapRef<typeof import('vue')['inject']>
readonly isProxy: UnwrapRef<typeof import('vue')['isProxy']>
readonly isReactive: UnwrapRef<typeof import('vue')['isReactive']>
readonly isReadonly: UnwrapRef<typeof import('vue')['isReadonly']>
readonly isRef: UnwrapRef<typeof import('vue')['isRef']>
readonly mapActions: UnwrapRef<typeof import('pinia')['mapActions']>
readonly mapGetters: UnwrapRef<typeof import('pinia')['mapGetters']>
readonly mapState: UnwrapRef<typeof import('pinia')['mapState']>
readonly mapStores: UnwrapRef<typeof import('pinia')['mapStores']>
readonly mapWritableState: UnwrapRef<typeof import('pinia')['mapWritableState']>
readonly markRaw: UnwrapRef<typeof import('vue')['markRaw']>
readonly mitt: UnwrapRef<typeof import('./src/utils/mitt.js')['default']>
readonly nextTick: UnwrapRef<typeof import('vue')['nextTick']>
readonly onActivated: UnwrapRef<typeof import('vue')['onActivated']>
readonly onBeforeMount: UnwrapRef<typeof import('vue')['onBeforeMount']>
readonly onBeforeRouteLeave: UnwrapRef<typeof import('vue-router')['onBeforeRouteLeave']>
readonly onBeforeRouteUpdate: UnwrapRef<typeof import('vue-router')['onBeforeRouteUpdate']>
readonly onBeforeUnmount: UnwrapRef<typeof import('vue')['onBeforeUnmount']>
readonly onBeforeUpdate: UnwrapRef<typeof import('vue')['onBeforeUpdate']>
readonly onDeactivated: UnwrapRef<typeof import('vue')['onDeactivated']>
readonly onErrorCaptured: UnwrapRef<typeof import('vue')['onErrorCaptured']>
readonly onMounted: UnwrapRef<typeof import('vue')['onMounted']>
readonly onRenderTracked: UnwrapRef<typeof import('vue')['onRenderTracked']>
readonly onRenderTriggered: UnwrapRef<typeof import('vue')['onRenderTriggered']>
readonly onScopeDispose: UnwrapRef<typeof import('vue')['onScopeDispose']>
readonly onServerPrefetch: UnwrapRef<typeof import('vue')['onServerPrefetch']>
readonly onUnmounted: UnwrapRef<typeof import('vue')['onUnmounted']>
readonly onUpdated: UnwrapRef<typeof import('vue')['onUpdated']>
readonly provide: UnwrapRef<typeof import('vue')['provide']>
readonly reactive: UnwrapRef<typeof import('vue')['reactive']>
readonly readonly: UnwrapRef<typeof import('vue')['readonly']>
readonly ref: UnwrapRef<typeof import('vue')['ref']>
readonly renameKeys: UnwrapRef<typeof import('./src/utils/treeUtil.js')['renameKeys']>
readonly resolveComponent: UnwrapRef<typeof import('vue')['resolveComponent']>
readonly setActivePinia: UnwrapRef<typeof import('pinia')['setActivePinia']>
readonly setMapStoreSuffix: UnwrapRef<typeof import('pinia')['setMapStoreSuffix']>
readonly shallowReactive: UnwrapRef<typeof import('vue')['shallowReactive']>
readonly shallowReadonly: UnwrapRef<typeof import('vue')['shallowReadonly']>
readonly shallowRef: UnwrapRef<typeof import('vue')['shallowRef']>
readonly storeToRefs: UnwrapRef<typeof import('pinia')['storeToRefs']>
readonly toRaw: UnwrapRef<typeof import('vue')['toRaw']>
readonly toRef: UnwrapRef<typeof import('vue')['toRef']>
readonly toRefs: UnwrapRef<typeof import('vue')['toRefs']>
readonly toValue: UnwrapRef<typeof import('vue')['toValue']>
readonly triggerRef: UnwrapRef<typeof import('vue')['triggerRef']>
readonly unref: UnwrapRef<typeof import('vue')['unref']>
readonly useAttrs: UnwrapRef<typeof import('vue')['useAttrs']>
readonly useCssModule: UnwrapRef<typeof import('vue')['useCssModule']>
readonly useCssVars: UnwrapRef<typeof import('vue')['useCssVars']>
readonly useLink: UnwrapRef<typeof import('vue-router')['useLink']>
readonly useRoute: UnwrapRef<typeof import('vue-router')['useRoute']>
readonly useRouter: UnwrapRef<typeof import('vue-router')['useRouter']>
readonly useSlots: UnwrapRef<typeof import('vue')['useSlots']>
readonly watch: UnwrapRef<typeof import('vue')['watch']>
readonly watchEffect: UnwrapRef<typeof import('vue')['watchEffect']>
readonly watchPostEffect: UnwrapRef<typeof import('vue')['watchPostEffect']>
readonly watchSyncEffect: UnwrapRef<typeof import('vue')['watchSyncEffect']>
}
}
/* eslint-disable */
/* prettier-ignore */
// @ts-nocheck
// Generated by unplugin-vue-components
// Read more: https://github.com/vuejs/core/pull/3399
export {}
declare module 'vue' {
export interface GlobalComponents {
LayCascader: typeof import('@layui/layui-vue')['LayCascader']
LayCheckbox: typeof import('@layui/layui-vue')['LayCheckbox']
LayInput: typeof import('@layui/layui-vue')['LayInput']
LayLine: typeof import('@layui/layui-vue')['LayLine']
RouterLink: typeof import('vue-router')['RouterLink']
RouterView: typeof import('vue-router')['RouterView']
}
}
import globals from 'globals'
import pluginVue from 'eslint-plugin-vue'
import path from 'path'
import { fileURLToPath } from 'url'
import { FlatCompat } from '@eslint/eslintrc'
import pluginJs from '@eslint/js'
import autoImport from './.eslintrc-auto-import.json' assert {type: 'json'}
// mimic CommonJS variables -- not needed if using CommonJS
const __filename = fileURLToPath(import.meta.url)
const __dirname = path.dirname(__filename)
const compat = new FlatCompat({ baseDirectory: __dirname, recommendedConfig: pluginJs.configs.recommended })
export default [
{
languageOptions: {
globals: {
...globals.browser,
...globals.node,
...autoImport.globals
}
}
},
...compat.extends('standard'),
...pluginVue.configs['flat/recommended'],
{
rules: {
'import/export': 0,
'no-unused-vars': 0,
'vue/multi-word-component-names': 0
}
}
]
......@@ -8,6 +8,6 @@
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
<script type="module" src="/src/main.js"></script>
</body>
</html>
......@@ -5,7 +5,7 @@
"type": "module",
"scripts": {
"dev": "vite",
"build": "vue-tsc && vite build",
"build": "vite build",
"preview": "vite preview"
},
"dependencies": {
......@@ -16,37 +16,35 @@
"core-js": "^3.6.5",
"echarts": "^5.4.3",
"gm-crypt": "^0.0.2",
"gt-maputils": "^0.1.9",
"less": "^4.2.0",
"mockjs": "^1.1.0",
"pinia": "^2.1.7",
"pinia-plugin-persistedstate": "^3.2.0",
"vue": "^3.4.21",
"vue-router": "^4.2.5"
},
"devDependencies": {
"@babel/core": "^7.23.3",
"@babel/eslint-parser": "^7.23.3",
"@babel/preset-env": "^7.23.3",
"@eslint/eslintrc": "^3.0.2",
"@eslint/js": "^9.0.0",
"@types/node": "^18.7.8",
"@vitejs/plugin-vue": "^5.0.4",
"@vue/compiler-sfc": "^3.3.4",
"eslint": "^8.57.0",
"eslint-config-standard": "^17.1.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-n": "^16.6.2",
"eslint-plugin-promise": "^6.1.1",
"eslint-plugin-vue": "^9.24.0",
"globals": "^15.0.0",
"sass": "^1.75.0",
"typescript": "^5.2.2",
"unplugin-auto-import": "^0.11.2",
"unplugin-vue-components": "^0.22.7",
"typescript": "^5.4.5",
"unplugin-auto-import": "^0.17.5",
"unplugin-vue-components": "^0.26.0",
"vite": "^5.2.0",
"vue-tsc": "^2.0.6"
},
"eslintConfig": {
"root": true,
"env": {
"node": true
},
"extends": [
"plugin:vue/essential",
"eslint:recommended"
],
"parserOptions": {
"parser": "babel-eslint"
},
"rules": {}
"vite-plugin-vue-devtools": "^7.0.27"
},
"browserslist": [
"> 1%",
......
<script setup lang="ts"></script>
<script setup></script>
<template>
<router-view></router-view>
<router-view />
</template>
<style scoped lang="scss">
......
import axios, {
// AxiosRequestHeaders,
AxiosResponse,
InternalAxiosRequestConfig
} from 'axios'
import axios from 'axios'
// import { useUserStore } from '../store/user'
import { layer } from '@layui/layui-vue'
import router from '../router'
type TAxiosOption = {
timeout: number
baseURL: string
}
const config: TAxiosOption = {
const config = {
timeout: 5000,
// baseURL: import.meta.env.VITE_APP_BASE_API
baseURL: window.location.origin
......@@ -20,12 +11,12 @@ const config: TAxiosOption = {
class Http {
service
constructor(config: TAxiosOption) {
constructor (config) {
this.service = axios.create(config)
/* 请求拦截 */
this.service.interceptors.request.use(
(config: InternalAxiosRequestConfig) => {
(config) => {
// const userInfoStore = useUserStore();
// if (userInfoStore.token) {
// (config.headers as AxiosRequestHeaders).token = userInfoStore.token as string
......@@ -44,7 +35,7 @@ class Http {
/* 响应拦截 */
this.service.interceptors.response.use(
(response: AxiosResponse<never>) => {
(response) => {
console.log(response)
switch (response.data.code) {
case 200:
......@@ -120,27 +111,43 @@ class Http {
)
}
/* GET 方法 */
// eslint-disable-next-line no-unreachable
get(url: string, params?: object, _object = {}): Promise<never> {
/**
* GET 方法
* @param url
* @param [params]
* @param [_object]
*/
get (url, params, _object = {}) {
return this.service.get(url, { params, ..._object })
}
/* POST 方法 */
// eslint-disable-next-line no-unreachable
post(url: string, params?: object, _object = {}): Promise<never> {
/**
* POST 方法
* @param url
* @param [params]
* @param [_object]
*/
post (url, params, _object = {}) {
return this.service.post(url, params, _object)
}
/* PUT 方法 */
// eslint-disable-next-line no-unreachable
put(url: string, params?: object, _object = {}): Promise<never> {
/**
* PUT 方法
* @param url
* @param [params]
* @param [_object]
*/
put (url, params, _object = {}) {
return this.service.put(url, params, _object)
}
/* DELETE 方法 */
// eslint-disable-next-line no-unreachable
delete(url: string, params?: never, _object = {}): Promise<never> {
/**
* DELETE 方法
* @param url
* @param [params]
* @param [_object]
*/
delete (url, params, _object = {}) {
return this.service.delete(url, { params, ..._object })
}
}
......
......@@ -3,6 +3,6 @@ import Http from '../http'
/**
* 保存质检、变更状态
*/
export const saveStatus = function (url: string, data: object) {
export const saveStatus = function (url, data) {
return Http.post(url, data)
}
......@@ -5,7 +5,7 @@ import Http from '../http'
* @param url
* @param data
*/
export const getLcInfo = function (url: string, data: object) {
export const getLcInfo = function (url, data) {
return Http.get(url, data)
}
......@@ -14,7 +14,7 @@ export const getLcInfo = function (url: string, data: object) {
* @param url
* @param data
*/
export const getConfigInfo = function (url: string, data: object) {
export const getConfigInfo = function (url, data) {
return Http.get(url, data)
}
......@@ -23,6 +23,6 @@ export const getConfigInfo = function (url: string, data: object) {
* @param url
* @param data
*/
export const getZjDataFromDB = function (url: string, data: object) {
export const getZjDataFromDB = function (url, data) {
return Http.get(url, data)
}
......@@ -4,11 +4,11 @@ import Http from '../http'
* @param code 一个字符串,代表要获取的 JSON 文件的名称(不包含扩展名)。
* @returns 返回一个 Promise 对象,它解析为从指定路径加载的 JSON 数据。
*/
export const getJsonCode = function (code: string) {
export const getJsonCode = function (code) {
// 使用 Http.get 方法请求指定路径的 JSON 数据
return Http.get(`/src/data/${code}.json`)
}
export const getList = function (url: string) {
export const getList = function (url) {
return Http.get(`/src/data/${url}.json`)
}
import Http from '../http'
export const login = function (loginForm: any) {
export const login = function (loginForm) {
return Http.post('/user/login', loginForm)
}
//登录验证码
// 登录验证码
export const verificationImg = function () {
return Http.get('/login/verificationImg')
}
//登录二维码
// 登录二维码
export const loginQrcode = function () {
return Http.get('/login/loginQrcode')
}
......
......@@ -2,8 +2,6 @@ import { createApp } from 'vue'
import Router from './router'
import Store from './store'
import './style.css'
import Layui from '@layui/layui-vue'
import '@layui/layui-vue/lib/index.css'
import App from './App.vue'
// 引入iconfont
......@@ -12,10 +10,8 @@ import '@/assets/iconfont/iconfont.css'
const env = import.meta.env
const app = createApp(App)
app.use(Store)
app.use(Router)
app.use(Layui)
app.mount('#app')
import { createRouter, createWebHashHistory, NavigationGuardNext, RouteLocationNormalized } from 'vue-router'
import { createRouter, createWebHashHistory } from 'vue-router'
import routes from './module/basicRoutes'
const router = createRouter({
......@@ -16,7 +16,7 @@ const router = createRouter({
* @param to 目标
* @param from 来至
*/
router.beforeEach((to: RouteLocationNormalized, from: RouteLocationNormalized, next: NavigationGuardNext) => {
router.beforeEach((to, from, next) => {
if (to.meta.requireAuth) {
next()
} else if (to.matched.length === 0) {
......
/**
* 获取数据差异
*
* @param arr1 数组
* @param arr2 数组
* @param {any[]} arr1 数组
* @param {any[]} arr2 数组
*/
const diff = function (arr1: any[], arr2: any[]) {
const diff = function (arr1, arr2) {
arr1 = Array.from(new Set(arr1))
arr2 = Array.from(new Set(arr2))
const mergeArr = arr1.concat(arr2)
......
import mitt from 'mitt'
import Mitt from 'mitt'
const emitter = new mitt()
const emitter = new Mitt()
export default emitter
......@@ -4,7 +4,7 @@
* @param list 集合
* @param id 节点编号
*/
export const getNode = function (list: any[], id: string): any {
export const getNode = function (list, id) {
for (const i in list) {
const item = list[i]
if (item.id === id) {
......@@ -26,7 +26,7 @@ export const getNode = function (list: any[], id: string): any {
* @param list 集合
* @param id 节点编号
*/
export const getParents = function (list: any[], id: string): any {
export const getParents = function (list, id) {
for (const i in list) {
if (list[i].id === id) {
return [list[i]]
......
......@@ -7,12 +7,20 @@
>
<template #extra>
<lay-button>刷新</lay-button>
<lay-button type="primary">返回</lay-button>
<lay-button type="primary">
返回
</lay-button>
</template>
</lay-exception>
</lay-card>
</template>
<script setup>
defineOptions({
name: '401Page'
})
</script>
<style>
.error-page {
padding-top: 200px;
......
......@@ -7,12 +7,20 @@
>
<template #extra>
<lay-button>刷新</lay-button>
<lay-button type="primary">返回</lay-button>
<lay-button type="primary">
返回
</lay-button>
</template>
</lay-exception>
</lay-card>
</template>
<script setup>
defineOptions({
name: '403Page'
})
</script>
<style>
.error-page {
padding-top: 200px;
......
......@@ -7,12 +7,20 @@
>
<template #extra>
<lay-button>刷新</lay-button>
<lay-button type="primary">返回</lay-button>
<lay-button type="primary">
返回
</lay-button>
</template>
</lay-exception>
</lay-card>
</template>
<script setup>
defineOptions({
name: '404Page'
})
</script>
<style>
.error-page {
padding-top: 200px;
......
......@@ -7,12 +7,20 @@
>
<template #extra>
<lay-button>刷新</lay-button>
<lay-button type="primary">返回</lay-button>
<lay-button type="primary">
返回
</lay-button>
</template>
</lay-exception>
</lay-card>
</template>
<script setup>
defineOptions({
name: '500Page'
})
</script>
<style>
.error-page {
padding-top: 200px;
......
......@@ -5,109 +5,182 @@
全国<span>15.46</span>亿亩
</div>
<div class="personal-div">
<i class="iconfont icon-widget-user"></i>
<i class="iconfont icon-widget-user" />
<span>个人中心</span>
</div>
</header>
<main class="main">
<!-- 地图 -->
<div class="map-container"></div>
<div class="map-container" />
<!-- 资源目录最小化 -->
<div class="resource-min" v-show="resourceIsFold" @click="resourceIsFold = false" title="展开资源目录">
<i class="iconfont icon-widget-layer1"></i>
<div
v-show="resourceIsFold"
class="resource-min"
title="展开资源目录"
@click="resourceIsFold = false"
>
<i class="iconfont icon-widget-layer1" />
</div>
<!-- 资源目录 -->
<div class="resource-panel" v-show="!resourceIsFold">
<div
v-show="!resourceIsFold"
class="resource-panel"
>
<div class="panel-title">
<i class="iconfont icon-widget-layer1"></i>
<i class="iconfont icon-widget-layer1" />
<span>资源目录</span>
<div class="fold-btn" @click="resourceIsFold = true" title="收起">
<i class="iconfont icon-widget-menufold"></i>
<div
class="fold-btn"
title="收起"
@click="resourceIsFold = true"
>
<i class="iconfont icon-widget-menufold" />
</div>
</div>
<div class="panel-body">
<lay-input suffix-icon="layui-icon-search" size="sm"> </lay-input>
<lay-input
suffix-icon="layui-icon-search"
size="sm"
/>
<div class="list-box">
<div class="list-item" v-for="(item) in resourceData" :key="item.id">
<lay-checkbox :name="item.id" skin="primary" v-model="item.status" value="" :label="item.name"></lay-checkbox>
<div
v-for="(item) in resourceData"
:key="item.id"
class="list-item"
>
<lay-checkbox
v-model="item.status"
:name="item.id"
skin="primary"
value=""
:label="item.name"
/>
</div>
</div>
</div>
</div>
<!-- 图例最小化 -->
<div class="lengend-min" v-show="lengendIsFold" @click="lengendIsFold = false" title="展开图例">
<i class="iconfont icon-widget-mulu"></i>
<div
v-show="lengendIsFold"
class="lengend-min"
title="展开图例"
@click="lengendIsFold = false"
>
<i class="iconfont icon-widget-mulu" />
</div>
<div class="lengend-panel" v-show="!lengendIsFold">
<div
v-show="!lengendIsFold"
class="lengend-panel"
>
<div class="panel-title">
<i class="iconfont icon-widget-mulu"></i>
<i class="iconfont icon-widget-mulu" />
<span>图例</span>
<div class="fold-btn" @click="lengendIsFold = true" title="收起">
<i class="iconfont icon-widget-menufold"></i>
<div
class="fold-btn"
title="收起"
@click="lengendIsFold = true"
>
<i class="iconfont icon-widget-menufold" />
</div>
</div>
<div class="panel-body">
<ul class="list-box">
<li class="list-item">
<!-- -->
<div class="lengend-yh"></div>
<div class="lengend-title">永久基本农田</div>
<div class="lengend-yh" />
<div class="lengend-title">
永久基本农田
</div>
</li>
<li class="list-item">
<div class="lengend-yhselected"></div>
<div class="lengend-title">选中永久基本农田图斑</div>
<div class="lengend-yhselected" />
<div class="lengend-title">
选中永久基本农田图斑
</div>
</li>
<li class="list-item">
<div class="lengend-xzqh"></div>
<div class="lengend-title">行政区划范围</div>
<div class="lengend-xzqh" />
<div class="lengend-title">
行政区划范围
</div>
</li>
<li class="list-item">
<div class="lengend-zdy"></div>
<div class="lengend-title">自定义范围</div>
<div class="lengend-zdy" />
<div class="lengend-title">
自定义范围
</div>
</li>
</ul>
</div>
</div>
<!-- 工具栏 -->
<div class="map-tools">
<div class="tools-arrow-part" @click="toolIsFold = !toolIsFold" :title="!toolIsFold ? '收起' : '展开'">
<i class="iconfont" :class="!toolIsFold ? 'icon-widget-move-right' : 'icon-widget-move-left'"></i>
<div
class="tools-arrow-part"
:title="!toolIsFold ? '收起' : '展开'"
@click="toolIsFold = !toolIsFold"
>
<i
class="iconfont"
:class="!toolIsFold ? 'icon-widget-move-right' : 'icon-widget-move-left'"
/>
</div>
<div class="tool-part-box" v-show="!toolIsFold">
<div
v-show="!toolIsFold"
class="tool-part-box"
>
<div class="tool-part">
<i class="iconfont icon-widget-info-query"></i>
<i class="iconfont icon-widget-info-query" />
<span>查询</span>
</div>
<lay-line direction="vertical" theme="black"></lay-line>
<lay-line
direction="vertical"
theme="black"
/>
<div class="tool-part">
<i class="iconfont icon-widget-location1"></i>
<i class="iconfont icon-widget-location1" />
<span>点定位</span>
</div>
<lay-line direction="vertical" theme="black"></lay-line>
<lay-line
direction="vertical"
theme="black"
/>
<div class="tool-part">
<i class="iconfont icon-widget-guanxianchaxun-duobianxing"></i>
<i class="iconfont icon-widget-guanxianchaxun-duobianxing" />
<span>面定位</span>
</div>
<lay-line direction="vertical" theme="black"></lay-line>
<lay-line
direction="vertical"
theme="black"
/>
<div class="tool-part">
<i class="iconfont icon-widget-huizhi"></i>
<i class="iconfont icon-widget-huizhi" />
<span>绘制范围</span>
</div>
<lay-line direction="vertical" theme="black"></lay-line>
<lay-line
direction="vertical"
theme="black"
/>
<div class="tool-part">
<i class="iconfont icon-widget-hand-point"></i>
<i class="iconfont icon-widget-hand-point" />
<span>点选</span>
</div>
<lay-line direction="vertical" theme="black"></lay-line>
<lay-line
direction="vertical"
theme="black"
/>
<div class="tool-part">
<i class="iconfont icon-widget-map-full"></i>
<i class="iconfont icon-widget-map-full" />
<span>全幅</span>
</div>
<lay-line direction="vertical" theme="black"></lay-line>
<lay-line
direction="vertical"
theme="black"
/>
<div class="tool-part">
<i class="iconfont icon-widget-celiang"></i>
<i class="iconfont icon-widget-celiang" />
<span>测距</span>
</div>
</div>
......@@ -115,46 +188,79 @@
<!-- 行政区村庄等输入框下拉框 -->
<div class="input-box">
<lay-cascader :options="cascaderOptions" v-model="regionData" :onlyLastLevel="true" allow-clear placeholder="请选择行政区"
:replaceFields="replaceFields" contentClass="cascaderClass" size="sm"
contentStyle="--global-checked-color: #2c5f9e"></lay-cascader>
<lay-input suffix-icon="layui-icon-search" size="sm" placeholder="请输入村庄名称、图斑编号" :allow-clear="true"
@input="villageSearch"> </lay-input>
<lay-cascader
v-model="regionData"
:options="cascaderOptions"
:only-last-level="true"
allow-clear
placeholder="请选择行政区"
:replace-fields="replaceFields"
content-class="cascaderClass"
size="sm"
content-style="--global-checked-color: #2c5f9e"
/>
<lay-input
suffix-icon="layui-icon-search"
size="sm"
placeholder="请输入村庄名称、图斑编号"
:allow-clear="true"
@input="villageSearch"
/>
</div>
<!-- 地图类型 -->
<div class="map-type" @mouseenter="mapTypeIsExpand = true" @mouseleave="mapTypeIsExpand = false">
<div
class="map-type"
@mouseenter="mapTypeIsExpand = true"
@mouseleave="mapTypeIsExpand = false"
>
<ul class="list-box">
<li class="list-item" :class="selectIndex == index ? 'active' : ''" v-for="(item, index) in mapTypeData" :key="index"
<li
v-for="(item, index) in mapTypeData"
:key="index"
class="list-item"
:class="selectIndex == index ? 'active' : ''"
:style="mapTypeIsExpand ? `right:${(mapTypeData.length - index - 1) * 96}px` : `right:${(mapTypeData.length - index - 1) * 10}px`"
@click="toSelectDt(index)"
:style="mapTypeIsExpand ? `right:${(mapTypeData.length - index - 1) * 96}px` : `right:${(mapTypeData.length - index - 1) * 10}px`">
<img :src="item.imgUrl" alt="">
>
<img
:src="item.imgUrl"
alt=""
>
<div class="top-check">
<lay-checkbox name="sc" skin="primary" v-model="item.isCheck" value="" :label="item.label"></lay-checkbox>
<lay-checkbox
v-model="item.isCheck"
name="sc"
skin="primary"
value=""
:label="item.label"
/>
</div>
<p class="detail-info">{{ item.title }}</p>
<p class="detail-info">
{{ item.title }}
</p>
</li>
</ul>
</div>
</main>
</template>
<script setup lang="ts">
import { reactive, ref, toRefs } from "vue";
import { getList } from "../../api/module/main";
<script setup>
import { reactive, ref, toRefs } from 'vue'
import { getList } from '../../api/module/main'
const imgUrl1 = new URL('../../assets/img/dt.png', import.meta.url).href
const imgUrl2 = new URL('../../assets/img/yx.png', import.meta.url).href
// 工具栏是否展开
const toolIsFold = ref(false);
const toolIsFold = ref(false)
// 资源目录是否展开
const resourceIsFold = ref(false);
const resourceIsFold = ref(false)
// 图例是否展开
const lengendIsFold = ref(false);
const lengendIsFold = ref(false)
// 影像图
const openCollect = ref(false);
const openCollect = ref(false)
const openLw = ref(false);
const openLw = ref(false)
// 选择行政区
const regionData = ref();
const regionData = ref()
// 替换主要字段
const replaceFields = {
label: 'name',
......@@ -162,66 +268,83 @@ const replaceFields = {
children: 'areaList'
}
// 资源目录 interface 类型
interface resourceItemType {
id: string;
name: string;
status: boolean
}
// 级联菜单 interface 子类型
interface cascaders {
name: string;
code: string;
}
// 级联菜单 interface 类型
interface cascadersItemType {
name: string;
code: string;
areaList: cascaders[]
}
/**
* 资源目录 interface 类型
*
* @typedef {Object} resourceItemType
* @property {string} id - id
* @property {string} name - 名称
* @property {boolean} status - 状态
*/
/**
* 级联菜单 interface 子类型
*
* @typedef {Object} cascaders
*
* @property {string} name - 名称
* @property {string} code - code
*/
/**
* 级联菜单 interface 类型
*
* @typedef {Object} cascadersItemType
*
* @property {string} name - 名称
* @property {string} code - code
* @property {cascaders[]} areaList - 子级
*/
/**
* @type {{
* resourceData: resourceItemType[],
* cascaderOptions: cascadersItemType[]
* }}
*/
const state = reactive({
resourceData: [] as resourceItemType[],
cascaderOptions: [] as cascadersItemType[]
resourceData: [],
cascaderOptions: []
})
const {
resourceData,
cascaderOptions
} = toRefs(state)
// 获取资源目录列表
getList('resourceData').then((res: any) => {
getList('resourceData').then((res) => {
console.log(res)
state.resourceData = res.data
})
// 获取省市区
getList('china').then((res: any) => {
getList('china').then((res) => {
console.log(res)
state.cascaderOptions = res.data
})
// 村庄搜索
const villageSearch = function (val: string) {
console.log("当前值:" + val)
const villageSearch = function (val) {
console.log('当前值:' + val)
}
// 地图类型
const mapTypeIsExpand = ref(false);
const mapTypeIsExpand = ref(false)
const mapTypeData = reactive([
{
imgUrl: imgUrl1,
label: "显示收藏点",
label: '显示收藏点',
isCheck: false,
title: "地图"
title: '地图'
},
{
imgUrl: imgUrl2,
label: "开启路网",
label: '开启路网',
isCheck: false,
title: "影像"
title: '影像'
}
])
// 地图默认选中第二个
let selectIndex = ref(1);
const toSelectDt = function (index: number) {
selectIndex.value = index;
const selectIndex = ref(1)
const toSelectDt = function (index) {
selectIndex.value = index
}
</script>
......@@ -341,7 +464,6 @@ const toSelectDt = function (index: number) {
.list-item {
line-height: 30px;
:deep(.layui-form-checkbox[lay-skin="primary"]:hover) i {
border-color: #2c5f9e;
color: #fff;
......
/// <reference types="vite/client" />
{
"compilerOptions": {
"target": "ESNext",
"jsx": "preserve",
"jsxImportSource": "vue",
"lib": ["DOM", "ESNext"],
"baseUrl": ".",
"module": "ESNext",
"moduleResolution": "node",
"paths": {
"@/*": ["src/*"]
},
"resolveJsonModule": true,
"types": [
"vitest",
"vite/client",
"vite-plugin-pwa/vue"
],
"allowJs": true,
"strict": true,
"strictNullChecks": true,
"noUnusedLocals": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"isolatedModules": true,
"skipLibCheck": true
},
"exclude": ["dist", "node_modules", "cypress"]
}
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import AutoImport from 'unplugin-auto-import/vite'
import Components from 'unplugin-vue-components/vite'
import { LayuiVueResolver } from 'unplugin-vue-components/resolvers'
import VueDevTools from 'vite-plugin-vue-devtools'
import path from 'path'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [vue()],
plugins: [
vue(),
VueDevTools(),
AutoImport({
resolvers: [LayuiVueResolver()],
imports: [
'vue',
'pinia',
'vue-router'
],
dirs: [
'./src/utils'
],
eslintrc: {
enabled: true
},
vueTemplate: true
}),
Components({
resolvers: [LayuiVueResolver()]
})
],
resolve: {
alias: {
'@': path.resolve(__dirname, 'src')
}
},
css: {
preprocessorOptions: {
scss: { charset: false },
less: {
javascriptEnabled: true
}
}
},
server: {
port: 3000,
cors: true,
proxy: {}
},
build: {
outDir: path.resolve(__dirname, '../dist')
},
envDir: path.resolve(__dirname, 'env')
})
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论