Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ selenium-debug.log
*.njsproj
*.sln
*.local
*.history

package-lock.json
yarn.lock
4 changes: 2 additions & 2 deletions mock/mock-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ const path = require('path')

const mockDir = path.join(process.cwd(), 'mock')

function registerRoutes(app) {
async function registerRoutes(app) {
let mockLastIndex
const { default: mocks } = require('./index.js')
const { default: mocks } = await import('./index.js')
for (const mock of mocks) {
app[mock.type](mock.url, mock.response)
mockLastIndex = app._router.stack.length
Expand Down
Binary file modified public/avatar.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/avatar_1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/avatar_bak.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/cd701950a4b57a46.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/favicon.ico
Binary file not shown.
Binary file added public/favicon_1.ico
Binary file not shown.
2 changes: 1 addition & 1 deletion public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<title><%= webpackConfig.name %></title>
</head>
<body>
<div id="app"></div>
<div id="dataxApp"></div>
<!-- built files will be auto injected -->
</body>
</html>
Binary file added public/logo-DataLink-light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/logo-DataLink.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
85 changes: 85 additions & 0 deletions public/logo-white.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/logo@7247x1171.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/App.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div id="app">
<div id="dataxApp">
<router-view />
</div>
</template>
Expand Down
2 changes: 1 addition & 1 deletion src/api/metadata-query.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export function createTable(params) {
return request({
url: '/api/metadata/createTable',
method: 'post',
params
data: params
})
}
// 判断字段是否存在,存在,即更新值,否则添加字段
Expand Down
13 changes: 7 additions & 6 deletions src/layout/components/Sidebar/Logo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,18 @@
<transition name="sidebarLogoFade">
<router-link v-if="collapse" key="collapse" class="sidebar-logo-link" to="/">
<img v-if="logo" :src="logo" class="sidebar-logo">
<h1 v-else class="sidebar-title">{{ title }} </h1>
<!-- <h1 v-else class="sidebar-title">{{ title }} </h1> -->
</router-link>
<router-link v-else key="expand" class="sidebar-logo-link" to="/">
<img v-if="logo" :src="logo" class="sidebar-logo">
<h1 class="sidebar-title">{{ title }} </h1>
<!-- <h1 class="sidebar-title">{{ title }} </h1> -->
</router-link>
</transition>
</div>
</template>

<script>
import LogoImg from '../../../../public/logo@7247x1171.png'
export default {
name: 'SidebarLogo',
props: {
Expand All @@ -24,8 +25,8 @@ export default {
},
data() {
return {
title: 'Vue Element Admin',
logo: 'https://wpimg.wallstcn.com/69a1c46c-eb1c-4b46-8bd4-e9e686ef5251.png'
title: 'Data Link',
logo: LogoImg
}
}
}
Expand Down Expand Up @@ -55,8 +56,8 @@ export default {
width: 100%;

& .sidebar-logo {
width: 32px;
height: 32px;
// width: 32px;
height: 25px;
vertical-align: middle;
margin-right: 12px;
}
Expand Down
41 changes: 33 additions & 8 deletions src/main.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import Vue from 'vue'

import './public-path'
import Vue from 'vue'
import VueRouter from 'vue-router';
import Cookies from 'js-cookie'

import 'normalize.css/normalize.css' // a modern alternative to CSS resets
Expand All @@ -12,7 +14,6 @@ import '@/styles/index.scss' // global css
import App from './App'
import store from './store'
import router from './router'

import './icons' // icon
import './permission' // permission control
import './utils/error-log' // error log
Expand Down Expand Up @@ -44,9 +45,33 @@ Object.keys(filters).forEach(key => {

Vue.config.productionTip = false

new Vue({
el: '#app',
router,
store,
render: h => h(App)
})
let instance = null

const render = (props) => {
const { container } = props;
instance = new Vue({
el: '#dataxApp',
router,
store,
render: h => h(App)
}).$mount(container ? container.querySelector('#dataxApp') : '#dataxApp')
}

if (!window.__POWERED_BY_QIANKUN__) {
render(document);
}

export async function bootstrap(props) {
console.log('[vue] vue app bootstraped', props)
Vue.prototype.parentData = {...props.data}
}
export async function mount(props) {
console.log('[vue] props from main framework', props)
render(props)
}
export async function unmount() {
instance.$destroy()
instance.$el.innerHTML = ''
instance = null
// router = null;
}
3 changes: 3 additions & 0 deletions src/public-path.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
if (window.__POWERED_BY_QIANKUN__) {
__webpack_public_path__ = window.__INJECTED_PUBLIC_PATH_BY_QIANKUN__;
}
1 change: 1 addition & 0 deletions src/router/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@ export const asyncRoutes = [

const createRouter = () => new Router({
// mode: 'history', // require service support
base: window.__POWERED_BY_QIANKUN__ ? '/datax' : '/',
scrollBehavior: () => ({ y: 0 }),
routes: constantRoutes
})
Expand Down
4 changes: 2 additions & 2 deletions src/settings.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module.exports = {
title: 'Datax Web',
title: 'Data Link',

/**
* @type {boolean} true | false
Expand All @@ -23,7 +23,7 @@ module.exports = {
* @type {boolean} true | false
* @description Whether show the logo in sidebar
*/
sidebarLogo: false,
sidebarLogo: true,

/**
* @type {string | array} 'production' | ['production', 'development']
Expand Down
2 changes: 1 addition & 1 deletion src/styles/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ html {
box-sizing: border-box;
}

#app {
#dataxApp {
height: 100%;
}

Expand Down
2 changes: 1 addition & 1 deletion src/styles/sidebar.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#app {
#dataxApp {

.main-container {
min-height: 100%;
Expand Down
1 change: 1 addition & 0 deletions src/views/datax/jobInfo/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,7 @@ export default {
readerTable: ''
},
resetTemp() {
console.log('%cindex.vue line:428 this.$options', 'color: white; background-color: #007acc;', this.$options.data())
this.temp = this.$options.data().temp
this.jobJson = ''
this.glueSource = ''
Expand Down
15 changes: 13 additions & 2 deletions src/views/datax/json-build/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -143,18 +143,27 @@ export default {
}
}
},
watch: {
'$route': function(to, from) {
if (to.name === 'JsonBuild') {
location.reload()
}
}
},
created() {
// this.getJdbcDs()
},
methods: {
next() {
const fromColumnList = this.$refs.reader.getData().columns
const toColumnsList = this.$refs.writer.getData().columns
// const fromTableName = this.$refs.reader.getData().tableName
const fromTableName = this.$refs.reader.getData().tableName
const readerDatabase = this.$refs.reader.getReaderDatabase()
// 第一步 reader 判断是否已选字段
if (this.active === 1) {
// 实现第一步骤读取的表和字段直接带到第二步骤
// this.$refs.writer.sendTableNameAndColumns(fromTableName, fromColumnList)
this.$refs.writer.sendNewTableNameAndColumns(readerDatabase, fromColumnList, fromTableName)
// 取子组件的数据
// console.info(this.$refs.reader.getData())
this.active++
Expand All @@ -173,7 +182,9 @@ export default {
duration: 2000
})
// 切回第一步
this.active = 1
// this.active = 1
// 跳转到任务管理
this.$router.push('/datax/job/jobInfo')
})
} else {
this.active++
Expand Down
3 changes: 3 additions & 0 deletions src/views/datax/json-build/reader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ export default {
showDataSource(data) {
this.dataSource = data
this.getData()
},
getReaderDatabase() {
return this.$refs.rdbmsreader.getReaderDatabase()
}
}
}
Expand Down
9 changes: 9 additions & 0 deletions src/views/datax/json-build/reader/RDBMSReader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,17 @@ export default {
datasourceId: [{ required: true, message: 'this is required', trigger: 'change' }],
tableName: [{ required: true, message: 'this is required', trigger: 'change' }],
tableSchema: [{ required: true, message: 'this is required', trigger: 'change' }]
},
readerDatabase: {
datasourceId: '',
rDsList: []
}
}
},
watch: {
'readerForm.datasourceId': function(oldVal, newVal) {
this.readerDatabase.datasourceId = newVal || oldVal
this.readerDatabase.rDsList = this.rDsList
if (this.dataSource === 'postgresql' || this.dataSource === 'oracle' || this.dataSource === 'sqlserver') {
this.getSchema()
} else {
Expand Down Expand Up @@ -220,6 +226,9 @@ export default {
this.readerForm.datasourceId = Bus.dataSourceId
}
return this.readerForm
},
getReaderDatabase() {
return this.readerDatabase
}
}
}
Expand Down
5 changes: 5 additions & 0 deletions src/views/datax/json-build/writer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ export default {
sendTableNameAndColumns(fromTableName, fromColumnList) {
this.$refs.hivewriter.fromTableName = fromTableName
this.$refs.hivewriter.fromColumnList = fromColumnList
},
sendNewTableNameAndColumns(originTableNames, originColumnList, originTableName) {
this.$refs.rdbmswriter.originTableNames = originTableNames
this.$refs.rdbmswriter.originColumnList = originColumnList
this.$refs.rdbmswriter.originTableName = originTableName
}
}
}
Expand Down
Loading