@pisell/materials 6.2.39 → 6.2.40
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/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/index.js +1 -1
- package/build/lowcode/meta.js +4 -4
- package/build/lowcode/preview.js +7 -7
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +36 -21
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +35 -20
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.js +23 -12
- package/es/components/dataSourceComponents/fields/Upload/BaseUpload.js +199 -19
- package/es/components/dataSourceComponents/fields/Upload/CameraPopover.js +66 -0
- package/es/components/dataSourceComponents/fields/Upload/index.less +35 -3
- package/es/components/filter/types.d.ts +1 -0
- package/es/components/pisellCamera/index.js +228 -0
- package/es/components/pisellCamera/index.less +131 -0
- package/es/components/pisellWalletPassCard/index.d.ts +1 -0
- package/es/components/pisellWalletPassCard/index.js +6 -1
- package/es/components/table/hooks/useTableSetting.js +1 -1
- package/es/components/walletCard/index.js +29 -3
- package/es/components/walletCard/index.less +27 -0
- package/es/locales/en-US.js +83 -69
- package/es/locales/zh-CN.js +84 -70
- package/es/locales/zh-TW.js +84 -70
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.js +10 -4
- package/lib/components/dataSourceComponents/fields/Upload/BaseUpload.js +168 -5
- package/lib/components/dataSourceComponents/fields/Upload/CameraPopover.js +95 -0
- package/lib/components/dataSourceComponents/fields/Upload/index.less +35 -3
- package/lib/components/filter/types.d.ts +1 -0
- package/lib/components/pisellCamera/index.js +222 -0
- package/lib/components/pisellCamera/index.less +131 -0
- package/lib/components/pisellWalletPassCard/index.d.ts +1 -0
- package/lib/components/pisellWalletPassCard/index.js +9 -1
- package/lib/components/table/hooks/useTableSetting.js +1 -1
- package/lib/components/walletCard/index.js +27 -3
- package/lib/components/walletCard/index.less +27 -0
- package/lib/locales/en-US.js +15 -1
- package/lib/locales/zh-CN.js +15 -1
- package/lib/locales/zh-TW.js +15 -1
- package/lowcode/data-source-table/meta.ts +119 -66
- package/lowcode/form-item-upload/meta.ts +20 -5
- package/lowcode/pisell-upload/meta.ts +8 -0
- package/lowcode/pisell-wallet-pass-card/meta.ts +19 -0
- package/lowcode/wallet-card/meta.ts +81 -63
- package/package.json +4 -3
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +0 -97
- package/es/components/dataSourceComponents/fields/Upload/type.d.ts +0 -37
- package/es/components/pisell-config-provider/context.d.ts +0 -20
- package/es/components/pisell-config-provider/index.d.ts +0 -12
- package/es/components/pisellAdjustPrice/index.d.ts +0 -4
- package/es/components/pisellAdjustPrice/type.d.ts +0 -20
- package/es/components/pisellCheckboxGroup/index.d.ts +0 -37
- package/es/components/pisellQRScanner/index.d.ts +0 -37
- package/es/components/pisellText/components/Amount/index.d.ts +0 -20
- package/es/components/table/Table/AddFieldModal/index.d.ts +0 -3
- package/es/components/virtual-keyboard/BaseNumberKeyboard/Presets.d.ts +0 -11
- package/es/components/virtual-keyboard/BaseNumberKeyboard/index.d.ts +0 -21
- package/es/components/virtual-keyboard/Number/index.d.ts +0 -5
- package/es/components/virtual-keyboard/Number/types.d.ts +0 -25
- package/es/components/walletCard/index.d.ts +0 -67
- package/es/locales/en-US.d.ts +0 -278
- package/es/locales/zh-CN.d.ts +0 -273
- package/es/locales/zh-TW.d.ts +0 -273
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +0 -97
- package/lib/components/dataSourceComponents/fields/Upload/type.d.ts +0 -37
- package/lib/components/pisell-config-provider/context.d.ts +0 -20
- package/lib/components/pisell-config-provider/index.d.ts +0 -12
- package/lib/components/pisellAdjustPrice/index.d.ts +0 -4
- package/lib/components/pisellAdjustPrice/type.d.ts +0 -20
- package/lib/components/pisellCheckboxGroup/index.d.ts +0 -37
- package/lib/components/pisellQRScanner/index.d.ts +0 -37
- package/lib/components/pisellText/components/Amount/index.d.ts +0 -20
- package/lib/components/table/Table/AddFieldModal/index.d.ts +0 -3
- package/lib/components/virtual-keyboard/BaseNumberKeyboard/Presets.d.ts +0 -11
- package/lib/components/virtual-keyboard/BaseNumberKeyboard/index.d.ts +0 -21
- package/lib/components/virtual-keyboard/Number/index.d.ts +0 -5
- package/lib/components/virtual-keyboard/Number/types.d.ts +0 -25
- package/lib/components/walletCard/index.d.ts +0 -67
- package/lib/locales/en-US.d.ts +0 -278
- package/lib/locales/zh-CN.d.ts +0 -273
- package/lib/locales/zh-TW.d.ts +0 -273
package/es/locales/zh-TW.js
CHANGED
|
@@ -1,50 +1,50 @@
|
|
|
1
1
|
export default {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
2
|
+
'table-filter-search': '搜索',
|
|
3
|
+
'table-filter-clear': '清除',
|
|
4
|
+
'table-filter-filter': '篩選',
|
|
5
|
+
'table-filter-min': '最小',
|
|
6
|
+
'table-filter-max': '最大',
|
|
7
|
+
'table-pagination-previous': '上一頁',
|
|
8
|
+
'table-pagination-next': '下一頁',
|
|
9
|
+
'table-pagination-total': function tablePaginationTotal(current, total) {
|
|
10
10
|
return "\u7B2C".concat(current, "\u9801 \u5171").concat(total, "\u9801");
|
|
11
11
|
},
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
12
|
+
'select-dropdown-render-select-all': '全選',
|
|
13
|
+
'select-dropdown-render-search': '搜索',
|
|
14
|
+
'sort-button-text': '排序',
|
|
15
|
+
'sort-oldest-to-newest': '從舊到新',
|
|
16
|
+
'sort-newest-to-oldest': '從新到舊',
|
|
17
|
+
'sort-a-z': 'A 到 Z',
|
|
18
|
+
'sort-z-a': 'Z 到 A',
|
|
19
|
+
'sort-from-morning-to-night': '從早到晚',
|
|
20
|
+
'sort-from-evening-to-morning': '從晚到早',
|
|
21
|
+
'sort-0-9': '0 ~ 9',
|
|
22
|
+
'sort-9-0': '9 ~ 0',
|
|
23
|
+
'table-action-filter-button': '篩選',
|
|
24
|
+
'table-action-filter-quick-filter': '快速篩選',
|
|
25
|
+
'table-action-filter-quick-filter-tip': function tableActionFilterQuickFilterTip(count) {
|
|
26
26
|
return "\u5728\u9801\u9762\u4E0A\u76F4\u63A5\u555F\u7528\u5FEB\u901F\u7BE9\u9078\uFF0C\u4EE5\u4FBF\u9032\u884C\u65B9\u4FBF\u7684\u7BE9\u9078\u64CD\u4F5C\uFF0C\u6700\u591A\u5141\u8A31\u4F7F\u7528".concat(count, "\u500B\u7BE9\u9078\u5668\u3002");
|
|
27
27
|
},
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
return
|
|
28
|
+
'table-action-filter-other-filter': '篩選',
|
|
29
|
+
'table-action-filter-other-filter-tip': function tableActionFilterOtherFilterTip() {
|
|
30
|
+
return '在清單中選擇篩選條件進行篩選操作,並顯示對應的結果。';
|
|
31
31
|
},
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
32
|
+
'table-action-group-by-title': '分組條件',
|
|
33
|
+
'table-action-group-by-title-tip': '請從下拉式選單中選擇要分組的字段,以便更好地組織和瀏覽數據。',
|
|
34
|
+
'table-action-column-title': '表頭設置',
|
|
35
|
+
'table-column-group-records': '條記錄',
|
|
36
|
+
'table-column-group-lock-tip': '固定列不可移動順序',
|
|
37
|
+
'table-column-drag-sort-disabled-tip': '已開啟自動排序,無法手動拖曳',
|
|
38
|
+
'table-action-filter-no-filter': '沒有可用的篩選器。',
|
|
39
|
+
'table-action-range-picker-presets-today': '今天',
|
|
40
|
+
'table-action-range-picker-presets-yesterday': '昨天',
|
|
41
|
+
'table-action-range-picker-presets-last-3-day': '過去3天',
|
|
42
|
+
'table-action-range-picker-presets-last-7-day': '過去7天',
|
|
43
|
+
'table-action-range-picker-presets-last-14-day': '過去14天',
|
|
44
|
+
'table-action-range-picker-presets-last-30-day': '過去30天',
|
|
45
|
+
'table-action-range-picker-presets-last-90-day': '過去90天',
|
|
46
|
+
'virtual-keyboard-time-now': '此刻',
|
|
47
|
+
'virtual-keyboard-time-ok': '確定',
|
|
48
48
|
'batch-editor-batch-edit': '批量編輯',
|
|
49
49
|
'batch-editor-actions': '操作',
|
|
50
50
|
'batch-editor-remove': '移除',
|
|
@@ -53,7 +53,7 @@ export default {
|
|
|
53
53
|
'batch-editor-search': '搜索',
|
|
54
54
|
'batch-editor-confirm': '確認',
|
|
55
55
|
'batch-editor-batch-remove': '批量移除',
|
|
56
|
-
'batch-editor-what-price':
|
|
56
|
+
'batch-editor-what-price': '什麼價格',
|
|
57
57
|
'batch-editor-quick-edit': '快速編輯',
|
|
58
58
|
'batch-editor-quick-edit-title': function batchEditorQuickEditTitle(product, num) {
|
|
59
59
|
return "\u60A8\u5DF2\u9078\u64C7 ".concat(product, " \u7B49").concat(num, "\u4EF6\u7522\u54C1");
|
|
@@ -131,7 +131,7 @@ export default {
|
|
|
131
131
|
'date-picker-first_day_of_next_month': '下個月的第一天',
|
|
132
132
|
'date-picker-last_day_of_last_month': '上個月的最後一天',
|
|
133
133
|
'date-picker-invalid-date': '無效日期',
|
|
134
|
-
|
|
134
|
+
'date-picker-apply': '确定',
|
|
135
135
|
'date-picker-shortcut-custom': '自定義',
|
|
136
136
|
'pisell-input-copy-success': '復製成功',
|
|
137
137
|
'pisell-input-copy': '復製',
|
|
@@ -155,14 +155,15 @@ export default {
|
|
|
155
155
|
'pisell-wallet-pass-card-required': '此欄位為必填',
|
|
156
156
|
'pisell-wallet-pass-card-expireDate': '長期',
|
|
157
157
|
// 金额修改组件
|
|
158
|
-
'pisell-adjust-price-price-override':
|
|
159
|
-
'pisell-adjust-price-discount':
|
|
160
|
-
'pisell-adjust-price-discount-amount':
|
|
161
|
-
'pisell-adjust-price-discount-percentage':
|
|
162
|
-
'pisell-adjust-price-total-after-discount':
|
|
163
|
-
'pisell-adjust-price-discount-can-be-maximum':
|
|
158
|
+
'pisell-adjust-price-price-override': '一口價',
|
|
159
|
+
'pisell-adjust-price-discount': '折扣',
|
|
160
|
+
'pisell-adjust-price-discount-amount': '金額',
|
|
161
|
+
'pisell-adjust-price-discount-percentage': '百分比',
|
|
162
|
+
'pisell-adjust-price-total-after-discount': '打折后總價',
|
|
163
|
+
'pisell-adjust-price-discount-can-be-maximum': '折扣最高可達',
|
|
164
164
|
'pisell-discount-card-title': '折扣',
|
|
165
165
|
'pisell-discount-card-unit': '折扣',
|
|
166
|
+
'pisell-discount-card-fixed-amount-prefix': '立減',
|
|
166
167
|
// 数据源表格
|
|
167
168
|
'pisell-data-source-table-add': '添加',
|
|
168
169
|
'pisell-data-source-table-edit': '編輯',
|
|
@@ -197,6 +198,7 @@ export default {
|
|
|
197
198
|
'walletCard-done': '完成',
|
|
198
199
|
'walletCard-qrcode': '二維碼',
|
|
199
200
|
'walletCard-barcode': '條形碼',
|
|
201
|
+
'walletCard-viewPin': '查看PIN',
|
|
200
202
|
// 上传组件
|
|
201
203
|
'pisell-upload-button': '上傳',
|
|
202
204
|
'pisell-upload-setting-size-error': function pisellUploadSettingSizeError(maxSize) {
|
|
@@ -272,7 +274,7 @@ export default {
|
|
|
272
274
|
'pisell-lowcode-app-version-control-new-version': '新版本',
|
|
273
275
|
'pisell-lowcode-app-version-control-promote-to-live': '發布正式版',
|
|
274
276
|
'pisell-lowcode-app-version-control-promote-version': function pisellLowcodeAppVersionControlPromoteVersion(version) {
|
|
275
|
-
return "\u767C\u5E03\u7248\u672C ".concat(version ||
|
|
277
|
+
return "\u767C\u5E03\u7248\u672C ".concat(version || '', "?");
|
|
276
278
|
},
|
|
277
279
|
'pisell-lowcode-app-version-control-promote-version-describe': '您確定要發佈此版本嗎?',
|
|
278
280
|
'pisell-lowcode-app-version-control-promote-version-ok': '發布',
|
|
@@ -284,27 +286,27 @@ export default {
|
|
|
284
286
|
'pisell-lowcode-navigation-menu-add-sub-menu': '添加子菜單',
|
|
285
287
|
'pisell-lowcode-navigation-menu-add-page': '添加頁面',
|
|
286
288
|
'pisell-lowcode-navigation-menu-add-page-tip': '沒有找到導航, 請添加子菜單或頁面。',
|
|
287
|
-
'pisell-lowcode-navigation-menu-tag-base':
|
|
288
|
-
'pisell-lowcode-navigation-menu-tag-proCode':
|
|
289
|
-
'pisell-lowcode-navigation-menu-tag-pisell1':
|
|
290
|
-
'pisell-lowcode-navigation-menu-tag-group':
|
|
291
|
-
'pisell-lowcode-navigation-menu-tag-sub-menu':
|
|
292
|
-
'pisell-lowcode-navigation-menu-tag-custom':
|
|
289
|
+
'pisell-lowcode-navigation-menu-tag-base': '基础',
|
|
290
|
+
'pisell-lowcode-navigation-menu-tag-proCode': 'Pro code',
|
|
291
|
+
'pisell-lowcode-navigation-menu-tag-pisell1': 'Pisell 1.0',
|
|
292
|
+
'pisell-lowcode-navigation-menu-tag-group': '分組',
|
|
293
|
+
'pisell-lowcode-navigation-menu-tag-sub-menu': '子菜單',
|
|
294
|
+
'pisell-lowcode-navigation-menu-tag-custom': '自定義',
|
|
293
295
|
// 应用标识符
|
|
294
296
|
'pisell-data-source-form-app-identifier-pattern': '只能包含小寫字母、數字、連字符、點和下劃線',
|
|
295
297
|
'pisell-data-source-form-app-identifier-start-with-letter': '必須以字母開頭',
|
|
296
298
|
'pisell-data-source-form-app-identifier-special-ends': '不能以連字符、點或下劃線結尾',
|
|
297
299
|
'pisell-data-source-form-app-identifier-consecutive-special': '不能包含連續的連字符、點或下劃線',
|
|
298
300
|
// QR Scanner 相關文案
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
301
|
+
'qrscanner-loading': '正在識別二維碼...',
|
|
302
|
+
'qrscanner-success': '識別成功: ',
|
|
303
|
+
'qrscanner-success-qrcode': '二維碼識別成功: ',
|
|
304
|
+
'qrscanner-success-barcode': '條形碼識別成功: ',
|
|
305
|
+
'qrscanner-error-upload-image': '請上傳圖片文件',
|
|
306
|
+
'qrscanner-error-load-failed': '讀取文件失敗',
|
|
307
|
+
'qrscanner-error-no-code': '未檢測到二維碼或條形碼',
|
|
308
|
+
'qrscanner-error-camera-init': '無法啟動攝像頭,請確保已授權',
|
|
309
|
+
'qrscanner-error-process-image': '處理圖像時出錯',
|
|
308
310
|
// 登录注册组件
|
|
309
311
|
'pisell-login-and-register-title': '登入到您的帳戶',
|
|
310
312
|
'pisell-login-and-register-subtitle': '歡迎回來!請輸入您的詳細信息。',
|
|
@@ -319,7 +321,7 @@ export default {
|
|
|
319
321
|
'pisell-login-and-register-google': '繼續使用Google',
|
|
320
322
|
'pisell-login-and-register-facebook': '繼續使用Facebook',
|
|
321
323
|
'pisell-login-and-register-apple': '繼續使用Apple',
|
|
322
|
-
'pisell-login-and-register-sign-up':
|
|
324
|
+
'pisell-login-and-register-sign-up': '沒有帳戶?註冊',
|
|
323
325
|
'pisell-login-and-register-login-tab': '登入',
|
|
324
326
|
'pisell-login-and-register-register-tab': '註冊',
|
|
325
327
|
'pisell-login-and-register-register-email-placeholder': '輸入您的電子郵件',
|
|
@@ -327,8 +329,20 @@ export default {
|
|
|
327
329
|
'pisell-login-and-register-register-button-text': '創建帳戶',
|
|
328
330
|
'pisell-login-and-register-remember-me': '記住我',
|
|
329
331
|
'pisell-login-and-register-forgot-password': '忘記密碼?',
|
|
330
|
-
'pisell2.text.goodpass.product-vouchers':
|
|
331
|
-
'pisell2.text.goodpass.last-settlement':
|
|
332
|
-
'pisell2.text.goodpass.view-more':
|
|
333
|
-
'pisell2.text.goodpass.save':
|
|
332
|
+
'pisell2.text.goodpass.product-vouchers': '優惠促銷',
|
|
333
|
+
'pisell2.text.goodpass.last-settlement': '(上次結算)',
|
|
334
|
+
'pisell2.text.goodpass.view-more': '查看更多',
|
|
335
|
+
'pisell2.text.goodpass.save': '節省',
|
|
336
|
+
// 相机组件
|
|
337
|
+
'pisell-camera-no-camera-accessible': '沒有找到攝像頭',
|
|
338
|
+
'pisell-camera-permission-denied': '沒有權限使用攝像頭',
|
|
339
|
+
'pisell-camera-switch-camera': '切換攝像頭',
|
|
340
|
+
'pisell-camera-canvas': 'canvas不支持',
|
|
341
|
+
'pisell-camera-checking': '正在檢測攝像頭...',
|
|
342
|
+
'pisell-camera-no-camera-desc': '請檢查設備是否連接攝像頭或授權瀏覽器訪問攝像頭',
|
|
343
|
+
// 拍照组件
|
|
344
|
+
'pisell-upload-camera-local-files': '本地文件',
|
|
345
|
+
'pisell-upload-camera-capture': '拍攝/拍照',
|
|
346
|
+
'pisell-upload-camera-retake': '重拍',
|
|
347
|
+
'pisell-upload-camera-use': '使用照片'
|
|
334
348
|
};
|
|
@@ -117,13 +117,15 @@ var useTableProps = (props) => {
|
|
|
117
117
|
openDrawer(item);
|
|
118
118
|
});
|
|
119
119
|
const handleDelete = (0, import_ahooks.useMemoizedFn)(
|
|
120
|
-
async (record, softDelete) => {
|
|
120
|
+
async (record, softDelete, customDeleteAction) => {
|
|
121
121
|
try {
|
|
122
122
|
registerValueVariable == null ? void 0 : registerValueVariable(componentId, {
|
|
123
123
|
currentRecord: { ...record }
|
|
124
124
|
});
|
|
125
125
|
setTimeout(async () => {
|
|
126
|
-
if (
|
|
126
|
+
if (customDeleteAction) {
|
|
127
|
+
await customDeleteAction(record);
|
|
128
|
+
} else if (softDelete) {
|
|
127
129
|
const deleteTime = (0, import_dayjs.default)().format("YYYY-MM-DD HH:mm:ss");
|
|
128
130
|
await (update == null ? void 0 : update.runAsync({
|
|
129
131
|
...record,
|
|
@@ -170,7 +172,11 @@ var useTableProps = (props) => {
|
|
|
170
172
|
okText: (0, import_locales.getText)("pisell-delete-confirm-ok"),
|
|
171
173
|
cancelText: (0, import_locales.getText)("pisell-delete-confirm-cancel"),
|
|
172
174
|
onOk: () => {
|
|
173
|
-
handleDelete(
|
|
175
|
+
handleDelete(
|
|
176
|
+
record,
|
|
177
|
+
item == null ? void 0 : item.softDelete,
|
|
178
|
+
item == null ? void 0 : item.customDeleteAction
|
|
179
|
+
);
|
|
174
180
|
}
|
|
175
181
|
});
|
|
176
182
|
return;
|
|
@@ -274,7 +280,7 @@ var useTableProps = (props) => {
|
|
|
274
280
|
getInitialValues
|
|
275
281
|
}
|
|
276
282
|
);
|
|
277
|
-
dom.__proto__.
|
|
283
|
+
dom.__proto__.__items = propsFilter == null ? void 0 : propsFilter.items;
|
|
278
284
|
return dom;
|
|
279
285
|
}, [propsFilter, search]);
|
|
280
286
|
const onRow = (0, import_ahooks.useMemoizedFn)((record) => {
|
|
@@ -46,6 +46,7 @@ var import_locales = require("../../../../locales");
|
|
|
46
46
|
var import_constants = require("./constants");
|
|
47
47
|
var import_usePlatform = require("../../hooks/usePlatform");
|
|
48
48
|
var import_utils2 = require("./utils");
|
|
49
|
+
var import_CameraPopover = __toESM(require("./CameraPopover"));
|
|
49
50
|
var import_shopUploadServe = require("./shopUploadServe");
|
|
50
51
|
var import_fallback = __toESM(require("./fallback.png"));
|
|
51
52
|
var import_index = require("./index.less");
|
|
@@ -67,6 +68,7 @@ var BaseUpload = (props) => {
|
|
|
67
68
|
onChange,
|
|
68
69
|
mediaUploadUrl: propsMediaUploadUrl,
|
|
69
70
|
getHeaders: propsGetHeaders,
|
|
71
|
+
allowCamera,
|
|
70
72
|
...restProps
|
|
71
73
|
} = props;
|
|
72
74
|
const isShop = (0, import_usePlatform.useIsShop)();
|
|
@@ -76,6 +78,8 @@ var BaseUpload = (props) => {
|
|
|
76
78
|
const [open, setOpen] = (0, import_react.useState)(false);
|
|
77
79
|
const [editMultilingualFile, setEditMultilingualFile] = (0, import_react.useState)(null);
|
|
78
80
|
const fileListRef = (0, import_react.useRef)([]);
|
|
81
|
+
const uploadButtonRef = (0, import_react.useRef)(null);
|
|
82
|
+
const uploadRef = (0, import_react.useRef)(null);
|
|
79
83
|
(0, import_react.useEffect)(() => {
|
|
80
84
|
fileListRef.current = fileList;
|
|
81
85
|
}, [fileList]);
|
|
@@ -140,9 +144,7 @@ var BaseUpload = (props) => {
|
|
|
140
144
|
multilingualFileList: item.multilingualFileList || (0, import_utils2.createMultilingualFileList)(
|
|
141
145
|
((_b = (_a = item.response) == null ? void 0 : _a.data) == null ? void 0 : _b.url) || item.url || ""
|
|
142
146
|
),
|
|
143
|
-
multilingual: item.multilingual || (0, import_utils2.createMultilingualData)(
|
|
144
|
-
((_d = (_c = item.response) == null ? void 0 : _c.data) == null ? void 0 : _d.url) || item.url || ""
|
|
145
|
-
)
|
|
147
|
+
multilingual: item.multilingual || (0, import_utils2.createMultilingualData)(((_d = (_c = item.response) == null ? void 0 : _c.data) == null ? void 0 : _d.url) || item.url || "")
|
|
146
148
|
};
|
|
147
149
|
});
|
|
148
150
|
});
|
|
@@ -319,6 +321,7 @@ var BaseUpload = (props) => {
|
|
|
319
321
|
}, []);
|
|
320
322
|
const beforeUpload = (0, import_react.useCallback)(
|
|
321
323
|
async (file, newFileList) => {
|
|
324
|
+
console.log("beforeUpload000", file, newFileList);
|
|
322
325
|
let currentFileCount = 1;
|
|
323
326
|
newFileList.forEach((item, index) => {
|
|
324
327
|
if (item.uid === file.uid) {
|
|
@@ -365,7 +368,8 @@ var BaseUpload = (props) => {
|
|
|
365
368
|
{
|
|
366
369
|
className: "pisell-upload-button",
|
|
367
370
|
type: "button",
|
|
368
|
-
disabled: restProps.disabled
|
|
371
|
+
disabled: restProps.disabled,
|
|
372
|
+
ref: uploadButtonRef
|
|
369
373
|
},
|
|
370
374
|
/* @__PURE__ */ import_react.default.createElement(import_icons.PlusOutlined, null),
|
|
371
375
|
/* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-upload-text" }, (0, import_locales.getText)("pisell-upload-button")),
|
|
@@ -460,7 +464,166 @@ var BaseUpload = (props) => {
|
|
|
460
464
|
className: "pisell-data-source-upload",
|
|
461
465
|
...customRequest
|
|
462
466
|
};
|
|
463
|
-
|
|
467
|
+
const onCameraChange = (file) => {
|
|
468
|
+
console.log("onCameraChange", file);
|
|
469
|
+
if (fileList.length >= calcMaxCount) {
|
|
470
|
+
countError.run((0, import_locales.getText)("pisell-upload-max-count-error")(calcMaxCount));
|
|
471
|
+
return;
|
|
472
|
+
}
|
|
473
|
+
const fileType = (0, import_utils2.getFileType)(file.name);
|
|
474
|
+
const typeMaxSize = typeMaxSizeMap == null ? void 0 : typeMaxSizeMap[fileType];
|
|
475
|
+
const _maxSize = typeMaxSize || maxSize || 10;
|
|
476
|
+
if (file.size > _maxSize * 1024 * 1024) {
|
|
477
|
+
sizeError.run((0, import_locales.getText)("pisell-upload-setting-size-error")(_maxSize));
|
|
478
|
+
return import_antd.Upload.LIST_IGNORE;
|
|
479
|
+
}
|
|
480
|
+
const pointSuffix = (0, import_utils2.getPointSuffix)(file.name);
|
|
481
|
+
if (accept !== "" && !accept.includes(pointSuffix)) {
|
|
482
|
+
typeError.run((0, import_locales.getText)("pisell-upload-setting-type-error")(pointSuffix));
|
|
483
|
+
return import_antd.Upload.LIST_IGNORE;
|
|
484
|
+
}
|
|
485
|
+
const uploadFileObj = {
|
|
486
|
+
uid: file.uid || `camera-${Date.now()}`,
|
|
487
|
+
name: file.name || `camera-${Date.now()}.jpg`,
|
|
488
|
+
status: "uploading",
|
|
489
|
+
url: file.url || file.thumbUrl,
|
|
490
|
+
thumbUrl: file.thumbUrl || file.url,
|
|
491
|
+
originFileObj: file.originFileObj || file,
|
|
492
|
+
lastModified: file.lastModified || Date.now(),
|
|
493
|
+
lastModifiedDate: file.lastModifiedDate || /* @__PURE__ */ new Date(),
|
|
494
|
+
type: file.type || "image/jpeg",
|
|
495
|
+
size: file.size,
|
|
496
|
+
// 如果是多语言模式,初始化多语言数据结构
|
|
497
|
+
...enableMultilingual && {
|
|
498
|
+
multilingualFileList: (0, import_utils2.createMultilingualFileList)(""),
|
|
499
|
+
multilingual: (0, import_utils2.createMultilingualData)("")
|
|
500
|
+
}
|
|
501
|
+
};
|
|
502
|
+
setFileList((prev) => {
|
|
503
|
+
const newFileList = [...prev, uploadFileObj];
|
|
504
|
+
if (!multiple && newFileList.length > 1) {
|
|
505
|
+
return [uploadFileObj];
|
|
506
|
+
}
|
|
507
|
+
return newFileList;
|
|
508
|
+
});
|
|
509
|
+
const fileObj = uploadFileObj.originFileObj;
|
|
510
|
+
if (fileObj) {
|
|
511
|
+
if (isShop) {
|
|
512
|
+
(0, import_shopUploadServe.uploadFile)(fileObj).then((result) => {
|
|
513
|
+
setFileList(
|
|
514
|
+
(prev) => prev.map(
|
|
515
|
+
(item) => {
|
|
516
|
+
var _a, _b, _c, _d;
|
|
517
|
+
return item.uid === uploadFileObj.uid ? {
|
|
518
|
+
...item,
|
|
519
|
+
status: "done",
|
|
520
|
+
response: result,
|
|
521
|
+
url: ((_a = result.data) == null ? void 0 : _a.url) || item.url,
|
|
522
|
+
thumbUrl: ((_b = result.data) == null ? void 0 : _b.url) || item.thumbUrl,
|
|
523
|
+
// 更新多语言数据
|
|
524
|
+
...enableMultilingual && {
|
|
525
|
+
multilingual: (0, import_utils2.createMultilingualData)(
|
|
526
|
+
((_c = result.data) == null ? void 0 : _c.url) || ""
|
|
527
|
+
),
|
|
528
|
+
multilingualFileList: (0, import_utils2.createMultilingualFileList)(
|
|
529
|
+
((_d = result.data) == null ? void 0 : _d.url) || ""
|
|
530
|
+
)
|
|
531
|
+
}
|
|
532
|
+
} : item;
|
|
533
|
+
}
|
|
534
|
+
)
|
|
535
|
+
);
|
|
536
|
+
handleChange({
|
|
537
|
+
file: { ...uploadFileObj, status: "done", response: result },
|
|
538
|
+
fileList: [
|
|
539
|
+
...fileList,
|
|
540
|
+
{ ...uploadFileObj, status: "done", response: result }
|
|
541
|
+
]
|
|
542
|
+
});
|
|
543
|
+
}).catch((error) => {
|
|
544
|
+
console.error("Camera upload error:", error);
|
|
545
|
+
setFileList(
|
|
546
|
+
(prev) => prev.map(
|
|
547
|
+
(item) => item.uid === uploadFileObj.uid ? { ...item, status: "error" } : item
|
|
548
|
+
)
|
|
549
|
+
);
|
|
550
|
+
(0, import_pisellToast.default)({
|
|
551
|
+
content: (0, import_locales.getText)("pisell-upload-error")(uploadFileObj.name)
|
|
552
|
+
});
|
|
553
|
+
});
|
|
554
|
+
} else {
|
|
555
|
+
const formData = new FormData();
|
|
556
|
+
formData.append(uploadProps.name || "file", fileObj);
|
|
557
|
+
const extraData = (() => {
|
|
558
|
+
if (typeof uploadProps.data === "function") {
|
|
559
|
+
const result = uploadProps.data(fileObj);
|
|
560
|
+
return result instanceof Promise ? {} : result;
|
|
561
|
+
}
|
|
562
|
+
return uploadProps.data || {};
|
|
563
|
+
})();
|
|
564
|
+
Object.keys(extraData).forEach((key) => {
|
|
565
|
+
formData.append(key, String(extraData[key]));
|
|
566
|
+
});
|
|
567
|
+
fetch(uploadProps.action, {
|
|
568
|
+
method: uploadProps.method || "post",
|
|
569
|
+
body: formData,
|
|
570
|
+
headers: uploadProps.headers || {}
|
|
571
|
+
}).then((response) => response.json()).then((result) => {
|
|
572
|
+
console.log("Camera upload success:", result);
|
|
573
|
+
setFileList(
|
|
574
|
+
(prev) => prev.map(
|
|
575
|
+
(item) => {
|
|
576
|
+
var _a, _b, _c, _d;
|
|
577
|
+
return item.uid === uploadFileObj.uid ? {
|
|
578
|
+
...item,
|
|
579
|
+
status: "done",
|
|
580
|
+
response: result,
|
|
581
|
+
url: ((_a = result.data) == null ? void 0 : _a.url) || item.url,
|
|
582
|
+
thumbUrl: ((_b = result.data) == null ? void 0 : _b.url) || item.thumbUrl,
|
|
583
|
+
// 更新多语言数据
|
|
584
|
+
...enableMultilingual && {
|
|
585
|
+
multilingual: (0, import_utils2.createMultilingualData)(
|
|
586
|
+
((_c = result.data) == null ? void 0 : _c.url) || ""
|
|
587
|
+
),
|
|
588
|
+
multilingualFileList: (0, import_utils2.createMultilingualFileList)(
|
|
589
|
+
((_d = result.data) == null ? void 0 : _d.url) || ""
|
|
590
|
+
)
|
|
591
|
+
}
|
|
592
|
+
} : item;
|
|
593
|
+
}
|
|
594
|
+
)
|
|
595
|
+
);
|
|
596
|
+
handleChange({
|
|
597
|
+
file: { ...uploadFileObj, status: "done", response: result },
|
|
598
|
+
fileList: [
|
|
599
|
+
...fileList,
|
|
600
|
+
{ ...uploadFileObj, status: "done", response: result }
|
|
601
|
+
]
|
|
602
|
+
});
|
|
603
|
+
}).catch((error) => {
|
|
604
|
+
console.error("Camera upload error:", error);
|
|
605
|
+
setFileList(
|
|
606
|
+
(prev) => prev.map(
|
|
607
|
+
(item) => item.uid === uploadFileObj.uid ? { ...item, status: "error" } : item
|
|
608
|
+
)
|
|
609
|
+
);
|
|
610
|
+
(0, import_pisellToast.default)({
|
|
611
|
+
content: (0, import_locales.getText)("pisell-upload-error")(uploadFileObj.name)
|
|
612
|
+
});
|
|
613
|
+
});
|
|
614
|
+
}
|
|
615
|
+
}
|
|
616
|
+
};
|
|
617
|
+
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(import_antd.Upload, { ref: uploadRef, ...uploadProps, fileList }, fileList.length >= calcMaxCount ? null : /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, allowCamera && !(0, import_utils.isMobile)() && /* @__PURE__ */ import_react.default.createElement(
|
|
618
|
+
import_CameraPopover.default,
|
|
619
|
+
{
|
|
620
|
+
onLocalFileClick: () => {
|
|
621
|
+
var _a;
|
|
622
|
+
return (_a = uploadButtonRef.current) == null ? void 0 : _a.click();
|
|
623
|
+
},
|
|
624
|
+
onCameraChange
|
|
625
|
+
}
|
|
626
|
+
), renderUploadButton(!!enableMultilingual))), /* @__PURE__ */ import_react.default.createElement(
|
|
464
627
|
import_pisellModal.default,
|
|
465
628
|
{
|
|
466
629
|
title: (0, import_locales.getText)("pisell-upload-multilingual-title"),
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/components/dataSourceComponents/fields/Upload/CameraPopover.tsx
|
|
30
|
+
var CameraPopover_exports = {};
|
|
31
|
+
__export(CameraPopover_exports, {
|
|
32
|
+
default: () => CameraPopover_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(CameraPopover_exports);
|
|
35
|
+
var import_antd = require("antd");
|
|
36
|
+
var import_react = __toESM(require("react"));
|
|
37
|
+
var import_locales = require("../../../../locales");
|
|
38
|
+
var import_pisellCamera = __toESM(require("../../../pisellCamera"));
|
|
39
|
+
var CameraPopover = (props) => {
|
|
40
|
+
const [open, setOpen] = (0, import_react.useState)(false);
|
|
41
|
+
const cameraRef = (0, import_react.useRef)(null);
|
|
42
|
+
const handleOpenChange = (newOpen) => {
|
|
43
|
+
setOpen(newOpen);
|
|
44
|
+
};
|
|
45
|
+
const onClick = (e, type) => {
|
|
46
|
+
var _a;
|
|
47
|
+
e.stopPropagation();
|
|
48
|
+
e.preventDefault();
|
|
49
|
+
if (type === "upload") {
|
|
50
|
+
console.log("本地文件");
|
|
51
|
+
props.onLocalFileClick();
|
|
52
|
+
} else {
|
|
53
|
+
console.log("拍照");
|
|
54
|
+
(_a = cameraRef.current) == null ? void 0 : _a.open();
|
|
55
|
+
}
|
|
56
|
+
handleOpenChange(false);
|
|
57
|
+
};
|
|
58
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode-upload-camera-popover" }, /* @__PURE__ */ import_react.default.createElement(
|
|
59
|
+
import_antd.Popover,
|
|
60
|
+
{
|
|
61
|
+
open,
|
|
62
|
+
onOpenChange: handleOpenChange,
|
|
63
|
+
trigger: "click",
|
|
64
|
+
arrow: false,
|
|
65
|
+
content: /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode-upload-camera-popover-content" }, /* @__PURE__ */ import_react.default.createElement(
|
|
66
|
+
"div",
|
|
67
|
+
{
|
|
68
|
+
className: "pisell-lowcode-upload-camera-popover-content-item",
|
|
69
|
+
onClick: (e) => onClick(e, "upload")
|
|
70
|
+
},
|
|
71
|
+
(0, import_locales.getText)("pisell-upload-camera-local-files")
|
|
72
|
+
), /* @__PURE__ */ import_react.default.createElement(
|
|
73
|
+
"div",
|
|
74
|
+
{
|
|
75
|
+
className: "pisell-lowcode-upload-camera-popover-content-item",
|
|
76
|
+
onClick: (e) => onClick(e, "photo")
|
|
77
|
+
},
|
|
78
|
+
(0, import_locales.getText)("pisell-upload-camera-capture")
|
|
79
|
+
)),
|
|
80
|
+
destroyTooltipOnHide: true
|
|
81
|
+
},
|
|
82
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
83
|
+
"div",
|
|
84
|
+
{
|
|
85
|
+
className: "pisell-lowcode-upload-camera-wrapper",
|
|
86
|
+
onClick: (e) => {
|
|
87
|
+
e.stopPropagation();
|
|
88
|
+
e.preventDefault();
|
|
89
|
+
handleOpenChange(true);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
)
|
|
93
|
+
), /* @__PURE__ */ import_react.default.createElement(import_pisellCamera.default, { ref: cameraRef, onChange: props.onCameraChange }));
|
|
94
|
+
};
|
|
95
|
+
var CameraPopover_default = CameraPopover;
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
right: 6px;
|
|
17
17
|
bottom: 6px;
|
|
18
18
|
cursor: pointer;
|
|
19
|
-
color: #
|
|
19
|
+
color: #98a2b3;
|
|
20
20
|
font-size: 20px;
|
|
21
21
|
&:hover {
|
|
22
22
|
transition: color 0.3s;
|
|
@@ -78,5 +78,37 @@
|
|
|
78
78
|
z-index: 1201 !important;
|
|
79
79
|
}
|
|
80
80
|
.pisell-lowcode-image-preview-operations-wrapper {
|
|
81
|
-
z-index: 1202!important;
|
|
82
|
-
}
|
|
81
|
+
z-index: 1202 !important;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.pisell-lowcode-upload-camera-popover {
|
|
85
|
+
position: absolute;
|
|
86
|
+
top: 0;
|
|
87
|
+
left: 0;
|
|
88
|
+
right: 0;
|
|
89
|
+
bottom: 0;
|
|
90
|
+
background-color: transparent;
|
|
91
|
+
|
|
92
|
+
.pisell-lowcode-upload-camera-wrapper {
|
|
93
|
+
height: 100%;
|
|
94
|
+
width: 100%;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.pisell-lowcode-upload-camera-popover-content {
|
|
99
|
+
margin: -12px;
|
|
100
|
+
display: flex;
|
|
101
|
+
flex-direction: column;
|
|
102
|
+
width: 200px;
|
|
103
|
+
border-radius: 10px;
|
|
104
|
+
overflow: hidden;
|
|
105
|
+
|
|
106
|
+
.pisell-lowcode-upload-camera-popover-content-item {
|
|
107
|
+
padding: 10px 12px;
|
|
108
|
+
cursor: pointer;
|
|
109
|
+
|
|
110
|
+
&:hover {
|
|
111
|
+
background-color: #f0f0f0;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|