Browse Source

1.update logo 2.Workflow Definition Page Timing Component Replaced with Source Code (#924)

* package

* 修改工作流实例页面状态为运行时,禁止删除,删除package.json包里面的babel-runtime和jasmine-core

* bugfix-user-specified queue takes precedence over tenant queue (#769)

Solve the problem that the user queue setting does not take effect

* update markdown docs which can not display images normally (#806)

* issue#728 (#746)

The mailSender in PasswordAuthentication() and setFrom() may not be the same in actual use, and it's best to set it up separately. please add a example about this.

* install-escheduler-ui.sh,monitor_server.py and install.sh scripts comment change to english and install-escheduler-ui.sh use escheduler change to dolphinscheduler (#812)

* service start exception modify

* master,worker start modify

* .env update

* install-escheduler-ui.sh,monitor_server.py and install.sh scripts comment change to english and install-escheduler-ui.sh use escheduler change to dolphinscheduler

* scripts name standardization (#813)

* service start exception modify

* master,worker start modify

* .env update

* install-escheduler-ui.sh,monitor_server.py and install.sh scripts comment change to english and install-escheduler-ui.sh use escheduler change to dolphinscheduler

* scripts name standardization

* [BUG][#731]repair swagger annotation,interface path:/escheduler/projects/{projectName}/process/batch-delete and /escheduler/projects/{projectName}/process/delete  (#764)

* 增加工作流导出导入功能,前端定时器表达式的秒和分钟的默认值从*修改成0

* 修改工作流导出导入功能由excel改为json减少依赖

* [BUG][#731]repair swagger annotation ,interface path:/escheduler/projects/{projectName}/process/batch-delete and /escheduler/projects/{projectName}/process/delete

* [BUG][#771] The edit timer did not assign the original data

* [FEATURE][#236] Cross-project dependency

* [FEATURE][#236] Cross-project dependency(增加跨项目依赖)

* misspell  words (#817)

* (Docs): Fixed some typo errors (#811)

* Update EasyScheduler Proposal.md

* Update frontend-deployment.md

* Update frontend-development.md

* Update 前端开发文档.md

* Update system-manual.md

* Update HttpClientTest.java

* Update 系统使用手册.md

* fix singleton with volatile (#818)

* Replace StringBuffer with StringBuilder inside the method (#816)

* flink task support(flink 任务支持) (#711)

* flink任务支持

* flink任务支持

* Update zh_CN.js

* Update FlinkArgsUtils.java

* Update .escheduler_env.sh

* 1.Delete the page section console.log;
2.Change project name;
3.Production configuration packaging clears console.log

* Delete the'babel-plugin-transform-remove-console'dependency package

* 1.repair [BUG]#884,2.Add Scheduling Time Fields to Workflow Instance List,3.Add a reminder for empty data

* 1.update logo 2.Workflow Definition Page Timing Component Replaced with Source Code
pull/2/head
break60 5 years ago committed by qiaozhanwei
parent
commit
33aedeb919
  1. 6
      escheduler-ui/src/js/conf/home/pages/projects/pages/definition/pages/list/_source/timing.vue
  2. 2
      escheduler-ui/src/js/conf/login/App.vue
  3. BIN
      escheduler-ui/src/js/conf/login/img/login-logo.png
  4. 85
      escheduler-ui/src/js/conf/login/img/login-logo.svg
  5. 6
      escheduler-ui/src/js/module/components/crontab/index.js
  6. 23
      escheduler-ui/src/js/module/components/crontab/source/_source/i18n/config.js
  7. 12
      escheduler-ui/src/js/module/components/crontab/source/_source/i18n/index.js
  8. 60
      escheduler-ui/src/js/module/components/crontab/source/_source/i18n/locale/en_US.js
  9. 60
      escheduler-ui/src/js/module/components/crontab/source/_source/i18n/locale/zh_CN.js
  10. 34
      escheduler-ui/src/js/module/components/crontab/source/_source/i18n/util.js
  11. 106
      escheduler-ui/src/js/module/components/crontab/source/_source/input-number.vue
  12. 505
      escheduler-ui/src/js/module/components/crontab/source/_times/day.vue
  13. 239
      escheduler-ui/src/js/module/components/crontab/source/_times/hour.vue
  14. 245
      escheduler-ui/src/js/module/components/crontab/source/_times/minute.vue
  15. 244
      escheduler-ui/src/js/module/components/crontab/source/_times/month.vue
  16. 252
      escheduler-ui/src/js/module/components/crontab/source/_times/second.vue
  17. 243
      escheduler-ui/src/js/module/components/crontab/source/_times/year.vue
  18. 190
      escheduler-ui/src/js/module/components/crontab/source/app.vue
  19. 30
      escheduler-ui/src/js/module/components/crontab/source/index.scss
  20. 199
      escheduler-ui/src/js/module/components/crontab/source/util/index.js
  21. BIN
      escheduler-ui/src/js/module/components/nav/logo.png
  22. 85
      escheduler-ui/src/js/module/components/nav/logo.svg
  23. 2
      escheduler-ui/src/js/module/components/nav/nav.vue
  24. 30
      escheduler-ui/src/lib/@vue/crontab/README.md
  25. 65
      escheduler-ui/src/lib/@vue/crontab/build/config.js
  26. 106
      escheduler-ui/src/lib/@vue/crontab/build/webpack.config.prod.js
  27. 1
      escheduler-ui/src/lib/@vue/crontab/dist/index.css
  28. 2
      escheduler-ui/src/lib/@vue/crontab/dist/index.js
  29. 1
      escheduler-ui/src/lib/@vue/crontab/dist/index.js.map
  30. 47
      escheduler-ui/src/lib/@vue/crontab/example/app.vue
  31. 14
      escheduler-ui/src/lib/@vue/crontab/example/index.html
  32. 14
      escheduler-ui/src/lib/@vue/crontab/example/index.js
  33. 63
      escheduler-ui/src/lib/@vue/crontab/package.json
  34. 7
      escheduler-ui/src/lib/@vue/crontab/postcss.config.js

6
escheduler-ui/src/js/conf/home/pages/projects/pages/definition/pages/list/_source/timing.vue

@ -144,10 +144,9 @@
import _ from 'lodash'
import i18n from '@/module/i18n'
import mEmail from './email.vue'
import '~/@vue/crontab/dist/index.css'
import store from '@/conf/home/store'
import { warningTypeList } from './util'
import { vCrontab } from '~/@vue/crontab/dist'
import { vCrontab } from '@/module/components/crontab/index'
import { formatDate } from '@/module/filter/filter'
import mPriority from '@/module/components/priority/priority'
import mWorkerGroups from '@/conf/home/pages/dag/_source/formModel/_source/workerGroups'
@ -291,8 +290,7 @@
this._preview()
}
},
watch: {
},
watch: {},
created () {
if(this.item.crontab !== null){
this.crontab = this.item.crontab

2
escheduler-ui/src/js/conf/login/App.vue

@ -143,7 +143,7 @@
width: 280px;
height: 60px;
display: block;
background: url("img/login-logo.png");
background: url("img/login-logo.svg") no-repeat 23px;
margin: 0 auto;
}
}

BIN
escheduler-ui/src/js/conf/login/img/login-logo.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.8 KiB

85
escheduler-ui/src/js/conf/login/img/login-logo.svg

@ -0,0 +1,85 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 21.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="图层_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 180 46" style="enable-background:new 0 0 180 46;" xml:space="preserve">
<style type="text/css">
.st0{fill:#85CDF0;}
.st1{fill:#0097E0;}
.st2{fill:#282828;}
</style>
<g>
<path class="st0" d="M29.9,25.6H14.5c-2.1,0-3.8,1.8-3.8,3.9c0,0.8,0.2,1.6,0.7,2.2c0.3-0.1,0.6-0.2,0.9-0.3l0,0l0,0
c1-0.4,2.1-1.2,2.8-1.8c0.2-0.1,0.3-0.2,0.4-0.3c0.1-0.1,0.2-0.2,0.4-0.3c0.6-0.5,1.4-1.1,2.6-1.3c0.2,0,0.4,0,0.7,0
c1,0,1.9,0.3,2.5,0.9c0.2-0.1,0.4-0.2,0.5-0.3c0.3-0.1,0.5-0.3,0.7-0.4c0.2-0.1,0.5-0.2,0.8-0.2c0.6,0,1.2,0.3,1.5,0.9
c0.2,0.4,0.4,1.1-0.2,2.2c-0.1,0.2-0.3,0.4-0.4,0.7c-0.3,0.6-0.7,1.2-1.3,2h6.6c2.1,0,3.8-1.8,3.8-3.9C33.7,27.4,32,25.6,29.9,25.6
z"/>
<path class="st1" d="M5.7,20.3h1c0.6,0,1-0.4,1-1c0-0.6-0.4-1-1-1h-1c-2.1,0-3.7-1.7-3.7-3.9c0-2.1,1.6-3.8,3.6-3.9v2.1l2.8-2.9
l-2.8-3v1.7C2.6,8.6,0,11.2,0,14.4C0,17.7,2.5,20.3,5.7,20.3z"/>
<path class="st1" d="M38.4,18.6h-1c-0.6,0-1,0.4-1,1c0,0.6,0.4,1,1,1h1c2.1,0,3.7,1.7,3.7,3.9c0,2.1-1.6,3.8-3.6,3.9v-2.1L35.7,29
l2.8,3v-1.7c3-0.1,5.5-2.6,5.5-5.9C44.1,21.1,41.6,18.6,38.4,18.6z"/>
<path class="st0" d="M29.9,15.3H14.5c-2.1,0-3.8,1.8-3.8,3.9s1.7,3.9,3.8,3.9h15.4c2.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5V30h-1.5V17.6z"/>
<path class="st2" d="M171.8,21.2c0.6,0.3,1,0.7,1.3,1.2c0.3,0.5,0.5,1,0.6,1.6c0.1,0.4,0.1,1.1,0.1,2h-6.4c0,0.9,0.2,1.7,0.6,2.2
c0.4,0.6,1,0.8,1.8,0.8c0.8,0,1.4-0.3,1.8-0.8c0.3-0.3,0.4-0.7,0.5-1.1h1.5c0,0.3-0.2,0.7-0.4,1.1c-0.2,0.4-0.5,0.7-0.7,1
c-0.4,0.5-1,0.8-1.7,0.9c-0.4,0.1-0.8,0.1-1.2,0.1c-1.1,0-2-0.4-2.8-1.2c-0.8-0.8-1.1-2-1.1-3.4c0-1.5,0.4-2.6,1.1-3.5
c0.8-0.9,1.8-1.4,3-1.4C170.6,20.8,171.2,20.9,171.8,21.2z M172.3,24.8c-0.1-0.7-0.2-1.2-0.4-1.6c-0.4-0.7-1.1-1.1-2-1.1
c-0.7,0-1.2,0.3-1.7,0.8c-0.5,0.5-0.7,1.1-0.7,1.9H172.3z"/>
<path class="st2" d="M175.7,21h1.4v1.6c0.1-0.3,0.4-0.7,0.8-1.1c0.4-0.4,1-0.7,1.5-0.7c0,0,0.1,0,0.1,0c0.1,0,0.2,0,0.3,0v1.6
c-0.1,0-0.2,0-0.2,0c-0.1,0-0.2,0-0.2,0c-0.7,0-1.3,0.2-1.7,0.7c-0.4,0.5-0.6,1.1-0.6,1.7V30h-1.5V21z"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 7.7 KiB

6
escheduler-ui/src/js/module/components/crontab/index.js

@ -0,0 +1,6 @@
import vCrontab from './source/app.vue'
// import './source/index.scss'
export {
vCrontab
}

23
escheduler-ui/src/js/module/components/crontab/source/_source/i18n/config.js

@ -0,0 +1,23 @@
/* eslint-disable */
import _ from 'lodash'
import zh_CN from './locale/zh_CN'
import en_US from './locale/en_US'
export function localeList () {
return [
{
code: 'zh_CN',
name: '中文',
locale: zh_CN
},
{
code: 'en_US',
name: 'English',
locale: en_US
}
]
}
export function findLocale (code) {
return _.find(localeList(), ['code', code])
}

12
escheduler-ui/src/js/module/components/crontab/source/_source/i18n/index.js

@ -0,0 +1,12 @@
import { findLocale } from './config'
import { template } from './util'
export default {
methods: {
$t (str, data) {
return template(findLocale(window.localeCrontab).locale[str], data)
}
}
}

60
escheduler-ui/src/js/module/components/crontab/source/_source/i18n/locale/en_US.js

@ -0,0 +1,60 @@
export default {
'秒': 'second',
'分': 'minute',
'时': 'hour',
'天': 'day',
'月': 'month',
'年': 'year',
'星期一': 'Monday',
'星期二': 'Tuesday',
'星期三': 'Wednesday',
'星期四': 'Thursday',
'星期五': 'Friday',
'星期六': 'Saturday',
'星期天': 'Sunday',
'每一秒钟': 'Every second',
'每隔': 'Every',
'秒执行 ': 'second carried out',
'秒开始': 'Start',
'具体秒数(可多选)': 'Specific second(multiple)',
'请选择具体秒数': 'Please enter a specific second',
'周期从': 'Cycle from',
'到': 'to',
'每一分钟': 'Every minute',
'分执行 ': 'minute carried out',
'分开始': 'Start',
'具体分钟数(可多选)': 'Specific minute(multiple)',
'请选择具体分钟数': 'Please enter a specific minute',
'每一小时': 'Every hour',
'小时执行 ': 'hour carried out',
'小时开始': 'Start',
'具体小时数(可多选)': 'Specific hour(multiple)',
'请选择具体小时数': 'Please enter a hour',
'每一天': 'Every day',
'周执行 ': 'week carried out',
'开始': 'Start',
'天执行 ': 'day carried out',
'天开始': 'Start',
'具体星期几(可多选)': 'Specific day of the week(multiple)',
'请选择具体周几': 'Please enter a week',
'具体天数(可多选)': 'Specific days(multiple)',
'请选择具体天数': 'Please enter a days',
'在这个月的最后一天': 'On the last day of the month',
'在这个月的最后一个工作日': 'On the last working day of the month',
'在这个月的最后一个': 'At the last of this month',
'在本月底前': 'Before the end of this month',
'最近的工作日周一至周五至本月': 'The most recent business day (Monday to Friday) to this month',
'在这个月的第': 'In this months',
'每一月': 'Every month',
'月执行 ': 'month carried out',
'月开始': 'Start',
'具体月数(可多选)': 'Specific months(multiple)',
'请选择具体月数': 'Please enter a months',
'每一年': 'Every year',
'年执行 ': 'year carried out',
'年开始': 'Start',
'具体年数(可多选)': 'Specific year(multiple)',
'请选择具体年数': 'Please enter a year',
'小时': 'hour',
'日': 'day'
}

60
escheduler-ui/src/js/module/components/crontab/source/_source/i18n/locale/zh_CN.js

@ -0,0 +1,60 @@
export default {
'秒': '秒',
'分': '分',
'时': '时',
'天': '天',
'月': '月',
'年': '年',
'星期一': '星期一',
'星期二': '星期二',
'星期三': '星期三',
'星期四': '星期四',
'星期五': '星期五',
'星期六': '星期六',
'星期天': '星期天',
'每一秒钟': '每一秒钟',
'每隔': '每隔',
'秒执行 ': '秒执行 ',
'秒开始': '秒开始',
'具体秒数(可多选)': '具体秒数(可多选)',
'请选择具体秒数': '请选择具体秒数',
'周期从': '周期从',
'到': '到',
'每一分钟': '每一分钟',
'分执行 ': '分执行 ',
'分开始': '分开始',
'具体分钟数(可多选)': '具体分钟数(可多选)',
'请选择具体分钟数': '请选择具体分钟数',
'每一小时': '每一小时',
'小时执行 ': '小时执行 ',
'小时开始': '小时开始',
'具体小时数(可多选)': '具体小时数(可多选)',
'请选择具体小时数': '请选择具体小时数',
'每一天': '每一天',
'周执行 ': '周执行 ',
'开始': '开始',
'天执行 ': '天执行 ',
'天开始': '天开始',
'具体星期几(可多选)': '具体星期几(可多选)',
'请选择具体周几': '请选择具体周几',
'具体天数(可多选)': '具体天数(可多选)',
'请选择具体天数': '请选择具体天数',
'在这个月的最后一天': '在这个月的最后一天',
'在这个月的最后一个工作日': '在这个月的最后一个工作日',
'在这个月的最后一个': '在这个月的最后一个',
'在本月底前': '在本月底前',
'最近的工作日周一至周五至本月': '最近的工作日周一至周五至本月',
'在这个月的第': '在这个月的第',
'每一月': '每一月',
'月执行 ': '月执行 ',
'月开始': '月开始',
'具体月数(可多选)': '具体月数(可多选)',
'请选择具体月数': '请选择具体月数',
'每一年': '每一年',
'年执行 ': '年执行 ',
'年开始': '年开始',
'具体年数(可多选)': '具体年数(可多选)',
'请选择具体年数': '请选择具体年数',
'小时': '小时',
'日': '日'
}

34
escheduler-ui/src/js/module/components/crontab/source/_source/i18n/util.js

@ -0,0 +1,34 @@
/**
* template
*
* @param {String} string
* @param {Array} ...args
* @return {String}
*/
const { hasOwnProperty } = {}
const RE_NARGS = /(%|)\{([0-9a-zA-Z_]+)\}/g
const hasOwn = (o, k) => hasOwnProperty.call(o, k)
const template = (string, ...args) => {
if (args.length === 1 && typeof args[0] === 'object') {
args = args[0]
}
if (!args || !args.hasOwnProperty) {
args = {}
}
return string.replace(RE_NARGS, (match, prefix, i, index) => {
let result
if (string[index - 1] === '{' &&
string[index + match.length] === '}') {
return i
} else {
result = hasOwn(args, i) ? args[i] : null
if (result === null || result === undefined) {
return ''
}
return result
}
})
}
export { template }

106
escheduler-ui/src/js/module/components/crontab/source/_source/input-number.vue

@ -0,0 +1,106 @@
<template>
<div class="input-number-model">
<x-button type="ghost" @click="onReduce()" :disabled="(value < (min + 1))"><span class="bt-text">-</span></x-button>
<x-input v-model="value" placeholder=" " @on-blur="onBlur"></x-input>
<x-button type="ghost" @click="onIncrease()" :disabled="(value > (max - 1))"><span class="bt-text">+</span></x-button>
</div>
</template>
<script>
export default {
name: 'input-number',
data () {
return {
value: 1,
isIncrease: false,
isReduce: false
}
},
props: {
min: {
type: Number,
default: 0
},
max: {
type: Number,
default: 10
},
propsValue: Number
},
methods: {
onBlur () {
let $reg = /^\+?[1-9][0-9]*$/  // eslint-disable-line
let $val = this.value
// if (parseInt($val) >= this.min || parseInt($val) <= this.max) {
// return
// }
//
if (!$reg.test($val)) {
this.value = this.min
}
//
if (this.value > this.max) {
this.value = this.max
}
//
if (this.min > this.value) {
this.value = this.min
}
this.$emit('on-number', this.value)
},
onIncrease () {
this.value = parseInt(this.value) + 1
this.$emit('on-number', this.value)
},
onReduce () {
this.value = parseInt(this.value) - 1
this.$emit('on-number', this.value)
}
},
watch: {
},
beforeCreate () {
},
created () {
this.value = this.propsValue ? this.propsValue : this.min
},
beforeMount () {
},
mounted () {
},
beforeUpdate () {
},
updated () {
},
beforeDestroy () {
},
destroyed () {
},
computed: {},
components: {}
}
</script>
<style lang="scss" rel="stylesheet/scss">
.input-number-model {
display: inline-block;
button{
background: #f5f7fa;
padding: 8px 10px;
position: relative;
.bt-text {
font-size: 18px;
color: #888;
}
}
.ans-input {
width: 60px;
margin:0 -2px 0 -1px;
input {
text-align: center;
}
}
button,input{
vertical-align: middle;
}
}
</style>

505
escheduler-ui/src/js/module/components/crontab/source/_times/day.vue

@ -0,0 +1,505 @@
<template>
<div class="day-model">
<div class="v-crontab-from-model">
<x-radio-group v-model="radioDay" vertical>
<div class="list-box">
<x-radio label="everyDay">
<span class="text">{{$t('每一天')}}</span>
</x-radio>
</div>
<div class="list-box">
<x-radio label="WkintervalWeek">
<span class="text">{{$t('每隔')}}</span>
<m-input-number :min="0" :max="7" :props-value="parseInt(WkintervalWeekPerformVal)" @on-number="onWkintervalWeekPerform"></m-input-number>
<span class="text">{{$t('天执行 从')}}</span>
<x-select :placeholder="$t('请选择具体小时数')" style="width: 200px" v-model="WkintervalWeekStartVal">
<x-option
v-for="item in selectWeekList"
:key="item.value"
:value="item.value"
:label="item.label">
</x-option>
</x-select>
<span class="text">{{$t('开始')}}</span>
</x-radio>
</div>
<div class="list-box">
<x-radio label="intervalDay">
<span class="text">{{$t('每隔')}}</span>
<m-input-number :min="0" :max="31" :props-value="parseInt(intervalDayPerformVal)" @on-number="onIntervalDayPerform"></m-input-number>
<span class="text">{{$t('天执行 从')}}</span>
<m-input-number :min="1" :max="31" :props-value="parseInt(intervalDayStartVal)" @on-number="onIntervalDayStart"></m-input-number>
<span class="text">{{$t('天开始')}}</span>
</x-radio>
</div>
<div class="list-box">
<x-radio label="WkspecificWeek">
<!--<span class="text"></span>-->
<span class="text">{{$t('具体星期几(可多选)')}}</span>
<x-select multiple :placeholder="$t('请选择具体周几')" v-model="WkspecificWeekVal">
<x-option
v-for="item in selectSpecificWeekList"
:key="item.value"
:value="item.value"
:label="item.label">
</x-option>
</x-select>
</x-radio>
</div>
<div class="list-box">
<x-radio label="specificDay">
<span class="text">{{$t('具体天数(可多选)')}}</span>
<x-select multiple :placeholder="$t('请选择具体天数')" v-model="WkspecificDayVal">
<x-option
v-for="item in selectSpecificDayList"
:key="item.value"
:value="item.value"
:label="item.label">
</x-option>
</x-select>
</x-radio>
</div>
<div class="list-box">
<x-radio label="monthLastDays">
<span class="text">{{$t('在这个月的最后一天')}}</span>
</x-radio>
</div>
<div class="list-box">
<x-radio label="monthLastWorkingDays">
<span class="text">{{$t('在这个月的最后一个工作日')}}</span>
</x-radio>
</div>
<div class="list-box">
<x-radio label="monthLastWeeks">
<span class="text">{{$t('在这个月的最后一个')}}</span>
<x-select :placeholder="$t('请选择具体周几')" v-model="monthLastWeeksVal">
<x-option
v-for="item in monthLastWeeksList"
:key="item.value"
:value="item.value"
:label="item.label">
</x-option>
</x-select>
</x-radio>
</div>
<div class="list-box">
<x-radio label="monthTailBefore">
<m-input-number :min="0" :max="31" :props-value="parseInt(monthTailBeforeVal)" @on-number="onMonthTailBefore"></m-input-number>
<span class="text">{{$t('在本月底前')}}</span>
</x-radio>
</div>
<div class="list-box">
<x-radio label="recentlyWorkingDaysMonth">
<span class="text">{{$t('最近的工作日(周一至周五)至本月')}}</span>
<m-input-number :min="0" :max="31" :props-value="parseInt(recentlyWorkingDaysMonthVal)" @on-number="onRecentlyWorkingDaysMonth"></m-input-number>
<span class="text">{{$t('日')}}</span>
</x-radio>
</div>
<div class="list-box">
<x-radio label="WkmonthNumWeeks">
<!--<span class="text"></span>-->
<span class="text">{{$t('在这个月的第')}}</span>
<m-input-number :min="0" :max="31" :props-value="parseInt(WkmonthNumWeeksDayVal)" @on-number="onWkmonthNumWeeksDay"></m-input-number>
<x-select :placeholder="$t('请选择具体周几')" style="width: 200px" v-model="WkmonthNumWeeksWeekVal">
<x-option
v-for="item in WkmonthNumWeeksWeekList"
:key="item.value"
:value="item.value"
:label="item.label">
</x-option>
</x-select>
</x-radio>
</div>
</x-radio-group>
</div>
</div>
</template>
<script>
import _ from 'lodash'
import i18n from '../_source/i18n'
import { selectList, isStr, isWeek } from '../util/index'
import mInputNumber from '../_source/input-number'
export default {
name: 'day',
mixins: [i18n],
data () {
return {
radioDay: 'everyDay',
dayValue: '*',
weekValue: '?',
everyDayVal: '*',
WkintervalWeekPerformVal: 2, //
WkintervalWeekStartVal: 2, //
selectWeekList: _.map(_.cloneDeep(selectList['week']), v => {
return {
value: v.value,
label: `${this.$t(v.label)}`
}
}),
intervalDayPerformVal: 1, //
intervalDayStartVal: 1, //
WkspecificWeekVal: [], //
selectSpecificWeekList: selectList['specificWeek'],
WkspecificDayVal: [], //
selectSpecificDayList: selectList['day'],
monthLastDaysVal: 'L',
monthLastWorkingDays: 'LW',
monthLastWeeksVal: '1L',
monthLastWeeksList: _.map(_.cloneDeep(selectList['lastWeeks']), v => {
return {
value: v.value,
label: `${this.$t(v.label)}`
}
}),
monthTailBeforeVal: 1,
recentlyWorkingDaysMonthVal: 1,
WkmonthNumWeeksDayVal: 1,
WkmonthNumWeeksWeekVal: 1,
WkmonthNumWeeksWeekList: _.map(_.cloneDeep(selectList['week']), v => {
return {
value: v.value,
label: `${this.$t(v.label)}`
}
})
}
},
props: {
dayVal: String,
weekVal: String
},
methods: {
//
onWkintervalWeekPerform (val) {
this.WkintervalWeekPerformVal = val
if (this.radioDay === 'WkintervalWeek') {
this.dayValue = `?`
this.weekValue = `${this.WkintervalWeekStartVal}/${this.WkintervalWeekPerformVal}`
}
},
//
onIntervalDayPerform (val) {
this.intervalDayPerformVal = val
if (this.radioDay === 'intervalDay') {
this.dayValue = `${this.intervalDayStartVal}/${this.intervalDayPerformVal}`
}
},
//
onIntervalDayStart (val) {
this.intervalDayStartVal = val
if (this.radioDay === 'intervalDay') {
this.dayValue = `${this.intervalDayStartVal}/${this.intervalDayPerformVal}`
}
},
//
onMonthTailBefore (val) {
this.monthTailBeforeVal = val
if (this.radioDay === 'monthTailBefore') {
this.dayValue = `L-${this.monthTailBeforeVal}`
}
},
//
onRecentlyWorkingDaysMonth (val) {
this.recentlyWorkingDaysMonthVal = val
if (this.radioDay === 'recentlyWorkingDaysMonth') {
this.dayValue = `${this.recentlyWorkingDaysMonthVal}W`
}
},
//
onWkmonthNumWeeksDay (val) {
this.WkmonthNumWeeksDayVal = val
this.weekValue = `${this.WkmonthNumWeeksWeekVal}#${this.WkmonthNumWeeksDayVal}`
},
//
everyDayReset () {
this.dayValue = _.cloneDeep(this.everyDayVal)
},
// *
WkintervalWeekReset () {
this.weekValue = `${this.WkintervalWeekStartVal}/${this.WkintervalWeekPerformVal}`
},
// *
intervalDayReset () {
this.dayValue = `${this.intervalDayStartVal}/${this.intervalDayPerformVal}`
},
//
WkspecificWeekReset () {
this.weekValue = this.WkspecificWeekVal.length ? this.WkspecificWeekVal.join(',') : '*'
},
//
specificDayReset () {
this.dayValue = this.WkspecificDayVal.length ? this.WkspecificDayVal.join(',') : '*'
},
//
monthLastDaysReset () {
this.dayValue = _.cloneDeep(this.monthLastDaysVal)
},
//
monthLastWorkingDaysReset () {
this.dayValue = _.cloneDeep(this.monthLastWorkingDays)
},
// *
monthLastWeeksReset () {
this.dayValue = _.cloneDeep(this.monthLastWeeksVal)
},
//
monthTailBeforeReset () {
this.dayValue = `L-${this.monthTailBeforeVal}`
},
//
recentlyWorkingDaysMonthReset () {
this.dayValue = `${this.recentlyWorkingDaysMonthVal}W`
},
//
WkmonthNumReset () {
this.weekValue = `${this.WkmonthNumWeeksWeekVal}#${this.WkmonthNumWeeksDayVal}`
}
},
watch: {
dayValue (val) {
this.$emit('on-day-value', val)
// console.log('dayValue=> ' + val)
},
weekValue (val) {
this.$emit('on-week-value', val)
// console.log('weekValue=> ' + val)
},
//
radioDay (val) {
switch (val) {
case 'everyDay':
this.weekValue = '?'
this.everyDayReset()
break
case 'WkintervalWeek':
this.dayValue = '?'
this.WkintervalWeekReset()
break
case 'intervalDay':
this.weekValue = '?'
this.intervalDayReset()
break
case 'WkspecificWeek':
this.dayValue = '?'
this.WkspecificWeekReset()
break
case 'specificDay':
this.weekValue = '?'
this.specificDayReset()
break
case 'monthLastDays':
this.weekValue = '?'
this.monthLastDaysReset()
break
case 'monthLastWorkingDays':
this.weekValue = '?'
this.monthLastWorkingDaysReset()
break
case 'monthLastWeeks':
this.weekValue = '?'
this.monthLastWeeksReset()
break
case 'monthTailBefore':
this.weekValue = '?'
this.monthTailBeforeReset()
break
case 'recentlyWorkingDaysMonth':
this.weekValue = '?'
this.recentlyWorkingDaysMonthReset()
break
case 'WkmonthNumWeeks':
this.dayValue = '?'
this.WkmonthNumReset()
break
}
},
WkintervalWeekStartVal (val) {
if (this.radioDay === 'WkintervalWeek') {
this.dayValue = `?`
this.weekValue = `${val}/${this.WkintervalWeekPerformVal}`
}
},
//
WkspecificWeekVal (val) {
if (this.radioDay === 'WkspecificWeek') {
this.dayValue = `?`
this.weekValue = val.join(',')
}
},
//
WkspecificDayVal (val) {
if (this.radioDay === 'specificDay') {
this.weekValue = `?`
this.dayValue = val.join(',')
}
},
monthLastWeeksVal (val) {
if (this.radioDay === 'monthLastWeeks') {
this.weekValue = `?`
this.dayValue = val
}
},
WkmonthNumWeeksWeekVal (val) {
if (this.radioDay === 'WkmonthNumWeeks') {
this.dayValue = `?`
this.weekValue = `${val}#${this.WkmonthNumWeeksDayVal}`
}
}
},
beforeCreate () {
},
created () {
let $dayVal = _.cloneDeep(this.dayVal)
let $weekVal = _.cloneDeep(this.weekVal)
let isWeek1 = $weekVal.indexOf('/') !== -1
let isWeek2 = $weekVal.indexOf('#') !== -1
//
if ($dayVal === '*' && $weekVal === '?') {
console.log('初始化')
this.radioDay = 'everyDay'
return
}
//
if (isWeek1 || isWeek2 || isWeek($weekVal)) {
this.dayValue = `?`
/**
* 按顺序标序号处理(除去天)
* @param [
* WkintervalWeek=>(/),
* WkspecificWeek=>(TUE,WED),
* WkmonthNumWeeks=>(#)
* ]
*/
let hanleWeekOne = () => {
console.log('1/3')
let a = isStr($weekVal, '/')
this.WkintervalWeekStartVal = parseInt(a[0])
this.WkintervalWeekPerformVal = parseInt(a[1])
this.dayValue = `?`
this.weekValue = `${this.WkintervalWeekPerformVal}/${this.WkintervalWeekStartVal}`
this.radioDay = 'WkintervalWeek'
}
let hanleWeekTwo = () => {
console.log('TUE,WED')
this.WkspecificWeekVal = $weekVal.split(',')
this.radioDay = 'WkspecificWeek'
}
let hanleWeekThree = () => {
console.log('6#5')
let a = isStr($weekVal, '#')
this.WkmonthNumWeeksWeekVal = parseInt(a[0])
this.WkmonthNumWeeksDayVal = parseInt(a[1])
this.radioDay = 'WkmonthNumWeeks'
}
//
if (isStr($weekVal, '/')) {
hanleWeekOne()
} else if (isStr($weekVal, '#')) {
hanleWeekThree()
} else if (isWeek($weekVal)) {
hanleWeekTwo()
}
} else {
this.weekValue = `?`
/**
* 按顺序标序号处理(除去周)
* @param [
* everyDay=>(*),
* intervalDay=>(1/1),
* specificDay=>(1,2,5,3,4),
* monthLastDays=>(L),
* monthLastWorkingDays=>(LW),
* monthLastWeeks=>(3L),
* monthTailBefore=>(L-4),
* recentlyWorkingDaysMonth=>(6W)
* ]
*/
const hanleDayOne = () => {
console.log('*')
}
const hanleDayTwo = () => {
console.log('1/1')
let a = isStr($dayVal, '/')
this.intervalDayStartVal = parseInt(a[0])
this.intervalDayPerformVal = parseInt(a[1])
this.radioDay = 'intervalDay'
}
const hanleDayThree = () => {
console.log('1,2,5,3,4')
this.WkspecificDayVal = $dayVal.split(',')
this.radioDay = 'specificDay'
}
const hanleDayFour = () => {
console.log('L')
this.radioDay = 'monthLastDays'
}
const hanleDayFive = () => {
console.log('LW')
this.radioDay = 'monthLastWorkingDays'
}
const hanleDaySix = () => {
console.log('3L')
this.monthLastWeeksVal = $dayVal
this.radioDay = 'monthLastWeeks'
}
const hanleDaySeven = () => {
console.log('L-4')
let a = isStr($dayVal, '-')
this.monthTailBeforeVal = parseInt(a[1])
this.radioDay = 'monthTailBefore'
}
const hanleDayEight = () => {
console.log('6W')
this.recentlyWorkingDaysMonthVal = parseInt($dayVal.slice(0, $dayVal.length - 1))
this.radioDay = 'recentlyWorkingDaysMonth'
}
if ($dayVal === '*') {
hanleDayOne()
} else if (isStr($dayVal, '/')) {
hanleDayTwo()
} else if ($dayVal === 'L') {
hanleDayFour()
} else if ($dayVal === 'LW') {
hanleDayFive()
} else if ($dayVal.charAt($dayVal.length - 1) === 'L') {
hanleDaySix()
} else if (isStr($dayVal, '-')) {
hanleDaySeven()
} else if ($dayVal.charAt($dayVal.length - 1) === 'W') {
hanleDayEight()
} else {
hanleDayThree()
}
}
},
beforeMount () {
},
mounted () {
},
beforeUpdate () {
},
updated () {
},
beforeDestroy () {
},
destroyed () {
},
computed: {},
components: { mInputNumber }
}
</script>
<style lang="scss" rel="stylesheet/scss">
.day-model {
}
</style>

239
escheduler-ui/src/js/module/components/crontab/source/_times/hour.vue

@ -0,0 +1,239 @@
<template>
<div class="hour-model">
<div class="v-crontab-from-model">
<x-radio-group v-model="radioHour" vertical>
<div class="list-box">
<x-radio label="everyHour">
<span class="text">{{$t('每一小时')}}</span>
</x-radio>
</div>
<div class="list-box">
<x-radio label="intervalHour">
<span class="text">{{$t('每隔')}}</span>
<m-input-number :min="0" :max="23" :props-value="parseInt(intervalPerformVal)" @on-number="onIntervalPerform"></m-input-number>
<span class="text">{{$t('小时执行 从')}}</span>
<m-input-number :min="0" :max="23" :props-value="parseInt(intervalStartVal)" @on-number="onIntervalStart"></m-input-number>
<span class="text">{{$t('小时开始')}}</span>
</x-radio>
</div>
<div class="list-box">
<x-radio label="specificHour">
<span class="text">{{$t('具体小时数(可多选)')}}</span>
<x-select multiple :placeholder="$t('请选择具体小时数')" v-model="specificHoursVal" @on-change="onspecificHours">
<x-option
v-for="item in selectHourList"
:key="item.value"
:value="item.value"
:label="item.label">
</x-option>
</x-select>
</x-radio>
</div>
<div class="list-box">
<x-radio label="cycleHour">
<span class="text">{{$t('周期从')}}</span>
<m-input-number :min="0" :max="23" :props-value="parseInt(cycleStartVal)" @on-number="onCycleStart"></m-input-number>
<span class="text">{{$t('到')}}</span>
<m-input-number :min="0" :max="23" :props-value="parseInt(cycleEndVal)" @on-number="onCycleEnd"></m-input-number>
<span class="text">{{$t('小时')}}</span>
</x-radio>
</div>
</x-radio-group>
</div>
</div>
</template>
<script>
import _ from 'lodash'
import i18n from '../_source/i18n'
import { selectList, isStr } from '../util/index'
import mInputNumber from '../_source/input-number'
export default {
name: 'hour',
mixins: [i18n],
data () {
return {
hourValue: '*',
radioHour: 'everyHour',
selectHourList: selectList['24'],
intervalPerformVal: 5,
intervalStartVal: 3,
specificHoursVal: [],
cycleStartVal: 1,
cycleEndVal: 1
}
},
props: {
hourVal: String,
value: {
type: String,
default: '*'
}
},
model: {
prop: 'value',
event: 'hourValueEvent'
},
methods: {
// 1
onIntervalPerform (val) {
this.intervalPerformVal = val
if (this.radioHour === 'intervalHour') {
this.hourValue = `${this.intervalStartVal}/${this.intervalPerformVal}`
}
},
// 2
onIntervalStart (val) {
this.intervalStartVal = val
if (this.radioHour === 'intervalHour') {
this.hourValue = `${this.intervalStartVal}/${this.intervalPerformVal}`
}
},
//
onspecificHours (arr) {
},
//
onCycleStart (val) {
this.cycleStartVal = val
if (this.radioHour === 'cycleHour') {
this.hourValue = `${this.cycleStartVal}-${this.cycleEndVal}`
}
},
//
onCycleEnd (val) {
this.cycleEndVal = val
if (this.radioHour === 'cycleHour') {
this.hourValue = `${this.cycleStartVal}-${this.cycleEndVal}`
}
},
//
everyReset () {
this.hourValue = '*'
},
//
intervalReset () {
this.hourValue = `${this.intervalStartVal}/${this.intervalPerformVal}`
},
//
specificReset () {
if (this.specificHoursVal.length) {
this.hourValue = this.specificHoursVal.join(',')
} else {
this.hourValue = '*'
}
},
//
cycleReset () {
this.hourValue = `${this.cycleStartVal}-${this.cycleEndVal}`
},
/**
* 解析参数值
*/
analyticalValue () {
return new Promise((resolve, reject) => {
let $hourVal = _.cloneDeep(this.value)
//
let $interval = isStr($hourVal, '/')
//
let $specific = isStr($hourVal, ',')
//
let $cycle = isStr($hourVal, '-')
//
if ($hourVal === '*') {
this.radioHour = 'everyHour'
this.hourValue = '*'
return
}
// ()
if ($hourVal.length === 1 && _.isInteger(parseInt($hourVal)) ||
$hourVal.length === 2 && _.isInteger(parseInt($hourVal))
) {
this.radioHour = 'specificHour'
this.specificHoursVal = [$hourVal]
return
}
//
if ($interval) {
this.radioHour = 'intervalHour'
this.intervalStartVal = parseInt($interval[0])
this.intervalPerformVal = parseInt($interval[1])
this.hourValue = `${this.intervalStartVal}/${this.intervalPerformVal}`
return
}
//
if ($specific) {
this.radioHour = 'specificHour'
this.specificHoursVal = $specific
return
}
//
if ($cycle) {
this.radioHour = 'cycleHour'
this.cycleStartVal = parseInt($cycle[0])
this.cycleEndVal = parseInt($cycle[1])
this.hourValue = `${this.cycleStartVal}/${this.cycleEndVal}`
return
}
resolve()
})
}
},
watch: {
//
hourValue (val) {
this.$emit('hourValueEvent', val)
},
//
radioHour (val) {
switch (val) {
case 'everyHour':
this.everyReset()
break
case 'intervalHour':
this.intervalReset()
break
case 'specificHour':
this.specificReset()
break
case 'cycleHour':
this.cycleReset()
break
}
},
//
specificHoursVal (arr) {
this.hourValue = arr.join(',')
}
},
beforeCreate () {
},
created () {
this.analyticalValue().then(() => {
console.log('数据结构解析成功!')
})
},
beforeMount () {
},
mounted () {
},
beforeUpdate () {
},
updated () {
},
beforeDestroy () {
},
destroyed () {
},
computed: {},
components: { mInputNumber }
}
</script>
<style lang="scss" rel="stylesheet/scss">
</style>

245
escheduler-ui/src/js/module/components/crontab/source/_times/minute.vue

@ -0,0 +1,245 @@
<template>
<div class="minute-model">
<div class="v-crontab-from-model">
<x-radio-group v-model="radioMinute" vertical>
<div class="list-box">
<x-radio label="everyMinute">
<span class="text">{{$t('每一分钟')}}</span>
</x-radio>
</div>
<div class="list-box">
<x-radio label="intervalMinute">
<span class="text">{{$t('每隔')}}</span>
<m-input-number :min="0" :max="59" :props-value="parseInt(intervalPerformVal)" @on-number="onIntervalPerform"></m-input-number>
<span class="text">{{$t('分执行 从')}}</span>
<m-input-number :min="0" :max="59" :props-value="parseInt(intervalStartVal)" @on-number="onIntervalStart"></m-input-number>
<span class="text">{{$t('分开始')}}</span>
</x-radio>
</div>
<div class="list-box">
<x-radio label="specificMinute">
<span class="text">{{$t('具体分钟数(可多选)')}}</span>
<x-select multiple :placeholder="$t('请选择具体分钟数')" v-model="specificMinutesVal" @on-change="onspecificMinutes">
<x-option
v-for="item in selectMinuteList"
:key="item.value"
:value="item.value"
:label="item.label">
</x-option>
</x-select>
</x-radio>
</div>
<div class="list-box">
<x-radio label="cycleMinute">
<span class="text">{{$t('周期从')}}</span>
<m-input-number :min="0" :max="59" :props-value="parseInt(cycleStartVal)" @on-number="onCycleStart"></m-input-number>
<span class="text">{{$t('到')}}</span>
<m-input-number :min="0" :max="59" :props-value="parseInt(cycleEndVal)" @on-number="onCycleEnd"></m-input-number>
<span class="text">{{$t('分')}}</span>
</x-radio>
</div>
</x-radio-group>
</div>
</div>
</template>
<script>
import _ from 'lodash'
import i18n from '../_source/i18n'
import { selectList, isStr } from '../util/index'
import mInputNumber from '../_source/input-number'
export default {
name: 'minute',
mixins: [i18n],
data () {
return {
minuteValue: '*',
radioMinute: 'everyMinute',
selectMinuteList: selectList['60'],
intervalPerformVal: 5,
intervalStartVal: 3,
specificMinutesVal: [],
cycleStartVal: 1,
cycleEndVal: 1
}
},
props: {
minuteVal: String,
value: {
type: String,
default: '*'
}
},
model: {
prop: 'value',
event: 'minuteValueEvent'
},
methods: {
// 1
onIntervalPerform (val) {
console.log(val)
this.intervalPerformVal = val
if (this.radioMinute === 'intervalMinute') {
this.minuteValue = `${this.intervalStartVal}/${this.intervalPerformVal}`
}
},
// 2
onIntervalStart (val) {
this.intervalStartVal = val
if (this.radioMinute === 'intervalMinute') {
this.minuteValue = `${this.intervalStartVal}/${this.intervalPerformVal}`
}
},
//
onspecificMinutes (arr) {
},
//
onCycleStart (val) {
this.cycleStartVal = val
if (this.radioMinute === 'cycleMinute') {
this.minuteValue = `${this.cycleStartVal}-${this.cycleEndVal}`
}
},
//
onCycleEnd (val) {
this.cycleEndVal = val
if (this.radioMinute === 'cycleMinute') {
this.minuteValue = `${this.cycleStartVal}-${this.cycleEndVal}`
}
},
//
everyReset () {
this.minuteValue = '*'
},
//
intervalReset () {
this.minuteValue = `${this.intervalStartVal}/${this.intervalPerformVal}`
},
//
specificReset () {
if (this.specificMinutesVal.length) {
this.minuteValue = this.specificMinutesVal.join(',')
} else {
this.minuteValue = '*'
}
},
//
cycleReset () {
this.minuteValue = `${this.cycleStartVal}-${this.cycleEndVal}`
},
/**
* 解析参数值
*/
analyticalValue () {
return new Promise((resolve, reject) => {
let $minuteVal = _.cloneDeep(this.value)
//
let $interval = isStr($minuteVal, '/')
//
let $specific = isStr($minuteVal, ',')
//
let $cycle = isStr($minuteVal, '-')
//
if ($minuteVal === '*') {
this.radioMinute = 'everyMinute'
this.minuteValue = '*'
return
}
//
if ($minuteVal.length === 1 && _.isInteger(parseInt($minuteVal)) ||
$minuteVal.length === 2 && _.isInteger(parseInt($minuteVal))
) {
this.radioMinute = 'specificMinute'
this.specificMinutesVal = [$minuteVal]
return
}
//
if ($interval) {
this.radioMinute = 'intervalMinute'
this.intervalStartVal = parseInt($interval[0])
this.intervalPerformVal = parseInt($interval[1])
this.minuteValue = `${this.intervalStartVal}/${this.intervalPerformVal}`
return
}
//
if ($specific) {
this.radioMinute = 'specificMinute'
this.specificMinutesVal = $specific
return
}
//
if ($cycle) {
this.radioMinute = 'cycleMinute'
this.cycleStartVal = parseInt($cycle[0])
this.cycleEndVal = parseInt($cycle[1])
this.minuteValue = `${this.cycleStartVal}/${this.cycleEndVal}`
return
}
resolve()
})
}
},
watch: {
//
minuteValue (val) {
this.$emit('minuteValueEvent', val)
},
//
radioMinute (val) {
switch (val) {
case 'everyMinute':
this.everyReset()
break
case 'intervalMinute':
this.intervalReset()
break
case 'specificMinute':
this.specificReset()
break
case 'cycleMinute':
this.cycleReset()
break
}
},
//
specificMinutesVal (arr) {
this.minuteValue = arr.join(',')
}
},
beforeCreate () {
},
created () {
this.analyticalValue().then(() => {
console.log('数据结构解析成功!')
})
},
beforeMount () {
},
mounted () {
},
beforeUpdate () {
},
updated () {
},
beforeDestroy () {
},
destroyed () {
},
computed: {},
components: { mInputNumber }
}
</script>
<style lang="scss" rel="stylesheet/scss">
.minute-model {
}
</style>

244
escheduler-ui/src/js/module/components/crontab/source/_times/month.vue

@ -0,0 +1,244 @@
<template>
<div class="month-model">
<div class="v-crontab-from-model">
<x-radio-group v-model="radioMonth" vertical>
<div class="list-box">
<x-radio label="everyMonth">
<span class="text">{{$t('每一月')}}</span>
</x-radio>
</div>
<div class="list-box">
<x-radio label="intervalMonth">
<span class="text">{{$t('每隔')}}</span>
<m-input-number :min="0" :max="12" :props-value="parseInt(intervalPerformVal)" @on-number="onIntervalPerform"></m-input-number>
<span class="text">{{$t('月执行 从')}}</span>
<m-input-number :min="0" :max="12" :props-value="parseInt(intervalStartVal)" @on-number="onIntervalStart"></m-input-number>
<span class="text">{{$t('月开始')}}</span>
</x-radio>
</div>
<div class="list-box">
<x-radio label="specificlMonth">
<span class="text">{{$t('具体月数(可多选)')}}</span>
<x-select multiple :placeholder="$t('请选择具体月数')" v-model="specificMonthVal" @on-change="onspecificlMonths">
<x-option
v-for="item in selectMonthList"
:key="item.value"
:value="item.value"
:label="item.label">
</x-option>
</x-select>
</x-radio>
</div>
<div class="list-box">
<x-radio label="cycleMonth">
<span class="text">{{$t('周期从')}}</span>
<m-input-number :min="0" :max="12" :props-value="parseInt(cycleStartVal)" @on-number="onCycleStart"></m-input-number>
<span class="text">{{$t('到')}}</span>
<m-input-number :min="0" :max="12" :props-value="parseInt(cycleEndVal)" @on-number="onCycleEnd"></m-input-number>
<span class="text">{{$t('月')}}</span>
</x-radio>
</div>
</x-radio-group>
</div>
</div>
</template>
<script>
import _ from 'lodash'
import i18n from '../_source/i18n'
import { selectList, isStr } from '../util/index'
import mInputNumber from '../_source/input-number'
export default {
name: 'month',
mixins: [i18n],
data () {
return {
monthValue: '*',
radioMonth: 'everyMonth',
selectMonthList: selectList['12'],
intervalPerformVal: 5,
intervalStartVal: 3,
specificMonthVal: [],
cycleStartVal: 1,
cycleEndVal: 1
}
},
props: {
monthVal: String,
value: {
type: String,
default: '*'
}
},
model: {
prop: 'value',
event: 'monthValueEvent'
},
methods: {
// 1
onIntervalPerform (val) {
this.intervalPerformVal = val
if (this.radioMonth === 'intervalMonth') {
this.monthValue = `${this.intervalStartVal}/${this.intervalPerformVal}`
}
},
// 2
onIntervalStart (val) {
this.intervalStartVal = val
if (this.radioMonth === 'intervalMonth') {
this.monthValue = `${this.intervalStartVal}/${this.intervalPerformVal}`
}
},
//
onspecificlMonths (arr) {
},
//
onCycleStart (val) {
this.cycleStartVal = val
if (this.radioMonth === 'cycleMonth') {
this.monthValue = `${this.cycleStartVal}-${this.cycleEndVal}`
}
},
//
onCycleEnd (val) {
this.cycleEndVal = val
if (this.radioMonth === 'cycleMonth') {
this.monthValue = `${this.cycleStartVal}-${this.cycleEndVal}`
}
},
//
everyReset () {
this.monthValue = '*'
},
//
intervalReset () {
this.monthValue = `${this.intervalStartVal}/${this.intervalPerformVal}`
},
//
specificReset () {
if (this.specificMonthVal.length) {
this.monthValue = this.specificMonthVal.join(',')
} else {
this.monthValue = '*'
}
},
//
cycleReset () {
this.monthValue = `${this.cycleStartVal}-${this.cycleEndVal}`
},
/**
* 解析参数值
*/
analyticalValue () {
return new Promise((resolve, reject) => {
let $monthVal = _.cloneDeep(this.value)
//
let $interval = isStr($monthVal, '/')
//
let $specific = isStr($monthVal, ',')
//
let $cycle = isStr($monthVal, '-')
//
if ($monthVal === '*') {
this.radioMonth = 'everyMonth'
this.monthValue = '*'
return
}
// ()
if ($monthVal.length === 1 && _.isInteger(parseInt($monthVal)) ||
$monthVal.length === 2 && _.isInteger(parseInt($monthVal))
) {
this.radioMonth = 'specificlMonth'
this.specificMonthVal = [$monthVal]
return
}
//
if ($interval) {
this.radioMonth = 'intervalMonth'
this.intervalStartVal = parseInt($interval[0])
this.intervalPerformVal = parseInt($interval[1])
this.monthValue = `${this.intervalStartVal}/${this.intervalPerformVal}`
return
}
//
if ($specific) {
this.radioMonth = 'specificlMonth'
this.specificMonthVal = $specific
return
}
//
if ($cycle) {
this.radioMonth = 'cycleMonth'
this.cycleStartVal = parseInt($cycle[0])
this.cycleEndVal = parseInt($cycle[1])
this.monthValue = `${this.cycleStartVal}/${this.cycleEndVal}`
return
}
resolve()
})
}
},
watch: {
//
monthValue (val) {
this.$emit('monthValueEvent', val)
},
//
radioMonth (val) {
switch (val) {
case 'everyMonth':
this.everyReset()
break
case 'intervalMonth':
this.intervalReset()
break
case 'specificlMonth':
this.specificReset()
break
case 'cycleMonth':
this.cycleReset()
break
}
},
//
specificMonthVal (arr) {
this.monthValue = arr.join(',')
}
},
beforeCreate () {
},
created () {
this.analyticalValue().then(() => {
console.log('数据结构解析成功!')
})
},
beforeMount () {
},
mounted () {
},
beforeUpdate () {
},
updated () {
},
beforeDestroy () {
},
destroyed () {
},
computed: {},
components: { mInputNumber }
}
</script>
<style lang="scss" rel="stylesheet/scss">
.month-model {
}
</style>

252
escheduler-ui/src/js/module/components/crontab/source/_times/second.vue

@ -0,0 +1,252 @@
<template>
<div class="second-model">
<div class="v-crontab-from-model">
<x-radio-group v-model="radioSecond" vertical>
<div class="list-box">
<x-radio label="everySecond">
<span class="text">{{$t('每一秒钟')}}</span>
</x-radio>
</div>
<div class="list-box">
<x-radio label="intervalSecond">
<span class="text">{{$t('每隔')}}</span>
<m-input-number :min="0" :max="59" :props-value="parseInt(intervalPerformVal)" @on-number="onIntervalPerform"></m-input-number>
<span class="text">{{$t('秒执行 从')}}</span>
<m-input-number :min="0" :max="59" :props-value="parseInt(intervalStartVal)" @on-number="onIntervalStart"></m-input-number>
<span class="text">{{$t('秒开始')}}</span>
</x-radio>
</div>
<div class="list-box">
<x-radio label="specificSecond">
<span class="text">{{$t('具体秒数(可多选)')}}</span>
<x-select multiple :placeholder="$t('请选择具体秒数')" v-model="specificSecondsVal" @on-change="onSpecificSeconds">
<x-option
v-for="item in selectSecondList"
:key="item.value"
:value="item.value"
:label="item.label">
</x-option>
</x-select>
</x-radio>
</div>
<div class="list-box">
<x-radio label="cycleSecond">
<span class="text">{{$t('周期从')}}</span>
<m-input-number :min="0" :max="59" :props-value="parseInt(cycleStartVal)" @on-number="onCycleStart"></m-input-number>
<span class="text">{{$t('到')}}</span>
<m-input-number :min="0" :max="59" :props-value="parseInt(cycleEndVal)" @on-number="onCycleEnd"></m-input-number>
<span class="text">{{$t('秒')}}</span>
</x-radio>
</div>
</x-radio-group>
</div>
</div>
</template>
<script>
import _ from 'lodash'
import i18n from '../_source/i18n'
import { selectList, isStr } from '../util/index'
import mInputNumber from '../_source/input-number'
export default {
name: 'second',
mixins: [i18n],
data () {
return {
secondValue: '*',
radioSecond: 'everySecond',
selectSecondList: selectList['60'],
intervalPerformVal: 5,
intervalStartVal: 3,
specificSecondsVal: [],
cycleStartVal: 1,
cycleEndVal: 1
}
},
props: {
secondVal: String,
value: {
type: String,
default: '*'
}
},
model: {
prop: 'value',
event: 'secondValueEvent'
},
methods: {
// 1
onIntervalPerform (val) {
console.log(val)
console.log('++')
this.intervalPerformVal = val
if (this.radioSecond === 'intervalSecond') {
this.secondValue = `${this.intervalStartVal}/${this.intervalPerformVal}`
}
},
// 2
onIntervalStart (val) {
this.intervalStartVal = val
if (this.radioSecond === 'intervalSecond') {
this.secondValue = `${this.intervalStartVal}/${this.intervalPerformVal}`
}
},
//
onSpecificSeconds (arr) {
},
//
onCycleStart (val) {
this.cycleStartVal = val
if (this.radioSecond === 'cycleSecond') {
this.secondValue = `${this.cycleStartVal}-${this.cycleEndVal}`
}
},
//
onCycleEnd (val) {
this.cycleEndVal = val
if (this.radioSecond === 'cycleSecond') {
this.secondValue = `${this.cycleStartVal}-${this.cycleEndVal}`
}
},
//
everyReset () {
this.secondValue = '*'
},
//
intervalReset () {
this.secondValue = `${this.intervalStartVal}/${this.intervalPerformVal}`
},
//
specificReset () {
if (this.specificSecondsVal.length) {
this.secondValue = this.specificSecondsVal.join(',')
} else {
this.secondValue = '*'
}
},
//
cycleReset () {
this.secondValue = `${this.cycleStartVal}-${this.cycleEndVal}`
},
/**
* 解析参数值
*/
analyticalValue () {
return new Promise((resolve, reject) => {
let $secondVal = _.cloneDeep(this.value)
//
let $interval = isStr($secondVal, '/')
//
let $specific = isStr($secondVal, ',')
//
let $cycle = isStr($secondVal, '-')
//
if ($secondVal === '*') {
this.radioSecond = 'everySecond'
this.secondValue = '*'
return
}
// ()
if ($secondVal.length === 1 && _.isInteger(parseInt($secondVal)) ||
$secondVal.length === 2 && _.isInteger(parseInt($secondVal))
) {
this.radioSecond = 'specificSecond'
this.specificSecondsVal = [$secondVal]
return
}
//
if ($interval) {
this.radioSecond = 'intervalSecond'
this.intervalStartVal = parseInt($interval[0])
this.intervalPerformVal = parseInt($interval[1])
this.secondValue = `${this.intervalStartVal}/${this.intervalPerformVal}`
return
}
//
if ($specific) {
this.radioSecond = 'specificSecond'
this.specificSecondsVal = $specific
return
}
//
if ($cycle) {
this.radioSecond = 'cycleSecond'
this.cycleStartVal = parseInt($cycle[0])
this.cycleEndVal = parseInt($cycle[1])
this.secondValue = `${this.cycleStartVal}/${this.cycleEndVal}`
return
}
resolve()
})
}
},
watch: {
// value
value () {
this.analyticalValue().then(() => {
console.log('数据结构解析成功!')
})
},
//
secondValue (val) {
this.$emit('secondValueEvent', val)
},
//
radioSecond (val) {
switch (val) {
case 'everySecond':
this.everyReset()
break
case 'intervalSecond':
this.intervalReset()
break
case 'specificSecond':
this.specificReset()
break
case 'cycleSecond':
this.cycleReset()
break
}
},
//
specificSecondsVal (arr) {
this.secondValue = arr.join(',')
}
},
beforeCreate () {
},
created () {
this.analyticalValue().then(() => {
console.log('数据结构解析成功!')
})
},
beforeMount () {
},
mounted () {
},
beforeUpdate () {
},
updated () {
},
beforeDestroy () {
},
destroyed () {
},
computed: {},
components: { mInputNumber }
}
</script>
<style lang="scss" rel="stylesheet/scss">
.second-model {
}
</style>

243
escheduler-ui/src/js/module/components/crontab/source/_times/year.vue

@ -0,0 +1,243 @@
<template>
<div class="year-model">
<div class="v-crontab-from-model">
<x-radio-group v-model="radioYear" vertical>
<div class="list-box">
<x-radio label="everyYear">
<span class="text">{{$t('每一年')}}</span>
</x-radio>
</div>
<div class="list-box">
<x-radio label="intervalYear">
<span class="text">{{$t('每隔')}}</span>
<m-input-number :min="2019" :max="2030" :props-value="parseInt(intervalPerformVal)" @on-number="onIntervalPerform"></m-input-number>
<span class="text">{{$t('年执行 从')}}</span>
<m-input-number :min="2019" :max="2030" :props-value="parseInt(intervalStartVal)" @on-number="onIntervalStart"></m-input-number>
<span class="text">{{$t('年开始')}}</span>
</x-radio>
</div>
<div class="list-box">
<x-radio label="specificYear">
<span class="text">{{$t('具体年数(可多选)')}}</span>
<x-select multiple :placeholder="$t('请选择具体年数')" v-model="specificYearVal" @on-change="onspecificYears">
<x-option
v-for="item in selectYearList"
:key="item.value"
:value="item.value"
:label="item.label">
</x-option>
</x-select>
</x-radio>
</div>
<div class="list-box">
<x-radio label="cycleYear">
<span class="text">{{$t('周期从')}}</span>
<m-input-number :min="2019" :max="2030" :props-value="parseInt(cycleStartVal)" @on-number="onCycleStart"></m-input-number>
<span class="text">{{$t('到')}}</span>
<m-input-number :min="2019" :max="2030" :props-value="parseInt(cycleEndVal)" @on-number="onCycleEnd"></m-input-number>
<span class="text">{{$t('年')}}</span>
</x-radio>
</div>
</x-radio-group>
</div>
</div>
</template>
<script>
import _ from 'lodash'
import i18n from '../_source/i18n'
import { selectList, isStr } from '../util/index'
import mInputNumber from '../_source/input-number'
export default {
name: 'year',
mixins: [i18n],
data () {
return {
yearValue: '*',
radioYear: 'everyYear',
selectYearList: selectList['year'],
intervalPerformVal: 1,
intervalStartVal: 2019,
specificYearVal: [],
cycleStartVal: 2019,
cycleEndVal: 2019
}
},
props: {
yearVal: String,
value: {
type: String,
default: '*'
}
},
model: {
prop: 'value',
event: 'yearValueEvent'
},
methods: {
// 1
onIntervalPerform (val) {
console.log(val)
this.intervalPerformVal = val
if (this.radioYear === 'intervalYear') {
this.yearValue = `${this.intervalStartVal}/${this.intervalPerformVal}`
}
},
// 2
onIntervalStart (val) {
this.intervalStartVal = val
if (this.radioYear === 'intervalYear') {
this.yearValue = `${this.intervalStartVal}/${this.intervalPerformVal}`
}
},
//
onspecificYears (arr) {
},
//
onCycleStart (val) {
this.cycleStartVal = val
if (this.radioYear === 'cycleYear') {
this.yearValue = `${this.cycleStartVal}-${this.cycleEndVal}`
}
},
//
onCycleEnd (val) {
this.cycleEndVal = val
if (this.radioYear === 'cycleYear') {
this.yearValue = `${this.cycleStartVal}-${this.cycleEndVal}`
}
},
//
everyReset () {
this.yearValue = '*'
},
//
intervalReset () {
this.yearValue = `${this.intervalStartVal}/${this.intervalPerformVal}`
},
//
specificReset () {
if (this.specificYearVal.length) {
this.yearValue = this.specificYearVal.join(',')
} else {
this.yearValue = '*'
}
},
//
cycleReset () {
this.yearValue = `${this.cycleStartVal}-${this.cycleEndVal}`
},
/**
* 解析参数值
*/
analyticalValue () {
return new Promise((resolve, reject) => {
let $yearVal = _.cloneDeep(this.value)
//
let $interval = isStr($yearVal, '/')
//
let $specific = isStr($yearVal, ',')
//
let $cycle = isStr($yearVal, '-')
//
if ($yearVal === '*') {
this.radioYear = 'everyYear'
this.yearValue = '*'
return
}
// ()
if ($yearVal.length === 4 && _.isInteger(parseInt($yearVal))) {
this.radioYear = 'specificYear'
this.specificYearVal = [$yearVal]
return
}
//
if ($interval) {
this.radioYear = 'intervalYear'
this.intervalStartVal = parseInt($interval[0])
this.intervalPerformVal = parseInt($interval[1])
this.yearValue = `${this.intervalStartVal}/${this.intervalPerformVal}`
return
}
//
if ($specific) {
this.radioYear = 'specificYear'
this.specificYearVal = $specific
return
}
//
if ($cycle) {
this.radioYear = 'cycleYear'
this.cycleStartVal = parseInt($cycle[0])
this.cycleEndVal = parseInt($cycle[1])
this.yearValue = `${this.cycleStartVal}/${this.cycleEndVal}`
return
}
resolve()
})
}
},
watch: {
//
yearValue (val) {
this.$emit('yearValueEvent', val)
},
//
radioYear (val) {
switch (val) {
case 'everyYear':
this.everyReset()
break
case 'intervalYear':
this.intervalReset()
break
case 'specificYear':
this.specificReset()
break
case 'cycleYear':
this.cycleReset()
break
}
},
//
specificYearVal (arr) {
this.yearValue = arr.join(',')
}
},
beforeCreate () {
},
created () {
this.analyticalValue().then(() => {
console.log('数据结构解析成功!')
})
},
beforeMount () {
},
mounted () {
},
beforeUpdate () {
},
updated () {
},
beforeDestroy () {
},
destroyed () {
},
computed: {},
components: { mInputNumber }
}
</script>
<style lang="scss" rel="stylesheet/scss">
.year-model {
}
</style>

190
escheduler-ui/src/js/module/components/crontab/source/app.vue

@ -0,0 +1,190 @@
<template>
<div class="v-crontab">
<!--<div style="border: 1px solid red;padding: 10px">-->
<!--&lt;!&ndash;<span style="display: block">{{secondVal}} {{minuteVal}} {{hourVal}} {{dayVal}} {{monthVal}} {{weekVal}} {{yearVal}}</span>&ndash;&gt;-->
<!--{{rtValue}}-->
<!--</div>-->
<div class="v-crontab-model">
<div class="clearfix v-crontab-tab">
<a href="javascript:" :class="tabVal === 'second' ?' active' :''" @click="onTab('second')"><i class="ans-icon-calendar"></i><span>{{$t('秒')}}</span></a>
<a href="javascript:" :class="tabVal === 'minute' ?' active' :''" @click="onTab('minute')"><i class="ans-icon-calendar"></i><span>{{$t('分')}}</span></a>
<a href="javascript:" :class="tabVal === 'hour' ?' active' :''" @click="onTab('hour')"><i class="ans-icon-calendar"></i><span>{{$t('时')}}</span></a>
<a href="javascript:" :class="tabVal === 'day' ?' active' :''" @click="onTab('day')"><i class="ans-icon-calendar"></i><span>{{$t('天')}}</span></a>
<a href="javascript:" :class="tabVal === 'month' ?' active' :''" @click="onTab('month')"><i class="ans-icon-calendar"></i><span>{{$t('月')}}</span></a>
<a href="javascript:" :class="tabVal === 'year' ?' active' :''" @click="onTab('year')"><i class="ans-icon-calendar"></i><span>{{$t('年')}}</span></a>
</div>
<div class="v-crontab-content">
<template v-if="tabVal === 'second'">
<m-second v-model="secondVal"></m-second>
</template>
<template v-if="tabVal === 'minute'">
<m-minute v-model="minuteVal"></m-minute>
</template>
<template v-if="tabVal === 'hour'">
<m-hour v-model="hourVal"></m-hour>
</template>
<!-- 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 -->
<template v-if="tabVal === 'month'">
<m-month v-model="monthVal"></m-month>
</template>
<template v-if="tabVal === 'year'">
<m-year v-model="yearVal"></m-year>
</template>
</div>
</div>
</div>
</template>
<script>
import i18n from './_source/i18n'
import mSecond from './_times/second'
import mMinute from './_times/minute'
import mHour from './_times/hour'
import mDay from './_times/day'
import mMonth from './_times/month'
import mYear from './_times/year'
export default {
name: 'app',
data () {
return {
tabVal: 'second',
secondVal: '*',
minuteVal: '*',
hourVal: '*',
dayVal: '*',
monthVal: '*',
weekVal: '?',
yearVal: '*',
watchValue: ''
}
},
mixins: [i18n],
props: {
value: {
type: String,
default: '* * * * * ? *'
},
locale: {
type: String,
default: 'en_US'
}
},
model: {
prop: 'value',
event: 'valueEvent'
},
methods: {
onTab (val) {
this.tabVal = val
},
_onDayValue (val) {
this.dayVal = val
},
_onWeekValue (val) {
this.weekVal = val
},
_reset () {
let str = this.value.split(' ')
this.secondVal = str[0]
this.minuteVal = str[1]
this.hourVal = str[2]
this.dayVal = str[3]
this.monthVal = str[4]
this.weekVal = str[5]
this.yearVal = str[6]
}
},
watch: {
rtValue (val) {
this.$emit('valueEvent', val)
},
value () {
this._reset()
}
},
beforeCreate () {
},
created () {
// win
window.localeCrontab = this.locale
//
this._reset()
},
beforeMount () {
},
mounted () {
},
beforeUpdate () {
},
updated () {
},
beforeDestroy () {
},
destroyed () {
},
computed: {
rtValue () {
return `${this.secondVal} ${this.minuteVal} ${this.hourVal} ${this.dayVal} ${this.monthVal} ${this.weekVal} ${this.yearVal}`
}
},
components: { mSecond, mMinute, mHour, mDay, mMonth, mYear }
}
</script>
<style lang="scss">
@import "index";
.v-crontab {
width: 640px;
border:1px solid #e4e7ed;
background: #fff;
border-radius: 4px;
.v-crontab-model {
.v-crontab-tab {
background: #f5f7fa;
height: 42px;
border-bottom: 1px solid #e4e7ed;
a {
width: 86px;
height: 42px;
line-height: 42px;
text-align: center;
float: left;
border-right: 1px solid #e4e7ed;
text-decoration: none;
span,i {
font-size: 14px;
color: #888;
vertical-align: middle;
}
i {
margin-right: 5px;
}
&:hover{
text-decoration: none;
}
&.active {
background: #fff;
position: relative;
height: 43px;
}
}
}
.v-crontab-content {
padding: 8px 20px;
padding-bottom: 12px;
}
}
}
</style>

30
escheduler-ui/src/js/module/components/crontab/source/index.scss

@ -0,0 +1,30 @@
.v-crontab-from-model {
.list-box {
//padding: 6px 0;
.ans-radio-wrapper {
height: auto !important;
}
.ans-radio-group-item {
.text {
color: #888;
}
}
.ans-radio-wrapper-checked {
.text {
color: #0097e0;
}
}
.ans-select {
.tag-container {
.tag-wrapper {
line-height: 10px;
margin-left: 6px;
.tag-text {
margin-right: 0;
}
}
}
}
}
}

199
escheduler-ui/src/js/module/components/crontab/source/util/index.js

@ -0,0 +1,199 @@
import _ from 'lodash'
/**
* 生成指定区间数字
* @param start 起始数值
* @param end 结束数值
*/
const range = (start, end) => {
let length = end - start + 1
let step = start - 1
return Array.apply(null, { length: length }).map(function (v, i) { step++; return step })
}
let selectList = {
'60': _.map(range(0, 59), v => {
return {
value: v + '',
label: v + ''
}
}),
'24': _.map(range(0, 23), v => {
return {
value: v + '',
label: v + ''
}
}),
'12': _.map(range(0, 12), v => {
return {
value: v + '',
label: v + ''
}
}),
'year': _.map(range(2018, 2030), v => {
return {
value: v + '',
label: v + ''
}
}),
'week': [
{
value: 1,
label: '星期天'
},
{
value: 2,
label: '星期一'
},
{
value: 3,
label: '星期二'
},
{
value: 4,
label: '星期三'
},
{
value: 5,
label: '星期四'
},
{
value: 6,
label: '星期五'
},
{
value: 7,
label: '星期六'
}
],
'specificWeek': [
{
value: 'SUN',
label: 'SUN'
},
{
value: 'MON',
label: 'MON'
},
{
value: 'TUE',
label: 'TUE'
},
{
value: 'WED',
label: 'WED'
},
{
value: 'THU',
label: 'THU'
},
{
value: 'FRI',
label: 'FRI'
},
{
value: 'SAT',
label: 'SAT'
}
],
'day': _.map(range(1, 31), v => {
return {
value: v + '',
label: v + ''
}
}),
'lastWeeks': [
{
value: '1L',
label: '星期天'
},
{
value: '2L',
label: '星期一'
},
{
value: '3L',
label: '星期二'
},
{
value: '4L',
label: '星期三'
},
{
value: '5L',
label: '星期四'
},
{
value: '6L',
label: '星期五'
},
{
value: '7L',
label: '星期六'
}
]
}
const isStr = (str, v) => {
let flag
if (str.indexOf(v) !== -1) {
flag = str.split(v)
}
return flag
}
const isWeek = (str) => {
let flag = false
let data = str.split(',')
let isSpecificWeek = (key) => {
return _.findIndex(selectList.specificWeek, v => v.value === key) !== -1
}
_.map(data, v => {
if (isSpecificWeek(v)) {
flag = true
}
})
return flag
}
/**
* template
*
* @param {String} string
* @param {Array} ...args
* @return {String}
*/
const { hasOwnProperty } = {}
const RE_NARGS = /(%|)\{([0-9a-zA-Z_]+)\}/g
const hasOwn = (o, k) => hasOwnProperty.call(o, k)
const template = (string, ...args) => {
if (args.length === 1 && typeof args[0] === 'object') {
args = args[0]
}
if (!args || !args.hasOwnProperty) {
args = {}
}
return string.replace(RE_NARGS, (match, prefix, i, index) => {
let result
if (string[index - 1] === '{' &&
string[index + match.length] === '}') {
return i
} else {
result = hasOwn(args, i) ? args[i] : null
if (result === null || result === undefined) {
return ''
}
return result
}
})
}
export {
selectList,
isStr,
isWeek,
template
}

BIN
escheduler-ui/src/js/module/components/nav/logo.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.8 KiB

85
escheduler-ui/src/js/module/components/nav/logo.svg

@ -0,0 +1,85 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 21.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="图层_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 180 46" style="enable-background:new 0 0 180 46;" xml:space="preserve">
<style type="text/css">
.st0{fill:#85CDF0;}
.st1{fill:#0097E0;}
.st2{fill:#FFFFFF;}
</style>
<g>
<path class="st0" d="M29.9,25.6H14.5c-2.1,0-3.8,1.8-3.8,3.9c0,0.8,0.2,1.6,0.7,2.2c0.3-0.1,0.6-0.2,0.9-0.3l0,0l0,0
c1-0.4,2.1-1.2,2.8-1.8c0.2-0.1,0.3-0.2,0.4-0.3c0.1-0.1,0.2-0.2,0.4-0.3c0.6-0.5,1.4-1.1,2.6-1.3c0.2,0,0.4,0,0.7,0
c1,0,1.9,0.3,2.5,0.9c0.2-0.1,0.4-0.2,0.5-0.3c0.3-0.1,0.5-0.3,0.7-0.4s0.5-0.2,0.8-0.2c0.6,0,1.2,0.3,1.5,0.9
c0.2,0.4,0.4,1.1-0.2,2.2c-0.1,0.2-0.3,0.4-0.4,0.7c-0.3,0.6-0.7,1.2-1.3,2h6.6c2.1,0,3.8-1.8,3.8-3.9C33.7,27.4,32,25.6,29.9,25.6
z"/>
<path class="st1" d="M5.7,20.3h1c0.6,0,1-0.4,1-1s-0.4-1-1-1h-1c-2.1,0-3.7-1.7-3.7-3.9c0-2.1,1.6-3.8,3.6-3.9v2.1l2.8-2.9l-2.8-3
v1.7c-3,0.2-5.6,2.8-5.6,6C0,17.7,2.5,20.3,5.7,20.3z"/>
<path class="st1" d="M38.4,18.6h-1c-0.6,0-1,0.4-1,1s0.4,1,1,1h1c2.1,0,3.7,1.7,3.7,3.9c0,2.1-1.6,3.8-3.6,3.9v-2.1L35.7,29l2.8,3
v-1.7c3-0.1,5.5-2.6,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.7,17.6h1.5V30h-1.5V17.6z"/>
<path class="st2" d="M171.8,21.2c0.6,0.3,1,0.7,1.3,1.2s0.5,1,0.6,1.6c0.1,0.4,0.1,1.1,0.1,2h-6.4c0,0.9,0.2,1.7,0.6,2.2
c0.4,0.6,1,0.8,1.8,0.8s1.4-0.3,1.8-0.8c0.3-0.3,0.4-0.7,0.5-1.1h1.5c0,0.3-0.2,0.7-0.4,1.1s-0.5,0.7-0.7,1
c-0.4,0.5-1,0.8-1.7,0.9c-0.4,0.1-0.8,0.1-1.2,0.1c-1.1,0-2-0.4-2.8-1.2c-0.8-0.8-1.1-2-1.1-3.4c0-1.5,0.4-2.6,1.1-3.5
c0.8-0.9,1.8-1.4,3-1.4C170.6,20.8,171.2,20.9,171.8,21.2z M172.3,24.8c-0.1-0.7-0.2-1.2-0.4-1.6c-0.4-0.7-1.1-1.1-2-1.1
c-0.7,0-1.2,0.3-1.7,0.8s-0.7,1.1-0.7,1.9C167.5,24.8,172.3,24.8,172.3,24.8z"/>
<path class="st2" d="M175.7,21h1.4v1.6c0.1-0.3,0.4-0.7,0.8-1.1c0.4-0.4,1-0.7,1.5-0.7h0.1c0.1,0,0.2,0,0.3,0v1.6
c-0.1,0-0.2,0-0.2,0c-0.1,0-0.2,0-0.2,0c-0.7,0-1.3,0.2-1.7,0.7s-0.6,1.1-0.6,1.7V30h-1.5L175.7,21L175.7,21z"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 7.6 KiB

2
escheduler-ui/src/js/module/components/nav/nav.vue

@ -304,7 +304,7 @@
width: 180px;
height: 46px;
display: block;
background: url("./logo.png") no-repeat;
background: url("./logo.svg") no-repeat;
}
}
.nav-box {

30
escheduler-ui/src/lib/@vue/crontab/README.md

@ -1,30 +0,0 @@
An component project
### Setup
- 安装node > 8的LTS版本,https://nodejs.org/en/
- 增加npm本地仓库host,106.75.23.50 npm.analysys.cn
- 没安装yarn的,可以忽略以下yarn命令
```sh
# set registry
npm config set registry http://registry.npm.analysys.cn
# install parcel
yarn global add parcel-bundler | npm i -g parcel-bundler
# install dependencies
yarn | npm i
# startup development server (defaults to 3000)
# -> http://localhost:3000
yarn start | npm start
```
### Lint
```sh
yarn test | npm run test
yarn lint:fix | npm run lint:fix
```

65
escheduler-ui/src/lib/@vue/crontab/build/config.js

@ -1,65 +0,0 @@
/**
* webpack config
*
* author: liuxin(liuxin@analysys.com.cn)
*/
const path = require('path')
const glob = require('globby')
const isProduction = process.env.NODE_ENV !== 'development'
const resolve = dir => path.join(__dirname, '..', dir)
const assetsDir = resolve('src')
const distDir = resolve('dist')
const baseConfig = {
entry: {
'index': glob.sync(['index.js'], { cwd: assetsDir })
},
output: {
path: distDir
},
module: {
rules: [
{
test: /\.js$/,
exclude: file => (
/node_modules/.test(file) &&
!/\.vue\.js/.test(file)
),
use: [
{
loader: 'babel-loader',
options: {
cacheDirectory: true,
cacheIdentifier: true
}
}
]
}
]
},
resolve: {
modules: [
resolve('node_modules'),
resolve('src')
],
extensions: ['.js', '.json', '.vue', '.scss']
},
externals: {
'vue': 'Vue',
'lodash': {
commonjs: 'lodash',
commonjs2: 'lodash',
amd: 'lodash',
root: '_'
}
}
}
module.exports = {
isProduction,
assetsDir,
distDir,
baseConfig
}

106
escheduler-ui/src/lib/@vue/crontab/build/webpack.config.prod.js

@ -1,106 +0,0 @@
/**
* webpack config for production
*
* author: liuxin(liuxin@analysys.com.cn)
*/
const webpack = require('webpack')
const merge = require('webpack-merge')
const { baseConfig } = require('./config')
const ExtractTextPlugin = require('extract-text-webpack-plugin')
const UglifyJSPlugin = require('uglifyjs-webpack-plugin')
const OptimizeCssAssetsPlugin = require('optimize-css-assets-webpack-plugin')
const ProgressPlugin = require('@fedor/progress-webpack-plugin')
const VueLoaderPlugin = require('vue-loader/lib/plugin')
const config = merge.smart(baseConfig, {
devtool: 'source-map',
output: {
filename: '[name].js',
libraryTarget: 'umd',
umdNamedDefine: false
},
module: {
rules: [
{
test: /\.vue$/,
loader: 'vue-loader',
options: {
hotReload: false
}
},
{
test: /\.css$/,
loader: ExtractTextPlugin.extract({
use: [
'css-loader',
{
loader: 'postcss-loader',
options: {
plugins: (loader) => [
require('autoprefixer')({
'browsers': ['ie > 8', 'last 2 version', 'safari >= 9']
}),
require('cssnano')
]
}
}
],
fallback: ['vue-style-loader']
})
},
{
test: /\.scss$/,
loader: ExtractTextPlugin.extract({
use: [
'css-loader',
{
loader: 'postcss-loader',
options: {
plugins: (loader) => [
require('autoprefixer')({
'browsers': ['ie > 8', 'last 2 version', 'safari >= 9']
}),
require('cssnano')
]
}
},
'sass-loader'
],
fallback: ['vue-style-loader']
})
}
]
},
plugins: [
new ProgressPlugin(),
new VueLoaderPlugin(),
new ExtractTextPlugin({ filename: '[name].css', allChunks: true }),
new webpack.optimize.OccurrenceOrderPlugin(),
new OptimizeCssAssetsPlugin({
assetNameRegExp: /\.css$/g,
cssProcessor: require('cssnano'),
cssProcessorOptions: { discardComments: { removeAll: true } },
canPrint: true
}),
new UglifyJSPlugin({
parallel: true,
sourceMap: true,
uglifyOptions: {
compress: {
drop_console: true,
drop_debugger: true
},
comments: function (n, c) {
/*! IMPORTANT: Please preserve 3rd-party library license info, inspired from @allex/amd-build-worker/config/util.js */
var text = c.value, type = c.type
if (type === 'comment2') {
return /^!|@preserve|@license|@cc_on|MIT/i.test(text)
}
}
}
})
]
})
module.exports = config

1
escheduler-ui/src/lib/@vue/crontab/dist/index.css vendored

@ -1 +0,0 @@
.input-number-model{display:inline-block}.input-number-model button{background:#f5f7fa;padding:8px 10px;position:relative}.input-number-model button .bt-text{font-size:18px;color:#888}.input-number-model .ans-input{width:60px;margin:0 -2px 0 -1px}.input-number-model .ans-input input{text-align:center}.input-number-model button,.input-number-model input{vertical-align:middle}.v-crontab{width:640px;border:1px solid #e4e7ed;background:#fff;border-radius:4px}.v-crontab .v-crontab-model .v-crontab-tab{background:#f5f7fa;height:42px;border-bottom:1px solid #e4e7ed}.v-crontab .v-crontab-model .v-crontab-tab a{width:86px;height:42px;line-height:42px;text-align:center;float:left;border-right:1px solid #e4e7ed;text-decoration:none}.v-crontab .v-crontab-model .v-crontab-tab a i,.v-crontab .v-crontab-model .v-crontab-tab a span{font-size:14px;color:#888;vertical-align:middle}.v-crontab .v-crontab-model .v-crontab-tab a i{margin-right:5px}.v-crontab .v-crontab-model .v-crontab-tab a:hover{text-decoration:none}.v-crontab .v-crontab-model .v-crontab-tab a.active{background:#fff;position:relative;height:43px}.v-crontab .v-crontab-model .v-crontab-content{padding:8px 20px 12px}.v-crontab-from-model .list-box .ans-radio-wrapper{height:auto!important}.v-crontab-from-model .list-box .ans-radio-group-item .text{color:#888}.v-crontab-from-model .list-box .ans-radio-wrapper-checked .text{color:#0097e0}.v-crontab-from-model .list-box .ans-select .tag-container .tag-wrapper{line-height:10px;margin-left:6px}.v-crontab-from-model .list-box .ans-select .tag-container .tag-wrapper .tag-text{margin-right:0}

2
escheduler-ui/src/lib/@vue/crontab/dist/index.js vendored

File diff suppressed because one or more lines are too long

1
escheduler-ui/src/lib/@vue/crontab/dist/index.js.map vendored

File diff suppressed because one or more lines are too long

47
escheduler-ui/src/lib/@vue/crontab/example/app.vue

@ -1,47 +0,0 @@
<template>
<div>
<div style="padding: 20px;">
<x-button @click="_lang('zh_CN')">中文</x-button>
<x-button @click="_lang('en_US')">英文</x-button>
</div>
<div style="padding: 40px">
{{value}}
</div>
<div v-if="is">
<v-crontab v-model="value" :locale="lang"></v-crontab>
</div>
</div>
</template>
<script>
import { vCrontab } from '../src'
export default {
name: 'app',
data: function () {
return {
value: '* * * * * ? *',
lang: 'zh_CN',
is: false
}
},
watch: {
},
mounted () {
setTimeout(() => {
// this.value = '4/6 4/6 4/6 4/6 4/6 ? 2019/2'
}, 2000)
this.is = true
},
methods: {
_lang (type) {
this.is = false
this.lang = type
setTimeout(() => {
this.is = true
}, 1)
}
},
components: { vCrontab }
}
</script>
<style lang="scss"></style>

14
escheduler-ui/src/lib/@vue/crontab/example/index.html

@ -1,14 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name=viewport content="width=device-width,user-scalable=no,initial-scale=1,maximum-scale=1,minimum-scale=1">
<script src="https://s1.analysys.cn/libs/??js-polyfills/0.1.42/polyfill.min.js"></script>
<title>demo</title>
</head>
<body>
<div id="app"></div>
<script src="https://s1.analysys.cn/libs/??lodash.js/4.17.11/lodash.min.js"></script>
<script src="./index.js"></script>
</body>
</html>

14
escheduler-ui/src/lib/@vue/crontab/example/index.js

@ -1,14 +0,0 @@
import Vue from 'vue'
import App from './app.vue'
import '@analysys/ans-ui/lib/ans-ui.min.css'
import ans from '@analysys/ans-ui/lib/ans-ui.min.js'
Vue.use(ans)
new Vue({
el: '#app',
render: h => h(App),
mounted () {
console.log('success')
}
})

63
escheduler-ui/src/lib/@vue/crontab/package.json

@ -1,63 +0,0 @@
{
"name": "@vue/crontab",
"version": "1.0.0-beta.10",
"description": "crontab",
"author": "quanquan <gongzijian@analysys.com.cn>",
"main": "dist/index.js",
"license": "MIT",
"scripts": {
"dev": "npm run clean && parcel ./example/index.html -p 3000",
"build": "npm run clean && cross-env NODE_ENV=production webpack --config ./build/webpack.config.prod.js",
"lint": "standard \"**/*.{js,vue}\"",
"lint:fix": "standard \"**/*.{js,vue}\" --fix",
"clean": "rimraf dist",
"start": "npm run dev",
"test": "npm run lint",
"prepublishOnly": "npm run build"
},
"dependencies": {
},
"devDependencies": {
"@fedor/progress-webpack-plugin": "^1.0.0",
"@fedor/standard": "^1.0.3",
"autoprefixer": "^9.1.3",
"babel-core": "^6.26.3",
"babel-eslint": "^8.2.6",
"babel-loader": "^7.1.1",
"babel-preset-env": "^1.7.0",
"cross-env": "^5.2.0",
"css-loader": "^0.28.8",
"cssnano": "^4.1.0",
"extract-text-webpack-plugin": "^3.0.2",
"ghooks": "^2.0.4",
"globby": "^8.0.1",
"node-sass": "^4.9.3",
"optimize-css-assets-webpack-plugin": "3.2.0",
"postcss-loader": "^3.0.0",
"rimraf": "^2.6.2",
"sass-loader": "^7.1.0",
"uglifyjs-webpack-plugin": "^1.2.7",
"vue": "^2.5.17",
"vue-hot-reload-api": "^2.3.0",
"vue-loader": "^15.4.1",
"vue-style-loader": "^4.1.1",
"vue-template-compiler": "^2.5.17",
"webpack": "^3.12.0",
"webpack-merge": "^4.1.4"
},
"standard": {
"parser": "babel-eslint",
"ignore": [
"src/font/*",
"dist/**",
"test/coverage/**",
"karma.conf.js",
"postcss.config.js"
]
},
"config": {
"ghooks": {
"pre-commit": "npm run lint"
}
}
}

7
escheduler-ui/src/lib/@vue/crontab/postcss.config.js

@ -1,7 +0,0 @@
module.exports = {
plugins: [
require('autoprefixer')({
browsers: ["ie > 8", "last 2 version", "safari >= 9"]
})
]
}
Loading…
Cancel
Save