Skip to content

Commit 60cec01

Browse files
authored
Merge pull request #5 from xtt55/fix-origin
Revision of the text
2 parents 323b342 + 933f3b4 commit 60cec01

File tree

6 files changed

+35
-33
lines changed

6 files changed

+35
-33
lines changed

src/js/module/hdfsSidebar/index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@ export default {
1313
},
1414
methods: {
1515
showTree(arg, cb) {
16-
const WorkSpace = Vue.extend(require('./hdfsSidebar.vue'));
17-
const newW = new WorkSpace();
16+
const ws = require('./hdfsSidebar.vue');
17+
const WSComp = Vue.extend(ws.default);
18+
const newW = new WSComp();
1819
cb(newW);
1920
},
2021
},

src/js/module/hiveSidebar/index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,9 @@ export default {
4545
});
4646
},
4747
showHive(arg, cb) {
48-
const Hive = Vue.extend(require('./hiveSidebar.vue'));
49-
const newW = new Hive();
48+
const hive = require('./hiveSidebar.vue');
49+
const HiveComp = Vue.extend(hive.default);
50+
const newW = new HiveComp();
5051
cb(newW);
5152
},
5253
},

src/js/module/workSidebar/index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@ export default {
1414
methods: {
1515
showTree(arg, cb) {
1616
// get tree
17-
const WorkSpace = Vue.extend(require('./workSidebar.vue'));
18-
const newW = new WorkSpace();
17+
const ws = require('./workSidebar.vue');
18+
const WSComp = Vue.extend(ws.default);
19+
const newW = new WSComp();
1920
cb(newW);
2021
},
2122
},

src/js/module/workbench/container.vue

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ import util from '@/js/util';
116116
import title from './title.vue';
117117
import body from './body.vue';
118118
import saveAs from './script/saveAs.vue';
119-
import {Work} from './modal.js';
119+
import { Work } from './modal.js';
120120
import _ from 'lodash';
121121
122122
export default {
@@ -148,7 +148,7 @@ export default {
148148
rightTab: 0,
149149
},
150150
isControlBtnShow: false,
151-
tips: '什么是Scriptis(意书)?\n意书是微众银行微数域(WeDataSphere)打造的一站式交互式数据探索分析工具,以任意桥(Linkis)做为内核,提供多种计算存储引擎(如Spark、Hive、TiDB等)、Hive数据库管理功能、资源(如Yarn资源、服务器资源)管理、应用管理和各种用户资源(如UDF、变量等)管理的能力。\n如何使用Scriptest(意书)?\n1. 选中工作空间的目录,创建文件夹;\n2. 右键某个文件夹 =>新建脚本;\n3. 选择脚本类型,如:SQL、Pyspark、HQL等;\n4. 书写脚本,点击执行,生成结果集\n5. 结果集左上角,点击【可视化】,生成可视化的图报表',
151+
tips: '什么是Scriptis(意书)?\n意书是微众银行微数域(WeDataSphere)打造的一站式交互式数据探索分析工具,以任意桥(Linkis)做为内核,提供多种计算存储引擎(如Spark、Hive、TiSpark等)、Hive数据库管理功能、资源(如Yarn资源、服务器资源)管理、应用管理和各种用户资源(如UDF、变量等)管理的能力。\n如何使用Scriptest(意书)?\n1. 选中工作空间的目录,创建文件夹;\n2. 右键某个文件夹 =>新建脚本;\n3. 选择脚本类型,如:SQL、Pyspark、HQL等;\n4. 书写脚本,点击执行,生成结果集。',
152152
isTopPanelFull: false,
153153
loading: false,
154154
};
@@ -161,7 +161,7 @@ export default {
161161
watch: {
162162
current(val, oldVal) {
163163
if (oldVal) {
164-
this.dispatch('Workbench:setResultCache', {id: oldVal});
164+
this.dispatch('Workbench:setResultCache', { id: oldVal });
165165
this.revealInSidebar();
166166
}
167167
},
@@ -217,7 +217,7 @@ export default {
217217
});
218218
});
219219
// 在获取到hive信息后再打开缓存的tab页信息
220-
this.getWorkList({list: []}).then(() => {
220+
this.getWorkList({ list: [] }).then(() => {
221221
this.openQueryTab();
222222
this.$nextTick(() => {
223223
this.loading = false;
@@ -268,7 +268,7 @@ export default {
268268
}
269269
// 这种情况适用于初始化系统是/consle,然后打开全局历史的查看
270270
// 必须打开缓存的tab后再打开从全局历史传递来的query,否在无法被选中
271-
this.getWorkList({list: cache.tabList}).then(() => {
271+
this.getWorkList({ list: cache.tabList }).then(() => {
272272
this.openQueryTab();
273273
this.$nextTick(() => {
274274
this.loading = false;
@@ -280,7 +280,7 @@ export default {
280280
}
281281
});
282282
},
283-
getWorkList({list}) {
283+
getWorkList({ list }) {
284284
return new Promise((resolve, reject) => {
285285
this.dispatch('IndexedDB:getTabs', (worklist) => {
286286
worklist.forEach((work) => {
@@ -329,7 +329,7 @@ export default {
329329
});
330330
}
331331
// 如果已经在tabs中,则打开
332-
let repeatWork = _.find(this.worklist, (work) => work.id==option.id);
332+
let repeatWork = _.find(this.worklist, (work) => work.id == option.id);
333333
let work = null;
334334
if (!repeatWork) {
335335
if (this.worklist.length >= 10) {
@@ -438,17 +438,17 @@ export default {
438438
'Workbench:saveAs'(work) {
439439
this.$refs.saveAs.open(work);
440440
},
441-
'Workbench:updateTab'({newNode, findWork, oldLabel}, cb) {
441+
'Workbench:updateTab'({ newNode, findWork, oldLabel }, cb) {
442442
const work = findWork || _.find(this.worklist, (work) => {
443443
return work.filename === oldLabel;
444444
});
445445
if (work) {
446446
const newKey = util.md5(newNode.path);
447-
const modifyLog = this.dispatch('IndexedDB:changeLogKey', {oldKey: work.id, newKey});
448-
const modifyHistory = this.dispatch('IndexedDB:changeHistoryKey', {oldKey: work.id, newKey});
449-
const modifyResult = this.dispatch('IndexedDB:changResultKey', {oldKey: work.id, newKey});
450-
const modifyProgress = this.dispatch('IndexedDB:changProgressKey', {oldKey: work.id, newKey});
451-
const modifyTab = this.dispatch('IndexedDB:changeTabKey', {oldKey: work.id, newKey});
447+
const modifyLog = this.dispatch('IndexedDB:changeLogKey', { oldKey: work.id, newKey });
448+
const modifyHistory = this.dispatch('IndexedDB:changeHistoryKey', { oldKey: work.id, newKey });
449+
const modifyResult = this.dispatch('IndexedDB:changResultKey', { oldKey: work.id, newKey });
450+
const modifyProgress = this.dispatch('IndexedDB:changProgressKey', { oldKey: work.id, newKey });
451+
const modifyTab = this.dispatch('IndexedDB:changeTabKey', { oldKey: work.id, newKey });
452452
Promise.all([modifyLog, modifyHistory, modifyResult, modifyProgress, modifyTab]).then(() => {
453453
setTimeout(() => {
454454
// 在重命名成功后重新打开tab;
@@ -518,8 +518,8 @@ export default {
518518
* @return {Promise}
519519
*/
520520
removeWork(work) {
521-
return new Promise((resolve, reject)=>{
522-
let doRemove = ()=>{
521+
return new Promise((resolve, reject) => {
522+
let doRemove = () => {
523523
let index = this.worklist.indexOf(work);
524524
if (index != -1) {
525525
this.worklist.splice(index, 1);
@@ -565,20 +565,20 @@ export default {
565565
if (work.unsave) {
566566
this.chooseWork(work);
567567
this.showCloseModal = true;
568-
this.closeModal.cancel = ()=> {
568+
this.closeModal.cancel = () => {
569569
this.showCloseModal = false;
570570
this.close = new Function();
571571
this.save = new Function();
572572
this.saveAs = new Function();
573573
resolve();
574574
},
575-
this.closeModal.close = ()=> {
575+
this.closeModal.close = () => {
576576
this.showCloseModal = false;
577577
doRemove();
578578
};
579579
if (!work.saveAs) {
580580
this.closeModal.text = `脚本 ${work.filename} 已发生改变,是否保存?`;
581-
this.closeModal.save = ()=>{
581+
this.closeModal.save = () => {
582582
this.showCloseModal = false;
583583
this.dispatch('Workbench:save', work);
584584
doRemove();
@@ -588,7 +588,7 @@ export default {
588588
const scriptText = work.type === 'hdfsScript' ? `只读脚本 ${work.filename} 已发生改变,是否另存至工作空间?` : `临时脚本 ${work.filename} 已发生改变,是否另存为文件?`;
589589
this.closeModal.text = scriptText;
590590
this.closeModal.save = null;
591-
this.closeModal.saveAs = ()=>{
591+
this.closeModal.saveAs = () => {
592592
this.dispatch('Workbench:saveAs', work);
593593
};
594594
}
@@ -615,7 +615,7 @@ export default {
615615
needCloseTabs = this.worklist.slice(0);
616616
break;
617617
case 'left':
618-
for (let i=0; i<this.workListLength; i++) {
618+
for (let i = 0; i < this.workListLength; i++) {
619619
if (this.worklist[i].id != this.current) {
620620
needCloseTabs.push(this.worklist[i]);
621621
} else {
@@ -624,7 +624,7 @@ export default {
624624
}
625625
break;
626626
case 'right':
627-
for (let i=this.workListLength-1; i>0; i--) {
627+
for (let i = this.workListLength - 1; i > 0; i--) {
628628
if (this.worklist[i].id != this.current) {
629629
needCloseTabs.push(this.worklist[i]);
630630
} else {
@@ -667,7 +667,7 @@ export default {
667667
668668
// 获取高亮的方法名
669669
getMethodName(args) {
670-
let {type, isInvert} = args;
670+
let { type, isInvert } = args;
671671
const lib = {
672672
workspaceScript: 'WorkSidebar:setHighLight',
673673
hdfsScript: 'HdfsSidebar:setHighLight',
@@ -767,7 +767,7 @@ export default {
767767
}
768768
},
769769
revealInSidebar(work) {
770-
let currentWork = work || this.worklist.find((item)=>item.id===this.current);
770+
let currentWork = work || this.worklist.find((item) => item.id === this.current);
771771
if (currentWork) {
772772
this.dispatch('WorkSidebar:revealInSideBar', currentWork);
773773
}
@@ -776,4 +776,3 @@ export default {
776776
};
777777
</script>
778778
<style src="./index.scss" lang="scss"></style>
779-

src/js/module/workbench/script/editor.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ export default {
112112
return this.script.running;
113113
},
114114
isHdfs() {
115-
return this.work.filepath.indexOf('/tmp') === 7;
115+
return this.work.filepath.indexOf('hdfs') === 0;
116116
},
117117
},
118118
watch: {

src/js/module/workbench/script/script.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -757,9 +757,9 @@ export default {
757757
scriptContent: this.script.data,
758758
params: this.formatParams(this.script.params),
759759
};
760-
const isHdfs = this.work.filepath.indexOf('/tmp');
760+
const isHdfs = this.work.filepath.indexOf('hdfs') === 0;
761761
if (this.script.data) {
762-
if (this.work.unsave && isHdfs !== 0) {
762+
if (this.work.unsave && !isHdfs) {
763763
if (this.work.filepath) {
764764
this.work.unsave = false;
765765
this.saveLoading = true;

0 commit comments

Comments
 (0)