Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
taobao-mini-template
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
2
Issues
2
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
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
qinhaitao
taobao-mini-template
Commits
d08c088f
Commit
d08c088f
authored
Nov 20, 2020
by
zhaofei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
s
parent
56807772
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
40 deletions
+25
-40
task-config.axml
client/components/task/task-config/task-config.axml
+2
-6
task-config.js
client/components/task/task-config/task-config.js
+11
-22
task-config.json
client/components/task/task-config/task-config.json
+2
-3
validate.js
client/pages/activity/add/validate.js
+10
-9
No files found.
client/components/task/task-config/task-config.axml
View file @
d08c088f
<view class="url-task">
<button size="small" type="primary" text="{{true}}" onTap="onOpenDialog" >{{taskData.title || '编辑任务'}}</button>
<
!-- <
task-dialog
<task-dialog
visible="{{visible}}"
a:if="{{visible}}"
onClose="onClose"
onUpdate="onUpdate"
unit="{{unit}}"
frequency="{{frequency}}"
hasItems="{{hasItems}}"
hasLink="{{hasLink}}"
taskData="{{taskData}}"
/> -->
<input a:if="{{hasLink}}" style="width: 250px" onChange="onChange" data-name="link" defaultValue="{{link}}" name="link" placeholder="请输入跳转链接"/>
<items-config a:if="{{hasItems}}" itemIds="{{itemIds}}" onUpdate="onItemIdsChange"/>
/>
</view>
client/components/task/task-config/task-config.js
View file @
d08c088f
Component
({
mixins
:
[],
data
:
{
taskRateType
:
1
,
times
:
''
,
title
:
''
,
link
:
''
,
itemIds
:
''
,
value
:
''
visible
:
false
},
props
:
{
hasLink
:
false
,
unit
:
''
,
frequency
:
''
,
onUpdate
:
()
=>
{},
taskData
:
{
title
:
''
,
...
...
@@ -24,27 +18,22 @@ Component({
},
didMount
()
{
},
didUpdate
()
{
},
didUnmount
()
{
},
didUpdate
()
{},
didUnmount
()
{},
methods
:
{
onUpdate
()
{
const
{
onUpdate
,
dataName
,
type
}
=
this
.
props
;
let
taskData
=
{
...
this
.
props
.
taskData
,
...
this
.
data
,
type
};
onUpdate
&&
onUpdate
(
taskData
,
dataName
);
},
onChange
(
e
)
{
const
{
value
}
=
e
.
detail
;
const
{
name
}
=
e
.
target
.
dataset
;
onClose
()
{
this
.
setData
({
[
name
]:
valu
e
visible
:
fals
e
})
this
.
onUpdate
()
},
on
ItemIdsChange
(
ids
)
{
on
OpenDialog
(
)
{
this
.
setData
({
itemIds
:
ids
visible
:
true
})
this
.
onUpdate
()
},
onUpdate
(
taskData
)
{
const
{
onUpdate
,
dataName
}
=
this
.
props
;
onUpdate
&&
onUpdate
(
taskData
,
dataName
);
}
},
});
client/components/task/task-config/task-config.json
View file @
d08c088f
{
"component"
:
true
,
"usingComponents"
:
{
"task-dialog"
:
"/components/dialog/task-dialog/task-dialog"
,
"items-config"
:
"/components/task/items-config/items-config"
"task-dialog"
:
"/components/dialog/task-dialog/task-dialog"
}
}
client/pages/activity/add/validate.js
View file @
d08c088f
...
...
@@ -5,19 +5,20 @@ import { rankTableValidator, validateRangeNumber, rankTimeValidator, isNumber,va
export
const
descriptor
=
{
<%
for
(
var
i
=
0
;
i
<
configList
.
length
;
++
i
)
{
%>
<%-
configList
[
i
].
validator
?
configList
[
i
].
validator
+
','
:
''
%><%
}
%>
//
tasks: {
//
type: 'object',
//
required: false,
//
fields: {
//
<% for(var i = 0; i < configList.length; ++i) {%>
//
<%- taskKeys.includes(configList[i].key) && configList[i].validator ? configList[i].validator + ',' : '' %><% } %>
//
}
//
}
<%-
!
taskKeys
.
includes
(
configList
[
i
].
key
)
&&
configList
[
i
].
validator
?
configList
[
i
].
validator
+
','
:
''
%><%
}
%>
tasks
:
{
type
:
'object'
,
required
:
false
,
fields
:
{
<%
for
(
var
i
=
0
;
i
<
configList
.
length
;
++
i
)
{
%>
<%-
taskKeys
.
includes
(
configList
[
i
].
key
)
&&
configList
[
i
].
validator
?
configList
[
i
].
validator
+
','
:
''
%><%
}
%>
}
}
}
export
const
formatValidator
=
(
descriptor
,
validators
)
=>
{
validators
=
validators
||
{}
Object
.
keys
(
descriptor
).
forEach
(
key
=>
{
...
...
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