Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
Starter Web Vue
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
product
kim3-web-vue
Starter Web Vue
Commits
f07dc0ad
Commit
f07dc0ad
authored
Jul 08, 2021
by
水落(YangLei)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 新增任务完成
parent
cd74de78
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
407 additions
and
22 deletions
+407
-22
src/api/index.js
src/api/index.js
+1
-0
src/api/xunjian.js
src/api/xunjian.js
+32
-0
src/components/MySelect/search_select.vue
src/components/MySelect/search_select.vue
+54
-0
src/components/MySelect/url_select.vue
src/components/MySelect/url_select.vue
+52
-0
src/components/table/table.vue
src/components/table/table.vue
+30
-13
src/components/table/wraper.vue
src/components/table/wraper.vue
+11
-2
src/pages/xunjian/task_managment/center/common/index.js
src/pages/xunjian/task_managment/center/common/index.js
+17
-0
src/pages/xunjian/task_managment/center/form.vue
src/pages/xunjian/task_managment/center/form.vue
+98
-1
src/pages/xunjian/task_managment/center/index.vue
src/pages/xunjian/task_managment/center/index.vue
+99
-4
src/utils/index.js
src/utils/index.js
+13
-2
No files found.
src/api/index.js
View file @
f07dc0ad
...
@@ -2,6 +2,7 @@ import { request, METHOD, formatObj } from '@/utils';
...
@@ -2,6 +2,7 @@ import { request, METHOD, formatObj } from '@/utils';
export
*
from
'
./menu
'
;
export
*
from
'
./menu
'
;
export
*
from
'
./system
'
;
export
*
from
'
./system
'
;
export
*
from
'
./task
'
;
export
*
from
'
./task
'
;
export
*
from
'
./xunjian
'
;
export
function
getUserDetailInfoApi
()
{
export
function
getUserDetailInfoApi
()
{
return
request
(
'
/api/v1/detail
'
,
METHOD
.
GET
);
return
request
(
'
/api/v1/detail
'
,
METHOD
.
GET
);
...
...
src/api/xunjian.js
0 → 100644
View file @
f07dc0ad
import
{
getReq
,
postReq
}
from
'
@/utils/requestUtil
'
;
import
langUtils
from
'
@/utils/langUtils
'
;
export
function
getXunJianDownloadUrlApi
(
idList
)
{
return
getReq
(
'
/ranger/inspection/api/v1/jobs/export
'
,
{
jobIdList
:
idList
.
join
(
'
,
'
)
});
}
export
function
getAreaListDataApi
()
{
return
getReq
(
`/ranger/inspection/api/v1/region/list`
);
}
export
function
getBusinessListApi
()
{
return
getReq
(
`/api/v1/parameters/business/list?paramModule=rpis_route_schedule¶mCode=inspection_state¶mLocale=
${
langUtils
.
get
()}
`
,
);
}
export
function
getBanZuListApi
()
{
return
getReq
(
`/api/v1/parameters/business/list?paramModule=rpis_route_schedule¶mCode=shift_type¶mLocale=
${
langUtils
.
get
()}
`
,
);
}
export
function
getTaskTypeApi
()
{
return
getReq
(
`/api/v1/parameters/business/list?paramModule=rpis_route_schedule¶mCode=job_type¶mLocale=
${
langUtils
.
get
()}
`
,
);
}
export
function
addXunJianTaskApi
(
data
)
{
return
postReq
(
'
/ranger/inspection/api/v1/jobs/temporary
'
,
data
);
}
src/components/MySelect/search_select.vue
0 → 100644
View file @
f07dc0ad
<
template
>
<a-select
show-search
placeholder=
"input search text"
:default-active-first-option=
"false"
:show-arrow=
"false"
:filter-option=
"false"
@
search=
"handleSearch"
allowClear
:options=
"options"
:mode=
"mode"
v-on=
"$listeners"
/>
</
template
>
<
script
>
import
{
getReq
}
from
'
@/utils/requestUtil
'
;
import
{
formatObj
}
from
'
@/utils
'
;
export
default
{
props
:
{
url
:
String
,
searchField
:
String
,
formatData
:
Object
,
mode
:
String
,
},
model
:
{
prop
:
'
value
'
,
event
:
'
change
'
,
},
data
()
{
return
{
options
:
[],
};
},
mounted
()
{
this
.
getData
(
''
);
},
methods
:
{
async
getData
(
searchString
)
{
this
.
options
=
formatObj
(
await
getReq
(
this
.
url
,
{
[
this
.
searchField
]:
searchString
}),
this
.
formatData
,
);
},
handleSearch
(
value
)
{
if
(
this
.
timeOut
)
clearTimeout
(
this
.
timeOut
);
this
.
timeOut
=
setTimeout
(()
=>
{
if
(
value
)
this
.
getData
(
value
);
},
300
);
},
},
};
</
script
>
src/components/MySelect/url_select.vue
0 → 100644
View file @
f07dc0ad
<
template
>
<a-select
style=
"width: 100%"
:dropdown-style=
"
{ maxHeight: '400px', overflow: 'auto' }"
placeholder="Please select"
allow-clear
:options="options"
v-on="$listeners"
v-bind="$attrs"
/>
</
template
>
<
script
>
import
{
getReq
}
from
'
@/utils/requestUtil
'
;
import
{
formatObj
}
from
'
@/utils
'
;
export
default
{
props
:
{
url
:
String
,
labelFiled
:
String
,
valueFiled
:
String
,
},
data
:
()
=>
({
options
:
[],
}),
model
:
{
prop
:
'
value
'
,
event
:
'
change
'
,
},
watch
:
{
url
:
'
getData
'
,
},
methods
:
{
async
getData
()
{
if
(
this
.
url
)
{
this
.
options
=
formatObj
(
await
getReq
(
this
.
url
),
{
label
:
this
.
labelFiled
,
value
:
this
.
valueFiled
,
key
:
this
.
valueFiled
,
});
}
},
},
mounted
()
{
this
.
getData
();
},
};
</
script
>
src/components/table/table.vue
View file @
f07dc0ad
<
template
>
<
template
>
<div>
<div>
<my-card
v-if=
"$scopedSlots.search"
>
<my-card
v-if=
"$scopedSlots.search"
class=
"tw-mb-2.5"
>
<a-form-model
:model=
"queryForm"
layout=
"horizontal"
>
<a-form-model
:model=
"queryForm"
layout=
"horizontal"
>
<a-row
:gutter=
"16"
>
<a-row
:gutter=
"16"
>
<slot
name=
"search"
:query=
"queryForm"
/>
<slot
name=
"search"
:query=
"queryForm"
/>
...
@@ -9,13 +9,6 @@
...
@@ -9,13 +9,6 @@
<div
class=
"tw-text-right tw-mt-2"
>
<div
class=
"tw-text-right tw-mt-2"
>
<a-space>
<a-space>
<a-popover
title=
"Title"
>
<template
slot=
"content"
>
<p>
Content
</p>
<p>
Content
</p>
</
template
>
<a-button>
高级查询
</a-button>
</a-popover>
<a-button
@
click=
"reset"
>
重置
</a-button>
<a-button
@
click=
"reset"
>
重置
</a-button>
<a-button
type=
"primary"
@
click=
"getData"
>
查询
</a-button>
<a-button
type=
"primary"
@
click=
"getData"
>
查询
</a-button>
</a-space>
</a-space>
...
@@ -23,9 +16,9 @@
...
@@ -23,9 +16,9 @@
</my-card>
</my-card>
<my-card>
<my-card>
<a-space
:class=
"{ 'tw-mb-2.5': !!$scopedSlots.search }
"
>
<a-space
class=
"tw-mb-2
"
>
<a-button
type=
"primary"
v-if=
"
add
Btn"
@
click=
"addBtnClick"
>
<a-button
type=
"primary"
v-if=
"
new
Btn"
@
click=
"addBtnClick"
>
{{
typeof addBtn === 'object' ? addBtn.text :
'新增' }}
{{
newBtn
.
text
||
'
新增
'
}}
</a-button>
</a-button>
<slot
name=
"operation"
/>
<slot
name=
"operation"
/>
</a-space>
</a-space>
...
@@ -37,6 +30,7 @@
...
@@ -37,6 +30,7 @@
:rowKey=
"rowKey"
:rowKey=
"rowKey"
:pagination=
"pagination"
:pagination=
"pagination"
@
change=
"pageChange"
@
change=
"pageChange"
:row-selection=
"selected ? rowSelection : undefined"
>
>
<slot
/>
<slot
/>
<a-table-column
title=
"操作"
v-if=
"buttons"
>
<a-table-column
title=
"操作"
v-if=
"buttons"
>
...
@@ -56,8 +50,9 @@
...
@@ -56,8 +50,9 @@
:width=
"600"
:width=
"600"
@
close=
"hidden"
@
close=
"hidden"
:maskClosable=
"false"
:maskClosable=
"false"
:title=
"title"
>
>
<slot
name=
"drawer"
:hidden=
"hidden"
/>
<slot
name=
"drawer"
:hidden=
"hidden"
:refresh=
"getData"
/>
</a-drawer>
</a-drawer>
</div>
</div>
</template>
</template>
...
@@ -70,6 +65,8 @@ const initQuery = {
...
@@ -70,6 +65,8 @@ const initQuery = {
pageNum
:
1
,
pageNum
:
1
,
};
};
const
defaultTitle
=
'
新增
'
;
export
default
{
export
default
{
props
:
{
props
:
{
url
:
String
,
url
:
String
,
...
@@ -78,9 +75,11 @@ export default {
...
@@ -78,9 +75,11 @@ export default {
noPage
:
Boolean
,
noPage
:
Boolean
,
formatData
:
Function
,
formatData
:
Function
,
rowKey
:
[
String
,
Function
],
rowKey
:
[
String
,
Function
],
selected
:
Array
,
},
},
data
()
{
data
()
{
const
newBtn
=
this
.
addBtn
?
(
typeof
this
.
addBtn
===
'
object
'
?
this
.
addBtn
:
{})
:
this
.
addBtn
;
return
{
return
{
initQuery
:
{
initQuery
:
{
...
initQuery
,
...
initQuery
,
...
@@ -90,7 +89,7 @@ export default {
...
@@ -90,7 +89,7 @@ export default {
loading
:
false
,
loading
:
false
,
total
:
0
,
total
:
0
,
visible
:
false
,
visible
:
false
,
title
:
'
新增
'
,
title
:
newBtn
.
title
??
defaultTitle
,
drawerStyle
:
{
drawerStyle
:
{
display
:
'
flex
'
,
display
:
'
flex
'
,
flexDirection
:
'
column
'
,
flexDirection
:
'
column
'
,
...
@@ -108,6 +107,9 @@ export default {
...
@@ -108,6 +107,9 @@ export default {
},
},
computed
:
{
computed
:
{
newBtn
()
{
return
this
.
addBtn
?
(
typeof
this
.
addBtn
===
'
object
'
?
this
.
addBtn
:
{})
:
this
.
addBtn
;
},
pagination
()
{
pagination
()
{
return
this
.
noPage
return
this
.
noPage
?
false
?
false
...
@@ -118,6 +120,13 @@ export default {
...
@@ -118,6 +120,13 @@ export default {
showQuickJumper
:
true
,
showQuickJumper
:
true
,
};
};
},
},
rowSelection
()
{
return
{
onChange
:
(
selectedRowKeys
,
selectedRows
)
=>
{
this
.
$emit
(
'
update:selected
'
,
[
selectedRowKeys
,
selectedRows
]);
},
};
},
},
},
methods
:
{
methods
:
{
...
@@ -151,21 +160,29 @@ export default {
...
@@ -151,21 +160,29 @@ export default {
hidden
()
{
hidden
()
{
this
.
visible
=
false
;
this
.
visible
=
false
;
this
.
title
=
this
.
addBtn
?.
title
??
defaultTitle
;
},
},
show
({
title
}
=
{})
{
show
({
title
}
=
{})
{
this
.
visible
=
true
;
this
.
visible
=
true
;
if
(
title
)
this
.
title
=
title
;
if
(
title
)
this
.
title
=
title
;
},
},
reset
()
{
reset
()
{
this
.
queryForm
=
{};
this
.
queryForm
=
{};
this
.
initQuery
=
{
...
initQuery
};
this
.
initQuery
=
{
...
initQuery
};
this
.
getData
();
this
.
getData
();
},
},
addBtnClick
()
{
addBtnClick
()
{
const
{
click
}
=
typeof
this
.
addBtn
===
'
object
'
?
this
.
addBtn
:
{};
const
{
click
}
=
typeof
this
.
addBtn
===
'
object
'
?
this
.
addBtn
:
{};
click
&&
click
();
click
&&
click
();
this
.
visible
=
true
;
this
.
visible
=
true
;
},
},
getFormRef
(
ref
)
{
console
.
log
(
ref
);
},
},
},
};
};
</
script
>
</
script
>
src/components/table/wraper.vue
View file @
f07dc0ad
...
@@ -31,6 +31,10 @@ export default {
...
@@ -31,6 +31,10 @@ export default {
type
:
Function
,
type
:
Function
,
default
:
EMPTY_FUN
,
default
:
EMPTY_FUN
,
},
},
refresh
:
{
type
:
Function
,
default
:
EMPTY_FUN
,
},
},
},
data
:
()
=>
({
data
:
()
=>
({
loading
:
false
,
loading
:
false
,
...
@@ -43,9 +47,14 @@ export default {
...
@@ -43,9 +47,14 @@ export default {
async
ok
()
{
async
ok
()
{
this
.
loading
=
true
;
this
.
loading
=
true
;
try
{
await
this
.
onOk
();
await
this
.
onOk
();
this
.
loading
=
false
;
this
.
hidden
();
this
.
hidden
();
this
.
refresh
();
}
catch
(
error
)
{
// todo
}
this
.
loading
=
false
;
},
},
},
},
};
};
...
...
src/pages/xunjian/task_managment/center/common/index.js
0 → 100644
View file @
f07dc0ad
export
const
areaFormatData
=
{
label
:
'
regionName
'
,
value
:
'
regionId
'
,
key
:
'
regionId
'
,
};
export
const
statusFormtData
=
{
label
:
'
paramName
'
,
value
:
'
paramValue
'
,
key
:
'
paramValue
'
,
};
export
const
banZuFormatData
=
{
label
:
'
paramName
'
,
value
:
'
paramValue
'
,
key
:
'
paramValue
'
,
};
src/pages/xunjian/task_managment/center/form.vue
View file @
f07dc0ad
<
template
>
<
template
>
<h1>
新增
</h1>
<Wraper
:hidden=
"hidden"
:onOk=
"submit"
:refresh=
"refresh"
>
<a-form-model
layout=
"vertical"
:model=
"form"
:rules=
"rules"
ref=
"form"
>
<a-form-model-item
label=
"地区"
prop=
"regionId"
>
<RequestSelect
:request=
"getAreaListDataApi"
:formatData=
"areaFormatData"
v-model=
"form.regionId"
/>
</a-form-model-item>
<a-form-model-item
label=
"线路"
prop=
"routeId"
>
<UrlSelect
:url=
"xianLuUrl"
labelFiled=
"routeName"
valueFiled=
"routeId"
v-model=
"form.routeId"
/>
</a-form-model-item>
<a-form-model-item
label=
"班组"
prop=
"shiftType"
>
<RequestSelect
:request=
"getBanZuListApi"
:formatData=
"banZuFormatData"
v-model=
"form.shiftType"
/>
</a-form-model-item>
<a-form-model-item
label=
"任务时间"
prop=
"jobTime"
>
<a-date-picker
showTime
class=
"tw-w-full"
valueFormat=
"YYYY-MM-DD HH:mm:ss"
v-model=
"form.jobTime"
/>
</a-form-model-item>
<a-form-model-item
label=
"巡检人"
prop=
"inspectionIdList"
>
<SearchSelect
url=
"/api/v1/users/searching"
searchField=
"userName"
:formatData=
"formatXunJianRenData"
v-model=
"form.inspectionIdList"
mode=
"multiple"
/>
</a-form-model-item>
</a-form-model>
</Wraper>
</
template
>
</
template
>
<
script
>
import
Wraper
from
'
@/components/table/wraper.vue
'
;
import
RequestSelect
from
'
@/components/MySelect/RequestSelect.vue
'
;
import
SearchSelect
from
'
@/components/MySelect/search_select.vue
'
;
import
UrlSelect
from
'
@/components/MySelect/url_select.vue
'
;
import
{
getAreaListDataApi
,
getBanZuListApi
,
addXunJianTaskApi
}
from
'
@/api
'
;
import
{
areaFormatData
,
banZuFormatData
}
from
'
./common
'
;
export
default
{
props
:
{
hidden
:
Function
,
refresh
:
Function
,
},
components
:
{
Wraper
,
RequestSelect
,
SearchSelect
,
UrlSelect
},
data
()
{
return
{
getAreaListDataApi
,
banZuFormatData
,
getBanZuListApi
,
form
:
{},
rules
:
{
inspectionIdList
:
[{
required
:
true
}],
jobTime
:
[{
required
:
true
}],
shiftType
:
[{
required
:
true
}],
routeId
:
[{
required
:
true
}],
regionId
:
[{
required
:
true
}],
},
areaFormatData
,
formatXunJianRenData
:
{
value
:
'
userId
'
,
label
:
'
userName
'
,
key
:
'
userId
'
,
},
};
},
computed
:
{
xianLuUrl
()
{
return
this
.
form
.
regionId
?
`/ranger/inspection/api/v1/routes/regions/
${
this
.
form
.
regionId
}
/list`
:
''
;
},
},
methods
:
{
async
submit
()
{
await
this
.
$refs
.
form
.
validate
();
return
addXunJianTaskApi
(
this
.
form
);
},
},
};
</
script
>
src/pages/xunjian/task_managment/center/index.vue
View file @
f07dc0ad
<
template
>
<
template
>
<Table
url=
"/ranger/inspection/api/v1/jobs"
:buttons=
"buttons"
rowKey=
"jobId"
addBtn
>
<Table
url=
"/ranger/inspection/api/v1/jobs"
:buttons=
"buttons"
rowKey=
"jobId"
:addBtn=
"addBtn"
:selected.sync=
"selected"
>
<template
#search
="
{query}">
<template
#search
="
{query}">
<my-form-item
label=
"开始时间"
>
<my-form-item
label=
"开始时间"
>
<a-date-picker
<a-date-picker
...
@@ -9,10 +15,71 @@
...
@@ -9,10 +15,71 @@
valueFormat=
"YYYY-MM-DD HH:mm:ss"
valueFormat=
"YYYY-MM-DD HH:mm:ss"
/>
/>
</my-form-item>
</my-form-item>
<my-form-item
label=
"结束时间"
>
<a-date-picker
class=
"tw-w-full"
show-time
v-model=
"query.startTime"
valueFormat=
"YYYY-MM-DD HH:mm:ss"
/>
</my-form-item>
<my-form-item
label=
"地区"
>
<RequestSelect
:request=
"getAreaListDataApi"
:formatData=
"areaFormatData"
v-model=
"query.regionId"
/>
</my-form-item>
<my-form-item
label=
"专业"
>
<RequestSelect
:request=
"getAreaListDataApi"
:formatData=
"areaFormatData"
v-model=
"query.regionId"
/>
</my-form-item>
<my-form-item
label=
"线路"
>
<RequestSelect
:request=
"getAreaListDataApi"
:formatData=
"areaFormatData"
v-model=
"query.regionId"
/>
</my-form-item>
<my-form-item
label=
"班组"
>
<RequestSelect
:request=
"getBanZuListApi"
:formatData=
"banZuFormatData"
v-model=
"query.shiftType"
/>
</my-form-item>
<my-form-item
label=
"巡检状态"
>
<RequestSelect
:request=
"getBusinessListApi"
:formatData=
"statusFormtData"
v-model=
"query.inspectionState"
/>
</my-form-item>
<my-form-item
label=
"任务类型"
>
<RequestSelect
:request=
"getTaskTypeApi"
:formatData=
"taskTypeFormatData"
v-model=
"query.jobType"
/>
</my-form-item>
<my-form-item
label=
"巡检人"
>
<RequestSelect
:request=
"getBusinessListApi"
:formatData=
"statusFormtData"
v-model=
"query.lastInspectionStaffId"
/>
</my-form-item>
</
template
>
</
template
>
<
template
#drawer=
"hidden"
>
<
template
#operation
>
<Form
:hidden=
"hidden"
/>
<a-button
@
click=
"download"
>
导出
</a-button>
</
template
>
<
template
#drawer=
"drawer"
>
<Form
v-bind=
"drawer"
/>
</
template
>
</
template
>
<a-table-column
title=
"线路名称"
data-index=
"routeName"
/>
<a-table-column
title=
"线路名称"
data-index=
"routeName"
/>
...
@@ -31,11 +98,24 @@
...
@@ -31,11 +98,24 @@
<
script
>
<
script
>
import
Table
from
'
@/components/table/table.vue
'
;
import
Table
from
'
@/components/table/table.vue
'
;
import
Form
from
'
./form.vue
'
;
import
Form
from
'
./form.vue
'
;
import
{
getXunJianDownloadUrlApi
}
from
'
@/api
'
;
import
{
downloadFileByUrl
}
from
'
@/utils
'
;
import
RequestSelect
from
'
@/components/MySelect/RequestSelect.vue
'
;
import
{
getAreaListDataApi
,
getBusinessListApi
,
getBanZuListApi
,
getTaskTypeApi
}
from
'
@/api
'
;
import
{
areaFormatData
,
statusFormtData
,
banZuFormatData
}
from
'
./common
'
;
export
default
{
export
default
{
components
:
{
Table
,
Form
},
components
:
{
Table
,
Form
,
RequestSelect
},
data
()
{
data
()
{
return
{
return
{
getAreaListDataApi
,
getBusinessListApi
,
getBanZuListApi
,
banZuFormatData
,
getTaskTypeApi
,
addBtn
:
{
title
:
'
新建临时任务
'
,
},
buttons
:
[
buttons
:
[
{
{
label
:
'
详情
'
,
label
:
'
详情
'
,
...
@@ -43,7 +123,22 @@ export default {
...
@@ -43,7 +123,22 @@ export default {
{
label
:
'
进度
'
},
{
label
:
'
进度
'
},
{
type
:
'
confirm
'
},
{
type
:
'
confirm
'
},
],
],
selected
:
[],
areaFormatData
,
statusFormtData
,
taskTypeFormatData
:
{
label
:
'
paramName
'
,
value
:
'
paramValue
'
,
key
:
'
paramValue
'
,
},
};
};
},
},
methods
:
{
async
download
()
{
if
(
!
this
.
selected
.
length
)
return
this
.
$message
.
error
(
'
请选择需要导出的数据
'
);
const
url
=
await
getXunJianDownloadUrlApi
(
this
.
selected
[
0
]);
downloadFileByUrl
(
`
${
this
.
$fileUrl
}${
url
}
`
);
},
},
};
};
</
script
>
</
script
>
src/utils/index.js
View file @
f07dc0ad
...
@@ -114,9 +114,9 @@ export function arrayToTree(options) {
...
@@ -114,9 +114,9 @@ export function arrayToTree(options) {
}
}
// select组件 数据格式化
// select组件 数据格式化
export
const
formatObj
=
async
(
ArrObj
,
obj
)
=>
{
export
const
formatObj
=
(
ArrObj
,
obj
)
=>
{
const
newData
=
[...
ArrObj
];
const
newData
=
[...
ArrObj
];
const
newDataOne
=
await
newData
.
map
(
i
=>
{
const
newDataOne
=
newData
.
map
(
i
=>
{
const
newObj
=
{
...
i
};
const
newObj
=
{
...
i
};
Object
.
keys
(
obj
).
forEach
(
key
=>
{
Object
.
keys
(
obj
).
forEach
(
key
=>
{
newObj
[
key
]
=
i
[
obj
[
key
]];
newObj
[
key
]
=
i
[
obj
[
key
]];
...
@@ -125,3 +125,14 @@ export const formatObj = async (ArrObj, obj) => {
...
@@ -125,3 +125,14 @@ export const formatObj = async (ArrObj, obj) => {
});
});
return
newDataOne
;
return
newDataOne
;
};
};
/**
* 下载文件
* @param {String} url 下载路径
*/
export
function
downloadFileByUrl
(
url
)
{
const
aEle
=
document
.
createElement
(
'
a
'
);
aEle
.
setAttribute
(
'
download
'
,
true
);
aEle
.
setAttribute
(
'
href
'
,
url
);
aEle
.
click
();
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment