Skip to content

Commit

Permalink
Merge pull request #83 from AnsGoo/dev
Browse files Browse the repository at this point in the history
fix: fix type error
  • Loading branch information
AnsGoo authored Aug 20, 2023
2 parents 9648819 + 7d3636f commit 7105ebc
Show file tree
Hide file tree
Showing 134 changed files with 1,497 additions and 1,573 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ VITE_APP_PROXY=[["/api","http://localhost:9900"]]
VITE_APP_BASE_URL=''

# 路由模式:hash 或者 history
VITE_ROUER_MODE='hash'
VITE_ROUTER_MODE='hash'

# Token 键
VITE_AUTH_TOKEN='Token'
Expand Down
2 changes: 1 addition & 1 deletion .env.development
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ VITE_APP_PROXY=[["/api","http://localhost:9900"]]
VITE_APP_BASE_URL='/'

# 路由模式:hash 或者 history
VITE_ROUER_MODE='hash'
VITE_ROUTER_MODE='hash'

# Token 键
VITE_AUTH_TOKEN='Token'
Expand Down
2 changes: 1 addition & 1 deletion .env.production
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ VITE_APP_PROXY=[["/api","http://localhost:9900"]]
VITE_APP_BASE_URL='/'

# 路由模式:hash 或者 history
VITE_ROUER_MODE='hash'
VITE_ROUTER_MODE='hash'

