@wp1001/ui 2.9.13 → 3.0.0

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.
Files changed (105) hide show
  1. package/@vant-D4fmGxs6.js +1 -3891
  2. package/index.html +28 -0
  3. package/index.js +1 -8419
  4. package/lib/tinymce/zh_CN.js +1 -0
  5. package/package.json +1 -1
  6. package/packages/assets/devtools-detector.js +1 -2
  7. package/packages/components/xarray/index.js +1 -64
  8. package/packages/components/xautorows/index.js +1 -35
  9. package/packages/components/xbutton/mobile.js +1 -3
  10. package/packages/components/xbutton/pc.js +1 -3
  11. package/packages/components/xbuttons/mobile.js +1 -51
  12. package/packages/components/xbuttons/pc.js +1 -51
  13. package/packages/components/xchart/constants.js +1 -58
  14. package/packages/components/xchart/index.js +1 -263
  15. package/packages/components/xchart/utils.js +1 -121
  16. package/packages/components/xcheckboxs/mobile.js +1 -58
  17. package/packages/components/xcheckboxs/pc.js +1 -49
  18. package/packages/components/xcol/mobile.js +1 -10
  19. package/packages/components/xcol/pc.js +1 -10
  20. package/packages/components/xdatepicker/mobile.js +1 -71
  21. package/packages/components/xdatepicker/pc.js +1 -9
  22. package/packages/components/xdialog/mobile.js +1 -60
  23. package/packages/components/xdialog/pc.js +1 -64
  24. package/packages/components/xdict/index.js +1 -47
  25. package/packages/components/xdistrictselect/mobile.js +1 -79
  26. package/packages/components/xdistrictselect/pc.js +1 -127
  27. package/packages/components/xform/mobile.js +1 -29
  28. package/packages/components/xform/pc.js +1 -42
  29. package/packages/components/xform/utils.js +1 -95
  30. package/packages/components/xformitem/mobile.js +1 -56
  31. package/packages/components/xformitem/pc.js +1 -72
  32. package/packages/components/xicon/mobile.js +1 -35
  33. package/packages/components/xicon/pc.js +1 -35
  34. package/packages/components/xinfo/index.js +1 -100
  35. package/packages/components/xlooper/index.js +1 -7
  36. package/packages/components/xpagination/mobile.js +1 -21
  37. package/packages/components/xpagination/pc.js +1 -21
  38. package/packages/components/xpicker/index.js +1 -38
  39. package/packages/components/xradios/mobile.js +1 -40
  40. package/packages/components/xradios/pc.js +1 -53
  41. package/packages/components/xrow/mobile.js +1 -9
  42. package/packages/components/xrow/pc.js +1 -9
  43. package/packages/components/xscan/mobile.js +1 -24
  44. package/packages/components/xscan/pc.js +1 -20
  45. package/packages/components/xsearcher/index.js +1 -198
  46. package/packages/components/xselect/mobile.js +1 -86
  47. package/packages/components/xselect/pc.js +1 -114
  48. package/packages/components/xselect/util.js +1 -66
  49. package/packages/components/xselectv2/index.js +1 -91
  50. package/packages/components/xtable/mobile.js +1 -108
  51. package/packages/components/xtable/pc.js +1 -143
  52. package/packages/components/xtable/searcher.js +1 -477
  53. package/packages/components/xtable/settings.js +1 -80
  54. package/packages/components/xtable/utils.js +1 -692
  55. package/packages/components/xtabletools/mobile.js +1 -25
  56. package/packages/components/xtabletools/pc.js +1 -18
  57. package/packages/components/xtablev2/index.js +1 -53
  58. package/packages/components/xtags/mobile.js +1 -17
  59. package/packages/components/xtags/pc.js +1 -17
  60. package/packages/components/xtinymce/index.js +1 -71
  61. package/packages/components/xuploader/xfileuploader.js +1 -48
  62. package/packages/components/xuploader/ximageuploader.js +1 -53
  63. package/packages/comps.js +1 -108
  64. package/packages/controllers/BaseController.js +1 -125
  65. package/packages/controllers/CrudController.js +1 -907
  66. package/packages/controllers/TempCrudController.js +1 -32
  67. package/packages/controllers/index.js +1 -15
  68. package/packages/directives/el-table-infinite-scroll.js +1 -55
  69. package/packages/directives/index.js +1 -5
  70. package/packages/index.js +1 -81
  71. package/packages/layout/breadcrumb/index.js +1 -41
  72. package/packages/layout/header/inner.js +1 -11
  73. package/packages/layout/screenlock/index.js +1 -129
  74. package/packages/layout/sidebar/item.js +1 -16
  75. package/packages/layout/sidebar/menu.js +1 -72
  76. package/packages/layout/tagsview/ScrollPane.js +1 -65
  77. package/packages/layout/tagsview/index.js +1 -169
  78. package/packages/plop/actions/make-fill-admin-partials-action.js +1 -95
  79. package/packages/plop/generators/make-admin-page.js +1 -39
  80. package/packages/plop/generators/make-database-admin-pages.js +1 -84
  81. package/packages/plop/generators/make-page-generator.js +1 -52
  82. package/packages/plop/generators/make-simple-page.js +1 -20
  83. package/packages/plop/plopfile.js +1 -24
  84. package/packages/plop/utils/index.js +1 -168
  85. package/packages/plop/utils/plop-utils.js +1 -86
  86. package/packages/utils/crypt.js +1 -24
  87. package/packages/utils/decorators.js +1 -67
  88. package/packages/utils/disallowDevtools.js +1 -53
  89. package/packages/utils/effects.js +1 -173
  90. package/packages/utils/funcs.js +1 -78
  91. package/packages/utils/index.js +1 -95
  92. package/packages/utils/message.js +1 -110
  93. package/packages/utils/middlewares.js +1 -86
  94. package/packages/utils/model.js +1 -71
  95. package/packages/utils/modelUtils.js +1 -203
  96. package/packages/utils/request.js +1 -57
  97. package/packages/utils/site.js +1 -33
  98. package/packages/vite-plugins.js +1 -141
  99. package/src/App.vue +134 -0
  100. package/src/main.js +1 -0
  101. package/src/request.js +1 -0
  102. package/style.css +1 -0
  103. package/vite.config.js +1 -0
  104. package/vite.lib.config.js +1 -0
  105. package/.env +0 -6
