Skip to content

Commit 9026c65

Browse files
committed
Merge branch 'dev-1.1.4' of github.com:WeDataSphere/DataSphereStudio into dev-1.1.4
2 parents 475d37f + a8b7956 commit 9026c65

File tree

9 files changed

+78
-97
lines changed

9 files changed

+78
-97
lines changed

web/config.json

+6-12
Original file line numberDiff line numberDiff line change
@@ -6,53 +6,47 @@
66
"i18n": {
77
"en": "workspace/i18n/en.json",
88
"zh-CN": "workspace/i18n/zh.json"
9-
},
10-
"header": ""
9+
}
1110
},
1211
"scriptis": {
1312
"routes": "scriptis/router",
1413
"module": "scriptis/module",
1514
"i18n": {
1615
"en": "scriptis/i18n/common/en.json",
1716
"zh-CN": "scriptis/i18n/common/zh.json"
18-
},
19-
"header": "scriptis/module/header"
17+
}
2018
},
2119
"workflows": {
2220
"routes": "workflows/router",
2321
"module": "workflows/module",
2422
"i18n": {
2523
"en": "workflows/i18n/common/en.json",
2624
"zh-CN": "workflows/i18n/common/zh.json"
27-
},
28-
"header": "workflows/module/header"
25+
}
2926
},
3027
"dataService": {
3128
"routes": "dataService/router",
3229
"module": "dataService/module",
3330
"i18n": {
3431
"en": "dataService/i18n/en.json",
3532
"zh-CN": "dataService/i18n/zh.json"
36-
},
37-
"header": "dataService/module/header"
33+
}
3834
},
3935
"dataGovernance": {
4036
"routes": "dataGovernance/router",
4137
"module": "dataGovernance/module",
4238
"i18n": {
4339
"en": "dataGovernance/i18n/en.json",
4440
"zh-CN": "dataGovernance/i18n/zh.json"
45-
},
46-
"header": "dataGovernance/module/header"
41+
}
4742
},
4843
"dolphinScheduler": {
4944
"routes": "dolphinScheduler/router",
5045
"module": "dolphinScheduler/module",
5146
"i18n": {
5247
"en": "dolphinScheduler/i18n/en.json",
5348
"zh-CN": "dolphinScheduler/i18n/zh.json"
54-
},
55-
"header": ""
49+
}
5650
}
5751
},
5852
"exts": {

web/packages/dss/module/footer/guide.vue

+1
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,7 @@ export default {
361361
@include guide-box-shadow(#dee4ec, #192235);
362362
border-radius: 2px;
363363
text-align:left;
364+
cursor: auto;
364365
.guide-header {
365366
position: relative;
366367
height: 48px;

web/packages/dss/module/footer/index.vue

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
<template>
2-
<div class="layout-footer" @mousemove="onMouseMove" :style="{'pointer-events': `${isMouseDown ? 'initial' : 'none'}`}">
2+
<div class="layout-footer" @mousemove="onMouseMove" :style="{'pointer-events': `${(isMouseDown || guideShow) ? 'initial' : 'none'}`}">
33
<div ref="footerChannel" class="tool-btns" @mousedown.prevent.stop="onMouseDown">
44
<template v-if="!min">
55
<div class="footer-btn footer-doc" @click="toggleGuide">
66
<SvgIcon icon-class="question" />
77
</div>
8-
<Guide :show="guideShow" @on-toggle="toggleGuide" ref="Guide"/>
98
<resource-simple
109
ref="resourceSimple"
1110
:dispatch="dispatch"
@@ -21,6 +20,7 @@
2120
</template>
2221
<Icon v-else type="md-arrow-dropup" class="show_arrow" @click="min=false" />
2322
</div>
23+
<Guide :show="guideShow" @on-toggle="toggleGuide" ref="Guide"/>
2424
</div>
2525
</template>
2626
<script>
@@ -86,7 +86,8 @@ export default {
8686
},
8787
toggleGuide() {
8888
if (!this.isMouseMove) {
89-
this.guideShow = !this.guideShow;
89+
window.open("/_book/", '_blank');
90+
// this.guideShow = !this.guideShow;
9091
}
9192
},
9293
onMouseDown(e) {

web/packages/dss/src/dynamic-apps.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ window.$APP_CONF = apps.conf
55
import { merge } from 'lodash'
66
import { subAppRoutes } from "./common-router"
77
// 根据module参数配置要打包的应用,生成的虚拟模块
8-
// 子应用可以有独立的顶层路由配置layout,header,footer,可配置micro_module参数
8+
// 子应用可以有独立的顶层路由配置layout,header,footer,可配置micro_module参数使用子应用layout
99

1010
let subRoutes = subAppRoutes
1111
const appsRoutes = Object.values(apps.appsRoutes)
1212

1313
/**
1414
* * 科管版本:scriptis + 管理台(linkis已从dss拆出去)
15-
* * npm run build --module=scriptis
15+
* * npm run build --module=scriptis --micro_module=scriptis
1616
* * 数据服务子应用:apiServices和workspace一起打包
1717
* * npm run build --module=apiServices,workspace --micro_module=apiServices
1818
* ! micro_module参数要和module里值一样,否则找不到

web/packages/dss/vue.config.js

+1-6
Original file line numberDiff line numberDiff line change
@@ -45,18 +45,14 @@ let requireComponent = []
4545
let requireComponentVue = []
4646
let appsRoutes = []
4747
let appsI18n = []
48-
let headers = []
4948
let confs = []
5049

5150
Object.entries(apps).forEach(item => {
5251
if (item[1].module) {
5352
requireComponent.push(`require.context('@/${item[1].module}',true,/([a-z|A-Z])+\\/index\.js$/)`)
5453
requireComponentVue.push(`require.context('@/${item[1].module}',true,/([a-z|A-Z])+.vue$/)`)
5554
}
56-
// 获取个模块header
57-
if (item[1].header) {
58-
headers.push(`${item[0]}: require('@/${item[1].header}/index.js')`)
59-
}
55+
6056
// 处理路由
6157
if (item[1].routes) {
6258
appsRoutes.push(`${item[0]}: require('@/${item[1].routes}')`)
@@ -109,7 +105,6 @@ const virtualModules = new VirtualModulesPlugin({
109105
requireComponent: [${requireComponent.join(',')}],
110106
requireComponentVue: [${requireComponentVue.join(',')}],
111107
microModule: ${JSON.stringify(process.env.npm_config_micro_module) || false},
112-
headers:{${headers.join(',')}},
113108
conf: {${confs.join(',')}}
114109
};`
115110
});
+61-71
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
11
<template>
2-
<div class="layout-footer">
3-
<resource-simple
4-
ref="resourceSimple"
5-
:dispatch="dispatch"
6-
@update-job="updateJob">
7-
</resource-simple>
8-
<div class="footer-btn footer-channel"
9-
:title="msg"
10-
ref="footerChannel"
11-
@mousedown.prevent.stop="onMouseDown"
12-
@mouseup.prevent.stop="oMouseUp"
13-
@click.prevent.stop="toast">
14-
<SvgIcon class="footer-channel-job" icon-class="job" />
15-
<span class="footer-channel-job-num">{{ num }}</span>
2+
<div class="layout-footer" @mousemove="onMouseMove" :style="{'pointer-events': `${isMouseDown ? 'initial' : 'none'}`}">
3+
<div ref="footerChannel" class="tool-btns" @mousedown.prevent.stop="onMouseDown">
4+
<template v-if="!min">
5+
<resource-simple
6+
ref="resourceSimple"
7+
:dispatch="dispatch"
8+
@update-job="updateJob">
9+
</resource-simple>
10+
<div class="footer-btn footer-channel"
11+
:title="msg"
12+
@click="toast">
13+
<SvgIcon class="footer-channel-job" icon-class="job" />
14+
<span class="footer-channel-job-num">{{ num }}</span>
15+
</div>
16+
<Icon type="md-arrow-dropdown" class="min_arrow" @click="min=true" />
17+
</template>
18+
<Icon v-else type="md-arrow-dropup" class="show_arrow" @click="min=false" />
1619
</div>
1720
</div>
1821
</template>
@@ -27,10 +30,9 @@ export default {
2730
return {
2831
num: 0,
2932
msg: '',
30-
moveX: null,
31-
moveY: null,
32-
isMouseDrop: false,
33-
isMouseMove: false,
33+
min: false,
34+
isMouseDown: false,
35+
isMouseMove: false
3436
};
3537
},
3638
created() {
@@ -39,6 +41,13 @@ export default {
3941
this.getRunningJob();
4042
}, 500);
4143
},
44+
mounted() {
45+
this.positionInfo = { x: 0, y: 0}
46+
document.onmouseup = () => {
47+
this.isMouseDown = false;
48+
}
49+
window.addEventListener('resize', this.resetChannelPosition)
50+
},
4251
watch: {
4352
'$route'() {
4453
this.resetChannelPosition()
@@ -64,73 +73,54 @@ export default {
6473
this[method](num);
6574
},
6675
toast() {
67-
// 取消拖动后自动点击事件
68-
if (this.isMouseMove) {
69-
return;
76+
if (!this.isMouseMove) {
77+
this.$refs.resourceSimple.open();
7078
}
71-
this.$refs.resourceSimple.open();
7279
},
7380
onMouseDown(e) {
74-
e = e || window.event;
7581
const footerChannel = this.$refs.footerChannel;
76-
this.moveX = e.clientX - footerChannel.offsetLeft;
77-
this.moveY = e.clientY - footerChannel.offsetTop;
78-
this.isMouseDrop = true;
79-
this.isMouseMove = false;
80-
// 阻止拖拽过程中选中文本
81-
document.onselectstart = () => {
82-
return false;
82+
this.positionInfo = {
83+
x: e.clientX - footerChannel.offsetLeft,
84+
y: e.clientY - footerChannel.offsetTop
8385
}
84-
// 这里无法在元素上使用@mousemove,否则拖动会有卡顿
85-
// 使用setTimeout是防止点击的同时会触发move事件,这时正常的点击事件是不会触发的。
86-
setTimeout(() => {
87-
document.onmousemove = (e) => {
88-
89-
if (this.isMouseDrop) {
90-
this.isMouseMove = true;
91-
const footerChannel = this.$refs.footerChannel;
92-
let x = e.clientX - this.moveX;
93-
let y = e.clientY - this.moveY;
94-
// 限制拖动范围
95-
let maxX = document.documentElement.clientWidth - 120;
96-
let maxY = document.documentElement.clientHeight - 60;
97-
if (this.moveX <= 0) {
98-
maxX = document.documentElement.scrollWidth - 120;
99-
}
100-
if (this.moveY <= 0) {
101-
maxY = document.documentElement.scrollHeight - 60;
102-
}
103-
x = Math.min(maxX, Math.max(0, x));
104-
y = Math.min(maxY, Math.max(0, y));
105-
if(e.clientX > maxX+120 || e.clientY > maxY+60 || e.clientX < 0 || e.clientY < 0){
106-
this.oMouseUp()
107-
}
108-
footerChannel.style.left = x + 'px';
109-
footerChannel.style.top = y + 'px';
110-
}
111-
}
112-
}, 0)
86+
this.isMouseMove = false;
87+
this.isMouseDown = true;
11388
},
114-
oMouseUp() {
115-
// 清空onmousemove方法
116-
document.onmousemove = null;
117-
this.isMouseDrop = false;
118-
setTimeout(() => {
119-
this.isMouseMove = false;
120-
}, 200)
121-
// 恢复document的文本选中功能
122-
document.onselectstart = () => {
123-
return true;
89+
onMouseMove(e) {
90+
const footerChannel = this.$refs.footerChannel;
91+
if (!this.isMouseDown) return
92+
let x = e.clientX - this.positionInfo.x
93+
let y = e.clientY - this.positionInfo.y
94+
if (x > document.documentElement.clientWidth - 40) {
95+
x = document.documentElement.clientWidth - 40
96+
}
97+
if (y > document.documentElement.clientHeight - 160) {
98+
y = document.documentElement.clientHeight - 160
99+
}
100+
if (x < 20) {
101+
x = 20
102+
}
103+
if (y < 20) {
104+
y = 20
105+
}
106+
footerChannel.style.left = x + 'px';
107+
footerChannel.style.top = y + 'px';
108+
if (Math.abs(e.movementX) > 10 || Math.abs(e.movementY) > 10) {
109+
this.isMouseMove = true;
124110
}
125111
},
126112
resetChannelPosition() {
113+
this.min = false
127114
const footerChannel = this.$refs.footerChannel;
128115
if (footerChannel) {
129-
footerChannel.style.left = document.documentElement.clientWidth - 120 + 'px';
130-
footerChannel.style.top = document.documentElement.clientHeight - 60 + 'px';
116+
footerChannel.style.left = document.documentElement.clientWidth - 80 + 'px';
117+
footerChannel.style.top = document.documentElement.clientHeight - 180 + 'px';
131118
}
132119
}
133120
},
121+
beforeDestroy() {
122+
window.removeEventListener('resize', this.resetChannelPosition)
123+
},
134124
};
135125
</script>
136126
<style src="./index.scss" lang="scss"></style>

web/packages/scriptis/module/header/index.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ export default {
106106
const url =
107107
location.origin + '/dss/linkis?noHeader=1&noFooter=1#/console'
108108
this.$router.push({
109-
name: 'commonIframe',
109+
path: '/commonIframe/linkis',
110110
query: {
111111
workspaceId: this.$route.query.workspaceId,
112112
url

web/packages/scriptis/router.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export const subAppRoutes = {
2424
},
2525
children: [
2626
{
27-
path: '/commonIframe',
27+
path: '/commonIframe/:appName',
2828
name: 'commonIframe',
2929
meta: {
3030
publicPage: true,

web/packages/workspace/module/bankHome/index.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ export default {
105105
} else {
106106
// util.windowOpen(item.url);
107107
this.$router.push({
108-
name: 'commonIframe',
108+
path: `/commonIframe/${item.title}`,
109109
query: {
110110
...this.$route.query,
111111
__noreplace: 1,

0 commit comments

Comments
 (0)