chore: 升级 wot-design-uni 到 @wot-ui/ui v2.0.8
重大变更: - 升级 UI 组件库从 wot-design-uni@1.14.0 到 @wot-ui/ui@2.0.8 - 新增 dayjs@1.11.13 作为独立依赖 组件迁移: - wd-message-box → wd-dialog (3个文件) - wd-status-tip → wd-empty (10个文件) - wd-col-picker → wd-cascader (3个文件) API 变更: - useMessage → useDialog (12个文件) - 所有导入路径从 wot-design-uni 更新为 @wot-ui/ui - dayjs 改为独立导入 配置更新: - vite.config.ts: 自定义 WotUIResolver 替代 WotResolver - tsconfig.json: 更新类型声明路径 - components.d.ts: 更新所有组件类型路径 影响范围: - 修改文件: 33个 - 布局文件: 2个 - 页面文件: 21个 - 组件文件: 1个 - 配置文件: 4个 - 类型文件: 2个 Breaking Changes: - Dialog 的 closeOnClickModal 默认值从 true 改为 false - Prompt 返回值从 res 改为 res.value - Empty 的 image 属性改为 icon - Cascader 的 columns 建议改为 options(向后兼容)
This commit is contained in:
7
.gitignore
vendored
7
.gitignore
vendored
@@ -24,3 +24,10 @@ dist
|
||||
launch.json
|
||||
.hbuilderx
|
||||
pnpm-lock.yaml
|
||||
|
||||
|
||||
.claude/
|
||||
.cursor/
|
||||
.windsurf/
|
||||
.agents/
|
||||
skills-lock.json
|
||||
85
components.d.ts
vendored
85
components.d.ts
vendored
@@ -10,7 +10,6 @@ declare module 'vue' {
|
||||
CuDateQuery: typeof import('./src/components/cu-date-query/index.vue')['default']
|
||||
CustomNavbar: typeof import('./src/components/custom-navbar/index.vue')['default']
|
||||
CustomTree: typeof import('./src/components/custom-tree/index.vue')['default']
|
||||
EmptyState: typeof import('./src/components/empty-state/index.vue')['default']
|
||||
Loading1: typeof import('./src/components/qiun-loading/loading1.vue')['default']
|
||||
Loading2: typeof import('./src/components/qiun-loading/loading2.vue')['default']
|
||||
Loading3: typeof import('./src/components/qiun-loading/loading3.vue')['default']
|
||||
@@ -19,49 +18,45 @@ declare module 'vue' {
|
||||
QiunDataCharts: typeof import('./src/components/qiun-data-charts/qiun-data-charts.vue')['default']
|
||||
QiunError: typeof import('./src/components/qiun-error/qiun-error.vue')['default']
|
||||
QiunLoading: typeof import('./src/components/qiun-loading/qiun-loading.vue')['default']
|
||||
WdActionSheet: typeof import('wot-design-uni/components/wd-action-sheet/wd-action-sheet.vue')['default']
|
||||
WdBadge: typeof import('wot-design-uni/components/wd-badge/wd-badge.vue')['default']
|
||||
WdButton: typeof import('wot-design-uni/components/wd-button/wd-button.vue')['default']
|
||||
WdCalendar: typeof import('wot-design-uni/components/wd-calendar/wd-calendar.vue')['default']
|
||||
WdCard: typeof import('wot-design-uni/components/wd-card/wd-card.vue')['default']
|
||||
WdCascader: typeof import('wot-design-uni/components/wd-cascader/wd-cascader.vue')['default']
|
||||
WdCell: typeof import('wot-design-uni/components/wd-cell/wd-cell.vue')['default']
|
||||
WdCellGroup: typeof import('wot-design-uni/components/wd-cell-group/wd-cell-group.vue')['default']
|
||||
WdCheckbox: typeof import('wot-design-uni/components/wd-checkbox/wd-checkbox.vue')['default']
|
||||
WdCollapse: typeof import('wot-design-uni/components/wd-collapse/wd-collapse.vue')['default']
|
||||
WdCollapseItem: typeof import('wot-design-uni/components/wd-collapse-item/wd-collapse-item.vue')['default']
|
||||
WdColPicker: typeof import('wot-design-uni/components/wd-col-picker/wd-col-picker.vue')['default']
|
||||
WdConfigProvider: typeof import('wot-design-uni/components/wd-config-provider/wd-config-provider.vue')['default']
|
||||
WdDivider: typeof import('wot-design-uni/components/wd-divider/wd-divider.vue')['default']
|
||||
WdDropMenu: typeof import('wot-design-uni/components/wd-drop-menu/wd-drop-menu.vue')['default']
|
||||
WdDropMenuItem: typeof import('wot-design-uni/components/wd-drop-menu-item/wd-drop-menu-item.vue')['default']
|
||||
WdEmpty: typeof import('wot-design-uni/components/wd-empty/wd-empty.vue')['default']
|
||||
WdFab: typeof import('wot-design-uni/components/wd-fab/wd-fab.vue')['default']
|
||||
WdForm: typeof import('wot-design-uni/components/wd-form/wd-form.vue')['default']
|
||||
WdGrid: typeof import('wot-design-uni/components/wd-grid/wd-grid.vue')['default']
|
||||
WdGridItem: typeof import('wot-design-uni/components/wd-grid-item/wd-grid-item.vue')['default']
|
||||
WdIcon: typeof import('wot-design-uni/components/wd-icon/wd-icon.vue')['default']
|
||||
WdImgCropper: typeof import('wot-design-uni/components/wd-img-cropper/wd-img-cropper.vue')['default']
|
||||
WdInput: typeof import('wot-design-uni/components/wd-input/wd-input.vue')['default']
|
||||
WdInputNumber: typeof import('wot-design-uni/components/wd-input-number/wd-input-number.vue')['default']
|
||||
WdLoading: typeof import('wot-design-uni/components/wd-loading/wd-loading.vue')['default']
|
||||
WdLoadmore: typeof import('wot-design-uni/components/wd-loadmore/wd-loadmore.vue')['default']
|
||||
WdMessageBox: typeof import('wot-design-uni/components/wd-message-box/wd-message-box.vue')['default']
|
||||
WdNotify: typeof import('wot-design-uni/components/wd-notify/wd-notify.vue')['default']
|
||||
WdPopup: typeof import('wot-design-uni/components/wd-popup/wd-popup.vue')['default']
|
||||
WdRadio: typeof import('wot-design-uni/components/wd-radio/wd-radio.vue')['default']
|
||||
WdRadioGroup: typeof import('wot-design-uni/components/wd-radio-group/wd-radio-group.vue')['default']
|
||||
WdSearch: typeof import('wot-design-uni/components/wd-search/wd-search.vue')['default']
|
||||
WdSelectPicker: typeof import('wot-design-uni/components/wd-select-picker/wd-select-picker.vue')['default']
|
||||
WdStatusTip: typeof import('wot-design-uni/components/wd-status-tip/wd-status-tip.vue')['default']
|
||||
WdSwiper: typeof import('wot-design-uni/components/wd-swiper/wd-swiper.vue')['default']
|
||||
WdSwitch: typeof import('wot-design-uni/components/wd-switch/wd-switch.vue')['default']
|
||||
WdTab: typeof import('wot-design-uni/components/wd-tab/wd-tab.vue')['default']
|
||||
WdTabbar: typeof import('wot-design-uni/components/wd-tabbar/wd-tabbar.vue')['default']
|
||||
WdTabbarItem: typeof import('wot-design-uni/components/wd-tabbar-item/wd-tabbar-item.vue')['default']
|
||||
WdTabs: typeof import('wot-design-uni/components/wd-tabs/wd-tabs.vue')['default']
|
||||
WdTag: typeof import('wot-design-uni/components/wd-tag/wd-tag.vue')['default']
|
||||
WdTextarea: typeof import('wot-design-uni/components/wd-textarea/wd-textarea.vue')['default']
|
||||
WdToast: typeof import('wot-design-uni/components/wd-toast/wd-toast.vue')['default']
|
||||
WdActionSheet: typeof import('@wot-ui/ui/components/wd-action-sheet/wd-action-sheet.vue')['default']
|
||||
WdBadge: typeof import('@wot-ui/ui/components/wd-badge/wd-badge.vue')['default']
|
||||
WdButton: typeof import('@wot-ui/ui/components/wd-button/wd-button.vue')['default']
|
||||
WdCalendar: typeof import('@wot-ui/ui/components/wd-calendar/wd-calendar.vue')['default']
|
||||
WdCard: typeof import('@wot-ui/ui/components/wd-card/wd-card.vue')['default']
|
||||
WdCascader: typeof import('@wot-ui/ui/components/wd-cascader/wd-cascader.vue')['default']
|
||||
WdCell: typeof import('@wot-ui/ui/components/wd-cell/wd-cell.vue')['default']
|
||||
WdCellGroup: typeof import('@wot-ui/ui/components/wd-cell-group/wd-cell-group.vue')['default']
|
||||
WdCheckbox: typeof import('@wot-ui/ui/components/wd-checkbox/wd-checkbox.vue')['default']
|
||||
WdCollapse: typeof import('@wot-ui/ui/components/wd-collapse/wd-collapse.vue')['default']
|
||||
WdCollapseItem: typeof import('@wot-ui/ui/components/wd-collapse-item/wd-collapse-item.vue')['default']
|
||||
WdConfigProvider: typeof import('@wot-ui/ui/components/wd-config-provider/wd-config-provider.vue')['default']
|
||||
WdDialog: typeof import('@wot-ui/ui/components/wd-dialog/wd-dialog.vue')['default']
|
||||
WdDivider: typeof import('@wot-ui/ui/components/wd-divider/wd-divider.vue')['default']
|
||||
WdDropMenu: typeof import('@wot-ui/ui/components/wd-drop-menu/wd-drop-menu.vue')['default']
|
||||
WdDropMenuItem: typeof import('@wot-ui/ui/components/wd-drop-menu-item/wd-drop-menu-item.vue')['default']
|
||||
WdEmpty: typeof import('@wot-ui/ui/components/wd-empty/wd-empty.vue')['default']
|
||||
WdFab: typeof import('@wot-ui/ui/components/wd-fab/wd-fab.vue')['default']
|
||||
WdForm: typeof import('@wot-ui/ui/components/wd-form/wd-form.vue')['default']
|
||||
WdGrid: typeof import('@wot-ui/ui/components/wd-grid/wd-grid.vue')['default']
|
||||
WdGridItem: typeof import('@wot-ui/ui/components/wd-grid-item/wd-grid-item.vue')['default']
|
||||
WdIcon: typeof import('@wot-ui/ui/components/wd-icon/wd-icon.vue')['default']
|
||||
WdImgCropper: typeof import('@wot-ui/ui/components/wd-img-cropper/wd-img-cropper.vue')['default']
|
||||
WdInput: typeof import('@wot-ui/ui/components/wd-input/wd-input.vue')['default']
|
||||
WdInputNumber: typeof import('@wot-ui/ui/components/wd-input-number/wd-input-number.vue')['default']
|
||||
WdLoading: typeof import('@wot-ui/ui/components/wd-loading/wd-loading.vue')['default']
|
||||
WdLoadmore: typeof import('@wot-ui/ui/components/wd-loadmore/wd-loadmore.vue')['default']
|
||||
WdNotify: typeof import('@wot-ui/ui/components/wd-notify/wd-notify.vue')['default']
|
||||
WdPopup: typeof import('@wot-ui/ui/components/wd-popup/wd-popup.vue')['default']
|
||||
WdRadio: typeof import('@wot-ui/ui/components/wd-radio/wd-radio.vue')['default']
|
||||
WdRadioGroup: typeof import('@wot-ui/ui/components/wd-radio-group/wd-radio-group.vue')['default']
|
||||
WdSearch: typeof import('@wot-ui/ui/components/wd-search/wd-search.vue')['default']
|
||||
WdSelectPicker: typeof import('@wot-ui/ui/components/wd-select-picker/wd-select-picker.vue')['default']
|
||||
WdSwiper: typeof import('@wot-ui/ui/components/wd-swiper/wd-swiper.vue')['default']
|
||||
WdSwitch: typeof import('@wot-ui/ui/components/wd-switch/wd-switch.vue')['default']
|
||||
WdTabbar: typeof import('@wot-ui/ui/components/wd-tabbar/wd-tabbar.vue')['default']
|
||||
WdTabbarItem: typeof import('@wot-ui/ui/components/wd-tabbar-item/wd-tabbar-item.vue')['default']
|
||||
WdTag: typeof import('@wot-ui/ui/components/wd-tag/wd-tag.vue')['default']
|
||||
WdTextarea: typeof import('@wot-ui/ui/components/wd-textarea/wd-textarea.vue')['default']
|
||||
WdToast: typeof import('@wot-ui/ui/components/wd-toast/wd-toast.vue')['default']
|
||||
}
|
||||
}
|
||||
|
||||
@@ -92,9 +92,10 @@
|
||||
"@dcloudio/uni-quickapp-webview": "3.0.0-4020420240722002",
|
||||
"@uni-helper/uni-use": "^0.19.15",
|
||||
"@vueuse/core": "9.13.0",
|
||||
"dayjs": "^1.11.13",
|
||||
"pinia": "^2.3.1",
|
||||
"vue": "^3.5.22",
|
||||
"wot-design-uni": "^1.14.0"
|
||||
"@wot-ui/ui": "2.0.8"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@commitlint/cli": "^19.8.1",
|
||||
@@ -108,7 +109,7 @@
|
||||
"@uni-helper/uni-types": "1.0.0-alpha.6",
|
||||
"@uni-helper/vite-plugin-uni-components": "^0.2.3",
|
||||
"@uni-helper/vite-plugin-uni-layouts": "^0.1.11",
|
||||
"@uni-helper/vite-plugin-uni-pages": "^0.2.29",
|
||||
"@uni-helper/vite-plugin-uni-pages": "^0.3.24",
|
||||
"@vue/runtime-core": "^3.5.22",
|
||||
"commitizen": "^4.3.1",
|
||||
"cz-git": "^1.12.0",
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { dayjs } from "wot-design-uni";
|
||||
import dayjs from "dayjs";
|
||||
|
||||
const props = defineProps({
|
||||
modelValue: {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { ConfigProviderThemeVars } from "wot-design-uni";
|
||||
import type { ConfigProviderThemeVars } from "@wot-ui/ui";
|
||||
|
||||
/**
|
||||
* 主题色选项接口
|
||||
|
||||
@@ -21,6 +21,6 @@ export default {
|
||||
<slot />
|
||||
<wd-notify />
|
||||
<wd-toast />
|
||||
<wd-message-box />
|
||||
<wd-dialog />
|
||||
</wd-config-provider>
|
||||
</template>
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
</wd-tabbar>
|
||||
<wd-notify />
|
||||
<wd-toast />
|
||||
<wd-message-box />
|
||||
<wd-dialog />
|
||||
</wd-config-provider>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -1,5 +1,19 @@
|
||||
{
|
||||
"globalStyle": {
|
||||
"navigationBarBackgroundColor": "@navBgColor",
|
||||
"navigationBarTextStyle": "@navTxtStyle",
|
||||
"navigationBarTitleText": "youlai-app",
|
||||
"backgroundColor": "@bgColor",
|
||||
"backgroundTextStyle": "@bgTxtStyle",
|
||||
"backgroundColorTop": "@bgColorTop",
|
||||
"backgroundColorBottom": "@bgColorBottom",
|
||||
"enablePullDownRefresh": false,
|
||||
"onReachBottomDistance": 50,
|
||||
"animationType": "pop-in",
|
||||
"animationDuration": 300
|
||||
},
|
||||
"pages": [
|
||||
// GENERATED BY UNI-PAGES, PLATFORM: MP-WEIXIN
|
||||
{
|
||||
"path": "pages/index/index",
|
||||
"type": "home",
|
||||
@@ -198,19 +212,7 @@
|
||||
}
|
||||
}
|
||||
],
|
||||
"globalStyle": {
|
||||
"navigationBarBackgroundColor": "@navBgColor",
|
||||
"navigationBarTextStyle": "@navTxtStyle",
|
||||
"navigationBarTitleText": "youlai-app",
|
||||
"backgroundColor": "@bgColor",
|
||||
"backgroundTextStyle": "@bgTxtStyle",
|
||||
"backgroundColorTop": "@bgColorTop",
|
||||
"backgroundColorBottom": "@bgColorBottom",
|
||||
"enablePullDownRefresh": false,
|
||||
"onReachBottomDistance": 50,
|
||||
"animationType": "pop-in",
|
||||
"animationDuration": 300
|
||||
},
|
||||
"subPackages": [],
|
||||
"tabBar": {
|
||||
"custom": true,
|
||||
"customize": true,
|
||||
@@ -221,6 +223,7 @@
|
||||
"backgroundColor": "@tabBgColor",
|
||||
"borderStyle": "@tabBorderStyle",
|
||||
"list": [
|
||||
// GENERATED BY UNI-PAGES, PLATFORM: MP-WEIXIN
|
||||
{
|
||||
"pagePath": "pages/index/index"
|
||||
},
|
||||
@@ -231,7 +234,5 @@
|
||||
"pagePath": "pages/mine/index"
|
||||
}
|
||||
]
|
||||
},
|
||||
"__esModule": true,
|
||||
"subPackages": []
|
||||
}
|
||||
}
|
||||
|
||||
@@ -90,7 +90,7 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, ref } from "vue";
|
||||
import { onReady, onShow } from "@dcloudio/uni-app";
|
||||
import { dayjs } from "wot-design-uni";
|
||||
import dayjs from "dayjs";
|
||||
import { useRouter } from "uni-mini-router";
|
||||
import { useUserStore } from "@/store";
|
||||
import { useNavigation } from "@/composables/useNavigation";
|
||||
|
||||
@@ -236,7 +236,7 @@
|
||||
</wd-popup>
|
||||
|
||||
<!-- 协议确认弹窗 -->
|
||||
<wd-message-box selector="policy-box" root-portal>
|
||||
<wd-dialog selector="policy-box" root-portal>
|
||||
<view class="policy-dialog__content">
|
||||
请阅读并同意有来技术
|
||||
<text class="policy-dialog__link" @click.stop="navigateToAgreement('user')">
|
||||
@@ -246,7 +246,7 @@
|
||||
《隐私政策》
|
||||
</text>
|
||||
</view>
|
||||
</wd-message-box>
|
||||
</wd-dialog>
|
||||
|
||||
<wd-toast />
|
||||
</view>
|
||||
@@ -261,13 +261,13 @@
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { onLoad, onShow } from "@dcloudio/uni-app";
|
||||
import { useToast, useMessage } from "wot-design-uni";
|
||||
import { useToast, useDialog } from "@wot-ui/ui";
|
||||
import { useUserStore } from "@/store/modules/user";
|
||||
import { useCountdown } from "@/composables/useCountdown";
|
||||
import AuthAPI from "@/api/auth";
|
||||
|
||||
const toast = useToast();
|
||||
const message = useMessage("policy-box");
|
||||
const dialog = useDialog("policy-box");
|
||||
const userStore = useUserStore();
|
||||
|
||||
// 导航栏尺寸
|
||||
|
||||
@@ -162,7 +162,7 @@
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { onMounted, reactive, ref } from "vue";
|
||||
import { useToast, useMessage } from "wot-design-uni";
|
||||
import { useToast, useDialog } from "@wot-ui/ui";
|
||||
import { useCountdown } from "@/composables/useCountdown";
|
||||
import UserAPI, {
|
||||
PasswordChangeForm,
|
||||
@@ -172,7 +172,7 @@ import UserAPI, {
|
||||
} from "@/api/user";
|
||||
|
||||
const toast = useToast();
|
||||
const { messageBox } = useMessage();
|
||||
const { messageBox } = useDialog();
|
||||
|
||||
const validatorConfirmPassword = (value: string) => {
|
||||
if (!value) {
|
||||
|
||||
@@ -216,7 +216,7 @@
|
||||
<script lang="ts" setup>
|
||||
import { computed, ref } from "vue";
|
||||
import { onShow } from "@dcloudio/uni-app";
|
||||
import { useToast, useMessage } from "wot-design-uni";
|
||||
import { useToast, useDialog } from "@wot-ui/ui";
|
||||
import { useUserStore, useThemeStore } from "@/store";
|
||||
import { useRouter } from "uni-mini-router";
|
||||
import { useNavbar } from "@/composables/useNavbar";
|
||||
@@ -224,7 +224,7 @@ import { getAccessToken } from "@/utils/auth";
|
||||
import { formatBytes } from "@/utils/format";
|
||||
|
||||
const toast = useToast();
|
||||
const { messageBox } = useMessage();
|
||||
const { messageBox } = useDialog();
|
||||
|
||||
const userStore = useUserStore();
|
||||
const themeStore = useThemeStore();
|
||||
|
||||
@@ -126,7 +126,7 @@ import UserAPI, { type UserProfileForm } from "@/api/user";
|
||||
import FileAPI, { type FileInfo } from "@/api/file";
|
||||
|
||||
const toast = useToast();
|
||||
const { messageBox } = useMessage();
|
||||
const { messageBox } = useDialog();
|
||||
const userStore = useUserStore();
|
||||
|
||||
const redirect = ref("/pages/index/index");
|
||||
|
||||
@@ -35,11 +35,11 @@
|
||||
<script lang="ts" setup>
|
||||
import { useUserStore } from "@/store";
|
||||
import { onLoad } from "@dcloudio/uni-app";
|
||||
import { useToast, useMessage } from "wot-design-uni";
|
||||
import { useToast, useDialog } from "@wot-ui/ui";
|
||||
|
||||
const userStore = useUserStore();
|
||||
const toast = useToast();
|
||||
const { messageBox } = useMessage();
|
||||
const { messageBox } = useDialog();
|
||||
const isLogin = computed(() => !!userStore.userInfo);
|
||||
|
||||
// 主题设置
|
||||
|
||||
@@ -104,13 +104,13 @@
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { useTheme } from "@/composables/useTheme";
|
||||
import { useToast, useMessage } from "wot-design-uni";
|
||||
import { useToast, useDialog } from "@wot-ui/ui";
|
||||
|
||||
// 使用主题组合函数
|
||||
const { isDark, themeVars, themeColorOptions, toggleTheme, setThemeColor } = useTheme();
|
||||
|
||||
const toast = useToast();
|
||||
const { messageBox } = useMessage();
|
||||
const { messageBox } = useDialog();
|
||||
|
||||
// 创建响应式的计算属性
|
||||
const isDarkMode = computed(() => isDark.value);
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
</wd-card>
|
||||
|
||||
<wd-loadmore v-if="total > 0" :state="loadMoreState" @reload="fetchConfigList" />
|
||||
<wd-status-tip v-else-if="total === 0" image="search" tip="暂无数据" />
|
||||
<wd-empty v-else-if="total === 0" icon="search" tip="暂无数据" />
|
||||
</view>
|
||||
|
||||
<!-- 弹窗表单 -->
|
||||
@@ -92,14 +92,14 @@
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { onLoad, onReachBottom } from "@dcloudio/uni-app";
|
||||
import { LoadMoreState } from "wot-design-uni/components/wd-loadmore/types";
|
||||
import { FormRules } from "wot-design-uni/components/wd-form/types";
|
||||
import { useToast, useMessage } from "wot-design-uni";
|
||||
import { LoadMoreState } from "@wot-ui/ui/components/wd-loadmore/types";
|
||||
import { FormRules } from "@wot-ui/ui/components/wd-form/types";
|
||||
import { useToast, useDialog } from "@wot-ui/ui";
|
||||
import ConfigAPI, { type ConfigPageQuery, ConfigItem, ConfigForm } from "@/api/config";
|
||||
import { hasPermission } from "@/utils/permission";
|
||||
|
||||
const toast = useToast();
|
||||
const { messageBox } = useMessage();
|
||||
const { messageBox } = useDialog();
|
||||
const loadMoreState = ref<LoadMoreState>("loading");
|
||||
const formRef = ref();
|
||||
const isSubmitting = ref(false);
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
</template>
|
||||
</CustomTree>
|
||||
|
||||
<wd-status-tip v-if="deptList.length === 0" image="search" tip="暂无数据" />
|
||||
<wd-empty v-if="deptList.length === 0" icon="search" tip="暂无数据" />
|
||||
</view>
|
||||
|
||||
<!-- 弹窗表单 -->
|
||||
@@ -45,7 +45,7 @@
|
||||
</view>
|
||||
<wd-form ref="formRef" :model="formData" :rules="rules">
|
||||
<wd-cell-group border>
|
||||
<wd-col-picker
|
||||
<wd-cascader
|
||||
v-model="parentSelected"
|
||||
label="上级部门"
|
||||
:columns="parentColumns"
|
||||
@@ -86,14 +86,14 @@
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { onLoad } from "@dcloudio/uni-app";
|
||||
import { FormRules } from "wot-design-uni/components/wd-form/types";
|
||||
import { useToast, useMessage } from "wot-design-uni";
|
||||
import { FormRules } from "@wot-ui/ui/components/wd-form/types";
|
||||
import { useToast, useDialog } from "@wot-ui/ui";
|
||||
import DeptAPI, { type DeptQuery, DeptItem, DeptForm } from "@/api/dept";
|
||||
import { hasPermission } from "@/utils/permission";
|
||||
import CustomTree from "@/components/custom-tree/index.vue";
|
||||
|
||||
const toast = useToast();
|
||||
const { messageBox } = useMessage();
|
||||
const { messageBox } = useDialog();
|
||||
const formRef = ref();
|
||||
const isSubmitting = ref(false);
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
</wd-card>
|
||||
|
||||
<wd-loadmore v-if="total > 0" :state="loadMoreState" @reload="fetchDictTypeList" />
|
||||
<wd-status-tip v-else-if="total === 0" image="search" tip="暂无数据" />
|
||||
<wd-empty v-else-if="total === 0" icon="search" tip="暂无数据" />
|
||||
</view>
|
||||
|
||||
<wd-popup
|
||||
@@ -91,15 +91,15 @@
|
||||
<script lang="ts" setup>
|
||||
import { onLoad, onReachBottom } from "@dcloudio/uni-app";
|
||||
import { useRouter } from "uni-mini-router";
|
||||
import { LoadMoreState } from "wot-design-uni/components/wd-loadmore/types";
|
||||
import { FormRules } from "wot-design-uni/components/wd-form/types";
|
||||
import { useToast, useMessage } from "wot-design-uni";
|
||||
import { LoadMoreState } from "@wot-ui/ui/components/wd-loadmore/types";
|
||||
import { FormRules } from "@wot-ui/ui/components/wd-form/types";
|
||||
import { useToast, useDialog } from "@wot-ui/ui";
|
||||
import DictAPI, { type DictTypeForm, type DictTypePageQuery, type DictTypeItem } from "@/api/dict";
|
||||
import { hasPermission } from "@/utils/permission";
|
||||
|
||||
const router = useRouter();
|
||||
const toast = useToast();
|
||||
const { messageBox } = useMessage();
|
||||
const { messageBox } = useDialog();
|
||||
const loadMoreState = ref<LoadMoreState>("loading");
|
||||
const formRef = ref();
|
||||
const isSubmitting = ref(false);
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
</wd-card>
|
||||
|
||||
<wd-loadmore v-if="total > 0" :state="loadMoreState" @reload="fetchItemList" />
|
||||
<wd-status-tip v-else-if="total === 0" image="search" tip="暂无数据" />
|
||||
<wd-empty v-else-if="total === 0" icon="search" tip="暂无数据" />
|
||||
</view>
|
||||
|
||||
<wd-popup
|
||||
@@ -98,14 +98,14 @@
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { onLoad, onReachBottom } from "@dcloudio/uni-app";
|
||||
import { LoadMoreState } from "wot-design-uni/components/wd-loadmore/types";
|
||||
import { FormRules } from "wot-design-uni/components/wd-form/types";
|
||||
import { useToast, useMessage } from "wot-design-uni";
|
||||
import { LoadMoreState } from "@wot-ui/ui/components/wd-loadmore/types";
|
||||
import { FormRules } from "@wot-ui/ui/components/wd-form/types";
|
||||
import { useToast, useDialog } from "@wot-ui/ui";
|
||||
import DictAPI, { type DictItemForm, type DictItemPageQuery, type DictDataItem } from "@/api/dict";
|
||||
import { hasPermission } from "@/utils/permission";
|
||||
|
||||
const toast = useToast();
|
||||
const { messageBox } = useMessage();
|
||||
const { messageBox } = useDialog();
|
||||
|
||||
const dictCode = ref<string>("");
|
||||
const pageTitle = ref<string>("字典数据");
|
||||
|
||||
@@ -59,7 +59,7 @@
|
||||
</wd-card>
|
||||
|
||||
<wd-loadmore v-if="total > 0" :state="loadMoreState" @reload="fetchLogList" />
|
||||
<wd-status-tip v-else-if="total === 0" image="search" tip="暂无数据" />
|
||||
<wd-empty v-else-if="total === 0" icon="search" tip="暂无数据" />
|
||||
</view>
|
||||
|
||||
<!-- 详情弹窗 -->
|
||||
@@ -102,7 +102,7 @@
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { onLoad, onReachBottom } from "@dcloudio/uni-app";
|
||||
import { LoadMoreState } from "wot-design-uni/components/wd-loadmore/types";
|
||||
import { LoadMoreState } from "@wot-ui/ui/components/wd-loadmore/types";
|
||||
import LogAPI, { type LogPageQuery, LogItem } from "@/api/log";
|
||||
|
||||
const loadMoreState = ref<LoadMoreState>("loading");
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
</template>
|
||||
</custom-tree>
|
||||
|
||||
<wd-status-tip v-if="menuList.length === 0" image="search" tip="暂无数据" />
|
||||
<wd-empty v-if="menuList.length === 0" icon="search" tip="暂无数据" />
|
||||
</view>
|
||||
|
||||
<!-- 弹窗表单 -->
|
||||
@@ -54,7 +54,7 @@
|
||||
<scroll-view scroll-y class="max-h-60vh">
|
||||
<wd-form ref="formRef" :model="formData" :rules="rules">
|
||||
<wd-cell-group border>
|
||||
<wd-col-picker
|
||||
<wd-cascader
|
||||
v-model="parentSelected"
|
||||
label="上级菜单"
|
||||
:columns="parentColumns"
|
||||
@@ -121,14 +121,14 @@
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { onLoad } from "@dcloudio/uni-app";
|
||||
import { FormRules } from "wot-design-uni/components/wd-form/types";
|
||||
import { useToast, useMessage } from "wot-design-uni";
|
||||
import { FormRules } from "@wot-ui/ui/components/wd-form/types";
|
||||
import { useToast, useDialog } from "@wot-ui/ui";
|
||||
import MenuAPI, { type MenuQuery, MenuItem, MenuForm } from "@/api/menu";
|
||||
import { hasPermission } from "@/utils/permission";
|
||||
import CustomTree from "@/components/custom-tree/index.vue";
|
||||
|
||||
const toast = useToast();
|
||||
const { messageBox } = useMessage();
|
||||
const { messageBox } = useDialog();
|
||||
const formRef = ref();
|
||||
const isSubmitting = ref(false);
|
||||
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
</wd-card>
|
||||
|
||||
<wd-loadmore v-if="total > 0" :state="loadMoreState" @reload="fetchNoticeList" />
|
||||
<wd-status-tip v-else-if="total === 0" image="search" tip="暂无数据" />
|
||||
<wd-empty v-else-if="total === 0" icon="search" tip="暂无数据" />
|
||||
</view>
|
||||
|
||||
<!-- 详情弹窗 -->
|
||||
@@ -156,9 +156,9 @@
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { onLoad, onReachBottom } from "@dcloudio/uni-app";
|
||||
import { LoadMoreState } from "wot-design-uni/components/wd-loadmore/types";
|
||||
import { FormRules } from "wot-design-uni/components/wd-form/types";
|
||||
import { useToast, useMessage } from "wot-design-uni";
|
||||
import { LoadMoreState } from "@wot-ui/ui/components/wd-loadmore/types";
|
||||
import { FormRules } from "@wot-ui/ui/components/wd-form/types";
|
||||
import { useToast, useDialog } from "@wot-ui/ui";
|
||||
import NoticeAPI, {
|
||||
type NoticePageQuery,
|
||||
NoticeItem,
|
||||
@@ -168,7 +168,7 @@ import NoticeAPI, {
|
||||
import { hasPermission } from "@/utils/permission";
|
||||
|
||||
const toast = useToast();
|
||||
const { messageBox } = useMessage();
|
||||
const { messageBox } = useDialog();
|
||||
const loadMoreState = ref<LoadMoreState>("loading");
|
||||
const formRef = ref();
|
||||
const isSubmitting = ref(false);
|
||||
|
||||
@@ -64,7 +64,7 @@
|
||||
</template>
|
||||
</custom-tree>
|
||||
|
||||
<wd-status-tip v-if="menuTree.length === 0" image="search" tip="暂无菜单数据" />
|
||||
<wd-empty v-if="menuTree.length === 0" icon="search" tip="暂无菜单数据" />
|
||||
</scroll-view>
|
||||
|
||||
<!-- 固定底部操作栏 -->
|
||||
@@ -77,7 +77,7 @@
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { onLoad } from "@dcloudio/uni-app";
|
||||
import { useToast } from "wot-design-uni";
|
||||
import { useToast } from "@wot-ui/ui";
|
||||
import MenuAPI, { type MenuItem } from "@/api/menu";
|
||||
import RoleAPI from "@/api/role";
|
||||
import CustomTree from "@/components/custom-tree/index.vue";
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
</wd-card>
|
||||
|
||||
<wd-loadmore v-if="total > 0" :state="loadMoreState" @reload="fetchRoleList" />
|
||||
<wd-status-tip v-else-if="total === 0" image="search" tip="暂无数据" />
|
||||
<wd-empty v-else-if="total === 0" icon="search" tip="暂无数据" />
|
||||
</view>
|
||||
|
||||
<!-- 弹窗表单 -->
|
||||
@@ -110,14 +110,14 @@
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { onLoad, onReachBottom } from "@dcloudio/uni-app";
|
||||
import { LoadMoreState } from "wot-design-uni/components/wd-loadmore/types";
|
||||
import { FormRules } from "wot-design-uni/components/wd-form/types";
|
||||
import { useToast, useMessage } from "wot-design-uni";
|
||||
import { LoadMoreState } from "@wot-ui/ui/components/wd-loadmore/types";
|
||||
import { FormRules } from "@wot-ui/ui/components/wd-form/types";
|
||||
import { useToast, useDialog } from "@wot-ui/ui";
|
||||
import RoleAPI, { type RolePageQuery, RoleItem, RoleForm } from "@/api/role";
|
||||
import { hasPermission } from "@/utils/permission";
|
||||
|
||||
const toast = useToast();
|
||||
const { messageBox } = useMessage();
|
||||
const { messageBox } = useDialog();
|
||||
const loadMoreState = ref<LoadMoreState>("loading");
|
||||
const formRef = ref();
|
||||
const isSubmitting = ref(false);
|
||||
|
||||
@@ -102,7 +102,7 @@
|
||||
</wd-card>
|
||||
|
||||
<wd-loadmore v-if="total > 0" :state="loadMoreState" @reload="fetchUserList" />
|
||||
<wd-status-tip v-else-if="total === 0" image="search" tip="暂无数据" />
|
||||
<wd-empty v-else-if="total === 0" icon="search" tip="暂无数据" />
|
||||
</view>
|
||||
|
||||
<!-- 弹窗表单 -->
|
||||
@@ -125,7 +125,7 @@
|
||||
required
|
||||
/>
|
||||
<wd-input v-model="formData.nickname" label="昵称" required />
|
||||
<wd-col-picker
|
||||
<wd-cascader
|
||||
v-model="deptSelected"
|
||||
label="部门"
|
||||
:columns="deptColumns"
|
||||
@@ -200,16 +200,16 @@
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { onLoad, onReachBottom } from "@dcloudio/uni-app";
|
||||
import { LoadMoreState } from "wot-design-uni/components/wd-loadmore/types";
|
||||
import { FormRules } from "wot-design-uni/components/wd-form/types";
|
||||
import { useQueue, useToast, useMessage } from "wot-design-uni";
|
||||
import { LoadMoreState } from "@wot-ui/ui/components/wd-loadmore/types";
|
||||
import { FormRules } from "@wot-ui/ui/components/wd-form/types";
|
||||
import { useQueue, useToast, useDialog } from "@wot-ui/ui";
|
||||
import UserAPI, { type UserPageQuery, UserItem, UserForm } from "@/api/user";
|
||||
import RoleAPI from "@/api/role";
|
||||
import DeptAPI from "@/api/dept";
|
||||
import { hasPermission } from "@/utils/permission";
|
||||
|
||||
const toast = useToast();
|
||||
const { messageBox } = useMessage();
|
||||
const { messageBox } = useDialog();
|
||||
const { closeOutside } = useQueue();
|
||||
const loadMoreState = ref<LoadMoreState>("loading");
|
||||
const formRef = ref();
|
||||
|
||||
15
src/types/auto-imports.d.ts
vendored
15
src/types/auto-imports.d.ts
vendored
@@ -6,7 +6,7 @@
|
||||
// biome-ignore lint: disable
|
||||
export {}
|
||||
declare global {
|
||||
const CommonUtil: typeof import('wot-design-uni')['CommonUtil']
|
||||
const CommonUtil: typeof import('@wot-ui/ui')['CommonUtil']
|
||||
const EffectScope: typeof import('vue')['EffectScope']
|
||||
const PERM_ALL: typeof import('../utils/permission')['PERM_ALL']
|
||||
const ROLE_ROOT: typeof import('../utils/permission')['ROLE_ROOT']
|
||||
@@ -157,6 +157,7 @@ declare global {
|
||||
const useCountdown: typeof import('../composables/useCountdown')['useCountdown']
|
||||
const useCssModule: typeof import('vue')['useCssModule']
|
||||
const useCssVars: typeof import('vue')['useCssVars']
|
||||
const useDialog: typeof import('@wot-ui/ui')['useDialog']
|
||||
const useDownloadFile: typeof import('@uni-helper/uni-use')['useDownloadFile']
|
||||
const useGlobalData: typeof import('@uni-helper/uni-use')['useGlobalData']
|
||||
const useId: typeof import('vue')['useId']
|
||||
@@ -170,7 +171,7 @@ declare global {
|
||||
const useNavbar: typeof import('../composables/useNavbar')['useNavbar']
|
||||
const useNavigation: typeof import('../composables/useNavigation')['useNavigation']
|
||||
const useNetwork: typeof import('@uni-helper/uni-use')['useNetwork']
|
||||
const useNotify: typeof import('wot-design-uni')['useNotify']
|
||||
const useNotify: typeof import('@wot-ui/ui')['useNotify']
|
||||
const useOnline: typeof import('@uni-helper/uni-use')['useOnline']
|
||||
const usePage: typeof import('@uni-helper/uni-use')['usePage']
|
||||
const usePageLayout: typeof import('../composables/useNavbar')['usePageLayout']
|
||||
@@ -198,7 +199,7 @@ declare global {
|
||||
const useTemplateRef: typeof import('vue')['useTemplateRef']
|
||||
const useTheme: typeof import('../composables/useTheme')['useTheme']
|
||||
const useThemeStore: typeof import('../store/modules/theme')['useThemeStore']
|
||||
const useToast: typeof import('wot-design-uni')['useToast']
|
||||
const useToast: typeof import('@wot-ui/ui')['useToast']
|
||||
const useUploadFile: typeof import('@uni-helper/uni-use')['useUploadFile']
|
||||
const useUserStore: typeof import('../store/modules/user')['useUserStore']
|
||||
const useVisible: typeof import('@uni-helper/uni-use')['useVisible']
|
||||
@@ -226,7 +227,7 @@ import { UnwrapRef } from 'vue'
|
||||
declare module 'vue' {
|
||||
interface GlobalComponents {}
|
||||
interface ComponentCustomProperties {
|
||||
readonly CommonUtil: UnwrapRef<typeof import('wot-design-uni')['CommonUtil']>
|
||||
readonly CommonUtil: UnwrapRef<typeof import('@wot-ui/ui')['CommonUtil']>
|
||||
readonly EffectScope: UnwrapRef<typeof import('vue')['EffectScope']>
|
||||
readonly RequestError: UnwrapRef<typeof import('../utils/request')['RequestError']>
|
||||
readonly SseConnectionState: UnwrapRef<typeof import('../composables/useSse')['SseConnectionState']>
|
||||
@@ -346,13 +347,13 @@ declare module 'vue' {
|
||||
readonly useCountdown: UnwrapRef<typeof import('../composables/useCountdown')['useCountdown']>
|
||||
readonly useCssModule: UnwrapRef<typeof import('vue')['useCssModule']>
|
||||
readonly useCssVars: UnwrapRef<typeof import('vue')['useCssVars']>
|
||||
readonly useDialog: UnwrapRef<typeof import('@wot-ui/ui')['useDialog']>
|
||||
readonly useId: UnwrapRef<typeof import('vue')['useId']>
|
||||
readonly useLoading: UnwrapRef<typeof import('../composables/useLoading')['useLoading']>
|
||||
readonly useMessage: UnwrapRef<typeof import('wot-design-uni')['useMessage']>
|
||||
readonly useModel: UnwrapRef<typeof import('vue')['useModel']>
|
||||
readonly useNavbar: UnwrapRef<typeof import('../composables/useNavbar')['useNavbar']>
|
||||
readonly useNavigation: UnwrapRef<typeof import('../composables/useNavigation')['useNavigation']>
|
||||
readonly useNotify: UnwrapRef<typeof import('wot-design-uni')['useNotify']>
|
||||
readonly useNotify: UnwrapRef<typeof import('@wot-ui/ui')['useNotify']>
|
||||
readonly usePagination: UnwrapRef<typeof import('../composables/useRequest')['usePagination']>
|
||||
readonly useRequest: UnwrapRef<typeof import('../composables/useRequest')['useRequest']>
|
||||
readonly useRoute: UnwrapRef<typeof import('uni-mini-router')['useRoute']>
|
||||
@@ -363,7 +364,7 @@ declare module 'vue' {
|
||||
readonly useTemplateRef: UnwrapRef<typeof import('vue')['useTemplateRef']>
|
||||
readonly useTheme: UnwrapRef<typeof import('../composables/useTheme')['useTheme']>
|
||||
readonly useThemeStore: UnwrapRef<typeof import('../store/modules/theme')['useThemeStore']>
|
||||
readonly useToast: UnwrapRef<typeof import('wot-design-uni')['useToast']>
|
||||
readonly useToast: UnwrapRef<typeof import('@wot-ui/ui')['useToast']>
|
||||
readonly useUserStore: UnwrapRef<typeof import('../store/modules/user')['useUserStore']>
|
||||
readonly user: UnwrapRef<typeof import('../api/user')['default']>
|
||||
readonly watch: UnwrapRef<typeof import('vue')['watch']>
|
||||
|
||||
59
src/types/uni-pages.d.ts
vendored
59
src/types/uni-pages.d.ts
vendored
@@ -3,33 +3,36 @@
|
||||
// @ts-nocheck
|
||||
// Generated by vite-plugin-uni-pages
|
||||
|
||||
type _LocationUrl =
|
||||
"/pages/index/index" |
|
||||
"/pages/login/index" |
|
||||
"/pages/mine/index" |
|
||||
"/pages/webview/index" |
|
||||
"/pages/work/index" |
|
||||
"/pages/mine/about/index" |
|
||||
"/pages/mine/account/index" |
|
||||
"/pages/mine/official/index" |
|
||||
"/pages/mine/profile/complete-profile" |
|
||||
"/pages/mine/profile/index" |
|
||||
"/pages/mine/settings/index" |
|
||||
"/pages/work/config/index" |
|
||||
"/pages/work/dept/index" |
|
||||
"/pages/work/dict/index" |
|
||||
"/pages/work/log/index" |
|
||||
"/pages/work/menu/index" |
|
||||
"/pages/work/monitor/index" |
|
||||
"/pages/work/notice/index" |
|
||||
"/pages/work/role/assign-perm" |
|
||||
"/pages/work/role/index" |
|
||||
"/pages/work/user/index" |
|
||||
"/pages/mine/settings/agreement/index" |
|
||||
"/pages/mine/settings/network/index" |
|
||||
"/pages/mine/settings/privacy/index" |
|
||||
"/pages/mine/settings/theme/index" |
|
||||
"/pages/work/dict/item/index";
|
||||
|
||||
interface NavigateToOptions {
|
||||
url: "/pages/index/index" |
|
||||
"/pages/login/index" |
|
||||
"/pages/mine/index" |
|
||||
"/pages/webview/index" |
|
||||
"/pages/work/index" |
|
||||
"/pages/mine/about/index" |
|
||||
"/pages/mine/account/index" |
|
||||
"/pages/mine/official/index" |
|
||||
"/pages/mine/profile/complete-profile" |
|
||||
"/pages/mine/profile/index" |
|
||||
"/pages/mine/settings/index" |
|
||||
"/pages/work/config/index" |
|
||||
"/pages/work/dept/index" |
|
||||
"/pages/work/dict/index" |
|
||||
"/pages/work/log/index" |
|
||||
"/pages/work/menu/index" |
|
||||
"/pages/work/monitor/index" |
|
||||
"/pages/work/notice/index" |
|
||||
"/pages/work/role/assign-perm" |
|
||||
"/pages/work/role/index" |
|
||||
"/pages/work/user/index" |
|
||||
"/pages/mine/settings/agreement/index" |
|
||||
"/pages/mine/settings/network/index" |
|
||||
"/pages/mine/settings/privacy/index" |
|
||||
"/pages/mine/settings/theme/index" |
|
||||
"/pages/work/dict/item/index";
|
||||
url: _LocationUrl;
|
||||
}
|
||||
interface RedirectToOptions extends NavigateToOptions {}
|
||||
|
||||
@@ -45,3 +48,7 @@ declare interface Uni {
|
||||
switchTab(options: UniNamespace.SwitchTabOptions & SwitchTabOptions): void;
|
||||
reLaunch(options: UniNamespace.ReLaunchOptions & ReLaunchOptions): void;
|
||||
}
|
||||
|
||||
declare module "virtual:uni-pages" {
|
||||
export type LocationUrl = _LocationUrl;
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
"@/*": ["./src/*"]
|
||||
},
|
||||
"lib": ["esnext", "dom"],
|
||||
"types": ["@dcloudio/types", "@uni-helper/uni-types", "wot-design-uni/global"]
|
||||
"types": ["@dcloudio/types", "@uni-helper/uni-types", "@wot-ui/ui/global"]
|
||||
},
|
||||
"vueCompilerOptions": {
|
||||
// 调整 Volar(Vue 语言服务工具)解析行为,用于为 uni-app 组件提供 TypeScript 类型
|
||||
|
||||
@@ -8,7 +8,31 @@ import { readFileSync } from "node:fs";
|
||||
import { resolve } from "node:path";
|
||||
|
||||
import Components from "@uni-helper/vite-plugin-uni-components";
|
||||
import { WotResolver } from "@uni-helper/vite-plugin-uni-components/resolvers";
|
||||
import type { ComponentResolver } from "@uni-helper/vite-plugin-uni-components";
|
||||
import { kebabCase } from "@uni-helper/vite-plugin-uni-components";
|
||||
|
||||
/**
|
||||
* 自定义 Wot UI v2 组件解析器
|
||||
*
|
||||
* 由于 @wot-ui/ui v2 的包名和路径发生了变化,需要自定义 resolver
|
||||
* 官方迁移文档: https://wot-ui.cn/guide/migration-v2.html#vite-插件自动导入
|
||||
*
|
||||
* @returns ComponentResolver
|
||||
*/
|
||||
function WotUIResolver(): ComponentResolver {
|
||||
return {
|
||||
type: "component",
|
||||
resolve: (name: string) => {
|
||||
if (name.match(/^Wd[A-Z]/)) {
|
||||
const compName = kebabCase(name);
|
||||
return {
|
||||
name,
|
||||
from: `@wot-ui/ui/components/${compName}/${compName}.vue`,
|
||||
};
|
||||
}
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
export default defineConfig(async ({ mode }: ConfigEnv): Promise<UserConfig> => {
|
||||
const UnoCss = await import("unocss/vite").then((i) => i.default);
|
||||
@@ -47,7 +71,7 @@ export default defineConfig(async ({ mode }: ConfigEnv): Promise<UserConfig> =>
|
||||
}
|
||||
: undefined,
|
||||
optimizeDeps: {
|
||||
include: ["wot-design-uni"],
|
||||
include: ["@wot-ui/ui"],
|
||||
exclude: ["vue-demi"],
|
||||
},
|
||||
plugins: [
|
||||
@@ -64,7 +88,7 @@ export default defineConfig(async ({ mode }: ConfigEnv): Promise<UserConfig> =>
|
||||
exclude: ["**/components/**/*.*"],
|
||||
}),
|
||||
Components({
|
||||
resolvers: [WotResolver()],
|
||||
resolvers: [WotUIResolver()],
|
||||
dirs: ["src/components"],
|
||||
}),
|
||||
|
||||
@@ -78,8 +102,8 @@ export default defineConfig(async ({ mode }: ConfigEnv): Promise<UserConfig> =>
|
||||
imports: ["createRouter", "useRouter", "useRoute"],
|
||||
},
|
||||
{
|
||||
from: "wot-design-uni",
|
||||
imports: ["useToast", "useMessage", "useNotify", "CommonUtil"],
|
||||
from: "@wot-ui/ui",
|
||||
imports: ["useToast", "useDialog", "useNotify", "CommonUtil"],
|
||||
},
|
||||
],
|
||||
dts: "src/types/auto-imports.d.ts", // 自动生成的类型声明文件
|
||||
|
||||
Reference in New Issue
Block a user