@netang/quasar 0.0.48 → 0.0.50

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.
Files changed (61) hide show
  1. package/components/data/index.vue +23 -23
  2. package/components/dialog/index.vue +10 -10
  3. package/components/dialog-table/index.vue +1 -1
  4. package/components/dragger/index.vue +2 -2
  5. package/components/drawer/index.vue +7 -7
  6. package/components/editor-code/index.vue +282 -0
  7. package/components/empty/index.vue +22 -3
  8. package/components/field-date/index.vue +35 -35
  9. package/components/field-table/index.vue +34 -34
  10. package/components/field-text/index.vue +2 -2
  11. package/components/field-tree/index.vue +18 -18
  12. package/components/input-number/index.vue +2 -2
  13. package/components/list-menu/index.vue +2 -2
  14. package/components/private/components/move-to-tree/index.vue +2 -2
  15. package/components/private/edit-power-data/index.vue +50 -50
  16. package/components/private/table-visible-columns-button/index.vue +2 -2
  17. package/components/render/index.vue +6 -6
  18. package/components/search/index.vue +2 -2
  19. package/components/search-item/index.vue +5 -5
  20. package/components/select/index.vue +2 -2
  21. package/components/splitter/index.vue +7 -7
  22. package/components/table/index.vue +5 -5
  23. package/components/table-splitter/index.vue +4 -4
  24. package/components/table-summary/index.vue +3 -3
  25. package/components/thumbnail/index.vue +6 -6
  26. package/components/uploader/index.vue +1 -1
  27. package/components/uploader-query/index.vue +25 -25
  28. package/components/value-format/index.vue +12 -12
  29. package/package.json +1 -1
  30. package/sass/quasar/field.scss +5 -0
  31. package/sass/quasar/table.scss +6 -0
  32. package/utils/$area.js +13 -13
  33. package/utils/$auth.js +6 -6
  34. package/utils/$dialog.js +3 -3
  35. package/utils/$form.js +2 -2
  36. package/utils/$power.js +118 -118
  37. package/utils/$rule.js +4 -4
  38. package/utils/$search.js +50 -50
  39. package/utils/$table.js +79 -76
  40. package/utils/$tree.js +43 -43
  41. package/utils/$uploader.js +47 -47
  42. package/utils/alert.js +1 -1
  43. package/utils/arr.js +2 -2
  44. package/utils/bus.js +1 -1
  45. package/utils/config.js +4 -4
  46. package/utils/confrim.js +1 -1
  47. package/utils/dict.js +5 -5
  48. package/utils/getData.js +9 -9
  49. package/utils/getFile.js +5 -5
  50. package/utils/getImage.js +12 -12
  51. package/utils/getTime.js +4 -4
  52. package/utils/http.js +20 -20
  53. package/utils/loading.js +1 -1
  54. package/utils/notify.js +1 -1
  55. package/utils/previewImage.js +2 -2
  56. package/utils/price.js +3 -3
  57. package/utils/timestamp.js +1 -1
  58. package/utils/toast.js +1 -1
  59. package/utils/uploader/qiniu.js +11 -11
  60. package/utils/useAuth.js +2 -2
  61. package/utils/useRouter.js +4 -4
@@ -44,8 +44,8 @@
44
44
  <div
45
45
  class="n-uploader-query__button--square cursor-pointer"
46
46
  :style="{
47
- width: utils.px(currentSize),
48
- height: utils.px(currentSize),
47
+ width: $n.px(currentSize),
48
+ height: $n.px(currentSize),
49
49
  }"
50
50
  @click="uploader.chooseUpload"
51
51
  v-show="showSquareButton"
@@ -53,7 +53,7 @@
53
53
  >
54
54
  <q-icon
55
55
  name="add"
56
- :size="utils.px(currentSize / 2)"
56
+ :size="$n.px(currentSize / 2)"
57
57
  />
58
58
  <div class="n-uploader-query__button--square__text" v-if="buttonText">{{buttonText}}</div>
59
59
  </div>
@@ -76,9 +76,9 @@
76
76
  >
77
77
  <q-img
78
78
  :src="getImage(fileItem)"
79
- :spinner-size="utils.px(currentSize / 2)"
80
- :width="utils.px(currentSize)"
81
- :height="utils.px(currentSize)"
79
+ :spinner-size="$n.px(currentSize / 2)"
80
+ :width="$n.px(currentSize)"
81
+ :height="$n.px(currentSize)"
82
82
  fit="fill"
83
83
  >
84
84
  <!-- 内容 -->
