@ysgroup/ui 0.1.16 → 0.1.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ysgroup/ui",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.18",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "src/index.ts",
|
|
6
6
|
"types": "src/index.ts",
|
|
7
7
|
"dependencies": {
|
|
8
8
|
"@element-plus/icons-vue": "^2.3.1",
|
|
9
|
-
"@ysgroup/contracts": "^0.1.
|
|
9
|
+
"@ysgroup/contracts": "^0.1.3",
|
|
10
10
|
"@ysgroup/theme": "^0.1.0"
|
|
11
11
|
},
|
|
12
12
|
"peerDependencies": {
|
|
@@ -95,9 +95,7 @@ const displayColumns = computed<FieldSpec[]>(() => {
|
|
|
95
95
|
const filtered = computed(() => {
|
|
96
96
|
const kw = keyword.value.trim().toLowerCase();
|
|
97
97
|
if (!kw) return props.rows;
|
|
98
|
-
return props.rows.filter((r) =>
|
|
99
|
-
displayColumns.value.some((c) => display(r, c).toLowerCase().includes(kw)),
|
|
100
|
-
);
|
|
98
|
+
return props.rows.filter((r) => displayColumns.value.some((c) => display(r, c).toLowerCase().includes(kw)));
|
|
101
99
|
});
|
|
102
100
|
|
|
103
101
|
// 搜索词变化时重置到第一页
|
|
@@ -157,7 +155,9 @@ function onSubmit(payload: Record<string, unknown>) {
|
|
|
157
155
|
<template>
|
|
158
156
|
<div class="ys-crud">
|
|
159
157
|
<YsTableToolbar v-model:keyword="keyword">
|
|
160
|
-
<template #actions
|
|
158
|
+
<template #actions
|
|
159
|
+
><el-button v-if="!readonly" type="primary" @click="onCreate">{{ createLabel || "新建" }}</el-button></template
|
|
160
|
+
>
|
|
161
161
|
</YsTableToolbar>
|
|
162
162
|
|
|
163
163
|
<el-table :data="paged" v-loading="loading" stripe border size="small" table-layout="fixed" row-key="_id">
|
|
@@ -179,15 +179,10 @@ function onSubmit(payload: Record<string, unknown>) {
|
|
|
179
179
|
</el-table-column>
|
|
180
180
|
</el-table>
|
|
181
181
|
|
|
182
|
-
<YsTablePagination
|
|
183
|
-
v-model:current-page="currentPage"
|
|
184
|
-
v-model:page-size="pageSize"
|
|
185
|
-
:total="filtered.length"
|
|
186
|
-
/>
|
|
182
|
+
<YsTablePagination v-model:current-page="currentPage" v-model:page-size="pageSize" :total="filtered.length" />
|
|
187
183
|
|
|
188
184
|
<YsFormDialog v-if="!externalEditor" v-model="dialogOpen" :table="table" :record="editing" :hidden="hiddenInForm" :saving="saving" @submit="onSubmit" />
|
|
189
185
|
</div>
|
|
190
186
|
</template>
|
|
191
187
|
|
|
192
|
-
<style scoped>
|
|
193
|
-
</style>
|
|
188
|
+
<style scoped></style>
|
|
@@ -22,6 +22,7 @@ const submitting = ref(false);
|
|
|
22
22
|
const PASSWORD_REQUIREMENT = "密码须至少包含 8 个字符,并同时包含大写字母、小写字母和数字。";
|
|
23
23
|
|
|
24
24
|
const canChangePassword = computed(() => props.role !== "Root" && props.username?.trim().toLowerCase() !== "root");
|
|
25
|
+
const canManageFrontend = computed(() => props.role === "Admin" || props.role === "Manager");
|
|
25
26
|
const visible = computed(() => props.modelValue && props.authenticated);
|
|
26
27
|
|
|
27
28
|
function isStrongPassword(password: string): boolean {
|
|
@@ -129,7 +130,7 @@ defineExpose({
|
|
|
129
130
|
</template>
|
|
130
131
|
<el-empty v-else description="Root 登录密码由平台安全配置维护,不允许在设置中心修改" :image-size="72" />
|
|
131
132
|
</el-tab-pane>
|
|
132
|
-
<el-tab-pane v-if="
|
|
133
|
+
<el-tab-pane v-if="canManageFrontend && $slots.managerActions" label="前端管理" name="manager-actions">
|
|
133
134
|
<slot name="managerActions" />
|
|
134
135
|
</el-tab-pane>
|
|
135
136
|
</el-tabs>
|
|
@@ -11,13 +11,7 @@ const emit = defineEmits<{
|
|
|
11
11
|
|
|
12
12
|
<template>
|
|
13
13
|
<div class="ys-table-toolbar">
|
|
14
|
-
<el-input
|
|
15
|
-
:model-value="keyword"
|
|
16
|
-
:placeholder="placeholder || '搜索'"
|
|
17
|
-
clearable
|
|
18
|
-
class="ys-table-toolbar__search"
|
|
19
|
-
@update:model-value="emit('update:keyword', String($event))"
|
|
20
|
-
/>
|
|
14
|
+
<el-input :model-value="keyword" :placeholder="placeholder || '搜索'" clearable class="ys-table-toolbar__search" @update:model-value="emit('update:keyword', String($event))" />
|
|
21
15
|
<slot />
|
|
22
16
|
<div class="ys-table-toolbar__spacer" />
|
|
23
17
|
<slot name="actions" />
|
|
@@ -38,4 +32,4 @@ const emit = defineEmits<{
|
|
|
38
32
|
.ys-table-toolbar__spacer {
|
|
39
33
|
flex: 1;
|
|
40
34
|
}
|
|
41
|
-
</style>
|
|
35
|
+
</style>
|