xianniu-ui 0.1.11-beta → 0.2.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.
- package/lib/xianniu-ui.common.js +17549 -209
- package/lib/xianniu-ui.css +1 -1
- package/lib/xianniu-ui.umd.js +17549 -209
- package/lib/xianniu-ui.umd.min.js +9 -1
- package/package.json +4 -3
- package/packages/dialog/main.vue +9 -16
- package/packages/footer/index.js +7 -0
- package/packages/footer/main.vue +29 -0
- package/packages/import/main.vue +68 -59
- package/packages/style/package.json +22 -22
- package/packages/table/main.vue +2 -2
- package/public/index.html +1 -1
- package/src/index.js +10 -3
- package/src/utils/index.js +2 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "xianniu-ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"main": "lib/xianniu-ui.umd.min.js",
|
|
6
6
|
"scripts": {
|
|
@@ -25,7 +25,8 @@
|
|
|
25
25
|
"core-js": "^3.6.5",
|
|
26
26
|
"dayjs": "^1.10.7",
|
|
27
27
|
"good-storage": "^1.1.1",
|
|
28
|
-
"
|
|
28
|
+
"lodash": "^4.17.21",
|
|
29
|
+
"vue": "2.6.11",
|
|
29
30
|
"vue-lottie": "^0.2.1",
|
|
30
31
|
"vue-router": "^3.2.0",
|
|
31
32
|
"vuex": "^3.6.2"
|
|
@@ -57,6 +58,6 @@
|
|
|
57
58
|
"sass": "^1.32.6",
|
|
58
59
|
"sass-loader": "^8.0.2",
|
|
59
60
|
"transliteration": "^1.1.11",
|
|
60
|
-
"vue-template-compiler": "
|
|
61
|
+
"vue-template-compiler": "2.6.11"
|
|
61
62
|
}
|
|
62
63
|
}
|
package/packages/dialog/main.vue
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<el-dialog
|
|
3
3
|
:title="title"
|
|
4
|
-
:visible="show"
|
|
4
|
+
:visible.sync="show"
|
|
5
5
|
:width="width ? width : _width"
|
|
6
6
|
:before-close="beforeClose"
|
|
7
7
|
:top="top"
|
|
@@ -10,19 +10,6 @@
|
|
|
10
10
|
@open="$emit('on-open')"
|
|
11
11
|
@opened="$emit('on-opened')"
|
|
12
12
|
>
|
|
13
|
-
<!-- <template #title>
|
|
14
|
-
<div class="flex align-items-center justify-content-between">
|
|
15
|
-
<div>
|
|
16
|
-
<span class="el-dialog__title">{{ title }}</span>
|
|
17
|
-
</div>
|
|
18
|
-
<div>
|
|
19
|
-
<slot name="tools" />
|
|
20
|
-
<div class="el-dialog__headerbtn" @click="onClose">
|
|
21
|
-
<span class="el-dialog__close el-icon el-icon-close close" />
|
|
22
|
-
</div>
|
|
23
|
-
</div>
|
|
24
|
-
</div>
|
|
25
|
-
</template> -->
|
|
26
13
|
<slot />
|
|
27
14
|
<span slot="footer">
|
|
28
15
|
<slot name="footer">
|
|
@@ -46,7 +33,7 @@ export default {
|
|
|
46
33
|
props: {
|
|
47
34
|
beforeClose: {
|
|
48
35
|
type: Function,
|
|
49
|
-
default:
|
|
36
|
+
default: null,
|
|
50
37
|
},
|
|
51
38
|
top: {
|
|
52
39
|
type: String,
|
|
@@ -90,11 +77,17 @@ export default {
|
|
|
90
77
|
|
|
91
78
|
methods: {
|
|
92
79
|
onClose() {
|
|
93
|
-
this.beforeClose()
|
|
80
|
+
this.beforeClose()
|
|
94
81
|
},
|
|
95
82
|
onConfirm() {
|
|
96
83
|
this.$emit("on-confirm");
|
|
97
84
|
},
|
|
85
|
+
// handleBeforeClose() {
|
|
86
|
+
// if (this.beforeClose && typeof this.beforeClose === "function") {
|
|
87
|
+
// return this.beforeClose();
|
|
88
|
+
// }
|
|
89
|
+
// this.onClose();
|
|
90
|
+
// },
|
|
98
91
|
},
|
|
99
92
|
};
|
|
100
93
|
</script>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<el-footer class="xn-footer">
|
|
3
|
+
<div class="xn-footer-main">
|
|
4
|
+
<slot />
|
|
5
|
+
</div>
|
|
6
|
+
</el-footer>
|
|
7
|
+
</template>
|
|
8
|
+
|
|
9
|
+
<script>
|
|
10
|
+
export default {
|
|
11
|
+
name: 'XnFooter'
|
|
12
|
+
}
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<style lang="scss" scoped>
|
|
16
|
+
@import 'packages/style/src/theme/variables.scss';
|
|
17
|
+
.xn-footer{
|
|
18
|
+
&-main{
|
|
19
|
+
position: fixed;
|
|
20
|
+
bottom: 0;
|
|
21
|
+
right: 0;
|
|
22
|
+
height: 60px;
|
|
23
|
+
width: calc(100% - #{$sideBarWidth});
|
|
24
|
+
background-color: #fff;
|
|
25
|
+
line-height: 60px;
|
|
26
|
+
padding: 0 15px;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
</style>
|
package/packages/import/main.vue
CHANGED
|
@@ -1,61 +1,63 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
</
|
|
46
|
-
<div slot="
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
2
|
+
<xn-dialog
|
|
3
|
+
title="批量导入"
|
|
4
|
+
v-bind="$attrs"
|
|
5
|
+
v-on="$listeners"
|
|
6
|
+
:show.sync="show"
|
|
7
|
+
:before-close="onClose"
|
|
8
|
+
@on-confirm="handleConfirm"
|
|
9
|
+
size="small"
|
|
10
|
+
>
|
|
11
|
+
<div class="xn-import">
|
|
12
|
+
<el-link
|
|
13
|
+
class="mb-20"
|
|
14
|
+
type="success"
|
|
15
|
+
icon="el-icon-download"
|
|
16
|
+
:underline="false"
|
|
17
|
+
@click="handleDownload"
|
|
18
|
+
>下载模板</el-link
|
|
19
|
+
>
|
|
20
|
+
<el-upload
|
|
21
|
+
ref="import"
|
|
22
|
+
action="###"
|
|
23
|
+
class="xn-import-upload"
|
|
24
|
+
v-bind="$attrs"
|
|
25
|
+
drag
|
|
26
|
+
:limit="limit"
|
|
27
|
+
:file-list="fileList"
|
|
28
|
+
:auto-upload="autoUpload"
|
|
29
|
+
:http-request="onSubmitUpload"
|
|
30
|
+
:before-upload="handleUploadBefore"
|
|
31
|
+
:on-exceed="onExceed"
|
|
32
|
+
:on-change="onChange"
|
|
33
|
+
:on-remove="onRemove"
|
|
34
|
+
:accept="accept"
|
|
35
|
+
v-on="$listeners"
|
|
36
|
+
>
|
|
37
|
+
<template slot="trigger">
|
|
38
|
+
<div class="xn-import-trigger">
|
|
39
|
+
<i class="xn-import-trigger__icon el-icon-upload" />
|
|
40
|
+
<span class="xn-import-trigger__text">
|
|
41
|
+
<span>将文件拖到此处,或</span>
|
|
42
|
+
<em>点击上传</em>
|
|
43
|
+
</span>
|
|
44
|
+
</div>
|
|
45
|
+
</template>
|
|
46
|
+
<div v-if="tip" slot="tip" class="el-upload__tip">{{ tip }}</div>
|
|
47
|
+
</el-upload>
|
|
48
|
+
<slot name="desc" class="xn-import-desc mt-10 fz-12">
|
|
49
|
+
<el-alert title="注:" type="warning">
|
|
50
|
+
<div>
|
|
51
|
+
<p>
|
|
52
|
+
1、非系统模板的文件会导入失败,请务必使用系统模板,点击上方按钮进行下载
|
|
53
|
+
</p>
|
|
54
|
+
<p>2、导入期间请勿进行其他操作</p>
|
|
55
|
+
<p>3、导入为替换操作,请谨慎操作</p>
|
|
56
|
+
</div>
|
|
57
|
+
</el-alert>
|
|
58
|
+
</slot>
|
|
59
|
+
</div>
|
|
60
|
+
</xn-dialog>
|
|
59
61
|
</template>
|
|
60
62
|
<script>
|
|
61
63
|
export default {
|
|
@@ -66,6 +68,14 @@ export default {
|
|
|
66
68
|
type: Boolean,
|
|
67
69
|
default: false,
|
|
68
70
|
},
|
|
71
|
+
limit: {
|
|
72
|
+
type: Number,
|
|
73
|
+
default: 1,
|
|
74
|
+
},
|
|
75
|
+
autoUpload: {
|
|
76
|
+
type: Boolean,
|
|
77
|
+
default: false,
|
|
78
|
+
},
|
|
69
79
|
tip: {
|
|
70
80
|
type: String,
|
|
71
81
|
default: "仅支持上传excel文件",
|
|
@@ -84,8 +94,7 @@ export default {
|
|
|
84
94
|
fileList: [],
|
|
85
95
|
};
|
|
86
96
|
},
|
|
87
|
-
created() {
|
|
88
|
-
},
|
|
97
|
+
created() {},
|
|
89
98
|
methods: {
|
|
90
99
|
onClose() {
|
|
91
100
|
this.$emit("update:show", false);
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "xn-ui-style",
|
|
3
|
-
"version": "1.0.0",
|
|
4
|
-
"description": "",
|
|
5
|
-
"main": "lib/index.css",
|
|
6
|
-
"style": "lib/index.css",
|
|
7
|
-
"files": [
|
|
8
|
-
"lib",
|
|
9
|
-
"src"
|
|
10
|
-
],
|
|
11
|
-
"scripts": {
|
|
12
|
-
"style": "gulp"
|
|
13
|
-
},
|
|
14
|
-
"author": "",
|
|
15
|
-
"license": "ISC",
|
|
16
|
-
"devDependencies": {
|
|
17
|
-
"gulp": "^4.0.2",
|
|
18
|
-
"gulp-autoprefixer": "^8.0.0",
|
|
19
|
-
"gulp-cssmin": "^0.2.0",
|
|
20
|
-
"gulp-sass": "^5.1.0"
|
|
21
|
-
}
|
|
22
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "xn-ui-style",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "",
|
|
5
|
+
"main": "lib/index.css",
|
|
6
|
+
"style": "lib/index.css",
|
|
7
|
+
"files": [
|
|
8
|
+
"lib",
|
|
9
|
+
"src"
|
|
10
|
+
],
|
|
11
|
+
"scripts": {
|
|
12
|
+
"style": "gulp"
|
|
13
|
+
},
|
|
14
|
+
"author": "",
|
|
15
|
+
"license": "ISC",
|
|
16
|
+
"devDependencies": {
|
|
17
|
+
"gulp": "^4.0.2",
|
|
18
|
+
"gulp-autoprefixer": "^8.0.0",
|
|
19
|
+
"gulp-cssmin": "^0.2.0",
|
|
20
|
+
"gulp-sass": "^5.1.0"
|
|
21
|
+
}
|
|
22
|
+
}
|
package/packages/table/main.vue
CHANGED
|
@@ -198,8 +198,8 @@ export default {
|
|
|
198
198
|
const res = this.data.filter((item) => item.id === val.id);
|
|
199
199
|
this.$emit("on-single", res);
|
|
200
200
|
},
|
|
201
|
-
handleToolsItem(row,
|
|
202
|
-
|
|
201
|
+
handleToolsItem(row, index) {
|
|
202
|
+
this.$emit("on-tools", { row, index });
|
|
203
203
|
},
|
|
204
204
|
handleChangeToolshow(item) {
|
|
205
205
|
item.checked = item.checked === true ? false : true;
|
package/public/index.html
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
<noscript>
|
|
13
13
|
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
|
|
14
14
|
</noscript>
|
|
15
|
-
<div id="
|
|
15
|
+
<div id="appDoc"></div>
|
|
16
16
|
<!-- built files will be auto injected -->
|
|
17
17
|
</body>
|
|
18
18
|
</html>
|
package/src/index.js
CHANGED
|
@@ -11,8 +11,10 @@ import XnDrawer from '../packages/drawer/index'
|
|
|
11
11
|
import XnTree from '../packages/tree/index'
|
|
12
12
|
import XnImport from '../packages/import/index'
|
|
13
13
|
import XnExport from '../packages/export/index'
|
|
14
|
+
import XnFooter from '../packages/footer/index'
|
|
14
15
|
|
|
15
16
|
import Utils from 'xn-ui/src/utils/index'
|
|
17
|
+
const doc = 'http://lzwr.gitee.io/xn-ui/#/'
|
|
16
18
|
const components = [
|
|
17
19
|
XnDialog,
|
|
18
20
|
XnTable,
|
|
@@ -25,10 +27,13 @@ const components = [
|
|
|
25
27
|
XnDrawer,
|
|
26
28
|
XnTree,
|
|
27
29
|
XnImport,
|
|
28
|
-
XnExport
|
|
30
|
+
XnExport,
|
|
31
|
+
XnFooter
|
|
29
32
|
]
|
|
30
33
|
const version = require('../package.json').version
|
|
31
|
-
|
|
34
|
+
if (process.env.NODE_ENV && process.env.NODE_ENV === 'development') {
|
|
35
|
+
console.log(`doc:${doc}`);
|
|
36
|
+
}
|
|
32
37
|
const install = function (Vue) {
|
|
33
38
|
if (install.installed) return
|
|
34
39
|
if (!Vue.prototype.$ELEMENT) throw new Error('缺失 element-ui,请进行安装')
|
|
@@ -38,13 +43,14 @@ const install = function (Vue) {
|
|
|
38
43
|
})
|
|
39
44
|
|
|
40
45
|
Vue.prototype.$XN = {
|
|
41
|
-
uploadUrl: '
|
|
46
|
+
uploadUrl: ''
|
|
42
47
|
}
|
|
43
48
|
Vue.prototype.$utils = Utils.$utils
|
|
44
49
|
Vue.prototype.$reg = Utils.$reg
|
|
45
50
|
Vue.prototype.$format = Utils.$format
|
|
46
51
|
Vue.prototype.$dayjs = Utils.$dayjs
|
|
47
52
|
Vue.prototype.$storage = Utils.$storage
|
|
53
|
+
Vue.prototype.$lodash = Utils.$lodash
|
|
48
54
|
|
|
49
55
|
}
|
|
50
56
|
if (typeof window !== 'undefined' && window.Vue) {
|
|
@@ -53,6 +59,7 @@ if (typeof window !== 'undefined' && window.Vue) {
|
|
|
53
59
|
|
|
54
60
|
export default {
|
|
55
61
|
version,
|
|
62
|
+
doc,
|
|
56
63
|
install,
|
|
57
64
|
XnDialog,
|
|
58
65
|
XnTable,
|
package/src/utils/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import format from './format'
|
|
|
4
4
|
import dayjs from './dayjs'
|
|
5
5
|
import storage from './storage'
|
|
6
6
|
import utils from './utils'
|
|
7
|
-
|
|
7
|
+
import lodash from 'lodash'
|
|
8
8
|
const version = () => {
|
|
9
9
|
return `xianniu-tools@${require('./package.json').version}`
|
|
10
10
|
}
|
|
@@ -14,6 +14,7 @@ export default {
|
|
|
14
14
|
$reg: reg,
|
|
15
15
|
$format: format,
|
|
16
16
|
$dayjs: dayjs,
|
|
17
|
+
$lodash: lodash,
|
|
17
18
|
$storage: storage,
|
|
18
19
|
$utils: utils
|
|
19
20
|
}
|