Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Hooke
/
data-table
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Authored by
hookehuyr
2022-12-06 17:03:11 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
2ffb7db91f7c699cb5640bdaeba32fd5b1638257
2ffb7db9
1 parent
5a662c61
解析URL参数
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
5 deletions
src/App.vue
src/utils/tools.js
src/App.vue
View file @
2ffb7db
...
...
@@ -2,7 +2,7 @@
* @Author: hookehuyr hookehuyr@gmail.com
* @Date: 2022-05-26 23:52:36
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2022-12-06 16:
41:55
* @LastEditTime: 2022-12-06 16:
52:33
* @FilePath: /data-table/src/App.vue
* @Description:
-->
...
...
@@ -27,7 +27,7 @@ import vConsole from "@/utils/vconsole";
// import wx from 'weixin-js-sdk'
// import { wxJsAPI } from '@/api/wx/config'
// import { apiList } from '@/api/wx/jsApiList.js'
import { wxInfo } from "@/utils/tools";
import { wxInfo
, getUrlParams
} from "@/utils/tools";
import { styleColor } from "@/constant.js";
import { getFormSettingAPI } from "@/api/form.js";
...
...
@@ -72,7 +72,7 @@ onMounted(async () => {
// console.warn(err);
// });
// 数据收集设置
const code =
$route.query.code
;
const code =
getUrlParams(location.href) ? getUrlParams(location.href).code : ''
;
const { data, extend } = await getFormSettingAPI({ form_code: code });
const form_setting = {};
if (data.length) {
...
...
src/utils/tools.js
View file @
2ffb7db
/*
* @Date: 2022-04-18 15:59:42
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2022-1
1-21 15:42:14
* @LastEditTime: 2022-1
2-06 16:51:59
* @FilePath: /data-table/src/utils/tools.js
* @Description: 文件描述
*/
...
...
@@ -101,4 +101,15 @@ const changeURLArg = (url, arg, arg_val) => {
return
url
+
'\n'
+
arg
+
'\n'
+
arg_val
;
}
export
{
formatDate
,
wxInfo
,
hasEllipsis
,
parseQueryString
,
strExist
,
changeURLArg
};
const
getUrlParams
=
(
url
)
=>
{
let
arr
=
url
.
split
(
'?'
);
let
res
=
arr
[
1
].
split
(
'&'
);
let
items
=
{};
for
(
let
i
=
0
;
i
<
res
.
length
;
i
++
)
{
let
a
=
res
[
i
].
split
(
'='
);
items
[
a
[
0
]]
=
a
[
1
];
}
return
items
}
export
{
formatDate
,
wxInfo
,
hasEllipsis
,
parseQueryString
,
strExist
,
changeURLArg
,
getUrlParams
};
...
...
Please
register
or
login
to post a comment