@netang/quasar 0.1.71 → 0.1.73

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 (2) hide show
  1. package/package.json +1 -1
  2. package/utils/$power.js +24 -7
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@netang/quasar",
3
- "version": "0.1.71",
3
+ "version": "0.1.73",
4
4
  "description": "netang-quasar",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
package/utils/$power.js CHANGED
@@ -10,6 +10,7 @@ import $n_isNumber from 'lodash/isNumber'
10
10
  import $n_cloneDeep from 'lodash/cloneDeep'
11
11
  import $n_isFunction from 'lodash/isFunction'
12
12
  import $n_pick from 'lodash/pick'
13
+ import $n_omit from 'lodash/omit'
13
14
 
14
15
  import $n_router from '@netang/utils/vue/router'
15
16
 
@@ -50,6 +51,21 @@ const {
50
51
  dicts,
51
52
  } = configs
52
53
 
54
+ /**
55
+ * 获取来源页面完整地址
56
+ */
57
+ function getFromPageFullUrl({ path, query }) {
58
+
59
+ const {
60
+ fullPath
61
+ } = $n_router.resolve({
62
+ path,
63
+ query: $n_omit(query, ['n_page_title', 'n_from_page']),
64
+ })
65
+
66
+ return encodeURIComponent(fullPath)
67
+ }
68
+
53
69
  /**
54
70
  * 创建权限实例
55
71
  */
@@ -845,18 +861,18 @@ function getRequestQuery(o) {
845
861
  // 获取列表数据
846
862
  if (
847
863
  // 如果按钮参数有显示类型
848
- $n_has(o.powerBtn.data, 'show')
864
+ // $n_has(o.powerBtn.data, 'show')
849
865
  // 按钮参数的显示类型必须是单选或多选
850
- && $n_indexOf(['single', 'multiple'], o.powerBtn.data.show) > -1
866
+ // && $n_indexOf(['single', 'multiple'], o.powerBtn.data.show) > -1
851
867
  // 如果有请求传参的列表设置
852
- && $n_has(o.powerBtn.data, 'requestQuery.list')
868
+ $n_has(o.powerBtn.data, 'requestQuery.list')
853
869
  // 如果有表格数据
854
870
  && $n_isValidArray(o.tableSelected)
855
871
  ) {
856
872
  let newQuery = {}
857
873
 
858
874
  // 如果是单选
859
- if (o.powerBtn.data.show === 'single') {
875
+ if ($n_get(o.powerBtn.data, 'show') === 'single') {
860
876
  // 取表格选中第一条数据
861
877
  newQuery = o.tableSelected[0]
862
878
 
@@ -1030,8 +1046,9 @@ async function request(options) {
1030
1046
 
1031
1047
  // 如果不是禁止添加来源页面参数
1032
1048
  if ($n_get(o.powerBtn.data, 'noFromPageQuery') !== true) {
1049
+
1033
1050
  // 来源页面是当前路由的完整路径
1034
- query.n_from_page = encodeURIComponent($currentRoute.fullPath)
1051
+ query.n_from_page = getFromPageFullUrl($currentRoute)
1035
1052
  }
1036
1053
 
1037
1054
  // 请求前执行
@@ -1376,10 +1393,10 @@ function routerPush({ path, query, pageTitle, fromPage }) {
1376
1393
  // 来源页面
1377
1394
  if (fromPage) {
1378
1395
  if (fromPage === true) {
1379
- fromPage = $n_router.getRoute().fullPath
1396
+ fromPage = $n_router.getRoute()
1380
1397
  }
1381
1398
  // 来源页面是指定路由的完整路径
1382
- query.n_from_page = encodeURIComponent(fromPage)
1399
+ query.n_from_page = getFromPageFullUrl(fromPage)
1383
1400
  }
1384
1401
 
1385
1402
  $n_router.push({