vue2-client 1.2.91 → 1.2.93

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/CHANGELOG.md CHANGED
@@ -1,9 +1,14 @@
1
1
  # Change Log
2
2
  > 所有关于本项目的变化都在该文档里。
3
3
 
4
- **1.2.90 - 1.2.91 -2022-08-01 @江超**
4
+ **1.2.93 -2022-08-03 @江超**
5
+ - 功能新增:
6
+ - util增加uuid方法
7
+
8
+ **1.2.90 - 1.2.92 -2022-08-01 @江超**
5
9
  - 功能新增:
6
10
  - XCard增加空状态显示
11
+ - 修复依赖
7
12
 
8
13
  **1.2.89 - 1.2.90 -2022-07-31 @张振宇**
9
14
  - 功能新增:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue2-client",
3
- "version": "1.2.91",
3
+ "version": "1.2.93",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "vue-cli-service serve",
@@ -13,7 +13,6 @@
13
13
  "@antv/data-set": "^0.11.8",
14
14
  "@antv/f2": "^3.8.11",
15
15
  "@antv/g2plot": "^2.4.20",
16
- "@babel/core": "^7.18.5",
17
16
  "@logicflow/core": "^1.1.20",
18
17
  "@logicflow/extension": "^1.1.20",
19
18
  "@vue/babel-helper-vue-jsx-merge-props": "^1.2.1",
@@ -22,14 +21,13 @@
22
21
  "ant-design-vue": "^1.7.8",
23
22
  "axios": "^0.27.2",
24
23
  "clipboard": "^2.0.11",
25
- "core-js": "^3.23.2",
26
- "webpack": "^4.46.0",
24
+ "core-js": "^3.23.5",
27
25
  "date-fns": "^2.28.0",
28
26
  "default-passive-events": "^2.0.0",
29
27
  "enquire.js": "^2.1.6",
30
28
  "file-saver": "^2.0.5",
31
- "highlight.js": "^11.5.1",
32
- "js-cookie": "^3.0.1",
29
+ "highlight.js": "^10.7.3",
30
+ "js-cookie": "^2.2.1",
33
31
  "jsencrypt": "^3.2.1",
34
32
  "lodash.get": "^4.4.2",
35
33
  "mockjs": "^1.1.0",
@@ -42,16 +40,16 @@
42
40
  "vue-router": "^3.5.4",
43
41
  "vuedraggable": "^2.24.3",
44
42
  "vuex": "^3.6.2",
45
- "xlsx": "^0.18.5"
43
+ "xlsx": "0.18.5"
46
44
  },
47
45
  "devDependencies": {
48
- "@ant-design/colors": "^6.0.0",
49
- "@vue/cli-plugin-babel": "^4.5.18",
50
- "@vue/cli-plugin-eslint": "^4.5.18",
51
- "@vue/cli-plugin-router": "^4.5.18",
46
+ "@ant-design/colors": "^4.0.5",
47
+ "@vue/cli-plugin-babel": "^4.5.19",
48
+ "@vue/cli-plugin-eslint": "^4.5.19",
49
+ "@vue/cli-plugin-router": "^4.5.19",
52
50
  "@vue/cli-plugin-unit-jest": "~4.5.19",
53
- "@vue/cli-plugin-vuex": "^4.5.18",
54
- "@vue/cli-service": "^4.5.18",
51
+ "@vue/cli-plugin-vuex": "^4.5.19",
52
+ "@vue/cli-service": "^4.5.19",
55
53
  "@vue/eslint-config-standard": "^4.0.0",
56
54
  "@vue/test-utils": "^1.3.0",
57
55
  "@vue/vue2-jest": "^27.0.0",
@@ -60,7 +58,7 @@
60
58
  "babel-jest": "^27.1.0",
61
59
  "babel-plugin-transform-remove-console": "^6.9.4",
62
60
  "babel-polyfill": "^6.26.0",
63
- "compression-webpack-plugin": "^5.0.2",
61
+ "compression-webpack-plugin": "^4.0.1",
64
62
  "deepmerge": "^4.2.2",
65
63
  "echarts": "^5.3.3",
66
64
  "eslint": "^6.8.0",
@@ -71,19 +69,18 @@
71
69
  "fast-deep-equal": "^3.1.3",
72
70
  "gh-pages": "^3.2.3",
73
71
  "jest": "^27.1.0",
74
- "less": "^3.13.1",
75
- "less-loader": "^7.3.0",
72
+ "less-loader": "^6.2.0",
76
73
  "react-bmap": "^1.0.130",
77
74
  "script-loader": "^0.7.2",
78
75
  "style-resources-loader": "^1.5.0",
79
76
  "vue-amap": "^0.5.10",
80
77
  "vue-baidu-map": "^0.21.22",
81
- "vue-bmap-gl": "^0.0.30",
78
+ "vue-bmap-gl": "0.0.30",
82
79
  "vue-cli-plugin-style-resources-loader": "^0.1.5",
83
- "vue-mapvgl": "^0.0.34",
80
+ "vue-mapvgl": "0.0.34",
84
81
  "vue-template-compiler": "2.6.14",
85
82
  "vuepress": "^1.9.7",
86
- "webpack-theme-color-replacer": "^1.4.1",
83
+ "webpack-theme-color-replacer": "1.4.1",
87
84
  "whatwg-fetch": "^3.6.2"
88
85
  },
