Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Z
zeroing-editor
Project
Project
Details
Activity
Releases
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
劳工
zeroing-editor
Commits
f832154c
Commit
f832154c
authored
Nov 26, 2019
by
rockyl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复复制项目失败的问题
parent
bf0e124f
Changes
12
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
61 additions
and
12 deletions
+61
-12
psd瘦身.jsx
psd瘦身.jsx
+18
-0
index.html
public/index.html
+1
-1
project.js
src/api/project.js
+1
-1
config.js
src/config.js
+2
-1
en.json
src/locales/en.json
+3
-0
zh-CN.json
src/locales/zh-CN.json
+5
-2
index.js
src/store/index.js
+1
-0
project.js
src/store/modules/project.js
+4
-0
Assets.vue
src/views/Editor/Assets.vue
+15
-4
Views.vue
src/views/Editor/Views.vue
+6
-1
DuplicateProjectDialog.vue
src/views/Home/DuplicateProjectDialog.vue
+3
-1
自动合并.jsx
自动合并.jsx
+2
-1
No files found.
psd瘦身.jsx
0 → 100644
View file @
f832154c
function
deleteDocumentAncestorsMetadata
()
{
whatApp
=
String
(
app
.
name
);
//String version of the app name
if
(
whatApp
.
search
(
"Photoshop"
)
>
0
)
{
//Check for photoshop specifically, or this will cause errors
//Function Scrubs Document Ancestors from Files
if
(
!
documents
.
length
)
{
alert
(
"There are no open documents. Please open a file to run this script."
)
return
;
}
if
(
ExternalObject
.
AdobeXMPScript
==
undefined
)
ExternalObject
.
AdobeXMPScript
=
new
ExternalObject
(
"lib:AdobeXMPScript"
);
var
xmp
=
new
XMPMeta
(
activeDocument
.
xmpMetadata
.
rawData
);
// Begone foul Document Ancestors!
xmp
.
deleteProperty
(
XMPConst
.
NS_PHOTOSHOP
,
"DocumentAncestors"
);
app
.
activeDocument
.
xmpMetadata
.
rawData
=
xmp
.
serialize
();
}
}
//Now run the function to remove the document ancestors
deleteDocumentAncestorsMetadata
();
\ No newline at end of file
public/index.html
View file @
f832154c
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
</noscript>
</noscript>
<script>
<script>
window
.
__data
=
{
window
.
__data
=
{
token
:
"<%= process.env.NODE_ENV === 'development' ? 'eyJhbGciOiJIUzI1Ni
J9.5Y2e6b6Z5Lqt.2fNMm0oJt0l0ZzsSYwo4ie8Bs7yLU9EmS2mtrmLPktY
' : '$TOKEN$' %>"
,
token
:
"<%= process.env.NODE_ENV === 'development' ? 'eyJhbGciOiJIUzI1Ni
IsInR5cCI6IkpXVCJ9.eyJpZCI6MjA4NSwibmFtZSI6IuWKs-eQquWzsCIsImFjY291bnQiOiJsYW9xaWZlbmciLCJlbWFpbCI6Imxhb3FpZmVuZ0BkdWliYS5jb20uY24iLCJtb2JpbGUiOiIxMzQ1Njc3NDE1MyIsImRpbmdVc2VySWQiOiI1MDY5MDYyOTIxMjkxMDAxIiwibW9kZWxBdXRob3JpemUiOmZhbHNlLCJsb2dpblRpbWVvdXQiOjc5MTUwLCJnbXRDcmVhdGUiOjE1MzQ0MTIwMTUwMDAsImdtdE1vZGlmaWVkIjoxNTczODgyMDk2MDAwLCJzeXN0ZW1JZFNldCI6WzAsMSwzNCwyMjcsMzYsMzcsMjMxLDIwMywxOSwyMSwyNDYsMjMsMjUsMjQ5LDI3LDMwXSwiaWF0IjoxNTc0NzU4OTk5fQ.tlRIqNZ3t1-5ZjWBuB7sASQuDBQ03gjfv0aDC_Ba_3k
' : '$TOKEN$' %>"
,
apiHost
:
"<%= process.env.NODE_ENV === 'development' ? 'http://beacon.duibadev.com.cn' : '$API_HOST$' %>"
apiHost
:
"<%= process.env.NODE_ENV === 'development' ? 'http://beacon.duibadev.com.cn' : '$API_HOST$' %>"
}
}
</script>
</script>
...
...
src/api/project.js
View file @
f832154c
...
@@ -21,7 +21,7 @@ export async function createOne(project) {
...
@@ -21,7 +21,7 @@ export async function createOne(project) {
}
}
export
async
function
duplicateOne
(
project
)
{
export
async
function
duplicateOne
(
project
)
{
return
await
fetchApi
(
'/api/project/
duplicate
'
,
{
return
await
fetchApi
(
'/api/project/
copy
'
,
{
params
:
project
,
params
:
project
,
method
:
'post'
,
method
:
'post'
,
errMessage
:
'Failed to duplicate project'
,
errMessage
:
'Failed to duplicate project'
,
...
...
src/config.js
View file @
f832154c
...
@@ -5,8 +5,9 @@
...
@@ -5,8 +5,9 @@
export
let
API_HOST
;
export
let
API_HOST
;
if
(
process
.
env
.
NODE_ENV
===
'development'
)
{
if
(
process
.
env
.
NODE_ENV
===
'development'
)
{
//API_HOST = 'http://10.10.95.74:7777';
//API_HOST = 'http://10.10.95.74:7777';
API_HOST
=
'http://10.10.94.134:7777'
;
//API_HOST = 'http://localhost:3002';
//API_HOST = 'http://localhost:3002';
API_HOST
=
window
.
__data
.
apiHost
;
//
API_HOST = window.__data.apiHost;
}
else
{
}
else
{
API_HOST
=
window
.
__data
.
apiHost
;
API_HOST
=
window
.
__data
.
apiHost
;
}
}
...
...
src/locales/en.json
View file @
f832154c
...
@@ -12,6 +12,7 @@
...
@@ -12,6 +12,7 @@
"Behavior"
:
"Behavior"
,
"Behavior"
:
"Behavior"
,
"Add"
:
"Add"
,
"Add"
:
"Add"
,
"Delete"
:
"Delete"
,
"Delete"
:
"Delete"
,
"Delete all"
:
"Delete all"
,
"Import"
:
"Import"
,
"Import"
:
"Import"
,
"Export"
:
"Export"
,
"Export"
:
"Export"
,
"Upload"
:
"Upload"
,
"Upload"
:
"Upload"
,
...
@@ -104,6 +105,7 @@
...
@@ -104,6 +105,7 @@
"Confirm to exit the editor"
:
"Confirm to exit the editor?"
,
"Confirm to exit the editor"
:
"Confirm to exit the editor?"
,
"Confirm to publish"
:
"Confirm to publish?"
,
"Confirm to publish"
:
"Confirm to publish?"
,
"Are you sure to delete this asset"
:
"Are you sure to delete this asset"
,
"Are you sure to delete this asset"
:
"Are you sure to delete this asset"
,
"Are you sure to delete all assets"
:
"Are you sure to delete all assets"
,
"Are you sure to delete this item"
:
"Are you sure to delete this item"
,
"Are you sure to delete this item"
:
"Are you sure to delete this item"
,
"Rename asset"
:
"Rename asset"
,
"Rename asset"
:
"Rename asset"
,
"Input asset name"
:
"Input asset name"
,
"Input asset name"
:
"Input asset name"
,
...
@@ -116,6 +118,7 @@
...
@@ -116,6 +118,7 @@
"Custom node desc"
:
"Custom node"
,
"Custom node desc"
:
"Custom node"
,
"Divider node desc"
:
"Divider node, exit will be executed in sequence"
,
"Divider node desc"
:
"Divider node, exit will be executed in sequence"
,
"Save this behavior before"
:
"Save this behavior before?"
,
"Save this behavior before"
:
"Save this behavior before?"
,
"Upload view failed"
:
"Upload view failed"
,
"menu"
:
{
"menu"
:
{
"save"
:
"Save"
,
"save"
:
"Save"
,
"details"
:
"Details"
,
"details"
:
"Details"
,
...
...
src/locales/zh-CN.json
View file @
f832154c
...
@@ -12,6 +12,7 @@
...
@@ -12,6 +12,7 @@
"Behavior"
:
"行为"
,
"Behavior"
:
"行为"
,
"Add"
:
"添加"
,
"Add"
:
"添加"
,
"Delete"
:
"删除"
,
"Delete"
:
"删除"
,
"Delete all"
:
"删除全部"
,
"Import"
:
"导入"
,
"Import"
:
"导入"
,
"Export"
:
"导出"
,
"Export"
:
"导出"
,
"Upload"
:
"上传"
,
"Upload"
:
"上传"
,
...
@@ -33,7 +34,7 @@
...
@@ -33,7 +34,7 @@
"Failed to fetch"
:
"网络错误!"
,
"Failed to fetch"
:
"网络错误!"
,
"In processing"
:
"处理中……"
,
"In processing"
:
"处理中……"
,
"Projects"
:
"项目"
,
"Projects"
:
"项目"
,
"copy"
:
"
复制
"
,
"copy"
:
"
副本
"
,
"No projects"
:
"无项目"
,
"No projects"
:
"无项目"
,
"Create"
:
"创建"
,
"Create"
:
"创建"
,
"Project details"
:
"项目详情"
,
"Project details"
:
"项目详情"
,
...
@@ -103,7 +104,8 @@
...
@@ -103,7 +104,8 @@
"Remote Version"
:
"远程版本"
,
"Remote Version"
:
"远程版本"
,
"Confirm to exit the editor"
:
"确定退出编辑器吗?"
,
"Confirm to exit the editor"
:
"确定退出编辑器吗?"
,
"Confirm to publish"
:
"确定发布吗?"
,
"Confirm to publish"
:
"确定发布吗?"
,
"Are you sure to delete this asset"
:
"确定删除素材吗"
,
"Are you sure to delete this asset"
:
"确定删除这个素材吗"
,
"Are you sure to delete all assets"
:
"确定删除全部素材吗"
,
"Are you sure to delete this item"
:
"确定删除这一项吗"
,
"Are you sure to delete this item"
:
"确定删除这一项吗"
,
"Rename asset"
:
"重命名素材"
,
"Rename asset"
:
"重命名素材"
,
"Input asset name"
:
"输入素材名"
,
"Input asset name"
:
"输入素材名"
,
...
@@ -116,6 +118,7 @@
...
@@ -116,6 +118,7 @@
"Custom node desc"
:
"自定义节点"
,
"Custom node desc"
:
"自定义节点"
,
"Divider node desc"
:
"分流节点,出口会按顺序一次执行"
,
"Divider node desc"
:
"分流节点,出口会按顺序一次执行"
,
"Save this behavior before"
:
"是否先保存这个行为?"
,
"Save this behavior before"
:
"是否先保存这个行为?"
,
"Upload view failed"
:
"上传视图失败"
,
"menu"
:
{
"menu"
:
{
"save"
:
"保存"
,
"save"
:
"保存"
,
"details"
:
"详情"
,
"details"
:
"详情"
,
...
...
src/store/index.js
View file @
f832154c
...
@@ -34,6 +34,7 @@ export default new Vuex.Store({
...
@@ -34,6 +34,7 @@ export default new Vuex.Store({
'deleteNode'
,
'deleteNode'
,
'addAsset'
,
'addAsset'
,
'deleteAsset'
,
'deleteAsset'
,
'deleteAllAssets'
,
'modifyAsset'
,
'modifyAsset'
,
'importView'
,
'importView'
,
'importAssets'
,
'importAssets'
,
...
...
src/store/modules/project.js
View file @
f832154c
...
@@ -303,6 +303,10 @@ export const projectStore = {
...
@@ -303,6 +303,10 @@ export const projectStore = {
}
}
}
}
},
},
deleteAllAssets
(
state
){
const
{
assets
}
=
state
.
data
;
assets
.
splice
(
0
);
},
modifyAsset
(
state
,
asset
)
{
modifyAsset
(
state
,
asset
)
{
},
},
...
...
src/views/Editor/Assets.vue
View file @
f832154c
<
template
>
<
template
>
<pane
class=
"assets"
icon=
"el-icon-s-shop"
:title=
"$t('panes.Assets')"
>
<pane
class=
"assets"
icon=
"el-icon-s-shop"
:title=
"$t('panes.Assets')"
>
<div
class=
"wrapper"
>
<div
class=
"wrapper"
>
<
!--
<
div
class=
"header-bar"
>
<div
class=
"header-bar"
>
<el-link
>
{{
$t
(
'Upload
'
)
}}
</el-link>
<el-link
@
click=
"deleteAll"
:underline=
"false"
>
{{
$t
(
'Delete all
'
)
}}
</el-link>
</div>
-->
</div>
<div
class=
"container"
>
<div
class=
"container"
>
<div
class=
"properties"
>
<div
class=
"properties"
>
<template
v-if=
"currentItem"
>
<template
v-if=
"currentItem"
>
...
@@ -93,8 +93,19 @@
...
@@ -93,8 +93,19 @@
uploadFileError
()
{
uploadFileError
()
{
console
.
log
(
'upload error'
)
console
.
log
(
'upload error'
)
},
},
deleteAll
(){
this
.
$confirm
(
this
.
$t
(
'Are you sure to delete all assets'
),
this
.
$t
(
'Alert'
),
{
confirmButtonText
:
this
.
$t
(
'Confirm'
),
cancelButtonText
:
this
.
$t
(
'Cancel'
),
type
:
'warning'
}).
then
(()
=>
{
this
.
deleteAllAssets
();
}).
catch
((
e
)
=>
{
});
},
...
mapMutations
([
...
mapMutations
([
'addAsset'
'addAsset'
,
'deleteAllAssets'
,
]),
]),
}
}
}
}
...
...
src/views/Editor/Views.vue
View file @
f832154c
...
@@ -144,6 +144,11 @@ export default {
...
@@ -144,6 +144,11 @@ export default {
},
},
uploadFileError
()
{
uploadFileError
()
{
console
.
log
(
'upload error'
);
console
.
log
(
'upload error'
);
this
.
$message
({
message
:
this
.
$t
(
'Upload view failed'
),
type
:
'error'
,
duration
:
1000
,
});
},
},
...
mapMutations
([
'importView'
,
'importAssets'
,
'deleteNode'
,
'addNode'
]),
...
mapMutations
([
'importView'
,
'importAssets'
,
'deleteNode'
,
'addNode'
]),
...
mapActions
([
'exportView'
])
...
mapActions
([
'exportView'
])
...
...
src/views/Home/DuplicateProjectDialog.vue
View file @
f832154c
...
@@ -43,6 +43,7 @@
...
@@ -43,6 +43,7 @@
},
},
doCreateProject
()
{
doCreateProject
()
{
this
.
$refs
.
form
.
validate
(
async
(
valid
)
=>
{
this
.
$refs
.
form
.
validate
(
async
(
valid
)
=>
{
console
.
log
(
valid
);
if
(
valid
){
if
(
valid
){
try
{
try
{
const
project
=
await
playWaiting
(
this
.
duplicateProject
(
this
.
project
),
this
.
$t
(
'Duplicating project'
));
const
project
=
await
playWaiting
(
this
.
duplicateProject
(
this
.
project
),
this
.
$t
(
'Duplicating project'
));
...
@@ -54,6 +55,7 @@
...
@@ -54,6 +55,7 @@
});
});
this
.
$emit
(
'success'
,
project
.
id
);
this
.
$emit
(
'success'
,
project
.
id
);
}
catch
(
e
)
{
}
catch
(
e
)
{
console
.
warn
(
e
);
}
}
}
}
})
})
...
@@ -62,7 +64,7 @@
...
@@ -62,7 +64,7 @@
//this.project.name = '';
//this.project.name = '';
},
},
...
mapActions
([
...
mapActions
([
'
cre
ateProject'
,
'
duplic
ateProject'
,
]),
]),
}
}
}
}
...
...
自动合并.jsx
View file @
f832154c
...
@@ -17,12 +17,13 @@ function merge(document){
...
@@ -17,12 +17,13 @@ function merge(document){
traverse
(
document
,
function
(
layer
){
traverse
(
document
,
function
(
layer
){
return
layer
.
name
.
match
(
mergeFlagReg
);
return
layer
.
name
.
match
(
mergeFlagReg
);
},
function
(
layer
){
},
function
(
layer
){
document
.
activeLayer
=
layer
;
var
newName
=
layer
.
name
.
replace
(
mergeFlagReg
,
''
);
var
newName
=
layer
.
name
.
replace
(
mergeFlagReg
,
''
);
layer
.
name
=
newName
;
layer
.
name
=
newName
;
mergeLayers
.
push
(
newName
);
mergeLayers
.
push
(
newName
);
document
.
activeLayer
=
layer
;
layer
.
merge
();
layer
.
merge
();
});
});
...
...
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