@lambo-design/shared 1.0.0-beta.143 → 1.0.0-beta.145

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": "@lambo-design/shared",
3
- "version": "1.0.0-beta.143",
3
+ "version": "1.0.0-beta.145",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "author": "lambo",
package/utils/assist.js CHANGED
@@ -109,6 +109,34 @@ export function operateHref(vm, h, currentRow, operationName, operation, type, p
109
109
  return h('a', renderOption, operationName);
110
110
  }
111
111
 
112
+ export function operateMore(vm, h, operation) {
113
+ return h("Dropdown", {
114
+ style: {
115
+ marginLeft: "4px",
116
+ },
117
+ props: {
118
+ transfer: true,
119
+ }
120
+ }, [
121
+ h("a", {
122
+ style: {
123
+ margin: '0 4px',
124
+ borderBottom: '0px solid #CC9900',
125
+ }
126
+ }, [
127
+ h("span", "更多"),
128
+ h("Icon", {
129
+ props: {
130
+ type: "ios-arrow-down"
131
+ },
132
+ })
133
+ ]),
134
+ h('DropdownMenu', {
135
+ slot: "list",
136
+ }, operation)
137
+ ]);
138
+ }
139
+
112
140
  export function isJson(arg) {
113
141
  return typeof (arg) == "object" && Object.prototype.toString.call(arg).toLowerCase() == "[object object]" && !arg.length
114
142
  };
@@ -1,5 +1,6 @@
1
1
  import config from "../../config/config"
2
2
  import {deepCopy} from "../assist";
3
+ import {getUrlParams} from "../platform"
3
4
  /**
4
5
  * 判断是否存在路由
5
6
  * @param $router
@@ -222,7 +223,14 @@ const generator = (menuData,constantRouterComponents) => {
222
223
  item.component = target.component;
223
224
  }
224
225
  if (target.url) {
225
- item.path = target.url;
226
+ let path = target.url;
227
+ let query = {};
228
+ if (path.indexOf("?") > -1) {
229
+ query = getUrlParams(path.substr(path.indexOf("?")));
230
+ item.query = query;
231
+ path = path.substr(0,path.indexOf("?"));
232
+ }
233
+ item.path = path;
226
234
  }
227
235
  if (item.uri) {
228
236
  item.meta.uriParam = item.uri;
@@ -252,6 +260,12 @@ const generator = (menuData,constantRouterComponents) => {
252
260
  if (item.uri.startsWith(config.routerBase + "/")) {
253
261
  path = path.replace(config.routerBase + "/","")
254
262
  }
263
+ let query = {};
264
+ if (path.indexOf("?") > -1) {
265
+ query = getUrlParams(path.substr(path.indexOf("?")));
266
+ item.query = query;
267
+ path = path.substr(0,path.indexOf("?"));
268
+ }
255
269
  let component = require(`@/view/${path}`);
256
270
  if (component) {
257
271
  item.component = resolve => {