xianniu-ui 0.1.11-beta → 0.1.12-beta

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xianniu-ui",
3
- "version": "0.1.11-beta",
3
+ "version": "0.1.12-beta",
4
4
  "private": false,
5
5
  "main": "lib/xianniu-ui.umd.min.js",
6
6
  "scripts": {
@@ -25,6 +25,7 @@
25
25
  "core-js": "^3.6.5",
26
26
  "dayjs": "^1.10.7",
27
27
  "good-storage": "^1.1.1",
28
+ "lodash": "^4.17.21",
28
29
  "vue": "^2.6.11",
29
30
  "vue-lottie": "^0.2.1",
30
31
  "vue-router": "^3.2.0",
@@ -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>
@@ -1,61 +1,63 @@
1
1
  <template>
2
- <xn-dialog
3
- title="批量导入"
4
- v-bind="$attrs"
5
- v-on="$listeners"
6
- :show-confirm="true"
7
- :show.sync="show"
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
- :file-list="fileList"
27
- :http-request="onSubmitUpload"
28
- :before-upload="handleUploadBefore"
29
- :on-exceed="onExceed"
30
- :on-change="onChange"
31
- :on-remove="onRemove"
32
- :accept="accept"
33
- v-on="$listeners"
34
- >
35
- <template slot="trigger">
36
- <div class="xn-import-trigger">
37
- <i class="xn-import-trigger__icon el-icon-upload" />
38
- <span class="xn-import-trigger__text">
39
- <span>将文件拖到此处,或</span>
40
- <em>点击上传</em>
41
- </span>
42
- </div>
43
- </template>
44
- <div v-if="tip" slot="tip" class="el-upload__tip">{{ tip }}</div>
45
- </el-upload>
46
- <div slot="desc" class="xn-import-desc mt-10 fz-12">
47
- <el-alert title="注:" type="warning">
48
- <div>
49
- <p>
50
- 1、非系统模板的文件会导入失败,请务必使用系统模板,点击上方按钮进行下载
51
- </p>
52
- <p>2、导入期间请勿进行其他操作</p>
53
- <p>3、导入为替换操作,请谨慎操作</p>
54
- </div>
55
- </el-alert>
56
- </div>
57
- </div>
58
- </xn-dialog>
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
+ }
@@ -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, idx) {
202
- console.log(row, idx);
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="app"></div>
15
+ <div id="appDoc"></div>
16
16
  <!-- built files will be auto injected -->
17
17
  </body>
18
18
  </html>
package/src/index.js CHANGED
@@ -13,6 +13,7 @@ import XnImport from '../packages/import/index'
13
13
  import XnExport from '../packages/export/index'
14
14
 
15
15
  import Utils from 'xn-ui/src/utils/index'
16
+ const doc = 'http://lzwr.gitee.io/xn-ui/#/'
16
17
  const components = [
17
18
  XnDialog,
18
19
  XnTable,
@@ -28,7 +29,9 @@ const components = [
28
29
  XnExport
29
30
  ]
30
31
  const version = require('../package.json').version
31
-
32
+ if (process.env.NODE_ENV && process.env.NODE_ENV === 'development') {
33
+ console.log(`doc:${doc}`);
34
+ }
32
35
  const install = function (Vue) {
33
36
  if (install.installed) return
34
37
  if (!Vue.prototype.$ELEMENT) throw new Error('缺失 element-ui,请进行安装')
@@ -38,13 +41,14 @@ const install = function (Vue) {
38
41
  })
39
42
 
40
43
  Vue.prototype.$XN = {
41
- uploadUrl: 'https://gateway.dev.xianniu.cn/file-server/oss/uploadFile'
44
+ uploadUrl: ''
42
45
  }
43
46
  Vue.prototype.$utils = Utils.$utils
44
47
  Vue.prototype.$reg = Utils.$reg
45
48
  Vue.prototype.$format = Utils.$format
46
49
  Vue.prototype.$dayjs = Utils.$dayjs
47
50
  Vue.prototype.$storage = Utils.$storage
51
+ Vue.prototype.$lodash = Utils.$lodash
48
52
 
49
53
  }
50
54
  if (typeof window !== 'undefined' && window.Vue) {
@@ -53,6 +57,7 @@ if (typeof window !== 'undefined' && window.Vue) {
53
57
 
54
58
  export default {
55
59
  version,
60
+ doc,
56
61
  install,
57
62
  XnDialog,
58
63
  XnTable,
@@ -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
  }