提交 01c2b12d 编写于 作者: B break60 提交者: qiaozhanwei

Change all Chinese names to English (#1207)

* Modify webpack configuration

* Change all Chinese names to English
上级 62aa1705
......@@ -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')
}
})
})
......@@ -65,7 +65,7 @@ const minifierConfig = isProduction ? {
const getPageEntry = view => jsEntry[view] ? view : ''
// 重新定向输出页面
// Redirect output page
const pageRewriter = {
'view/home/index.*': 'index.html'
}
......
......@@ -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
}
}
......
......@@ -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>
......
......@@ -18,7 +18,7 @@
import i18n from '@/module/i18n'
/**
* 状态码表
* State code table
*/
let stateType = [
{
......
......@@ -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)) {
......
......@@ -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({
......
......@@ -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">`
......
......@@ -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
......
......@@ -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 }
......
......@@ -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 }
......
......@@ -166,7 +166,7 @@
this._handlerEditor()
},
destroyed () {
editor.toTextArea() // 卸载
editor.toTextArea() // uninstall
editor.off($('.code-create-mirror'), 'keypress', this.keypress)
},
computed: {},
......
......@@ -16,7 +16,7 @@
*/
/**
* 处理后缀名
* Processing suffix
*/
const handlerSuffix = {
'.txt': 'textile',
......
......@@ -195,7 +195,7 @@
},
mounted () {
if (this.isNoType) {
// 获取数据
// get data
this._getViewResources()
}
},
......
......@@ -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>
......
/*
* 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)
}
}
}
......@@ -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) => {
......
......@@ -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 = {
......
......@@ -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) {
......
......@@ -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) {
......
......@@ -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
......
......@@ -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) {
......
......@@ -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
......
......@@ -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
......
......@@ -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
}
......
......@@ -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),
......
......@@ -91,46 +91,46 @@
event: 'hourValueEvent'
},
methods: {
// 间隔执行时间(1)
// Interval execution time(1)
onIntervalPerform (val) {
this.intervalPerformVal = val
if (this.radioHour === 'intervalHour') {
this.hourValue = `${this.intervalStartVal}/${this.intervalPerformVal}`
}
},
// 间隔开始时间(2)
// Interval start time(2)
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 () {
......
......@@ -91,7 +91,7 @@
event: 'minuteValueEvent'
},
methods: {
// 间隔执行时间(1)
// Interval execution time(1)
onIntervalPerform (val) {
console.log(val)
this.intervalPerformVal = val
......@@ -99,39 +99,39 @@
this.minuteValue = `${this.intervalStartVal}/${this.intervalPerformVal}`
}
},
// 间隔开始时间(2)
// Interval start time(2)
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(',')
}
......
......@@ -91,46 +91,46 @@
event: 'monthValueEvent'
},
methods: {
// 间隔执行时间(1)
// Interval execution time(1)
onIntervalPerform (val) {
this.intervalPerformVal = val
if (this.radioMonth === 'intervalMonth') {
this.monthValue = `${this.intervalStartVal}/${this.intervalPerformVal}`
}
},
// 间隔开始时间(2)
// Interval start time(2)
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(',')
}
......
......@@ -91,7 +91,7 @@
event: 'secondValueEvent'
},
methods: {
// 间隔执行时间(1)
// Interval execution time(1)
onIntervalPerform (val) {
console.log(val)
console.log('++')
......@@ -100,39 +100,39 @@
this.secondValue = `${this.intervalStartVal}/${this.intervalPerformVal}`
}
},
// 间隔开始时间(2)
// Interval start time(2)
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 () {
......
......@@ -91,7 +91,7 @@
event: 'yearValueEvent'
},
methods: {
// 间隔执行时间(1)
// Interval execution time(1)
onIntervalPerform (val) {
console.log(val)
this.intervalPerformVal = val
......@@ -99,39 +99,39 @@
this.yearValue = `${this.intervalStartVal}/${this.intervalPerformVal}`
}
},
// 间隔开始时间(2)
// Interval start time(2)
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 () {
......
......@@ -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 () {
......
......@@ -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
......
......@@ -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',
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册