@peng_kai/kit 0.3.0-beta.24 → 0.3.0-beta.26
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/admin/components/filter/src/FilterReset.vue +7 -8
- package/admin/components/filter/src/more/TableSetting.vue +4 -4
- package/admin/components/provider/admin-router.ts +2 -2
- package/admin/components/rich-text/src/RichText.new.vue +2 -2
- package/admin/components/rich-text/src/editorConfig.ts +66 -0
- package/admin/components/settings/src/SchemaForm.vue +5 -4
- package/admin/components/settings/src/Settings.vue +1 -1
- package/admin/layout/large/Content.vue +1 -6
- package/package.json +64 -94
|
@@ -48,14 +48,13 @@ function reset() {
|
|
|
48
48
|
const tableColumns = inject('tableColumns', props.tableColumns) as TableColumnsType<any>;
|
|
49
49
|
const tableColumnsConfig = inject('tableColumnsConfig') as Ref<ColumnConfig[]>;
|
|
50
50
|
function openTableSettingModal() {
|
|
51
|
-
// const tableColumns = props.tableColumns?.map((x: any) => ({
|
|
52
|
-
// ...x,
|
|
53
|
-
// title: typeof x.title === 'string' ? x.title : x.dataIndex || '',
|
|
54
|
-
// })) || [];
|
|
55
51
|
|
|
56
|
-
if (!tableColumns
|
|
52
|
+
if (!tableColumns) return;
|
|
57
53
|
|
|
58
|
-
TableSettingModal.open({
|
|
54
|
+
TableSettingModal.open({
|
|
55
|
+
tableColumns,
|
|
56
|
+
tableColumnsConfig: tableColumnsConfig.value || []
|
|
57
|
+
} as any)?.then((res) => {
|
|
59
58
|
TableSettingModal.close();
|
|
60
59
|
if (res) {
|
|
61
60
|
tableColumnsConfig.value = res;
|
|
@@ -80,13 +79,13 @@ onTtaTimeZone(() => {
|
|
|
80
79
|
<Button :disabled="loading" @click="reset()">
|
|
81
80
|
重置
|
|
82
81
|
</Button>
|
|
83
|
-
<Dropdown trigger="click" placement="bottomRight">
|
|
82
|
+
<Dropdown trigger="click" placement="bottomRight" >
|
|
84
83
|
<Button class="px-1 w-8">
|
|
85
84
|
<i class="i-si:more-square-horiz-fill scale-130 transform-origin-bottom-center" />
|
|
86
85
|
</Button>
|
|
87
86
|
<template #overlay>
|
|
88
87
|
<Menu>
|
|
89
|
-
<MenuItem v-if="tableColumns
|
|
88
|
+
<MenuItem v-if="tableColumns" @click="openTableSettingModal">
|
|
90
89
|
设置表格
|
|
91
90
|
</MenuItem>
|
|
92
91
|
</Menu>
|
|
@@ -79,13 +79,13 @@ defineExpose({
|
|
|
79
79
|
<div v-for="(col, i) in columnsConfig" :key="col.dataIndex" :index="i"
|
|
80
80
|
class="flex items-center gap-2 p-2 select-none">
|
|
81
81
|
<div
|
|
82
|
-
class="drag-handler flex items-center justify-center p-1 -m-2
|
|
83
|
-
:class="{ 'pointer-events-none !cursor-no-drop': col.fixed }"
|
|
82
|
+
class="drag-handler flex items-center justify-center p-1 -m-2 "
|
|
83
|
+
:class="{ '!pointer-events-none !cursor-no-drop': col.fixed }"
|
|
84
84
|
>
|
|
85
85
|
<i class="i-material-symbols:drag-indicator" :class="{ 'op-0': col.fixed }" />
|
|
86
|
-
<span>{{ col.title }}</span>
|
|
87
86
|
</div>
|
|
88
|
-
<
|
|
87
|
+
<span>{{ col.title }}</span>
|
|
88
|
+
<RadioGroup class="ml-auto" v-model:value="columnsShowValue[col.dataIndex]" :options="columnsShowOptions[col.dataIndex]"
|
|
89
89
|
optionType="button" buttonStyle="solid" size="small" />
|
|
90
90
|
<!-- <Select v-model:value="columnsShowValue[col.dataIndex]" :options="columnsShowOptions[col.dataIndex]" /> -->
|
|
91
91
|
</div>
|
|
@@ -82,7 +82,7 @@ function useTab(router: ShallowRef<Router | null>, options: TOptions = {}) {
|
|
|
82
82
|
const lastTime = Date.now();
|
|
83
83
|
const isReplaced = history.state?.replaced;
|
|
84
84
|
const tabType = Number(history.state?.tabType ?? 1); // 0:不新增 tab, 1:新增 tab, 2: 固定 tab(不可关闭)
|
|
85
|
-
|
|
85
|
+
|
|
86
86
|
// 0. 刷新页面
|
|
87
87
|
if (toTab && toTab?.path === fromTab?.path) {
|
|
88
88
|
const components = to.matched[1].components as Record<string, any>;
|
|
@@ -155,7 +155,7 @@ function useTab(router: ShallowRef<Router | null>, options: TOptions = {}) {
|
|
|
155
155
|
const compName = currentTab.value?.path;
|
|
156
156
|
|
|
157
157
|
if (mainComp && compName)
|
|
158
|
-
mainComp.__name =
|
|
158
|
+
mainComp.__name = to.fullPath;
|
|
159
159
|
}
|
|
160
160
|
});
|
|
161
161
|
});
|
|
@@ -4,8 +4,8 @@ import { Ckeditor } from '@ckeditor/ckeditor5-vue';
|
|
|
4
4
|
import { shallowRef } from 'vue';
|
|
5
5
|
import { useInjectDisabled } from 'ant-design-vue/es/config-provider/DisabledContext';
|
|
6
6
|
import { defaultConfig } from './editorConfig';
|
|
7
|
-
import 'https://cdn.ckeditor.com/ckeditor5/41.
|
|
8
|
-
import 'https://cdn.ckeditor.com/ckeditor5/41.
|
|
7
|
+
import 'https://cdn.ckeditor.com/ckeditor5/41.2.0/super-build/ckeditor.js';
|
|
8
|
+
import 'https://cdn.ckeditor.com/ckeditor5/41.2.0/super-build/translations/zh-cn.js';
|
|
9
9
|
|
|
10
10
|
function useClassicEditor() {
|
|
11
11
|
const ClassicEditor = shallowRef();
|
|
@@ -3,6 +3,72 @@ export const defaultConfig: Record<string, any> = {
|
|
|
3
3
|
ui: 'zh-cn',
|
|
4
4
|
},
|
|
5
5
|
removePlugins: ['ImportWord', 'ExportWord', 'RevisionHistory', 'RealTimeCollaborativeEditing', 'RealTimeCollaborativeComments', 'RealTimeCollaborativeRevisionHistory', 'RealTimeCollaborativeTrackChanges', 'PresenceList', 'WProofreader', 'DocumentOutline', 'Comments', 'TrackChanges', 'TrackChangesData', 'TableOfContents', 'SlashCommand', 'PasteFromOfficeEnhanced', 'ContentTemplates', 'FormatPainter', 'Mentions', 'PageBreak', 'Pagination', 'AIAssistant', 'CaseChange', 'Template'],
|
|
6
|
+
// plugins: [
|
|
7
|
+
// 'Alignment',
|
|
8
|
+
// 'Autoformat',
|
|
9
|
+
// 'AutoImage',
|
|
10
|
+
// 'AutoLink',
|
|
11
|
+
// 'Autosave',
|
|
12
|
+
// 'BalloonToolbar',
|
|
13
|
+
// 'BlockQuote',
|
|
14
|
+
// 'Bold',
|
|
15
|
+
// 'Code',
|
|
16
|
+
// 'CodeBlock',
|
|
17
|
+
// 'Essentials',
|
|
18
|
+
// 'FindAndReplace',
|
|
19
|
+
// 'FontBackgroundColor',
|
|
20
|
+
// 'FontColor',
|
|
21
|
+
// 'FontFamily',
|
|
22
|
+
// 'FontSize',
|
|
23
|
+
// 'FullPage',
|
|
24
|
+
// 'Fullscreen',
|
|
25
|
+
// 'GeneralHtmlSupport',
|
|
26
|
+
// 'Heading',
|
|
27
|
+
// 'Highlight',
|
|
28
|
+
// 'HorizontalLine',
|
|
29
|
+
// 'HtmlComment',
|
|
30
|
+
// 'HtmlEmbed',
|
|
31
|
+
// 'ImageBlock',
|
|
32
|
+
// 'ImageCaption',
|
|
33
|
+
// 'ImageInline',
|
|
34
|
+
// 'ImageInsert',
|
|
35
|
+
// 'ImageInsertViaUrl',
|
|
36
|
+
// 'ImageResize',
|
|
37
|
+
// 'ImageStyle',
|
|
38
|
+
// 'ImageTextAlternative',
|
|
39
|
+
// 'ImageToolbar',
|
|
40
|
+
// 'ImageUpload',
|
|
41
|
+
// 'Indent',
|
|
42
|
+
// 'IndentBlock',
|
|
43
|
+
// 'Italic',
|
|
44
|
+
// 'Link',
|
|
45
|
+
// 'LinkImage',
|
|
46
|
+
// 'List',
|
|
47
|
+
// 'ListProperties',
|
|
48
|
+
// 'Markdown',
|
|
49
|
+
// 'MediaEmbed',
|
|
50
|
+
// 'Paragraph',
|
|
51
|
+
// 'PasteFromMarkdownExperimental',
|
|
52
|
+
// 'PasteFromOffice',
|
|
53
|
+
// 'PlainTableOutput',
|
|
54
|
+
// 'RemoveFormat',
|
|
55
|
+
// 'ShowBlocks',
|
|
56
|
+
// 'SimpleUploadAdapter',
|
|
57
|
+
// 'SourceEditing',
|
|
58
|
+
// 'Strikethrough',
|
|
59
|
+
// 'Subscript',
|
|
60
|
+
// 'Superscript',
|
|
61
|
+
// 'Table',
|
|
62
|
+
// 'TableCaption',
|
|
63
|
+
// 'TableCellProperties',
|
|
64
|
+
// 'TableColumnResize',
|
|
65
|
+
// 'TableLayout',
|
|
66
|
+
// 'TableProperties',
|
|
67
|
+
// 'TableToolbar',
|
|
68
|
+
// 'TextTransformation',
|
|
69
|
+
// 'Underline',
|
|
70
|
+
// 'WordCount'
|
|
71
|
+
// ],
|
|
6
72
|
toolbar: {
|
|
7
73
|
items: [
|
|
8
74
|
'undo',
|
|
@@ -150,14 +150,14 @@ const antdValueResolvers: Record<number, (value: any) => any> = {
|
|
|
150
150
|
|
|
151
151
|
<script setup lang="ts">
|
|
152
152
|
const props = withDefaults(defineProps<{
|
|
153
|
-
|
|
153
|
+
formConfig: IConfigDetail[]
|
|
154
154
|
disabled?: boolean
|
|
155
155
|
}>(), {
|
|
156
156
|
disabled: false,
|
|
157
157
|
});
|
|
158
158
|
|
|
159
159
|
const configList = computed(() => {
|
|
160
|
-
const list = cloneDeep(props.
|
|
160
|
+
const list = cloneDeep(props.formConfig);
|
|
161
161
|
|
|
162
162
|
if (!list?.length)
|
|
163
163
|
return;
|
|
@@ -169,7 +169,7 @@ const configList = computed(() => {
|
|
|
169
169
|
|
|
170
170
|
return list;
|
|
171
171
|
});
|
|
172
|
-
const configMap = computed(() => mapKeys(cloneDeep(props.
|
|
172
|
+
const configMap = computed(() => mapKeys(cloneDeep(props.formConfig ?? []), 'key'));
|
|
173
173
|
function formSchema() {
|
|
174
174
|
const _configList = configList.value ?? [];
|
|
175
175
|
const entries = _configList.map(config => [
|
|
@@ -221,9 +221,10 @@ defineExpose({ reset, validate });
|
|
|
221
221
|
<slot
|
|
222
222
|
v-if="$slots[item.key]"
|
|
223
223
|
:name="item.key"
|
|
224
|
-
:state="
|
|
224
|
+
:state="settingForm.state[item.key]"
|
|
225
225
|
:config="item"
|
|
226
226
|
:orginConfig="configMap[item.key]"
|
|
227
|
+
:setState="(v: any) => settingForm.state[item.key] = v"
|
|
227
228
|
/>
|
|
228
229
|
<template v-else>
|
|
229
230
|
<slot v-if="item.form_type === FormTypes.NUMBER_INPUT" :name="FormTypes.NUMBER_INPUT">
|
|
@@ -66,7 +66,7 @@ async function submitSetting() {
|
|
|
66
66
|
>
|
|
67
67
|
<component
|
|
68
68
|
:is="$slots.default?.({
|
|
69
|
-
|
|
69
|
+
formConfig: configQuerier.data.value ?? [],
|
|
70
70
|
disabled: settingMutator.isPending.value || props.readonly,
|
|
71
71
|
})[0]"
|
|
72
72
|
:ref="setRefs.form"
|
|
@@ -5,18 +5,13 @@ import { KeepAlive, type KeepAliveProps } from 'vue';
|
|
|
5
5
|
const props = defineProps<{
|
|
6
6
|
cached: KeepAliveProps['include']
|
|
7
7
|
}>();
|
|
8
|
-
|
|
9
|
-
function side(comp: any) {
|
|
10
|
-
console.log('🤡 / side / comp:', comp)
|
|
11
|
-
return comp;
|
|
12
|
-
}
|
|
13
8
|
</script>
|
|
14
9
|
|
|
15
10
|
<template>
|
|
16
11
|
<RouterView #default="{ Component }">
|
|
17
12
|
<KeepAlive :include="props.cached">
|
|
18
13
|
<Suspense>
|
|
19
|
-
<component :is="Component" :key="
|
|
14
|
+
<component :is="Component" :key="(Component as any).type?.__name" />
|
|
20
15
|
<template #fallback>
|
|
21
16
|
<div class="flex justify-center items-center h-full">
|
|
22
17
|
<div class="flex items-center">
|
package/package.json
CHANGED
|
@@ -1,94 +1,64 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@peng_kai/kit",
|
|
3
|
-
"type": "module",
|
|
4
|
-
"version": "0.3.0-beta.
|
|
5
|
-
"description": "",
|
|
6
|
-
"author": "",
|
|
7
|
-
"license": "ISC",
|
|
8
|
-
"keywords": [],
|
|
9
|
-
"main": "index.js",
|
|
10
|
-
"scripts": {
|
|
11
|
-
"dev:js": "tsx ./admin/scripts/deploy.ts",
|
|
12
|
-
"lint": "eslint .",
|
|
13
|
-
"lint:fix": "eslint . --fix"
|
|
14
|
-
},
|
|
15
|
-
"peerDependencies": {
|
|
16
|
-
"ant-design-vue": "4.2.6",
|
|
17
|
-
"vue": "3.5.
|
|
18
|
-
"vue-router": "4.5.1"
|
|
19
|
-
},
|
|
20
|
-
"dependencies": {
|
|
21
|
-
"@aws-sdk/client-s3": "^3.
|
|
22
|
-
"@aws-sdk/lib-storage": "^3.
|
|
23
|
-
"@babel/generator": "^7.28.
|
|
24
|
-
"@babel/parser": "^7.28.
|
|
25
|
-
"@babel/traverse": "^7.28.
|
|
26
|
-
"@babel/types": "^7.28.
|
|
27
|
-
"@ckeditor/ckeditor5-vue": "^7.3.0",
|
|
28
|
-
"@fingerprintjs/fingerprintjs": "^4.6.2",
|
|
29
|
-
"@tanstack/vue-query": "^5.
|
|
30
|
-
"@vueuse/components": "^13.
|
|
31
|
-
"@vueuse/core": "^13.
|
|
32
|
-
"@vueuse/router": "^13.
|
|
33
|
-
"archiver": "^7.0.1",
|
|
34
|
-
"axios": "^1.
|
|
35
|
-
"bignumber.js": "^9.3.1",
|
|
36
|
-
"chokidar": "^
|
|
37
|
-
"crypto-es": "^
|
|
38
|
-
"dayjs": "^1.11.
|
|
39
|
-
"echarts": "^5.5.1",
|
|
40
|
-
"execa": "^9.
|
|
41
|
-
"fast-glob": "^3.3.
|
|
42
|
-
"fluid-dnd": "^2.
|
|
43
|
-
"localstorage-slim": "^2.7.1",
|
|
44
|
-
"lodash-es": "^4.17.21",
|
|
45
|
-
"nprogress": "^0.2.0",
|
|
46
|
-
"pinia": "^3.0.3",
|
|
47
|
-
"tsx": "^4.16.00",
|
|
48
|
-
"vue": "^3.5.
|
|
49
|
-
"vue-i18n": "^11.1.
|
|
50
|
-
"vue-router": "^4.5.1"
|
|
51
|
-
},
|
|
52
|
-
"devDependencies": {
|
|
53
|
-
"@
|
|
54
|
-
"@
|
|
55
|
-
"@
|
|
56
|
-
"@
|
|
57
|
-
"@
|
|
58
|
-
"@
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
"@ckeditor/ckeditor5-horizontal-line": "^46.0.0",
|
|
66
|
-
"@ckeditor/ckeditor5-html-embed": "^46.0.0",
|
|
67
|
-
"@ckeditor/ckeditor5-html-support": "^46.0.0",
|
|
68
|
-
"@ckeditor/ckeditor5-image": "^46.0.0",
|
|
69
|
-
"@ckeditor/ckeditor5-import-word": "^46.0.0",
|
|
70
|
-
"@ckeditor/ckeditor5-indent": "^46.0.0",
|
|
71
|
-
"@ckeditor/ckeditor5-link": "^46.0.0",
|
|
72
|
-
"@ckeditor/ckeditor5-list": "^46.0.0",
|
|
73
|
-
"@ckeditor/ckeditor5-media-embed": "^46.0.0",
|
|
74
|
-
"@ckeditor/ckeditor5-paragraph": "^46.0.0",
|
|
75
|
-
"@ckeditor/ckeditor5-remove-format": "^46.0.0",
|
|
76
|
-
"@ckeditor/ckeditor5-show-blocks": "^46.0.0",
|
|
77
|
-
"@ckeditor/ckeditor5-source-editing": "^46.0.0",
|
|
78
|
-
"@ckeditor/ckeditor5-table": "^46.0.0",
|
|
79
|
-
"@ckeditor/ckeditor5-theme-lark": "^46.0.0",
|
|
80
|
-
"@ckeditor/ckeditor5-typing": "^46.0.0",
|
|
81
|
-
"@ckeditor/ckeditor5-upload": "^46.0.0",
|
|
82
|
-
"@ckeditor/ckeditor5-word-count": "^46.0.0",
|
|
83
|
-
"@peng_kai/lint": "^0.1.0",
|
|
84
|
-
"@types/archiver": "^6.0.3",
|
|
85
|
-
"@types/crypto-js": "^4.2.2",
|
|
86
|
-
"@types/lodash-es": "^4.17.12",
|
|
87
|
-
"@types/node": "^22.16.5",
|
|
88
|
-
"@types/nprogress": "^0.2.3",
|
|
89
|
-
"ant-design-vue": "^4.2.6",
|
|
90
|
-
"type-fest": "^4.41.0",
|
|
91
|
-
"typescript": "^5.8.3",
|
|
92
|
-
"vue-component-type-helpers": "^3.0.4"
|
|
93
|
-
}
|
|
94
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@peng_kai/kit",
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "0.3.0-beta.26",
|
|
5
|
+
"description": "",
|
|
6
|
+
"author": "",
|
|
7
|
+
"license": "ISC",
|
|
8
|
+
"keywords": [],
|
|
9
|
+
"main": "index.js",
|
|
10
|
+
"scripts": {
|
|
11
|
+
"dev:js": "tsx ./admin/scripts/deploy.ts",
|
|
12
|
+
"lint": "eslint .",
|
|
13
|
+
"lint:fix": "eslint . --fix"
|
|
14
|
+
},
|
|
15
|
+
"peerDependencies": {
|
|
16
|
+
"ant-design-vue": "4.2.6",
|
|
17
|
+
"vue": "3.5.21",
|
|
18
|
+
"vue-router": "4.5.1"
|
|
19
|
+
},
|
|
20
|
+
"dependencies": {
|
|
21
|
+
"@aws-sdk/client-s3": "^3.891.0",
|
|
22
|
+
"@aws-sdk/lib-storage": "^3.891.0",
|
|
23
|
+
"@babel/generator": "^7.28.3",
|
|
24
|
+
"@babel/parser": "^7.28.4",
|
|
25
|
+
"@babel/traverse": "^7.28.4",
|
|
26
|
+
"@babel/types": "^7.28.4",
|
|
27
|
+
"@ckeditor/ckeditor5-vue": "^7.3.0",
|
|
28
|
+
"@fingerprintjs/fingerprintjs": "^4.6.2",
|
|
29
|
+
"@tanstack/vue-query": "^5.89.0",
|
|
30
|
+
"@vueuse/components": "^13.9.0",
|
|
31
|
+
"@vueuse/core": "^13.9.0",
|
|
32
|
+
"@vueuse/router": "^13.9.0",
|
|
33
|
+
"archiver": "^7.0.1",
|
|
34
|
+
"axios": "^1.12.2",
|
|
35
|
+
"bignumber.js": "^9.3.1",
|
|
36
|
+
"chokidar": "^4.0.3",
|
|
37
|
+
"crypto-es": "^3.1.2",
|
|
38
|
+
"dayjs": "^1.11.18",
|
|
39
|
+
"echarts": "^5.5.1",
|
|
40
|
+
"execa": "^9.6.0",
|
|
41
|
+
"fast-glob": "^3.3.3",
|
|
42
|
+
"fluid-dnd": "^2.6.2",
|
|
43
|
+
"localstorage-slim": "^2.7.1",
|
|
44
|
+
"lodash-es": "^4.17.21",
|
|
45
|
+
"nprogress": "^0.2.0",
|
|
46
|
+
"pinia": "^3.0.3",
|
|
47
|
+
"tsx": "^4.16.00",
|
|
48
|
+
"vue": "^3.5.21",
|
|
49
|
+
"vue-i18n": "^11.1.12",
|
|
50
|
+
"vue-router": "^4.5.1"
|
|
51
|
+
},
|
|
52
|
+
"devDependencies": {
|
|
53
|
+
"@peng_kai/lint": "^0.1.0",
|
|
54
|
+
"@types/archiver": "^6.0.3",
|
|
55
|
+
"@types/crypto-js": "^4.2.2",
|
|
56
|
+
"@types/lodash-es": "^4.17.12",
|
|
57
|
+
"@types/node": "^22.18.5",
|
|
58
|
+
"@types/nprogress": "^0.2.3",
|
|
59
|
+
"ant-design-vue": "^4.2.6",
|
|
60
|
+
"type-fest": "^5.0.0",
|
|
61
|
+
"typescript": "^5.9.2",
|
|
62
|
+
"vue-component-type-helpers": "^3.0.7"
|
|
63
|
+
}
|
|
64
|
+
}
|