Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
source-trace-manage-go
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Tracing
source-trace-manage-go
Commits
90846532
Commit
90846532
authored
May 07, 2021
by
zL
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交部分代码
parent
e5df757d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
10 deletions
+16
-10
Template.ts
src/plugins/Template.ts
+13
-9
editTemplate.vue
src/views/template/editTemplate.vue
+3
-1
No files found.
src/plugins/Template.ts
View file @
90846532
...
@@ -16,7 +16,7 @@ export function formatApiJson(local: Unit[]): RootUnitType[] {
...
@@ -16,7 +16,7 @@ export function formatApiJson(local: Unit[]): RootUnitType[] {
return
{
return
{
data
:
unit
.
children
.
map
((
item
)
=>
formatL2Local2Api
(
item
)),
data
:
unit
.
children
.
map
((
item
)
=>
formatL2Local2Api
(
item
)),
type
:
3
,
type
:
3
,
key
:
''
,
key
:
unit
.
title
,
label
:
unit
.
title
label
:
unit
.
title
};
};
});
});
...
@@ -28,8 +28,11 @@ export function formatApiJson(local: Unit[]): RootUnitType[] {
...
@@ -28,8 +28,11 @@ export function formatApiJson(local: Unit[]): RootUnitType[] {
*/
*/
function
formatL2Local2Api
(
localL2
:
Property
|
Unit
):
TemplateProperty
|
TmplSelectProperty
|
UnitProperty
{
function
formatL2Local2Api
(
localL2
:
Property
|
Unit
):
TemplateProperty
|
TmplSelectProperty
|
UnitProperty
{
if
(
localL2
instanceof
Property
)
{
if
(
localL2
instanceof
Property
)
{
return
formatProperty2Api
(
localL2
);
return
formatProperty2Api
(
localL2
);
}
else
{
}
else
{
console
.
log
(
1
);
const
children
=
localL2
.
children
as
Property
[];
const
children
=
localL2
.
children
as
Property
[];
return
{
return
{
key
:
''
,
key
:
''
,
...
@@ -45,7 +48,7 @@ function formatProperty2Api(property: Property): TemplateProperty | TmplSelectPr
...
@@ -45,7 +48,7 @@ function formatProperty2Api(property: Property): TemplateProperty | TmplSelectPr
if
(
property
.
type
===
PropertyType
.
Select
)
{
if
(
property
.
type
===
PropertyType
.
Select
)
{
return
{
return
{
key
:
property
.
key
,
key
:
property
.
label
,
type
:
PropertyType
.
Select
,
type
:
PropertyType
.
Select
,
label
:
property
.
label
,
label
:
property
.
label
,
options
:
property
.
options
,
options
:
property
.
options
,
...
@@ -69,7 +72,7 @@ function formatProperty2Api(property: Property): TemplateProperty | TmplSelectPr
...
@@ -69,7 +72,7 @@ function formatProperty2Api(property: Property): TemplateProperty | TmplSelectPr
data
=
{}
data
=
{}
}
}
return
{
return
{
key
:
property
.
key
,
key
:
property
.
label
,
type
:
(
property
.
type
as
PropertyType
.
Image
),
type
:
(
property
.
type
as
PropertyType
.
Image
),
data
:
data
,
data
:
data
,
label
:
property
.
label
label
:
property
.
label
...
@@ -88,7 +91,7 @@ function formatProperty2Api(property: Property): TemplateProperty | TmplSelectPr
...
@@ -88,7 +91,7 @@ function formatProperty2Api(property: Property): TemplateProperty | TmplSelectPr
data
=
{}
data
=
{}
}
}
return
{
return
{
key
:
property
.
key
,
key
:
property
.
label
,
type
:
(
property
.
type
as
PropertyType
.
File
),
type
:
(
property
.
type
as
PropertyType
.
File
),
data
:
data
,
data
:
data
,
label
:
property
.
label
label
:
property
.
label
...
@@ -102,7 +105,8 @@ function formatProperty2Api(property: Property): TemplateProperty | TmplSelectPr
...
@@ -102,7 +105,8 @@ function formatProperty2Api(property: Property): TemplateProperty | TmplSelectPr
value
:
property
.
value
value
:
property
.
value
},
},
type
:
PropertyType
.
Input
,
type
:
PropertyType
.
Input
,
key
:
property
.
parent
.
title
===
'ext'
?
property
.
label
:
property
.
key
,
// key: property.parent.title === 'ext' ? property.label : property.key,
key
:
property
.
label
,
label
:
property
.
label
label
:
property
.
label
};
};
}
else
if
(
property
.
type
===
PropertyType
.
Date
)
{
}
else
if
(
property
.
type
===
PropertyType
.
Date
)
{
...
@@ -113,7 +117,7 @@ function formatProperty2Api(property: Property): TemplateProperty | TmplSelectPr
...
@@ -113,7 +117,7 @@ function formatProperty2Api(property: Property): TemplateProperty | TmplSelectPr
value
:
property
.
value
value
:
property
.
value
},
},
type
:
PropertyType
.
Date
,
type
:
PropertyType
.
Date
,
key
:
property
.
key
,
key
:
property
.
label
,
label
:
property
.
label
label
:
property
.
label
};
};
...
@@ -131,7 +135,7 @@ function formatProperty2Api(property: Property): TemplateProperty | TmplSelectPr
...
@@ -131,7 +135,7 @@ function formatProperty2Api(property: Property): TemplateProperty | TmplSelectPr
data
=
{}
data
=
{}
}
}
return
{
return
{
key
:
property
.
key
,
key
:
property
.
label
,
type
:
(
property
.
type
as
PropertyType
.
Video
),
type
:
(
property
.
type
as
PropertyType
.
Video
),
data
:
data
,
data
:
data
,
label
:
property
.
label
label
:
property
.
label
...
@@ -151,7 +155,7 @@ function formatProperty2Api(property: Property): TemplateProperty | TmplSelectPr
...
@@ -151,7 +155,7 @@ function formatProperty2Api(property: Property): TemplateProperty | TmplSelectPr
data
=
{}
data
=
{}
}
}
return
{
return
{
key
:
property
.
key
,
key
:
property
.
label
,
type
:
(
property
.
type
as
PropertyType
.
Audio
),
type
:
(
property
.
type
as
PropertyType
.
Audio
),
data
:
data
,
data
:
data
,
label
:
property
.
label
label
:
property
.
label
...
@@ -166,7 +170,7 @@ function formatProperty2Api(property: Property): TemplateProperty | TmplSelectPr
...
@@ -166,7 +170,7 @@ function formatProperty2Api(property: Property): TemplateProperty | TmplSelectPr
value
:
property
.
value
value
:
property
.
value
},
},
type
:
(
property
.
type
as
PropertyType
.
Image
),
type
:
(
property
.
type
as
PropertyType
.
Image
),
key
:
property
.
key
,
key
:
property
.
label
,
label
:
property
.
label
label
:
property
.
label
};
};
}
}
...
...
src/views/template/editTemplate.vue
View file @
90846532
...
@@ -602,7 +602,9 @@ export default class editTemplate extends Vue {
...
@@ -602,7 +602,9 @@ export default class editTemplate extends Vue {
await
this
.
fileHandler
();
await
this
.
fileHandler
();
var
newDetail
=
new
Array
();
var
newDetail
=
new
Array
();
newDetail
=
formatApiJson
(
this
.
rootUnitList
);
newDetail
=
formatApiJson
(
this
.
rootUnitList
);
// console.log(newDetail);
// return
// return
// return
// 更新ext数据
// 更新ext数据
for
(
let
index
=
0
;
index
<
newDetail
.
length
;
index
++
)
{
for
(
let
index
=
0
;
index
<
newDetail
.
length
;
index
++
)
{
...
...
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