@@ -99,7 +99,7 @@
99
99
  <q-circular-progress
100
100
  indeterminate
101
101
  rounded
102
- :size="utils.px(currentSize / 1.5)"
102
+ :size="$n.px(currentSize / 1.5)"
103
103
  :thickness="0.14"
104
104
  color="white"
105
105
  v-if="fileItem.status < UPLOAD_STATUS.uploading"
@@ -108,7 +108,7 @@
108
108
  <!-- 上传中 -->
109
109
  <q-circular-progress
110
110
  :value="fileItem.progress"
111
- :size="utils.px(currentSize / 1.5)"
111
+ :size="$n.px(currentSize / 1.5)"
112
112
  :thickness="0.14"
113
113
  color="white"
114
114
  track-color="grey-5"
@@ -118,7 +118,7 @@
118
118
  <q-icon
119
119
  class="cursor-pointer"
120
120
  name="pause"
121
- :size="utils.px(currentSize / 3)"
121
+ :size="$n.px(currentSize / 3)"
122
122
  @click="uploader.deleteFileItem(fileItem)"
123
123
  />
124
124
  </q-circular-progress>
@@ -163,8 +163,8 @@
163
163
  <div
164
164
  class="n-uploader-query__button--square cursor-pointer"
165
165
  :style="{
166
- width: utils.px(currentSize),
167
- height: utils.px(currentSize),
166
+ width: $n.px(currentSize),
167
+ height: $n.px(currentSize),
168
168
  }"
169
169
  @click="uploader.chooseUpload"
170
170
  v-show="showSquareButton"
@@ -172,7 +172,7 @@
172
172
  >
173
173
  <q-icon
174
174
  name="add"
175
- :size="utils.px(currentSize / 2)"
175
+ :size="$n.px(currentSize / 2)"
176
176
  />
177
177
  <div class="n-uploader-query__button--square__text" v-if="buttonText">{{buttonText}}</div>
178
178
  </div>
@@ -191,7 +191,7 @@
191
191
  ghost: fileItemIndex === fromIndex,
192
192
  }"
193
193
  :style="{
194
- height: utils.px(currentSize),
194
+ height: $n.px(currentSize),
195
195
  }"
196
196
  :draggable="currentDrag"
197
197
  @mousedown.self="mousedown($event, fileItemIndex)"
@@ -204,8 +204,8 @@
204
204
  <div
205
205
  class="n-uploader-query__item__icon"
206
206
  :style="{
207
- width: utils.px(currentSize),
208
- height: utils.px(currentSize),
207
+ width: $n.px(currentSize),
208
+ height: $n.px(currentSize),
209
209
  }"
210
210
  >
211
211
  <!-- 上传中前 -->
@@ -213,7 +213,7 @@
213
213
  class="n-uploader-query__item__icon__icon"
214
214
  indeterminate
215
215
  rounded
216
- :size="utils.px(currentSize / 1.8)"
216
+ :size="$n.px(currentSize / 1.8)"
217
217
  :thickness="0.18"
218
218
  v-if="fileItem.status < UPLOAD_STATUS.uploading"
219
219
  />
@@ -222,7 +222,7 @@
222
222
  <q-circular-progress
223
223
  class="n-uploader-query__item__icon__icon"
224
224
  :value="fileItem.progress"
225
- :size="utils.px(currentSize / 1.8)"
225
+ :size="$n.px(currentSize / 1.8)"
226
226
  :thickness="0.18"
227
227
  show-value
228
228
  v-else-if="fileItem.status === UPLOAD_STATUS.uploading"
@@ -230,7 +230,7 @@
230
230
  <q-icon
231
231
  class="cursor-pointer"
232
232
  name="pause"
233
- :size="utils.px(currentSize / 3)"
233
+ :size="$n.px(currentSize / 3)"
234
234
  @click="uploader.deleteFileItem(fileItem)"
235
235
  />
236
236
  </q-circular-progress>
@@ -239,7 +239,7 @@
239
239
  <q-icon
240
240
  class="n-uploader-query__item__icon__icon"
241
241
  name="description"
242
- :size="utils.px(currentSize / 1.5)"
242
+ :size="$n.px(currentSize / 1.5)"
243
243
  v-else-if="type === 'file'"
244
244
  />
245
245
 
@@ -248,7 +248,7 @@
248
248
  class="n-uploader-query__item__icon__icon cursor-pointer"
249
249
  name="play_circle"
250
250
  title="播放"
