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 @@ ...@@ -14,7 +14,7 @@
</noscript> </noscript>
<script> <script>
window.__data = { 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$' %>" apiHost : "<%= process.env.NODE_ENV === 'development' ? 'http://beacon.duibadev.com.cn' : '$API_HOST$' %>"
} }
</script> </script>
......
...@@ -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',
......
...@@ -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;
} }
......
...@@ -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",
......
...@@ -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": "详情",
......
...@@ -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',
......
...@@ -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) {
}, },
......
<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',
]), ]),
} }
} }
......
...@@ -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'])
......
...@@ -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([
'createProject', 'duplicateProject',
]), ]),
} }
} }
......
...@@ -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();
}); });
......
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