89
86
  "browserslist": [
@@ -17,7 +17,7 @@
17
17
  <a-select-option
18
18
  v-for="(item,index) in attr.keys"
19
19
  :key="index"
20
- :value="Object.keys(item)[0]">{{ item[Object.keys(item)[0]] }}
20
+ :value="item.value">{{ item.label }}
21
21
  </a-select-option>
22
22
  </a-select>
23
23
  </a-input>
@@ -62,8 +62,8 @@
62
62
  <a-select-option
63
63
  v-for="(item,index) in attr.keys"
64
64
  :key="index"
65
- :value="Object.keys(item)[0]">
66
- {{ item[Object.keys(item)[0]] }}
65
+ :value="item.value">
66
+ {{ item.label }}
67
67
  </a-select-option>
68
68
  </template>
69
69
  <template v-else>
@@ -71,7 +71,7 @@
71
71
  <a-select-option
72
72
  v-for="(item,index) in option"
73
73
  :key="index"
74
- :value="Object.keys(item)[0]">{{ item[Object.keys(item)[0]] }}
74
+ :value="item.value">{{ item.label }}
75
75
  </a-select-option>
76
76
  </template>
77
77
  <template v-else>
@@ -104,7 +104,7 @@
104
104
  <a-select-option
105
105
  v-for="(item,index) in option"
106
106
  :key="index"
107
- :value="Object.keys(item)[0]">{{ item[Object.keys(item)[0]] }}
107
+ :value="item.value">{{ item.label }}
108
108
  </a-select-option>
109
109
  </a-select>
110
110
  </a-form-model-item>
package/src/utils/util.js CHANGED
@@ -1,222 +1,230 @@
1
- import enquireJs from 'enquire.js'
2
-
3
- const timeList = [
4
- {
5
- CN: '早上好',
6
- HK: '早晨啊',
7
- US: 'Good morning'
8
- }, {
9
- CN: '上午好',
10
- HK: '上午好',
11
- US: 'Good morning'
12
- }, {
13
- CN: '中午好',
14
- HK: '中午好',
15
- US: 'Good afternoon'
16
- }, {
17
- CN: '下午好',
18
- HK: '下午好',
19
- US: 'Good afternoon'
20
- }, {
21
- CN: '晚上好',
22
- HK: '晚上好',
23
- US: 'Good evening'
24
- }
25
- ]
26
- /**
27
- * 数组去空值
28
- */
29
- export function arrRemoveEmpty (arr) {
30
- for (var i = 0; i < arr.length; i++) {
31
- if (arr[i] == '' || typeof (arr[i]) == 'undefined') {
32
- arr.splice(i, 1)
33
- i--
34
- }
35
- }
36
- return arr
37
- }
38
-
39
- export function isDef (v) {
40
- return v !== undefined && v !== null
41
- }
42
-
43
- export function formatDate (dateStr, fmt) {
44
- if (dateStr == null) {
45
- return '--'
46
- }
47
- let date
48
- if (dateStr === 'now') {
49
- date = new Date()
50
- } else {
51
- date = new Date(dateStr)
52
- }
53
- const o = {
54
- 'M+': date.getMonth() + 1,
55
- 'd+': date.getDate(),
56
- 'h+': date.getHours(),
57
- 'm+': date.getMinutes(),
58
- 's+': date.getSeconds(),
59
- 'q+': Math.floor((date.getMonth() + 3) / 3),
60
- 'S': date.getMilliseconds()
61
- }
62
- if (!fmt) {
63
- fmt = 'yyyy-MM-dd hh:mm:ss'
64
- }
65
- if (/(y+)/.test(fmt)) {
66
- fmt = fmt.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length))
67
- }
68
- for (const k in o) {
69
- if (new RegExp('(' + k + ')').test(fmt)) {
70
- fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k]).length)))
71
- }
72
- }
73
- return fmt
74
- }
75
-
76
- export function timeCompare (date1, date2) {
77
- const date11 = new Date(date1)
78
- const date22 = new Date(date2)
79
- return date11.time > date22.time ? 1 : -1
80
- }
81
-
82
- export function timeFix () {
83
- const time = new Date()
84
- const hour = time.getHours()
85
- return hour < 9
86
- ? timeList[0] : (hour <= 11 ? timeList[1] : (hour <= 13 ? timeList[2] : (hour <= 20 ? timeList[3] : timeList[4])))
87
- }
88
-
89
- /**
90
- * Remove an item from an array.
91
- */
92
- export function remove (arr, item) {
93
- if (arr.length) {
94
- const index = arr.indexOf(item)
95
- if (index > -1) {
96
- return arr.splice(index, 1)
97
- }
98
- }
99
- }
100
-
101
- export function isRegExp (v) {
102
- return _toString.call(v) === '[object RegExp]'
103
- }
104
-
105
- export function enquireScreen (call) {
106
- const handler = {
107
- match: function () {
108
- call && call(true)
109
- },
110
- unmatch: function () {
111
- call && call(false)
112
- }
113
- }
114
- enquireJs.register('only screen and (max-width: 767.99px)', handler)
115
- }
116
-
117
- export function showXml (str) {
118
- let text = str
119
-
120
- // 去掉多余的空格
121
- text = '\n' + text.replace(/(<\w+)(\s.*?>)/g, function ($0, name, props) {
122
- return name + props.replace(/\s+(\w+=)/g, ' $1')
123
- }).replace(/>\s*?</g, '>\n<')
124
-
125
- // 把注释编码
126
- text = text.replace(/\n/g, '\r').replace(/<!--(.+?)-->/g, function ($0, text) {
127
- return '<!--' + escape(text) + '-->'
128
- }).replace(/\r/g, '\n')
129
-
130
- // 调整格式
131
- const rgx = /\n(<(([^?]).+?)(?:\s|\s*?>|\s*?(\/)>)(?:.*?(?:(\/)>|<(\/)\2>))?)/mg
132
- const nodeStack = []
133
- const output = text.replace(rgx, function ($0, all, name, isBegin, isCloseFull1, isCloseFull2, isFull1, isFull2) {
134
- const isClosed = (isCloseFull1 === '/') || (isCloseFull2 === '/') || (isFull1 === '/') || (isFull2 === '/')
135
- let prefix
136
- if (isBegin === '!') {
137
- prefix = getPrefix(nodeStack.length)
138
- } else {
139
- if (isBegin !== '/') {
140
- prefix = getPrefix(nodeStack.length)
141
- if (!isClosed) {
142
- nodeStack.push(name)
143
- }
144
- } else {
145
- nodeStack.pop()
146
- prefix = getPrefix(nodeStack.length)
147
- }
148
- }
149
- return '\n' + prefix + all
150
- })
151
- let outputText = output.substring(1)
152
-
153
- // 把注释还原并解码,调格式
154
- outputText = outputText.replace(/\n/g, '\r').replace(/(\s*)<!--(.+?)-->/g, function ($0, prefix, text) {
155
- if (prefix.charAt(0) === '\r') { prefix = prefix.substring(1) }
156
- text = unescape(text).replace(/\r/g, '\n')
157
- return '\n' + prefix + '<!--' + text.replace(/^\s*/mg, prefix) + '-->'
158
- })
159
- // alert(outputText);
160
-
161
- outputText = outputText.replace(/\s+$/g, '').replace(/\r/g, '\r\n')
162
-
163
- return outputText
164
- }
165
-
166
- function getPrefix (prefixIndex) {
167
- const span = ' '
168
- const output = []
169
- for (let i = 0; i < prefixIndex; ++i) {
170
- output.push(span)
171
- }
172
-
173
- return output.join('')
174
- }
175
-
176
- /**
177
- * 构造树型结构数据
178
- * [label,value,children]
179
- */
180
- export function handleTree (data, id, parentId, children) {
181
- const config = {
182
- id: id || 'id',
183
- parentId: parentId || 'parent_id',
184
- childrenList: children || 'children'
185
- }
186
- const childrenListMap = {}
187
- const nodeIds = {}
188
- const tree = []
189
- for (const d of data) {
190
- const parentId = d[config.parentId]
191
- if (childrenListMap[parentId] == null) {
192
- childrenListMap[parentId] = []
193
- }
194
- nodeIds[d[config.id]] = d
195
- childrenListMap[parentId].push(d)
196
- }
197
- for (const d of data) {
198
- const parentId = d[config.parentId]
199
- if (nodeIds[parentId] == null) {
200
- tree.push(d)
201
- }
202
- }
203
- for (const t of tree) {
204
- adaptToChildrenList(t)
205
- }
206
-
207
- function adaptToChildrenList (o) {
208
- o.label = o.name
209
- o.value = o.name
210
- if (childrenListMap[o[config.id]] !== null) {
211
- o[config.childrenList] = childrenListMap[o[config.id]]
212
- }
213
- if (o[config.childrenList]) {
214
- for (const c of o[config.childrenList]) {
215
- adaptToChildrenList(c)
216
- }
217
- }
218
- }
219
- return tree
220
- }
221
-
222
- const _toString = Object.prototype.toString
1
+ import enquireJs from 'enquire.js'
2
+
3
+ const timeList = [
4
+ {
5
+ CN: '早上好',
6
+ HK: '早晨啊',
7
+ US: 'Good morning'
8
+ }, {
9
+ CN: '上午好',
10
+ HK: '上午好',
11
+ US: 'Good morning'
12
+ }, {
13
+ CN: '中午好',
14
+ HK: '中午好',
15
+ US: 'Good afternoon'
16
+ }, {
17
+ CN: '下午好',
18
+ HK: '下午好',
19
+ US: 'Good afternoon'
20
+ }, {
21
+ CN: '晚上好',
22
+ HK: '晚上好',
23
+ US: 'Good evening'
24
+ }
25
+ ]
26
+ /**
27
+ * 数组去空值
28
+ */
29
+ export function arrRemoveEmpty (arr) {
30
+ for (var i = 0; i < arr.length; i++) {
31
+ if (arr[i] == '' || typeof (arr[i]) == 'undefined') {
32
+ arr.splice(i, 1)
33
+ i--
34
+ }
35
+ }
36
+ return arr
37
+ }
38
+
39
+ export function isDef (v) {
40
+ return v !== undefined && v !== null
41
+ }
42
+
43
+ export function formatDate (dateStr, fmt) {
44
+ if (dateStr == null) {
45
+ return '--'
46
+ }
47
+ let date
48
+ if (dateStr === 'now') {
49
+ date = new Date()
50
+ } else {
51
+ date = new Date(dateStr)
52
+ }
53
+ const o = {
54
+ 'M+': date.getMonth() + 1,
55
+ 'd+': date.getDate(),
56
+ 'h+': date.getHours(),
57
+ 'm+': date.getMinutes(),
58
+ 's+': date.getSeconds(),
59
+ 'q+': Math.floor((date.getMonth() + 3) / 3),
60
+ 'S': date.getMilliseconds()
61
+ }
62
+ if (!fmt) {
63
+ fmt = 'yyyy-MM-dd hh:mm:ss'
64
+ }
65
+ if (/(y+)/.test(fmt)) {
66
+ fmt = fmt.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length))
67
+ }
68
+ for (const k in o) {
69
+ if (new RegExp('(' + k + ')').test(fmt)) {
70
+ fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k]).length)))
71
+ }
72
+ }
73
+ return fmt
74
+ }
75
+
76
+ export function uuid () {
77
+ return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
78
+ const r = Math.random() * 16 | 0
79
+ const v = c === 'x' ? r : (r & 0x3 | 0x8)
80
+ return v.toString(16)
81
+ })
82
+ }
83
+
84
+ export function timeCompare (date1, date2) {
85
+ const date11 = new Date(date1)
86
+ const date22 = new Date(date2)
87
+ return date11.time > date22.time ? 1 : -1
88
+ }
89
+
90
+ export function timeFix () {
91
+ const time = new Date()
92
+ const hour = time.getHours()
93
+ return hour < 9
94
+ ? timeList[0] : (hour <= 11 ? timeList[1] : (hour <= 13 ? timeList[2] : (hour <= 20 ? timeList[3] : timeList[4])))
95
+ }
96
+
97
+ /**
98
+ * Remove an item from an array.
99
+ */
100
+ export function remove (arr, item) {
101
+ if (arr.length) {
102
+ const index = arr.indexOf(item)
103
+ if (index > -1) {
104
+ return arr.splice(index, 1)
105
+ }
106
+ }
107
+ }
108
+
109
+ export function isRegExp (v) {
110
+ return _toString.call(v) === '[object RegExp]'
111
+ }
112
+
113
+ export function enquireScreen (call) {
114
+ const handler = {
115
+ match: function () {
116
+ call && call(true)
117
+ },
118
+ unmatch: function () {
119
+ call && call(false)
120
+ }
121
+ }
122
+ enquireJs.register('only screen and (max-width: 767.99px)', handler)
123
+ }
124
+
125
+ export function showXml (str) {
126
+ let text = str
127
+
128
+ // 去掉多余的空格
129
+ text = '\n' + text.replace(/(<\w+)(\s.*?>)/g, function ($0, name, props) {
130
+ return name + props.replace(/\s+(\w+=)/g, ' $1')
131
+ }).replace(/>\s*?</g, '>\n<')
132
+
133
+ // 把注释编码
134
+ text = text.replace(/\n/g, '\r').replace(/<!--(.+?)-->/g, function ($0, text) {
135
+ return '<!--' + escape(text) + '-->'
136
+ }).replace(/\r/g, '\n')
137
+
138
+ // 调整格式
139
+ const rgx = /\n(<(([^?]).+?)(?:\s|\s*?>|\s*?(\/)>)(?:.*?(?:(\/)>|<(\/)\2>))?)/mg
140
+ const nodeStack = []
141
+ const output = text.replace(rgx, function ($0, all, name, isBegin, isCloseFull1, isCloseFull2, isFull1, isFull2) {
142
+ const isClosed = (isCloseFull1 === '/') || (isCloseFull2 === '/') || (isFull1 === '/') || (isFull2 === '/')
143
+ let prefix
144
+ if (isBegin === '!') {
145
+ prefix = getPrefix(nodeStack.length)
146
+ } else {
147
+ if (isBegin !== '/') {
148
+ prefix = getPrefix(nodeStack.length)
149
+ if (!isClosed) {
150
+ nodeStack.push(name)
151
+ }
152
+ } else {
153
+ nodeStack.pop()
154
+ prefix = getPrefix(nodeStack.length)
155
+ }
156
+ }
157
+ return '\n' + prefix + all
158
+ })
159
+ let outputText = output.substring(1)
160
+
161
+ // 把注释还原并解码,调格式
162
+ outputText = outputText.replace(/\n/g, '\r').replace(/(\s*)<!--(.+?)-->/g, function ($0, prefix, text) {
163
+ if (prefix.charAt(0) === '\r') { prefix = prefix.substring(1) }
164
+ text = unescape(text).replace(/\r/g, '\n')
165
+ return '\n' + prefix + '<!--' + text.replace(/^\s*/mg, prefix) + '-->'
166
+ })
167
+ // alert(outputText);
168
+
169
+ outputText = outputText.replace(/\s+$/g, '').replace(/\r/g, '\r\n')
170
+
171
+ return outputText
172
+ }
173
+
174
+ function getPrefix (prefixIndex) {
175
+ const span = ' '
176
+ const output = []
177
+ for (let i = 0; i < prefixIndex; ++i) {
178
+ output.push(span)
179
+ }
180
+
181
+ return output.join('')
182
+ }
183
+
184
+ /**
185
+ * 构造树型结构数据
186
+ * [label,value,children]
187
+ */
188
+ export function handleTree (data, id, parentId, children) {
189
+ const config = {
190
+ id: id || 'id',
191
+ parentId: parentId || 'parent_id',
192
+ childrenList: children || 'children'
193
+ }
194
+ const childrenListMap = {}
195
+ const nodeIds = {}
196
+ const tree = []
197
+ for (const d of data) {
198
+ const parentId = d[config.parentId]
199
+ if (childrenListMap[parentId] == null) {
200
+ childrenListMap[parentId] = []
201
+ }
202
+ nodeIds[d[config.id]] = d
203
+ childrenListMap[parentId].push(d)
204
+ }
205
+ for (const d of data) {
206
+ const parentId = d[config.parentId]
207
+ if (nodeIds[parentId] == null) {
208
+ tree.push(d)
209
+ }
210
+ }
211
+ for (const t of tree) {
212
+ adaptToChildrenList(t)
213
+ }
214
+
215
+ function adaptToChildrenList (o) {
216
+ o.label = o.name
217
+ o.value = o.name
218
+ if (childrenListMap[o[config.id]] !== null) {
219
+ o[config.childrenList] = childrenListMap[o[config.id]]
220
+ }
221
+ if (o[config.childrenList]) {
222
+ for (const c of o[config.childrenList]) {
223
+ adaptToChildrenList(c)
224
+ }
225
+ }
226
+ }
227
+ return tree
228
+ }
229
+
230
+ const _toString = Object.prototype.toString