Commit 99c79c3b authored by rockyl's avatar rockyl

psd上传后使用文件名作为视图名

修复复制项目的问题
parent f832154c
......@@ -3,12 +3,13 @@
*/
var mergeFlagReg = /__m$/;
var extName = '.psd';
var oldDocument = app.activeDocument;
var mergeLayers = [];
var document = oldDocument.duplicate(oldDocument.name + '-合并', 0);
var document = oldDocument.duplicate(oldDocument.name.replace(extName, '') + '-合并' + extName, 0);
app.activeDocument = document;
merge(document);
......
......@@ -22,7 +22,7 @@
:expand-on-click-node="false"
draggable
highlight-current
:default-expand-all="true"
:default-expand-all="false"
@node-click="handleNodeClick"
empty-text=""
:allow-drag="allowDrag"
......@@ -136,6 +136,8 @@ export default {
console.log('upload success', response);
const { view, assets } = response.data;
view.name = file.name.substring(0, file.name.lastIndexOf('.'));
this.importView(view);
this.importAssets(assets);
} else {
......
......@@ -22,7 +22,8 @@
return {
visible: false,
project: {
name: ''
id: '',
name: '',
},
template: 'blank',
templates: {
......@@ -39,6 +40,7 @@
methods: {
async show(project) {
this.project.name = project.name + '-' + this.$t('copy') + '-' + Math.floor(Math.random() * 10000);
this.project.id = project.id;
this.visible = true;
},
doCreateProject() {
......
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