@wp1001/ui 2.9.13 → 3.0.1
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/@vant-D4fmGxs6.js +1 -3891
- package/index.html +28 -0
- package/index.js +1 -8419
- package/lib/tinymce/zh_CN.js +1 -0
- package/package.json +1 -1
- package/packages/assets/devtools-detector.js +1 -2
- package/packages/components/xarray/index.js +1 -64
- package/packages/components/xautorows/index.js +1 -35
- package/packages/components/xbutton/mobile.js +1 -3
- package/packages/components/xbutton/pc.js +1 -3
- package/packages/components/xbuttons/mobile.js +1 -51
- package/packages/components/xbuttons/pc.js +1 -51
- package/packages/components/xchart/constants.js +1 -58
- package/packages/components/xchart/index.js +1 -263
- package/packages/components/xchart/utils.js +1 -121
- package/packages/components/xcheckboxs/mobile.js +1 -58
- package/packages/components/xcheckboxs/pc.js +1 -49
- package/packages/components/xcol/mobile.js +1 -10
- package/packages/components/xcol/pc.js +1 -10
- package/packages/components/xdatepicker/mobile.js +1 -71
- package/packages/components/xdatepicker/pc.js +1 -9
- package/packages/components/xdialog/mobile.js +1 -60
- package/packages/components/xdialog/pc.js +1 -64
- package/packages/components/xdict/index.js +1 -47
- package/packages/components/xdistrictselect/mobile.js +1 -79
- package/packages/components/xdistrictselect/pc.js +1 -127
- package/packages/components/xform/mobile.js +1 -29
- package/packages/components/xform/pc.js +1 -42
- package/packages/components/xform/utils.js +1 -95
- package/packages/components/xformitem/mobile.js +1 -56
- package/packages/components/xformitem/pc.js +1 -72
- package/packages/components/xicon/mobile.js +1 -35
- package/packages/components/xicon/pc.js +1 -35
- package/packages/components/xinfo/index.js +1 -100
- package/packages/components/xlooper/index.js +1 -7
- package/packages/components/xpagination/mobile.js +1 -21
- package/packages/components/xpagination/pc.js +1 -21
- package/packages/components/xpicker/index.js +1 -38
- package/packages/components/xradios/mobile.js +1 -40
- package/packages/components/xradios/pc.js +1 -53
- package/packages/components/xrow/mobile.js +1 -9
- package/packages/components/xrow/pc.js +1 -9
- package/packages/components/xscan/mobile.js +1 -24
- package/packages/components/xscan/pc.js +1 -20
- package/packages/components/xsearcher/index.js +1 -198
- package/packages/components/xselect/mobile.js +1 -86
- package/packages/components/xselect/pc.js +1 -114
- package/packages/components/xselect/util.js +1 -66
- package/packages/components/xselectv2/index.js +1 -91
- package/packages/components/xtable/mobile.js +1 -108
- package/packages/components/xtable/pc.js +1 -143
- package/packages/components/xtable/searcher.js +1 -477
- package/packages/components/xtable/settings.js +1 -80
- package/packages/components/xtable/utils.js +1 -692
- package/packages/components/xtabletools/mobile.js +1 -25
- package/packages/components/xtabletools/pc.js +1 -18
- package/packages/components/xtablev2/index.js +1 -53
- package/packages/components/xtags/mobile.js +1 -17
- package/packages/components/xtags/pc.js +1 -17
- package/packages/components/xtinymce/index.js +1 -71
- package/packages/components/xuploader/xfileuploader.js +1 -48
- package/packages/components/xuploader/ximageuploader.js +1 -53
- package/packages/comps.js +1 -108
- package/packages/controllers/BaseController.js +1 -125
- package/packages/controllers/CrudController.js +1 -907
- package/packages/controllers/TempCrudController.js +1 -32
- package/packages/controllers/index.js +1 -15
- package/packages/directives/el-table-infinite-scroll.js +1 -55
- package/packages/directives/index.js +1 -5
- package/packages/index.js +1 -81
- package/packages/layout/breadcrumb/index.js +1 -41
- package/packages/layout/header/inner.js +1 -11
- package/packages/layout/pc.vue +1 -1
- package/packages/layout/screenlock/index.js +1 -129
- package/packages/layout/sidebar/item.js +1 -16
- package/packages/layout/sidebar/menu.js +1 -72
- package/packages/layout/tagsview/ScrollPane.js +1 -65
- package/packages/layout/tagsview/index.js +1 -169
- package/packages/plop/actions/make-fill-admin-partials-action.js +1 -95
- package/packages/plop/generators/make-admin-page.js +1 -39
- package/packages/plop/generators/make-database-admin-pages.js +1 -84
- package/packages/plop/generators/make-page-generator.js +1 -52
- package/packages/plop/generators/make-simple-page.js +1 -20
- package/packages/plop/plopfile.js +1 -24
- package/packages/plop/utils/index.js +1 -168
- package/packages/plop/utils/plop-utils.js +1 -86
- package/packages/utils/crypt.js +1 -24
- package/packages/utils/decorators.js +1 -67
- package/packages/utils/disallowDevtools.js +1 -53
- package/packages/utils/effects.js +1 -173
- package/packages/utils/funcs.js +1 -78
- package/packages/utils/index.js +1 -95
- package/packages/utils/message.js +1 -110
- package/packages/utils/middlewares.js +1 -86
- package/packages/utils/model.js +1 -71
- package/packages/utils/modelUtils.js +1 -203
- package/packages/utils/request.js +1 -57
- package/packages/utils/site.js +1 -33
- package/packages/vite-plugins.js +1 -141
- package/src/App.vue +134 -0
- package/src/main.js +1 -0
- package/src/request.js +1 -0
- package/style.css +1 -0
- package/vite.config.js +1 -0
- package/vite.lib.config.js +1 -0
- package/.env +0 -6
|
@@ -1,203 +1 @@
|
|
|
1
|
-
import { watch }
|
|
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
|
+
function a92_0x4f50(_0x277039,_0x28e11f){const _0xbac91d=a92_0xbac9();return a92_0x4f50=function(_0x4f50fb,_0x55f223){_0x4f50fb=_0x4f50fb-0x1b5;let _0x35e9ef=_0xbac91d[_0x4f50fb];return _0x35e9ef;},a92_0x4f50(_0x277039,_0x28e11f);}const a92_0x170be4=a92_0x4f50;(function(_0x16c8ce,_0x421358){const _0x387764=a92_0x4f50,_0x21b539=_0x16c8ce();while(!![]){try{const _0x551546=-parseInt(_0x387764(0x1fa))/0x1+parseInt(_0x387764(0x1b7))/0x2*(-parseInt(_0x387764(0x1d0))/0x3)+parseInt(_0x387764(0x1c2))/0x4*(parseInt(_0x387764(0x1b8))/0x5)+-parseInt(_0x387764(0x1db))/0x6*(-parseInt(_0x387764(0x1cd))/0x7)+-parseInt(_0x387764(0x1e0))/0x8+-parseInt(_0x387764(0x1b5))/0x9+parseInt(_0x387764(0x1bf))/0xa;if(_0x551546===_0x421358)break;else _0x21b539['push'](_0x21b539['shift']());}catch(_0x34c12a){_0x21b539['push'](_0x21b539['shift']());}}}(a92_0xbac9,0xde24c));import{watch}from'vue';const {funcs}=StardustJs;export const initFields=_0x4cd64f=>{return _0x4cd64f['map'](_0x23464a=>{const _0x5760b5=a92_0x4f50,_0x8a67cb=Object[_0x5760b5(0x1c4)](_0x23464a);for(let _0x1d6dd5 of _0x8a67cb){if(_0x1d6dd5[_0x5760b5(0x1fc)](_0x5760b5(0x1f8)))_0x23464a[_0x5760b5(0x1f1)]??={},_0x23464a[_0x5760b5(0x1f1)][_0x1d6dd5[_0x5760b5(0x1f6)](0x3)]=_0x23464a[_0x1d6dd5],delete _0x23464a[_0x1d6dd5];else _0x1d6dd5[_0x5760b5(0x1fc)](_0x5760b5(0x1d7))&&(_0x23464a[_0x5760b5(0x1fb)]??={},_0x23464a[_0x5760b5(0x1fb)][_0x1d6dd5[_0x5760b5(0x1f6)](0x3)]=_0x23464a[_0x1d6dd5],delete _0x23464a[_0x1d6dd5]);}if(_0x23464a[_0x5760b5(0x1e5)]==='date')_0x23464a[_0x5760b5(0x1fb)]??={},_0x23464a[_0x5760b5(0x1fb)][_0x5760b5(0x1dc)]??=_0x5760b5(0x1c5);else _0x23464a['type']===_0x5760b5(0x1c8)&&(_0x23464a[_0x5760b5(0x1fb)]??={},_0x23464a[_0x5760b5(0x1fb)][_0x5760b5(0x1dc)]??=_0x5760b5(0x1e7));return _0x23464a['xs']??=0x18,_0x23464a;});};export const initModel=(_0x367336,_0x513926)=>{const _0x4d22c9=a92_0x4f50;for(let _0x3b7a73 in _0x367336){const _0x5a91c3=_0x367336[_0x3b7a73];if(!_0x5a91c3||typeof _0x5a91c3!=='object')continue;_0x3b7a73==='table'&&_0x367336[_0x3b7a73][_0x4d22c9(0x1be)]&&initTable(_0x5a91c3,_0x513926),_0x3b7a73===_0x4d22c9(0x1c9)&&_0x367336[_0x3b7a73]['_isBaseDialog']&&initDialog(_0x5a91c3,_0x513926),_0x3b7a73===_0x4d22c9(0x1b9)&&_0x367336[_0x3b7a73][_0x4d22c9(0x1e1)]&&initForm(_0x5a91c3,_0x513926);}return _0x367336;};export const initTable=(_0x3424ec,_0x41f5c0)=>{const _0x394eb5=a92_0x4f50;return _0x3424ec['columns'][_0x394eb5(0x1ec)](..._0x41f5c0[_0x394eb5(0x1df)](_0x25fd12=>{const _0x14b433=_0x394eb5;return _0x25fd12['visible']===![]?_0x25fd12[_0x14b433(0x1d1)]:_0x25fd12[_0x14b433(0x1d1)]!==![];})),_0x3424ec;};export const initDialog=(_0xbca489,_0x25f23d)=>{const _0x3c5288=a92_0x4f50;return _0xbca489[_0x3c5288(0x1d8)]=_0x25f23d['filter'](_0x4dbbb6=>{const _0x4feb98=_0x3c5288;if(_0x4dbbb6[_0x4feb98(0x1cc)]===![])return _0x4dbbb6['canAdd']||_0x4dbbb6[_0x4feb98(0x1d5)];return _0x4dbbb6[_0x4feb98(0x1ba)]!==![]||_0x4dbbb6[_0x4feb98(0x1d5)]!==![];}),initForm(_0xbca489,_0x25f23d),_0xbca489;};export const initForm=(_0x4f9746,_0xe0c9f9)=>{const _0x44bbbc=a92_0x4f50;_0x4f9746[_0x44bbbc(0x1e1)]&&!_0x4f9746[_0x44bbbc(0x1de)]&&(_0x4f9746[_0x44bbbc(0x1d8)]=_0xe0c9f9[_0x44bbbc(0x1df)](_0x11b543=>_0x11b543[_0x44bbbc(0x1cc)]!==![]));initDefaultForm(_0x4f9746[_0x44bbbc(0x1b9)],_0x4f9746[_0x44bbbc(0x1d8)]),_0x4f9746['initialForm']=funcs['deepCopy'](_0x4f9746[_0x44bbbc(0x1b9)]),_0x4f9746[_0x44bbbc(0x1c7)]=funcs[_0x44bbbc(0x1b6)](_0x4f9746['formRules']);const _0x55f8fe=()=>{initFormRules(_0x4f9746);};return watch(()=>_0x4f9746[_0x44bbbc(0x1d8)],_0x55f8fe,{'immediate':!![],'deep':!![]}),_0x4f9746;};function a92_0xbac9(){const _0x2b54be=['validator','push','change','ElInputNumber','string','options','tableAttrs','split','start-placeholder','virtual','datetimerange','slice','onChange','ta_','blur','554820DAekMu','formAttrs','startsWith','1835271iCkGkV','deepCopy','574yAmWSj','12620wkBdxa','form','canAdd','match','trim','ElSwitch','_isBaseTable','8455820YiOSiW','endsWith','platform','472IGbrXy','end-placeholder','keys','YYYY-MM-DD','assign','initialFormRules','datetime','dialog','asyncValidator','XCheckboxs','visible','10157XGhQqc','forEach','ElDatePicker','246ANDOyh','canView','number','includes','some','canEdit','mobile','fa_','formItems','prop','formRules','4098APijrp','value-format','isMobile','_isBaseDialog','filter','3538192ZOrSdX','_isBaseForm','hasOwnProperty','comp','x-checkboxs','type','every','YYYY-MM-DD\x20HH:mm:ss','monthrange','daterange','label'];a92_0xbac9=function(){return _0x2b54be;};return a92_0xbac9();}export const initFormRules=_0x379f49=>{const _0x4c1e11=a92_0x4f50,{formItems:_0x3e3733,initialFormRules:_0x20717f}=_0x379f49;Object['assign'](_0x379f49['formRules'],funcs[_0x4c1e11(0x1b6)](_0x20717f)),Object[_0x4c1e11(0x1c4)](_0x379f49[_0x4c1e11(0x1da)])[_0x4c1e11(0x1ce)](_0x17d1a9=>{const _0x41c118=_0x4c1e11;!_0x20717f[_0x41c118(0x1e2)](_0x17d1a9)&&delete _0x379f49[_0x41c118(0x1da)][_0x17d1a9];});const _0xc8d58b={};return _0x3e3733[_0x4c1e11(0x1ce)](_0x3cd135=>{const _0x3bdf5e=_0x4c1e11;if(_0x379f49[_0x3bdf5e(0x1da)][_0x3cd135[_0x3bdf5e(0x1d9)]])return;if(!_0x3cd135['required']&&!_0x3cd135['validator']&&!_0x3cd135['asyncValidator'])return;const _0x59dd2a=_0x3cd135['platform']||_0x379f49[_0x3bdf5e(0x1c1)]||(window[_0x3bdf5e(0x1dd)]?_0x3bdf5e(0x1d6):'pc'),_0x55107e=triggers[_0x59dd2a],_0x517c8d=[],_0x570265=_0x3bdf5e(0x1f0)in _0x3cd135,_0x38d017='请'+(_0x3cd135[_0x3bdf5e(0x1eb)]||_0x3cd135[_0x3bdf5e(0x1ca)]?'正确':'')+(_0x570265?'选择':'输入')+(_0x3cd135?.[_0x3bdf5e(0x1ea)]||_0x3cd135[_0x3bdf5e(0x1d9)]),_0x2b2c3d={'required':!![],'message':_0x38d017};if(_0x3cd135['validator'])_0x2b2c3d['validator']=(_0x50799a,_0x24536b)=>{const _0x44bb8e=_0x3bdf5e;return _0x59dd2a==='pc'?_0x3cd135[_0x44bb8e(0x1eb)](_0x50799a,_0x24536b):_0x3cd135[_0x44bb8e(0x1eb)](_0x24536b,_0x50799a);};if(_0x3cd135['asyncValidator'])_0x2b2c3d[_0x3bdf5e(0x1ca)]=(_0x50f93d,_0x24e8ec)=>{const _0x50ef5b=_0x3bdf5e;return _0x59dd2a==='pc'?_0x3cd135[_0x50ef5b(0x1ca)](_0x50f93d,_0x24e8ec):_0x3cd135['asyncValidator'](_0x24e8ec,_0x50f93d);};!_0x3cd135[_0x3bdf5e(0x1e3)]?_0x517c8d[_0x3bdf5e(0x1ec)]({..._0x2b2c3d,'trigger':_0x55107e[_0x3bdf5e(0x1f9)]}):_0x517c8d[_0x3bdf5e(0x1ec)]({..._0x2b2c3d,'trigger':_0x55107e['change']}),_0x3cd135['comp']===_0x3bdf5e(0x1ee)&&_0x517c8d[_0x3bdf5e(0x1ec)]({..._0x2b2c3d,'trigger':_0x55107e[_0x3bdf5e(0x1f9)]}),_0xc8d58b[_0x3cd135[_0x3bdf5e(0x1d9)]]=_0x517c8d;}),Object[_0x4c1e11(0x1c6)](_0x379f49[_0x4c1e11(0x1da)],_0xc8d58b),_0x379f49['formRules'];};export const initDefaultForm=(_0xca568,_0x5c1627,_0x108ffa=!![])=>{const _0x3c05ce=a92_0x4f50,_0x48b3eb={};return _0x5c1627[_0x3c05ce(0x1ce)](_0x5d8276=>{const _0x2286d8=_0x3c05ce;if(!_0x5d8276[_0x2286d8(0x1d9)]||_0x5d8276[_0x2286d8(0x1f4)])return;let _0xd5361c='';const {type:_0x8471de,options:_0x278b56}=_0x5d8276,{multiple:_0x35f960}=_0x5d8276[_0x2286d8(0x1fb)]||{};if(_0x108ffa&&_0x8471de===_0x2286d8(0x1d2)||_0x5d8276[_0x2286d8(0x1e3)]===_0x2286d8(0x1ee))_0xd5361c=null;else{if(_0x5d8276[_0x2286d8(0x1e3)]===_0x2286d8(0x1bd))_0xd5361c=![];else{if(_0x278b56&&(_0x5d8276[_0x2286d8(0x1e3)]?.['endsWith'](_0x2286d8(0x1cb))||_0x5d8276[_0x2286d8(0x1e3)]?.[_0x2286d8(0x1c0)](_0x2286d8(0x1e4))||_0x35f960))_0xd5361c=[];else{if(_0x5d8276[_0x2286d8(0x1e3)]===_0x2286d8(0x1cf)&&[_0x2286d8(0x1f5),_0x2286d8(0x1e9),_0x2286d8(0x1e8)][_0x2286d8(0x1d3)](_0x5d8276[_0x2286d8(0x1e5)])){const _0x5dba74={'datetimerange':'时间','daterange':'日期','monthrange':'月份'}[_0x5d8276[_0x2286d8(0x1e5)]];!_0x5d8276[_0x2286d8(0x1f3)]&&(_0x5d8276[_0x2286d8(0x1f3)]='开始'+_0x5dba74),!_0x5d8276['end-placeholder']&&(_0x5d8276[_0x2286d8(0x1c3)]='结束'+_0x5dba74),_0xd5361c=[];}}}}_0x48b3eb[_0x5d8276[_0x2286d8(0x1d9)]]=_0xd5361c;}),Object['assign'](_0xca568,{..._0x48b3eb,..._0xca568}),_0xca568;};export const isWhenMatched=(_0x1d6f35,_0x438942)=>{const _0x28e207=a92_0x4f50;if(!_0x1d6f35)return!![];const _0x328019=_0x1d6f35['split'](/\s?(&&|\|\|)\s?/g);if(_0x328019[_0x28e207(0x1d3)]('&&')&&_0x328019[_0x28e207(0x1d3)]('||'))throw'一个\x20when\x20表达式中仅支持\x20&&\x20模式或\x20||\x20模式';const _0x482dec=_0x328019['includes']('&&'),_0x224756=/[\^\*\$\~\!]?=/,_0x120c26=_0x328019[_0x28e207(0x1df)](_0x14c76d=>_0x14c76d!=='&&'&&_0x14c76d!=='||');return _0x120c26[_0x482dec?_0x28e207(0x1e6):'some'](_0x252398=>{const _0x2b78fe=_0x28e207;let [_0x5ed3b5,_0x513119]=_0x252398[_0x2b78fe(0x1f2)](_0x224756);_0x513119=_0x513119['split']('|');let _0x1c312a=_0x438942[_0x5ed3b5];if(typeof _0x1c312a===_0x2b78fe(0x1d2))_0x1c312a+='';else{if(typeof _0x1c312a===_0x2b78fe(0x1ef))_0x1c312a=_0x1c312a[_0x2b78fe(0x1bc)]();}const _0x391eb8=_0x252398[_0x2b78fe(0x1bb)](_0x224756)[0x0];if(_0x391eb8==='!=')return!_0x513119[_0x2b78fe(0x1d3)](_0x1c312a);return _0x513119[_0x2b78fe(0x1d4)](_0x4f8b65=>{const _0x56d31b=_0x2b78fe;if(_0x391eb8==='^=')return _0x1c312a?.[_0x56d31b(0x1fc)](_0x4f8b65);else{if(_0x391eb8==='*=')return _0x1c312a?.[_0x56d31b(0x1d3)](_0x4f8b65);else{if(_0x391eb8==='$=')return _0x1c312a?.[_0x56d31b(0x1c0)](_0x4f8b65);else{if(_0x391eb8==='~=')return!_0x1c312a?.[_0x56d31b(0x1d3)](_0x4f8b65);else{if(_0x391eb8==='!=')return _0x1c312a!==_0x4f8b65;}}}}return _0x4f8b65===_0x1c312a;});});};export const triggers={'mobile':{'blur':'onBlur','change':a92_0x170be4(0x1f7)},'pc':{'blur':a92_0x170be4(0x1f9),'change':a92_0x170be4(0x1ed)}};export default{'initFields':initFields,'initModel':initModel,'initTable':initTable,'initDialog':initDialog,'initForm':initForm,'initFormRules':initFormRules,'initDefaultForm':initDefaultForm,'isWhenMatched':isWhenMatched,'triggers':triggers};
|
|
@@ -1,57 +1 @@
|
|
|
1
|
-
|
|
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(_0x22195e,_0xf8a8c){const _0x524ed6=a93_0x26db,_0x2035bd=_0x22195e();while(!![]){try{const _0x32853f=-parseInt(_0x524ed6(0x98))/0x1*(parseInt(_0x524ed6(0xa7))/0x2)+-parseInt(_0x524ed6(0xa8))/0x3+parseInt(_0x524ed6(0xb0))/0x4*(parseInt(_0x524ed6(0x97))/0x5)+parseInt(_0x524ed6(0x9d))/0x6+parseInt(_0x524ed6(0x99))/0x7+parseInt(_0x524ed6(0xa6))/0x8*(-parseInt(_0x524ed6(0xae))/0x9)+-parseInt(_0x524ed6(0xb9))/0xa;if(_0x32853f===_0xf8a8c)break;else _0x2035bd['push'](_0x2035bd['shift']());}catch(_0x46e05f){_0x2035bd['push'](_0x2035bd['shift']());}}}(a93_0x5782,0xc3854));import{Message}from'./message.js';function a93_0x26db(_0x369660,_0x26d2bc){const _0x5782ec=a93_0x5782();return a93_0x26db=function(_0x26dbf9,_0x1c9012){_0x26dbf9=_0x26dbf9-0x97;let _0x2a2c86=_0x5782ec[_0x26dbf9];return _0x2a2c86;},a93_0x26db(_0x369660,_0x26d2bc);}const requestUse=(_0x309d5f,_0x462df3,_0x3e9439,_0x4dbd20,_0x305bea)=>{const _0x1a644e=a93_0x26db;_0x305bea['headers'][_0x1a644e(0xaa)]||=_0x3e9439[_0x1a644e(0xad)]['token'];const _0x1eace3=_0x309d5f['config'][_0x1a644e(0xa3)]['httpEncrypt'];if(_0x1eace3!==![]){_0x305bea[_0x1a644e(0xbd)][_0x1a644e(0x9f)]=_0x1eace3,_0x305bea[_0x1a644e(0xbd)]['Content-Type']||=_0x1a644e(0xa5);if(_0x305bea['url'][_0x1a644e(0xc2)]('?')>=0x0){const [_0x17afce,..._0x50066e]=_0x305bea[_0x1a644e(0x9e)][_0x1a644e(0xb2)]('?'),_0x45a7e2=_0x462df3[_0x1a644e(0xc0)][_0x1eace3](_0x50066e[_0x1a644e(0xb5)]('?'),_0x1a644e(0xc1));_0x305bea[_0x1a644e(0x9e)]=_0x17afce+'?'+_0x45a7e2;}else _0x305bea[_0x1a644e(0xb6)]||={'__placeholder__':Date[_0x1a644e(0xbc)]()[_0x1a644e(0xac)](0x10)};if(_0x305bea[_0x1a644e(0xb6)]){const _0x4216de=decodeURIComponent(new URLSearchParams(_0x305bea['params'])[_0x1a644e(0xac)]());_0x305bea[_0x1a644e(0x9e)]+='?'+_0x462df3['encrypt'][_0x1eace3](_0x4216de,_0x1a644e(0xc1)),delete _0x305bea[_0x1a644e(0xb6)];}if(_0x305bea[_0x1a644e(0xa0)]!==undefined&&!(_0x305bea[_0x1a644e(0xa0)]instanceof FormData)){const _0x49c495=_0x462df3[_0x1a644e(0xc0)][_0x1eace3](JSON['stringify'](_0x305bea[_0x1a644e(0xa0)]),_0x1a644e(0xb1));_0x305bea[_0x1a644e(0xa0)]=_0x49c495;}}return _0x305bea;},responseUse=(_0x24a879,_0x4226a2,_0x22fc8f,_0x3b5a54,_0x913c0d)=>{const _0x1aa479=a93_0x26db;if([0x191,0x192,0x2711][_0x1aa479(0xbf)](_0x913c0d[_0x1aa479(0xa0)][_0x1aa479(0x9a)])){_0x22fc8f[_0x1aa479(0xad)][_0x1aa479(0xa1)]();const _0xa564ff='/'+location[_0x1aa479(0xa9)]['slice'](0x2)[_0x1aa479(0xb2)]('?')[0x0],_0x4b8404=StardustJs[_0x1aa479(0xa2)]['decodeQuery'](location['href'][_0x1aa479(0xb2)]('?')[0x1]||'');return _0x3b5a54[_0x1aa479(0xbb)](_0x4b8404[_0x1aa479(0xb7)]?_0x1aa479(0xb4)+(_0x4b8404[_0x1aa479(0xb7)]||_0xa564ff):_0x1aa479(0xb8)),Promise[_0x1aa479(0xa4)](_0x913c0d);}else{if([0x2712][_0x1aa479(0xbf)](_0x913c0d[_0x1aa479(0xa0)][_0x1aa479(0x9a)]))return Message['e'](_0x913c0d[_0x1aa479(0xa0)]['err']),Promise[_0x1aa479(0xa4)](_0x913c0d);}const _0x196bc3=_0x913c0d[_0x1aa479(0xbd)][_0x1aa479(0xab)]||_0x913c0d[_0x1aa479(0xa0)][_0x1aa479(0xaf)];_0x196bc3&&_0x22fc8f['user']['setToken'](_0x196bc3);if(_0x913c0d[_0x1aa479(0xa0)][_0x1aa479(0xbe)])return Message['e'](_0x913c0d[_0x1aa479(0xa0)][_0x1aa479(0xbe)]||_0x1aa479(0x9c)),Promise[_0x1aa479(0xa4)](_0x913c0d);return _0x913c0d[_0x1aa479(0xbd)]['content-type']?.['includes'](_0x1aa479(0xb3))&&(_0x913c0d[_0x1aa479(0xa0)]=JSON['parse'](StardustJs[_0x1aa479(0x9b)]['convertIsoDates'](JSON['stringify'](_0x913c0d[_0x1aa479(0xa0)])))),Promise[_0x1aa479(0xba)](_0x913c0d[_0x1aa479(0xa0)]);};export{requestUse,responseUse};function a93_0x5782(){const _0x206bc5=['query','indexOf','4484085QruaiJ','10144ISdBHG','3152366VCsNsd','code','dates','未知错误','8116206tkMIpK','url','Http-Encrypt','data','setExpired','funcs','globalProperties','reject','application/json;\x20charset=UTF-8','160temLgm','124luBftT','1704144FnYmGB','hash','Authorization','refresh-token','toString','user','28368rzhdRM','token','4vZJXPR','body','split','application/json','/login?redirectTo=','join','params','redirectTo','/login','6389880GgQkzr','resolve','replace','now','headers','err','includes','encrypt'];a93_0x5782=function(){return _0x206bc5;};return a93_0x5782();}
|
package/packages/utils/site.js
CHANGED
|
@@ -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_0xaa3eaf=a94_0x4be3;function a94_0x1df5(){const _0x35de32=['440541WkKqjc','fill','font','7iHfdXR','innerHeight','getContext','38539EZTzMk','measureText','40098eUVuJZ','width','818072OLMtal','8OpRBfo','788043XFPcNu','Style','956252AlAruw','px\x20Arial','1229370cVJhnj','canvas','height','10fAqYiH'];a94_0x1df5=function(){return _0x35de32;};return a94_0x1df5();}function a94_0x4be3(_0x42cbb3,_0x216a8c){const _0x1df545=a94_0x1df5();return a94_0x4be3=function(_0x4be3d6,_0x490c24){_0x4be3d6=_0x4be3d6-0x133;let _0x281119=_0x1df545[_0x4be3d6];return _0x281119;},a94_0x4be3(_0x42cbb3,_0x216a8c);}(function(_0x1b8847,_0x1eafb2){const _0x3bfd17=a94_0x4be3,_0x2ffc3f=_0x1b8847();while(!![]){try{const _0x260f38=-parseInt(_0x3bfd17(0x13c))/0x1*(parseInt(_0x3bfd17(0x141))/0x2)+parseInt(_0x3bfd17(0x142))/0x3+parseInt(_0x3bfd17(0x144))/0x4+-parseInt(_0x3bfd17(0x146))/0x5+-parseInt(_0x3bfd17(0x13e))/0x6+-parseInt(_0x3bfd17(0x139))/0x7*(-parseInt(_0x3bfd17(0x140))/0x8)+-parseInt(_0x3bfd17(0x136))/0x9*(parseInt(_0x3bfd17(0x135))/0xa);if(_0x260f38===_0x1eafb2)break;else _0x2ffc3f['push'](_0x2ffc3f['shift']());}catch(_0x18eefd){_0x2ffc3f['push'](_0x2ffc3f['shift']());}}}(a94_0x1df5,0x24375));export const createWatermark=({text:_0x25ef27,gap:_0x162f05,fontSize:_0x22790f,color:_0x9ed612,width:width=window['innerWidth'],height:height=window[a94_0xaa3eaf(0x13a)],drawMode:drawMode=a94_0xaa3eaf(0x137)})=>{const _0x369203=a94_0xaa3eaf,_0x17df3d=document['createElement'](_0x369203(0x133));_0x17df3d['width']=width,_0x17df3d[_0x369203(0x134)]=height;const _0x257916=_0x17df3d[_0x369203(0x13b)]('2d');_0x257916[_0x369203(0x138)]=_0x22790f+_0x369203(0x145),_0x257916[drawMode+_0x369203(0x143)]=_0x9ed612;const _0x320198=_0x257916[_0x369203(0x13d)](_0x25ef27)[_0x369203(0x13f)],_0x39131c=_0x320198+_0x162f05,_0x2ac497=_0x22790f+_0x162f05;for(let _0x455225=_0x162f05/0x2;_0x455225<height;_0x455225+=_0x2ac497){for(let _0x2d89e1=_0x162f05/0x2;_0x2d89e1<width;_0x2d89e1+=_0x39131c){_0x257916[drawMode+'Text'](_0x25ef27,_0x2d89e1,_0x455225);}}return _0x17df3d;};export default{'createWatermark':createWatermark};
|
package/packages/vite-plugins.js
CHANGED
|
@@ -1,141 +1 @@
|
|
|
1
|
-
import
|
|
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
|
+
(function(_0xb95a73,_0x47998e){const _0x2353cd=a95_0x1355,_0x496461=_0xb95a73();while(!![]){try{const _0x3d6406=parseInt(_0x2353cd(0x206))/0x1+-parseInt(_0x2353cd(0x1ed))/0x2*(-parseInt(_0x2353cd(0x1e6))/0x3)+-parseInt(_0x2353cd(0x1f0))/0x4+parseInt(_0x2353cd(0x20a))/0x5+-parseInt(_0x2353cd(0x210))/0x6*(-parseInt(_0x2353cd(0x20c))/0x7)+-parseInt(_0x2353cd(0x1ea))/0x8*(parseInt(_0x2353cd(0x1e1))/0x9)+parseInt(_0x2353cd(0x1eb))/0xa;if(_0x3d6406===_0x47998e)break;else _0x496461['push'](_0x496461['shift']());}catch(_0x32d57c){_0x496461['push'](_0x496461['shift']());}}}(a95_0x278a,0xd86b8));function a95_0x1355(_0x183aa6,_0x1a559){const _0x278a4c=a95_0x278a();return a95_0x1355=function(_0x135566,_0x16ab09){_0x135566=_0x135566-0x1d9;let _0x5f5057=_0x278a4c[_0x135566];return _0x5f5057;},a95_0x1355(_0x183aa6,_0x1a559);}function a95_0x278a(){const _0x5e7f58=['size','no\x20controller','existsSync','toLowerCase','_ctx\x20=\x20wrapCtx(_ctx,\x20filterPrivateFields(model),\x20filterPrivateFields(controller))','_ctx\x20=\x20wrapCtx(_ctx,\x20null,\x20filterPrivateFields(controller))','no\x20model','DbName','map','startsWith','<style\x20lang=\x22scss\x22>','_ctx\x20=\x20wrapCtx(_ctx,\x20filterPrivateFields(model))','<script\x20setup>','dirname','vue\x20})','.js','import\x20makeModel\x20','auto-deconstruct','import\x20makeController\x20from\x20\x27./controller.js\x27','1364049feONlV','\x20=\x20new\x20Table(','.scss\x22;','instantiateTables','33890xQpsxE','forEach','168588zbMVAI','import\x20makeModel\x20from\x20\x27./model.js\x27','replace','return\x20{\x20...__returned__,\x20...filterPrivateFields(controller)\x20}','402teLddF','<script\x20setup>\x0a','return\x20(_ctx,\x20_cache)\x20=>\x20{','split','-scoped.scss\x22;','const\x20model','</style>','join','<script>','const\x20model\x20=\x20makeModel()','slice','.vue','controller.js','/src/','model.js','18DoDQRs','<script>\x0a','return\x20{\x20...__returned__,\x20...filterPrivateFields(model)\x20}','return\x20{\x20...__returned__,\x20...filterPrivateFields(model),\x20...filterPrivateFields(controller)\x20}','trim','57xzfVrK','basename','push','const\x20controller\x20=\x20makeController({\x20','6568328xsxihF','1991080IQNTdc','includes','106234DpOQrw','filter','@use\x20\x22./','6656992xMuzhX',',\x20\x27','splice'];a95_0x278a=function(){return _0x5e7f58;};return a95_0x278a();}import a95_0x26426c from'node:fs';import a95_0x33b7c5 from'node:path';const filterPrivateFields='\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',inject=(_0x5ccd9d,_0x434a5c)=>{const _0x366b31=a95_0x1355,_0x526f1c=a95_0x33b7c5[_0x366b31(0x200)](_0x434a5c),_0x2240b5=a95_0x33b7c5[_0x366b31(0x1e7)](_0x434a5c),_0x233750=_0x2240b5[_0x366b31(0x213)]('.')[0x0],_0x5df80f=a95_0x26426c['existsSync'](a95_0x33b7c5[_0x366b31(0x1d9)](_0x526f1c,_0x233750+'-scoped.scss')),_0x310913=a95_0x26426c[_0x366b31(0x1f5)](a95_0x33b7c5[_0x366b31(0x1d9)](_0x526f1c,_0x233750+'.scss')),_0x518e53=a95_0x26426c[_0x366b31(0x1f5)](a95_0x33b7c5[_0x366b31(0x1d9)](_0x526f1c,_0x366b31(0x1e0))),_0x510375=a95_0x26426c[_0x366b31(0x1f5)](a95_0x33b7c5[_0x366b31(0x1d9)](_0x526f1c,_0x366b31(0x1de))),_0x1bfa1c=_0x518e53&&!_0x5ccd9d[_0x366b31(0x1ec)](_0x366b31(0x1f9))&&!_0x5ccd9d[_0x366b31(0x1ec)](_0x366b31(0x215)),_0x4a3dac=_0x510375&&!_0x5ccd9d[_0x366b31(0x1ec)](_0x366b31(0x1f4))&&!_0x5ccd9d[_0x366b31(0x1ec)]('const\x20controller');if(_0x434a5c[_0x366b31(0x1ec)](_0x366b31(0x1df))&&_0x2240b5[_0x366b31(0x1ec)]('.vue')&&_0x5ccd9d['startsWith'](_0x366b31(0x1ff))){_0x5ccd9d=_0x5ccd9d[_0x366b31(0x20e)]('<script\x20setup>',_0x366b31(0x211));const _0x28c343=_0x5ccd9d[_0x366b31(0x213)]('\x0a');_0x5df80f&&_0x28c343[_0x366b31(0x1e8)](...['<style\x20lang=\x22scss\x22\x20scoped>',_0x366b31(0x1ef)+_0x233750+_0x366b31(0x214),'</style>']),_0x310913&&_0x28c343['push'](...[_0x366b31(0x1fd),_0x366b31(0x1ef)+_0x233750+_0x366b31(0x208),_0x366b31(0x216)]),_0x4a3dac&&_0x28c343[_0x366b31(0x1f2)](0x1,0x0,_0x366b31(0x205),_0x366b31(0x1e9)+(_0x1bfa1c?'model,\x20':'')+_0x366b31(0x201)),_0x1bfa1c&&_0x28c343[_0x366b31(0x1f2)](0x1,0x0,_0x366b31(0x20d),_0x366b31(0x1db)),_0x5ccd9d=_0x28c343[_0x366b31(0x1d9)]('\x0a');}return _0x5ccd9d;},instantiateTables=(_0x5f4e72,_0x1aa006)=>{const _0x571297=a95_0x1355,_0x3a5057=a95_0x33b7c5[_0x571297(0x1e7)](_0x1aa006),_0x19bd96=_0x3a5057[_0x571297(0x1ec)](_0x571297(0x1dd)),_0xe15619=_0x3a5057['includes'](_0x571297(0x202));if(_0x1aa006[_0x571297(0x1ec)]('/src/')&&(_0x19bd96||_0xe15619)){const _0x302947=_0x5f4e72[_0x571297(0x213)]('\x0a')['map'](_0xc77835=>_0xc77835[_0x571297(0x1e5)]())[_0x571297(0x1ee)](_0x429cb1=>!_0x429cb1[_0x571297(0x1fc)]('//'))[_0x571297(0x1d9)]('\x0a'),_0x3b2ed9=new Set([..._0x302947['matchAll'](/[^a-z][A-Z]\w+\.(search|add|update|remove|func|batch|get)/g)][_0x571297(0x1fb)](_0x4a1bf4=>_0x4a1bf4[0x0][_0x571297(0x1dc)](0x1)[_0x571297(0x213)]('.')[0x0]));if(_0x3b2ed9[_0x571297(0x1f3)]){let _0x184fda='';_0x3b2ed9[_0x571297(0x20b)](_0x393b5d=>{const _0x2771e8=_0x571297;let [_0x26e428,_0x496d76]=_0x393b5d[_0x2771e8(0x213)]('_')[_0x2771e8(0x1fb)](_0x7768f=>_0x7768f[_0x2771e8(0x20e)](/[A-Z]/g,_0x5d6a10=>'_'+_0x5d6a10[_0x2771e8(0x1f6)]())['slice'](0x1));_0x496d76?_0x26e428='\x27'+_0x26e428+'\x27':(_0x496d76=_0x26e428,_0x26e428=_0x2771e8(0x1fa)),_0x184fda+='const\x20'+_0x393b5d+_0x2771e8(0x207)+_0x26e428+_0x2771e8(0x1f1)+_0x496d76+'\x27)\x0a';}),_0x19bd96?_0x5f4e72=_0x5f4e72[_0x571297(0x20e)](_0x571297(0x1ff),'<script\x20setup>\x0a'+_0x184fda)[_0x571297(0x20e)](_0x571297(0x1da),_0x571297(0x1e2)+_0x184fda):_0x5f4e72=_0x184fda+_0x5f4e72;}}return _0x5f4e72;},deconstruct=(_0x2f70e6,_0x84b32c)=>{const _0x49427d=a95_0x1355,_0x4e3e36=a95_0x33b7c5['basename'](_0x84b32c),_0x3ef758=_0x4e3e36['includes'](_0x49427d(0x1dd));if(_0x84b32c[_0x49427d(0x1ec)](_0x49427d(0x1df))&&_0x3ef758){const _0x67690d='return\x20__returned__',_0x15aebe=_0x49427d(0x212),_0x2d1ad5=_0x2f70e6[_0x49427d(0x1ec)](_0x67690d),_0x19cf43=_0x2f70e6[_0x49427d(0x1ec)](_0x15aebe),_0xb49974=(_0x2d1ad5||_0x19cf43)&&_0x2f70e6[_0x49427d(0x1ec)](_0x49427d(0x203)),_0x22bb38=(_0x2d1ad5||_0x19cf43)&&_0x2f70e6[_0x49427d(0x1ec)]('import\x20makeController\x20');if(_0xb49974||_0x22bb38){let _0x770dd4=filterPrivateFields;if(_0x2d1ad5){if(_0xb49974&&_0x22bb38)_0x770dd4+=_0x49427d(0x1e4);else{if(_0xb49974)_0x770dd4+=_0x49427d(0x1e3);else _0x22bb38&&(_0x770dd4+=_0x49427d(0x20f));}}else{_0x770dd4+=_0x15aebe+'\x0a';if(_0xb49974&&_0x22bb38)_0x770dd4+=_0x49427d(0x1f7);else{if(_0xb49974)_0x770dd4+=_0x49427d(0x1fe);else _0x22bb38&&(_0x770dd4+=_0x49427d(0x1f8));}_0x770dd4+='\x0a';}_0x2f70e6=_0x2f70e6[_0x49427d(0x20e)](_0x2d1ad5?_0x67690d:_0x15aebe,_0x770dd4);}}return _0x2f70e6;};export const autoInject=(_0xc1c731={})=>{return{'name':'auto-inject','transform'(_0x12b845,_0x35d1e7){const _0x184c80=a95_0x1355;return _0x12b845=inject(_0x12b845,_0x35d1e7),_0xc1c731[_0x184c80(0x209)]!==![]&&(_0x12b845=instantiateTables(_0x12b845,_0x35d1e7)),{'code':_0x12b845};}};};export const autoDeconstruct=()=>{const _0x4b1e6e=a95_0x1355;return{'name':_0x4b1e6e(0x204),'transform'(_0x395791,_0x3f546d){return{'code':deconstruct(_0x395791,_0x3f546d)};}};};
|
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_0x544117=a96_0x7a09;(function(_0x3d3dbc,_0x4b5409){const _0x2080e4=a96_0x7a09,_0x573eea=_0x3d3dbc();while(!![]){try{const _0xf87897=-parseInt(_0x2080e4(0x1f5))/0x1*(-parseInt(_0x2080e4(0x1f0))/0x2)+parseInt(_0x2080e4(0x1f9))/0x3*(parseInt(_0x2080e4(0x1f8))/0x4)+parseInt(_0x2080e4(0x1fc))/0x5*(-parseInt(_0x2080e4(0x1fb))/0x6)+-parseInt(_0x2080e4(0x1f3))/0x7*(-parseInt(_0x2080e4(0x1f6))/0x8)+parseInt(_0x2080e4(0x1ef))/0x9*(-parseInt(_0x2080e4(0x1fd))/0xa)+parseInt(_0x2080e4(0x1eb))/0xb+parseInt(_0x2080e4(0x1fa))/0xc*(-parseInt(_0x2080e4(0x1ee))/0xd);if(_0xf87897===_0x4b5409)break;else _0x573eea['push'](_0x573eea['shift']());}catch(_0x309b14){_0x573eea['push'](_0x573eea['shift']());}}}(a96_0x2cff,0x6dd26));import{createApp}from'vue';import a96_0x4e03d9 from'element-plus';function a96_0x7a09(_0x1a4a07,_0x22436c){const _0x2cff42=a96_0x2cff();return a96_0x7a09=function(_0x7a0999,_0x4d80b1){_0x7a0999=_0x7a0999-0x1e9;let _0x546769=_0x2cff42[_0x7a0999];return _0x546769;},a96_0x7a09(_0x1a4a07,_0x22436c);}import a96_0x14c853 from'vant';import a96_0x188ff4 from'../packages/index.js';import'../packages/index.scss';import a96_0x3b74e2,{API_BASE_URL}from'./request.js';import a96_0xba8976 from'@/App.vue';const app=createApp(a96_0xba8976);app['directive'](a96_0x544117(0x1e9),{'created'(_0x1b4b59,_0x28bb1b){}}),app['use'](a96_0x4e03d9);for(const [key,component]of Object[a96_0x544117(0x1ec)](ElementPlusIconsVue)){app[a96_0x544117(0x1f4)](key,component);}function a96_0x2cff(){const _0x4ee6e6=['globalProperties','config','28IvfzEm','component','29evAIIR','841112nmEHiU','use','404pAGamV','20886jzfOAs','11442372AzqKUT','67188BGTdbU','15RQrWTf','260oEqnPT','domid','assign','4148815sufeuR','entries','#app','13yrQdsx','221031BRxdPR','39628bMdaNZ'];a96_0x2cff=function(){return _0x4ee6e6;};return a96_0x2cff();}app[a96_0x544117(0x1f7)](a96_0x14c853),app[a96_0x544117(0x1f7)](a96_0x188ff4,{'ElementPlus':a96_0x4e03d9,'Vant':a96_0x14c853}),Object[a96_0x544117(0x1ea)](app[a96_0x544117(0x1f2)][a96_0x544117(0x1f1)],{'isMobile':window['isMobile'],'service':{'request':a96_0x3b74e2,'API_BASE_URL':API_BASE_URL},'$store':{'app':{'sidebarCollapse':![],'toggleDuration':0x0}}}),app['mount'](a96_0x544117(0x1ed));export default app;
|
package/src/request.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const a97_0x31aa1c=a97_0x1100;(function(_0x7f940b,_0x1ccb8a){const _0x297986=a97_0x1100,_0x11da36=_0x7f940b();while(!![]){try{const _0x5975be=-parseInt(_0x297986(0xdf))/0x1*(parseInt(_0x297986(0xe0))/0x2)+parseInt(_0x297986(0xd4))/0x3+-parseInt(_0x297986(0xe3))/0x4+-parseInt(_0x297986(0xd5))/0x5+parseInt(_0x297986(0xe2))/0x6+-parseInt(_0x297986(0xd8))/0x7+parseInt(_0x297986(0xe8))/0x8;if(_0x5975be===_0x1ccb8a)break;else _0x11da36['push'](_0x11da36['shift']());}catch(_0x5b4c49){_0x11da36['push'](_0x11da36['shift']());}}}(a97_0x4268,0xce0ea));function a97_0x1100(_0x2f14b5,_0x5a13db){const _0x42684c=a97_0x4268();return a97_0x1100=function(_0x1100c7,_0x7d0879){_0x1100c7=_0x1100c7-0xd1;let _0x49a27f=_0x42684c[_0x1100c7];return _0x49a27f;},a97_0x1100(_0x2f14b5,_0x5a13db);}function a97_0x4268(){const _0x3ed032=['3184795qJDsrW','stringify','startsWith','11423944ZPVWZD','body','string','response','API_BASE_URL','includes','env','1SKClxq','946940VyFzpC','interceptors','9668868UQMHIY','3418236odifpr','http','error','GET','use','10626312efvrjk','toUpperCase','application/json','POST','4503669jdmaUv'];a97_0x4268=function(){return _0x3ed032;};return a97_0x4268();}const {PROD,VITE_DEV_BASE_URL,VITE_PROD_BASE_URL,VITE_TIMEOUT=0xea60}=import.meta[a97_0x31aa1c(0xde)],API_BASE_URL=window[a97_0x31aa1c(0xdc)]||(PROD?VITE_PROD_BASE_URL:VITE_DEV_BASE_URL),createRequest=_0x1b03c6=>{const _0x3b9798=a97_0x31aa1c,_0x3f7a43=axios['create']({'baseURL':API_BASE_URL,'timeout':VITE_TIMEOUT*0x1,..._0x1b03c6});return _0x3f7a43[_0x3b9798(0xe1)]['request']['use'](_0x12e78e=>{return _0x12e78e;},_0x51be09=>{const _0x45482d=_0x3b9798;console[_0x45482d(0xe5)](_0x51be09);}),_0x3f7a43[_0x3b9798(0xe1)][_0x3b9798(0xdb)][_0x3b9798(0xe7)](_0x2d3786=>{return _0x2d3786;},_0x8854e5=>{const _0x4d16dd=_0x3b9798;console[_0x4d16dd(0xe5)](_0x8854e5);}),_0x3f7a43;},fetchRequest=(_0x4cb0cb,_0x299eb1={})=>{const _0x37d9d3=a97_0x31aa1c;_0x4cb0cb=_0x4cb0cb[_0x37d9d3(0xd7)](_0x37d9d3(0xe4))?_0x4cb0cb:API_BASE_URL+_0x4cb0cb;const {method:method=_0x37d9d3(0xe6),headers:_0x3c723f,body:_0x4b5b1a,..._0x2bcf7a}=_0x299eb1,_0x272307={'method':method,..._0x2bcf7a,'headers':{'content-type':_0x37d9d3(0xd2),..._0x3c723f}};return['PUT',_0x37d9d3(0xd3)][_0x37d9d3(0xdd)](method[_0x37d9d3(0xd1)]())&&(_0x272307[_0x37d9d3(0xd9)]=typeof _0x4b5b1a===_0x37d9d3(0xda)?_0x4b5b1a:JSON[_0x37d9d3(0xd6)](_0x4b5b1a)),fetch(_0x4cb0cb,_0x272307);};export default createRequest();export{API_BASE_URL,createRequest,fetchRequest};
|