提交 ee7a05af 编写于 作者: B break60 提交者: qiaozhanwei

1.update logo 2.Workflow Definition Page Timing Component Replaced with...

 1.update logo 2.Workflow Definition Page Timing Component Replaced with Source Code3.Repair bug #901,#909,#935 (#998)

* 1.repair [BUG]#884;2.Add Scheduling Time Fields to Workflow Instance List;3.Add a reminder for empty data 4.Delete the'babel-plugin-transform-remove-console'dependency package

* 1.update logo 2.Workflow Definition Page Timing Component Replaced with Source Code

* Repair bug #901,#909,#935
上级 8f865826
......@@ -355,7 +355,11 @@
this.sqlType = o.params.sqlType
this.connParams = o.params.connParams || ''
this.localParams = o.params.localParams || []
this.showType = o.params.showType.split(',') || []
if(o.params.showType == '') {
this.showType = []
} else {
this.showType = o.params.showType.split(',') || []
}
this.preStatements = o.params.preStatements || []
this.postStatements = o.params.postStatements || []
this.title = o.params.title || ''
......
......@@ -97,7 +97,7 @@
</template>
</m-list-box-f>
<m-list-box-f>
<template slot="name"><b>*</b>{{$t('Database Name')}}</template>
<template slot="name"><b :class="{hidden:showdDatabase}">*</b>{{$t('Database Name')}}</template>
<template slot="content">
<x-input
type="input"
......@@ -165,6 +165,7 @@
// btn test loading
testLoading: false,
showPrincipal: true,
showdDatabase: false,
isShowPrincipal:true
}
},
......@@ -264,7 +265,7 @@
return false
}
if (!this.database) {
if (!this.database && this.showdDatabase == false) {
this.$message.warning(`${i18n.$t('Please enter database name')}`)
return false
}
......@@ -323,6 +324,11 @@
}else{
this.showPrincipal = true
}
if(value == 'POSTGRESQL') {
this.showdDatabase = true;
} else {
this.showdDatabase = false;
}
}
},
created () {
......
......@@ -34,7 +34,7 @@
</td>
<td>
<span class="ellipsis">
<a href="javascript:" class="links">{{item.name}}</a>
{{item.name}}
</span>
</td>
<td>
......
......@@ -49,7 +49,7 @@
</td>
<td>
<span>
<a href="javascript:" class="links">{{item.hostname}}</a>
{{item.hostname}}
</span>
</td>
<td><span>{{item.connections}}</span></td>
......
......@@ -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'
......
......@@ -45,7 +45,7 @@
<span>{{parseInt(pageNo === 1 ? ($index + 1) : (($index + 1) + (pageSize * (pageNo - 1))))}}</span>
</td>
<td>
<span class="ellipsis"><a href="javascript:" class="links">{{item.name}}</a></span>
<span class="ellipsis">{{item.name}}</span>
</td>
<td><a href="javascript:" class="links" @click="_go(item)"><span class="ellipsis">{{item.processInstanceName}}</span></a></td>
<td><span>{{item.taskType}}</span></td>
......
......@@ -28,16 +28,12 @@
</td>
<td>
<span>
<a href="javascript:" class="links">
{{item.queueName}}
</a>
{{item.queueName}}
</span>
</td>
<td>
<span>
<a href="javascript:" class="links">
{{item.queue}}
</a>
{{item.queue}}
</span>
</td>
<td>
......
......@@ -34,16 +34,12 @@
</td>
<td>
<span>
<a href="javascript:" class="links">
{{item.tenantCode}}
</a>
{{item.tenantCode}}
</span>
</td>
<td>
<span>
<a href="javascript:" class="links">
{{item.tenantName}}
</a>
{{item.tenantName}}
</span>
</td>
<td>
......
......@@ -41,7 +41,7 @@
</td>
<td>
<span>
<a href="javascript:" class="links">{{item.userName || '-'}}</a>
{{item.userName || '-'}}
</span>
</td>
<td>
......
......@@ -31,7 +31,7 @@
</td>
<td>
<span>
<a href="javascript:" class="links">{{item.groupName}}</a>
{{item.groupName}}
</span>
</td>
<td><span>{{item.groupType === 'EMAIL' ? `${$t('Email')}` : `${$t('SMS')}`}}</span></td>
......
......@@ -28,7 +28,7 @@
</td>
<td>
<span>
<a href="javascript:" class="links">{{item.name}}</a>
{{item.name}}
</span>
</td>
<td>
......
......@@ -31,7 +31,7 @@
</td>
<td>
<span>
<a href="javascript:" class="links">{{item.userName}}</a>
{{item.userName}}
</span>
</td>
<td><span>{{item.token}}</span></td>
......
......@@ -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;
}
}
......
<!-- 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. -->
<!-- <?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.1,0,3.8-1.8,3.8-3.9S32,15.3,29.9,15.3z"/>
<path class="st0" d="M29.9,5.1H14.5c-2.1,0-3.8,1.8-3.8,3.9v0c0,2.2,1.7,3.9,3.8,3.9h15.4c2.1,0,3.8-1.8,3.8-3.9v0
C33.7,6.8,32,5.1,29.9,5.1z"/>
<path class="st1" d="M19.5,39c0.2,1.3-0.4,1-0.9,0.6c-0.3-0.2-1.2-0.7-1.7-1c0.8-0.4,1.5-0.9,2-1.3C19.2,37.8,19.4,38.4,19.5,39z
M18.4,31c-0.1,0-0.2,0.1-0.2,0.2s0.1,0.2,0.2,0.2s0.2-0.1,0.2-0.2S18.5,31,18.4,31z M24.2,30.3c-0.8,1.3-1.8,3.3-4.6,5.9
c-0.6,0.6-1.9,1.5-3.2,2.1c-0.4,0.2-1,0.4-1.6,0.6c0.4-0.6,0.6-1.2,0.7-1.8l-0.3,0c-0.7,2.3-2.4,4.3-4.5,5c-1.3,0.4-1-0.3-0.8-0.9
c0.2-0.4,0.7-2.4,0.9-3.4l-0.4-0.1c0,0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.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>
/*
* 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.
*/
import vCrontab from './source/app.vue'
// import './source/index.scss'
export {
vCrontab
}
/*
* 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.
*/
/* 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])
}
/*
* 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.
*/
import { findLocale } from './config'
import { template } from './util'
export default {
methods: {
$t (str, data) {
return template(findLocale(window.localeCrontab).locale[str], data)
}
}
}
/*
* 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.
*/
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'
}
/*
* 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.
*/
export default {
'': '',
'': '',
'': '',
'': '',
'': '',
'': '',
'星期一': '星期一',
'星期二': '星期二',
'星期三': '星期三',
'星期四': '星期四',
'星期五': '星期五',
'星期六': '星期六',
'星期天': '星期天',
'每一秒钟': '每一秒钟',
'每隔': '每隔',
'秒执行 从': '秒执行 从',
'秒开始': '秒开始',
'具体秒数(可多选)': '具体秒数(可多选)',
'请选择具体秒数': '请选择具体秒数',
'周期从': '周期从',
'': '',
'每一分钟': '每一分钟',
'分执行 从': '分执行 从',
'分开始': '分开始',
'具体分钟数(可多选)': '具体分钟数(可多选)',
'请选择具体分钟数': '请选择具体分钟数',
'每一小时': '每一小时',
'小时执行 从': '小时执行 从',
'小时开始': '小时开始',
'具体小时数(可多选)': '具体小时数(可多选)',
'请选择具体小时数': '请选择具体小时数',
'每一天': '每一天',
'周执行 从': '周执行 从',
'开始': '开始',
'天执行 从': '天执行 从',
'天开始': '天开始',
'具体星期几(可多选)': '具体星期几(可多选)',
'请选择具体周几': '请选择具体周几',
'具体天数(可多选)': '具体天数(可多选)',
'请选择具体天数': '请选择具体天数',
'在这个月的最后一天': '在这个月的最后一天',
'在这个月的最后一个工作日': '在这个月的最后一个工作日',
'在这个月的最后一个': '在这个月的最后一个',
'在本月底前': '在本月底前',
'最近的工作日(周一至周五)至本月': '最近的工作日(周一至周五)至本月',
'在这个月的第': '在这个月的第',
'每一月': '每一月',
'月执行 从': '月执行 从',
'月开始': '月开始',
'具体月数(可多选)': '具体月数(可多选)',
'请选择具体月数': '请选择具体月数',
'每一年': '每一年',
'年执行 从': '年执行 从',
'年开始': '年开始',
'具体年数(可多选)': '具体年数(可多选)',
'请选择具体年数': '请选择具体年数',
'小时': '小时',
'': ''
}
/*
* 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.
*/
/**
* 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 }
/*
* 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.
*/
<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>
/*
* 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.
*/
<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>
/*
* 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.
*/
<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>
/*
* 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.
*/
<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>
/*
* 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.
*/
<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>
/*
* 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.
*/
<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>
/*
* 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.
*/
<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>
/*
* 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.
*/
<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>
/*
* 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.
*/
.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;
}
}
}
}
}
}
\ No newline at end of file
/*
* 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.
*/
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
}
<!-- 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. -->
<!--<?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,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.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.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.4C138.9,20.8,139.5,20.9,140,21.2z M140.6,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.9C135.8,24.8,140.6,24.8,140.6,24.8z"/>
<path class="st2" d="M148.8,21.3c0.3,0.2,0.6,0.5,0.9,0.9v-4.6h1.4V30h-1.3v-1.3c-0.3,0.6-0.7,1-1.2,1.2s-1,0.4-1.6,0.4
c-1,0-1.8-0.4-2.5-1.3c-0.7-0.8-1.1-2-1.1-3.4c0-1.3,0.3-2.5,1-3.4c0.7-1,1.6-1.4,2.8-1.4C147.8,20.8,148.3,21,148.8,21.3z
M145.5,28.1c0.4,0.7,1,1,1.9,1c0.7,0,1.2-0.3,1.7-0.9c0.4-0.6,0.7-1.5,0.7-2.6s-0.2-2-0.7-2.5s-1-0.8-1.7-0.8s-1.3,0.3-1.8,0.9
s-0.7,1.4-0.7,2.6C144.9,26.6,145.1,27.4,145.5,28.1z"/>
<path class="st2" d="M154.8,21v6c0,0.5,0.1,0.8,0.2,1.1c0.3,0.5,0.7,0.8,1.4,0.8c1,0,1.7-0.5,2-1.4c0.2-0.5,0.3-1.2,0.3-2.1V21
h1.5v9h-1.4v-1.3c-0.2,0.3-0.4,0.6-0.7,0.9c-0.6,0.5-1.2,0.7-2,0.7c-1.2,0-2.1-0.4-2.5-1.3c-0.2-0.5-0.4-1.1-0.4-1.8V21H154.8z"/>
<path class="st2" d="M162.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>
......@@ -304,7 +304,7 @@
width: 180px;
height: 46px;
display: block;
background: url("./logo.png") no-repeat;
background: url("./logo.svg") no-repeat;
}
}
.nav-box {
......
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
```
/**
* 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
}
/**
* 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
.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}
\ No newline at end of file
<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>
\ No newline at end of file
<!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>
\ No newline at end of file
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')
}
})
{
"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"
}
}
}
module.exports = {
plugins: [
require('autoprefixer')({
browsers: ["ie > 8", "last 2 version", "safari >= 9"]
})
]
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册