Skip to content

Commit 8e42857

Browse files
committed
Add column add, show and hide functions.
1 parent 42e2b35 commit 8e42857

File tree

9 files changed

+107
-102
lines changed

9 files changed

+107
-102
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,12 @@
4343
"vue": "^3.3.4"
4444
},
4545
"devDependencies": {
46-
"@types/node": "^20.9.1",
46+
"@types/node": "^20.9.2",
4747
"@types/sortablejs": "^1.15.5",
4848
"@vitejs/plugin-vue": "^4.5.0",
4949
"@vitest/ui": "^0.34.6",
5050
"autoprefixer": "^10.4.16",
51-
"daisyui": "^3.9.4",
51+
"daisyui": "^4.4.2",
5252
"happy-dom": "^12.10.3",
5353
"postcss": "^8.4.31",
5454
"postcss-import": "^15.1.0",

pnpm-lock.yaml

Lines changed: 47 additions & 44 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/assets/locales/en.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@
2828
"url": "URL",
2929
"phone": "Phone",
3030
"password": "Password"
31+
},
32+
"state": {
33+
"selectPlaceholder": "Please Select"
3134
}
3235
},
3336
"layout": {
@@ -72,4 +75,4 @@
7275
"submit": "ADD"
7376
}
7477
}
75-
}
78+
}

src/assets/locales/zh-CN.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@
2828
"url": "网址",
2929
"phone": "电话",
3030
"password": "密码"
31+
},
32+
"state": {
33+
"selectPlaceholder": "请选择"
3134
}
3235
},
3336
"layout": {
@@ -72,4 +75,4 @@
7275
"submit": "添加"
7376
}
7477
}
75-
}
78+
}

src/components/common/Menu.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import { IwUtils } from '../../utils';
55
const contextmenuRef = ref<HTMLElement | null>(null)
66
const isShow = ref<boolean>(false)
77
8-
function showContextMenu(attachObj: HTMLElement | MouseEvent, offset: MenuOffsetKind = MenuOffsetKind.LEFT_BOTTOM, size: MenuSizeKind = MenuSizeKind.MEDIUM) {
9-
if (attachObj instanceof HTMLElement && IwUtils.hasParentWithClass(attachObj, 'iw-contextmenu__item')) {
8+
function showContextMenu(attachObj: HTMLElement | MouseEvent, offset: MenuOffsetKind = MenuOffsetKind.LEFT_BOTTOM, size: MenuSizeKind = MenuSizeKind.MEDIUM, force: boolean = false) {
9+
if (!force && attachObj instanceof HTMLElement && IwUtils.hasParentWithClass(attachObj, 'iw-contextmenu__item')) {
1010
// Prevent accidental triggering from items
1111
return
1212
}

src/components/conf.ts

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -189,15 +189,7 @@ export function initConf(props: TableProps): [TableBasicConf, TableLayoutConf[]]
189189
layoutKind: LayoutKind.LIST,
190190
icon: iconSvg.TEXT,
191191
columns: props.columns.map(column => {
192-
return {
193-
name: column.name,
194-
wrap: true,
195-
fixed: false,
196-
width: 200,
197-
hide: false,
198-
dateStart: false,
199-
dateEnd: false,
200-
}
192+
return getDefaultLayoutColumnConf(column.name)
201193
}),
202194
filters: [],
203195
sorts: [],
@@ -209,11 +201,11 @@ export function initConf(props: TableProps): [TableBasicConf, TableLayoutConf[]]
209201
export function getDefaultLayoutColumnConf(columnName: string): TableLayoutColumnConf {
210202
return {
211203
name: columnName,
212-
wrap: true,
213-
fixed: false,
214-
width: 200,
215-
hide: false,
216-
dateStart: false,
217-
dateEnd: false,
204+
wrap: true,
205+
fixed: false,
206+
width: 200,
207+
hide: false,
208+
dateStart: false,
209+
dateEnd: false,
218210
}
219211
}

src/components/layout/list/ColumnAggs.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ function changeColumnAggs(aggKind: AggregateKind, colIdx: number) {
3939
:data-column-name="column.name" :style="props.setColumnStyles(colIdx)"
4040
@click="(event: MouseEvent) => showAggsContextMenu(event, colIdx)" v-if="column.name == props.pkColumnName">
4141
<span class="iw-list-agg-cell__group font-bold flex-grow pl-1">{{ props.groupValue }}</span>
42-
<span class="iw-list-agg-cell__agg text-xs pr-1 self-center">{{ $t('function.group.agg.count')
42+
<span class="iw-list-agg-cell__agg text-xs pr-1 self-center">{{ $t('_.agg.count')
4343
}}</span>
4444
<span class="iw-list-agg-cell__value text-info self-center">{{ props.dataBasic.totalNumber }}</span>
4545
</div>

0 commit comments

Comments
 (0)