Skip to content

Commit 75be13f

Browse files
chore: 更新 Makefile 清理规则,添加对 public/entry 和 public/runtime 目录的清理,同时更新 pnpm-lock.yaml 和 pnpm-workspace.yaml 中的依赖版本
1 parent a96c251 commit 75be13f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+2837
-2483
lines changed

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,12 @@
22
clean:
33
find . -name 'node_modules' -type d -prune -exec rm -rf '{}' +
44
find . -name 'dist' -type d -prune -exec rm -rf '{}' +
5+
find . -path '*/public/entry' -type d -prune -exec rm -rf '{}' +
6+
find . -path '*/public/runtime' -type d -prune -exec rm -rf '{}' +
57
find . -name '.turbo' -type d -prune -exec rm -rf '{}' +
68
find . -name '.output' -type d -prune -exec rm -rf '{}' +
79
find . -name '.nuxt' -type d -prune -exec rm -rf '{}' +
10+
find . -name 'pnpm-lock.yaml' -type f -prune -exec rm -rf '{}' +
811

912
install:
1013
pnpm install

apps/playground/src/components/pagePreview/preview.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,4 @@ const proxyVisible = computed({
5050
5151
</script>
5252
<style lang='scss' scoped>
53-
</style>
53+
</style>

apps/playground/src/views/editor/index.vue

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -202,11 +202,7 @@
202202
]);
203203
204204
const schemas = ref<ISchemasRoot>(defaultSchemas);
205-
if(runtimePathType === 'vue3') {
206-
schemas.value = testSchemasV1
207-
} else {
208205
schemas.value = testSchemasV2
209-
}
210206
let preSchemasStr = '';
211207
let schemasStr = '';
212208
let id: string | null = null;

