Skip to content

Commit fb68864

Browse files
committed
fix: 修复问题工作流新的拖拽模式
1 parent 9e3dd49 commit fb68864

File tree

21 files changed

+132
-102
lines changed

21 files changed

+132
-102
lines changed

web/.eslintignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
iconfont.js
22
packages/dss/server/*
3+
packages/dss/public/*
4+
packages/dss/dist/*
5+
packages/cyeditor/*
36
packages/*/node_modules/*/*
47
"*.min.js"

web/packages/cyeditor/cyeditor-context-menu/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ class ContextMenu {
121121
show(e) {
122122
if (e.target.data().type === 'edgehandle') return
123123
this.triggerEvt = e;
124-
if (typeof this._options.beforeShow === 'function' && !this.isShow) {
124+
if (typeof this._options.beforeShow === 'function') {
125125
const show = this._options.beforeShow(e, this._options.menus.slice(0))
126126
if (!show) return
127127
if (show && show.then) {

web/packages/cyeditor/index.js

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -324,27 +324,14 @@ class CyEditor extends EventBus {
324324
this._plugins.edgehandles.enable();
325325
}
326326
}
327-
}
328-
if (typeof key === 'string') {
327+
} else if (typeof key === 'string') {
329328
this.editorOptions[key] = value
330329
if (typeof this._handleOptonsChange[key] === 'function') {
331330
this._handleOptonsChange[key].call(this, value)
332331
}
333332
} else if (typeof key === 'object') {
334333
Object.assign(this.editorOptions, key)
335334
}
336-
let { dragAddNodes, snapGrid } = this.editorOptions
337-
// drag node add to cy
338-
if (dragAddNodes && this.cy) {
339-
this._plugins.dragAddNodes = this.cy.dragAddNodes({
340-
container: '.cy-editor-container .left',
341-
nodeTypes: this.editorOptions.nodeTypes,
342-
})
343-
}
344-
// snap-grid
345-
if (snapGrid && this.cy) {
346-
this._plugins.cySnapToGrid = this.cy.snapToGrid()
347-
}
348335
}
349336

350337
deleteSelected() {

web/packages/cyeditor/index.scss

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
.left {
88
display: none;
99
}
10+
.cy {
11+
padding-left: 0;
12+
}
1013
}
1114
}
1215

web/packages/editor/editor.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ export default {
7373
let typeConfig = types[this.type];
7474
let config = merge(
7575
{
76-
automaticLayout: false,
76+
automaticLayout: true,
7777
scrollBeyondLastLine: false,
7878
minimap: {
7979
enabled: false,

web/packages/editorLsp/editor.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ export default {
7474
let typeConfig = types[this.type];
7575
let config = merge(
7676
{
77-
automaticLayout: false,
77+
automaticLayout: true,
7878
scrollBeyondLastLine: false,
7979
minimap: {
8080
enabled: false,
@@ -161,8 +161,8 @@ export default {
161161
})
162162
this.editor = editor
163163
this.monaco = monaco
164-
this.editorModel = this.editor.getModel();
165164
this.initMonaco()
165+
this.editorModel = this.editor.getModel();
166166
this.changeTheme(localStorage.getItem('theme'));
167167
eventbus.on('theme.change', this.changeTheme);
168168
},

web/packages/scriptis/module/workSidebar/workSidebar.vue

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -278,8 +278,12 @@ export default {
278278
copy: false,
279279
type: "脚本文件",
280280
};
281-
this.handleCreate(node).then(() => {
282-
plugin.emit('copilot_web_listener_inster', regs)
281+
this.handleCreate(node, (_, isOpen) => {
282+
if (isOpen) {
283+
setTimeout(() => {
284+
plugin.emit('copilot_web_listener_inster', regs)
285+
}, 500);
286+
}
283287
});
284288
}
285289
})
@@ -390,15 +394,15 @@ export default {
390394
this.openToTABAction(node.data);
391395
}
392396
},
393-
openToTABAction(node) {
397+
openToTABAction(node, openCallBack) {
394398
const openNode = node || this.currentNode.data;
395399
const path = openNode.path;
396400
const source = openNode.copy ? this.path : '';
397401
this.dispatch('Workbench:openFile', {
398402
source,
399403
path,
400404
filename: openNode.name,
401-
}, () => {});
405+
}, openCallBack || (() => {}));
402406
},
403407
copyPathAction() {
404408
util.executeCopy(this.currentNode.data.path);
@@ -489,12 +493,12 @@ export default {
489493
type: result[0] || PREFIX,
490494
});
491495
},
492-
handleCreate(node) {
496+
handleCreate(node, openCallBack) {
493497
return new Promise((resolve, reject) => {
494498
this.handleCreating(node, (flag) => {
495499
if (flag) {
496500
if (node.isLeaf) {
497-
this.openToTABAction(node);
501+
this.openToTABAction(node, openCallBack);
498502
}
499503
let text = node.copy ? this.$t('message.scripts.constants.success.stick') : this.$t('message.scripts.constants.success.add')
500504
this.$Message.success(text);

web/packages/scriptis/module/workbench/container.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -688,9 +688,9 @@ export default {
688688
ismodifyByOldTab,
689689
currentNodeKey: this.node ? this.node.key : "",
690690
},
691-
() => {
691+
(isOpen) => {
692692
this.loading = false
693-
cb(rst)
693+
cb(rst, isOpen)
694694
if (option.source) {
695695
this.save(rst, option)
696696
}

web/packages/scriptis/view/home/index.vue

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,7 @@ import storage from '@dataspherestudio/shared/common/helper/storage';
7878
import eventbus from '@dataspherestudio/shared/common/helper/eventbus';
7979
import plugin from '@dataspherestudio/shared/common/util/plugin'
8080
81-
const [{ copilotEntryComponent }] = plugin.emitHook('copilot_web_component') || []
82-
81+
const [ copilotWebComponent ] = plugin.emitHook('copilot_web_component') || []
8382
export default {
8483
components: {
8584
workbench: workbenchModule.component,
@@ -103,7 +102,7 @@ export default {
103102
navHeight: 0,
104103
showSetting: false,
105104
proxyUserName: '',
106-
copilotEntryComponent
105+
copilotEntryComponent: copilotWebComponent ? copilotWebComponent.copilotEntryComponent : null
107106
};
108107
},
109108
//组建内的守卫

web/packages/shared/components/projectForm/index.vue

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,7 @@ export default {
232232
return {
233233
ProjectShow: false,
234234
originBusiness: "",
235+
mode: "",
235236
devProcess: [
236237
{
237238
id: 1,
@@ -344,14 +345,15 @@ export default {
344345
projectData(value) {
345346
const cloneObj = _.cloneDeep(value);
346347
this.projectDataCurrent = cloneObj;
347-
// 设置开发流程的默认参数
348-
let curProcessList = [];
349-
this.devProcess.forEach((item) => {
350-
if(item.checked === 1) {
351-
curProcessList.push(item.dicValue)
352-
}
353-
})
354-
this.projectDataCurrent.devProcessList = curProcessList;
348+
if (this.mode === 'add') {
349+
let curProcessList = [];
350+
this.devProcess.forEach((item) => {
351+
if(item.checked === 1) {
352+
curProcessList.push(item.dicValue)
353+
}
354+
})
355+
this.projectDataCurrent.devProcessList = curProcessList;
356+
}
355357
},
356358
},
357359
methods: {
@@ -401,14 +403,15 @@ export default {
401403
tmpArr.splice(index, 1);
402404
this.projectDataCurrent.business = tmpArr.toString();
403405
},
404-
showProject(params) {
406+
showProject(params,mode) {
405407
this.ProjectShow = true
406408
this.$refs.projectForm.resetFields()
407409
// 新增只有一项自动勾选
408410
if (this.orchestratorModeList && this.orchestratorModeList.list.length === 1 && !params.name) {
409411
params.orchestratorModeList = [this.orchestratorModeList.list[0].dicKey]
410412
}
411413
this.projectDataCurrent = {...params}
414+
this.mode = mode
412415
}
413416
},
414417
};

0 commit comments

Comments
 (0)