Browse Source

Change all Chinese names to English (#1207)

* Modify webpack configuration

* Change all Chinese names to English
pull/2/head
break60 5 years ago committed by qiaozhanwei
parent
commit
01c2b12d57
  1. 12
      dolphinscheduler-ui/build/combo.js
  2. 2
      dolphinscheduler-ui/build/config.js
  3. 62
      dolphinscheduler-ui/src/js/conf/home/pages/monitor/pages/servers/_source/gaugeOption.js
  4. 2
      dolphinscheduler-ui/src/js/conf/home/pages/monitor/pages/servers/alert.vue
  5. 2
      dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/_source/instanceConditions/common.js
  6. 4
      dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/definition/pages/list/_source/email.vue
  7. 2
      dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/index/_source/defineUserCount.vue
  8. 14
      dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/instance/pages/gantt/_source/gantt.js
  9. 8
      dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/instance/pages/gantt/index.vue
  10. 34
      dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/instance/pages/list/index.vue
  11. 8
      dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/taskInstance/index.vue
  12. 2
      dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/create/index.vue
  13. 2
      dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/details/_source/utils.js
  14. 2
      dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/details/index.vue
  15. 3
      dolphinscheduler-ui/src/js/conf/home/pages/security/pages/warningGroups/_source/list.vue
  16. 44
      dolphinscheduler-ui/src/js/module/ana-charts/common.js
  17. 10
      dolphinscheduler-ui/src/js/module/ana-charts/index.js
  18. 84
      dolphinscheduler-ui/src/js/module/ana-charts/packages/bar/index.js
  19. 10
      dolphinscheduler-ui/src/js/module/ana-charts/packages/base.js
  20. 30
      dolphinscheduler-ui/src/js/module/ana-charts/packages/funnel/index.js
  21. 56
      dolphinscheduler-ui/src/js/module/ana-charts/packages/line/index.js
  22. 30
      dolphinscheduler-ui/src/js/module/ana-charts/packages/pie/index.js
  23. 34
      dolphinscheduler-ui/src/js/module/ana-charts/packages/radar/index.js
  24. 34
      dolphinscheduler-ui/src/js/module/ana-charts/packages/scatter/index.js
  25. 6
      dolphinscheduler-ui/src/js/module/components/crontab/source/_source/input-number.vue
  26. 64
      dolphinscheduler-ui/src/js/module/components/crontab/source/_times/day.vue
  27. 44
      dolphinscheduler-ui/src/js/module/components/crontab/source/_times/hour.vue
  28. 42
      dolphinscheduler-ui/src/js/module/components/crontab/source/_times/minute.vue
  29. 42
      dolphinscheduler-ui/src/js/module/components/crontab/source/_times/month.vue
  30. 46
      dolphinscheduler-ui/src/js/module/components/crontab/source/_times/second.vue
  31. 44
      dolphinscheduler-ui/src/js/module/components/crontab/source/_times/year.vue
  32. 8
      dolphinscheduler-ui/src/js/module/components/crontab/source/app.vue
  33. 6
      dolphinscheduler-ui/src/js/module/components/crontab/source/util/index.js
  34. 18
      dolphinscheduler-ui/src/js/module/components/secondaryMenu/_source/menu.js

12
dolphinscheduler-ui/build/combo.js

@ -55,7 +55,7 @@ var jslibs = {
'local': []
}
// css集合
// css
csslibs = {
'base': [
'normalize/7.0.0/normalize.min.css',
@ -72,14 +72,14 @@ csslibs = {
]
}
// 创建文件夹目录
// Create folder directory
var dirPath = path.resolve(__dirname, '..', 'src/combo/' + version)
if (!fs.existsSync(dirPath)) {
fs.mkdirSync(dirPath)
console.log('文件夹创建成功')
console.log('Folder created successfully')
} else {
console.log('文件夹已存在')
console.log('Folder already exists')
}
var jsKeys = Object.keys(jslibs)
@ -93,7 +93,7 @@ jsUrl.forEach((v, i) => {
var stream = fs.createWriteStream(path.join(dirPath, jsKeys[i] + '.js'), { encoding: 'utf-8' })
request(url).pipe(stream).on('close', function (err) {
if (!err) {
console.log('文件[' + version + '/' + jsKeys[i] + '.js' + ']下载完毕')
console.log('file[' + version + '/' + jsKeys[i] + '.js' + ']Download completed')
}
})
})
@ -109,7 +109,7 @@ cssUrl.forEach((v, i) => {
var stream = fs.createWriteStream(path.join(dirPath, cssKeys[i] + '.css'), { encoding: 'utf-8' })
request(url).pipe(stream).on('close', function (err) {
if (!err) {
console.log('文件[' + version + '/' + cssKeys[i] + '.css' + ']下载完毕')
console.log('file[' + version + '/' + cssKeys[i] + '.css' + ']Download completed')
}
})
})

2
dolphinscheduler-ui/build/config.js

@ -65,7 +65,7 @@ const minifierConfig = isProduction ? {
const getPageEntry = view => jsEntry[view] ? view : ''
// 重新定向输出页面
// Redirect output page
const pageRewriter = {
'view/home/index.*': 'index.html'
}

62
dolphinscheduler-ui/src/js/conf/home/pages/monitor/pages/servers/_source/gaugeOption.js

@ -19,47 +19,47 @@ export default function (value) {
series: [
{
type: 'gauge',
center: ['50%', '45%'], // 仪表位置
radius: '80%', // 仪表大小
startAngle: 200, // 开始角度
endAngle: -20, // 结束角度
center: ['50%', '45%'], // Instrument position
radius: '80%', // Instrument size
startAngle: 200, // Starting angle
endAngle: -20, // End angle
axisLine: {
show: false,
lineStyle: { // 属性lineStyle控制线条样式
lineStyle: { // Property linestyle controls line style
color: [
[ 0.5, new echarts.graphic.LinearGradient(0, 0, 1, 0, [{ // eslint-disable-line
offset: 1,
color: '#E75F25' // 50% 处的颜色
color: '#E75F25' // 50% Color in place
}, {
offset: 0.8,
color: '#D9452C' // 40% 处的颜色
}], false) ], // 100% 处的颜色
color: '#D9452C' // 40% Color in place
}], false) ], // 100% Color in place
[ 0.7, new echarts.graphic.LinearGradient(0, 0, 1, 0, [{ // eslint-disable-line
offset: 1,
color: '#FFC539' // 70% 处的颜色
color: '#FFC539' // 70% Color in place
}, {
offset: 0.8,
color: '#FE951E' // 66% 处的颜色
color: '#FE951E' // 66% Color in place
}, {
offset: 0,
color: '#E75F25' // 50% 处的颜色
color: '#E75F25' // 50% Color in place
}], false) ],
[ 0.9, new echarts.graphic.LinearGradient(0, 0, 0, 1, [{ // eslint-disable-line
offset: 1,
color: '#C7DD6B' // 90% 处的颜色
color: '#C7DD6B' // 90% Color in place
}, {
offset: 0.8,
color: '#FEEC49' // 86% 处的颜色
color: '#FEEC49' // 86% Color in place
}, {
offset: 0,
color: '#FFC539' // 70% 处的颜色
color: '#FFC539' // 70% Color in place
}], false) ],
[1, new echarts.graphic.LinearGradient(0, 0, 0, 1, [ { // eslint-disable-line
offset: 0.2,
color: '#1CAD52' // 92% 处的颜色
color: '#1CAD52' // 92% Color in place
}, {
offset: 0,
color: '#C7DD6B' // 90% 处的颜色
color: '#C7DD6B' // 90% Color in place
}], false) ]
],
width: 10
@ -74,7 +74,7 @@ export default function (value) {
axisLabel: {
show: false
},
pointer: { // 指针样式
pointer: { // Pointer style
length: '45%'
},
detail: {
@ -83,34 +83,34 @@ export default function (value) {
},
{
type: 'gauge',
center: ['50%', '45%'], // 默认全局居中
center: ['50%', '45%'], // Default global center
radius: '70%',
startAngle: 200,
endAngle: -20,
axisLine: {
show: true,
lineStyle: { // 属性lineStyle控制线条样式
color: [ // 表盘颜色
[ 0.5, '#DA462C' ], // 0-50%处的颜色
[ 0.7, '#FF9618' ], // 51%-70%处的颜色
[ 0.9, '#FFED44' ], // 70%-90%处的颜色
[ 1, '#20AE51' ]// 90%-100%处的颜色
lineStyle: { // Property linestyle controls line style
color: [ // Dial Color
[ 0.5, '#DA462C' ], // 0-50%Color in place
[ 0.7, '#FF9618' ], // 51%-70%Color in place
[ 0.9, '#FFED44' ], // 70%-90%Color in place
[ 1, '#20AE51' ]// 90%-100%Color in place
],
width: 30// 表盘宽度
width: 30// Dial width
}
},
splitLine: { // 分割线样式(及10、20等长线样式)
splitLine: { // Split line style (and 10, 20 equal length line style)
length: 30,
lineStyle: { // 属性lineStyle控制线条样式
lineStyle: { // Property linestyle controls line style
width: 2
}
},
axisTick: { // 刻度线样式(及短线样式)
axisTick: { // Tick mark style (and short line style)
length: 20
},
axisLabel: { // 文字样式(及“10”、“20”等文字样式)
axisLabel: { // Text style (and text styles such as "10", "20")
color: 'black',
distance: 5 // 文字离表盘的距离
distance: 5 // Distance between text and dial
},
detail: {
formatter: '{score|{value}%}',
@ -120,7 +120,7 @@ export default function (value) {
rich: {
score: {
color: 'white',
fontFamily: '微软雅黑',
fontFamily: 'Microsoft YaHei',
fontSize: 32
}
}

2
dolphinscheduler-ui/src/js/conf/home/pages/monitor/pages/servers/alert.vue

@ -15,7 +15,7 @@
* limitations under the License.
*/
<template>
<m-list-construction title="Alert服务">
<m-list-construction title="Alert Service">
<template slot="content">
<template v-if="masterList.length">
<m-list :list="masterList"></m-list>

2
dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/_source/instanceConditions/common.js

@ -18,7 +18,7 @@
import i18n from '@/module/i18n'
/**
* 状态码表
* State code table
*/
let stateType = [
{

4
dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/definition/pages/list/_source/email.vue

@ -146,7 +146,7 @@
* Carriage return
*/
_emailEnter () {
// list
// not list Hand filling
if (!this.emailList.length) {
this._manualEmail()
return
@ -157,7 +157,7 @@
* delete email
*/
_emailDelete () {
//
// Do not delete in case of input method in Chinese
if (!this.isCn) {
this.emailWidth = 0
if (_.isInteger(this.activeIndex)) {

2
dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/index/_source/defineUserCount.vue

@ -56,7 +56,7 @@
})
const myChart = Chart.bar('#process-definition-bar', this.defineUserList, {})
myChart.echart.setOption(bar)
//
// Jump not allowed on home page
if (this.projectId) {
myChart.echart.on('click', e => {
this.$router.push({

14
dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/instance/pages/gantt/_source/gantt.js

@ -66,16 +66,16 @@ Gantt.prototype.init = function ({ el, tasks }) {
.orient('left')
.tickSize(0)
// 时间纬度
// time dimension
this.compXAxisTimes()
// 时间刻度计算
// Timescale calculation
this.initializeXAxis()
// 绘制图表
// Drawing charts
this.drawChart()
}
/**
* 计算时间纬度
* Calculate time latitude
*/
Gantt.prototype.compXAxisTimes = function () {
if (this.tasks === undefined || this.tasks.length < 1) {
@ -90,7 +90,7 @@ Gantt.prototype.compXAxisTimes = function () {
}
/**
* 时间刻度处理
* Timescale processing
*/
Gantt.prototype.initializeXAxis = function () {
this.x = d3.time.scale()
@ -116,7 +116,7 @@ Gantt.prototype.initializeXAxis = function () {
}
/**
* 绘制图表
* Drawing charts
*/
Gantt.prototype.drawChart = function () {
const svg = d3.select(this.el)
@ -163,7 +163,7 @@ Gantt.prototype.drawChart = function () {
})
}
/**
* tip提示
* Tip prompt
*/
Gantt.prototype.tip = function (d) {
let str = `<div style="text-align: left;word-break:break-all">`

8
dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/instance/pages/gantt/index.vue

@ -55,15 +55,15 @@
name: 'instance-gantt-index',
data () {
return {
//
// Node state
tasksState: tasksState,
// loading
isLoading: true,
// gantt
// gantt data
ganttData: {
taskNames: []
},
//
// Data available
isNodata: false
}
},
@ -71,7 +71,7 @@
methods: {
...mapActions('dag', ['getViewGantt']),
/**
* 获取数据
* get data
*/
_getViewGantt () {
this.isLoading = true

34
dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/instance/pages/list/index.vue

@ -52,17 +52,17 @@
return {
// loading
isLoading: true,
//
// total
total: null,
//
// data
processInstanceList: [],
// Parameter
searchParams: {
//
// Search keywords
searchVal: '',
//
// Number of pages
pageSize: 10,
//
// Current page
pageNo: 1,
// host
host: '',
@ -87,7 +87,7 @@
this._debounceGET()
},
/**
* 分页事件
* Paging event
*/
_page (val) {
this.searchParams.pageNo = val
@ -95,7 +95,7 @@
this._debounceGET()
},
/**
* 获取list数据
* get list data
*/
_getProcessInstanceListP (flag) {
this.isLoading = !flag
@ -109,20 +109,20 @@
})
},
/**
* 更新
* update
*/
_onUpdate () {
this._debounceGET()
},
/**
* 路由变动
* Routing changes
*/
_routerView () {
return this.$route.name === 'projects-instance-details'
},
/**
* 防抖请求接口
* @desc 防止函数多次被调用
* Anti shake request interface
* @desc Prevent functions from being called multiple times
*/
_debounceGET: _.debounce(function (flag) {
this._getProcessInstanceListP(flag)
@ -132,7 +132,7 @@
})
},
watch: {
//
// Routing changes
'$route' (a, b) {
if (a.name === 'instance' && b.name === 'projects-instance-details') {
this._debounceGET()
@ -149,27 +149,27 @@
}
},
created () {
// id
// Delete process definition ID
localStore.removeItem('subProcessId')
//
// Route parameter merge
if (!_.isEmpty(this.$route.query)) {
this.searchParams = _.assign(this.searchParams, this.$route.query)
}
//
// Judge the request data according to the route
if (!this._routerView()) {
this._debounceGET()
}
},
mounted () {
//
// Cycle acquisition status
this.setIntervalP = setInterval(() => {
this._debounceGET('false')
}, 90000)
},
beforeDestroy () {
//
// Destruction wheel
clearInterval(this.setIntervalP)
},
components: { mList, mInstanceConditions, mSpin, mListConstruction, mSecondaryMenu, mNoData }

8
dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/taskInstance/index.vue

@ -108,8 +108,8 @@
})
},
/**
* 防抖请求接口
* @desc 防止函数多次被调用
* Anti shake request interface
* @desc Prevent functions from being called multiple times
*/
_debounceGET: _.debounce(function (flag) {
this._getList(flag)
@ -131,13 +131,13 @@
created () {
},
mounted () {
//
// Cycle acquisition status
this.setIntervalP = setInterval(() => {
this._debounceGET('false')
}, 90000)
},
beforeDestroy () {
//
// Destruction wheel
clearInterval(this.setIntervalP)
},
components: { mList, mInstanceConditions, mSpin, mListConstruction, mSecondaryMenu, mNoData }

2
dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/create/index.vue

@ -166,7 +166,7 @@
this._handlerEditor()
},
destroyed () {
editor.toTextArea() //
editor.toTextArea() // uninstall
editor.off($('.code-create-mirror'), 'keypress', this.keypress)
},
computed: {},

2
dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/details/_source/utils.js

@ -16,7 +16,7 @@
*/
/**
* 处理后缀名
* Processing suffix
*/
const handlerSuffix = {
'.txt': 'textile',

2
dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/details/index.vue

@ -195,7 +195,7 @@
},
mounted () {
if (this.isNoType) {
//
// get data
this._getViewResources()
}
},

3
dolphinscheduler-ui/src/js/conf/home/pages/security/pages/warningGroups/_source/list.vue

@ -78,8 +78,7 @@
<x-button type="primary" size="xsmall" shape="circle" @click="_delete(item,$index)">{{$t('Confirm')}}</x-button>
</div>
<template slot="reference">
<x-button v-if="item.id==1" type="error" shape="circle" size="xsmall" data-toggle="tooltip" icon="iconfont icon-shanchu" :title="$t('delete')" disabled></x-button>
<x-button v-else type="error" shape="circle" size="xsmall" data-toggle="tooltip" icon="iconfont icon-shanchu" :title="$t('delete')"></x-button>
<x-button type="error" shape="circle" size="xsmall" data-toggle="tooltip" icon="iconfont icon-shanchu" :title="$t('delete')" :disabled="item.id==1?true: false"></x-button>
</template>
</x-poptip>
</td>

44
dolphinscheduler-ui/src/js/module/ana-charts/common.js

@ -1,9 +1,25 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* 根据参数找到容器并初始化图表然后返回一个或者一组图表实例
* @param {*} Target 图表组件类
* @param {*} el 选择器或者 DOM 对象
* @param {*} data 数据源
* @param {*} options 可选项
* Find the container and initialize the chart according to the parameters, and then return one or a group of chart instances
* @param {*} Target Chart component class
* @param {*} el Selector or DOM object
* @param {*} data data source
* @param {*} options Optional
*/
export const init = (Target, el, data, options) => {
const list = getChartContainers(el)
@ -15,11 +31,11 @@ export const init = (Target, el, data, options) => {
}
/**
* 统一图表容器为 DOM 元素数组
* @param {*} el 选择器或者 DOM 对象
* Unified chart container is an array of DOM elements
* @param {*} el Selector or DOM object
*/
function getChartContainers (el) {
// 未传参数,直接返回
// Parameter not transmitted, return directly
if (!el) {
return
}
@ -33,7 +49,7 @@ function getChartContainers (el) {
}
}
if (!el) {
throw new Error('找不到对应的dom对象')
throw new Error('No corresponding DOM object found!')
}
let list
if (HTMLElement.prototype.isPrototypeOf(el)) {
@ -42,20 +58,20 @@ function getChartContainers (el) {
list = Array.from(el)
}
if (!list) {
throw new Error('未找到对应的dom对象')
throw new Error('No corresponding DOM object found!')
}
return list
}
/**
* 检测在指定对象中是否存在指定的属性名
* @param {Object} model 待检测模型
* @param {...any} params 待检测属性名
* Detects whether the specified property name exists in the specified object
* @param {Object} model Model to be tested
* @param {...any} params Property name to be tested
*/
export const checkKeyInModel = (model, ...params) => {
for (const key of params) {
if (!model.hasOwnProperty(key)) {
throw new Error('数据格式错误未找到指定属性' + key)
throw new Error('Data format error! The specified property was not found:' + key)
}
}
}

10
dolphinscheduler-ui/src/js/module/ana-charts/index.js

@ -34,15 +34,15 @@ const components = {
}
const Chart = {
// 默认配置
// Default configuration
settings: {},
/**
* 配置全局属性
* @param {Object} options 全局配置项
* Configure global properties
* @param {Object} options Global configuration item
*/
config (options) {
const { theme } = options
// 注册主题
// Registration theme
if (theme) {
checkKeyInModel(theme, 'name', 'data')
echarts.registerTheme(theme.name, theme.data)
@ -53,7 +53,7 @@ const Chart = {
}
}
// 注入不同组件对应方法
// Corresponding methods for injection of different components
for (const key in components) {
if (components.hasOwnProperty(key)) {
Chart[key.toLowerCase()] = (el, data, options) => {

84
dolphinscheduler-ui/src/js/module/ana-charts/packages/bar/index.js

@ -20,27 +20,27 @@ import { checkKeyInModel, init } from '../../common'
const TYPE = 'bar'
/**
* 柱状图
* Histogram
*/
export default class Bar extends Base {
/**
* 单独导出时调用的初始化方法
* @param {*} el 选择器或者 DOM 对象
* @param {*} data 数据源
* @param {*} options 可选项
* Initialization method called on separate export
* @param {*} el Selector or DOM object
* @param {*} data data source
* @param {*} options Optional
*/
static init (el, data, options) {
return init(Bar, el, data, options)
}
/**
* 将用户配置转换为符合 ECharts API 格式的配置格式
* Convert user configuration to a configuration format that conforms to the format of echarts API
*/
transform () {
const { data = [] } = this.settings
if (data.length === 0) {
throw new Error('数据源为空')
throw new Error('Data source is empty')
}
if (Object.keys(data[0]).length > 2) {
@ -52,22 +52,22 @@ export default class Bar extends Base {
}
/**
* 单条柱
* Single column
*/
setSingleBar () {
const {
// 数据
// data
data = [],
// 属性字典
// Attribute dictionary
keyMap = {
xAxisKey: 'key',
dataKey: 'value'
},
// 图表标题
title = '单条柱状图'
// Chart title
title = 'Single bar histogram'
} = this.settings
// x 轴对应属性名,数据值对应的属性名
// X axis corresponds to attribute name, data value corresponds to attribute name
const { xAxisKey, dataKey } = keyMap
checkKeyInModel(data[0], xAxisKey, dataKey)
@ -89,27 +89,27 @@ export default class Bar extends Base {
}
/**
* 多条柱
* Multiple columns
*/
setMultipleBars () {
const {
// 数据
// data
data = [],
// 属性字典
// Attribute dictionary
keyMap = {
xAxisKey: 'key',
legendKey: 'typeName',
dataKey: 'value'
},
// 图表标题
title = '多条柱状图',
// 折柱混合时,指定的折线数据索引
// Chart title
title = 'Multiple histogram',
// The specified index of polyline data when the column is mixed
lineTypes
} = this.settings
// x 轴对应属性名,图例对应的属性名,数据值对应的属性名
// Attribute name corresponding to X axis, legend and data value
const { xAxisKey, legendKey, dataKey } = keyMap
// 是否使用时间轴数据
// Use timeline data or not
const timeline = Object.keys(data[0]).length === 4
const timelineKey = keyMap.timelineKey || 'timeline'
if (timeline) {
@ -118,7 +118,7 @@ export default class Bar extends Base {
checkKeyInModel(data[0], xAxisKey, legendKey, dataKey)
}
// 规范折柱混合索引
// Standard mixed index of folded columns
let lineTypeList = []
if (lineTypes) {
if (!Array.isArray(lineTypes)) {
@ -128,7 +128,7 @@ export default class Bar extends Base {
}
}
// 时间轴默认配置
// Timeline default configuration
const timelineOptions = {
timeline: {
axisType: 'category',
@ -139,7 +139,7 @@ export default class Bar extends Base {
options: []
}
// 初始值
// Initial value
const legendData = []
const series = []
const xAxis = {
@ -151,24 +151,24 @@ export default class Bar extends Base {
const xAxisItem = data[i][xAxisKey]
const dataItem = data[i][dataKey]
// 图例
// Legend
if (!legendData.includes(legendItem)) {
legendData.push(legendItem)
}
// x
// x axis
if (!xAxis.data.includes(xAxisItem)) {
xAxis.data.push(xAxisItem)
}
// 时间轴
// time axis
if (timeline) {
const timelineItem = data[i][timelineKey]
// 设置时间轴 label
// Set timeline label
if (!timelineOptions.timeline.data.includes(timelineItem)) {
timelineOptions.timeline.data.push(timelineItem)
}
// 通用的系列配置
// Universal family configuration
if (!series.some(s => s.name === legendItem)) {
let seriesType = TYPE
if (lineTypeList.length !== 0 && lineTypeList.includes(legendItem)) {
@ -179,10 +179,10 @@ export default class Bar extends Base {
type: seriesType
})
}
// 系列数据
// Series data
let targetOptions = timelineOptions.options.find(o => o._helpName === timelineItem)
if (!targetOptions) {
// 初始化 option
// Initialization option
targetOptions = {
_helpName: timelineItem,
title: { text: title.replace('$timeline', timelineItem) },
@ -192,7 +192,7 @@ export default class Bar extends Base {
}
let targetSeries = targetOptions.series.find(d => d._helpName === legendItem)
if (!targetSeries) {
// 初始化系列数据
// Initialize series data
targetSeries = {
_helpName: legendItem,
data: []
@ -201,7 +201,7 @@ export default class Bar extends Base {
}
targetSeries.data.push(dataItem)
} else {
// 非时间轴数据处理
// Non timeline data processing
let targetSeries = series.find(s => s.name === legendItem)
if (!targetSeries) {
let seriesType = TYPE
@ -226,28 +226,28 @@ export default class Bar extends Base {
}
/**
* 绘制图表
* Drawing charts
*/
apply () {
const { title, xAxis, series, legendData, timelineOptions } = this.options
const {
// 是否为横向图
// Whether it is a horizontal drawing
reverseAxis = false,
// 自定义 y 轴
// Custom Y axis
yAxis,
// 是否为堆叠图
// Is it a stacking diagram
stack = false,
// 注入配置到 series
// Injection configuration to series
insertSeries
} = this.settings
const valueAxis = { type: 'value' }
let yAxisModel = reverseAxis ? xAxis : valueAxis
let xAxisModel = reverseAxis ? valueAxis : xAxis
// 使用自定义 y 轴覆盖
// Use custom Y-axis overlay
if (yAxis) {
yAxisModel = yAxis
}
// 设置堆叠图
// Set up stack chart
if (stack) {
series.forEach(set => {
set.stack = '总量'
@ -265,7 +265,7 @@ export default class Bar extends Base {
_series = this.injectDataIntoSeries(insertSeries, _series)
}
// 时间轴
// time axis
if (timelineOptions) {
let opts = {
baseOption: {
@ -293,7 +293,7 @@ export default class Bar extends Base {
this.echart.clear()
this.echart.setOption(opts, true)
} else {
// 简单图表标题为空时,图表垂直居中
// When the simple chart title is empty, the chart is vertically centered
const top = !title && this.simple ? '3%' : 60
let opts = {

10
dolphinscheduler-ui/src/js/module/ana-charts/packages/base.js

@ -24,23 +24,23 @@ export default class Base {
if (options) {
this.options = options
if (settings.theme) {
// 使用已经注册的自定义主题
// Use a registered custom theme
this.echart = echarts.init(element, settings.theme)
} else if (Chart.settings.defaultTheme) {
// 使用全局配置的主题
// Topics using global configuration
this.echart = echarts.init(element, Chart.settings.defaultTheme)
} else {
this.echart = echarts.init(element)
}
// 响应窗口 resize 事件
// Response window resize event
window.addEventListener('resize', () => this.echart.resize())
this.apply()
}
}
/**
* 刷新数据
* @param {*} data 图表数据
* refresh data
* @param {*} data Icon data
*/
setData (data) {
if (data && data.length !== 0) {

30
dolphinscheduler-ui/src/js/module/ana-charts/packages/funnel/index.js

@ -20,29 +20,29 @@ import { checkKeyInModel, init } from '../../common'
const TYPE = 'funnel'
/**
* 漏斗图
* Funnel plot
*/
export default class Funnel extends Base {
/**
* 单独导出时调用的初始化方法
* @param {*} el 选择器或者 DOM 对象
* @param {*} data 数据源
* @param {*} options 可选项
* Initialization method called on separate export
* @param {*} el Selector or DOM pair
* @param {*} data data source
* @param {*} options Optional
*/
static init (el, data, options) {
return init(Funnel, el, data, options)
}
/**
* 将用户配置转换为符合 ECharts API 格式的配置格式
* Convert user configuration to a configuration format that conforms to the format of echarts API
*/
transform () {
const {
// 数据
// data
data = [],
// 标题
title = '漏斗图',
// 属性字典
// title
title = 'Funnel plot',
// Attribute dictionary
keyMap = {
textKey: 'key',
dataKey: 'value'
@ -50,10 +50,10 @@ export default class Funnel extends Base {
} = this.settings
if (data.length === 0) {
throw new Error('数据源为空')
throw new Error('Data source is empty!')
}
// 文本对应属性名,数据值对应的属性名
// Attribute name corresponding to text and attribute name corresponding to data value
const { textKey, dataKey } = keyMap
checkKeyInModel(data[0], textKey, dataKey)
@ -99,7 +99,7 @@ export default class Funnel extends Base {
data: []
}]
// 填充数据
// Fill data
for (let i = 0; i < data.length; i++) {
const element = data[i]
const { [dataKey]: value, [textKey]: name, ...other } = element
@ -115,12 +115,12 @@ export default class Funnel extends Base {
}
/**
* 绘制图表
* Drawing charts
*/
apply () {
let { title, series, legendData } = this.options
// 注入配置到series
// Injection configuration to series
let { insertSeries } = this.settings
let _series = series
if (insertSeries && insertSeries.length && series.length) {

56
dolphinscheduler-ui/src/js/module/ana-charts/packages/line/index.js

@ -20,27 +20,27 @@ import { checkKeyInModel, init } from '../../common'
const TYPE = 'line'
/**
* 折线图
* Broken line diagram
*/
export default class Line extends Base {
/**
* 单独导出时调用的初始化方法
* @param {*} el 选择器或者 DOM 对象
* @param {*} data 数据源
* @param {*} options 可选项
* Initialization method called on separate export
* @param {*} el Selector or DOM object
* @param {*} data data source
* @param {*} options Optional
*/
static init (el, data, options) {
return init(Line, el, data, options)
}
/**
* 将用户配置转换为符合 ECharts API 格式的配置格式
* Convert user configuration to a configuration format that conforms to the format of echarts API
*/
transform () {
const { data = [] } = this.settings
if (data.length === 0) {
throw new Error('数据源为空')
throw new Error('Data source is empty!')
}
if (Object.keys(data[0]).length > 2) {
@ -52,22 +52,22 @@ export default class Line extends Base {
}
/**
* 单条折线
* Single broken line
*/
setSingleLine () {
const {
// 数据
// data
data = [],
// 属性字典
// Attribute dictionary
keyMap = {
xAxisKey: 'key',
dataKey: 'value'
},
// 图表标题
title = '单条折线图'
// Chart title
title = 'Single line chart'
} = this.settings
// x 轴对应属性名,数据值对应的属性名
// X axis corresponds to attribute name, data value corresponds to attribute name
const { xAxisKey, dataKey } = keyMap
checkKeyInModel(data[0], xAxisKey, dataKey)
@ -89,23 +89,23 @@ export default class Line extends Base {
}
/**
* 多条折线
* Multiple broken lines
*/
setMultipleLines () {
const {
// 数据
// data
data = [],
// 属性字典
// Attribute dictionary
keyMap = {
xAxisKey: 'key',
legendKey: 'typeName',
dataKey: 'value'
},
// 图表标题
title = '多条折线图'
// Chart title
title = 'Multiple line chart'
} = this.settings
// x 轴对应属性名,图例对应的属性名,数据值对应的属性名
// Attribute name corresponding to X axis, legend and data value
const { xAxisKey, legendKey, dataKey } = keyMap
checkKeyInModel(data[0], xAxisKey, legendKey, dataKey)
@ -121,17 +121,17 @@ export default class Line extends Base {
const xAxisItem = data[i][xAxisKey]
const dataItem = data[i][dataKey]
// 图例
// Legend
if (!legendData.includes(legendItem)) {
legendData.push(legendItem)
}
// x 轴
// X axis
if (!xAxis.data.includes(xAxisItem)) {
xAxis.data.push(xAxisItem)
}
// 系列
// series
let targetSeries = series.find(s => s.name === legendItem)
if (!targetSeries) {
targetSeries = {
@ -148,26 +148,26 @@ export default class Line extends Base {
}
/**
* 绘制图表
* Drawing charts
*/
apply () {
const { title, xAxis, series, legendData = [] } = this.options
const {
// 是否为横向图
// Whether it is a horizontal drawing
reverseAxis = false,
// 自定义 y 轴
// Custom Y axis
yAxis,
// 注入配置到 series
// Injection configuration to series
insertSeries
} = this.settings
const valueAxis = { type: 'value' }
let yAxisModel = reverseAxis ? xAxis : valueAxis
let xAxisModel = reverseAxis ? valueAxis : xAxis
// 使用自定义 y 轴覆盖
// Use custom Y-axis overlay
if (yAxis) {
yAxisModel = yAxis
}
// 简单图表标题为空时,图表垂直居中
// When the simple chart title is empty, the chart is vertically centered
const top = !title && this.simple ? '3%' : 60
let _series = series

30
dolphinscheduler-ui/src/js/module/ana-charts/packages/pie/index.js

@ -20,31 +20,31 @@ import { checkKeyInModel, init } from '../../common'
const TYPE = 'pie'
/**
* 饼图
* Pie chart
*/
export default class Pie extends Base {
/**
* 单独导出时调用的初始化方法
* @param {*} el 选择器或者 DOM 对象
* @param {*} data 数据源
* @param {*} options 可选项
* Initialization method called on separate export
* @param {*} el Selector or DOM object
* @param {*} data data source
* @param {*} options Optional
*/
static init (el, data, options) {
return init(Pie, el, data, options)
}
/**
* 将用户配置转换为符合 ECharts API 格式的配置格式
* Convert user configuration to a configuration format that conforms to the format of echarts API
*/
transform () {
const {
// 数据
// data
data = [],
// 标题
title = '饼图',
// 是否环形图
// title
title = 'Pie chart',
// Ring chart or not
ring = false,
// 属性字典
// Attribute dictionary
keyMap = {
textKey: 'key',
dataKey: 'value'
@ -55,7 +55,7 @@ export default class Pie extends Base {
throw new Error('数据源为空')
}
// 文本对应属性名,数据值对应的属性名
// Attribute name corresponding to text and attribute name corresponding to data value
const { textKey, dataKey } = keyMap
checkKeyInModel(data[0], textKey, dataKey)
@ -69,7 +69,7 @@ export default class Pie extends Base {
data: []
}]
// 填充数据
// Fill data
for (let i = 0; i < data.length; i++) {
const element = data[i]
const { [dataKey]: value, [textKey]: name, ...other } = element
@ -85,12 +85,12 @@ export default class Pie extends Base {
}
/**
* 绘制图表
* Drawing charts
*/
apply () {
let { title, series, legendData } = this.options
// 注入配置到series
// Injection configuration to series
let { insertSeries } = this.settings
let _series = series
if (insertSeries && insertSeries.length && series.length) {

34
dolphinscheduler-ui/src/js/module/ana-charts/packages/radar/index.js

@ -20,29 +20,29 @@ import { checkKeyInModel, init } from '../../common'
const TYPE = 'radar'
/**
* 雷达图
* Radar chart
*/
export default class Radar extends Base {
/**
* 单独导出时调用的初始化方法
* @param {*} el 选择器或者 DOM 对象
* @param {*} data 数据源
* @param {*} options 可选项
* Initialization method called on separate export
* @param {*} el Selector or DOM object
* @param {*} data data source
* @param {*} options Optional
*/
static init (el, data, options) {
return init(Radar, el, data, options)
}
/**
* 将用户配置转换为符合 ECharts API 格式的配置格式
* Convert user configuration to a configuration format that conforms to the format of echarts API
*/
transform () {
const {
// 数据
// data
data = [],
// 图表标题
title = '雷达图',
// 属性字典
// Chart title
title = 'Radar chart',
// Attribute dictionary
keyMap = {
textKey: 'key',
legendKey: 'typeName',
@ -51,10 +51,10 @@ export default class Radar extends Base {
} = this.settings
if (data.length === 0) {
throw new Error('数据源为空')
throw new Error('Data source is empty!')
}
// 文本对应属性名,图例对应的属性名,数据值对应的属性名
// Attribute name corresponding to text, attribute name corresponding to legend, attribute name corresponding to data value
const { textKey, legendKey, dataKey } = keyMap
checkKeyInModel(data[0], textKey, legendKey, dataKey)
@ -62,18 +62,18 @@ export default class Radar extends Base {
const seriesData = []
const indicator = []
// 设置图例并初始化数据系列
// Set legend and initialize data series
for (let i = 0; i < data.length; i++) {
const legendItem = data[i][legendKey]
const textItem = data[i][textKey]
const dataItem = data[i][dataKey]
// 图例
// Legend
if (!legendData.includes(legendItem)) {
legendData.push(legendItem)
}
// 系列
// series
let targetSeries = seriesData.find(s => s.name === legendItem)
if (!targetSeries) {
targetSeries = {
@ -86,7 +86,7 @@ export default class Radar extends Base {
targetSeries.value.push(dataItem)
targetSeries._raw.push(data[i])
// 指标
// index
let targetIndicator = indicator.find(i => i.name === textItem)
if (!targetIndicator) {
indicator.push({ name: textItem })
@ -97,7 +97,7 @@ export default class Radar extends Base {
}
/**
* 绘制图表
* Drawing charts
*/
apply () {
const { title, seriesData, legendData = [], indicator } = this.options

34
dolphinscheduler-ui/src/js/module/ana-charts/packages/scatter/index.js

@ -20,29 +20,29 @@ import { checkKeyInModel, init } from '../../common'
const TYPE = 'scatter'
/**
* 气泡图
* Bubble chart
*/
export default class Scatter extends Base {
/**
* 单独导出时调用的初始化方法
* @param {*} el 选择器或者 DOM 对象
* @param {*} data 数据源
* @param {*} options 可选项
* Initialization method called on separate export
* @param {*} el Selector or DOM object
* @param {*} data data source
* @param {*} options Optional
*/
static init (el, data, options) {
return init(Scatter, el, data, options)
}
/**
* 将用户配置转换为符合 ECharts API 格式的配置格式
* Convert user configuration to a configuration format that conforms to the format of echarts API
*/
transform () {
const {
// 数据
// data
data = [],
// 图表标题
title = '气泡图',
// 属性字典
// Chart title
title = 'Bubble chart',
// Attribute dictionary
keyMap = {
xKey: 'x',
yKey: 'y',
@ -53,7 +53,7 @@ export default class Scatter extends Base {
} = this.settings
if (data.length === 0) {
throw new Error('数据源为空')
throw new Error('Data source is empty!')
}
const legendData = []
@ -72,12 +72,12 @@ export default class Scatter extends Base {
...other
} = data[i]
// 图例
// Legend
if (!legendData.includes(legendItem)) {
legendData.push(legendItem)
}
// 系列
// series
let targetSeries = series.find(s => s.name === legendItem)
if (!targetSeries) {
targetSeries = {
@ -115,17 +115,17 @@ export default class Scatter extends Base {
}
/**
* 绘制图表
* Drawing charts
*/
apply () {
const { title, series, legendData = [] } = this.options
let {
// 自定义 x 轴
// Custom X axis
xAxis,
// 自定义 y 轴
// Custom Y axis
yAxis,
// 注入配置到 series
// Injection configuration to series
insertSeries
} = this.settings
let _series = series

6
dolphinscheduler-ui/src/js/module/components/crontab/source/_source/input-number.vue

@ -49,15 +49,15 @@
// if (parseInt($val) >= this.min || parseInt($val) <= this.max) {
// return
// }
//
// Verify integer
if (!$reg.test($val)) {
this.value = this.min
}
//
// Maximum value
if (this.value > this.max) {
this.value = this.max
}
//
// minimum value
if (this.min > this.value) {
this.value = this.min
}

64
dolphinscheduler-ui/src/js/module/components/crontab/source/_times/day.vue

@ -145,19 +145,19 @@
dayValue: '*',
weekValue: '?',
everyDayVal: '*',
WkintervalWeekPerformVal: 2, //
WkintervalWeekStartVal: 2, //
WkintervalWeekPerformVal: 2, // Every few days
WkintervalWeekStartVal: 2, // What day of the week
selectWeekList: _.map(_.cloneDeep(selectList['week']), v => {
return {
value: v.value,
label: `${this.$t(v.label)}`
}
}),
intervalDayPerformVal: 1, //
intervalDayStartVal: 1, //
WkspecificWeekVal: [], //
intervalDayPerformVal: 1, // Every other day
intervalDayStartVal: 1, // From the day
WkspecificWeekVal: [], // Specific day of the week
selectSpecificWeekList: selectList['specificWeek'],
WkspecificDayVal: [], //
WkspecificDayVal: [], // Specific day of the week
selectSpecificDayList: selectList['day'],
monthLastDaysVal: 'L',
monthLastWorkingDays: 'LW',
@ -185,7 +185,7 @@
weekVal: String
},
methods: {
//
// Every few weeks
onWkintervalWeekPerform (val) {
this.WkintervalWeekPerformVal = val
if (this.radioDay === 'WkintervalWeek') {
@ -193,81 +193,81 @@
this.weekValue = `${this.WkintervalWeekStartVal}/${this.WkintervalWeekPerformVal}`
}
},
//
// Every other day
onIntervalDayPerform (val) {
this.intervalDayPerformVal = val
if (this.radioDay === 'intervalDay') {
this.dayValue = `${this.intervalDayStartVal}/${this.intervalDayPerformVal}`
}
},
//
// From week day
onIntervalDayStart (val) {
this.intervalDayStartVal = val
if (this.radioDay === 'intervalDay') {
this.dayValue = `${this.intervalDayStartVal}/${this.intervalDayPerformVal}`
}
},
//
// By the end of this month
onMonthTailBefore (val) {
this.monthTailBeforeVal = val
if (this.radioDay === 'monthTailBefore') {
this.dayValue = `L-${this.monthTailBeforeVal}`
}
},
//
// Last working day
onRecentlyWorkingDaysMonth (val) {
this.recentlyWorkingDaysMonthVal = val
if (this.radioDay === 'recentlyWorkingDaysMonth') {
this.dayValue = `${this.recentlyWorkingDaysMonthVal}W`
}
},
//
// On the day of this month
onWkmonthNumWeeksDay (val) {
this.WkmonthNumWeeksDayVal = val
this.weekValue = `${this.WkmonthNumWeeksWeekVal}#${this.WkmonthNumWeeksDayVal}`
},
//
// Reset every day
everyDayReset () {
this.dayValue = _.cloneDeep(this.everyDayVal)
},
// *
// Reset interval week starts from *
WkintervalWeekReset () {
this.weekValue = `${this.WkintervalWeekStartVal}/${this.WkintervalWeekPerformVal}`
},
// *
// Reset interval days from *
intervalDayReset () {
this.dayValue = `${this.intervalDayStartVal}/${this.intervalDayPerformVal}`
},
//
// Specific week (multiple choices)
WkspecificWeekReset () {
this.weekValue = this.WkspecificWeekVal.length ? this.WkspecificWeekVal.join(',') : '*'
},
//
// Specific days (multiple choices)
specificDayReset () {
this.dayValue = this.WkspecificDayVal.length ? this.WkspecificDayVal.join(',') : '*'
},
//
// On the last day of the month
monthLastDaysReset () {
this.dayValue = _.cloneDeep(this.monthLastDaysVal)
},
//
// On the last working day of the month
monthLastWorkingDaysReset () {
this.dayValue = _.cloneDeep(this.monthLastWorkingDays)
},
// *
// At the end of the month*
monthLastWeeksReset () {
this.dayValue = _.cloneDeep(this.monthLastWeeksVal)
},
//
// By the end of this month
monthTailBeforeReset () {
this.dayValue = `L-${this.monthTailBeforeVal}`
},
//
// Last working day (Monday to Friday) to this month
recentlyWorkingDaysMonthReset () {
this.dayValue = `${this.recentlyWorkingDaysMonthVal}W`
},
//
// On the day of this month
WkmonthNumReset () {
this.weekValue = `${this.WkmonthNumWeeksWeekVal}#${this.WkmonthNumWeeksDayVal}`
}
@ -281,7 +281,7 @@
this.$emit('on-week-value', val)
// console.log('weekValue=> ' + val)
},
//
// Selected type
radioDay (val) {
switch (val) {
case 'everyDay':
@ -336,14 +336,14 @@
this.weekValue = `${val}/${this.WkintervalWeekPerformVal}`
}
},
//
// Specific day of the week (multiple choice)
WkspecificWeekVal (val) {
if (this.radioDay === 'WkspecificWeek') {
this.dayValue = `?`
this.weekValue = val.join(',')
}
},
//
// Specific days (multiple choices)
WkspecificDayVal (val) {
if (this.radioDay === 'specificDay') {
this.weekValue = `?`
@ -371,19 +371,19 @@
let isWeek1 = $weekVal.indexOf('/') !== -1
let isWeek2 = $weekVal.indexOf('#') !== -1
//
// Initialization
if ($dayVal === '*' && $weekVal === '?') {
console.log('初始化')
console.log('Initialization')
this.radioDay = 'everyDay'
return
}
//
// week
if (isWeek1 || isWeek2 || isWeek($weekVal)) {
this.dayValue = `?`
/**
* 按顺序标序号处理(除去天)
* Processing by sequence number (excluding days)
* @param [
* WkintervalWeek=>(/),
* WkspecificWeek=>(TUE,WED),
@ -414,7 +414,7 @@
this.radioDay = 'WkmonthNumWeeks'
}
//
// Processing week
if (isStr($weekVal, '/')) {
hanleWeekOne()
} else if (isStr($weekVal, '#')) {
@ -426,7 +426,7 @@
this.weekValue = `?`
/**
* 按顺序标序号处理(除去周)
* Processing by sequence number (excluding week)
* @param [
* everyDay=>(*),
* intervalDay=>(1/1),

44
dolphinscheduler-ui/src/js/module/components/crontab/source/_times/hour.vue

@ -91,46 +91,46 @@
event: 'hourValueEvent'
},
methods: {
// 1
// Interval execution time1
onIntervalPerform (val) {
this.intervalPerformVal = val
if (this.radioHour === 'intervalHour') {
this.hourValue = `${this.intervalStartVal}/${this.intervalPerformVal}`
}
},
// 2
// Interval start time2
onIntervalStart (val) {
this.intervalStartVal = val
if (this.radioHour === 'intervalHour') {
this.hourValue = `${this.intervalStartVal}/${this.intervalPerformVal}`
}
},
//
// Specific hours
onspecificHours (arr) {
},
//
// Cycle start value
onCycleStart (val) {
this.cycleStartVal = val
if (this.radioHour === 'cycleHour') {
this.hourValue = `${this.cycleStartVal}-${this.cycleEndVal}`
}
},
//
// Cycle end value
onCycleEnd (val) {
this.cycleEndVal = val
if (this.radioHour === 'cycleHour') {
this.hourValue = `${this.cycleStartVal}-${this.cycleEndVal}`
}
},
//
// Reset every hour
everyReset () {
this.hourValue = '*'
},
//
// Reset interval hours
intervalReset () {
this.hourValue = `${this.intervalStartVal}/${this.intervalPerformVal}`
},
//
// Reset specific hours
specificReset () {
if (this.specificHoursVal.length) {
this.hourValue = this.specificHoursVal.join(',')
@ -138,31 +138,31 @@
this.hourValue = '*'
}
},
//
// Reset cycle hours
cycleReset () {
this.hourValue = `${this.cycleStartVal}-${this.cycleEndVal}`
},
/**
* 解析参数值
* Parse parameter value
*/
analyticalValue () {
return new Promise((resolve, reject) => {
let $hourVal = _.cloneDeep(this.value)
//
// Interval hour
let $interval = isStr($hourVal, '/')
//
// Specific hours
let $specific = isStr($hourVal, ',')
//
// Cycle hour
let $cycle = isStr($hourVal, '-')
//
// Every hour
if ($hourVal === '*') {
this.radioHour = 'everyHour'
this.hourValue = '*'
return
}
// ()
// Positive integer (hour)
if ($hourVal.length === 1 && _.isInteger(parseInt($hourVal)) ||
$hourVal.length === 2 && _.isInteger(parseInt($hourVal))
) {
@ -171,7 +171,7 @@
return
}
//
// Interval hour
if ($interval) {
this.radioHour = 'intervalHour'
this.intervalStartVal = parseInt($interval[0])
@ -180,14 +180,14 @@
return
}
//
// Specific hours
if ($specific) {
this.radioHour = 'specificHour'
this.specificHoursVal = $specific
return
}
//
// Cycle hour
if ($cycle) {
this.radioHour = 'cycleHour'
this.cycleStartVal = parseInt($cycle[0])
@ -200,11 +200,11 @@
}
},
watch: {
//
// Derived value
hourValue (val) {
this.$emit('hourValueEvent', val)
},
//
// Selected type
radioHour (val) {
switch (val) {
case 'everyHour':
@ -221,7 +221,7 @@
break
}
},
//
// Specific hours
specificHoursVal (arr) {
this.hourValue = arr.join(',')
}
@ -230,7 +230,7 @@
},
created () {
this.analyticalValue().then(() => {
console.log('数据结构解析成功!')
console.log('Data structure parsing succeeded!')
})
},
beforeMount () {

42
dolphinscheduler-ui/src/js/module/components/crontab/source/_times/minute.vue

@ -91,7 +91,7 @@
event: 'minuteValueEvent'
},
methods: {
// 1
// Interval execution time1
onIntervalPerform (val) {
console.log(val)
this.intervalPerformVal = val
@ -99,39 +99,39 @@
this.minuteValue = `${this.intervalStartVal}/${this.intervalPerformVal}`
}
},
// 2
// Interval start time2
onIntervalStart (val) {
this.intervalStartVal = val
if (this.radioMinute === 'intervalMinute') {
this.minuteValue = `${this.intervalStartVal}/${this.intervalPerformVal}`
}
},
//
// Specific points
onspecificMinutes (arr) {
},
//
// Cycle start value
onCycleStart (val) {
this.cycleStartVal = val
if (this.radioMinute === 'cycleMinute') {
this.minuteValue = `${this.cycleStartVal}-${this.cycleEndVal}`
}
},
//
// Cycle end value
onCycleEnd (val) {
this.cycleEndVal = val
if (this.radioMinute === 'cycleMinute') {
this.minuteValue = `${this.cycleStartVal}-${this.cycleEndVal}`
}
},
//
// Reset every point
everyReset () {
this.minuteValue = '*'
},
//
// Reset interval minute
intervalReset () {
this.minuteValue = `${this.intervalStartVal}/${this.intervalPerformVal}`
},
//
// Reset specific minutes
specificReset () {
if (this.specificMinutesVal.length) {
this.minuteValue = this.specificMinutesVal.join(',')
@ -139,31 +139,31 @@
this.minuteValue = '*'
}
},
//
// Reset cycle minutes
cycleReset () {
this.minuteValue = `${this.cycleStartVal}-${this.cycleEndVal}`
},
/**
* 解析参数值
* Parse parameter value
*/
analyticalValue () {
return new Promise((resolve, reject) => {
let $minuteVal = _.cloneDeep(this.value)
//
// Interval score
let $interval = isStr($minuteVal, '/')
//
// Specific points
let $specific = isStr($minuteVal, ',')
//
// Periodic Division
let $cycle = isStr($minuteVal, '-')
//
// Every point
if ($minuteVal === '*') {
this.radioMinute = 'everyMinute'
this.minuteValue = '*'
return
}
//
// Positive integer (min)
if ($minuteVal.length === 1 && _.isInteger(parseInt($minuteVal)) ||
$minuteVal.length === 2 && _.isInteger(parseInt($minuteVal))
) {
@ -172,7 +172,7 @@
return
}
//
// nterval score
if ($interval) {
this.radioMinute = 'intervalMinute'
this.intervalStartVal = parseInt($interval[0])
@ -181,14 +181,14 @@
return
}
//
// Specific minutes
if ($specific) {
this.radioMinute = 'specificMinute'
this.specificMinutesVal = $specific
return
}
//
// Periodic Division
if ($cycle) {
this.radioMinute = 'cycleMinute'
this.cycleStartVal = parseInt($cycle[0])
@ -201,11 +201,11 @@
}
},
watch: {
//
// Derived value
minuteValue (val) {
this.$emit('minuteValueEvent', val)
},
//
// Selected type
radioMinute (val) {
switch (val) {
case 'everyMinute':
@ -222,7 +222,7 @@
break
}
},
//
// pecific minutes
specificMinutesVal (arr) {
this.minuteValue = arr.join(',')
}

42
dolphinscheduler-ui/src/js/module/components/crontab/source/_times/month.vue

@ -91,46 +91,46 @@
event: 'monthValueEvent'
},
methods: {
// 1
// Interval execution time1
onIntervalPerform (val) {
this.intervalPerformVal = val
if (this.radioMonth === 'intervalMonth') {
this.monthValue = `${this.intervalStartVal}/${this.intervalPerformVal}`
}
},
// 2
// Interval start time2
onIntervalStart (val) {
this.intervalStartVal = val
if (this.radioMonth === 'intervalMonth') {
this.monthValue = `${this.intervalStartVal}/${this.intervalPerformVal}`
}
},
//
// Specific months
onspecificlMonths (arr) {
},
//
// Cycle start value
onCycleStart (val) {
this.cycleStartVal = val
if (this.radioMonth === 'cycleMonth') {
this.monthValue = `${this.cycleStartVal}-${this.cycleEndVal}`
}
},
//
// Cycle end value
onCycleEnd (val) {
this.cycleEndVal = val
if (this.radioMonth === 'cycleMonth') {
this.monthValue = `${this.cycleStartVal}-${this.cycleEndVal}`
}
},
//
// Reset every month
everyReset () {
this.monthValue = '*'
},
//
// Reset every month
intervalReset () {
this.monthValue = `${this.intervalStartVal}/${this.intervalPerformVal}`
},
//
// Reset specific months
specificReset () {
if (this.specificMonthVal.length) {
this.monthValue = this.specificMonthVal.join(',')
@ -138,31 +138,31 @@
this.monthValue = '*'
}
},
//
// Months of reset cycle
cycleReset () {
this.monthValue = `${this.cycleStartVal}-${this.cycleEndVal}`
},
/**
* 解析参数值
* Parse parameter value
*/
analyticalValue () {
return new Promise((resolve, reject) => {
let $monthVal = _.cloneDeep(this.value)
//
// Interval month
let $interval = isStr($monthVal, '/')
//
// Specific months
let $specific = isStr($monthVal, ',')
//
// Cycle month
let $cycle = isStr($monthVal, '-')
//
// Every month
if ($monthVal === '*') {
this.radioMonth = 'everyMonth'
this.monthValue = '*'
return
}
// ()
// Positive integer (month)
if ($monthVal.length === 1 && _.isInteger(parseInt($monthVal)) ||
$monthVal.length === 2 && _.isInteger(parseInt($monthVal))
) {
@ -171,7 +171,7 @@
return
}
//
// Interval month
if ($interval) {
this.radioMonth = 'intervalMonth'
this.intervalStartVal = parseInt($interval[0])
@ -180,14 +180,14 @@
return
}
//
// Specific months
if ($specific) {
this.radioMonth = 'specificlMonth'
this.specificMonthVal = $specific
return
}
//
// Cycle month
if ($cycle) {
this.radioMonth = 'cycleMonth'
this.cycleStartVal = parseInt($cycle[0])
@ -200,11 +200,11 @@
}
},
watch: {
//
// Derived value
monthValue (val) {
this.$emit('monthValueEvent', val)
},
//
// Selected type
radioMonth (val) {
switch (val) {
case 'everyMonth':
@ -221,7 +221,7 @@
break
}
},
//
// Specific months
specificMonthVal (arr) {
this.monthValue = arr.join(',')
}

46
dolphinscheduler-ui/src/js/module/components/crontab/source/_times/second.vue

@ -91,7 +91,7 @@
event: 'secondValueEvent'
},
methods: {
// 1
// Interval execution time1
onIntervalPerform (val) {
console.log(val)
console.log('++')
@ -100,39 +100,39 @@
this.secondValue = `${this.intervalStartVal}/${this.intervalPerformVal}`
}
},
// 2
// Interval start time2
onIntervalStart (val) {
this.intervalStartVal = val
if (this.radioSecond === 'intervalSecond') {
this.secondValue = `${this.intervalStartVal}/${this.intervalPerformVal}`
}
},
//
// Specific seconds
onSpecificSeconds (arr) {
},
//
// Cycle start value
onCycleStart (val) {
this.cycleStartVal = val
if (this.radioSecond === 'cycleSecond') {
this.secondValue = `${this.cycleStartVal}-${this.cycleEndVal}`
}
},
//
// Cycle end value
onCycleEnd (val) {
this.cycleEndVal = val
if (this.radioSecond === 'cycleSecond') {
this.secondValue = `${this.cycleStartVal}-${this.cycleEndVal}`
}
},
//
// Reset every second
everyReset () {
this.secondValue = '*'
},
//
// Reset interval seconds
intervalReset () {
this.secondValue = `${this.intervalStartVal}/${this.intervalPerformVal}`
},
//
// Reset specific seconds
specificReset () {
if (this.specificSecondsVal.length) {
this.secondValue = this.specificSecondsVal.join(',')
@ -140,31 +140,31 @@
this.secondValue = '*'
}
},
//
// Reset cycle seconds
cycleReset () {
this.secondValue = `${this.cycleStartVal}-${this.cycleEndVal}`
},
/**
* 解析参数值
* Parse parameter value
*/
analyticalValue () {
return new Promise((resolve, reject) => {
let $secondVal = _.cloneDeep(this.value)
//
// Interval seconds
let $interval = isStr($secondVal, '/')
//
// Specific seconds
let $specific = isStr($secondVal, ',')
//
// Cycle second
let $cycle = isStr($secondVal, '-')
//
// Every second
if ($secondVal === '*') {
this.radioSecond = 'everySecond'
this.secondValue = '*'
return
}
// ()
// Positive integer (seconds)
if ($secondVal.length === 1 && _.isInteger(parseInt($secondVal)) ||
$secondVal.length === 2 && _.isInteger(parseInt($secondVal))
) {
@ -173,7 +173,7 @@
return
}
//
// Interval seconds
if ($interval) {
this.radioSecond = 'intervalSecond'
this.intervalStartVal = parseInt($interval[0])
@ -182,14 +182,14 @@
return
}
//
// Specific seconds
if ($specific) {
this.radioSecond = 'specificSecond'
this.specificSecondsVal = $specific
return
}
//
// Cycle second
if ($cycle) {
this.radioSecond = 'cycleSecond'
this.cycleStartVal = parseInt($cycle[0])
@ -202,17 +202,17 @@
}
},
watch: {
// value
// Value change reparse structure
value () {
this.analyticalValue().then(() => {
console.log('数据结构解析成功!')
})
},
//
// Derived value
secondValue (val) {
this.$emit('secondValueEvent', val)
},
//
// Selected type
radioSecond (val) {
switch (val) {
case 'everySecond':
@ -229,7 +229,7 @@
break
}
},
//
// Specific seconds
specificSecondsVal (arr) {
this.secondValue = arr.join(',')
}
@ -238,7 +238,7 @@
},
created () {
this.analyticalValue().then(() => {
console.log('数据结构解析成功!')
console.log('Data structure parsing succeeded!')
})
},
beforeMount () {

44
dolphinscheduler-ui/src/js/module/components/crontab/source/_times/year.vue

@ -91,7 +91,7 @@
event: 'yearValueEvent'
},
methods: {
// 1
// Interval execution time1
onIntervalPerform (val) {
console.log(val)
this.intervalPerformVal = val
@ -99,39 +99,39 @@
this.yearValue = `${this.intervalStartVal}/${this.intervalPerformVal}`
}
},
// 2
// Interval start time2
onIntervalStart (val) {
this.intervalStartVal = val
if (this.radioYear === 'intervalYear') {
this.yearValue = `${this.intervalStartVal}/${this.intervalPerformVal}`
}
},
//
// Specific year
onspecificYears (arr) {
},
//
// Cycle start value
onCycleStart (val) {
this.cycleStartVal = val
if (this.radioYear === 'cycleYear') {
this.yearValue = `${this.cycleStartVal}-${this.cycleEndVal}`
}
},
//
// Cycle end value
onCycleEnd (val) {
this.cycleEndVal = val
if (this.radioYear === 'cycleYear') {
this.yearValue = `${this.cycleStartVal}-${this.cycleEndVal}`
}
},
//
// Reset every year
everyReset () {
this.yearValue = '*'
},
//
// Reset every other year
intervalReset () {
this.yearValue = `${this.intervalStartVal}/${this.intervalPerformVal}`
},
//
// Reset specific years
specificReset () {
if (this.specificYearVal.length) {
this.yearValue = this.specificYearVal.join(',')
@ -139,38 +139,38 @@
this.yearValue = '*'
}
},
//
// Reset cycle years
cycleReset () {
this.yearValue = `${this.cycleStartVal}-${this.cycleEndVal}`
},
/**
* 解析参数值
* Parse parameter value
*/
analyticalValue () {
return new Promise((resolve, reject) => {
let $yearVal = _.cloneDeep(this.value)
//
// Interval year
let $interval = isStr($yearVal, '/')
//
// Specific year
let $specific = isStr($yearVal, ',')
//
// Cycle year
let $cycle = isStr($yearVal, '-')
//
// Every year
if ($yearVal === '*') {
this.radioYear = 'everyYear'
this.yearValue = '*'
return
}
// ()
// Positive integer (year)
if ($yearVal.length === 4 && _.isInteger(parseInt($yearVal))) {
this.radioYear = 'specificYear'
this.specificYearVal = [$yearVal]
return
}
//
// Interval year
if ($interval) {
this.radioYear = 'intervalYear'
this.intervalStartVal = parseInt($interval[0])
@ -179,14 +179,14 @@
return
}
//
// Specific years
if ($specific) {
this.radioYear = 'specificYear'
this.specificYearVal = $specific
return
}
//
// Cycle year
if ($cycle) {
this.radioYear = 'cycleYear'
this.cycleStartVal = parseInt($cycle[0])
@ -199,11 +199,11 @@
}
},
watch: {
//
// Derived value
yearValue (val) {
this.$emit('yearValueEvent', val)
},
//
// Selected type
radioYear (val) {
switch (val) {
case 'everyYear':
@ -220,7 +220,7 @@
break
}
},
//
// Specific years
specificYearVal (arr) {
this.yearValue = arr.join(',')
}
@ -229,7 +229,7 @@
},
created () {
this.analyticalValue().then(() => {
console.log('数据结构解析成功!')
console.log('Data structure parsing succeeded!')
})
},
beforeMount () {

8
dolphinscheduler-ui/src/js/module/components/crontab/source/app.vue

@ -42,11 +42,11 @@
<m-hour v-model="hourVal"></m-hour>
</template>
<!-- start -->
<!-- day start -->
<template v-if="tabVal === 'day'">
<m-day @on-day-value="_onDayValue" @on-week-value="_onWeekValue" :day-val="dayVal" :week-val="weekVal"></m-day>
</template>
<!-- end -->
<!-- day end -->
<template v-if="tabVal === 'month'">
<m-month v-model="monthVal"></m-month>
@ -131,10 +131,10 @@
beforeCreate () {
},
created () {
// win
// International binding under win
window.localeCrontab = this.locale
//
// Initialization
this._reset()
},
beforeMount () {

6
dolphinscheduler-ui/src/js/module/components/crontab/source/util/index.js

@ -18,9 +18,9 @@
import _ from 'lodash'
/**
* 生成指定区间数字
* @param start 起始数值
* @param end 结束数值
* Generate specified interval number
* @param start Starting value
* @param end End value
*/
const range = (start, end) => {
let length = end - start + 1

18
dolphinscheduler-ui/src/js/module/components/secondaryMenu/_source/menu.js

@ -211,30 +211,12 @@ let menu = {
id: 1,
disabled: true
},
// {
// name: 'Alert',
// path: 'servers-alert',
// id: 2,
// disabled: true
// },
// {
// name: 'RpcServer',
// path: 'servers-rpcserver',
// id: 3,
// disabled: true
// },
{
name: 'Zookeeper',
path: 'servers-zookeeper',
id: 4,
disabled: true
},
// {
// name: 'ApiServer',
// path: 'servers-apiserver',
// id: 5,
// disabled: true
// },
{
name: 'DB',
path: 'servers-db',

Loading…
Cancel
Save