@@ -1,203 +1 @@
1
- import { watch } from 'vue'
2
-
3
- const { funcs } = StardustJs
4
-
5
- export const initFields = fields => {
6
- return fields.map(f => {
7
- const keys = Object.keys(f)
8
- for (let key of keys) {
9
- if (key.startsWith('ta_')) {
10
- f.tableAttrs ??= {}
11
- f.tableAttrs[key.slice(3)] = f[key]
12
- delete f[key]
13
- } else if (key.startsWith('fa_')) {
14
- f.formAttrs ??= {}
15
- f.formAttrs[key.slice(3)] = f[key]
16
- delete f[key]
17
- }
18
- }
19
- if (f.type === 'date') {
20
- f.formAttrs ??= {}
21
- f.formAttrs['value-format'] ??= 'YYYY-MM-DD'
22
- } else if (f.type === 'datetime') {
23
- f.formAttrs ??= {}
24
- f.formAttrs['value-format'] ??= 'YYYY-MM-DD HH:mm:ss'
25
- }
26
- f.xs ??= 24
27
- return f
28
- })
29
- }
30
-
31
- export const initModel = (model, fields) => {
32
- for (let key in model) {
33
- const value = model[key]
34
- if (!value || typeof value !== 'object') {
35
- continue
36
- }
37
- if (key === 'table' && model[key]._isBaseTable) {
38
- initTable(value, fields)
39
- }
40
- if (key === 'dialog' && model[key]._isBaseDialog) {
41
- initDialog(value, fields)
42
- }
43
- if (key === 'form' && model[key]._isBaseForm) {
44
- initForm(value, fields)
45
- }
46
- }
47
- return model
48
- }
49
-
50
- export const initTable = (table, fields) => {
51
- table.columns.push(...fields.filter(field => {
52
- return field.visible === false ? field.canView : field.canView !== false
53
- }))
54
- return table
55
- }
56
-
57
- export const initDialog = (dialog, fields) => {
58
- dialog.formItems = fields.filter(field => {
59
- if (field.visible === false) {
60
- return field.canAdd || field.canEdit
61
- }
62
- return (field.canAdd !== false) || (field.canEdit !== false)
63
- })
64
- initForm(dialog, fields)
65
- return dialog
66
- }
67
-
68
- export const initForm = (form, fields) => {
69
- if (form._isBaseForm && !form._isBaseDialog) {
70
- form.formItems = fields.filter(field => field.visible !== false)
71
- }
72
- initDefaultForm(form.form, form.formItems)
73
- form.initialForm = funcs.deepCopy(form.form)
74
- form.initialFormRules = funcs.deepCopy(form.formRules)
75
-
76
- const init = () => {
77
- initFormRules(form)
78
- }
79
- watch(() => form.formItems, init, { immediate: true, deep: true })
80
- return form
81
- }
82
-
83
- export const initFormRules = (container) => {
84
- const { formItems, initialFormRules } = container
85
- Object.assign(container.formRules, funcs.deepCopy(initialFormRules))
86
- Object.keys(container.formRules).forEach(key => {
87
- if (!initialFormRules.hasOwnProperty(key)) {
88
- delete container.formRules[key]
89
- }
90
- })
91
- const rules = {}
92
- formItems.forEach(item => {
93
- if (container.formRules[item.prop]) return
94
- if (!item.required && !item.validator && !item.asyncValidator) return
95
- const platform = item.platform || container.platform || (window.isMobile ? 'mobile' : 'pc')
96
- const trigger = triggers[platform]
97
- const itemRules = []
98
- const isSelects = 'options' in item
99
- const message = `请${item.validator || item.asyncValidator ? '正确' : ''}${isSelects ? '选择' : '输入'}${item?.label || item.prop}`
100
- const baseRule = { required: true, message }
101
- if (item.validator) baseRule.validator = (param1, param2) => {
102
- return platform === 'pc' ? item.validator(param1, param2) : item.validator(param2, param1)
103
- }
104
- if (item.asyncValidator) baseRule.asyncValidator = (param1, param2) => {
105
- return platform === 'pc' ? item.asyncValidator(param1, param2) : item.asyncValidator(param2, param1)
106
- }
107
- if (!item.comp) {
108
- itemRules.push({ ...baseRule, trigger: trigger.blur })
109
- } else {
110
- itemRules.push({ ...baseRule, trigger: trigger.change })
111
- }
112
- if (item.comp === 'ElInputNumber') {
113
- itemRules.push({ ...baseRule, trigger: trigger.blur })
114
- }
115
- rules[item.prop] = itemRules
116
- })
117
- Object.assign(container.formRules, rules)
118
- return container.formRules
119
- }
120
-
121
- export const initDefaultForm = (form, formItems, number0 = true) => {
122
- const defaultForm = {}
123
- formItems.forEach(item => {
124
- if (!item.prop || item.virtual) return
125
- let value = ''
126
- const { type, options } = item
127
- const { multiple } = item.formAttrs || {}
128
- if (number0 && type === 'number' || item.comp === 'ElInputNumber') {
129
- value = null
130
- } else if (item.comp === 'ElSwitch') {
131
- value = false
132
- } else if (options && (item.comp?.endsWith('XCheckboxs') || item.comp?.endsWith('x-checkboxs') || multiple)) {
133
- value = []
134
- } else if (item.comp === 'ElDatePicker' && ['datetimerange', 'daterange', 'monthrange'].includes(item.type)) {
135
- const placeholer = ({
136
- datetimerange: '时间',
137
- daterange: '日期',
138
- monthrange: '月份'
139
- })[item.type]
140
- if (!item['start-placeholder']) {
141
- item['start-placeholder'] = '开始' + placeholer
142
- }
143
- if (!item['end-placeholder']) {
144
- item['end-placeholder'] = '结束' + placeholer
145
- }
146
- value = []
147
- }
148
- defaultForm[item.prop] = value
149
- })
150
- Object.assign(form, { ...defaultForm, ...form })
151
- return form
152
- }
153
-
154
- export const isWhenMatched = (when, form) => {
155
- if (!when) return true
156
- const parts = when.split(/\s?(&&|\|\|)\s?/g)
157
- if (parts.includes('&&') && parts.includes('||')) {
158
- throw '一个 when 表达式中仅支持 && 模式或 || 模式'
159
- }
160
- const isEvery = parts.includes('&&')
161
- const reg = /[\^\*\$\~\!]?=/
162
- const groups = parts.filter(p => p !== '&&' && p !== '||')
163
- return groups[isEvery ? 'every' : 'some'](group => {
164
- let [field, values] = group.split(reg)
165
- values = values.split('|')
166
- let v = form[field]
167
- if (typeof v === 'number') v += ''
168
- else if (typeof v === 'string') v = v.trim()
169
- const type = group.match(reg)[0]
170
- if (type === '!=') return !values.includes(v)
171
- return values.some(ele => {
172
- if (type === '^=') return v?.startsWith(ele)
173
- else if (type === '*=') return v?.includes(ele)
174
- else if (type === '$=') return v?.endsWith(ele)
175
- else if (type === '~=') return !v?.includes(ele)
176
- else if (type === '!=') return v !== ele
177
- return ele === v
178
- })
179
- })
180
- }
181
-
182
- export const triggers = {
183
- mobile: {
184
- blur: 'onBlur',
185
- change: 'onChange'
186
- },
187
- pc: {
188
- blur: 'blur',
189
- change: 'change'
190
- }
191
- }
192
-
193
- export default {
194
- initFields,
195
- initModel,
196
- initTable,
197
- initDialog,
198
- initForm,
199
- initFormRules,
200
- initDefaultForm,
201
- isWhenMatched,
202
- triggers
203
- }
1
+ const a92_0x13515a=a92_0x2bee;(function(_0xbdb39c,_0x3e9972){const _0x234fdb=a92_0x2bee,_0x1420ac=_0xbdb39c();while(!![]){try{const _0x2e6d0f=-parseInt(_0x234fdb(0xc8))/0x1*(-parseInt(_0x234fdb(0xab))/0x2)+-parseInt(_0x234fdb(0xac))/0x3*(-parseInt(_0x234fdb(0xbb))/0x4)+parseInt(_0x234fdb(0x9b))/0x5+parseInt(_0x234fdb(0xc5))/0x6+parseInt(_0x234fdb(0xb8))/0x7*(-parseInt(_0x234fdb(0xc7))/0x8)+parseInt(_0x234fdb(0xa2))/0x9+-parseInt(_0x234fdb(0x9c))/0xa;if(_0x2e6d0f===_0x3e9972)break;else _0x1420ac['push'](_0x1420ac['shift']());}catch(_0x1f023c){_0x1420ac['push'](_0x1420ac['shift']());}}}(a92_0x1f42,0x1f095));import{watch}from'vue';const {funcs}=StardustJs;export const initFields=_0x434967=>{return _0x434967['map'](_0x5da080=>{const _0x3f16bd=a92_0x2bee,_0x3b4294=Object[_0x3f16bd(0xd6)](_0x5da080);for(let _0x36c39c of _0x3b4294){if(_0x36c39c[_0x3f16bd(0x9e)](_0x3f16bd(0xc1)))_0x5da080[_0x3f16bd(0x97)]??={},_0x5da080[_0x3f16bd(0x97)][_0x36c39c[_0x3f16bd(0xb3)](0x3)]=_0x5da080[_0x36c39c],delete _0x5da080[_0x36c39c];else _0x36c39c['startsWith']('fa_')&&(_0x5da080[_0x3f16bd(0xa9)]??={},_0x5da080[_0x3f16bd(0xa9)][_0x36c39c['slice'](0x3)]=_0x5da080[_0x36c39c],delete _0x5da080[_0x36c39c]);}if(_0x5da080[_0x3f16bd(0xcf)]===_0x3f16bd(0xc3))_0x5da080['formAttrs']??={},_0x5da080['formAttrs'][_0x3f16bd(0xd9)]??=_0x3f16bd(0xd1);else _0x5da080[_0x3f16bd(0xcf)]==='datetime'&&(_0x5da080['formAttrs']??={},_0x5da080[_0x3f16bd(0xa9)]['value-format']??=_0x3f16bd(0x99));return _0x5da080['xs']??=0x18,_0x5da080;});};export const initModel=(_0x3c4b1e,_0x25f049)=>{const _0x350527=a92_0x2bee;for(let _0x5950a0 in _0x3c4b1e){const _0x68afe8=_0x3c4b1e[_0x5950a0];if(!_0x68afe8||typeof _0x68afe8!=='object')continue;_0x5950a0===_0x350527(0xce)&&_0x3c4b1e[_0x5950a0][_0x350527(0xcc)]&&initTable(_0x68afe8,_0x25f049),_0x5950a0==='dialog'&&_0x3c4b1e[_0x5950a0][_0x350527(0xb2)]&&initDialog(_0x68afe8,_0x25f049),_0x5950a0===_0x350527(0xd7)&&_0x3c4b1e[_0x5950a0][_0x350527(0xad)]&&initForm(_0x68afe8,_0x25f049);}return _0x3c4b1e;};export const initTable=(_0x309413,_0x34879b)=>{const _0x3be6a2=a92_0x2bee;return _0x309413[_0x3be6a2(0xd2)][_0x3be6a2(0xa8)](..._0x34879b['filter'](_0x3a706a=>{return _0x3a706a['visible']===![]?_0x3a706a['canView']:_0x3a706a['canView']!==![];})),_0x309413;};export const initDialog=(_0x1ea118,_0xad27c6)=>{const _0x3339da=a92_0x2bee;return _0x1ea118[_0x3339da(0xbf)]=_0xad27c6[_0x3339da(0xd3)](_0x5b7dc0=>{const _0x4898c5=_0x3339da;if(_0x5b7dc0['visible']===![])return _0x5b7dc0[_0x4898c5(0xc6)]||_0x5b7dc0[_0x4898c5(0xd4)];return _0x5b7dc0[_0x4898c5(0xc6)]!==![]||_0x5b7dc0[_0x4898c5(0xd4)]!==![];}),initForm(_0x1ea118,_0xad27c6),_0x1ea118;};export const initForm=(_0x40a77a,_0x725b5d)=>{const _0x5bf183=a92_0x2bee;_0x40a77a[_0x5bf183(0xad)]&&!_0x40a77a[_0x5bf183(0xb2)]&&(_0x40a77a[_0x5bf183(0xbf)]=_0x725b5d[_0x5bf183(0xd3)](_0x28177d=>_0x28177d[_0x5bf183(0xa1)]!==![]));initDefaultForm(_0x40a77a['form'],_0x40a77a['formItems']),_0x40a77a[_0x5bf183(0xbd)]=funcs['deepCopy'](_0x40a77a[_0x5bf183(0xd7)]),_0x40a77a[_0x5bf183(0xa0)]=funcs[_0x5bf183(0xc0)](_0x40a77a[_0x5bf183(0xcb)]);const _0x4864ed=()=>{initFormRules(_0x40a77a);};return watch(()=>_0x40a77a[_0x5bf183(0xbf)],_0x4864ed,{'immediate':!![],'deep':!![]}),_0x40a77a;};function a92_0x1f42(){const _0x339551=['trim','isMobile','datetimerange','end-placeholder','_isBaseDialog','slice','blur','ElSwitch','comp','endsWith','353269AGwNBw','hasOwnProperty','asyncValidator','40jnjaMF','string','initialForm','platform','formItems','deepCopy','ta_','forEach','date','includes','206814IhPaea','canAdd','24SzXwkS','61599qAblUf','split','number','formRules','_isBaseTable','一个\x20when\x20表达式中仅支持\x20&&\x20模式或\x20||\x20模式','table','type','virtual','YYYY-MM-DD','columns','filter','canEdit','required','keys','form','assign','value-format','change','label','daterange','tableAttrs','start-placeholder','YYYY-MM-DD\x20HH:mm:ss','onBlur','462950qkkYHr','2140760SAgjfD','prop','startsWith','ElDatePicker','initialFormRules','visible','1439406ANxuPy','onChange','validator','options','ElInputNumber','XCheckboxs','push','formAttrs','some','2MPhmYt','43203HASZNd','_isBaseForm'];a92_0x1f42=function(){return _0x339551;};return a92_0x1f42();}export const initFormRules=_0x22e882=>{const _0x35e797=a92_0x2bee,{formItems:_0x594979,initialFormRules:_0x330580}=_0x22e882;Object[_0x35e797(0xd8)](_0x22e882['formRules'],funcs[_0x35e797(0xc0)](_0x330580)),Object['keys'](_0x22e882[_0x35e797(0xcb)])[_0x35e797(0xc2)](_0x5ed6b3=>{const _0x542373=_0x35e797;!_0x330580[_0x542373(0xb9)](_0x5ed6b3)&&delete _0x22e882[_0x542373(0xcb)][_0x5ed6b3];});const _0xadfc70={};return _0x594979['forEach'](_0x42695=>{const _0x1fba1f=_0x35e797;if(_0x22e882[_0x1fba1f(0xcb)][_0x42695['prop']])return;if(!_0x42695[_0x1fba1f(0xd5)]&&!_0x42695['validator']&&!_0x42695['asyncValidator'])return;const _0x5a4bbf=_0x42695[_0x1fba1f(0xbe)]||_0x22e882[_0x1fba1f(0xbe)]||(window[_0x1fba1f(0xaf)]?'mobile':'pc'),_0x9b8dfb=triggers[_0x5a4bbf],_0x4487a7=[],_0x2bd99a=_0x1fba1f(0xa5)in _0x42695,_0x2bd3e6='请'+(_0x42695[_0x1fba1f(0xa4)]||_0x42695[_0x1fba1f(0xba)]?'正确':'')+(_0x2bd99a?'选择':'输入')+(_0x42695?.[_0x1fba1f(0xdb)]||_0x42695[_0x1fba1f(0x9d)]),_0x256e2d={'required':!![],'message':_0x2bd3e6};if(_0x42695[_0x1fba1f(0xa4)])_0x256e2d[_0x1fba1f(0xa4)]=(_0x1d957c,_0x40624b)=>{const _0x4ccf15=_0x1fba1f;return _0x5a4bbf==='pc'?_0x42695[_0x4ccf15(0xa4)](_0x1d957c,_0x40624b):_0x42695[_0x4ccf15(0xa4)](_0x40624b,_0x1d957c);};if(_0x42695[_0x1fba1f(0xba)])_0x256e2d['asyncValidator']=(_0x52df52,_0xb6b3ff)=>{const _0xe516ec=_0x1fba1f;return _0x5a4bbf==='pc'?_0x42695['asyncValidator'](_0x52df52,_0xb6b3ff):_0x42695[_0xe516ec(0xba)](_0xb6b3ff,_0x52df52);};!_0x42695[_0x1fba1f(0xb6)]?_0x4487a7['push']({..._0x256e2d,'trigger':_0x9b8dfb[_0x1fba1f(0xb4)]}):_0x4487a7[_0x1fba1f(0xa8)]({..._0x256e2d,'trigger':_0x9b8dfb[_0x1fba1f(0xda)]}),_0x42695[_0x1fba1f(0xb6)]===_0x1fba1f(0xa6)&&_0x4487a7[_0x1fba1f(0xa8)]({..._0x256e2d,'trigger':_0x9b8dfb[_0x1fba1f(0xb4)]}),_0xadfc70[_0x42695[_0x1fba1f(0x9d)]]=_0x4487a7;}),Object[_0x35e797(0xd8)](_0x22e882['formRules'],_0xadfc70),_0x22e882[_0x35e797(0xcb)];};export const initDefaultForm=(_0xaea5b6,_0x520612,_0x236e5a=!![])=>{const _0x127241=a92_0x2bee,_0x5ab36a={};return _0x520612[_0x127241(0xc2)](_0x1c2592=>{const _0x3f2a3b=_0x127241;if(!_0x1c2592[_0x3f2a3b(0x9d)]||_0x1c2592[_0x3f2a3b(0xd0)])return;let _0x4a5c2c='';const {type:_0x1a4cc9,options:_0x3b5b27}=_0x1c2592,{multiple:_0x5035f9}=_0x1c2592['formAttrs']||{};if(_0x236e5a&&_0x1a4cc9===_0x3f2a3b(0xca)||_0x1c2592[_0x3f2a3b(0xb6)]==='ElInputNumber')_0x4a5c2c=null;else{if(_0x1c2592[_0x3f2a3b(0xb6)]===_0x3f2a3b(0xb5))_0x4a5c2c=![];else{if(_0x3b5b27&&(_0x1c2592[_0x3f2a3b(0xb6)]?.[_0x3f2a3b(0xb7)](_0x3f2a3b(0xa7))||_0x1c2592[_0x3f2a3b(0xb6)]?.[_0x3f2a3b(0xb7)]('x-checkboxs')||_0x5035f9))_0x4a5c2c=[];else{if(_0x1c2592[_0x3f2a3b(0xb6)]===_0x3f2a3b(0x9f)&&[_0x3f2a3b(0xb0),_0x3f2a3b(0x96),'monthrange'][_0x3f2a3b(0xc4)](_0x1c2592[_0x3f2a3b(0xcf)])){const _0x41bef0={'datetimerange':'时间','daterange':'日期','monthrange':'月份'}[_0x1c2592[_0x3f2a3b(0xcf)]];!_0x1c2592[_0x3f2a3b(0x98)]&&(_0x1c2592[_0x3f2a3b(0x98)]='开始'+_0x41bef0),!_0x1c2592[_0x3f2a3b(0xb1)]&&(_0x1c2592[_0x3f2a3b(0xb1)]='结束'+_0x41bef0),_0x4a5c2c=[];}}}}_0x5ab36a[_0x1c2592['prop']]=_0x4a5c2c;}),Object[_0x127241(0xd8)](_0xaea5b6,{..._0x5ab36a,..._0xaea5b6}),_0xaea5b6;};export const isWhenMatched=(_0x4c6007,_0x4ba2af)=>{const _0x44ab9a=a92_0x2bee;if(!_0x4c6007)return!![];const _0x5af946=_0x4c6007['split'](/\s?(&&|\|\|)\s?/g);if(_0x5af946[_0x44ab9a(0xc4)]('&&')&&_0x5af946[_0x44ab9a(0xc4)]('||'))throw _0x44ab9a(0xcd);const _0x387c27=_0x5af946['includes']('&&'),_0xfa864d=/[\^\*\$\~\!]?=/,_0x913183=_0x5af946['filter'](_0x447a1d=>_0x447a1d!=='&&'&&_0x447a1d!=='||');return _0x913183[_0x387c27?'every':_0x44ab9a(0xaa)](_0x250c0d=>{const _0x5d6b84=_0x44ab9a;let [_0x247577,_0x147745]=_0x250c0d[_0x5d6b84(0xc9)](_0xfa864d);_0x147745=_0x147745[_0x5d6b84(0xc9)]('|');let _0x43d499=_0x4ba2af[_0x247577];if(typeof _0x43d499==='number')_0x43d499+='';else{if(typeof _0x43d499===_0x5d6b84(0xbc))_0x43d499=_0x43d499[_0x5d6b84(0xae)]();}const _0x39ec0c=_0x250c0d['match'](_0xfa864d)[0x0];if(_0x39ec0c==='!=')return!_0x147745[_0x5d6b84(0xc4)](_0x43d499);return _0x147745[_0x5d6b84(0xaa)](_0x1cf0e4=>{const _0x1777a4=_0x5d6b84;if(_0x39ec0c==='^=')return _0x43d499?.[_0x1777a4(0x9e)](_0x1cf0e4);else{if(_0x39ec0c==='*=')return _0x43d499?.[_0x1777a4(0xc4)](_0x1cf0e4);else{if(_0x39ec0c==='$=')return _0x43d499?.[_0x1777a4(0xb7)](_0x1cf0e4);else{if(_0x39ec0c==='~=')return!_0x43d499?.['includes'](_0x1cf0e4);else{if(_0x39ec0c==='!=')return _0x43d499!==_0x1cf0e4;}}}}return _0x1cf0e4===_0x43d499;});});};export const triggers={'mobile':{'blur':a92_0x13515a(0x9a),'change':a92_0x13515a(0xa3)},'pc':{'blur':a92_0x13515a(0xb4),'change':'change'}};function a92_0x2bee(_0x32add7,_0x335b5e){const _0x1f42ee=a92_0x1f42();return a92_0x2bee=function(_0x2bee0d,_0x43c6b9){_0x2bee0d=_0x2bee0d-0x96;let _0x277401=_0x1f42ee[_0x2bee0d];return _0x277401;},a92_0x2bee(_0x32add7,_0x335b5e);}export default{'initFields':initFields,'initModel':initModel,'initTable':initTable,'initDialog':initDialog,'initForm':initForm,'initFormRules':initFormRules,'initDefaultForm':initDefaultForm,'isWhenMatched':isWhenMatched,'triggers':triggers};
@@ -1,57 +1 @@
1
- import { Message } from './message.js'
2
-
3
- const requestUse = (app, crypt, store, router, config) => {
4
- config.headers.Authorization ||= store.user.token
5
- const type = app.config.globalProperties.httpEncrypt
6
- if (type !== false) {
7
- config.headers['Http-Encrypt'] = type
8
- config.headers['Content-Type'] ||= 'application/json; charset=UTF-8'
9
- if (config.url.indexOf('?') >= 0) {
10
- const [path, ...others] = config.url.split('?')
11
- const encrypted = crypt.encrypt[type](others.join('?'), 'query')
12
- config.url = path + '?' + encrypted
13
- } else {
14
- config.params ||= { __placeholder__: Date.now().toString(16) }
15
- }
16
- if (config.params) {
17
- const query = decodeURIComponent(new URLSearchParams(config.params).toString())
18
- config.url += '?' + crypt.encrypt[type](query, 'query')
19
- delete config.params
20
- }
21
- if (config.data !== undefined && !(config.data instanceof FormData)) {
22
- const encrypted = crypt.encrypt[type](JSON.stringify(config.data), 'body')
23
- config.data = encrypted
24
- }
25
- }
26
- return config
27
- }
28
-
29
- const responseUse = (app, crypt, store, router, res) => {
30
- if ([401, 402, 10001].includes(res.data.code)) {
31
- store.user.setExpired()
32
- const currentPath = '/' + location.hash.slice(2).split('?')[0]
33
- const query = StardustJs.funcs.decodeQuery(location.href.split('?')[1] || '')
34
- router.replace(query.redirectTo ? `/login?redirectTo=${query.redirectTo || currentPath}` : '/login')
35
- return Promise.reject(res)
36
- } else if ([10002].includes(res.data.code)) {
37
- Message.e(res.data.err)
38
- return Promise.reject(res)
39
- }
40
- const token = res.headers['refresh-token'] || res.data.token
41
- if (token) {
42
- store.user.setToken(token)
43
- }
44
- if (res.data.err) {
45
- Message.e(res.data.err || '未知错误')
46
- return Promise.reject(res)
47
- }
48
- if (res.headers['content-type']?.includes('application/json')) {
49
- res.data = JSON.parse(StardustJs.dates.convertIsoDates(JSON.stringify(res.data)))
50
- }
51
- return Promise.resolve(res.data)
52
- }
53
-
54
- export {
55
- requestUse,
56
- responseUse
57
- }
1
+ (function(_0x11088f,_0x262ae1){const _0x13b966=a93_0x33ca,_0x491796=_0x11088f();while(!![]){try{const _0x3d3140=parseInt(_0x13b966(0x167))/0x1*(-parseInt(_0x13b966(0x17b))/0x2)+-parseInt(_0x13b966(0x168))/0x3*(parseInt(_0x13b966(0x161))/0x4)+-parseInt(_0x13b966(0x16b))/0x5*(parseInt(_0x13b966(0x171))/0x6)+-parseInt(_0x13b966(0x16c))/0x7*(-parseInt(_0x13b966(0x173))/0x8)+parseInt(_0x13b966(0x16d))/0x9*(parseInt(_0x13b966(0x15b))/0xa)+-parseInt(_0x13b966(0x162))/0xb*(-parseInt(_0x13b966(0x172))/0xc)+parseInt(_0x13b966(0x177))/0xd;if(_0x3d3140===_0x262ae1)break;else _0x491796['push'](_0x491796['shift']());}catch(_0xad84b0){_0x491796['push'](_0x491796['shift']());}}}(a93_0x3202,0x512e2));import{Message}from'./message.js';const requestUse=(_0x1474e8,_0x326005,_0x13c96c,_0x511151,_0xf17da9)=>{const _0x1a8d8c=a93_0x33ca;_0xf17da9['headers'][_0x1a8d8c(0x152)]||=_0x13c96c['user'][_0x1a8d8c(0x17c)];const _0x33c9bb=_0x1474e8[_0x1a8d8c(0x17e)][_0x1a8d8c(0x164)]['httpEncrypt'];if(_0x33c9bb!==![]){_0xf17da9[_0x1a8d8c(0x16e)][_0x1a8d8c(0x17a)]=_0x33c9bb,_0xf17da9[_0x1a8d8c(0x16e)][_0x1a8d8c(0x151)]||='application/json;\x20charset=UTF-8';if(_0xf17da9['url'][_0x1a8d8c(0x16f)]('?')>=0x0){const [_0x4527fa,..._0x427370]=_0xf17da9[_0x1a8d8c(0x154)]['split']('?'),_0x3f7930=_0x326005['encrypt'][_0x33c9bb](_0x427370['join']('?'),'query');_0xf17da9[_0x1a8d8c(0x154)]=_0x4527fa+'?'+_0x3f7930;}else _0xf17da9['params']||={'__placeholder__':Date[_0x1a8d8c(0x169)]()['toString'](0x10)};if(_0xf17da9[_0x1a8d8c(0x176)]){const _0x5e5d7a=decodeURIComponent(new URLSearchParams(_0xf17da9[_0x1a8d8c(0x176)])['toString']());_0xf17da9[_0x1a8d8c(0x154)]+='?'+_0x326005[_0x1a8d8c(0x155)][_0x33c9bb](_0x5e5d7a,_0x1a8d8c(0x15c)),delete _0xf17da9[_0x1a8d8c(0x176)];}if(_0xf17da9['data']!==undefined&&!(_0xf17da9[_0x1a8d8c(0x14f)]instanceof FormData)){const _0x672cf9=_0x326005['encrypt'][_0x33c9bb](JSON[_0x1a8d8c(0x179)](_0xf17da9[_0x1a8d8c(0x14f)]),_0x1a8d8c(0x15e));_0xf17da9[_0x1a8d8c(0x14f)]=_0x672cf9;}}return _0xf17da9;},responseUse=(_0x26f557,_0xc8530b,_0xc9c49b,_0x5e1ecc,_0x267c32)=>{const _0x2d5841=a93_0x33ca;if([0x191,0x192,0x2711][_0x2d5841(0x166)](_0x267c32[_0x2d5841(0x14f)]['code'])){_0xc9c49b[_0x2d5841(0x153)][_0x2d5841(0x175)]();const _0x11a84d='/'+location[_0x2d5841(0x163)][_0x2d5841(0x158)](0x2)[_0x2d5841(0x15d)]('?')[0x0],_0x4dae9d=StardustJs[_0x2d5841(0x17d)][_0x2d5841(0x150)](location['href'][_0x2d5841(0x15d)]('?')[0x1]||'');return _0x5e1ecc[_0x2d5841(0x16a)](_0x4dae9d[_0x2d5841(0x157)]?_0x2d5841(0x159)+(_0x4dae9d[_0x2d5841(0x157)]||_0x11a84d):_0x2d5841(0x178)),Promise[_0x2d5841(0x165)](_0x267c32);}else{if([0x2712][_0x2d5841(0x166)](_0x267c32[_0x2d5841(0x14f)]['code']))return Message['e'](_0x267c32[_0x2d5841(0x14f)][_0x2d5841(0x156)]),Promise[_0x2d5841(0x165)](_0x267c32);}const _0x57eb5e=_0x267c32['headers']['refresh-token']||_0x267c32['data']['token'];_0x57eb5e&&_0xc9c49b['user'][_0x2d5841(0x170)](_0x57eb5e);if(_0x267c32[_0x2d5841(0x14f)]['err'])return Message['e'](_0x267c32['data'][_0x2d5841(0x156)]||_0x2d5841(0x15a)),Promise['reject'](_0x267c32);return _0x267c32[_0x2d5841(0x16e)]['content-type']?.[_0x2d5841(0x166)](_0x2d5841(0x174))&&(_0x267c32['data']=JSON['parse'](StardustJs['dates'][_0x2d5841(0x160)](JSON[_0x2d5841(0x179)](_0x267c32['data'])))),Promise[_0x2d5841(0x15f)](_0x267c32[_0x2d5841(0x14f)]);};function a93_0x3202(){const _0x23c720=['globalProperties','reject','includes','36187hqtBwl','3gYyEwU','now','replace','55kDVSbF','609yOuaQy','61119dltHbh','headers','indexOf','setToken','78714jOAJZZ','24TEDQye','7144cnDpLO','application/json','setExpired','params','2222493uejOdP','/login','stringify','Http-Encrypt','4DpaZVv','token','funcs','config','data','decodeQuery','Content-Type','Authorization','user','url','encrypt','err','redirectTo','slice','/login?redirectTo=','未知错误','600DpcJue','query','split','body','resolve','convertIsoDates','2352516zkxEBJ','2646677jUpwoy','hash'];a93_0x3202=function(){return _0x23c720;};return a93_0x3202();}function a93_0x33ca(_0x179ab6,_0x49f461){const _0x320232=a93_0x3202();return a93_0x33ca=function(_0x33ca43,_0x14a25d){_0x33ca43=_0x33ca43-0x14f;let _0x2ba9c4=_0x320232[_0x33ca43];return _0x2ba9c4;},a93_0x33ca(_0x179ab6,_0x49f461);}export{requestUse,responseUse};
@@ -1,33 +1 @@
1
-
2
- export const createWatermark = ({
3
- text,
4
- gap,
5
- fontSize,
6
- color,
7
- width = window.innerWidth,
8
- height = window.innerHeight,
9
- drawMode = 'fill'
10
- }) => {
11
- const canvas = document.createElement('canvas')
12
- canvas.width = width
13
- canvas.height = height
14
-
15
- const ctx = canvas.getContext('2d')
16
- ctx.font = `${fontSize}px Arial`
17
- ctx[drawMode + 'Style'] = color
18
-
19
- const textWidth = ctx.measureText(text).width
20
- const perWidth = textWidth + gap
21
- const perHeight = fontSize + gap
22
- for (let y = gap / 2; y < height; y += perHeight) {
23
- for (let x = gap / 2; x < width; x += perWidth) {
24
- ctx[drawMode + 'Text'](text, x, y)
25
- }
26
- }
27
-
28
- return canvas
29
- }
30
-
31
- export default {
32
- createWatermark
33
- }
1
+ const a94_0x2596f0=a94_0x17c1;(function(_0x19ec89,_0x3256c2){const _0x292a5d=a94_0x17c1,_0x2a03a3=_0x19ec89();while(!![]){try{const _0x1289e9=parseInt(_0x292a5d(0x1cb))/0x1*(-parseInt(_0x292a5d(0x1c8))/0x2)+parseInt(_0x292a5d(0x1d1))/0x3*(parseInt(_0x292a5d(0x1ca))/0x4)+parseInt(_0x292a5d(0x1c7))/0x5+parseInt(_0x292a5d(0x1c4))/0x6+parseInt(_0x292a5d(0x1bd))/0x7+-parseInt(_0x292a5d(0x1c1))/0x8+parseInt(_0x292a5d(0x1cc))/0x9*(-parseInt(_0x292a5d(0x1cf))/0xa);if(_0x1289e9===_0x3256c2)break;else _0x2a03a3['push'](_0x2a03a3['shift']());}catch(_0x2805b1){_0x2a03a3['push'](_0x2a03a3['shift']());}}}(a94_0x3c84,0x59e45));export const createWatermark=({text:_0x285513,gap:_0x2ccd49,fontSize:_0x2c8bb5,color:_0x3c7025,width:width=window[a94_0x2596f0(0x1bf)],height:height=window['innerHeight'],drawMode:drawMode=a94_0x2596f0(0x1ce)})=>{const _0x9eebdf=a94_0x2596f0,_0x57c979=document[_0x9eebdf(0x1c5)](_0x9eebdf(0x1c2));_0x57c979[_0x9eebdf(0x1cd)]=width,_0x57c979[_0x9eebdf(0x1c9)]=height;const _0x4a20ce=_0x57c979['getContext']('2d');_0x4a20ce[_0x9eebdf(0x1c0)]=_0x2c8bb5+_0x9eebdf(0x1be),_0x4a20ce[drawMode+_0x9eebdf(0x1d0)]=_0x3c7025;const _0x521842=_0x4a20ce[_0x9eebdf(0x1c6)](_0x285513)[_0x9eebdf(0x1cd)],_0x16c1af=_0x521842+_0x2ccd49,_0x1a79f6=_0x2c8bb5+_0x2ccd49;for(let _0x13029a=_0x2ccd49/0x2;_0x13029a<height;_0x13029a+=_0x1a79f6){for(let _0x1ef936=_0x2ccd49/0x2;_0x1ef936<width;_0x1ef936+=_0x16c1af){_0x4a20ce[drawMode+_0x9eebdf(0x1c3)](_0x285513,_0x1ef936,_0x13029a);}}return _0x57c979;};function a94_0x3c84(){const _0x4114b8=['27pkBedP','width','fill','12970idEoPd','Style','2892WoGalZ','2443931DTbBaC','px\x20Arial','innerWidth','font','2471928KsQlzC','canvas','Text','786918YRzHaT','createElement','measureText','81230HPsRvI','174VxueoO','height','3044mRrHdL','6311SvyiHW'];a94_0x3c84=function(){return _0x4114b8;};return a94_0x3c84();}function a94_0x17c1(_0x53bc20,_0x105aba){const _0x3c8456=a94_0x3c84();return a94_0x17c1=function(_0x17c167,_0x5a480d){_0x17c167=_0x17c167-0x1bd;let _0x1894fb=_0x3c8456[_0x17c167];return _0x1894fb;},a94_0x17c1(_0x53bc20,_0x105aba);}export default{'createWatermark':createWatermark};
@@ -1,141 +1 @@
1
- import fs from 'node:fs'
2
- import path from 'node:path'
3
-
4
- const filterPrivateFields = `
5
- const filterPrivateFields = source => {
6
- const target = {}
7
- for (let key in source) {
8
- if (key[0] !== "$" && key[0] !== "_") {
9
- target[key] = source[key]
10
- }
11
- }
12
- return target
13
- }
14
- const wrapCtx = (_ctx, model, controller) => {
15
- return new Proxy(_ctx, {
16
- get (obj, prop) {
17
- if (prop in obj) return obj[prop]
18
- return model?.[prop] ?? controller?.[prop]
19
- }
20
- })
21
- }
22
- `
23
-
24
- const inject = (src, id) => {
25
- const dirname = path.dirname(id)
26
- const basename = path.basename(id)
27
- const name = basename.split('.')[0]
28
- const hasScopedScss = fs.existsSync(path.join(dirname, name + '-scoped.scss'))
29
- const hasScss = fs.existsSync(path.join(dirname, name + '.scss'))
30
- const hasModel = fs.existsSync(path.join(dirname, 'model.js'))
31
- const hasController = fs.existsSync(path.join(dirname, 'controller.js'))
32
- const needModel = hasModel && !src.includes('no model') && !src.includes('const model')
33
- const needController = hasController && !src.includes('no controller') && !src.includes('const controller')
34
-
35
- if (id.includes('/src/') && basename.includes('.vue') && src.startsWith('<script setup>')) {
36
- src = src.replace('<script setup>', '<script setup>\n')
37
- const lines = src.split('\n')
38
- if (hasScopedScss) {
39
- lines.push(...['<style lang="scss" scoped>', `@use "./${name}-scoped.scss";`, '</style>'])
40
- }
41
- if (hasScss) {
42
- lines.push(...['<style lang="scss">', `@use "./${name}.scss";`, '</style>'])
43
- }
44
- if (needController) {
45
- lines.splice(1, 0, `import makeController from './controller.js'`, `const controller = makeController({ ${needModel ? 'model, ' : ''}vue })`)
46
- }
47
- if (needModel) {
48
- lines.splice(1, 0, `import makeModel from './model.js'`, `const model = makeModel()`)
49
- }
50
- src = lines.join('\n')
51
- }
52
- return src
53
- }
54
-
55
- const instantiateTables = (src, id) => {
56
- const basename = path.basename(id)
57
- const isVue = basename.includes('.vue')
58
- const isJs = basename.includes('.js')
59
- if (id.includes('/src/') && (isVue || isJs)) {
60
- const code = src.split('\n').map(l => l.trim()).filter(l => !l.startsWith('//')).join('\n')
61
- const names = new Set([...code.matchAll(/[^a-z][A-Z]\w+\.(search|add|update|remove|func|batch|get)/g)].map(e => e[0].slice(1).split('.')[0]))
62
- if (names.size) {
63
- let top = ''
64
- names.forEach(name => {
65
- let [dbname, tablename] = name.split('_').map(n => n.replace(/[A-Z]/g, c => '_' + c.toLowerCase()).slice(1))
66
- if (tablename) {
67
- dbname = `'${dbname}'`
68
- } else {
69
- tablename = dbname
70
- dbname = 'DbName'
71
- }
72
- top += `const ${name} = new Table(${dbname}, '${tablename}')\n`
73
- })
74
- if (isVue) {
75
- src = src.replace('<script setup>', '<script setup>\n' + top).replace('<script>', '<script>\n' + top)
76
- } else {
77
- src = top + src
78
- }
79
- }
80
- }
81
- return src
82
- }
83
-
84
- const deconstruct = (src, id) => {
85
- const basename = path.basename(id)
86
- const isVue = basename.includes('.vue')
87
- if (id.includes('/src/') && isVue) {
88
- const devText = 'return __returned__'
89
- const buildText = 'return (_ctx, _cache) => {'
90
- const isDev = src.includes(devText)
91
- const isBuild = src.includes(buildText)
92
- const needModel = (isDev || isBuild) && src.includes('import makeModel ')
93
- const needController = (isDev || isBuild) && src.includes('import makeController ')
94
- if (needModel || needController) {
95
- let replacement = filterPrivateFields
96
- if (isDev) {
97
- if (needModel && needController) {
98
- replacement += 'return { ...__returned__, ...filterPrivateFields(model), ...filterPrivateFields(controller) }'
99
- } else if (needModel) {
100
- replacement += 'return { ...__returned__, ...filterPrivateFields(model) }'
101
- } else if (needController) {
102
- replacement += 'return { ...__returned__, ...filterPrivateFields(controller) }'
103
- }
104
- } else {
105
- replacement += buildText + '\n'
106
- if (needModel && needController) {
107
- replacement += '_ctx = wrapCtx(_ctx, filterPrivateFields(model), filterPrivateFields(controller))'
108
- } else if (needModel) {
109
- replacement += '_ctx = wrapCtx(_ctx, filterPrivateFields(model))'
110
- } else if (needController) {
111
- replacement += '_ctx = wrapCtx(_ctx, null, filterPrivateFields(controller))'
112
- }
113
- replacement += '\n'
114
- }
115
- src = src.replace(isDev ? devText : buildText, replacement)
116
- }
117
- }
118
- return src
119
- }
120
-
121
- export const autoInject = (config = {}) => {
122
- return {
123
- name: 'auto-inject',
124
- transform (src, id) {
125
- src = inject(src, id)
126
- if (config.instantiateTables !== false) {
127
- src = instantiateTables(src, id)
128
- }
129
- return { code: src }
130
- }
131
- }
132
- }
133
-
134
- export const autoDeconstruct = () => {
135
- return {
136
- name: 'auto-deconstruct',
137
- transform (src, id) {
138
- return { code: deconstruct(src, id) }
139
- }
140
- }
141
- }
1
+ const a95_0x1eada7=a95_0x121a;function a95_0x121a(_0x4c296b,_0x7eff5c){const _0x1eef09=a95_0x1eef();return a95_0x121a=function(_0x121af1,_0x26d820){_0x121af1=_0x121af1-0xd4;let _0x486fc7=_0x1eef09[_0x121af1];return _0x486fc7;},a95_0x121a(_0x4c296b,_0x7eff5c);}(function(_0x1142b4,_0x1375b6){const _0x37cf00=a95_0x121a,_0x4d3d3c=_0x1142b4();while(!![]){try{const _0x23887c=parseInt(_0x37cf00(0xf3))/0x1*(parseInt(_0x37cf00(0x100))/0x2)+-parseInt(_0x37cf00(0x10a))/0x3*(-parseInt(_0x37cf00(0xed))/0x4)+parseInt(_0x37cf00(0xd9))/0x5+-parseInt(_0x37cf00(0xfa))/0x6+-parseInt(_0x37cf00(0xe7))/0x7+parseInt(_0x37cf00(0xe3))/0x8+-parseInt(_0x37cf00(0x108))/0x9;if(_0x23887c===_0x1375b6)break;else _0x4d3d3c['push'](_0x4d3d3c['shift']());}catch(_0x58e2d4){_0x4d3d3c['push'](_0x4d3d3c['shift']());}}}(a95_0x1eef,0x37e6f));import a95_0x57d979 from'node:fs';import a95_0x2bc012 from'node:path';function a95_0x1eef(){const _0x54fc7e=['matchAll','<style\x20lang=\x22scss\x22\x20scoped>','.scss\x22;','join','return\x20{\x20...__returned__,\x20...filterPrivateFields(model),\x20...filterPrivateFields(controller)\x20}','\x0a\x20\x20const\x20filterPrivateFields\x20=\x20source\x20=>\x20{\x0a\x20\x20\x20\x20const\x20target\x20=\x20{}\x0a\x20\x20\x20\x20for\x20(let\x20key\x20in\x20source)\x20{\x0a\x20\x20\x20\x20\x20\x20if\x20(key[0]\x20!==\x20\x22$\x22\x20&&\x20key[0]\x20!==\x20\x22_\x22)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20target[key]\x20=\x20source[key]\x0a\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20}\x0a\x20\x20\x20\x20return\x20target\x0a\x20\x20}\x0a\x20\x20const\x20wrapCtx\x20=\x20(_ctx,\x20model,\x20controller)\x20=>\x20{\x0a\x20\x20\x20\x20return\x20new\x20Proxy(_ctx,\x20{\x0a\x20\x20\x20\x20\x20\x20get\x20(obj,\x20prop)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20if\x20(prop\x20in\x20obj)\x20return\x20obj[prop]\x0a\x20\x20\x20\x20\x20\x20\x20\x20return\x20model?.[prop]\x20??\x20controller?.[prop]\x0a\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20})\x0a\x20\x20}\x0a','auto-deconstruct','2133465xsmFXZ','const\x20model\x20=\x20makeModel()','/src/','model,\x20','instantiateTables',',\x20\x27','<script>','_ctx\x20=\x20wrapCtx(_ctx,\x20filterPrivateFields(model))','return\x20{\x20...__returned__,\x20...filterPrivateFields(controller)\x20}','const\x20','370016cxVltX','import\x20makeModel\x20','<script\x20setup>','slice','1884043oWOwLA','const\x20controller','<style\x20lang=\x22scss\x22>','replace','push','startsWith','34872fAxBQB','controller.js','forEach','map','includes','const\x20model','1xGYjTQ','dirname','@use\x20\x22./','existsSync','import\x20makeModel\x20from\x20\x27./model.js\x27','toLowerCase','import\x20makeController\x20from\x20\x27./controller.js\x27','1946880SVpOIv','no\x20controller','split','return\x20(_ctx,\x20_cache)\x20=>\x20{','splice','return\x20__returned__','321398TDMdAy','import\x20makeController\x20','<script>\x0a','.js','basename','vue\x20})','no\x20model','.vue','653220qjXUvR','return\x20{\x20...__returned__,\x20...filterPrivateFields(model)\x20}','90reeEWY','</style>','DbName'];a95_0x1eef=function(){return _0x54fc7e;};return a95_0x1eef();}const filterPrivateFields=a95_0x1eada7(0xd7),inject=(_0x3fa971,_0x1c0229)=>{const _0x6be4a3=a95_0x1eada7,_0x19a616=a95_0x2bc012[_0x6be4a3(0xf4)](_0x1c0229),_0x1c719c=a95_0x2bc012[_0x6be4a3(0x104)](_0x1c0229),_0x55fde6=_0x1c719c['split']('.')[0x0],_0x33b252=a95_0x57d979[_0x6be4a3(0xf6)](a95_0x2bc012['join'](_0x19a616,_0x55fde6+'-scoped.scss')),_0xf683bb=a95_0x57d979['existsSync'](a95_0x2bc012[_0x6be4a3(0xd5)](_0x19a616,_0x55fde6+'.scss')),_0x2c950a=a95_0x57d979[_0x6be4a3(0xf6)](a95_0x2bc012[_0x6be4a3(0xd5)](_0x19a616,'model.js')),_0x34239c=a95_0x57d979['existsSync'](a95_0x2bc012[_0x6be4a3(0xd5)](_0x19a616,_0x6be4a3(0xee))),_0x5d990c=_0x2c950a&&!_0x3fa971[_0x6be4a3(0xf1)](_0x6be4a3(0x106))&&!_0x3fa971['includes'](_0x6be4a3(0xf2)),_0x2f324a=_0x34239c&&!_0x3fa971['includes'](_0x6be4a3(0xfb))&&!_0x3fa971[_0x6be4a3(0xf1)](_0x6be4a3(0xe8));if(_0x1c0229[_0x6be4a3(0xf1)](_0x6be4a3(0xdb))&&_0x1c719c[_0x6be4a3(0xf1)](_0x6be4a3(0x107))&&_0x3fa971[_0x6be4a3(0xec)](_0x6be4a3(0xe5))){_0x3fa971=_0x3fa971[_0x6be4a3(0xea)]('<script\x20setup>','<script\x20setup>\x0a');const _0x59dd69=_0x3fa971[_0x6be4a3(0xfc)]('\x0a');_0x33b252&&_0x59dd69[_0x6be4a3(0xeb)](...[_0x6be4a3(0x10e),_0x6be4a3(0xf5)+_0x55fde6+'-scoped.scss\x22;',_0x6be4a3(0x10b)]),_0xf683bb&&_0x59dd69[_0x6be4a3(0xeb)](...[_0x6be4a3(0xe9),_0x6be4a3(0xf5)+_0x55fde6+_0x6be4a3(0xd4),_0x6be4a3(0x10b)]),_0x2f324a&&_0x59dd69[_0x6be4a3(0xfe)](0x1,0x0,_0x6be4a3(0xf9),'const\x20controller\x20=\x20makeController({\x20'+(_0x5d990c?_0x6be4a3(0xdc):'')+_0x6be4a3(0x105)),_0x5d990c&&_0x59dd69[_0x6be4a3(0xfe)](0x1,0x0,_0x6be4a3(0xf7),_0x6be4a3(0xda)),_0x3fa971=_0x59dd69[_0x6be4a3(0xd5)]('\x0a');}return _0x3fa971;},instantiateTables=(_0x929dbe,_0x166f5b)=>{const _0x26a097=a95_0x1eada7,_0x12045d=a95_0x2bc012[_0x26a097(0x104)](_0x166f5b),_0x52f63f=_0x12045d['includes'](_0x26a097(0x107)),_0x3f7926=_0x12045d['includes'](_0x26a097(0x103));if(_0x166f5b[_0x26a097(0xf1)](_0x26a097(0xdb))&&(_0x52f63f||_0x3f7926)){const _0x59e9f4=_0x929dbe['split']('\x0a')['map'](_0x1b9964=>_0x1b9964['trim']())['filter'](_0x58e1ea=>!_0x58e1ea[_0x26a097(0xec)]('//'))[_0x26a097(0xd5)]('\x0a'),_0x447a48=new Set([..._0x59e9f4[_0x26a097(0x10d)](/[^a-z][A-Z]\w+\.(search|add|update|remove|func|batch|get)/g)][_0x26a097(0xf0)](_0x24a2e8=>_0x24a2e8[0x0][_0x26a097(0xe6)](0x1)[_0x26a097(0xfc)]('.')[0x0]));if(_0x447a48['size']){let _0x2083ce='';_0x447a48[_0x26a097(0xef)](_0xe40047=>{const _0x22df14=_0x26a097;let [_0x3f0a7c,_0x19876f]=_0xe40047[_0x22df14(0xfc)]('_')[_0x22df14(0xf0)](_0x4e8128=>_0x4e8128[_0x22df14(0xea)](/[A-Z]/g,_0x54bf0a=>'_'+_0x54bf0a[_0x22df14(0xf8)]())[_0x22df14(0xe6)](0x1));_0x19876f?_0x3f0a7c='\x27'+_0x3f0a7c+'\x27':(_0x19876f=_0x3f0a7c,_0x3f0a7c=_0x22df14(0x10c)),_0x2083ce+=_0x22df14(0xe2)+_0xe40047+'\x20=\x20new\x20Table('+_0x3f0a7c+_0x22df14(0xde)+_0x19876f+'\x27)\x0a';}),_0x52f63f?_0x929dbe=_0x929dbe[_0x26a097(0xea)](_0x26a097(0xe5),'<script\x20setup>\x0a'+_0x2083ce)[_0x26a097(0xea)](_0x26a097(0xdf),_0x26a097(0x102)+_0x2083ce):_0x929dbe=_0x2083ce+_0x929dbe;}}return _0x929dbe;},deconstruct=(_0x1b6a81,_0x10ccfd)=>{const _0xf9c2d6=a95_0x1eada7,_0x3d4b1d=a95_0x2bc012[_0xf9c2d6(0x104)](_0x10ccfd),_0x19c08a=_0x3d4b1d[_0xf9c2d6(0xf1)]('.vue');if(_0x10ccfd[_0xf9c2d6(0xf1)](_0xf9c2d6(0xdb))&&_0x19c08a){const _0x10dbf2=_0xf9c2d6(0xff),_0x194130=_0xf9c2d6(0xfd),_0x5fa0c4=_0x1b6a81[_0xf9c2d6(0xf1)](_0x10dbf2),_0x4f962e=_0x1b6a81[_0xf9c2d6(0xf1)](_0x194130),_0x269033=(_0x5fa0c4||_0x4f962e)&&_0x1b6a81[_0xf9c2d6(0xf1)](_0xf9c2d6(0xe4)),_0x2f70d0=(_0x5fa0c4||_0x4f962e)&&_0x1b6a81[_0xf9c2d6(0xf1)](_0xf9c2d6(0x101));if(_0x269033||_0x2f70d0){let _0x54a103=filterPrivateFields;if(_0x5fa0c4){if(_0x269033&&_0x2f70d0)_0x54a103+=_0xf9c2d6(0xd6);else{if(_0x269033)_0x54a103+=_0xf9c2d6(0x109);else _0x2f70d0&&(_0x54a103+=_0xf9c2d6(0xe1));}}else{_0x54a103+=_0x194130+'\x0a';if(_0x269033&&_0x2f70d0)_0x54a103+='_ctx\x20=\x20wrapCtx(_ctx,\x20filterPrivateFields(model),\x20filterPrivateFields(controller))';else{if(_0x269033)_0x54a103+=_0xf9c2d6(0xe0);else _0x2f70d0&&(_0x54a103+='_ctx\x20=\x20wrapCtx(_ctx,\x20null,\x20filterPrivateFields(controller))');}_0x54a103+='\x0a';}_0x1b6a81=_0x1b6a81['replace'](_0x5fa0c4?_0x10dbf2:_0x194130,_0x54a103);}}return _0x1b6a81;};export const autoInject=(_0x2f2fb6={})=>{return{'name':'auto-inject','transform'(_0x43aad1,_0x285f5e){const _0x8a21f=a95_0x121a;return _0x43aad1=inject(_0x43aad1,_0x285f5e),_0x2f2fb6[_0x8a21f(0xdd)]!==![]&&(_0x43aad1=instantiateTables(_0x43aad1,_0x285f5e)),{'code':_0x43aad1};}};};export const autoDeconstruct=()=>{const _0x3edff7=a95_0x1eada7;return{'name':_0x3edff7(0xd8),'transform'(_0x62dccc,_0x41f35d){return{'code':deconstruct(_0x62dccc,_0x41f35d)};}};};
package/src/App.vue ADDED
@@ -0,0 +1,134 @@
1
+ <script setup>
2
+ import { reactive } from 'vue'
3
+ import { areaList } from '@vant/area-data'
4
+
5
+ import { baseTable, baseForm } from '../packages/utils/model.js'
6
+
7
+ const table = {
8
+ ...baseTable(),
9
+ isRowEdit: true,
10
+ uid: 'table-1',
11
+ searcherConfig: {
12
+ views: [
13
+ {
14
+ name: '默认视图-1',
15
+ conditions: [
16
+ { no: 1, prop: 'fruit', op: 'eq', value: '苹果' },
17
+ { no: 2, prop: 'year', op: 'eq', value: '2024' },
18
+ ],
19
+ expression: '1 2'
20
+ }
21
+ ]
22
+ },
23
+ columns: [
24
+ { label: '水果', prop: 'fruit' },
25
+ { label: '日期', prop: 'year', comp: 'ElDatePicker' },
26
+ { label: '价格', prop: 'price', comp: 'ElInputNumber', min: 0, precision: 2 },
27
+ { label: '二维码', prop: 'qrcode', slot: '$qrcode', style: { width: '100px', height: '100px' } },
28
+ ],
29
+ list: [
30
+ { fruit: '苹果', year: '2015-01-01', price: 43123.3, qrcode: 'abcdef' },
31
+ { fruit: '苹果', year: '2016-01-01', price: 85234.8, qrcode: '123456' },
32
+ { fruit: '苹果', year: '2017-01-01', price: 93345.7, qrcode: 'abcdef' },
33
+ { fruit: '葡萄', year: '2015-02-01', price: 83456.1, qrcode: 'abcdef' },
34
+ { fruit: '葡萄', year: '2016-02-01', price: 73567.4, qrcode: 'abcdef' },
35
+ { fruit: '葡萄', year: '2017-02-01', price: 55678.1, qrcode: 'abcdef' },
36
+ { fruit: '西瓜', year: '2015-03-01', price: 86789.4, qrcode: 'abcdef' },
37
+ { fruit: '西瓜', year: '2016-03-01', price: 65890.2, qrcode: 'abcdef' },
38
+ { fruit: '西瓜', year: '2017-03-01', price: 82901.5, qrcode: 'abcdef' },
39
+ { fruit: '香蕉', year: '2015-04-01', price: 72012.4, qrcode: 'abcdef' },
40
+ { fruit: '香蕉', year: '2016-04-01', price: 53123.9, qrcode: 'abcdef' },
41
+ { fruit: '香蕉', year: '2017-04-01', price: 39234.1, qrcode: 'abcdef' },
42
+ ].map(ele => {
43
+ ele.isEditing = true
44
+ ele.editable = true
45
+ return ele
46
+ })
47
+ }
48
+
49
+ const controller = {
50
+ handleSearch () {
51
+ console.log('000000000000000')
52
+ },
53
+ handleAdd () {
54
+ console.log('111111111111111')
55
+ },
56
+ handleSubmit () {
57
+ model.form.formRef.validate()
58
+ }
59
+ }
60
+
61
+ const model = reactive({
62
+ buttons: [
63
+ '查询|handleSearch|success|search',
64
+ '新增|handleAdd|primary|plus',
65
+ '提交|handleAdd|warning|search'
66
+ ],
67
+ visible: true,
68
+ richtext: '',
69
+ form: {
70
+ ...baseForm(),
71
+ formItems: [
72
+ { label: '姓名', prop: 'name', required: true, directives: { domid: 'name' }, viewonly: false },
73
+ {
74
+ label: '头像', prop: 'avatar',
75
+ infoAttrs: { slot: '$qrcode' }, viewonly: true
76
+ },
77
+ { label: '生日', prop: 'birthday', comp: 'MobileXDatePicker', type: 'datetime' },
78
+ { label: '地区', prop: 'district', comp: 'x-district-select', areaList, required: true },
79
+ {
80
+ label: '用户', prop: 'user', comp: 'x-searcher',
81
+ titles: ['name', 'gender'],
82
+ subTitles: 'age',
83
+ value: 'name'
84
+ },
85
+ { label: '年龄', prop: 'age', comp: 'ElInputNumber', min: 1, required: true, infoAttrs: { slot: 'age' } },
86
+ {
87
+ label: '教育经历', prop: 'educations', comp: 'x-array', required: true, span: 24,
88
+ items: [
89
+ { label: '学校', prop: 'school' },
90
+ { label: '开始时间', prop: 'start', comp: 'ElDatePicker', type: 'month', 'value-format': 'YYYY-MM' },
91
+ { label: '结束时间', prop: 'end', comp: 'ElDatePicker', type: 'month', 'value-format': 'YYYY-MM' },
92
+ ].map(ele => ({ ...ele, required: true }))
93
+ },
94
+ { label: '学历', prop: 'xueli', comp: 'mobile-x-select', options: ['小学', '初中', '高中', '大学'] },
95
+ {
96
+ label: '其他', prop: 'others', comp: 'x-dict',
97
+ items: [
98
+ { label: '座右铭', prop: 'motto' },
99
+ { label: '备注', prop: 'remark' },
100
+ ]
101
+ }
102
+ ].map(ele => {
103
+ const { span = 12, xs = 24 } = ele
104
+ return Object.assign(ele, { span, xs })
105
+ }),
106
+ form: {
107
+ name: 'Stardust',
108
+ avatar: 'abcdef',
109
+ district: '',
110
+ user: '',
111
+ educations: [
112
+ { school: '11', start: '2024-05', end: '2024-06' },
113
+ { school: '22', start: '2024-06', end: '2024-07' }
114
+ ]
115
+ }
116
+ }
117
+ })
118
+
119
+ window.model = model
120
+ </script>
121
+
122
+ <template>
123
+ <div style="padding: 10px;">
124
+ <x-buttons :buttons="model.buttons" :controller :gutter="10" />
125
+ <x-form :form="model.form" :gutter="10" label-width="100px">
126
+ <template #age>
127
+ <el-input-number v-model="model.form.form.age" :min="0" />
128
+ </template>
129
+ </x-form>
130
+ <x-info :data="model.form.form" :fields="model.form.formItems" />
131
+ <el-button type="primary" @click="controller.handleSubmit">提交</el-button>
132
+ <x-table :table :controller hide-operates />
133
+ </div>
134
+ </template>
package/src/main.js ADDED
@@ -0,0 +1 @@
1
+ const a96_0x2e7f1=a96_0x8971;(function(_0x518a7b,_0x235966){const _0xb71b8d=a96_0x8971,_0x36013d=_0x518a7b();while(!![]){try{const _0x2d56e7=-parseInt(_0xb71b8d(0x8e))/0x1*(-parseInt(_0xb71b8d(0x93))/0x2)+-parseInt(_0xb71b8d(0x90))/0x3*(parseInt(_0xb71b8d(0x91))/0x4)+-parseInt(_0xb71b8d(0x86))/0x5+parseInt(_0xb71b8d(0x81))/0x6+-parseInt(_0xb71b8d(0x82))/0x7*(parseInt(_0xb71b8d(0x85))/0x8)+-parseInt(_0xb71b8d(0x88))/0x9*(parseInt(_0xb71b8d(0x94))/0xa)+parseInt(_0xb71b8d(0x8b))/0xb;if(_0x2d56e7===_0x235966)break;else _0x36013d['push'](_0x36013d['shift']());}catch(_0x376b12){_0x36013d['push'](_0x36013d['shift']());}}}(a96_0x5dcf,0x95834));import{createApp}from'vue';import a96_0x543d8e from'element-plus';import a96_0x3e09f8 from'vant';import a96_0x455dcd from'../packages/index.js';import'../packages/index.scss';import a96_0x53e199,{API_BASE_URL}from'./request.js';function a96_0x8971(_0x29938e,_0x2f70c7){const _0x5dcf6a=a96_0x5dcf();return a96_0x8971=function(_0x897196,_0x4f4fe4){_0x897196=_0x897196-0x81;let _0x3faf44=_0x5dcf6a[_0x897196];return _0x3faf44;},a96_0x8971(_0x29938e,_0x2f70c7);}function a96_0x5dcf(){const _0x44cd9d=['9FheeVd','config','component','15885914ThZjLw','entries','use','474393oubhNw','domid','3AvzQEA','1795484NLPnge','mount','4oMUgxJ','2887350XNxFMn','5984328QMsWcM','182287HIZxwn','globalProperties','directive','336FWLDnh','4733080DQCPKi','assign'];a96_0x5dcf=function(){return _0x44cd9d;};return a96_0x5dcf();}import a96_0x1725a8 from'@/App.vue';const app=createApp(a96_0x1725a8);app[a96_0x2e7f1(0x84)](a96_0x2e7f1(0x8f),{'created'(_0x2b4939,_0x1e1f3d){}}),app[a96_0x2e7f1(0x8d)](a96_0x543d8e);for(const [key,component]of Object[a96_0x2e7f1(0x8c)](ElementPlusIconsVue)){app[a96_0x2e7f1(0x8a)](key,component);}app['use'](a96_0x3e09f8),app[a96_0x2e7f1(0x8d)](a96_0x455dcd,{'ElementPlus':a96_0x543d8e,'Vant':a96_0x3e09f8}),Object[a96_0x2e7f1(0x87)](app[a96_0x2e7f1(0x89)][a96_0x2e7f1(0x83)],{'isMobile':window['isMobile'],'service':{'request':a96_0x53e199,'API_BASE_URL':API_BASE_URL},'$store':{'app':{'sidebarCollapse':![],'toggleDuration':0x0}}}),app[a96_0x2e7f1(0x92)]('#app');export default app;
package/src/request.js ADDED
@@ -0,0 +1 @@
1
+ const a97_0x6b814a=a97_0x3d61;(function(_0x4efc09,_0x30ba22){const _0xa6a975=a97_0x3d61,_0x68e82=_0x4efc09();while(!![]){try{const _0x201200=parseInt(_0xa6a975(0x14f))/0x1*(-parseInt(_0xa6a975(0x14a))/0x2)+-parseInt(_0xa6a975(0x138))/0x3+-parseInt(_0xa6a975(0x140))/0x4*(-parseInt(_0xa6a975(0x14b))/0x5)+-parseInt(_0xa6a975(0x13f))/0x6*(-parseInt(_0xa6a975(0x14d))/0x7)+parseInt(_0xa6a975(0x14c))/0x8+parseInt(_0xa6a975(0x139))/0x9*(parseInt(_0xa6a975(0x13c))/0xa)+parseInt(_0xa6a975(0x148))/0xb*(-parseInt(_0xa6a975(0x13a))/0xc);if(_0x201200===_0x30ba22)break;else _0x68e82['push'](_0x68e82['shift']());}catch(_0x5dd131){_0x68e82['push'](_0x68e82['shift']());}}}(a97_0x42c7,0x83065));const {PROD,VITE_DEV_BASE_URL,VITE_PROD_BASE_URL,VITE_TIMEOUT=0xea60}=import.meta[a97_0x6b814a(0x143)],API_BASE_URL=window['API_BASE_URL']||(PROD?VITE_PROD_BASE_URL:VITE_DEV_BASE_URL),createRequest=_0x3cf0d2=>{const _0x45be0b=a97_0x6b814a,_0x81f016=axios['create']({'baseURL':API_BASE_URL,'timeout':VITE_TIMEOUT*0x1,..._0x3cf0d2});return _0x81f016[_0x45be0b(0x144)][_0x45be0b(0x146)][_0x45be0b(0x147)](_0xceddc3=>{return _0xceddc3;},_0x1cd62f=>{console['error'](_0x1cd62f);}),_0x81f016[_0x45be0b(0x144)]['response']['use'](_0x1f3872=>{return _0x1f3872;},_0x3d223b=>{console['error'](_0x3d223b);}),_0x81f016;},fetchRequest=(_0x5b178e,_0x3d3ed4={})=>{const _0x301366=a97_0x6b814a;_0x5b178e=_0x5b178e[_0x301366(0x13d)](_0x301366(0x145))?_0x5b178e:API_BASE_URL+_0x5b178e;const {method:method='GET',headers:_0x4006f3,body:_0x442ac0,..._0x37e251}=_0x3d3ed4,_0xff7ab7={'method':method,..._0x37e251,'headers':{'content-type':_0x301366(0x13e),..._0x4006f3}};return[_0x301366(0x14e),_0x301366(0x13b)]['includes'](method[_0x301366(0x141)]())&&(_0xff7ab7['body']=typeof _0x442ac0===_0x301366(0x142)?_0x442ac0:JSON[_0x301366(0x149)](_0x442ac0)),fetch(_0x5b178e,_0xff7ab7);};function a97_0x3d61(_0x8486f0,_0x24b1dd){const _0x42c7d2=a97_0x42c7();return a97_0x3d61=function(_0x3d6112,_0x54b6a7){_0x3d6112=_0x3d6112-0x138;let _0x10d6b7=_0x42c7d2[_0x3d6112];return _0x10d6b7;},a97_0x3d61(_0x8486f0,_0x24b1dd);}export default createRequest();export{API_BASE_URL,createRequest,fetchRequest};function a97_0x42c7(){const _0x3fa8e7=['5qOuOcy','562592JpPxzn','77AwRGvU','PUT','422dwEwuE','370995tPFWuX','1234881HZJHoI','10368996AbobbH','POST','10cUDgfV','startsWith','application/json','578574HCorYh','2326140fScpMy','toUpperCase','string','env','interceptors','http','request','use','11atsKrN','stringify','1542bvNzUd'];a97_0x42c7=function(){return _0x3fa8e7;};return a97_0x42c7();}