Commit f832154c authored by rockyl's avatar rockyl

修复复制项目失败的问题

parent bf0e124f
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
......@@ -14,7 +14,7 @@
</noscript>
<script>
window.__data = {
token : "<%= process.env.NODE_ENV === 'development' ? 'eyJhbGciOiJIUzI1NiJ9.5Y2e6b6Z5Lqt.2fNMm0oJt0l0ZzsSYwo4ie8Bs7yLU9EmS2mtrmLPktY' : '$TOKEN$' %>",
token : "<%= process.env.NODE_ENV === 'development' ? 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MjA4NSwibmFtZSI6IuWKs-eQquWzsCIsImFjY291bnQiOiJsYW9xaWZlbmciLCJlbWFpbCI6Imxhb3FpZmVuZ0BkdWliYS5jb20uY24iLCJtb2JpbGUiOiIxMzQ1Njc3NDE1MyIsImRpbmdVc2VySWQiOiI1MDY5MDYyOTIxMjkxMDAxIiwibW9kZWxBdXRob3JpemUiOmZhbHNlLCJsb2dpblRpbWVvdXQiOjc5MTUwLCJnbXRDcmVhdGUiOjE1MzQ0MTIwMTUwMDAsImdtdE1vZGlmaWVkIjoxNTczODgyMDk2MDAwLCJzeXN0ZW1JZFNldCI6WzAsMSwzNCwyMjcsMzYsMzcsMjMxLDIwMywxOSwyMSwyNDYsMjMsMjUsMjQ5LDI3LDMwXSwiaWF0IjoxNTc0NzU4OTk5fQ.tlRIqNZ3t1-5ZjWBuB7sASQuDBQ03gjfv0aDC_Ba_3k' : '$TOKEN$' %>",
apiHost : "<%= process.env.NODE_ENV === 'development' ? 'http://beacon.duibadev.com.cn' : '$API_HOST$' %>"
}
</script>
......
......@@ -21,7 +21,7 @@ export async function createOne(project) {
}
export async function duplicateOne(project) {
return await fetchApi('/api/project/duplicate', {
return await fetchApi('/api/project/copy', {
params: project,
method: 'post',
errMessage: 'Failed to duplicate project',
......
......@@ -5,8 +5,9 @@
export let API_HOST;
if (process.env.NODE_ENV === 'development') {
//API_HOST = 'http://10.10.95.74:7777';
API_HOST = 'http://10.10.94.134:7777';
//API_HOST = 'http://localhost:3002';
API_HOST = window.__data.apiHost;
//API_HOST = window.__data.apiHost;
} else {
API_HOST = window.__data.apiHost;
}
......
......@@ -12,6 +12,7 @@
"Behavior": "Behavior",
"Add": "Add",
"Delete": "Delete",
"Delete all": "Delete all",
"Import": "Import",
"Export": "Export",
"Upload": "Upload",
......@@ -104,6 +105,7 @@
"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 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 @@
"Custom node desc": "Custom node",
"Divider node desc": "Divider node, exit will be executed in sequence",
"Save this behavior before": "Save this behavior before?",
"Upload view failed": "Upload view failed",
"menu": {
"save": "Save",
"details": "Details",
......
......@@ -12,6 +12,7 @@
"Behavior": "行为",
"Add": "添加",
"Delete": "删除",
"Delete all": "删除全部",
"Import": "导入",
"Export": "导出",
"Upload": "上传",
......@@ -33,7 +34,7 @@
"Failed to fetch": "网络错误!",
"In processing": "处理中……",
"Projects": "项目",
"copy": "复制",
"copy": "副本",
"No projects": "无项目",
"Create": "创建",
"Project details": "项目详情",
......@@ -103,7 +104,8 @@
"Remote Version": "远程版本",
"Confirm to exit the editor": "确定退出编辑器吗?",
"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": "确定删除这一项吗",
"Rename asset": "重命名素材",
"Input asset name": "输入素材名",
......@@ -116,6 +118,7 @@
"Custom node desc": "自定义节点",
"Divider node desc": "分流节点,出口会按顺序一次执行",
"Save this behavior before": "是否先保存这个行为?",
"Upload view failed": "上传视图失败",
"menu": {
"save": "保存",
"details": "详情",
......
......@@ -34,6 +34,7 @@ export default new Vuex.Store({
'deleteNode',
'addAsset',
'deleteAsset',
'deleteAllAssets',
'modifyAsset',
'importView',
'importAssets',
......
......@@ -303,6 +303,10 @@ export const projectStore = {
}
}
},
deleteAllAssets(state){
const {assets} = state.data;
assets.splice(0);
},
modifyAsset(state, asset) {
},
......
<template>
<pane class="assets" icon="el-icon-s-shop" :title="$t('panes.Assets')">
<div class="wrapper">
<!--<div class="header-bar">
<el-link>{{$t('Upload')}}</el-link>
</div>-->
<div class="header-bar">
<el-link @click="deleteAll" :underline="false">{{$t('Delete all')}}</el-link>
</div>
<div class="container">
<div class="properties">
<template v-if="currentItem">
......@@ -93,8 +93,19 @@
uploadFileError() {
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([
'addAsset'
'addAsset',
'deleteAllAssets',
]),
}
}
......
......@@ -144,6 +144,11 @@ export default {
},
uploadFileError() {
console.log('upload error');
this.$message({
message: this.$t('Upload view failed'),
type: 'error',
duration: 1000,
});
},
...mapMutations(['importView', 'importAssets', 'deleteNode', 'addNode']),
...mapActions(['exportView'])
......
......@@ -43,6 +43,7 @@
},
doCreateProject() {
this.$refs.form.validate(async (valid)=>{
console.log(valid);
if(valid){
try {
const project = await playWaiting(this.duplicateProject(this.project), this.$t('Duplicating project'));
......@@ -54,6 +55,7 @@
});
this.$emit('success', project.id);
}catch (e) {
console.warn(e);
}
}
})
......@@ -62,7 +64,7 @@
//this.project.name = '';
},
...mapActions([
'createProject',
'duplicateProject',
]),
}
}
......
......@@ -17,12 +17,13 @@ function merge(document){
traverse(document, function(layer){
return layer.name.match(mergeFlagReg);
}, function(layer){
document.activeLayer = layer;
var newName = layer.name.replace(mergeFlagReg, '');
layer.name = newName;
mergeLayers.push(newName);
document.activeLayer = layer;
layer.merge();
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment