jianghu-ui 1.0.6 → 1.0.7
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/dist/jianghu-ui.css +181 -110
- package/dist/jianghu-ui.js +1 -1
- package/package.json +1 -1
- package/src/components/JhDrawer/JhDrawer.stories.js +6 -6
- package/src/components/JhDrawerForm/JhDrawerForm.vue +1 -1
- package/src/components/JhForm/JhForm.stories.js +114 -95
- package/src/components/JhForm/JhForm.vue +148 -21
- package/src/components/JhFormFields/JhFormFields.vue +33 -14
- package/src/components/JhModal/JhModal.stories.js +6 -6
- package/src/components/JhModal/JhModal.vue +1 -1
- package/src/components/JhModalForm/JhModalForm.vue +1 -1
- package/src/components/JhTable/JhTable.stories.js +134 -167
- package/src/components/JhTable/JhTable.vue +83 -23
- package/src/style/globalCSSVuetifyV4.css +1 -2
- package/src/components/JhAddressSelect/JhAddressSelect.md +0 -267
- package/src/components/JhCard/JhCard.md +0 -246
- package/src/components/JhCheckCard/JhCheckCard.md +0 -245
- package/src/components/JhConfirmDialog/JhConfirmDialog.md +0 -70
- package/src/components/JhDateRangePicker/JhDateRangePicker.md +0 -56
- package/src/components/JhDescriptions/JhDescriptions.md +0 -724
- package/src/components/JhDraggable/JhDraggable.md +0 -66
- package/src/components/JhDrawer/JhDrawer.md +0 -68
- package/src/components/JhDrawerForm/JhDrawerForm.md +0 -69
- package/src/components/JhEditableTable/JhEditableTable.md +0 -507
- package/src/components/JhFileInput/JhFileInput.md +0 -56
- package/src/components/JhForm/JhForm.md +0 -676
- package/src/components/JhFormFields/JhFormFields.md +0 -647
- package/src/components/JhFormList/JhFormList.md +0 -303
- package/src/components/JhJsonEditor/JhJsonEditor.md +0 -54
- package/src/components/JhLayout/JhLayout.md +0 -580
- package/src/components/JhList/JhList.md +0 -441
- package/src/components/JhMarkdownEditor/JhMarkdownEditor.md +0 -56
- package/src/components/JhMask/JhMask.md +0 -62
- package/src/components/JhMenu/JhMenu.md +0 -85
- package/src/components/JhModal/JhModal.md +0 -68
- package/src/components/JhModalForm/JhModalForm.md +0 -69
- package/src/components/JhPageContainer/JhPageContainer.md +0 -409
- package/src/components/JhQueryFilter/JhQueryFilter.md +0 -77
- package/src/components/JhScene/JhScene.md +0 -64
- package/src/components/JhStatisticCard/JhStatisticCard.md +0 -363
- package/src/components/JhStepsForm/JhStepsForm.md +0 -666
- package/src/components/JhTable/JhTable.md +0 -730
- package/src/components/JhTableAttachment/JhTableAttachment.md +0 -70
- package/src/components/JhToast/JhToast.md +0 -67
- package/src/components/JhTreeSelect/JhTreeSelect.md +0 -82
- package/src/components/JhWaterMark/JhWaterMark.md +0 -190
- package/src/components/README.md +0 -52
package/package.json
CHANGED
|
@@ -115,7 +115,7 @@ export default {
|
|
|
115
115
|
};
|
|
116
116
|
|
|
117
117
|
// 基础用法
|
|
118
|
-
export const
|
|
118
|
+
export const 基础用法 = {
|
|
119
119
|
render: (args) => ({
|
|
120
120
|
components: { JhDrawer },
|
|
121
121
|
data() {
|
|
@@ -188,7 +188,7 @@ export const Basic = {
|
|
|
188
188
|
};
|
|
189
189
|
|
|
190
190
|
// 左侧抽屉
|
|
191
|
-
export const
|
|
191
|
+
export const 左侧抽屉 = {
|
|
192
192
|
render: (args) => ({
|
|
193
193
|
components: { JhDrawer },
|
|
194
194
|
data() {
|
|
@@ -230,7 +230,7 @@ export const LeftDrawer = {
|
|
|
230
230
|
};
|
|
231
231
|
|
|
232
232
|
// 底部抽屉
|
|
233
|
-
export const
|
|
233
|
+
export const 底部抽屉 = {
|
|
234
234
|
render: (args) => ({
|
|
235
235
|
components: { JhDrawer },
|
|
236
236
|
data() {
|
|
@@ -282,7 +282,7 @@ export const BottomDrawer = {
|
|
|
282
282
|
};
|
|
283
283
|
|
|
284
284
|
// 自定义操作按钮
|
|
285
|
-
export const
|
|
285
|
+
export const 自定义操作按钮 = {
|
|
286
286
|
render: (args) => ({
|
|
287
287
|
components: { JhDrawer },
|
|
288
288
|
data() {
|
|
@@ -369,7 +369,7 @@ export const CustomActions = {
|
|
|
369
369
|
};
|
|
370
370
|
|
|
371
371
|
// 无按钮抽屉
|
|
372
|
-
export const
|
|
372
|
+
export const 无按钮抽屉 = {
|
|
373
373
|
render: (args) => ({
|
|
374
374
|
components: { JhDrawer },
|
|
375
375
|
data() {
|
|
@@ -416,7 +416,7 @@ export const NoButtons = {
|
|
|
416
416
|
};
|
|
417
417
|
|
|
418
418
|
// 宽度配置
|
|
419
|
-
export const
|
|
419
|
+
export const 宽度配置 = {
|
|
420
420
|
render: (args) => ({
|
|
421
421
|
components: { JhDrawer },
|
|
422
422
|
data() {
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
class="elevation-24"
|
|
10
10
|
>
|
|
11
11
|
<!-- 抽屉标题 -->
|
|
12
|
-
<v-row class="jh-drawer-header px-4 bg-white" no-gutters align="center">
|
|
12
|
+
<v-row class="jh-drawer-header px-4 bg-white sticky top-0 z-10" no-gutters align="center">
|
|
13
13
|
<span class="text-h7 font-weight-bold py-4">{{ title }}</span>
|
|
14
14
|
<v-spacer></v-spacer>
|
|
15
15
|
|
|
@@ -301,8 +301,8 @@ export const Grid栅格布局 = {
|
|
|
301
301
|
template: `
|
|
302
302
|
<JhForm v-bind="args">
|
|
303
303
|
<template #actions="{ validate, resetForm }">
|
|
304
|
-
<v-btn class="mr-2" text @click="resetForm">重置</v-btn>
|
|
305
|
-
<v-btn color="primary" @click="validate">提交</v-btn>
|
|
304
|
+
<v-btn class="mr-2 mt-4" text @click="resetForm">重置</v-btn>
|
|
305
|
+
<v-btn color="primary mt-4" @click="validate">提交</v-btn>
|
|
306
306
|
</template>
|
|
307
307
|
</JhForm>
|
|
308
308
|
`,
|
|
@@ -656,8 +656,8 @@ export const 行内布局 = {
|
|
|
656
656
|
<div>
|
|
657
657
|
<JhForm v-bind="args">
|
|
658
658
|
<template #actions="{ validate, resetForm }">
|
|
659
|
-
<v-btn color="primary" class="ml-2" @click="validate">查询</v-btn>
|
|
660
|
-
<v-btn text class="ml-2" @click="resetForm">重置</v-btn>
|
|
659
|
+
<v-btn color="primary" class="ml-2 mt-4" @click="validate">查询</v-btn>
|
|
660
|
+
<v-btn text class="ml-2 mt-4" @click="resetForm">重置</v-btn>
|
|
661
661
|
</template>
|
|
662
662
|
</JhForm>
|
|
663
663
|
</div>
|
|
@@ -1059,97 +1059,6 @@ export const 数据转换 = {
|
|
|
1059
1059
|
}),
|
|
1060
1060
|
};
|
|
1061
1061
|
|
|
1062
|
-
// onFinish 回调示例
|
|
1063
|
-
export const 提交回调 = {
|
|
1064
|
-
args: {
|
|
1065
|
-
fields: [
|
|
1066
|
-
{
|
|
1067
|
-
key: 'title',
|
|
1068
|
-
label: '标题',
|
|
1069
|
-
type: 'text',
|
|
1070
|
-
placeholder: '请输入标题',
|
|
1071
|
-
required: true,
|
|
1072
|
-
},
|
|
1073
|
-
{
|
|
1074
|
-
key: 'content',
|
|
1075
|
-
label: '内容',
|
|
1076
|
-
type: 'textarea',
|
|
1077
|
-
placeholder: '请输入内容',
|
|
1078
|
-
required: true,
|
|
1079
|
-
rows: 4,
|
|
1080
|
-
cols: { md: 12 },
|
|
1081
|
-
},
|
|
1082
|
-
],
|
|
1083
|
-
initialData: {
|
|
1084
|
-
title: '',
|
|
1085
|
-
content: '',
|
|
1086
|
-
},
|
|
1087
|
-
},
|
|
1088
|
-
render: (args) => ({
|
|
1089
|
-
components: { JhForm },
|
|
1090
|
-
data() {
|
|
1091
|
-
return {
|
|
1092
|
-
args: {
|
|
1093
|
-
...args,
|
|
1094
|
-
onFinish: this.handleFinish,
|
|
1095
|
-
onFinishFailed: this.handleFinishFailed,
|
|
1096
|
-
},
|
|
1097
|
-
loading: false,
|
|
1098
|
-
};
|
|
1099
|
-
},
|
|
1100
|
-
template: `
|
|
1101
|
-
<div>
|
|
1102
|
-
<JhForm v-bind="args">
|
|
1103
|
-
<template #actions="{ validate, resetForm }">
|
|
1104
|
-
<v-row class="mt-4">
|
|
1105
|
-
<v-col cols="12" class="text-right">
|
|
1106
|
-
<v-btn class="mr-2" @click="resetForm" :disabled="loading">重置</v-btn>
|
|
1107
|
-
<v-btn
|
|
1108
|
-
color="success"
|
|
1109
|
-
@click="validate"
|
|
1110
|
-
:loading="loading"
|
|
1111
|
-
>
|
|
1112
|
-
提交
|
|
1113
|
-
</v-btn>
|
|
1114
|
-
</v-col>
|
|
1115
|
-
</v-row>
|
|
1116
|
-
</template>
|
|
1117
|
-
</JhForm>
|
|
1118
|
-
<v-alert v-if="submitResult" :type="submitResult.type" class="mt-4">
|
|
1119
|
-
{{ submitResult.message }}
|
|
1120
|
-
</v-alert>
|
|
1121
|
-
</div>
|
|
1122
|
-
`,
|
|
1123
|
-
data() {
|
|
1124
|
-
return {
|
|
1125
|
-
submitResult: null,
|
|
1126
|
-
};
|
|
1127
|
-
},
|
|
1128
|
-
methods: {
|
|
1129
|
-
async handleFinish(values) {
|
|
1130
|
-
this.loading = true;
|
|
1131
|
-
this.submitResult = null;
|
|
1132
|
-
|
|
1133
|
-
// 模拟 API 调用
|
|
1134
|
-
await new Promise(resolve => setTimeout(resolve, 1500));
|
|
1135
|
-
|
|
1136
|
-
console.log('提交成功:', values);
|
|
1137
|
-
this.submitResult = {
|
|
1138
|
-
type: 'success',
|
|
1139
|
-
message: '提交成功! 数据: ' + JSON.stringify(values),
|
|
1140
|
-
};
|
|
1141
|
-
this.loading = false;
|
|
1142
|
-
},
|
|
1143
|
-
handleFinishFailed(values) {
|
|
1144
|
-
console.log('验证失败:', values);
|
|
1145
|
-
this.submitResult = {
|
|
1146
|
-
type: 'error',
|
|
1147
|
-
message: '表单验证失败,请检查必填项',
|
|
1148
|
-
};
|
|
1149
|
-
},
|
|
1150
|
-
},
|
|
1151
|
-
}),
|
|
1152
|
-
};
|
|
1153
1062
|
|
|
1154
1063
|
// 只读模式示例
|
|
1155
1064
|
export const 只读模式 = {
|
|
@@ -1227,6 +1136,116 @@ export const 只读模式 = {
|
|
|
1227
1136
|
},
|
|
1228
1137
|
};
|
|
1229
1138
|
|
|
1139
|
+
// 增强版提交功能示例
|
|
1140
|
+
export const 增强版提交功能 = {
|
|
1141
|
+
args: {
|
|
1142
|
+
fields: [
|
|
1143
|
+
{
|
|
1144
|
+
key: 'name',
|
|
1145
|
+
label: '姓名',
|
|
1146
|
+
type: 'text',
|
|
1147
|
+
placeholder: '请输入姓名',
|
|
1148
|
+
required: true,
|
|
1149
|
+
cols: { md: 6 },
|
|
1150
|
+
},
|
|
1151
|
+
{
|
|
1152
|
+
key: 'email',
|
|
1153
|
+
label: '邮箱',
|
|
1154
|
+
type: 'text',
|
|
1155
|
+
placeholder: '请输入邮箱',
|
|
1156
|
+
rules: 'email',
|
|
1157
|
+
required: true,
|
|
1158
|
+
cols: { md: 6 },
|
|
1159
|
+
},
|
|
1160
|
+
{
|
|
1161
|
+
key: 'phone',
|
|
1162
|
+
label: '手机号',
|
|
1163
|
+
type: 'text',
|
|
1164
|
+
placeholder: '请输入手机号',
|
|
1165
|
+
rules: 'phone',
|
|
1166
|
+
required: true,
|
|
1167
|
+
cols: { md: 12 },
|
|
1168
|
+
},
|
|
1169
|
+
],
|
|
1170
|
+
},
|
|
1171
|
+
render: (args) => ({
|
|
1172
|
+
components: { JhForm },
|
|
1173
|
+
data() {
|
|
1174
|
+
return {
|
|
1175
|
+
args,
|
|
1176
|
+
submitResult: null,
|
|
1177
|
+
};
|
|
1178
|
+
},
|
|
1179
|
+
template: `
|
|
1180
|
+
<div>
|
|
1181
|
+
<JhForm v-bind="args" ref="form" @submit-error="handleSubmitError">
|
|
1182
|
+
<template #actions="{ validate, resetForm }">
|
|
1183
|
+
<v-row class="mt-4">
|
|
1184
|
+
<v-col cols="12" class="text-right">
|
|
1185
|
+
<v-btn class="mr-2" @click="resetForm">重置</v-btn>
|
|
1186
|
+
<v-btn
|
|
1187
|
+
color="success"
|
|
1188
|
+
@click="handleSubmit"
|
|
1189
|
+
:loading="$refs.form?.submitLoading"
|
|
1190
|
+
>
|
|
1191
|
+
提交(增强版)
|
|
1192
|
+
</v-btn>
|
|
1193
|
+
</v-col>
|
|
1194
|
+
</v-row>
|
|
1195
|
+
</template>
|
|
1196
|
+
</JhForm>
|
|
1197
|
+
<v-alert
|
|
1198
|
+
v-if="submitResult"
|
|
1199
|
+
:type="submitResult.type"
|
|
1200
|
+
class="mt-4"
|
|
1201
|
+
>
|
|
1202
|
+
{{ submitResult.message }}
|
|
1203
|
+
</v-alert>
|
|
1204
|
+
<v-alert
|
|
1205
|
+
v-if="$refs.form?.submitError"
|
|
1206
|
+
type="error"
|
|
1207
|
+
class="mt-4"
|
|
1208
|
+
>
|
|
1209
|
+
提交错误: {{ $refs.form.submitError }}
|
|
1210
|
+
</v-alert>
|
|
1211
|
+
<div class="mt-4">
|
|
1212
|
+
<v-btn text @click="showFormState">查看表单状态</v-btn>
|
|
1213
|
+
</div>
|
|
1214
|
+
</div>
|
|
1215
|
+
`,
|
|
1216
|
+
methods: {
|
|
1217
|
+
async handleSubmit() {
|
|
1218
|
+
this.submitResult = null;
|
|
1219
|
+
|
|
1220
|
+
const result = await this.$refs.form.submit({
|
|
1221
|
+
showLoading: true,
|
|
1222
|
+
resetError: true
|
|
1223
|
+
});
|
|
1224
|
+
|
|
1225
|
+
if (result) {
|
|
1226
|
+
this.submitResult = {
|
|
1227
|
+
type: 'success',
|
|
1228
|
+
message: '提交成功!',
|
|
1229
|
+
};
|
|
1230
|
+
} else {
|
|
1231
|
+
this.submitResult = {
|
|
1232
|
+
type: 'error',
|
|
1233
|
+
message: '提交失败,请检查表单',
|
|
1234
|
+
};
|
|
1235
|
+
}
|
|
1236
|
+
},
|
|
1237
|
+
handleSubmitError(error) {
|
|
1238
|
+
console.error('提交错误:', error);
|
|
1239
|
+
},
|
|
1240
|
+
showFormState() {
|
|
1241
|
+
const state = this.$refs.form.getFormState();
|
|
1242
|
+
console.log('表单状态:', state);
|
|
1243
|
+
alert('表单状态已打印到控制台,请查看');
|
|
1244
|
+
},
|
|
1245
|
+
},
|
|
1246
|
+
}),
|
|
1247
|
+
};
|
|
1248
|
+
|
|
1230
1249
|
// 使用 JhFormFields 组合表单
|
|
1231
1250
|
export const 使用JhFormFields组合 = () => ({
|
|
1232
1251
|
components: { JhFormFields },
|
|
@@ -166,7 +166,7 @@ export default {
|
|
|
166
166
|
// 隐藏详情信息
|
|
167
167
|
hideDetails: {
|
|
168
168
|
type: [Boolean, String],
|
|
169
|
-
default:
|
|
169
|
+
default: true,
|
|
170
170
|
},
|
|
171
171
|
|
|
172
172
|
// 自定义标签样式类
|
|
@@ -251,6 +251,9 @@ export default {
|
|
|
251
251
|
data() {
|
|
252
252
|
return {
|
|
253
253
|
formData: {},
|
|
254
|
+
// 表单提交状态
|
|
255
|
+
submitLoading: false,
|
|
256
|
+
submitError: null,
|
|
254
257
|
};
|
|
255
258
|
},
|
|
256
259
|
|
|
@@ -350,7 +353,7 @@ export default {
|
|
|
350
353
|
// 只排除组件内部明确处理的事件,其他所有事件都透传给 v-form
|
|
351
354
|
const excludedEvents = [
|
|
352
355
|
// JhForm 特有的事件(不在 v-form 中)
|
|
353
|
-
'
|
|
356
|
+
'field-change'
|
|
354
357
|
];
|
|
355
358
|
|
|
356
359
|
const listeners = { ...this.$listeners || {} };
|
|
@@ -456,6 +459,27 @@ export default {
|
|
|
456
459
|
getForm() {
|
|
457
460
|
return this.$refs[this.formRef];
|
|
458
461
|
},
|
|
462
|
+
|
|
463
|
+
// 转发 v-form 的所有方法
|
|
464
|
+
...(() => {
|
|
465
|
+
const methods = {};
|
|
466
|
+
// 定义需要转发的 v-form 方法
|
|
467
|
+
const formMethods = ['validate', 'reset', 'resetValidation'];
|
|
468
|
+
|
|
469
|
+
formMethods.forEach(methodName => {
|
|
470
|
+
methods[methodName] = function(...args) {
|
|
471
|
+
const form = this.$refs[this.formRef];
|
|
472
|
+
if (form && typeof form[methodName] === 'function') {
|
|
473
|
+
return form[methodName](...args);
|
|
474
|
+
}
|
|
475
|
+
// 如果 v-form 不存在或方法不存在,返回默认值
|
|
476
|
+
if (methodName === 'validate') return true;
|
|
477
|
+
return undefined;
|
|
478
|
+
};
|
|
479
|
+
});
|
|
480
|
+
|
|
481
|
+
return methods;
|
|
482
|
+
})(),
|
|
459
483
|
|
|
460
484
|
// 获取表单数据
|
|
461
485
|
getFormData() {
|
|
@@ -518,28 +542,97 @@ export default {
|
|
|
518
542
|
return true;
|
|
519
543
|
},
|
|
520
544
|
|
|
521
|
-
//
|
|
522
|
-
async submit() {
|
|
523
|
-
const
|
|
524
|
-
|
|
525
|
-
|
|
545
|
+
// 提交表单(增强版,支持加载状态和错误处理)
|
|
546
|
+
async submit(options = {}) {
|
|
547
|
+
const {
|
|
548
|
+
validate = true,
|
|
549
|
+
transform = true,
|
|
550
|
+
showLoading = false,
|
|
551
|
+
resetError = true
|
|
552
|
+
} = options;
|
|
553
|
+
|
|
554
|
+
// 重置错误
|
|
555
|
+
if (resetError) {
|
|
556
|
+
this.submitError = null;
|
|
557
|
+
}
|
|
558
|
+
|
|
559
|
+
// 显示加载状态
|
|
560
|
+
if (showLoading) {
|
|
561
|
+
this.submitLoading = true;
|
|
562
|
+
}
|
|
563
|
+
|
|
564
|
+
try {
|
|
565
|
+
// 验证表单
|
|
566
|
+
if (validate) {
|
|
567
|
+
const isValid = await this.validate();
|
|
568
|
+
if (!isValid) {
|
|
569
|
+
// 调用 onFinishFailed 回调
|
|
570
|
+
if (this.onFinishFailed) {
|
|
571
|
+
this.onFinishFailed(this.formData);
|
|
572
|
+
}
|
|
573
|
+
return false;
|
|
574
|
+
}
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
// 转换数据
|
|
578
|
+
const transformedData = transform ? this.getTransformedData() : { ...this.formData };
|
|
579
|
+
|
|
580
|
+
// 触发 submit 事件
|
|
526
581
|
this.$emit('submit', transformedData);
|
|
527
582
|
|
|
528
583
|
// 调用 onFinish 回调
|
|
529
584
|
if (this.onFinish) {
|
|
530
|
-
|
|
531
|
-
await this.onFinish(transformedData);
|
|
532
|
-
} catch (error) {
|
|
533
|
-
console.error('Form submit error:', error);
|
|
534
|
-
}
|
|
585
|
+
await this.onFinish(transformedData);
|
|
535
586
|
}
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
587
|
+
|
|
588
|
+
return true;
|
|
589
|
+
} catch (error) {
|
|
590
|
+
console.error('Form submit error:', error);
|
|
591
|
+
this.submitError = error.message || '提交失败';
|
|
592
|
+
this.$emit('submit-error', error);
|
|
593
|
+
return false;
|
|
594
|
+
} finally {
|
|
595
|
+
// 隐藏加载状态
|
|
596
|
+
if (showLoading) {
|
|
597
|
+
this.submitLoading = false;
|
|
540
598
|
}
|
|
541
599
|
}
|
|
542
|
-
|
|
600
|
+
},
|
|
601
|
+
|
|
602
|
+
// 验证单个字段(增强版)
|
|
603
|
+
async validateField(fieldName) {
|
|
604
|
+
// 首先尝试通过 v-form 验证
|
|
605
|
+
const form = this.$refs[this.formRef];
|
|
606
|
+
if (form && form.validate) {
|
|
607
|
+
// v-form 的 validate 方法会验证所有字段
|
|
608
|
+
// 这里我们返回整体验证结果
|
|
609
|
+
return await this.validate();
|
|
610
|
+
}
|
|
611
|
+
|
|
612
|
+
// 如果 v-form 不存在,返回 true
|
|
613
|
+
return true;
|
|
614
|
+
},
|
|
615
|
+
|
|
616
|
+
// 获取表单状态
|
|
617
|
+
getFormState() {
|
|
618
|
+
return {
|
|
619
|
+
submitLoading: this.submitLoading,
|
|
620
|
+
submitError: this.submitError,
|
|
621
|
+
formData: { ...this.formData }
|
|
622
|
+
};
|
|
623
|
+
},
|
|
624
|
+
|
|
625
|
+
// 清除提交错误
|
|
626
|
+
clearSubmitError() {
|
|
627
|
+
this.submitError = null;
|
|
628
|
+
},
|
|
629
|
+
|
|
630
|
+
// 批量更新字段值
|
|
631
|
+
batchUpdateFields(values) {
|
|
632
|
+
Object.keys(values).forEach(key => {
|
|
633
|
+
this.$set(this.formData, key, values[key]);
|
|
634
|
+
this.handleFieldChange({ key, value: values[key] });
|
|
635
|
+
});
|
|
543
636
|
},
|
|
544
637
|
|
|
545
638
|
// 获取转换后的数据
|
|
@@ -604,10 +697,44 @@ export default {
|
|
|
604
697
|
}
|
|
605
698
|
|
|
606
699
|
/* 只读模式 */
|
|
607
|
-
.jh-form--readonly
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
700
|
+
.jh-form--readonly {
|
|
701
|
+
/* 只读模式整体样式 */
|
|
702
|
+
.jh-field-label {
|
|
703
|
+
/* 只读模式下的标签样式 */
|
|
704
|
+
color: rgba(0, 0, 0, 0.65);
|
|
705
|
+
font-weight: 500;
|
|
706
|
+
}
|
|
707
|
+
|
|
708
|
+
.jh-form-readonly-text {
|
|
709
|
+
/* 只读模式下的文本样式 */
|
|
710
|
+
padding: 6px 12px;
|
|
711
|
+
color: rgba(0, 0, 0, 0.87);
|
|
712
|
+
background-color: rgba(0, 0, 0, 0.04);
|
|
713
|
+
border-radius: 4px;
|
|
714
|
+
line-height: 1.5;
|
|
715
|
+
transition: all 0.2s ease;
|
|
716
|
+
}
|
|
717
|
+
|
|
718
|
+
/* 水平布局下的调整 */
|
|
719
|
+
&.jh-form--horizontal {
|
|
720
|
+
.jh-field-wrapper {
|
|
721
|
+
margin-bottom: 16px;
|
|
722
|
+
}
|
|
723
|
+
}
|
|
724
|
+
|
|
725
|
+
/* 垂直布局下的调整 */
|
|
726
|
+
&.jh-form--vertical {
|
|
727
|
+
.jh-field-wrapper {
|
|
728
|
+
margin-bottom: 16px;
|
|
729
|
+
}
|
|
730
|
+
}
|
|
731
|
+
|
|
732
|
+
/* 网格布局下的调整 */
|
|
733
|
+
&.jh-form--grid {
|
|
734
|
+
.jh-field-wrapper {
|
|
735
|
+
margin-bottom: 16px;
|
|
736
|
+
}
|
|
737
|
+
}
|
|
611
738
|
}
|
|
612
739
|
|
|
613
740
|
/* 字段标签 */
|
|
@@ -74,11 +74,6 @@
|
|
|
74
74
|
</v-tooltip>
|
|
75
75
|
</div>
|
|
76
76
|
|
|
77
|
-
<!-- 额外提示信息 -->
|
|
78
|
-
<div v-if="field.extra" class="jh-field-extra text-caption grey--text mb-2">
|
|
79
|
-
{{ field.extra }}
|
|
80
|
-
</div>
|
|
81
|
-
|
|
82
77
|
<!-- 只读模式展示 -->
|
|
83
78
|
<div v-if="isFieldReadonly(field)" class="jh-form-readonly-text">
|
|
84
79
|
{{ getReadonlyValue(field) }}
|
|
@@ -168,6 +163,7 @@
|
|
|
168
163
|
:multiple="field.multiple"
|
|
169
164
|
:chips="field.chips"
|
|
170
165
|
:hide-details="field.hideDetails || hideDetails"
|
|
166
|
+
small-chips
|
|
171
167
|
v-bind="field.props"
|
|
172
168
|
@change="handleChange(field.key, $event)"
|
|
173
169
|
@blur="handleBlur(field.key, $event)"
|
|
@@ -912,7 +908,7 @@ export default {
|
|
|
912
908
|
.jh-form-fields--bordered {
|
|
913
909
|
border: 1px solid rgba(0, 0, 0, 0.12);
|
|
914
910
|
border-radius: 4px;
|
|
915
|
-
padding: 16px;
|
|
911
|
+
padding: 15px 16px 30px;
|
|
916
912
|
}
|
|
917
913
|
|
|
918
914
|
.jh-form-fields-header {
|
|
@@ -943,10 +939,37 @@ export default {
|
|
|
943
939
|
margin-bottom: 0 !important;
|
|
944
940
|
}
|
|
945
941
|
|
|
946
|
-
.jh-form-fields--readonly
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
942
|
+
.jh-form-fields--readonly {
|
|
943
|
+
/* 只读模式整体样式 */
|
|
944
|
+
.jh-field-label {
|
|
945
|
+
/* 只读模式下的标签样式 */
|
|
946
|
+
color: rgba(0, 0, 0, 0.65);
|
|
947
|
+
font-weight: 500;
|
|
948
|
+
}
|
|
949
|
+
|
|
950
|
+
.jh-form-readonly-text {
|
|
951
|
+
/* 只读模式下的文本样式 */
|
|
952
|
+
padding: 6px 12px;
|
|
953
|
+
color: rgba(0, 0, 0, 0.87);
|
|
954
|
+
background-color: rgba(0, 0, 0, 0.04);
|
|
955
|
+
border-radius: 4px;
|
|
956
|
+
line-height: 1.5;
|
|
957
|
+
transition: all 0.2s ease;
|
|
958
|
+
}
|
|
959
|
+
|
|
960
|
+
/* 水平布局下的调整 */
|
|
961
|
+
&.jh-form-fields--horizontal {
|
|
962
|
+
.jh-field-wrapper {
|
|
963
|
+
margin-bottom: 16px;
|
|
964
|
+
}
|
|
965
|
+
}
|
|
966
|
+
|
|
967
|
+
/* 垂直布局下的调整 */
|
|
968
|
+
&.jh-form-fields--vertical {
|
|
969
|
+
.jh-field-wrapper {
|
|
970
|
+
margin-bottom: 16px;
|
|
971
|
+
}
|
|
972
|
+
}
|
|
950
973
|
}
|
|
951
974
|
|
|
952
975
|
.jh-field-label {
|
|
@@ -983,10 +1006,6 @@ export default {
|
|
|
983
1006
|
word-break: break-word;
|
|
984
1007
|
}
|
|
985
1008
|
|
|
986
|
-
.jh-field-extra {
|
|
987
|
-
margin-top: -8px;
|
|
988
|
-
line-height: 1.5;
|
|
989
|
-
}
|
|
990
1009
|
|
|
991
1010
|
.jh-color-preview {
|
|
992
1011
|
display: inline-block;
|
|
@@ -119,7 +119,7 @@ export default {
|
|
|
119
119
|
};
|
|
120
120
|
|
|
121
121
|
// 基础用法
|
|
122
|
-
export const
|
|
122
|
+
export const 基础用法 = {
|
|
123
123
|
render: (args) => ({
|
|
124
124
|
components: { JhModal },
|
|
125
125
|
data() {
|
|
@@ -194,7 +194,7 @@ export const Basic = {
|
|
|
194
194
|
};
|
|
195
195
|
|
|
196
196
|
// 全屏弹窗
|
|
197
|
-
export const
|
|
197
|
+
export const 全屏弹窗 = {
|
|
198
198
|
render: (args) => ({
|
|
199
199
|
components: { JhModal },
|
|
200
200
|
data() {
|
|
@@ -260,7 +260,7 @@ export const Fullscreen = {
|
|
|
260
260
|
};
|
|
261
261
|
|
|
262
262
|
// 自定义操作按钮
|
|
263
|
-
export const
|
|
263
|
+
export const 自定义操作按钮 = {
|
|
264
264
|
render: (args) => ({
|
|
265
265
|
components: { JhModal },
|
|
266
266
|
data() {
|
|
@@ -352,7 +352,7 @@ export const CustomActions = {
|
|
|
352
352
|
};
|
|
353
353
|
|
|
354
354
|
// 无操作区域
|
|
355
|
-
export const
|
|
355
|
+
export const 无操作区域 = {
|
|
356
356
|
render: (args) => ({
|
|
357
357
|
components: { JhModal },
|
|
358
358
|
data() {
|
|
@@ -416,7 +416,7 @@ export const NoActions = {
|
|
|
416
416
|
};
|
|
417
417
|
|
|
418
418
|
// 不同尺寸
|
|
419
|
-
export const
|
|
419
|
+
export const 不同尺寸 = {
|
|
420
420
|
render: (args) => ({
|
|
421
421
|
components: { JhModal },
|
|
422
422
|
data() {
|
|
@@ -525,7 +525,7 @@ export const DifferentSizes = {
|
|
|
525
525
|
};
|
|
526
526
|
|
|
527
527
|
// 非持久化弹窗
|
|
528
|
-
export const
|
|
528
|
+
export const 非持久化弹窗 = {
|
|
529
529
|
render: (args) => ({
|
|
530
530
|
components: { JhModal },
|
|
531
531
|
data() {
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
>
|
|
11
11
|
<v-card>
|
|
12
12
|
<!-- 标题栏 -->
|
|
13
|
-
<v-card-title class="d-flex align-center justify-space-between pa-4
|
|
13
|
+
<v-card-title class="d-flex align-center justify-space-between pa-4 sticky top-0 z-10 bg-white darken-1">
|
|
14
14
|
<span class="text-h6">{{ title }}</span>
|
|
15
15
|
<v-btn
|
|
16
16
|
v-if="closable"
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
>
|
|
9
9
|
<v-card>
|
|
10
10
|
<!-- 标题栏 -->
|
|
11
|
-
<v-card-title class="d-flex align-center justify-space-between pa-4">
|
|
11
|
+
<v-card-title class="d-flex align-center justify-space-between pa-4 sticky top-0 z-10 bg-white darken-1">
|
|
12
12
|
<span class="text-h6">{{ title }}</span>
|
|
13
13
|
<v-btn
|
|
14
14
|
v-if="closable"
|