@netang/quasar 0.1.85 → 0.1.87

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.
@@ -120,9 +120,11 @@ export default {
120
120
  })
121
121
 
122
122
  // 更新布局数据
123
- $power.update(function(data) {
124
- data.uploader.push(uploader)
125
- })
123
+ if ($power) {
124
+ $power?.update(function(data) {
125
+ data.uploader.push(uploader)
126
+ })
127
+ }
126
128
 
127
129
  // ==========【监听数据】==============================================================================================
128
130
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@netang/quasar",
3
- "version": "0.1.85",
3
+ "version": "0.1.87",
4
4
  "description": "netang-quasar",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
package/utils/$power.js CHANGED
@@ -1227,10 +1227,13 @@ async function request(options) {
1227
1227
 
1228
1228
  async function nextBefore() {
1229
1229
 
1230
+ // 请求地址
1231
+ const requestUrl = o.powerBtn.data.url
1232
+
1230
1233
  // 请求
1231
1234
  const res = await $n_http({
1232
1235
  // 请求地址
1233
- url: o.powerBtn.data.url,
1236
+ url: requestUrl,
1234
1237
  // 请求数据
1235
1238
  data: requestData,
1236
1239
  // 加载中
@@ -1239,6 +1242,8 @@ async function request(options) {
1239
1242
 
1240
1243
  // 返回结果数据
1241
1244
  const resultData = Object.assign({
1245
+ // 请求地址
1246
+ requestUrl,
1242
1247
  // 参数
1243
1248
  options: o,
1244
1249
  // 请求数据
package/utils/$table.js CHANGED
@@ -51,6 +51,8 @@ import { NRenderKey, NPowerKey, NTableKey } from './symbols'
51
51
  const {
52
52
  // 表格配置
53
53
  tablesConfig,
54
+ // 字典常量
55
+ dicts,
54
56
  } = configs
55
57
 
56
58
  /**
@@ -1193,6 +1195,52 @@ function config(routePath, path, defaultValue) {
1193
1195
  return $n_cloneDeep($n_get(tablesConfig, $n_slash(routePath, 'start', false) + (path ? '.' + path : ''), defaultValue))
1194
1196
  }
1195
1197
 
1198
+ /**
1199
+ * 获取表格浏览数据
1200
+ */
1201
+ async function getViewData(options) {
1202
+
1203
+ const {
1204
+ url,
1205
+ field,
1206
+ value,
1207
+ } = Object.assign({
1208
+ field: 'id',
1209
+ value: [],
1210
+ }, options)
1211
+
1212
+ const _isValidValue = $n_isValidValue(value)
1213
+ if (_isValidValue || $n_isValidArray(value)) {
1214
+
1215
+ const { status, data } = await $n_http({
1216
+ url,
1217
+ // 头部请求
1218
+ headers: {
1219
+ // 添加头部查看请求
1220
+ Pview: 1,
1221
+ },
1222
+ data: {
1223
+ n_search: [
1224
+ {
1225
+ field,
1226
+ compare: _isValidValue ? dicts.SEARCH_COMPARE_TYPE__EQUAL : dicts.SEARCH_COMPARE_TYPE__IN,
1227
+ value: _isValidValue ? value : $n_uniq(value),
1228
+ },
1229
+ ],
1230
+ },
1231
+ })
1232
+
1233
+ if (
1234
+ status
1235
+ && $n_isValidArray($n.get(data, 'rows'))
1236
+ ) {
1237
+ return data.rows
1238
+ }
1239
+ }
1240
+
1241
+ return []
1242
+ }
1243
+
1196
1244
  /**
1197
1245
  * 业务表格
1198
1246
  */
@@ -1201,6 +1249,9 @@ const $table = {
1201
1249
  create,
1202
1250
  // 获取表格配置
1203
1251
  config,
1252
+
1253
+ // 获取表格浏览数据
1254
+ getViewData,
1204
1255
  }
1205
1256
 
1206
1257
  export default $table