mirror of
https://github.com/un-pany/v3-admin-vite.git
synced 2025-04-22 03:49:19 +08:00
Merge branch 'un-pany:main' into main
This commit is contained in:
commit
f0d65d56ba
@ -25,6 +25,7 @@ module.exports = {
|
||||
},
|
||||
rules: {
|
||||
// TS
|
||||
"@typescript-eslint/no-unused-expressions": "off",
|
||||
"@typescript-eslint/no-explicit-any": "off",
|
||||
"no-debugger": "off",
|
||||
"@typescript-eslint/explicit-module-boundary-types": "off",
|
||||
|
6
.github/workflows/deploy.yml
vendored
6
.github/workflows/deploy.yml
vendored
@ -14,15 +14,15 @@ jobs:
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
- name: Setup Node.js 20.10.0
|
||||
- name: Setup Node.js 20.15.1
|
||||
uses: actions/setup-node@master
|
||||
with:
|
||||
node-version: 20.10.0
|
||||
node-version: 20.15.1
|
||||
|
||||
- name: Setup pnpm
|
||||
uses: pnpm/action-setup@v2
|
||||
with:
|
||||
version: 8.11.0
|
||||
version: 9.5.0
|
||||
|
||||
- name: Build
|
||||
run: pnpm install && pnpm build:prod
|
||||
|
@ -1,4 +1 @@
|
||||
#!/bin/sh
|
||||
. "$(dirname "$0")/_/husky.sh"
|
||||
|
||||
npx lint-staged
|
||||
|
3
.npmrc
3
.npmrc
@ -1,2 +1,5 @@
|
||||
# China mirror of npm
|
||||
# registry = https://registry.npmmirror.com
|
||||
|
||||
# 通过该配置兜底解决组件没有类型提示的问题
|
||||
shamefully-hoist = true
|
||||
|
1
.vscode/settings.json
vendored
1
.vscode/settings.json
vendored
@ -1,4 +1,5 @@
|
||||
{
|
||||
"prettier.enable": true,
|
||||
"editor.codeActionsOnSave": {
|
||||
"source.fixAll.eslint": "explicit"
|
||||
},
|
||||
|
58
package.json
58
package.json
@ -21,58 +21,58 @@
|
||||
"lint:eslint": "eslint --cache --max-warnings 0 \"{src,tests,types}/**/*.{vue,js,jsx,ts,tsx}\" --fix",
|
||||
"lint:prettier": "prettier --write \"{src,tests,types}/**/*.{vue,js,jsx,ts,tsx,json,css,less,scss,html,md}\"",
|
||||
"lint": "pnpm lint:eslint && pnpm lint:prettier",
|
||||
"prepare": "husky install",
|
||||
"prepare": "husky",
|
||||
"test": "vitest"
|
||||
},
|
||||
"dependencies": {
|
||||
"@element-plus/icons-vue": "2.3.1",
|
||||
"axios": "1.7.2",
|
||||
"dayjs": "1.11.11",
|
||||
"element-plus": "2.7.3",
|
||||
"axios": "1.7.3",
|
||||
"dayjs": "1.11.12",
|
||||
"element-plus": "2.8.0",
|
||||
"js-cookie": "3.0.5",
|
||||
"lodash-es": "4.17.21",
|
||||
"mitt": "3.0.1",
|
||||
"normalize.css": "8.0.1",
|
||||
"nprogress": "0.2.0",
|
||||
"path-browserify": "1.0.1",
|
||||
"path-to-regexp": "6.2.2",
|
||||
"pinia": "2.1.7",
|
||||
"path-to-regexp": "7.1.0",
|
||||
"pinia": "2.2.1",
|
||||
"screenfull": "6.0.2",
|
||||
"vue": "3.4.27",
|
||||
"vue-router": "4.3.2",
|
||||
"vxe-table": "4.6.17",
|
||||
"vxe-table-plugin-element": "4.0.3",
|
||||
"xe-utils": "3.5.26"
|
||||
"vue": "3.4.37",
|
||||
"vue-router": "4.4.3",
|
||||
"vxe-table": "4.6.18",
|
||||
"vxe-table-plugin-element": "4.0.4",
|
||||
"xe-utils": "3.5.30"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/js-cookie": "3.0.6",
|
||||
"@types/lodash-es": "4.17.12",
|
||||
"@types/node": "20.12.12",
|
||||
"@types/node": "22.2.0",
|
||||
"@types/nprogress": "0.2.3",
|
||||
"@types/path-browserify": "1.0.2",
|
||||
"@typescript-eslint/eslint-plugin": "7.10.0",
|
||||
"@typescript-eslint/parser": "7.10.0",
|
||||
"@vitejs/plugin-vue": "5.0.4",
|
||||
"@vitejs/plugin-vue-jsx": "3.1.0",
|
||||
"@typescript-eslint/eslint-plugin": "8.0.1",
|
||||
"@typescript-eslint/parser": "8.0.1",
|
||||
"@vitejs/plugin-vue": "5.1.2",
|
||||
"@vitejs/plugin-vue-jsx": "4.0.0",
|
||||
"@vue/eslint-config-prettier": "9.0.0",
|
||||
"@vue/eslint-config-typescript": "13.0.0",
|
||||
"@vue/test-utils": "2.4.6",
|
||||
"eslint": "8.57.0",
|
||||
"eslint-plugin-prettier": "5.1.3",
|
||||
"eslint-plugin-vue": "9.26.0",
|
||||
"husky": "9.0.11",
|
||||
"jsdom": "24.1.0",
|
||||
"lint-staged": "15.2.5",
|
||||
"prettier": "3.2.5",
|
||||
"sass": "1.77.2",
|
||||
"typescript": "5.4.5",
|
||||
"unocss": "0.60.3",
|
||||
"vite": "5.2.11",
|
||||
"eslint-plugin-prettier": "5.2.1",
|
||||
"eslint-plugin-vue": "9.27.0",
|
||||
"husky": "9.1.4",
|
||||
"jsdom": "24.1.1",
|
||||
"lint-staged": "15.2.8",
|
||||
"prettier": "3.3.3",
|
||||
"sass": "1.77.8",
|
||||
"typescript": "5.5.4",
|
||||
"unocss": "0.61.9",
|
||||
"vite": "5.4.0",
|
||||
"vite-plugin-svg-icons": "2.0.1",
|
||||
"vite-svg-loader": "5.1.0",
|
||||
"vitest": "1.6.0",
|
||||
"vue-eslint-parser": "9.4.2",
|
||||
"vue-tsc": "2.0.19"
|
||||
"vitest": "2.0.5",
|
||||
"vue-eslint-parser": "9.4.3",
|
||||
"vue-tsc": "2.0.29"
|
||||
},
|
||||
"lint-staged": {
|
||||
"*.{vue,js,jsx,ts,tsx}": [
|
||||
|
2980
pnpm-lock.yaml
generated
2980
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@ -28,8 +28,8 @@ export function updateTableDataApi(data: Table.CreateOrUpdateTableRequestData) {
|
||||
}
|
||||
|
||||
/** 查 */
|
||||
export function getTableDataApi(params: Table.GetTableRequestData) {
|
||||
return request<Table.GetTableResponseData>({
|
||||
export function getTableDataApi(params: Table.TableRequestData) {
|
||||
return request<Table.TableResponseData>({
|
||||
url: "table",
|
||||
method: "get",
|
||||
params
|
||||
|
@ -4,7 +4,7 @@ export interface CreateOrUpdateTableRequestData {
|
||||
password?: string
|
||||
}
|
||||
|
||||
export interface GetTableRequestData {
|
||||
export interface TableRequestData {
|
||||
/** 当前页码 */
|
||||
currentPage: number
|
||||
/** 查询条数 */
|
||||
@ -15,7 +15,7 @@ export interface GetTableRequestData {
|
||||
phone?: string
|
||||
}
|
||||
|
||||
export interface GetTableData {
|
||||
export interface TableData {
|
||||
createTime: string
|
||||
email: string
|
||||
id: string
|
||||
@ -25,7 +25,7 @@ export interface GetTableData {
|
||||
username: string
|
||||
}
|
||||
|
||||
export type GetTableResponseData = ApiResponseData<{
|
||||
list: GetTableData[]
|
||||
export type TableResponseData = ApiResponseData<{
|
||||
list: TableData[]
|
||||
total: number
|
||||
}>
|
||||
|
@ -35,7 +35,7 @@ const handleChangeTheme = ({ clientX, clientY }: MouseEvent, themeName: ThemeNam
|
||||
:key="index"
|
||||
:disabled="activeThemeName === theme.name"
|
||||
@click="
|
||||
(e) => {
|
||||
(e: MouseEvent) => {
|
||||
handleChangeTheme(e, theme.name)
|
||||
}
|
||||
"
|
||||
|
@ -90,8 +90,8 @@ const resolvePath = (routePath: string) => {
|
||||
}
|
||||
|
||||
.el-icon {
|
||||
width: 1em;
|
||||
margin-right: 12px;
|
||||
width: 1em !important;
|
||||
margin-right: 12px !important;
|
||||
font-size: 18px;
|
||||
}
|
||||
</style>
|
||||
|
@ -1,7 +1,7 @@
|
||||
<script lang="ts" setup>
|
||||
import { reactive, ref, watch } from "vue"
|
||||
import { createTableDataApi, deleteTableDataApi, updateTableDataApi, getTableDataApi } from "@/api/table"
|
||||
import { type CreateOrUpdateTableRequestData, type GetTableData } from "@/api/table/types/table"
|
||||
import { type CreateOrUpdateTableRequestData, type TableData } from "@/api/table/types/table"
|
||||
import { type FormInstance, type FormRules, ElMessage, ElMessageBox } from "element-plus"
|
||||
import { Search, Refresh, CirclePlus, Delete, Download, RefreshRight } from "@element-plus/icons-vue"
|
||||
import { usePagination } from "@/hooks/usePagination"
|
||||
@ -51,7 +51,7 @@ const resetForm = () => {
|
||||
//#endregion
|
||||
|
||||
//#region 删
|
||||
const handleDelete = (row: GetTableData) => {
|
||||
const handleDelete = (row: TableData) => {
|
||||
ElMessageBox.confirm(`正在删除用户:${row.username},确认删除?`, "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
@ -66,14 +66,14 @@ const handleDelete = (row: GetTableData) => {
|
||||
//#endregion
|
||||
|
||||
//#region 改
|
||||
const handleUpdate = (row: GetTableData) => {
|
||||
const handleUpdate = (row: TableData) => {
|
||||
dialogVisible.value = true
|
||||
formData.value = cloneDeep(row)
|
||||
}
|
||||
//#endregion
|
||||
|
||||
//#region 查
|
||||
const tableData = ref<GetTableData[]>([])
|
||||
const tableData = ref<TableData[]>([])
|
||||
const searchFormRef = ref<FormInstance | null>(null)
|
||||
const searchData = reactive({
|
||||
username: "",
|
||||
|
@ -2,7 +2,7 @@
|
||||
import { nextTick, reactive, ref } from "vue"
|
||||
import { type ElMessageBoxOptions, ElMessageBox, ElMessage } from "element-plus"
|
||||
import { deleteTableDataApi, getTableDataApi } from "@/api/table"
|
||||
import { type GetTableResponseData } from "@/api/table/types/table"
|
||||
import { type TableResponseData } from "@/api/table/types/table"
|
||||
import RoleColumnSolts from "./tsx/RoleColumnSolts"
|
||||
import StatusColumnSolts from "./tsx/StatusColumnSolts"
|
||||
import {
|
||||
@ -142,7 +142,7 @@ const xGridOpt: VxeGridProps = reactive({
|
||||
let total = 0
|
||||
let result: RowMeta[] = []
|
||||
/** 加载数据 */
|
||||
const callback = (res: GetTableResponseData) => {
|
||||
const callback = (res: TableResponseData) => {
|
||||
if (res?.data) {
|
||||
// 总数
|
||||
total = res.data.total
|
||||
|
Loading…
x
Reference in New Issue
Block a user