packages/core/src/app.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export class LowCodeRoot extends Subscribe implements ILowCodeRoot {
5353

5454
this.setEnv(options.ua);
5555
options.platform && (this.platform = options.platform);
56-
this.flexible = new Flexible({ designWidth: options.designWidth, });
56+
this.flexible = new Flexible({ designWidth: options.designWidth });
5757
if (options.config) {
5858
this.setConfig(options.config, options.curPage);
5959
}
@@ -144,7 +144,7 @@ export class LowCodeRoot extends Subscribe implements ILowCodeRoot {
144144
this.page.destroy();
145145
}
146146

147-
this.page = new LowCodePage({ config: pageConfig, root: this, });
147+
this.page = new LowCodePage({ config: pageConfig, root: this });
148148
super.emit('page-change', this.page);
149149
// this.bindEvents();
150150
}
@@ -201,7 +201,7 @@ export class LowCodeRoot extends Subscribe implements ILowCodeRoot {
201201
node?: LowCodeNode
202202
) {
203203
const eventHanlder = (...args: any[]) => {
204-
fn({ app: this, dataSource: ds || {}, }, ...args);
204+
fn({ app: this, dataSource: ds || {} }, ...args);
205205
};
206206
// 先清空
207207
if (this.cache.has(key)) {

packages/editor/src/components/form/datasource-fields.vue

Lines changed: 31 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -15,26 +15,27 @@
1515
<script lang="ts" setup>
1616
import { useTable } from '@quantum-design/vue3-antd-pc-ui';
1717
import { IDataSchema } from '@quantum-lowcode/schemas';
18-
import { isArray, js_utils_get_uuid } from '@quantum-lowcode/utils';
18+
import { js_utils_get_uuid } from '@quantum-lowcode/utils';
1919
import { cloneDeep } from 'lodash-es';
2020
import { computed, nextTick, unref } from 'vue';
2121
2222
defineOptions({
23-
name: 'DataSourceFields',
23+
name: 'DataSourceFields'
2424
});
2525
2626
const props = withDefaults(
2727
defineProps<{
2828
value: Partial<IDataSchema & {id: string}>[];
2929
}>(),
3030
{
31-
value: [] as any,
31+
value: () => []
3232
}
3333
);
3434
3535
const emits = defineEmits(['change', 'update:value']);
3636
3737
const getDataSourceProps = computed(() => {
38+
console.log('getDataSourceProps', props.value);
3839
const data = cloneDeep(props.value);
3940
return data.map(item => {
4041
if (!item.id) {
@@ -44,7 +45,7 @@ const getDataSourceProps = computed(() => {
4445
});
4546
});
4647
47-
const [registerTable, {getDataSource, deleteTableDataRecord, insertTableDataRecord, setTableData, }] = useTable({
48+
const [registerTable, {getDataSource, deleteTableDataRecord}] = useTable({
4849
pagination: false,
4950
rowKey: 'id',
5051
dataSource: getDataSourceProps,
@@ -58,7 +59,7 @@ const [registerTable, {getDataSource, deleteTableDataRecord, insertTableDataReco
5859
sorter: false,
5960
editRow: true,
6061
editRule: true,
61-
width: 100,
62+
width: 100
6263
},
6364
{
6465
title: '属性名称',
@@ -68,7 +69,7 @@ const [registerTable, {getDataSource, deleteTableDataRecord, insertTableDataReco
6869
editRow: true,
6970
editComponent: 'Input',
7071
editRule: true,
71-
width: 100,
72+
width: 100
7273
},
7374
{
7475
title: '数据类型',
@@ -80,16 +81,16 @@ const [registerTable, {getDataSource, deleteTableDataRecord, insertTableDataReco
8081
editComponent: 'Select',
8182
editComponentProps: {
8283
options: [
83-
{ label: '字符串', value: 'string', },
84-
{ label: '数字', value: 'number', },
85-
{ label: '布尔值', value: 'boolean', },
86-
{ label: '对象', value: 'object', },
87-
{ label: '数组', value: 'array', },
88-
{ label: 'null', value: 'null', },
89-
{ label: 'any', value: 'any', }
90-
],
84+
{ label: '字符串', value: 'string' },
85+
{ label: '数字', value: 'number' },
86+
{ label: '布尔值', value: 'boolean' },
87+
{ label: '对象', value: 'object' },
88+
{ label: '数组', value: 'array' },
89+
{ label: 'null', value: 'null' },
90+
{ label: 'any', value: 'any' }
91+
]
9192
},
92-
width: 100,
93+
width: 100
9394
},
9495
{
9596
title: '描述',
@@ -99,7 +100,7 @@ const [registerTable, {getDataSource, deleteTableDataRecord, insertTableDataReco
99100
sorter: false,
100101
editRow: true,
101102
editComponent: 'Input',
102-
width: 250,
103+
width: 250
103104
},
104105
{
105106
title: '默认值',
@@ -109,10 +110,10 @@ const [registerTable, {getDataSource, deleteTableDataRecord, insertTableDataReco
109110
editRow: true,
110111
sorter: false,
111112
editComponent: 'Input',
112-
width: 100,
113+
width: 100
113114
}
114115
],
115-
canResize: false,
116+
canResize: false
116117
});
117118
118119
function createActions(record:any) {
@@ -122,7 +123,7 @@ function createActions(record:any) {
122123
label: '编辑',
123124
onClick: () => {
124125
record.onEdit();
125-
},
126+
}
126127
},
127128
{
128129
label: '删除',
@@ -131,8 +132,8 @@ function createActions(record:any) {
131132
confirm: () => {
132133
deleteTableDataRecord(record.id);
133134
nextTick(() => updateData());
134-
},
135-
},
135+
}
136+
}
136137
}
137138
];
138139
}
@@ -142,7 +143,7 @@ function createActions(record:any) {
142143
onClick: () => {
143144
record.onSubmit();
144145
nextTick(() => updateData());
145-
},
146+
}
146147
},
147148
{
148149
label: '取消',
@@ -153,39 +154,28 @@ function createActions(record:any) {
153154
deleteTableDataRecord(record.id);
154155
}
155156
record.onCancel();
156-
},
157-
},
157+
}
158+
}
158159
}
159160
];
160161
}
161162
162-
function updateData() {
163+
function updateData(data?: any) {
163164
const dataSource = getDataSource().map(item => unref(item.editValueRefs));
164-
if (isArray(dataSource) && dataSource.length > 0) {
165-
insertTableDataRecord({
165+
if (data) {
166+
dataSource.push({
166167
id: js_utils_get_uuid(4),
167168
name: '',
168169
title: '',
169170
type: 'string',
170171
description: '',
171172
defaultValue: '',
172-
editable: true,
173+
editable: true
173174
});
174-
} else {
175-
setTableData([{
176-
id: js_utils_get_uuid(4),
177-
name: '',
178-
title: '',
179-
type: 'string',
180-
description: '',
181-
defaultValue: '',
182-
editable: true,
183-
}]);
184175
}
185-
const data = getDataSource();
186-
console.log(data);
176+
console.log('updateData', dataSource);
187177
emits('update:value', dataSource);
188-
emits('change', dataSource);
178+
emits('change', [...dataSource]);
189179
}
190180
191181
</script>

packages/editor/src/components/layouts/sidebar/data-source/data-edit.vue

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,26 +12,26 @@ import { inject, ref } from 'vue';
1212
import { IDataSourceSchema } from '@quantum-lowcode/schemas';
1313
import { mergeWith } from 'lodash-es';
1414
defineOptions({
15-
name: 'DataEdit',
15+
name: 'DataEdit'
1616
});
17-
const { dataSourceService, } = inject<IServices>('services') || {};
17+
const { dataSourceService } = inject<IServices>('services') || {};
1818
1919
const values = ref<Partial<IDataSourceSchema>>({});
2020
const dataSourceConfig = ref<FormConfig>([]);
2121
const drawerTitle = ref('');
2222
23-
defineEmits(['register'])
23+
defineEmits(['register']);
2424
25-
const [registerForm, {setFieldsValue, getFieldsValue, validate, resetFields, }] = useForm({
25+
const [registerForm, {setFieldsValue, getFieldsValue, validate, resetFields }] = useForm({
2626
labelWidth: 100,
2727
schemas: dataSourceConfig as any,
2828
showActionButtonGroup: false,
2929
baseColProps: {
30-
span: 24,
31-
},
30+
span: 24
31+
}
3232
});
3333
34-
const [registerDrawer, {closeDrawer, }] = useDrawerInner(async(obj: any) => {
34+
const [registerDrawer, {closeDrawer }] = useDrawerInner(async(obj: any) => {
3535
if (obj.key) {
3636
values.value = dataSourceService?.getDataSourceById(obj.key) || {};
3737
dataSourceConfig.value = dataSourceService?.getFormConfig(values.value.type) as any;
@@ -41,20 +41,21 @@ const [registerDrawer, {closeDrawer, }] = useDrawerInner(async(obj: any) => {
4141
drawerTitle.value = '新增';
4242
dataSourceConfig.value = dataSourceService?.getFormConfig(obj.type) as any;
4343
await setFieldsValue(mergeWith(
44-
{type: obj.type, },
45-
dataSourceService?.getFormValue(obj.type) || {},
44+
{type: obj.type },
45+
dataSourceService?.getFormValue(obj.type) || {}
4646
));
4747
}
4848
});
4949
5050
async function editSave() {
5151
await validate();
5252
const values = getFieldsValue();
53+
console.log('values', values);
5354
if (!values.fields) {
54-
values.fields = []
55+
values.fields = [];
5556
}
5657
if (!values.methods) {
57-
values.methods = []
58+
values.methods = [];
5859
}
5960
if (values.id) {
6061
dataSourceService?.update(values as IDataSourceSchema);

packages/editor/src/components/layouts/sidebar/data-source/index.vue

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -52,37 +52,37 @@ import { useDrawer } from '@quantum-design/vue3-antd-pc-ui';
5252
import DataEdit from './data-edit.vue';
5353
5454
defineOptions({
55-
name: 'DataSource',
55+
name: 'DataSource'
5656
});
5757
58-
const { editorService, dataSourceService, } = inject<IServices>('services') || {};
58+
const { editorService, dataSourceService } = inject<IServices>('services') || {};
5959
6060
const dataSources = computed(() => dataSourceService?.get('dataSources') || []);
6161
6262
const searchText = ref();
6363
6464
const datasourceTypeList = computed(() =>
6565
[
66-
{ label: '基础', value: 'base', },
67-
{ label: 'HTTP', value: 'http', }
66+
{ label: '基础', value: 'base' },
67+
{ label: 'HTTP', value: 'http' }
6868
].concat(dataSourceService?.get('datasourceTypeList') ?? [])
6969
);
7070
7171
function formatTree(type: 'fields' | 'methods', ds: IDataSourceSchema) {
7272
if (isArray(ds[type]) && ds[type].length > 0) {
7373
const enums = {
7474
fields: '数据',
75-
methods: '方法',
75+
methods: '方法'
7676
};
7777
const obj = {
7878
title: enums[type],
7979
key: type,
8080
children: ds[type].map((f) => {
8181
return {
8282
title: (f.title ?? '') + `(${f.name})`,
83-
key: f.name,
83+
key: f.name
8484
};
85-
}),
85+
})
8686
};
8787
return obj;
8888
}
@@ -103,20 +103,20 @@ const dataSourceList = computed(() => {
103103
return {
104104
title: ds.title + `(${ds.id})`,
105105
key: 'root' + ds.id,
106-
children,
106+
children
107107
};
108108
});
109109
});
110110
111111
function addDataSource(type: string) {
112112
openDrawer(true, {
113-
type,
113+
type
114114
});
115115
}
116116
function EditDataSource(key: string) {
117117
const realKey = key.replace('root', '');
118118
openDrawer(true, {
119-
key: realKey,
119+
key: realKey
120120
});
121121
}
122122
function deleteDataSource(key: string) {
@@ -125,11 +125,11 @@ function deleteDataSource(key: string) {
125125
title: '是否删除此条数据',
126126
onOk: () => {
127127
dataSourceService?.delete(realKey);
128-
},
128+
}
129129
});
130130
}
131131
132-
const [registerDrawer, {openDrawer, }] = useDrawer();
132+
const [registerDrawer, {openDrawer }] = useDrawer();
133133
134134
</script>
135135
<style lang='scss' scoped>

0 commit comments

Comments
 (0)