Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
schedule
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fengzhaoyu
schedule
Commits
bdb33035
Commit
bdb33035
authored
Mar 31, 2020
by
xiexiaoqin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
对接口
parent
bb81785e
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
244 additions
and
290 deletions
+244
-290
fileList.acss
components/fileList/fileList.acss
+22
-2
fileList.axml
components/fileList/fileList.axml
+20
-13
fileList.js
components/fileList/fileList.js
+47
-15
taskPanel.js
components/taskPanel/taskPanel.js
+16
-16
meetingDetail.acss
pages/meetingDetail/meetingDetail.acss
+3
-3
meetingDetail.axml
pages/meetingDetail/meetingDetail.axml
+3
-6
meetingDetail.js
pages/meetingDetail/meetingDetail.js
+30
-12
meetingDetail.json
pages/meetingDetail/meetingDetail.json
+0
-3
store.js
pages/meetingDetail/store.js
+8
-3
uploadFile.acss
pages/uploadFile/uploadFile.acss
+16
-116
uploadFile.axml
pages/uploadFile/uploadFile.axml
+5
-21
uploadFile.js
pages/uploadFile/uploadFile.js
+68
-78
uploadFile.json
pages/uploadFile/uploadFile.json
+6
-2
No files found.
components/fileList/fileList.acss
View file @
bdb33035
.desc {
color: rgba(10, 10, 10, 1);
font-size: 32rpx;
line-height: 48rpx;
margin-top: 10rpx;
}
.task-list {
border: 1rpx solid rgba(245, 246, 247, 1);
border-radius: 16rpx;
...
...
@@ -13,6 +20,10 @@
height: 64rpx;
}
.file-box-close {
padding-right: 70rpx;
}
.file-box>.file-icon {
position: absolute;
width: 50rpx;
...
...
@@ -29,6 +40,14 @@
line-height: 38rpx;
}
.file-box>.iconfont {
font-size: 40rpx;
color: rgba(25, 31, 37, 0.4);
position: absolute;
right: 0;
top: 10rpx;
}
.file-box>.file-title>text:first-child {
text-overflow: ellipsis;
overflow: hidden;
...
...
@@ -46,7 +65,8 @@
}
.file-box-mask {
background: rgba(25, 31, 37, 0.12)
background: rgba(10, 10, 10, 0.04);
position: relative;
}
.btns-pop {
...
...
@@ -75,7 +95,7 @@
.btns-pop .triangle {
position: absolute;
bottom: -
28
rpx;
bottom: -
31
rpx;
width: 0;
left: 50%;
margin-left: -16rpx;
...
...
components/fileList/fileList.axml
View file @
bdb33035
<view class="task-list">
<view class="file-box {{show ? 'file-box-mask' : ''}}" a:for="{{fileList}}" data-data="{{item}}" onTap="preview" onLongTap="showOperate">
<view class="file-icon {{item.fileType}}"></view>
<view class="file-title">
<text>{{item.fileName.slice(0, item.fileName.length - 5)}}</text>
<text>{{item.fileName.slice(-5)}}</text></view>
<view class="file-size">{{(item.fileSize/1024/1024).toFixed(2)}}KB</view>
<view class="btns-pop" a:if="{{show}}">
<view class="edit" catchTap="updateFile" data-file="{{item}}">
<view class="{{fileView.logId == logId ? 'file-box-mask' : ''}}" data-logId="{{fileView.logId}}" catchLongTap="showOperate">
<view class="desc" meeta:if='{{fileView.description}}'>
{{fileView.description}}
</view>
<view class="task-list" a:if="{{fileView.fileInfos && fileView.fileInfos.length > 0}}">
<view class="file-box {{isCanDelete ? 'file-box-close': ''}}" a:for="{{ fileView.fileInfos}}" onTap="preview" data-file="{{item}}">
<view class="file-icon {{item.fileType}}"></view>
<view class="file-title">
<text>{{item.fileName.slice(0, item.fileName.length - 5)}}</text>
<text>{{item.fileName.slice(-5)}}</text></view>
<view class="file-size">{{(item.fileSize/1024/1024).toFixed(2)}}KB</view>
<view a:if="{{isCanDelete}}" class="iconfont iconicon_noAgreed1" catchTap="removeFile" data-id="{{item.fileId}}"></view>
</view>
</view>
<view class="btns-pop" a:if="{{fileView.logId == logId}}">
<view class="edit" catchTap="updateFile" data-fileView="{{fileView}}">
编辑
</view>
<view catchTap="deleteFile" data-file="{{item
}}">
</view>
<view catchTap="deleteFile" data-id="{{fileView.id
}}">
删除
</view>
<view class="triangle"></view>
</view>
<view class="triangle"></view>
</view>
</view>
\ No newline at end of file
components/fileList/fileList.js
View file @
bdb33035
Component
({
import
create
from
'dd-store'
;
import
pageStore
from
'../../pages/meetingDetail/store'
;
import
{
previewPermissions
}
from
'../../api/request.js'
create
.
Component
({
store
:
pageStore
,
mixins
:
[],
data
:
{
show
:
fals
e
logId
:
''
//stor
e
},
props
:
{
isCanEdit
:
true
isCanEdit
:
true
,
isCanDelete
:
false
},
didMount
()
{
},
...
...
@@ -13,21 +19,41 @@ Component({
},
didUnmount
()
{
},
methods
:
{
//移除文件
removeFile
(
e
)
{
const
fileInfos
=
this
.
store
.
data
.
fileInfos
.
filter
(
it
=>
it
.
fileId
!==
e
.
target
.
dataset
.
id
);
this
.
store
.
data
.
fileInfos
=
fileInfos
;
this
.
update
();
},
//预览文件
preview
(
e
)
{
dd
.
previewFileInDingTalk
({
corpId
:
dd
.
corpId
,
...
e
.
target
.
dataset
.
file
const
file
=
e
.
target
.
dataset
.
file
const
data
=
{
ddUserId
:
getApp
().
globalData
.
userid
,
type
:
'download'
,
fileIds
:
file
.
fileId
,
projectName
:
'MING_MEETING'
}
previewPermissions
(
data
).
then
(
res
=>
{
dd
.
previewFileInDingTalk
({
corpId
:
dd
.
corpId
,
spaceId
:
res
.
data
.
data
,
fileId
:
file
.
fileId
,
fileName
:
file
.
fileName
,
fileSize
:
file
.
fileSize
,
fileType
:
file
.
fileType
})
})
},
showOperate
()
{
//显示操作框
showOperate
(
e
)
{
if
(
this
.
props
.
isCanEdit
)
{
this
.
setData
({
show
:
true
})
this
.
store
.
data
.
logId
=
e
.
target
.
dataset
.
logId
;
this
.
update
();
}
},
//删除动态下的文件和描述
deleteFile
(
e
)
{
// let data = event.target.dataset.file.id
dd
.
confirm
({
title
:
'删除文件'
,
content
:
'确认删除文件吗?'
,
...
...
@@ -35,16 +61,22 @@ Component({
cancelButtonText
:
'取消'
,
success
:
(
res
)
=>
{
if
(
res
.
confirm
)
{
this
.
props
.
deleteTaskFile
(
)
this
.
props
.
onDeleteMeetingFile
(
e
.
target
.
dataset
.
id
)
}
}
})
},
//去编辑文件页面
updateFile
(
e
)
{
this
.
setData
({
show
:
false
})
dd
.
navigateTo
({
url
:
`./../editFile/editFile?file=
${
JSON
.
stringify
(
e
.
target
.
dataset
.
file
)}
`
})
logId
:
''
});
const
{
fileInfos
,
description
}
=
e
.
target
.
dataset
.
fileView
;
this
.
store
.
data
.
oldFileInfos
=
JSON
.
stringify
(
fileInfos
);
this
.
store
.
data
.
oldDescription
=
description
;
this
.
store
.
data
.
fileInfos
=
fileInfos
;
this
.
store
.
data
.
description
=
e
.
target
.
dataset
.
fileView
.
description
;
dd
.
navigateTo
({
url
:
`./../uploadFile/uploadFile?action=update`
})
}
},
});
components/taskPanel/taskPanel.js
View file @
bdb33035
...
...
@@ -30,27 +30,27 @@ create.Component({
// this.props.onCheckChange({ status, id });
},
inputChange
(
e
)
{
const
value
=
e
.
detail
.
value
;
if
(
value
)
{
this
.
store
.
data
.
currentTask
.
taskInfos
=
{
taskTitle
:
value
};
this
.
update
();
}
},
// inputChange: debounce(function (e) {
// inputChange(e) {
// const value = e.detail.value;
// if (value) {
// this.store.data.currentTask.taskInfos = { taskTitle: value };
// this.update();
// //更新要调用更新接口
// // if (this.props.action === 'update') {
// // if (value !== this.props.oldTask.taskInfos.taskTitle) {
// // this.store.data.isEditTaskTitle = true;
// // // this.props.onInputChange(value);
// // }
// // }
// }
// }, 1000),
// },
inputChange
:
debounce
(
function
(
e
)
{
const
value
=
e
.
detail
.
value
;
if
(
value
)
{
this
.
store
.
data
.
currentTask
.
taskInfos
=
{
taskTitle
:
value
};
this
.
update
();
//更新要调用更新接口
// if (this.props.action === 'update') {
// if (value !== this.props.oldTask.taskInfos.taskTitle) {
// this.store.data.isEditTaskTitle = true;
// // this.props.onInputChange(value);
// }
// }
}
},
1000
),
handleExcutorChange
(
e
)
{
//执行人页面删除执行人
if
(
e
.
target
.
dataset
.
acceptorId
)
{
...
...
pages/meetingDetail/meetingDetail.acss
View file @
bdb33035
...
...
@@ -22,12 +22,12 @@ page {
padding-left: 104rpx;
}
.compose-column .desc {
color: rgba(
25, 31, 37
, 1);
/*
.compose-column .desc {
color: rgba(
10, 10, 10
, 1);
font-size: 32rpx;
line-height: 48rpx;
margin-top: 10rpx;
}
}
*/
.compose-column>.avater {
width: 80rpx;
...
...
pages/meetingDetail/meetingDetail.axml
View file @
bdb33035
<import src="../../template/avater/index.axml"/>
<view class="list">
<view class="list"
onTap="hideFileOperate"
>
<block a:for="{{affairList}}">
<view a:if="{{item.category == '3' && item.taskViewList}}" class='compose-column'>
<view class="avater task-avater">
...
...
@@ -11,16 +11,13 @@
</view>
<task-list onShowPop="showPop" onSetCurrentTask="setCurrentTask" taskList="{{item.taskViewList}}" onChangeTaskStatusOnList="changeTaskStatusOnList"/>
</view>
<view a:if="{{item.
logType == '2' && item.fileView.fileInfos
}}" class='compose-column'>
<view a:if="{{item.
category == '2' && item.fileView && item.fileView.fileInfos && item.fileView.fileInfos.length > 0
}}" class='compose-column'>
<template is="avater" data="{{item: item.fileView.creatorInfo}}"/>
<view class="title">
{{item.fileView.creatorInfo.username}}
<text>{{item.createTime}}</text>
</view>
<view class="desc">
{{item.description}}
</view>
<file-list fileList="{{item.fileInfos}}" onReload="reload"/>
<file-list fileView="{{item.fileView}}" onDeleteMeetingFile="deleteMeetingFile"/>
</view>
<view a:if="{{item.content}}" class='simple-column'>{{item.content}}{{item.createTime}}</view>
</block>
...
...
pages/meetingDetail/meetingDetail.js
View file @
bdb33035
...
...
@@ -13,6 +13,17 @@ create.Page({
type
:
''
}
},
onShow
()
{
dd
.
alert
({
content
:
'onshow'
})
if
(
this
.
store
.
data
.
isNeedReloadList
)
{
dd
.
alert
({
content
:
'reload'
})
this
.
reload
(
this
.
data
.
scheduleItem
.
id
);
}
},
onLoad
(
query
)
{
this
.
setData
({
scheduleItem
:
JSON
.
parse
(
query
.
scheduleItem
),
...
...
@@ -71,6 +82,10 @@ create.Page({
// this.$store.$data.participatorUserId = participatorUserId
// this.$store.update();
// this.conflictPeople()
this
.
store
.
data
.
scheduleId
=
res
.
data
.
data
.
id
;
this
.
store
.
data
.
groupId
=
res
.
data
.
data
.
groupId
;
this
.
update
();
this
.
reload
(
this
.
data
.
scheduleItem
.
id
);
}
})
...
...
@@ -80,7 +95,7 @@ create.Page({
getMeetingRoomAffairs
(
id
).
then
(
res
=>
{
const
affairList
=
res
.
data
.
data
;
const
newAffairList
=
affairList
.
map
(
it
=>
{
if
(
it
.
logType
==
'2'
)
{
if
(
it
.
category
==
'2'
&&
it
.
fileView
)
{
if
(
it
.
fileView
.
creatorInfo
)
{
it
.
fileView
.
creatorInfo
=
JSON
.
parse
(
it
.
fileView
.
creatorInfo
);
}
...
...
@@ -176,10 +191,6 @@ create.Page({
},
// 添加文件
addMeetingFile
()
{
decodeURI
.
navagac
},
// 文件上传
addMeetingFile
()
{
let
data
=
{
ddUserId
:
getApp
().
globalData
.
userid
,
type
:
'add'
,
...
...
@@ -187,13 +198,13 @@ create.Page({
}
uploadPermissions
(
data
).
then
(
res
=>
{
if
(
res
.
data
.
code
===
0
)
{
const
_that
=
this
dd
.
uploadAttachmentToDingTalk
({
image
:
{
multiple
:
true
,
compress
:
true
,
max
:
9
,
spaceId
:
res
.
data
.
data
},
space
:
{
spaceId
:
res
.
data
.
data
,
compress
:
true
,
isCopy
:
1
,
max
:
9
},
types
:
[
"photo"
,
"camera"
,
"space"
],
success
:
(
res
)
=>
{
dd
.
navigateTo
({
url
:
`./../uploadFile/uploadFile?scheduleItem=
${
JSON
.
stringify
(
_that
.
data
.
scheduleItem
)}
&upLoadInfo=
${
encodeURIComponent
(
JSON
.
stringify
(
res
))}
`
})
this
.
store
.
data
.
fileInfos
=
res
.
data
;
dd
.
navigateTo
({
url
:
`./../uploadFile/uploadFile`
})
},
fail
:
(
err
)
=>
{
}
...
...
@@ -201,13 +212,20 @@ create.Page({
}
})
},
// 修改文件描述
updateMeetingFile
()
{
//隐藏文件操作浮窗
hideFileOperate
()
{
this
.
store
.
data
.
logId
=
''
;
this
.
update
();
},
// 删除文件
deleteMeetingFile
()
{
deleteMeetingFile
(
id
)
{
this
.
updateTask
({
"logType"
:
"schedule_accessory_remove"
,
"resourceType"
:
"accessory"
,
"id"
:
id
},
()
=>
{
this
.
reload
(
this
.
data
.
scheduleItem
.
id
);
})
},
// 删除执行人
deleteTaskExcutor
()
{
...
...
pages/meetingDetail/meetingDetail.json
View file @
bdb33035
{
"window"
:
{
"title"
:
"会议详情"
},
"usingComponents"
:
{
"popup"
:
"../../components/popup/index"
,
"task-list"
:
"../../components/taskList/taskList"
,
...
...
pages/meetingDetail/store.js
View file @
bdb33035
...
...
@@ -8,10 +8,14 @@ class Store {
taskStatus
:
''
,
taskInfos
:
null
},
// isAddAcceptorInfo: false,
// isDeleteAcceptorInfo: false,
fileInfos
:
null
,
description
:
''
,
oldFileInfos
:
''
,
oldDescription
:
''
,
scheduleId
:
''
,
groupId
:
''
,
isNeedReloadList
:
false
,
// isEditTaskTitle: false
logId
:
''
}
}
export
default
new
Store
()
\ No newline at end of file
pages/uploadFile/uploadFile.acss
View file @
bdb33035
@import "../../assests/font/iconfont.acss";
page {
background: #fff;
font-family: PingFangSC-Regular;
font-size: 34rpx;
color: #191F25;
padding-bottom: 180rpx;
}
.describe {
padding:32rpx 32rpx 0 32rpx;
}
.textarea {
padding-left: 0!important;
display: block;
}
.fileList {
margin-top: 32rpx;
padding: 0 32rpx;
display: flex;
justify-content: space-between;
}
.file {
background: #F6F7F8;
border-radius: 2rpx;
width: 634rpx;
height: 88rpx;
line-height: 88rpx;
display: flex;
overflow: hidden;
}
.fileimage {
flex: 0 0 58rpx;
width: 60rpx;
height: 72rpx;
background: url(../../assests/all.png) center /100% 100%;
margin: 8rpx 16rpx 8rpx 8rpx;
}
.fileName {
font-size: 26rpx;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.close {
line-height: 88rpx;
font-size: 30rpx;
color: rgba(25, 31, 37, 0.40);
text-align: right;
.uploadFile {
padding: 48rpx 48rpx 136rpx 48rpx;
box-sizing: border-box;
}
.add {
padding: 0 32rpx;
margin-top: 40rpx;
height: 32rpx;
line-height: 32rpx;
}
.icontianjia1 {
height: 100%;
display: inline-block;
vertical-align: middle;
line-height: 30rpx;
color: #3296fa;
margin-right: 16rpx;
.textarea {
padding: 0;
display: block;
margin-bottom: 32rpx;
}
.addText {
height: 32rpx;
line-height: 32rpx;
font-size: 28rpx;
color: #3296FA;
}
.save {
padding: 24rpx 34rpx;
position: fixed;
bottom: 0;
padding-left: 24rpx;
margin-top: 32rpx;
}
.saveButton {
font-size: 36rpx;
width: 686rpx;
line-height: 90rpx;
position: fixed;
bottom: 32rpx;
left: 0.32rem;
font-size: 32rpx;
width: calc(100% - 72rpx);
line-height: 72rpx;
text-align: center;
color: #fff;
background: #3296FA;
border: 1rpx solid rgba(25, 31, 37, 0.12);
background: rgba(234, 12, 40, 1);
border-radius: 48rpx;
}
.pdf {
background: url(../../assests/pdf.png) center /100% 100%;
}
.image {
background: url(../../assests/image.png) center /100% 100%;
}
.docx {
background: url(../../assests/docx.png) center /100% 100%;
}
.mov {
background: url(../../assests/mp4.png) center /100% 100%;
}
.mp4 {
background: url(../../assests/mp4.png) center /100% 100%;
}
.ppt {
background: url(../../assests/ppt.png) center /100% 100%;
}
.pptx {
background: url(../../assests/ppt.png) center /100% 100%;
}
.pdf {
background: url(../../assests/pdf.png) center /100% 100%;
}
.xlsx {
background: url(../../assests/xlsx.png) center /100% 100%;
}
.zip {
background: url(../../assests/zip.png) center /100% 100%;
}
\ No newline at end of file
pages/uploadFile/uploadFile.axml
View file @
bdb33035
<view class="uploadFile">
<view class="describe">
<textarea
class="textarea" onInput="inputDes
" placeholder="添加文件描述..." maxlength="-1" />
<textarea
value="{{description}}" class="textarea" onInput="inputChange
" placeholder="添加文件描述..." maxlength="-1" />
</view>
<view class="fileList" a:for="{{upLoadInfo.data}}" onTap="preview" data-file="{{item}}">
<view class="file">
<view class="fileimage {{item.fileType==('png' || 'PNG'|| 'jpg' || 'svg' || 'jpeg' || 'JPG') ?'image': item.fileType}}">
</view>
<view class="fileName">
{{item.fileName}}
</view>
</view>
<view class="close iconshanchu2 iconfont" data-item="{{item}}" onTap="close">
</view>
</view>
<view class="add" onTap="add">
<text class="icontianjia1 iconfont"></text>
<text class="addText">继续添加</text>
</view>
<view class="save">
<view class="saveButton" onTap="saveUpload">
<file-list fileView="{{{fileInfos: fileInfos}}}" isCanEdit="{{false}}" isCanDelete="{{true}}"/>
<view class="addText" onTap="{{add}}">继续添加</view>
</view>
<view class="saveButton" onTap="saveUpload">
保存
</view>
</view>
</view>
\ No newline at end of file
pages/uploadFile/uploadFile.js
View file @
bdb33035
import
create
from
'dd-store'
import
exampleStore
from
'/stores/exampleStore'
import
{
saveFileInfo
,
addSchedule
,
uploadPermissions
,
previewPermissions
}
from
'../../api/request.js'
import
{
throttle
}
from
'./../../utils/utils.js'
import
{
throttle
,
debounce
}
from
'./../../utils/utils.js'
import
pageStore
from
'../meetingDetail/store'
;
create
.
Page
({
store
:
exampleStore
,
useAll
:
true
,
store
:
pageStore
,
data
:
{
scheduleItem
:
''
,
upLoadInfo
:
''
,
descript
:
''
fileInfos
:
null
,
//store
description
:
''
,
//store
action
:
''
},
onLoad
(
event
)
{
let
scheduleItem
=
JSON
.
parse
(
event
.
scheduleItem
)
let
upLoadInfo
=
JSON
.
parse
(
decodeURIComponent
(
event
.
upLoadInfo
))
this
.
setData
({
scheduleItem
:
scheduleItem
,
upLoadInfo
:
upLoadInfo
})
onLoad
(
query
)
{
dd
.
setNavigationBar
({
title
:
'上传文件'
})
title
:
'添加会议文件'
});
// 编辑的时候传action=update
if
(
query
)
{
this
.
setData
({
action
:
query
.
action
});
dd
.
setNavigationBar
({
title
:
'编辑会议文件'
});
}
},
onShow
()
{
},
inputDes
(
event
)
{
let
value
=
event
.
detail
.
value
this
.
setData
({
descript
:
value
})
// inputDes(event) {
// let value = event.detail.value
// this.setData({
// description: value
// })
// },
inputChange
:
debounce
(
function
(
e
)
{
const
value
=
e
.
detail
.
value
;
if
(
value
)
{
this
.
store
.
data
.
description
=
value
;
this
.
update
();
}
},
1000
),
},
close
(
event
)
{
let
fileId
=
event
.
target
.
dataset
.
item
.
fileId
this
.
data
.
upLoadInfo
.
data
.
forEach
((
item
,
index
)
=>
{
if
(
item
.
fileId
==
fileId
)
{
this
.
data
.
upLoadInfo
.
data
.
splice
(
index
,
1
)
return
}
})
this
.
setData
({
upLoadInfo
:
this
.
data
.
upLoadInfo
})
},
add
()
{
le
t
data
=
{
cons
t
data
=
{
ddUserId
:
getApp
().
globalData
.
userid
,
type
:
'add'
,
projectName
:
'MING_MEETING'
...
...
@@ -56,10 +54,8 @@ create.Page({
space
:
{
spaceId
:
res
.
data
.
data
,
compress
:
true
,
isCopy
:
1
,
max
:
9
},
types
:
[
"photo"
,
"camera"
,
"space"
],
success
:
(
res
)
=>
{
_that
.
data
.
upLoadInfo
.
data
.
push
(...
res
.
data
)
_that
.
setData
({
upLoadInfo
:
_that
.
data
.
upLoadInfo
})
_that
.
store
.
data
.
fileInfos
.
push
(...
res
.
data
)
_that
.
update
();
},
fail
:
(
err
)
=>
{
}
...
...
@@ -67,53 +63,47 @@ create.Page({
}
})
},
// 文件预览
preview
(
event
)
{
const
_that
=
this
let
file
=
event
.
target
.
dataset
.
file
let
data
=
{
ddUserId
:
getApp
().
globalData
.
userid
,
type
:
'download'
,
fileIds
:
file
.
fileId
,
projectName
:
'MING_MEETING'
}
previewPermissions
(
data
).
then
(
res
=>
{
dd
.
previewFileInDingTalk
({
corpId
:
dd
.
corpId
,
spaceId
:
res
.
data
.
data
,
fileId
:
file
.
fileId
,
fileName
:
file
.
fileName
,
fileSize
:
file
.
fileSize
,
fileType
:
file
.
fileType
})
})
},
// 保存的接口
saveUpload
:
throttle
(
function
()
{
let
data
=
{
const
{
fileInfos
,
oldFileInfos
,
description
,
oldDescription
}
=
this
.
store
.
data
;
if
(
!
fileInfos
||
(
fileInfos
&&
fileInfos
.
length
==
0
))
{
dd
.
showToast
({
content
:
'请上传文件'
})
return
;
}
//如果实际没有修改,不生成记录
if
(
this
.
data
.
action
==
'update'
)
{
if
(
oldFileInfos
==
JSON
.
stringify
(
fileInfos
)
&&
description
==
oldDescription
)
{
return
dd
.
navigateBack
()
}
}
const
data
=
{
resourceType
:
'accessory'
,
creatorId
:
'2'
,
scheduleId
:
this
.
data
.
scheduleItem
.
id
,
creatorId
:
getApp
().
globalData
.
userid
,
category
:
'2'
,
scheduleId
:
this
.
store
.
data
.
scheduleId
,
groupId
:
this
.
store
.
data
.
groupId
,
uploader
:
getApp
().
globalData
.
userid
,
groupId
:
this
.
data
.
scheduleItem
.
groupId
,
creatorInfo
:
JSON
.
stringify
({
userId
:
getApp
().
globalData
.
userid
,
username
:
getApp
().
globalData
.
name
,
headUrl
:
getApp
().
globalData
.
avatar
,
platform
:
'dingtalk'
}),
creatorInfo
:
getApp
().
globalData
.
userInfo
,
thirdStoreTenant
:
'dingTalk'
,
fileInfos
:
JSON
.
stringify
(
this
.
data
.
upLoadInfo
.
data
),
description
:
this
.
data
.
descript
,
fileInfos
:
JSON
.
stringify
(
fileInfos
),
description
:
description
,
logType
:
'schedule_accessory_add'
}
if
(
this
.
data
.
action
==
'update'
)
{
data
.
logType
=
'schedule_accessory_modify'
;
}
saveFileInfo
(
data
).
then
(
res
=>
{
dd
.
alert
({
content
:
JSON
.
stringify
(
data
)
})
dd
.
navigateBack
({
delta
:
1
})
this
.
store
.
data
.
isNeedReloadList
=
true
;
this
.
update
();
dd
.
navigateBack
()
})
},
1000
)
});
pages/uploadFile/uploadFile.json
View file @
bdb33035
{}
\ No newline at end of file
{
"usingComponents"
:
{
"file-list"
:
"../../components/fileList/fileList"
}
}
\ No newline at end of file
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