This commit is contained in:
ahjung
2024-06-29 17:35:10 +08:00
parent 489f791caa
commit 19df8d5f09
7 changed files with 6240 additions and 5027 deletions

View File

@@ -1,5 +1,10 @@
# CHANGELOG # CHANGELOG
## 1.9.2
- 升级 `vite``5.x` 版本
- 优化 `BasicTable` 组件,编辑样式
- 新增 `BasicTable` 组件,支持 `striped` 入参
- 依赖升级 - 依赖升级
## 1.9.1 ## 1.9.1

View File

@@ -1,6 +1,6 @@
{ {
"name": "naive-ui-admin", "name": "naive-ui-admin",
"version": "1.9.2", "version": "1.9.3",
"author": { "author": {
"name": "Ahjung", "name": "Ahjung",
"email": "735878602@qq.com", "email": "735878602@qq.com",
@@ -30,10 +30,10 @@
"@vicons/ionicons5": "^0.12.0", "@vicons/ionicons5": "^0.12.0",
"@vueup/vue-quill": "^1.2.0", "@vueup/vue-quill": "^1.2.0",
"@vueuse/core": "^9.13.0", "@vueuse/core": "^9.13.0",
"axios": "^1.6.8", "axios": "^1.7.2",
"blueimp-md5": "^2.19.0", "blueimp-md5": "^2.19.0",
"date-fns": "^2.30.0", "date-fns": "^2.30.0",
"echarts": "^5.5.0", "echarts": "^5.5.1",
"element-resize-detector": "^1.2.4", "element-resize-detector": "^1.2.4",
"lodash-es": "^4.17.21", "lodash-es": "^4.17.21",
"mitt": "^3.0.1", "mitt": "^3.0.1",
@@ -42,24 +42,24 @@
"pinia": "^2.1.7", "pinia": "^2.1.7",
"qs": "^6.12.1", "qs": "^6.12.1",
"vfonts": "^0.0.3", "vfonts": "^0.0.3",
"vue": "^3.4.27", "vue": "^3.4.31",
"vue-router": "^4.3.2", "vue-router": "^4.4.0",
"vue-types": "^4.2.1" "vue-types": "^4.2.1"
}, },
"devDependencies": { "devDependencies": {
"@commitlint/cli": "^17.8.1", "@commitlint/cli": "^17.8.1",
"@commitlint/config-conventional": "^17.8.1", "@commitlint/config-conventional": "^17.8.1",
"@types/lodash": "^4.17.1", "@types/lodash": "^4.17.6",
"@types/node": "^18.19.33", "@types/node": "^18.19.39",
"@typescript-eslint/eslint-plugin": "^5.62.0", "@typescript-eslint/eslint-plugin": "^5.62.0",
"@typescript-eslint/parser": "^5.62.0", "@typescript-eslint/parser": "^5.62.0",
"@vitejs/plugin-vue": "^3.2.0", "@vitejs/plugin-vue": "^3.2.0",
"@vitejs/plugin-vue-jsx": "^2.1.1", "@vitejs/plugin-vue-jsx": "^2.1.1",
"@vue/compiler-sfc": "^3.4.27", "@vue/compiler-sfc": "^3.4.31",
"@vue/eslint-config-typescript": "^11.0.3", "@vue/eslint-config-typescript": "^11.0.3",
"autoprefixer": "^10.4.19", "autoprefixer": "^10.4.19",
"commitizen": "^4.3.0", "commitizen": "^4.3.0",
"core-js": "^3.37.0", "core-js": "^3.37.1",
"cross-env": "^7.0.3", "cross-env": "^7.0.3",
"dotenv": "^16.4.5", "dotenv": "^16.4.5",
"eslint": "^8.57.0", "eslint": "^8.57.0",
@@ -84,17 +84,17 @@
"stylelint-config-standard": "^29.0.0", "stylelint-config-standard": "^29.0.0",
"stylelint-order": "^5.0.0", "stylelint-order": "^5.0.0",
"stylelint-scss": "^4.7.0", "stylelint-scss": "^4.7.0",
"tailwindcss": "^3.4.3", "tailwindcss": "^3.4.4",
"typescript": "^4.9.5", "typescript": "^4.9.5",
"unplugin-vue-components": "^0.22.12", "unplugin-vue-components": "^0.22.12",
"vite": "^3.2.10", "vite": "^5.3.2",
"vite-plugin-compression": "^0.5.1", "vite-plugin-compression": "^0.5.1",
"vite-plugin-html": "^3.2.2", "vite-plugin-html": "^3.2.2",
"vite-plugin-mock": "^2.9.8", "vite-plugin-mock": "^2.9.8",
"vite-plugin-style-import": "^2.0.0", "vite-plugin-style-import": "^2.0.0",
"vue-demi": "^0.13.11", "vue-demi": "^0.13.11",
"vue-draggable-next": "^2.2.1", "vue-draggable-next": "^2.2.1",
"vue-eslint-parser": "^9.4.2", "vue-eslint-parser": "^9.4.3",
"vuedraggable": "^4.1.0" "vuedraggable": "^4.1.0"
}, },
"lint-staged": { "lint-staged": {

10900
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@@ -156,7 +156,7 @@
const tableElRef = ref<ComponentRef>(null); const tableElRef = ref<ComponentRef>(null);
const wrapRef = ref<Nullable<HTMLDivElement>>(null); const wrapRef = ref<Nullable<HTMLDivElement>>(null);
let paginationEl: HTMLElement | null; let paginationEl: HTMLElement | null;
const isStriped = ref(false); const isStriped = ref(props.striped || false);
const tableData = ref<Recordable[]>([]); const tableData = ref<Recordable[]>([]);
const innerPropsRef = ref<Partial<BasicTableProps>>(); const innerPropsRef = ref<Partial<BasicTableProps>>();

View File

@@ -1,12 +1,6 @@
<template> <template>
<div class="editable-cell"> <div class="editable-cell">
<div v-show="!isEdit" class="editable-cell-content" @click="handleEdit"> <div class="flex editable-cell-content" v-if="isEdit" v-click-outside="onClickOutside">
{{ getValues }}
<n-icon class="edit-icon" v-if="!column.editRow">
<FormOutlined />
</n-icon>
</div>
<div class="flex editable-cell-content" v-show="isEdit" v-click-outside="onClickOutside">
<div class="editable-cell-content-comp"> <div class="editable-cell-content-comp">
<CellComponent <CellComponent
v-bind="getComponentProps" v-bind="getComponentProps"
@@ -29,6 +23,12 @@
</n-icon> </n-icon>
</div> </div>
</div> </div>
<div v-else class="flex items-center editable-cell-content" @click="handleEdit">
{{ getValues }}
<n-icon class="ml-1 edit-icon" v-if="!column.editRow">
<FormOutlined />
</n-icon>
</div>
</div> </div>
</template> </template>
<script lang="ts"> <script lang="ts">

View File

@@ -56,4 +56,5 @@ export const basicProps = {
}, },
canResize: propTypes.bool.def(true), canResize: propTypes.bool.def(true),
resizeHeightOffset: propTypes.number.def(0), resizeHeightOffset: propTypes.number.def(0),
striped: propTypes.bool.def(false),
}; };

View File

@@ -14,6 +14,7 @@
:actionColumn="actionColumn" :actionColumn="actionColumn"
@update:checked-row-keys="onCheckedRow" @update:checked-row-keys="onCheckedRow"
:scroll-x="1090" :scroll-x="1090"
:striped="true"
> >
<template #tableTitle> <template #tableTitle>
<n-button type="primary" @click="addTable"> <n-button type="primary" @click="addTable">