# Token 键
VITE_AUTH_TOKEN='Token'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
import type { SelectOption } from 'naive-ui'
import { NButton, NInput, NInputGroup, NSelect } from 'naive-ui'
import { StaticKey, useEventBus } from 'open-data-v'
import StaticContent from 'open-data-v/data/static/DataView.vue'
import { StaticContent } from 'open-data-v/data/static'
import { onMounted, reactive, ref, watch } from 'vue'
import type { StaticDataDetail } from '@/api/data'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ import { NButton, NCard, NFormItem, NInput, NInputGroup, NModal } from 'naive-ui
import type { Slotter } from 'open-data-v/data'
import { onMounted, reactive, ref, watch } from 'vue'
import StaticContent from './Content.vue'
import DataHandler, { QUICK_TYPE } from './handler'
import StaticContent from './Quick.vue'
const props = defineProps<{
slotter: Slotter
Expand Down
2 changes: 1 addition & 1 deletion examples/data/Quick/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { shallowRef } from 'vue'

import handler, { QUICK_TYPE } from './handler'
import Quick from './View.vue'
import Quick from './Pane.vue'

export default {
type: QUICK_TYPE,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<Rest v-model:options="formData" @update:rest-options="formChange" @change="formChange">
<RestContent v-model:options="formData" @update:rest-options="formChange" @change="formChange">
<template #data-select>
<n-select
:options="restDataList"
Expand All @@ -21,18 +21,22 @@
</n-button-group>
</n-space>
</template>
</Rest>
</RestContent>
</template>
<script setup lang="ts">
import type { AxiosResponse } from 'axios'
import type { SelectOption } from 'naive-ui'
import { NButton, NButtonGroup, NInput, NSelect, NSpace } from 'naive-ui'
import { StaticKey, useEventBus } from 'open-data-v'
import { useRequest } from 'open-data-v/data/hooks/http'
import { RequestMethod } from 'open-data-v/data/rest/requestEnums'
import Rest from 'open-data-v/data/rest/Rest.vue'
import type { RequestResponse, RestOption } from 'open-data-v/data/rest/type'
import { KVToRecordable, recordabletoKV, requestOptionsToStore } from 'open-data-v/data/rest/utils'
import type { RestOption, RestResponse } from 'open-data-v/data/rest'
import {
KVToRecordable,
recordabletoKV,
RequestMethod,
requestOptionsToStore,
RestContent
} from 'open-data-v/data/rest'
import { onMounted, reactive, ref } from 'vue'
import {
Expand Down Expand Up @@ -163,7 +167,7 @@ interface RequestDataOption extends RestOption {
id?: string
}
const formData = reactive<RequestDataOption>(props.options)
const response = ref<RequestResponse>({
const response = ref<RestResponse>({
status: 0,
data: '',
headers: {}
Expand Down
8 changes: 4 additions & 4 deletions examples/data/Rest/View.vue → examples/data/Rest/Pane.vue
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<template>
<RestView :slotter="slotter">
<RestPane :slotter="slotter">
<DataViewSlot />
</RestView>
</RestPane>
</template>

<script lang="ts" setup>
import type { Slotter } from 'open-data-v/data'
import RestView from 'open-data-v/data/rest/View.vue'
import { RestPane } from 'open-data-v/data/rest'
import DataViewSlot from './DynamicExtendView.vue'
import DataViewSlot from './DynamicExtendContent.vue'
defineProps<{
slotter: Slotter
Expand Down
5 changes: 2 additions & 3 deletions examples/data/Rest/index.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import handler from 'open-data-v/data/rest/handler'
import { RequestMethod } from 'open-data-v/data/rest/requestEnums'
import { handler, RequestMethod } from 'open-data-v/data/rest'
import { shallowRef } from 'vue'

import { uuid } from '@/utils/utils'

import DataView from './View.vue'
import DataView from './Pane.vue'

export default {
type: 'REST',
Expand Down
2 changes: 1 addition & 1 deletion examples/layout/components/Menu/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<script lang="ts" setup>
import type { MenuOption } from 'naive-ui'
import { NMenu } from 'naive-ui'
import XIcon from 'open-data-v/designer/components/xicon/XIcon.vue'
import { XIcon } from 'open-data-v/designer'
import { computed, h, onMounted, ref, watch } from 'vue'
import { RouterLink, useRoute } from 'vue-router'
Expand Down
5 changes: 0 additions & 5 deletions examples/pages/ApiView/DataHistory/static/Static.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
<n-li
v-for="item in dataHistory"
:key="item.id"
v-contextmenu="() => dataHistoryContextMenus(item.id)"
class="data-item"
@click="selectDataItem(item.id)"
><n-space>{{ item.name }}</n-space></n-li
Expand Down Expand Up @@ -82,10 +81,6 @@ const dataListContextMenus = (id: string): Optional<ContextmenuItem[]> => {
}
]
}
const dataHistoryContextMenus = (_: string): Optional<ContextmenuItem[]> => {
return []
}
</script>
<style lang="less">
.data-item {
Expand Down
8 changes: 4 additions & 4 deletions examples/pages/ApiView/View.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Rest from 'open-data-v/data/rest/Rest.vue'
import Static from 'open-data-v/data/static/DataView.vue'
import { RestContent } from 'open-data-v/data/rest'
import { StaticContent } from 'open-data-v/data/static'
import { defineComponent } from 'vue'

export default defineComponent({
Expand All @@ -12,9 +12,9 @@ export default defineComponent({
setup(props) {
return () => {
if (props.active == 'REST') {
return <Rest mode="debug" />
return <RestContent mode="debug" />
} else if (props.active == 'STATIC') {
return <Static mode="debug" />
return <StaticContent mode="debug" />
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion examples/pages/Pages.vue
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
<script setup lang="ts">
import type { DropdownOption } from 'naive-ui'
import { NButton, NCard, NDropdown, NEllipsis, NTooltip } from 'naive-ui'
import XIcon from 'open-data-v/designer/components/xicon/XIcon.vue'
import { XIcon } from 'open-data-v/designer'
import { h, onMounted, ref } from 'vue'
import { useRouter } from 'vue-router'
Expand Down
2 changes: 1 addition & 1 deletion examples/router/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class RouteView {

// 根据环境变量中的配置生成路由模式
private createHistory = (): RouterHistory => {
if (import.meta.env.VITE_ROUER_MODE === RouteMode.HISTORY) {
if (import.meta.env.VITE_ROUTER_MODE === RouteMode.HISTORY) {
return createWebHistory()
} else {
return createWebHashHistory()
Expand Down
2 changes: 1 addition & 1 deletion examples/types/env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ declare namespace layer {}
interface ImportMetaEnv {
readonly VITE_APP_TITLE: string
readonly VITE_APP_PORT: string
readonly VITE_ROUER_MODE: string
readonly VITE_ROUTER_MODE: string
readonly VITE_APP_BASE_URL: string
readonly VITE_AUTH_TOKEN: string
readonly VITE_TOKEN_STORAGE: string
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@
"stylelint": "^15.10.3",
"stylelint-config-recommended-vue": "^1.5.0",
"tailwindcss": "^3.3.3",
"typescript": "^5.1.6",
"vite": "4.2.3",
"typescript": "^4.9.5",
"vite": "^4.4.9",
"vite-plugin-vue-markdown": "^0.22.6",
"vue-eslint-parser": "^7.11.0",
"vue-tsc": "^1.8.8"
Expand Down
Loading

0 comments on commit 7105ebc

Please sign in to comment.