@wp1001/ui 2.9.13
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/.env +6 -0
- package/@vant-D4fmGxs6.js +3891 -0
- package/index.js +8419 -0
- package/package.json +59 -0
- package/packages/assets/devtools-detector.js +2 -0
- package/packages/components/xarray/index.js +64 -0
- package/packages/components/xarray/xarray.vue +57 -0
- package/packages/components/xautorows/index.js +35 -0
- package/packages/components/xautorows/xautorows.vue +29 -0
- package/packages/components/xbutton/mobile.js +3 -0
- package/packages/components/xbutton/mobile.vue +9 -0
- package/packages/components/xbutton/pc.js +3 -0
- package/packages/components/xbutton/pc.vue +9 -0
- package/packages/components/xbuttons/mobile.js +51 -0
- package/packages/components/xbuttons/mobile.vue +12 -0
- package/packages/components/xbuttons/pc.js +51 -0
- package/packages/components/xbuttons/pc.vue +16 -0
- package/packages/components/xchart/constants.js +58 -0
- package/packages/components/xchart/index.js +263 -0
- package/packages/components/xchart/utils.js +121 -0
- package/packages/components/xchart/xchart.vue +173 -0
- package/packages/components/xcheckboxs/mobile.js +58 -0
- package/packages/components/xcheckboxs/mobile.vue +38 -0
- package/packages/components/xcheckboxs/pc.js +49 -0
- package/packages/components/xcheckboxs/pc.vue +42 -0
- package/packages/components/xcol/mobile.js +10 -0
- package/packages/components/xcol/mobile.vue +9 -0
- package/packages/components/xcol/pc.js +10 -0
- package/packages/components/xcol/pc.vue +9 -0
- package/packages/components/xdatepicker/mobile.js +71 -0
- package/packages/components/xdatepicker/mobile.vue +44 -0
- package/packages/components/xdatepicker/pc.js +9 -0
- package/packages/components/xdatepicker/pc.vue +12 -0
- package/packages/components/xdialog/mobile.js +60 -0
- package/packages/components/xdialog/mobile.vue +43 -0
- package/packages/components/xdialog/pc.js +64 -0
- package/packages/components/xdialog/pc.vue +51 -0
- package/packages/components/xdict/index.js +47 -0
- package/packages/components/xdict/xdict.vue +9 -0
- package/packages/components/xdistrictselect/mobile.js +79 -0
- package/packages/components/xdistrictselect/mobile.vue +28 -0
- package/packages/components/xdistrictselect/pc.js +127 -0
- package/packages/components/xdistrictselect/pc.vue +32 -0
- package/packages/components/xform/mobile.js +29 -0
- package/packages/components/xform/mobile.vue +43 -0
- package/packages/components/xform/pc.js +42 -0
- package/packages/components/xform/pc.vue +76 -0
- package/packages/components/xform/utils.js +95 -0
- package/packages/components/xformitem/mobile.js +56 -0
- package/packages/components/xformitem/mobile.vue +3 -0
- package/packages/components/xformitem/pc.js +72 -0
- package/packages/components/xformitem/pc.vue +10 -0
- package/packages/components/xformitem/utils.jsx +181 -0
- package/packages/components/xicon/mobile.js +35 -0
- package/packages/components/xicon/mobile.vue +9 -0
- package/packages/components/xicon/pc.js +35 -0
- package/packages/components/xicon/pc.vue +11 -0
- package/packages/components/xinfo/index.js +100 -0
- package/packages/components/xinfo/xinfo.vue +140 -0
- package/packages/components/xlooper/index.js +7 -0
- package/packages/components/xlooper/xlooper.vue +20 -0
- package/packages/components/xpagination/mobile.js +21 -0
- package/packages/components/xpagination/mobile.vue +31 -0
- package/packages/components/xpagination/pc.js +21 -0
- package/packages/components/xpagination/pc.vue +16 -0
- package/packages/components/xpicker/index.js +38 -0
- package/packages/components/xpicker/xpicker.vue +29 -0
- package/packages/components/xradios/mobile.js +40 -0
- package/packages/components/xradios/mobile.vue +22 -0
- package/packages/components/xradios/pc.js +53 -0
- package/packages/components/xradios/pc.vue +43 -0
- package/packages/components/xrow/mobile.js +9 -0
- package/packages/components/xrow/mobile.vue +23 -0
- package/packages/components/xrow/pc.js +9 -0
- package/packages/components/xrow/pc.vue +22 -0
- package/packages/components/xscan/mobile.js +24 -0
- package/packages/components/xscan/mobile.vue +21 -0
- package/packages/components/xscan/pc.js +20 -0
- package/packages/components/xscan/pc.vue +18 -0
- package/packages/components/xsearcher/index.js +198 -0
- package/packages/components/xsearcher/xsearcher.vue +170 -0
- package/packages/components/xselect/mobile.js +86 -0
- package/packages/components/xselect/mobile.vue +24 -0
- package/packages/components/xselect/pc.js +114 -0
- package/packages/components/xselect/pc.vue +55 -0
- package/packages/components/xselect/util.js +66 -0
- package/packages/components/xselectv2/index.js +91 -0
- package/packages/components/xselectv2/xselectv2.vue +46 -0
- package/packages/components/xtable/mobile.js +108 -0
- package/packages/components/xtable/mobile.vue +246 -0
- package/packages/components/xtable/pc.js +143 -0
- package/packages/components/xtable/pc.vue +421 -0
- package/packages/components/xtable/searcher.js +477 -0
- package/packages/components/xtable/searcher.jsx +330 -0
- package/packages/components/xtable/searcher.vue +133 -0
- package/packages/components/xtable/settings.js +80 -0
- package/packages/components/xtable/settings.vue +77 -0
- package/packages/components/xtable/utils.js +692 -0
- package/packages/components/xtabletools/mobile.js +25 -0
- package/packages/components/xtabletools/mobile.vue +126 -0
- package/packages/components/xtabletools/pc.js +18 -0
- package/packages/components/xtabletools/pc.vue +135 -0
- package/packages/components/xtablev2/index.js +53 -0
- package/packages/components/xtablev2/utils.jsx +214 -0
- package/packages/components/xtablev2/xtablev2.vue +147 -0
- package/packages/components/xtags/mobile.js +17 -0
- package/packages/components/xtags/mobile.vue +21 -0
- package/packages/components/xtags/pc.js +17 -0
- package/packages/components/xtags/pc.vue +22 -0
- package/packages/components/xtinymce/index.js +71 -0
- package/packages/components/xtinymce/xtinymce.vue +9 -0
- package/packages/components/xuploader/xfileuploader.js +48 -0
- package/packages/components/xuploader/xfileuploader.vue +54 -0
- package/packages/components/xuploader/ximageuploader.js +53 -0
- package/packages/components/xuploader/ximageuploader.vue +52 -0
- package/packages/comps.js +108 -0
- package/packages/controllers/BaseController.js +125 -0
- package/packages/controllers/CrudController.js +907 -0
- package/packages/controllers/TempCrudController.js +32 -0
- package/packages/controllers/index.js +15 -0
- package/packages/directives/el-table-infinite-scroll.js +55 -0
- package/packages/directives/index.js +5 -0
- package/packages/index.js +81 -0
- package/packages/index.scss +4 -0
- package/packages/layout/breadcrumb/breadcrumb.vue +31 -0
- package/packages/layout/breadcrumb/index.js +41 -0
- package/packages/layout/header/header.vue +281 -0
- package/packages/layout/header/inner.js +11 -0
- package/packages/layout/header/inner.vue +3 -0
- package/packages/layout/mobile-menu.vue +83 -0
- package/packages/layout/mobile-tabs.vue +54 -0
- package/packages/layout/pc.vue +85 -0
- package/packages/layout/screenlock/index.js +129 -0
- package/packages/layout/screenlock/screenlock.vue +85 -0
- package/packages/layout/sidebar/item.js +16 -0
- package/packages/layout/sidebar/item.vue +16 -0
- package/packages/layout/sidebar/menu.js +72 -0
- package/packages/layout/sidebar/menu.vue +106 -0
- package/packages/layout/sidebar/sidebar.vue +147 -0
- package/packages/layout/tagsview/ScrollPane.js +65 -0
- package/packages/layout/tagsview/ScrollPane.vue +24 -0
- package/packages/layout/tagsview/index.js +169 -0
- package/packages/layout/tagsview/index.vue +124 -0
- package/packages/plop/actions/make-fill-admin-partials-action.js +95 -0
- package/packages/plop/generators/make-admin-page.js +39 -0
- package/packages/plop/generators/make-database-admin-pages.js +84 -0
- package/packages/plop/generators/make-page-generator.js +52 -0
- package/packages/plop/generators/make-simple-page.js +20 -0
- package/packages/plop/plopfile.js +24 -0
- package/packages/plop/templates/admin_page/controller.js +3 -0
- package/packages/plop/templates/admin_page/model.js +24 -0
- package/packages/plop/templates/admin_page/{{snakeCase pagename}}-scoped.scss +3 -0
- package/packages/plop/templates/admin_page/{{snakeCase pagename}}.vue +11 -0
- package/packages/plop/templates/simple_page/controller.js +3 -0
- package/packages/plop/templates/simple_page/model.js +6 -0
- package/packages/plop/templates/simple_page/{{snakeCase pagename}}-scoped.scss +3 -0
- package/packages/plop/templates/simple_page/{{snakeCase pagename}}.vue +7 -0
- package/packages/plop/utils/index.js +168 -0
- package/packages/plop/utils/plop-utils.js +86 -0
- package/packages/styles/common.scss +137 -0
- package/packages/styles/element-ui.scss +142 -0
- package/packages/styles/vant.scss +133 -0
- package/packages/styles/variables.scss +23 -0
- package/packages/utils/crypt.js +24 -0
- package/packages/utils/decorators.js +67 -0
- package/packages/utils/disallowDevtools.js +53 -0
- package/packages/utils/effects.js +173 -0
- package/packages/utils/funcs.js +78 -0
- package/packages/utils/index.js +95 -0
- package/packages/utils/message.js +110 -0
- package/packages/utils/middlewares.js +86 -0
- package/packages/utils/model.js +71 -0
- package/packages/utils/modelUtils.js +203 -0
- package/packages/utils/request.js +57 -0
- package/packages/utils/site.js +33 -0
- package/packages/vite-plugins.js +141 -0
- package/publish.sh +12 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
name: 'MobileXTags',
|
|
3
|
+
props: {
|
|
4
|
+
data: Array,
|
|
5
|
+
text: {
|
|
6
|
+
type: String,
|
|
7
|
+
default: 'text'
|
|
8
|
+
}
|
|
9
|
+
},
|
|
10
|
+
emits: ['close'],
|
|
11
|
+
computed: {
|
|
12
|
+
_data () {
|
|
13
|
+
if (!this.data?.length) return []
|
|
14
|
+
return this.data.map(ele => typeof ele === 'object' ? ele : { text: ele })
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
export { default } from './mobile.js'
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<template>
|
|
6
|
+
<div class="x-tags mobile-x-tags">
|
|
7
|
+
<van-tag
|
|
8
|
+
v-for="(item, index) in _data" :key="index"
|
|
9
|
+
v-bind="{ ...$attrs, item }"
|
|
10
|
+
@close="$emit('close', item[text], index)"
|
|
11
|
+
>
|
|
12
|
+
{{ item[text] }}
|
|
13
|
+
</van-tag>
|
|
14
|
+
</div>
|
|
15
|
+
</template>
|
|
16
|
+
|
|
17
|
+
<style lang="scss" scoped>
|
|
18
|
+
.van-tag {
|
|
19
|
+
margin-right: 10px;
|
|
20
|
+
}
|
|
21
|
+
</style>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
name: 'PcXTags',
|
|
3
|
+
props: {
|
|
4
|
+
data: Array,
|
|
5
|
+
text: {
|
|
6
|
+
type: String,
|
|
7
|
+
default: 'text'
|
|
8
|
+
}
|
|
9
|
+
},
|
|
10
|
+
emits: ['close'],
|
|
11
|
+
computed: {
|
|
12
|
+
_data () {
|
|
13
|
+
if (!this.data?.length) return []
|
|
14
|
+
return this.data.map(ele => typeof ele === 'object' ? ele : { text: ele })
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
export { default } from './pc.js'
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<template>
|
|
6
|
+
<div class="x-tags pc-x-tags">
|
|
7
|
+
<el-tag
|
|
8
|
+
v-for="(item, index) in _data" :key="index"
|
|
9
|
+
v-bind="{ ...$attrs, item }"
|
|
10
|
+
:type="item.type || $attrs.type"
|
|
11
|
+
@close="$emit('close', item[text], index)"
|
|
12
|
+
>
|
|
13
|
+
{{ item[text] }}
|
|
14
|
+
</el-tag>
|
|
15
|
+
</div>
|
|
16
|
+
</template>
|
|
17
|
+
|
|
18
|
+
<style lang="scss" scoped>
|
|
19
|
+
.el-tag {
|
|
20
|
+
margin-right: 10px;
|
|
21
|
+
}
|
|
22
|
+
</style>
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
// 功能若复杂,这里继续修改
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
name: 'XTinymce',
|
|
5
|
+
props: {
|
|
6
|
+
modelValue: {
|
|
7
|
+
type: String,
|
|
8
|
+
default: ''
|
|
9
|
+
},
|
|
10
|
+
config: {
|
|
11
|
+
type: Object,
|
|
12
|
+
default: () => ({})
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
emits: ['update:modelValue'],
|
|
16
|
+
data () {
|
|
17
|
+
return {
|
|
18
|
+
id: 'tm-' + Date.now().toString(16)
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
watch: {
|
|
22
|
+
modelValue (value) {
|
|
23
|
+
if (value === this._content) return
|
|
24
|
+
this.instance?.setContent(value)
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
mounted () {
|
|
28
|
+
this.initEditor()
|
|
29
|
+
},
|
|
30
|
+
beforeUnmount () {
|
|
31
|
+
if (this.instance) {
|
|
32
|
+
this.instance.destroy()
|
|
33
|
+
this.instance = null
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
methods: {
|
|
37
|
+
async initEditor () {
|
|
38
|
+
const instances = await window.tinymce.init({
|
|
39
|
+
language: 'zh_CN',
|
|
40
|
+
language_url: './lib/tinymce/zh_CN.js',
|
|
41
|
+
selector: 'textarea#' + this.id,
|
|
42
|
+
height: 500,
|
|
43
|
+
plugins: [
|
|
44
|
+
'advlist', 'autolink', 'lists', 'link', 'image', 'charmap', 'preview',
|
|
45
|
+
'anchor', 'searchreplace', 'visualblocks', 'code', 'fullscreen',
|
|
46
|
+
'insertdatetime', 'media', 'table', 'help', 'wordcount'
|
|
47
|
+
],
|
|
48
|
+
toolbar: `
|
|
49
|
+
undo redo | blocks |
|
|
50
|
+
bold italic backcolor | alignleft aligncenter
|
|
51
|
+
alignright alignjustify | bullist numlist outdent indent |
|
|
52
|
+
removeformat | help
|
|
53
|
+
content_style: 'body { font-family:Helvetica,Arial,sans-serif; font-size:16px }
|
|
54
|
+
`,
|
|
55
|
+
placeholder: '请输入、编辑富文本内容~',
|
|
56
|
+
...this.config
|
|
57
|
+
})
|
|
58
|
+
const instance = instances[instances.length - 1]
|
|
59
|
+
instance.on('change', e => {
|
|
60
|
+
this._content = instance.getContent()
|
|
61
|
+
this.$emit('update:modelValue', this._content)
|
|
62
|
+
})
|
|
63
|
+
instance.on('input', e => {
|
|
64
|
+
this._content = e.target.innerHTML
|
|
65
|
+
this.$emit('update:modelValue', this._content)
|
|
66
|
+
})
|
|
67
|
+
this.instance = instance
|
|
68
|
+
window._tinymce_instances_ = instances
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { injectVanFieldProvide } from '../../utils/funcs.js'
|
|
2
|
+
import { Message } from '../../utils/message.js'
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
name: 'XFileUploader',
|
|
6
|
+
props: {
|
|
7
|
+
modelValue: Array | String,
|
|
8
|
+
multiple: Boolean,
|
|
9
|
+
accept: String,
|
|
10
|
+
action: String
|
|
11
|
+
},
|
|
12
|
+
emits: ['update:modelValue'],
|
|
13
|
+
data () {
|
|
14
|
+
return {
|
|
15
|
+
fileList: []
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
computed: {
|
|
19
|
+
limit () {
|
|
20
|
+
return this.$attrs.limit || (this.multiple ? 1e9 : 1)
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
watch: {
|
|
24
|
+
modelValue: {
|
|
25
|
+
handler (value) {
|
|
26
|
+
this.fileList = Array.isArray(value) ? value : (value ? [{ url: value }] : [])
|
|
27
|
+
},
|
|
28
|
+
immediate: true
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
created () {
|
|
32
|
+
injectVanFieldProvide(this)
|
|
33
|
+
},
|
|
34
|
+
methods: {
|
|
35
|
+
handleSelect () {
|
|
36
|
+
this.$emit('update:modelValue', this.fileList)
|
|
37
|
+
this.provide?.resetValidation()
|
|
38
|
+
},
|
|
39
|
+
handleRemove (...props) {
|
|
40
|
+
this.$emit('update:modelValue', this.fileList)
|
|
41
|
+
this.provide?.resetValidation()
|
|
42
|
+
this.$attrs['on-remove']?.(...props)
|
|
43
|
+
},
|
|
44
|
+
handleExceed (files, uploadFiles) {
|
|
45
|
+
Message({ type: 'warning', message: '图片数量不能超过 ' + this.limit + ' 个' })
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
export { default } from './xfileuploader.js'
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<template>
|
|
6
|
+
<el-upload
|
|
7
|
+
v-model:file-list="fileList"
|
|
8
|
+
@update:file-list="handleSelect"
|
|
9
|
+
drag
|
|
10
|
+
:action
|
|
11
|
+
:accept
|
|
12
|
+
:multiple
|
|
13
|
+
:limit
|
|
14
|
+
class="x-file-uploader"
|
|
15
|
+
:class="[
|
|
16
|
+
isMobile ? 'mobile-x-file-uploader' : 'pc-x-file-uploader',
|
|
17
|
+
{ disabled: $attrs.disabled || fileList.length >= limit }
|
|
18
|
+
]"
|
|
19
|
+
:on-exceed="handleExceed"
|
|
20
|
+
v-bind="$attrs"
|
|
21
|
+
:auto-upload="false"
|
|
22
|
+
:on-remove="handleRemove"
|
|
23
|
+
>
|
|
24
|
+
<div class="mask">
|
|
25
|
+
<pc-x-icon name="upload-filled" />
|
|
26
|
+
<div v-if="!disabled" class="el-upload__text">
|
|
27
|
+
将文件拖到此处,或<em>点击上传</em>
|
|
28
|
+
</div>
|
|
29
|
+
</div>
|
|
30
|
+
</el-upload>
|
|
31
|
+
</template>
|
|
32
|
+
|
|
33
|
+
<style lang="scss" scoped>
|
|
34
|
+
.x-file-uploader {
|
|
35
|
+
text-align: center;
|
|
36
|
+
position: relative;
|
|
37
|
+
&.disabled {
|
|
38
|
+
:deep(.el-upload) {
|
|
39
|
+
display: none;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
:deep(.el-upload-dragger) {
|
|
43
|
+
height: 200px;
|
|
44
|
+
}
|
|
45
|
+
.mask {
|
|
46
|
+
position: absolute;
|
|
47
|
+
width: 100%;
|
|
48
|
+
height: 100%;
|
|
49
|
+
left: 0;
|
|
50
|
+
top: 0;
|
|
51
|
+
background-color: rgba(255, 255, 255, 0.2);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
</style>
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { injectVanFieldProvide } from '../../utils/funcs.js'
|
|
2
|
+
import { Message } from '../../utils/message.js'
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
name: 'XImageUploader',
|
|
6
|
+
props: {
|
|
7
|
+
modelValue: Array | String,
|
|
8
|
+
multiple: Boolean,
|
|
9
|
+
action: String
|
|
10
|
+
},
|
|
11
|
+
emits: ['update:modelValue'],
|
|
12
|
+
data () {
|
|
13
|
+
return {
|
|
14
|
+
fileList: [],
|
|
15
|
+
previewingImage: {},
|
|
16
|
+
dialogVisible: false
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
computed: {
|
|
20
|
+
limit () {
|
|
21
|
+
return this.$attrs.limit || (this.multiple ? 1e9 : 1)
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
watch: {
|
|
25
|
+
modelValue: {
|
|
26
|
+
handler (value) {
|
|
27
|
+
this.fileList = Array.isArray(value) ? value : (value ? [{ url: value }] : [])
|
|
28
|
+
},
|
|
29
|
+
immediate: true
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
created () {
|
|
33
|
+
injectVanFieldProvide(this)
|
|
34
|
+
},
|
|
35
|
+
methods: {
|
|
36
|
+
handleSelect () {
|
|
37
|
+
this.$emit('update:modelValue', this.fileList)
|
|
38
|
+
this.provide?.resetValidation()
|
|
39
|
+
},
|
|
40
|
+
handleRemove (...props) {
|
|
41
|
+
this.$emit('update:modelValue', this.fileList)
|
|
42
|
+
this.provide?.resetValidation()
|
|
43
|
+
this.$attrs['on-remove']?.(...props)
|
|
44
|
+
},
|
|
45
|
+
handlePreview (img) {
|
|
46
|
+
this.previewingImage = img
|
|
47
|
+
this.dialogVisible = true
|
|
48
|
+
},
|
|
49
|
+
handleExceed (files, uploadFiles) {
|
|
50
|
+
Message({ type: 'warning', message: '图片数量不能超过 ' + this.limit + ' 个' })
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
export { default } from './ximageuploader.js'
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<template>
|
|
6
|
+
<el-upload
|
|
7
|
+
v-model:file-list="fileList"
|
|
8
|
+
@update:file-list="handleSelect"
|
|
9
|
+
:action
|
|
10
|
+
list-type="picture-card"
|
|
11
|
+
accept="image/*"
|
|
12
|
+
:multiple
|
|
13
|
+
:limit
|
|
14
|
+
class="x-image-uploader"
|
|
15
|
+
:class="[
|
|
16
|
+
isMobile ? 'mobile-x-image-uploader' : 'pc-x-image-uploader',
|
|
17
|
+
{ disabled: $attrs.disabled || fileList.length >= limit }
|
|
18
|
+
]"
|
|
19
|
+
:on-preview="handlePreview"
|
|
20
|
+
:on-exceed="handleExceed"
|
|
21
|
+
v-bind="$attrs"
|
|
22
|
+
:auto-upload="false"
|
|
23
|
+
:on-remove="handleRemove"
|
|
24
|
+
>
|
|
25
|
+
<template #default>
|
|
26
|
+
<el-icon><Plus /></el-icon>
|
|
27
|
+
</template>
|
|
28
|
+
</el-upload>
|
|
29
|
+
<x-dialog
|
|
30
|
+
v-model="dialogVisible"
|
|
31
|
+
actionsheet
|
|
32
|
+
:title="'预览图片' + (previewingImage.name || '')"
|
|
33
|
+
>
|
|
34
|
+
<img :src="previewingImage.url" alt="previewing-image" class="previewing-image">
|
|
35
|
+
</x-dialog>
|
|
36
|
+
</template>
|
|
37
|
+
|
|
38
|
+
<style lang="scss" scoped>
|
|
39
|
+
.x-image-uploader {
|
|
40
|
+
&.disabled {
|
|
41
|
+
:deep(.el-upload) {
|
|
42
|
+
display: none;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
.previewing-image {
|
|
47
|
+
display: block;
|
|
48
|
+
width: 100%;
|
|
49
|
+
margin: auto;
|
|
50
|
+
padding-bottom: 15px;
|
|
51
|
+
}
|
|
52
|
+
</style>
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import xarray from './components/xarray/xarray.vue'
|
|
2
|
+
import xautorows from './components/xautorows/xautorows.vue'
|
|
3
|
+
import mobilexbutton from './components/xbutton/mobile.vue'
|
|
4
|
+
import pcxbutton from './components/xbutton/pc.vue'
|
|
5
|
+
import mobilexbuttons from './components/xbuttons/mobile.vue'
|
|
6
|
+
import pcxbuttons from './components/xbuttons/pc.vue'
|
|
7
|
+
import xchart from './components/xchart/xchart.vue'
|
|
8
|
+
import mobilexcheckboxs from './components/xcheckboxs/mobile.vue'
|
|
9
|
+
import pcxcheckboxs from './components/xcheckboxs/pc.vue'
|
|
10
|
+
import mobilexcol from './components/xcol/mobile.vue'
|
|
11
|
+
import pcxcol from './components/xcol/pc.vue'
|
|
12
|
+
import mobilexdialog from './components/xdialog/mobile.vue'
|
|
13
|
+
import mobilexdatepicker from './components/xdatepicker/mobile.vue'
|
|
14
|
+
import pcxdatepicker from './components/xdatepicker/pc.vue'
|
|
15
|
+
import pcxdialog from './components/xdialog/pc.vue'
|
|
16
|
+
import xdict from './components/xdict/xdict.vue'
|
|
17
|
+
import mobilexdistrictselect from './components/xdistrictselect/mobile.vue'
|
|
18
|
+
import pcxdistrictselect from './components/xdistrictselect/pc.vue'
|
|
19
|
+
import mobilexform from './components/xform/mobile.vue'
|
|
20
|
+
import pcxform from './components/xform/pc.vue'
|
|
21
|
+
import mobilexformitem from './components/xformitem/mobile.vue'
|
|
22
|
+
import pcxformitem from './components/xformitem/pc.vue'
|
|
23
|
+
import mobilexicon from './components/xicon/mobile.vue'
|
|
24
|
+
import pcxicon from './components/xicon/pc.vue'
|
|
25
|
+
import xinfo from './components/xinfo/xinfo.vue'
|
|
26
|
+
import xlooper from './components/xlooper/xlooper.vue'
|
|
27
|
+
import mobilexpagination from './components/xpagination/mobile.vue'
|
|
28
|
+
import pcxpagination from './components/xpagination/pc.vue'
|
|
29
|
+
import xpicker from './components/xpicker/xpicker.vue'
|
|
30
|
+
import mobilexradios from './components/xradios/mobile.vue'
|
|
31
|
+
import pcxradios from './components/xradios/pc.vue'
|
|
32
|
+
import mobilexrow from './components/xrow/mobile.vue'
|
|
33
|
+
import pcxrow from './components/xrow/pc.vue'
|
|
34
|
+
import mobilexscan from './components/xscan/mobile.vue'
|
|
35
|
+
import pcxscan from './components/xscan/pc.vue'
|
|
36
|
+
import xsearcher from './components/xsearcher/xsearcher.vue'
|
|
37
|
+
import mobilexselect from './components/xselect/mobile.vue'
|
|
38
|
+
import pcxselect from './components/xselect/pc.vue'
|
|
39
|
+
import xselectv2 from './components/xselectv2/xselectv2.vue'
|
|
40
|
+
import mobilextable from './components/xtable/mobile.vue'
|
|
41
|
+
import pcxtable from './components/xtable/pc.vue'
|
|
42
|
+
import mobilextabletools from './components/xtabletools/mobile.vue'
|
|
43
|
+
import pcxtabletools from './components/xtabletools/pc.vue'
|
|
44
|
+
import xtablev2 from './components/xtablev2/xtablev2.vue'
|
|
45
|
+
import mobilextags from './components/xtags/mobile.vue'
|
|
46
|
+
import pcxtags from './components/xtags/pc.vue'
|
|
47
|
+
import xtinymce from './components/xtinymce/xtinymce.vue'
|
|
48
|
+
import xfileuploader from './components/xuploader/xfileuploader.vue'
|
|
49
|
+
import ximageuploader from './components/xuploader/ximageuploader.vue'
|
|
50
|
+
|
|
51
|
+
const modules = {
|
|
52
|
+
xarray,
|
|
53
|
+
xautorows,
|
|
54
|
+
mobilexbutton,
|
|
55
|
+
pcxbutton,
|
|
56
|
+
mobilexbuttons,
|
|
57
|
+
pcxbuttons,
|
|
58
|
+
xchart,
|
|
59
|
+
mobilexcheckboxs,
|
|
60
|
+
pcxcheckboxs,
|
|
61
|
+
mobilexcol,
|
|
62
|
+
pcxcol,
|
|
63
|
+
mobilexdatepicker,
|
|
64
|
+
pcxdatepicker,
|
|
65
|
+
mobilexdialog,
|
|
66
|
+
pcxdialog,
|
|
67
|
+
xdict,
|
|
68
|
+
mobilexdistrictselect,
|
|
69
|
+
pcxdistrictselect,
|
|
70
|
+
mobilexform,
|
|
71
|
+
pcxform,
|
|
72
|
+
mobilexformitem,
|
|
73
|
+
pcxformitem,
|
|
74
|
+
mobilexicon,
|
|
75
|
+
pcxicon,
|
|
76
|
+
xinfo,
|
|
77
|
+
xlooper,
|
|
78
|
+
mobilexpagination,
|
|
79
|
+
pcxpagination,
|
|
80
|
+
xpicker,
|
|
81
|
+
mobilexradios,
|
|
82
|
+
pcxradios,
|
|
83
|
+
mobilexrow,
|
|
84
|
+
pcxrow,
|
|
85
|
+
mobilexscan,
|
|
86
|
+
pcxscan,
|
|
87
|
+
xsearcher,
|
|
88
|
+
mobilexselect,
|
|
89
|
+
pcxselect,
|
|
90
|
+
xselectv2,
|
|
91
|
+
mobilextable,
|
|
92
|
+
pcxtable,
|
|
93
|
+
mobilextabletools,
|
|
94
|
+
pcxtabletools,
|
|
95
|
+
xtablev2,
|
|
96
|
+
mobilextags,
|
|
97
|
+
pcxtags,
|
|
98
|
+
xtinymce,
|
|
99
|
+
xfileuploader,
|
|
100
|
+
ximageuploader
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
const comps = {}
|
|
104
|
+
for (let key in modules) {
|
|
105
|
+
comps[modules[key].name] = modules[key]
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export default comps
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { nextTick, watch } from 'vue'
|
|
2
|
+
import uiUtils from '../utils/index.js'
|
|
3
|
+
|
|
4
|
+
const { funcs, highdict, dates } = window.StardustJs
|
|
5
|
+
const { storage } = window.StardustBrowser
|
|
6
|
+
|
|
7
|
+
const VUE_LIFE_HOOKS = [
|
|
8
|
+
'onBeforeMount',
|
|
9
|
+
'onMounted',
|
|
10
|
+
'onBeforeUpdate',
|
|
11
|
+
'onUpdated',
|
|
12
|
+
'onBeforeUnmount',
|
|
13
|
+
'onUnmounted',
|
|
14
|
+
'onErrorCaptured',
|
|
15
|
+
'onRenderTracked',
|
|
16
|
+
'onRenderTriggered',
|
|
17
|
+
'onActivated',
|
|
18
|
+
'onDeactivated'
|
|
19
|
+
]
|
|
20
|
+
|
|
21
|
+
class BaseController {
|
|
22
|
+
constructor ({ model, vue }) {
|
|
23
|
+
this.model = model
|
|
24
|
+
this._bindMethods()
|
|
25
|
+
if (vue) {
|
|
26
|
+
const vm = vue.getCurrentInstance()
|
|
27
|
+
Object.defineProperties(this, {
|
|
28
|
+
vue: { get: () => vue },
|
|
29
|
+
vm: { get: () => vm }
|
|
30
|
+
})
|
|
31
|
+
this._initLifeHooks()
|
|
32
|
+
}
|
|
33
|
+
nextTick(() => this.onInit())
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
onInit () {
|
|
37
|
+
this.__eval_action_watcher__ = watch(this.router.currentRoute, route => {
|
|
38
|
+
route.query?._action_ && this._evalAction()
|
|
39
|
+
}, { immediate: true })
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
get app () { throw '请自行注入 app' }
|
|
43
|
+
|
|
44
|
+
get $el () { return this.vm && this.vm.ctx.$el || null }
|
|
45
|
+
|
|
46
|
+
get router () { throw '请自行注入 router' }
|
|
47
|
+
|
|
48
|
+
get route () { return this.router.currentRoute.value }
|
|
49
|
+
|
|
50
|
+
get params () { return this.route.params }
|
|
51
|
+
|
|
52
|
+
get query () { return this.route.query }
|
|
53
|
+
|
|
54
|
+
get store () { throw '请自行注入 store' }
|
|
55
|
+
|
|
56
|
+
get uiUtils () { return uiUtils }
|
|
57
|
+
|
|
58
|
+
get service () { throw '请自行注入 service' }
|
|
59
|
+
|
|
60
|
+
get $api () { return this.service.api }
|
|
61
|
+
|
|
62
|
+
get $request () { return this.service.request }
|
|
63
|
+
|
|
64
|
+
get $restful () { return this.service.restful }
|
|
65
|
+
|
|
66
|
+
get config () { return this.app.config.globalProperties }
|
|
67
|
+
|
|
68
|
+
get $js () { return window.StardustJs }
|
|
69
|
+
|
|
70
|
+
get $browser () { return window.StardustBrowser }
|
|
71
|
+
|
|
72
|
+
get $dates () { return dates }
|
|
73
|
+
|
|
74
|
+
get $highdict () { return highdict }
|
|
75
|
+
|
|
76
|
+
get $copy () { return funcs.deepCopy }
|
|
77
|
+
|
|
78
|
+
get $sleep () { return funcs.sleep }
|
|
79
|
+
|
|
80
|
+
get $storage () { return storage }
|
|
81
|
+
|
|
82
|
+
get $local () { return storage.local }
|
|
83
|
+
|
|
84
|
+
get $session () { return storage.session }
|
|
85
|
+
|
|
86
|
+
_bindMethods () {
|
|
87
|
+
const thisKeys = [...Object.keys(this), ...this._getMethods()]
|
|
88
|
+
const proto = Object.getOwnPropertyDescriptors(this.__proto__)
|
|
89
|
+
const subKeys = Object.keys(proto).filter(method => method !== 'constructor')
|
|
90
|
+
const allKeys = Array.from(new Set([...thisKeys, ...subKeys]))
|
|
91
|
+
const methods = allKeys.filter(key => typeof this[key] === 'function')
|
|
92
|
+
methods.forEach(method => {
|
|
93
|
+
this[method] = this[method].bind(this)
|
|
94
|
+
})
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
_initLifeHooks () {
|
|
98
|
+
this.vue.onBeforeUnmount(() => {
|
|
99
|
+
this.__eval_action_watcher__?.()
|
|
100
|
+
})
|
|
101
|
+
VUE_LIFE_HOOKS.forEach(hook => {
|
|
102
|
+
this[hook] && this.vue[hook](this[hook].bind(this))
|
|
103
|
+
})
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
_evalAction () {
|
|
107
|
+
const { _action_, _action_params_, ...others } = this.query
|
|
108
|
+
if (_action_ && this[_action_]) {
|
|
109
|
+
this[_action_]?.(JSON.parse(_action_params_ || '{}'))
|
|
110
|
+
this.router.replace(this.route.path + '?' + funcs.encodeQuery(others))
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
_getMethods () {
|
|
115
|
+
return [
|
|
116
|
+
'_bindMethods',
|
|
117
|
+
'_initLifeHooks',
|
|
118
|
+
'_evalAction',
|
|
119
|
+
'_getMethods',
|
|
120
|
+
'onInit'
|
|
121
|
+
]
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export default BaseController
|