251
- :size="utils.px(currentSize / 1.5)"
251
+ :size="$n.px(currentSize / 1.5)"
252
252
  @click="uploader.play(fileItem)"
253
253
  v-else
254
254
  />
@@ -412,7 +412,7 @@ export default {
412
412
  */
413
413
  const currentDrag = computed(function() {
414
414
  return props.drag
415
- && utils.isValidArray(query.value)
415
+ && $n.isValidArray(query.value)
416
416
  && query.value.length > 1
417
417
  })
418
418
 
@@ -454,11 +454,11 @@ export default {
454
454
  * 获取图片地址
455
455
  */
456
456
  function getImage(fileItem) {
457
- return _.has(fileItem, '__img') ?
457
+ return $n.has(fileItem, '__img') ?
458
458
  fileItem.__img
459
459
  : (
460
- utils.isValidString(fileItem.hash) ?
461
- utils.getImage(fileItem.hash, { w: $q.platform.is.mobile ? currentSize.value * 2 : currentSize.value })
460
+ $n.isValidString(fileItem.hash) ?
461
+ $n.getImage(fileItem.hash, { w: $q.platform.is.mobile ? currentSize.value * 2 : currentSize.value })
462
462
  : ''
463
463
  )
464
464
  }
@@ -467,7 +467,7 @@ export default {
467
467
  * 获取文件名称
468
468
  */
469
469
  function getFileName(fileItem) {
470
- return fileItem.title + (_.get(fileItem, 'ext') ? '.' + fileItem.ext : '')
470
+ return fileItem.title + ($n.get(fileItem, 'ext') ? '.' + fileItem.ext : '')
471
471
  }
472
472
 
473
473
  // ==========【生命周期】=========================================================================================
@@ -100,7 +100,7 @@ export default {
100
100
  * 格式化声明值
101
101
  */
102
102
  function formatModelValue(value) {
103
- return _.isFunction(props.before)
103
+ return $n.isFunction(props.before)
104
104
  // 如果有修改前值方法
105
105
  ? props.before({ value, formatArray, formatString })
106
106
  // 返回值
@@ -128,7 +128,7 @@ export default {
128
128
  const value = current.value.value
129
129
 
130
130
  // 获取新值
131
- const newValue = _.isFunction(props.after) ?
131
+ const newValue = $n.isFunction(props.after) ?
132
132
  // 如果有修改提交值方法
133
133
  props.after({ value, formatArray, formatString })
134
134
  // 否则返回当前值
@@ -160,24 +160,24 @@ export default {
160
160
  toString: false,
161
161
  }, params)
162
162
 
163
- val = utils.isValidArray(val) ? val : []
163
+ val = $n.isValidArray(val) ? val : []
164
164
 
165
165
  // 如果数组有值
166
166
  if (val.length) {
167
167
 
168
168
  // 是否给每个值去除首位空格
169
169
  if (o.trim) {
170
- val = val.map(e => utils.trimString(e))
170
+ val = val.map(e => $n.trimString(e))
171
171
  }
172
172
 
173
173
  // 是否验证每个值是否为有效字符串/数字
174
174
  if (o.isValidValue) {
175
- val = val.filter(val => utils.isValidValue(val))
175
+ val = val.filter(val => $n.isValidValue(val))
176
176
  }
177
177
 
178
178
  // 去重
179
179
  if (o.unique) {
180
- val = _.uniq(val)
180
+ val = $n.uniq(val)
181
181
  }
182
182
  }
183
183
 
@@ -213,15 +213,15 @@ export default {
213
213
  // 是否去除首尾空格
214
214
  if (o.trim) {
215
215
  // 去除首尾空格
216
- val = utils.trimString(val)
216
+ val = $n.trimString(val)
217
217
 
218
218
  // 否则转字符串
219
219
  } else {
220
- val = utils.isValidValue(val) ? String(val) : ''
220
+ val = $n.isValidValue(val) ? String(val) : ''
221
221
  }
222
222
 
223
223
  // 如果有分割符
224
- if (utils.isValidValue(o.separator, true)) {
224
+ if ($n.isValidValue(o.separator, true)) {
225
225
 
226
226
  // 是否替换
227
227
  if (o.replace) {
@@ -229,16 +229,16 @@ export default {
229
229
  }
230
230
 
231
231
  // 分隔成数组
232
- val = utils.split(val, o.separator)
232
+ val = $n.split(val, o.separator)
233
233
 
234
234
  // 如果去重
235
235
  if (o.unique) {
236
- val = _.uniq(val)
236
+ val = $n.uniq(val)
237
237
  }
238
238
 
239
239
  // 如果验证每个值是否为有效字符串/数字
240
240
  if (o.isValidValue) {
241
- val = val.filter(val => utils.isValidValue(val))
241
+ val = val.filter(val => $n.isValidValue(val))
242
242
  }
243
243
 
244
244
  // 如果转数组
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@netang/quasar",
3
- "version": "0.0.48",
3
+ "version": "0.0.50",
4
4
  "description": "netang-quasar",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
@@ -149,6 +149,11 @@
149
149
  transform: translateY(-80%) scale(0.85) !important;
150
150
  }
151
151
  }
152
+
153
+ // 文本框的上边距
154
+ &.q-textarea.q-field--labeled .q-field__control-container {
155
+ padding-top: 5px;
156
+ }
152
157
  }
153
158
 
154
159
  &--labeled {
@@ -11,6 +11,12 @@ $dark-td-bg-color: $dark;
11
11
 
12
12
  .n-table {
13
13
 
14
+ // 单元格换行
15
+ &__col-wrap {
16
+ word-wrap: break-word !important;
17
+ white-space: pre-wrap !important;
18
+ }
19
+
14
20
  &.q-table {
15
21
  &--dense {
16
22
  // 复选框
package/utils/$area.js CHANGED
@@ -19,14 +19,14 @@ function _getData(areaData, level, params) {
19
19
  }, params)
20
20
 
21
21
  // 克隆树数据
22
- const treeData = _.cloneDeep(_areaData)
22
+ const treeData = $n.cloneDeep(_areaData)
23
23
  const all = {}
24
24
  const rows = []
25
25
 
26
26
  // 是否有忽略省市区 id
27
- const isIgnore = utils.isValidArray(para.ignore)
27
+ const isIgnore = $n.isValidArray(para.ignore)
28
28
  function checkIgnore(id) {
29
- return isIgnore && _.indexOf(para.ignore, id) > -1
29
+ return isIgnore && $n.indexOf(para.ignore, id) > -1
30
30
  }
31
31
 
32
32
  // 省
@@ -45,7 +45,7 @@ function _getData(areaData, level, params) {
45
45
  }
46
46
 
47
47
  // 市
48
- if (level > 1 && utils.isValidArray(item1[2])) {
48
+ if (level > 1 && $n.isValidArray(item1[2])) {
49
49
 
50
50
  for (let index2 = 0, len2 = item1[2].length; index2 < len2; index2++) {
51
51
  const item2 = item1[2][index2]
@@ -64,7 +64,7 @@ function _getData(areaData, level, params) {
64
64
  item1[2][index2] = all[item2[1]]
65
65
 
66
66
  // 区
67
- if (level > 2 && utils.isValidArray(item2[2])) {
67
+ if (level > 2 && $n.isValidArray(item2[2])) {
68
68
  for (let index3 = 0, len3 = item2[2].length; index3 < len3; index3++) {
69
69
  const item3 = item2[2][index3]
70
70
 
@@ -90,7 +90,7 @@ function _getData(areaData, level, params) {
90
90
  rows.push(all[key])
91
91
  }
92
92
 
93
- resolve(utils.toTree({
93
+ resolve($n.toTree({
94
94
  data: rows,
95
95
  }))
96
96
  }
@@ -112,7 +112,7 @@ function _getData(areaData, level, params) {
112
112
  * 替换地址
113
113
  */
114
114
  function replaceArea(val) {
115
- val = utils.trimString(val)
115
+ val = $n.trimString(val)
116
116
  return val.replace(/直辖市/g, '')
117
117
  .replace(/市/g, '')
118
118
  .replace(/区/g, '')
@@ -166,7 +166,7 @@ async function getInfo(params) {
166
166
  const { attrs, nodes, tree } = areaData
167
167
 
168
168
  // 先通过地区编码来查找
169
- let data = _.get(nodes, code)
169
+ let data = $n.get(nodes, code)
170
170
 
171
171
  // 如果没有找到, 则通过文字来查找
172
172
  if (! data) {
@@ -184,19 +184,19 @@ async function getInfo(params) {
184
184
  children: children1,
185
185
  } = item1
186
186
 
187
- const _text1 = utils.replaceAll(text1, '省', '')
187
+ const _text1 = $n.replaceAll(text1, '省', '')
188
188
 
189
189
  if (
190
190
  isAreaText ?
191
191
  (
192
192
  provinceText === text1
193
- || utils.replaceAll(provinceText, '省', '') === _text1
193
+ || $n.replaceAll(provinceText, '省', '') === _text1
194
194
  )
195
195
  : regionText.indexOf(_text1) > -1
196
196
  ) {
197
197
 
198
198
  // 获取市 start --------------------------------------------------
199
- if (utils.isValidArray(children1)) {
199
+ if ($n.isValidArray(children1)) {
200
200
 
201
201
  for (const item2 of children1) {
202
202
 
@@ -216,7 +216,7 @@ async function getInfo(params) {
216
216
  : regionText.indexOf(_text2) > -1
217
217
  ) {
218
218
  // 获取区 start --------------------------------------------------
219
- if (utils.isValidArray(children2)) {
219
+ if ($n.isValidArray(children2)) {
220
220
 
221
221
  if (areaText || regionText) {
222
222
 
@@ -379,7 +379,7 @@ async function getInfo(params) {
379
379
  return res
380
380
  }
381
381
 
382
- utils.$area = {
382
+ $n.$area = {
383
383
  // 获取数据
384
384
  getData,
385
385
  // 获取详情
package/utils/$auth.js CHANGED
@@ -29,7 +29,7 @@ function updateLogin(res) {
29
29
  return _updateAdminUserInfo({
30
30
  id: i,
31
31
  token: t,
32
- info: utils.isValidObject(admin_user_info) ? admin_user_info : {},
32
+ info: $n.isValidObject(admin_user_info) ? admin_user_info : {},
33
33
  })
34
34
  }
35
35
 
@@ -61,12 +61,12 @@ function _updateAdminUserInfo(res) {
61
61
  // 设置已登录
62
62
  res.isLogin = true
63
63
 
64
- if (! utils.isValidObject(res.info)) {
64
+ if (! $n.isValidObject(res.info)) {
65
65
  res.info = {}
66
66
  }
67
67
 
68
68
  // 保存缓存(永久缓存)
69
- utils.cookie.set('_tk', res, 0)
69
+ $n.cookie.set('_tk', res, 0)
70
70
 
71
71
  // 设置管理员信息状态
72
72
  stateAdminUserInfo.value = res
@@ -92,7 +92,7 @@ function getAdminUserId() {
92
92
  * 跳转登录页面
93
93
  */
94
94
  function pushLogin(query) {
95
- utils.router.push({
95
+ $n.router.push({
96
96
  path: 'login',
97
97
  query,
98
98
  })
@@ -104,7 +104,7 @@ function pushLogin(query) {
104
104
  function logout() {
105
105
 
106
106
  // 删除管理员信息
107
- utils.cookie.delete('_tk')
107
+ $n.cookie.delete('_tk')
108
108
 
109
109
  // 清空管理员信息状态
110
110
  stateAdminUserInfo.value = {
@@ -117,7 +117,7 @@ function logout() {
117
117
  /**
118
118
  * 鉴权业务
119
119
  */
120
- utils.$auth = {
120
+ $n.$auth = {
121
121
  // 是否登录
122
122
  isLogin,
123
123
  // 登录后更新数据
package/utils/$dialog.js CHANGED
@@ -10,9 +10,9 @@ import { NDialogKey } from './symbols'
10
10
  function create(params) {
11
11
  if (
12
12
  // 如果是路由组件
13
- _.has(params, 'route')
13
+ $n.has(params, 'route')
14
14
  // 或自定义组件
15
- || _.has(params, 'name')
15
+ || $n.has(params, 'name')
16
16
  ) {
17
17
  return Dialog.create({
18
18
  // 组件
@@ -35,7 +35,7 @@ function onInject() {
35
35
  /**
36
36
  * 对话框业务
37
37
  */
38
- utils.$dialog = {
38
+ $n.$dialog = {
39
39
  // 创建对话框
40
40
  create,
41
41
  // 获取对话框注入数据
package/utils/$form.js CHANGED
@@ -18,7 +18,7 @@ function create(params) {
18
18
  }, params)
19
19
 
20
20
  // 获取权限注入
21
- const $power = _.has(params, '$power') ? params.$power : inject(NPowerKey)
21
+ const $power = $n.has(params, '$power') ? params.$power : inject(NPowerKey)
22
22
 
23
23
  // ==========【返回】=================================================================================================
24
24
 
@@ -46,7 +46,7 @@ function create(params) {
46
46
  /**
47
47
  * 业务表单
48
48
  */
49
- utils.$form = {
49
+ $n.$form = {
50
50
  // 创建表单
51
51
  create,
52
52
  }