Commit 8f23aa5a by yangzhi

fix:定时任务;币种

parent a7d315a6
...@@ -2012,49 +2012,6 @@ ...@@ -2012,49 +2012,6 @@
"webpack-merge": "^5.7.3", "webpack-merge": "^5.7.3",
"webpack-virtual-modules": "^0.4.2", "webpack-virtual-modules": "^0.4.2",
"whatwg-fetch": "^3.6.2" "whatwg-fetch": "^3.6.2"
},
"dependencies": {
"@vue/vue-loader-v15": {
"version": "npm:vue-loader@15.10.1",
"resolved": "https://registry.npmmirror.com/vue-loader/-/vue-loader-15.10.1.tgz",
"integrity": "sha512-SaPHK1A01VrNthlix6h1hq4uJu7S/z0kdLUb6klubo738NeQoLbS6V9/d8Pv19tU0XdQKju3D1HSKuI8wJ5wMA==",
"dev": true,
"requires": {
"@vue/component-compiler-utils": "^3.1.0",
"hash-sum": "^1.0.2",
"loader-utils": "^1.1.0",
"vue-hot-reload-api": "^2.3.0",
"vue-style-loader": "^4.1.0"
},
"dependencies": {
"hash-sum": {
"version": "1.0.2",
"resolved": "https://registry.npmmirror.com/hash-sum/-/hash-sum-1.0.2.tgz",
"integrity": "sha512-fUs4B4L+mlt8/XAtSOGMUO1TXmAelItBPtJG7CyHJfYTdDjwisntGO2JQz7oUsatOY9o68+57eziUVNw/mRHmA==",
"dev": true
}
}
},
"json5": {
"version": "1.0.2",
"resolved": "https://registry.npmmirror.com/json5/-/json5-1.0.2.tgz",
"integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==",
"dev": true,
"requires": {
"minimist": "^1.2.0"
}
},
"loader-utils": {
"version": "1.4.2",
"resolved": "https://registry.npmmirror.com/loader-utils/-/loader-utils-1.4.2.tgz",
"integrity": "sha512-I5d00Pd/jwMD2QCduo657+YM/6L3KZu++pmX9VFncxaxvHcru9jx1lBaFft+r4Mt2jK0Yhp41XlRAihzPxHNCg==",
"dev": true,
"requires": {
"big.js": "^5.2.2",
"emojis-list": "^3.0.0",
"json5": "^1.0.1"
}
}
} }
}, },
"@vue/cli-shared-utils": { "@vue/cli-shared-utils": {
...@@ -2215,6 +2172,47 @@ ...@@ -2215,6 +2172,47 @@
"eslint-import-resolver-webpack": "^0.13.1" "eslint-import-resolver-webpack": "^0.13.1"
} }
}, },
"@vue/vue-loader-v15": {
"version": "npm:vue-loader@15.10.1",
"resolved": "https://registry.npmmirror.com/vue-loader/-/vue-loader-15.10.1.tgz",
"integrity": "sha512-SaPHK1A01VrNthlix6h1hq4uJu7S/z0kdLUb6klubo738NeQoLbS6V9/d8Pv19tU0XdQKju3D1HSKuI8wJ5wMA==",
"dev": true,
"requires": {
"@vue/component-compiler-utils": "^3.1.0",
"hash-sum": "^1.0.2",
"loader-utils": "^1.1.0",
"vue-hot-reload-api": "^2.3.0",
"vue-style-loader": "^4.1.0"
},
"dependencies": {
"hash-sum": {
"version": "1.0.2",
"resolved": "https://registry.npmmirror.com/hash-sum/-/hash-sum-1.0.2.tgz",
"integrity": "sha512-fUs4B4L+mlt8/XAtSOGMUO1TXmAelItBPtJG7CyHJfYTdDjwisntGO2JQz7oUsatOY9o68+57eziUVNw/mRHmA==",
"dev": true
},
"json5": {
"version": "1.0.2",
"resolved": "https://registry.npmmirror.com/json5/-/json5-1.0.2.tgz",
"integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==",
"dev": true,
"requires": {
"minimist": "^1.2.0"
}
},
"loader-utils": {
"version": "1.4.2",
"resolved": "https://registry.npmmirror.com/loader-utils/-/loader-utils-1.4.2.tgz",
"integrity": "sha512-I5d00Pd/jwMD2QCduo657+YM/6L3KZu++pmX9VFncxaxvHcru9jx1lBaFft+r4Mt2jK0Yhp41XlRAihzPxHNCg==",
"dev": true,
"requires": {
"big.js": "^5.2.2",
"emojis-list": "^3.0.0",
"json5": "^1.0.1"
}
}
}
},
"@vue/web-component-wrapper": { "@vue/web-component-wrapper": {
"version": "1.3.0", "version": "1.3.0",
"resolved": "https://registry.npmmirror.com/@vue/web-component-wrapper/-/web-component-wrapper-1.3.0.tgz", "resolved": "https://registry.npmmirror.com/@vue/web-component-wrapper/-/web-component-wrapper-1.3.0.tgz",
...@@ -3924,9 +3922,9 @@ ...@@ -3924,9 +3922,9 @@
"dev": true "dev": true
}, },
"element-ui": { "element-ui": {
"version": "2.15.10", "version": "2.15.13",
"resolved": "https://registry.npmjs.org/element-ui/-/element-ui-2.15.10.tgz", "resolved": "https://registry.npmmirror.com/element-ui/-/element-ui-2.15.13.tgz",
"integrity": "sha512-jmD++mU2wKXbisvx4fxOl2mHaU+HWHTAq/3Wf8x9Bwyu4GdDZPLABb+CGi3DWN6fPqdgRcd74aX39DO+YHObLw==", "integrity": "sha512-LJoatEYX6WV74FqXBss8Xfho9fh9rjDSzrDrTyREdGb1h1R3uRvmLh5jqp2JU137aj4/BgqA3K06RQpQBX33Bg==",
"requires": { "requires": {
"async-validator": "~1.8.1", "async-validator": "~1.8.1",
"babel-helper-vue-jsx-merge-props": "^2.0.0", "babel-helper-vue-jsx-merge-props": "^2.0.0",
...@@ -8164,6 +8162,11 @@ ...@@ -8164,6 +8162,11 @@
"websocket-driver": "^0.7.4" "websocket-driver": "^0.7.4"
} }
}, },
"sortablejs": {
"version": "1.10.2",
"resolved": "https://registry.npmmirror.com/sortablejs/-/sortablejs-1.10.2.tgz",
"integrity": "sha512-YkPGufevysvfwn5rfdlGyrGjt7/CRHwvRPogD/lC+TnvcN29jDpCifKP+rBqf+LRldfXSTh+0CGLcSg0VIxq3A=="
},
"source-map": { "source-map": {
"version": "0.6.1", "version": "0.6.1",
"resolved": "https://registry.npmmirror.com/source-map/-/source-map-0.6.1.tgz", "resolved": "https://registry.npmmirror.com/source-map/-/source-map-0.6.1.tgz",
...@@ -8963,6 +8966,14 @@ ...@@ -8963,6 +8966,14 @@
"integrity": "sha512-4gDntzrifFnCEvyoO8PqyJDmguXgVPxKiIxrBKjIowvL9l+N66196+72XVYR8BBf1Uv1Fgt3bGevJ+sEmxfZzw==", "integrity": "sha512-4gDntzrifFnCEvyoO8PqyJDmguXgVPxKiIxrBKjIowvL9l+N66196+72XVYR8BBf1Uv1Fgt3bGevJ+sEmxfZzw==",
"dev": true "dev": true
}, },
"vuedraggable": {
"version": "2.24.3",
"resolved": "https://registry.npmmirror.com/vuedraggable/-/vuedraggable-2.24.3.tgz",
"integrity": "sha512-6/HDXi92GzB+Hcs9fC6PAAozK1RLt1ewPTLjK0anTYguXLAeySDmcnqE8IC0xa7shvSzRjQXq3/+dsZ7ETGF3g==",
"requires": {
"sortablejs": "1.10.2"
}
},
"vuex": { "vuex": {
"version": "3.6.2", "version": "3.6.2",
"resolved": "https://registry.npmmirror.com/vuex/-/vuex-3.6.2.tgz", "resolved": "https://registry.npmmirror.com/vuex/-/vuex-3.6.2.tgz",
......
...@@ -12,14 +12,14 @@ ...@@ -12,14 +12,14 @@
"@wangeditor/editor-for-vue": "^1.0.2", "@wangeditor/editor-for-vue": "^1.0.2",
"axios": "^1.1.3", "axios": "^1.1.3",
"core-js": "^3.8.3", "core-js": "^3.8.3",
"element-ui": "^2.15.10", "element-ui": "^2.15.13",
"js-md5": "^0.7.3", "js-md5": "^0.7.3",
"lodash": "~4.17.20",
"vue": "^2.6.14", "vue": "^2.6.14",
"vue-router": "^3.5.1", "vue-router": "^3.5.1",
"vuex": "^3.6.2", "vuex": "^3.6.2",
"vxe-table": "^3.5.9", "vxe-table": "^3.5.9",
"xe-utils": "^3.5.7", "xe-utils": "^3.5.7"
"lodash": "~4.17.20"
}, },
"devDependencies": { "devDependencies": {
"@babel/core": "^7.12.16", "@babel/core": "^7.12.16",
......
...@@ -106,4 +106,34 @@ axios.interceptors.response.use( ...@@ -106,4 +106,34 @@ axios.interceptors.response.use(
return Promise.reject(error) return Promise.reject(error)
}, },
) )
export function get(url, params) {
return new Promise((resolve, reject) => {
axios.get(url, { params })
.then((res) => {
if (res.status === 200 && res.data) {
resolve(res.data)
} else {
resolve(res)
}
})
.catch((err) => {
reject(err)
})
})
}
export function post(url, params, headers) {
return new Promise((resolve, reject) => {
axios.post(url, params, headers)
.then((res) => {
if (res.status === 200 && res.data) {
resolve(res.data)
} else {
resolve(res)
}
})
.catch((err) => {
reject(err)
})
})
}
export default axios export default axios
<template>
<div id="changeContab">
<div class="language">
<slot></slot>
</div>
<el-tabs
type="border-card"
style="border-color: #dcdfe6"
>
<el-tab-pane>
<span slot="label">
<i class="el-icon-date"></i>
{{ text.Seconds.name }}
</span>
<div class="tabBody">
<el-row>
<el-radio v-model="second.cronEvery" label="1">
{{ text.Seconds.every }}
</el-radio>
</el-row>
<el-row>
<el-radio v-model="second.cronEvery" label="2">
{{ text.Seconds.interval[0] }}
<el-input-number
size="small"
v-model="second.incrementIncrement"
:min="1"
:max="60"
></el-input-number>
{{ text.Seconds.interval[1] || '' }}
<el-input-number
size="small"
v-model="second.incrementStart"
:min="0"
:max="59"
></el-input-number>
{{ text.Seconds.interval[2] || '' }}
</el-radio>
</el-row>
<el-row>
<el-radio
class="long"
v-model="second.cronEvery"
label="3"
>
{{ text.Seconds.specific }}
<el-select
size="small"
multiple
v-model="second.specificSpecific"
>
<el-option
v-for="(val, index) in 60"
:key="index"
:value="val - 1"
>
{{ val - 1 }}
</el-option>
</el-select>
</el-radio>
</el-row>
<el-row>
<el-radio v-model="second.cronEvery" label="4">
{{ text.Seconds.cycle[0] }}
<el-input-number
size="small"
v-model="second.rangeStart"
:min="1"
:max="60"
></el-input-number>
{{ text.Seconds.cycle[1] || '' }}
<el-input-number
size="small"
v-model="second.rangeEnd"
:min="0"
:max="59"
></el-input-number>
{{ text.Seconds.cycle[2] || '' }}
</el-radio>
</el-row>
</div>
</el-tab-pane>
<el-tab-pane>
<span slot="label">
<i class="el-icon-date"></i>
{{ text.Minutes.name }}
</span>
<div class="tabBody">
<el-row>
<el-radio v-model="minute.cronEvery" label="1">
{{ text.Minutes.every }}
</el-radio>
</el-row>
<el-row>
<el-radio v-model="minute.cronEvery" label="2">
{{ text.Minutes.interval[0] }}
<el-input-number
size="small"
v-model="minute.incrementIncrement"
:min="1"
:max="60"
></el-input-number>
{{ text.Minutes.interval[1] }}
<el-input-number
size="small"
v-model="minute.incrementStart"
:min="0"
:max="59"
></el-input-number>
{{ text.Minutes.interval[2] || '' }}
</el-radio>
</el-row>
<el-row>
<el-radio
class="long"
v-model="minute.cronEvery"
label="3"
>
{{ text.Minutes.specific }}
<el-select
size="small"
multiple
v-model="minute.specificSpecific"
>
<el-option
v-for="(val, index) in 60"
:key="index"
:value="val - 1"
>
{{ val - 1 }}
</el-option>
</el-select>
</el-radio>
</el-row>
<el-row>
<el-radio v-model="minute.cronEvery" label="4">
{{ text.Minutes.cycle[0] }}
<el-input-number
size="small"
v-model="minute.rangeStart"
:min="1"
:max="60"
></el-input-number>
{{ text.Minutes.cycle[1] }}
<el-input-number
size="small"
v-model="minute.rangeEnd"
:min="0"
:max="59"
></el-input-number>
{{ text.Minutes.cycle[2] }}
</el-radio>
</el-row>
</div>
</el-tab-pane>
<el-tab-pane>
<span slot="label">
<i class="el-icon-date"></i>
{{ text.Hours.name }}
</span>
<div class="tabBody">
<el-row>
<el-radio v-model="hour.cronEvery" label="1">
{{ text.Hours.every }}
</el-radio>
</el-row>
<el-row>
<el-radio v-model="hour.cronEvery" label="2">
{{ text.Hours.interval[0] }}
<el-input-number
size="small"
v-model="hour.incrementIncrement"
:min="0"
:max="23"
></el-input-number>
{{ text.Hours.interval[1] }}
<el-input-number
size="small"
v-model="hour.incrementStart"
:min="0"
:max="23"
></el-input-number>
{{ text.Hours.interval[2] }}
</el-radio>
</el-row>
<el-row>
<el-radio
class="long"
v-model="hour.cronEvery"
label="3"
>
{{ text.Hours.specific }}
<el-select
size="small"
multiple
v-model="hour.specificSpecific"
>
<el-option
v-for="(val, index) in 24"
:key="index"
:value="val - 1"
>
{{ val - 1 }}
</el-option>
</el-select>
</el-radio>
</el-row>
<el-row>
<el-radio v-model="hour.cronEvery" label="4">
{{ text.Hours.cycle[0] }}
<el-input-number
size="small"
v-model="hour.rangeStart"
:min="0"
:max="23"
></el-input-number>
{{ text.Hours.cycle[1] }}
<el-input-number
size="small"
v-model="hour.rangeEnd"
:min="0"
:max="23"
></el-input-number>
{{ text.Hours.cycle[2] }}
</el-radio>
</el-row>
</div>
</el-tab-pane>
<el-tab-pane>
<span slot="label">
<i class="el-icon-date"></i>
{{ text.Day.name }}
</span>
<div class="tabBody">
<el-row>
<el-radio v-model="day.cronEvery" label="1">
{{ text.Day.every }}
</el-radio>
</el-row>
<el-row>
<el-radio v-model="day.cronEvery" label="2">
{{ text.Day.intervalWeek[0] }}
<el-input-number
size="small"
v-model="week.incrementIncrement"
:min="1"
:max="7"
></el-input-number>
{{ text.Day.intervalWeek[1] }}
<el-select
size="small"
v-model="week.incrementStart"
>
<el-option
v-for="(val, index) in 7"
:key="index"
:label="text.Week[val - 1]"
:value="val"
></el-option>
</el-select>
{{ text.Day.intervalWeek[2] }}
</el-radio>
</el-row>
<el-row>
<el-radio v-model="day.cronEvery" label="3">
{{ text.Day.intervalDay[0] }}
<el-input-number
size="small"
v-model="day.incrementIncrement"
:min="1"
:max="31"
></el-input-number>
{{ text.Day.intervalDay[1] }}
<el-input-number
size="small"
v-model="day.incrementStart"
:min="1"
:max="31"
></el-input-number>
{{ text.Day.intervalDay[2] }}
</el-radio>
</el-row>
<el-row>
<el-radio
class="long"
v-model="day.cronEvery"
label="4"
>
{{ text.Day.specificWeek }}
<el-select
size="small"
multiple
v-model="week.specificSpecific"
>
<el-option
v-for="(val, index) in 7"
:key="index"
:label="text.Week[val - 1]"
:value="
[
'SUN',
'MON',
'TUE',
'WED',
'THU',
'FRI',
'SAT',
][val - 1]
"
></el-option>
</el-select>
</el-radio>
</el-row>
<el-row>
<el-radio
class="long"
v-model="day.cronEvery"
label="5"
>
{{ text.Day.specificDay }}
<el-select
size="small"
multiple
v-model="day.specificSpecific"
>
<el-option
v-for="(val, index) in 31"
:key="index"
:value="val"
>
{{ val }}
</el-option>
</el-select>
</el-radio>
</el-row>
<el-row>
<el-radio v-model="day.cronEvery" label="6">
{{ text.Day.lastDay }}
</el-radio>
</el-row>
<el-row>
<el-radio v-model="day.cronEvery" label="7">
{{ text.Day.lastWeekday }}
</el-radio>
</el-row>
<el-row>
<el-radio v-model="day.cronEvery" label="8">
{{ text.Day.lastWeek[0] }}
<el-select
size="small"
v-model="day.cronLastSpecificDomDay"
>
<el-option
v-for="(val, index) in 7"
:key="index"
:label="text.Week[val - 1]"
:value="val"
></el-option>
</el-select>
{{ text.Day.lastWeek[1] || '' }}
</el-radio>
</el-row>
<el-row>
<el-radio v-model="day.cronEvery" label="9">
<el-input-number
size="small"
v-model="day.cronDaysBeforeEomMinus"
:min="1"
:max="31"
></el-input-number>
{{ text.Day.beforeEndMonth[0] }}
</el-radio>
</el-row>
<el-row>
<el-radio v-model="day.cronEvery" label="10">
{{ text.Day.nearestWeekday[0] }}
<el-input-number
size="small"
v-model="day.cronDaysNearestWeekday"
:min="1"
:max="31"
></el-input-number>
{{ text.Day.nearestWeekday[1] }}
</el-radio>
</el-row>
<el-row>
<el-radio v-model="day.cronEvery" label="11">
{{ text.Day.someWeekday[0] }}
<el-input-number
size="small"
v-model="week.cronNthDayNth"
:min="1"
:max="5"
></el-input-number>
<el-select
size="small"
v-model="week.cronNthDayDay"
>
<el-option
v-for="(val, index) in 7"
:key="index"
:label="text.Week[val - 1]"
:value="val"
></el-option>
</el-select>
{{ text.Day.someWeekday[1] }}
</el-radio>
</el-row>
</div>
</el-tab-pane>
<el-tab-pane>
<span slot="label">
<i class="el-icon-date"></i>
{{ text.Month.name }}
</span>
<div class="tabBody">
<el-row>
<el-radio v-model="month.cronEvery" label="1">
{{ text.Month.every }}
</el-radio>
</el-row>
<el-row>
<el-radio v-model="month.cronEvery" label="2">
{{ text.Month.interval[0] }}
<el-input-number
size="small"
v-model="month.incrementIncrement"
:min="0"
:max="12"
></el-input-number>
{{ text.Month.interval[1] }}
<el-input-number
size="small"
v-model="month.incrementStart"
:min="0"
:max="12"
></el-input-number>
</el-radio>
</el-row>
<el-row>
<el-radio
class="long"
v-model="month.cronEvery"
label="3"
>
{{ text.Month.specific }}
<el-select
size="small"
multiple
v-model="month.specificSpecific"
>
<el-option
v-for="(val, index) in 12"
:key="index"
:label="val"
:value="val"
></el-option>
</el-select>
</el-radio>
</el-row>
<el-row>
<el-radio v-model="month.cronEvery" label="4">
{{ text.Month.cycle[0] }}
<el-input-number
size="small"
v-model="month.rangeStart"
:min="1"
:max="12"
></el-input-number>
{{ text.Month.cycle[1] }}
<el-input-number
size="small"
v-model="month.rangeEnd"
:min="1"
:max="12"
></el-input-number>
</el-radio>
</el-row>
</div>
</el-tab-pane>
<el-tab-pane>
<span slot="label">
<i class="el-icon-date"></i>
{{ text.Year.name }}
</span>
<div class="tabBody">
<el-row>
<el-radio v-model="year.cronEvery" label="1">
{{ text.Year.every }}
</el-radio>
</el-row>
<el-row>
<el-radio v-model="year.cronEvery" label="2">
{{ text.Year.interval[0] }}
<el-input-number
size="small"
v-model="year.incrementIncrement"
:min="1"
:max="99"
></el-input-number>
{{ text.Year.interval[1] }}
<el-input-number
size="small"
v-model="year.incrementStart"
:min="2018"
:max="2118"
></el-input-number>
</el-radio>
</el-row>
<el-row>
<el-radio
class="long"
v-model="year.cronEvery"
label="3"
>
{{ text.Year.specific }}
<el-select
size="small"
filterable
multiple
v-model="year.specificSpecific"
>
<el-option
v-for="(val, index) in 100"
:key="index"
:label="2017 + val"
:value="2017 + val"
></el-option>
</el-select>
</el-radio>
</el-row>
<el-row>
<el-radio v-model="year.cronEvery" label="4">
{{ text.Year.cycle[0] }}
<el-input-number
size="small"
v-model="year.rangeStart"
:min="2018"
:max="2118"
></el-input-number>
{{ text.Year.cycle[1] }}
<el-input-number
size="small"
v-model="year.rangeEnd"
:min="2018"
:max="2118"
></el-input-number>
</el-radio>
</el-row>
</div>
</el-tab-pane>
</el-tabs>
<table
class="table"
cellpadding="0"
cellspacing="0"
width="100%"
>
<tr>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
</tr>
<tr>
<td>{{ this.secondsText || '*' }}</td>
<td>{{ this.minutesText || '*' }}</td>
<td>{{ this.hoursText || '*' }}</td>
<td>{{ this.daysText || '*' }}</td>
<td>{{ this.monthsText || '*' }}</td>
<td>{{ this.weeksText || '?' }}</td>
<td>{{ this.yearsText || '*' }}</td>
</tr>
</table>
<div style="height: 10px"></div>
<!-- <div class="bottom">
<span class="value">{{ this.cron }}</span>
<el-button type="primary" @click="change">{{ text.Save }}</el-button>
<el-button type="primary" @click="close">{{ text.Close }}</el-button>
</div> -->
</div>
</template>
<script>
import Language from '../../language/index'
export default {
name: 'vueCron',
props: {
data: {
type: String,
default: '',
},
},
data() {
return {
second: {
cronEvery: '',
incrementStart: '3',
incrementIncrement: '5',
rangeStart: '',
rangeEnd: '',
specificSpecific: [],
},
minute: {
cronEvery: '',
incrementStart: '3',
incrementIncrement: '5',
rangeStart: '',
rangeEnd: '',
specificSpecific: [],
},
hour: {
cronEvery: '',
incrementStart: '3',
incrementIncrement: '5',
rangeStart: '',
rangeEnd: '',
specificSpecific: [],
},
day: {
cronEvery: '',
incrementStart: '1',
incrementIncrement: '1',
rangeStart: '',
rangeEnd: '',
specificSpecific: [],
cronLastSpecificDomDay: 1,
cronDaysBeforeEomMinus: '',
cronDaysNearestWeekday: '',
},
week: {
cronEvery: '',
incrementStart: '1',
incrementIncrement: '1',
specificSpecific: [],
cronNthDayDay: 1,
cronNthDayNth: '1',
},
month: {
cronEvery: '',
incrementStart: '3',
incrementIncrement: '5',
rangeStart: '',
rangeEnd: '',
specificSpecific: [],
},
year: {
cronEvery: '',
incrementStart: '2017',
incrementIncrement: '1',
rangeStart: '',
rangeEnd: '',
specificSpecific: [],
},
output: {
second: '',
minute: '',
hour: '',
day: '',
month: '',
Week: '',
year: '',
},
}
},
model: {
prop: 'value',
event: 'change',
},
computed: {
text() {
return Language.cn
},
secondsText() {
let seconds = ''
const cronEvery = this.second.cronEvery
switch (cronEvery.toString()) {
case '1':
seconds = '*'
break
case '2':
seconds =
this.second.incrementStart +
'/' +
this.second.incrementIncrement
break
case '3':
// eslint-disable-next-line array-callback-return
this.second.specificSpecific.map(val => {
seconds += val + ','
})
seconds = seconds.slice(0, -1)
break
case '4':
seconds =
this.second.rangeStart +
'-' +
this.second.rangeEnd
break
}
return seconds
},
minutesText() {
let minutes = ''
const cronEvery = this.minute.cronEvery
switch (cronEvery.toString()) {
case '1':
minutes = '*'
break
case '2':
minutes =
this.minute.incrementStart +
'/' +
this.minute.incrementIncrement
break
case '3':
// eslint-disable-next-line array-callback-return
this.minute.specificSpecific.map(val => {
minutes += val + ','
})
minutes = minutes.slice(0, -1)
break
case '4':
minutes =
this.minute.rangeStart +
'-' +
this.minute.rangeEnd
break
}
return minutes
},
hoursText() {
let hours = ''
const cronEvery = this.hour.cronEvery
switch (cronEvery.toString()) {
case '1':
hours = '*'
break
case '2':
hours =
this.hour.incrementStart +
'/' +
this.hour.incrementIncrement
break
case '3':
// eslint-disable-next-line array-callback-return
this.hour.specificSpecific.map(val => {
hours += val + ','
})
hours = hours.slice(0, -1)
break
case '4':
hours =
this.hour.rangeStart + '-' + this.hour.rangeEnd
break
}
return hours
},
daysText() {
let days = ''
const cronEvery = this.day.cronEvery
switch (cronEvery.toString()) {
case '1':
break
case '2':
case '4':
case '11':
days = '?'
break
case '3':
days =
this.day.incrementStart +
'/' +
this.day.incrementIncrement
break
case '5':
// eslint-disable-next-line array-callback-return
this.day.specificSpecific.map(val => {
days += val + ','
})
days = days.slice(0, -1)
break
case '6':
days = 'L'
break
case '7':
days = 'LW'
break
case '8':
days = this.day.cronLastSpecificDomDay + 'L'
break
case '9':
days = 'L-' + this.day.cronDaysBeforeEomMinus
break
case '10':
days = this.day.cronDaysNearestWeekday + 'W'
break
}
return days
},
weeksText() {
let weeks = ''
const cronEvery = this.day.cronEvery
switch (cronEvery.toString()) {
case '1':
case '3':
case '5':
weeks = '?'
break
case '2':
weeks =
this.week.incrementStart +
'/' +
this.week.incrementIncrement
break
case '4':
// eslint-disable-next-line array-callback-return
this.week.specificSpecific.map(val => {
weeks += val + ','
})
weeks = weeks.slice(0, -1)
break
case '6':
case '7':
case '8':
case '9':
case '10':
weeks = '?'
break
case '11':
weeks =
this.week.cronNthDayDay +
'#' +
this.week.cronNthDayNth
break
}
return weeks
},
monthsText() {
let months = ''
const cronEvery = this.month.cronEvery
switch (cronEvery.toString()) {
case '1':
months = '*'
break
case '2':
months =
this.month.incrementStart +
'/' +
this.month.incrementIncrement
break
case '3':
// eslint-disable-next-line array-callback-return
this.month.specificSpecific.map(val => {
months += val + ','
})
months = months.slice(0, -1)
break
case '4':
months =
this.month.rangeStart +
'-' +
this.month.rangeEnd
break
}
return months
},
yearsText() {
let years = ''
const cronEvery = this.year.cronEvery
switch (cronEvery.toString()) {
case '1':
years = '*'
break
case '2':
years =
this.year.incrementStart +
'/' +
this.year.incrementIncrement
break
case '3':
// eslint-disable-next-line array-callback-return
this.year.specificSpecific.map(val => {
years += val + ','
})
years = years.slice(0, -1)
break
case '4':
years =
this.year.rangeStart + '-' + this.year.rangeEnd
break
}
return years
},
cron() {
return `${this.secondsText || '*'} ${this
.minutesText || '*'} ${this.hoursText || '*'} ${this
.daysText || '*'} ${this.monthsText || '*'} ${this
.weeksText || '?'} ${this.yearsText || '*'}`
},
},
watch: {
value(val) {
if (val) {
const arr = val.split(' ')
this.secondsText = arr[0]
this.minutesText = arr[1]
this.hoursText = arr[2]
this.daysText = arr[3]
this.monthsText = arr[4]
this.yearsText = arr[5]
}
// this.rest(this.$data)
},
cron(v) {
this.$emit('change', v)
},
},
methods: {
getValue() {
return this.cron
},
},
mounted() {},
}
</script>
<style lang="less" scoped>
#changeContab {
position: relative;
.language {
position: absolute;
right: 5px;
z-index: 1;
top: 5px;
}
.el-tabs {
box-shadow: none;
}
.tabBody {
.el-row {
margin: 10px 0;
.long {
.el-select {
width: 350px;
}
}
.el-input-number {
width: 110px;
}
}
}
.bottom {
width: 100%;
text-align: center;
margin-top: 5px;
position: relative;
.value {
font-size: 18px;
vertical-align: middle;
}
}
}
.table {
margin: 10px 0;
border-bottom: 1px solid #dcdfe6;
border-right: 1px solid #dcdfe6;
border-radius: 5px;
td,
th {
line-height: 24px;
border-top: 1px solid #dcdfe6;
border-left: 1px solid #dcdfe6;
}
td {
text-align: center;
}
}
</style>
<template>
<div class="box" ref="box">
<div
class="top"
ref="top"
:style="{
height: isfooter && footerShow ? height : '100%',
userSelect: isMove ? 'none' : 'auto',
}"
>
<slot name="header"></slot>
</div>
<template v-if="isfooter">
<div class="resize" ref="dividingLine">
<div class="footer-show" ref="resize">
<span>
<i class="el-icon-d-caret" title="底部明细"></i>
</span>
</div>
</div>
<div
:style="{
userSelect: isMove ? 'none' : 'auto',
height: height
? `calc(100% - 20px - ${height}) `
: '',
}"
v-show="isfooter && footerShow"
class="footer"
ref="footer"
>
<slot name="footer"></slot>
</div>
</template>
</div>
</template>
<script>
export default {
name: 'Drag',
data() {
return {
isClick: false,
footerShow: true,
boxHeight: 0,
isMove: false,
startPosition: 0,
}
},
props: {
isfooter: {
type: Boolean,
default: true,
},
elementChange: {
type: Function,
default: () => {},
},
height: {
type: String,
default: 'calc(70% - 20px)',
},
},
mounted() {
this.topDom = this.$refs.top
this.footerDom = this.$refs.footer
const box = this.$refs.box
this.boxHeight = box.clientHeight
this.resize = this.$refs.resize
this.dividingLine = this.$refs.dividingLine
if (this.resize) {
this.resize.addEventListener(
'mousedown',
this.mousedown,
)
}
document.addEventListener('mousemove', this.mousemove)
document.addEventListener('mouseup', this.mouseup)
window.addEventListener('resize', this.onResize)
},
destroyed() {
this.resize &&
this.resize.removeEventListener(
'mousedown',
this.mousedown,
)
document.removeEventListener(
'mousemove',
this.mousemove,
)
document.removeEventListener('mouseup', this.mouseup)
window.removeEventListener('resize', this.onResize)
},
watch: {
isfooter2(v) {
if (!v) this.isfooter = true
else this.isfooter = false
this.footerTabs()
},
isfooter(v) {
this.resize &&
this.resize.removeEventListener(
'mousedown',
this.mousedown,
)
if (v) {
this.$nextTick(() => {
this.resize = this.$refs.resize
this.footerDom = this.$refs.footer
if (this.resize) {
this.resize.addEventListener(
'mousedown',
this.mousedown,
)
}
})
}
},
},
methods: {
onResize() {
const box = this.$refs.box
this.boxHeight = box.clientHeight
},
mousedown(e) {
this.resize.setCapture && this.resize.setCapture()
this.isClick = true
this.isMove = true
this.startPosition = e.clientY
},
mousemove(e) {
this.isClick = false
if (!this.isMove || !this.footerShow) return
if (this.timer) return
setTimeout(() => {
const endY = e.clientY
const moveLen = endY - this.startPosition
// let maxT =this.boxHeight - 150
// if (moveLen < 300) moveLen = 300
// if (moveLen > maxT) moveLen = maxT
const topH = this.getheight(this.topDom) + moveLen
const footerH = this.boxHeight - topH - 20
if (topH < 150 || footerH < 150) return
this.topDom.style.height = topH + 'px'
this.footerDom.style.height = footerH + 'px'
// this.footerDom.style.height =
// this.getheight(this.footerDom) - moveLen + 'px'
this.startPosition = e.clientY
}, 16)
},
mouseup() {
if (this.isClick) {
// this.footerToggle()
this.isClick = false
}
this.isMove = false
this.resize?.releaseCapture &&
this.resize.releaseCapture()
},
getheight(dom) {
if (dom) {
let height = getComputedStyle(dom).height
height = height.replace(/[^0-9.]/gi, '')
return Number(height)
}
},
footerToggle() {
this.footerShow = !this.footerShow
},
},
}
</script>
<style scoped>
.box {
width: 100%;
height: 100%;
overflow: hidden;
box-sizing: border-box;
/* border: 1px solid #ff0000; */
}
.top {
width: 100%;
border-radius: 10px;
background: #fff;
padding-top: 10px;
overflow: hidden;
box-sizing: border-box;
/* background: skyblue; */
}
.top > div,
.footer > div {
display: flex;
height: 100%;
width: 100%;
}
.top > div {
flex-direction: column;
/* padding-top: 10px; */
box-sizing: border-box;
}
.footer {
width: 100%;
height: 30%;
border-radius: 10px;
background: #fff;
overflow: hidden;
margin-top: 10px;
/* background: tomato; */
}
.resize {
width: 100%;
height: 0px;
}
.footer-show {
position: relative;
text-align: center;
height: 1px;
cursor: row-resize;
background-color: #f5f7fa;
/* border-top: 1px solid #e4e7ed; */
}
.footer-show::after {
display: none;
position: absolute;
bottom: 0;
left: 50%;
width: 223px;
height: 26px;
content: '';
transform: translate(-50%, 0);
background: linear-gradient(
to right,
transparent,
#eeeeee,
transparent
);
}
.footer-show:hover::after {
display: block;
}
.footer-show span {
display: none;
position: absolute;
top: 0;
left: 50%;
width: 30px;
height: 32px;
z-index: 5;
transform: translate(-50%, -50%);
border-radius: 50%;
background: #ddd;
}
.footer-show:hover span {
display: block;
}
.footer-show i:hover {
color: #1d8acf;
}
.footer-show i {
font-weight: bold;
color: #999;
font-size: 26px;
line-height: 32px;
}
</style>
<!--
* @Description:
* @Author: chd
* @Date: 2020-10-19 15:44:02
* @LastEditors: chd
* @LastEditTime: 2021-04-28 13:57:48
-->
<script>
import { isMobile } from '../../utils/commonUtil'
export default {
name: 'layout',
inheritAttrs: false,
props: {
isleftshow: {
default: true,
type: Boolean,
},
},
data() {
return {
isLeft: true,
}
},
methods: {
leftChange() {
this.isLeft = !this.isLeft
},
},
render() {
const {
$scopedSlots,
$attrs,
isLeft,
isleftshow,
$vnode,
} = this
const leftStyle = $attrs?.leftStyle || {}
let { width, ...attrs } = leftStyle
if (!width) width = '200px'
return (
<div class={`page_main ${isMobile ? 'mobile' : ''}`}>
{$scopedSlots.header && (
<div class="page_header">
{$scopedSlots.header()}
</div>
)}
<div
class="layout_wrap"
style={$vnode.data.staticStyle}
>
{$scopedSlots.page_left && (
<div
class="page_left"
style={{
...attrs,
width: isLeft ? width : '1px',
}}
>
{$scopedSlots.page_left()}
</div>
)}
{isleftshow && (
<div class="separation">
<span
class="left_toggle"
title={isLeft ? '点击收起' : '点击展开'}
onClick={this.leftChange}
>
<i
class={
isLeft
? 'el-icon-caret-left'
: 'el-icon-caret-right'
}
></i>
</span>
</div>
)}
{$scopedSlots.page_right && (
<div
class="page_right"
style={$attrs?.rightStyle || {}}
>
{$scopedSlots.page_right()}
</div>
)}
{$scopedSlots.default && $scopedSlots.default()}
</div>
</div>
)
},
}
</script>
<style scoped>
.page_main {
height: calc(100vh - 86px);
box-sizing: border-box;
display: flex;
flex-direction: column;
margin: 0;
overflow: hidden;
position: relative;
}
.page_main .layout_wrap {
height: 100%;
display: flex;
flex-direction: column;
overflow: hidden;
position: relative;
}
.page_main:not(.mobile) {
margin-right: 54px;
}
/* .page_main.home .tool_warper {
display: none;
} */
.page_main.row .layout_wrap {
flex-direction: row;
}
.page_main.wrap .layout_wrap {
background: #fff;
box-sizing: border-box;
border-radius: 10px;
padding-top: 10px;
}
.page_main.wrap .layout_wrap >>> form:nth-of-type(1) {
margin-left: 10px;
}
.page_main.mobile {
height: calc(100vh - 56px);
}
.page_header {
background: #fff;
padding-top: 10px;
margin-bottom: 10px;
}
.page_left {
position: relative;
display: flex;
flex-direction: column;
width: 200px;
height: 100%;
background: var(--background-color);
box-sizing: border-box;
border-radius: 5px 5px 0 0;
overflow: auto;
}
.separation {
display: none;
position: relative;
width: 1px;
}
.row .separation {
display: block;
}
.separation .left_toggle {
position: absolute;
right: -16px;
width: 17px;
height: 24px;
background: #dedede;
z-index: 1000;
top: 50%;
transform: translateY(-50%);
cursor: pointer;
border-top-right-radius: 5px;
border-bottom-right-radius: 5px;
}
.separation .left_toggle::before {
position: absolute;
width: 0px;
height: 0px;
content: '';
top: 10px;
left: -12px;
pointer-events: none;
transform: rotate(45deg);
border-width: 12px;
border-style: solid;
border-color: rgba(0, 0, 0, 0) #dedede rgba(0, 0, 0, 0)
rgba(0, 0, 0, 0);
border-radius: 5px;
}
.separation .left_toggle::after {
position: absolute;
width: 0px;
height: 0px;
top: -10px;
left: -12px;
pointer-events: none;
content: '';
transform: rotate(-45deg);
border-width: 12px;
border-style: solid;
border-color: rgba(0, 0, 0, 0) #dedede rgba(0, 0, 0, 0)
rgba(0, 0, 0, 0);
border-radius: 5px;
}
.separation .left_toggle i {
display: block;
margin-top: 3px;
pointer-events: none;
}
.separation:hover .left_toggle {
display: block;
}
.page_right {
flex: 1;
display: flex;
flex-direction: column;
margin-left: 10px;
box-sizing: border-box;
overflow: hidden;
position: relative;
}
.page_main:not(.drag) .page_right {
background: var(--background-color);
border-radius: 5px 5px 0 0;
padding-top: 10px;
box-sizing: border-box;
}
.page_main .page_right >>> form:nth-of-type(1),
.page_main .page_left >>> form,
.page_main.drag >>> form {
padding-left: 10px;
}
/* .page_right >>> .top {
padding-top: 0;
} */
.page_main.drag .page_right {
/* padding-top: 10px; */
background: transparent;
}
</style>
<!--
* @Description: 描述
* @Author: chd
* @Date: 2020-08-14 13:10:35
* @LastEditors: chd
* @LastEditTime: 2021-03-12 13:33:01
-->
<template>
<div class="pageinationCon">
<div class="select-number" v-if="selections">
选中
<span style="color: red; font-weight: bold">
{{ selections ? selections.length : 0 }}
</span>
</div>
<slot></slot>
<el-pagination
@current-change="currentChange"
:current-page.sync="options.currentPage"
:page-size="options.pageSize"
:page-sizes="pageSizes"
:layout="layout"
:total="options.total"
>
<template #default>
<span class="default-input">
自定义条数
<el-input
placeholder="请输入"
v-model="customizeNumbers"
style="width: 55px"
@change="onPageSizeInput"
/>
条/页
</span>
</template>
</el-pagination>
</div>
</template>
<script>
export default {
name: 'pagination',
data() {
return {
customizeNumbers: this.options.pageSize,
}
},
props: {
setValue: {
type: Function,
default: () => {},
},
options: {
type: Object,
default: () => ({}),
},
pageSizes: {
type: Array,
default: () => [100, 200, 500],
},
layout: {
type: String,
default: () =>
'total, prev, pager, next, jumper,slot',
},
selections: {
type: Array,
},
},
methods: {
currentChange(i) {
this.setValue({ currentPage: i })
},
changeSizes(value) {
this.setValue({ pageSize: +value })
},
onPageSizeInput(value) {
value = parseInt(value) // + 可能转换出来小数,而 parseInt 就是整数
if (value <= 0 || isNaN(value)) {
value = this.options.pageSize || 20
}
if (value > 500) value = 500
this.customizeNumbers = `${value}`
this.changeSizes(value)
},
},
}
</script>
<style scoped>
.pageinationCon::v-deep .default-input {
margin-left: 24px;
font-weight: normal !important;
color: #606266 !important;
}
.select-number {
position: absolute;
left: 5px;
top: 10px;
}
</style>
/*
* @Description: 描述
* @Author: chd
* @Date: 2021-02-04 10:02:43
* @LastEditors: chd
* @LastEditTime: 2021-02-04 10:02:58
*/
export default {
Seconds: {
name: '秒',
every: '每一秒钟',
interval: ['每隔', '秒执行 从', '秒开始'],
specific: '具体秒数(可多选)',
cycle: ['周期从', '到', '秒'],
},
Minutes: {
name: '分',
every: '每一分钟',
interval: ['每隔', '分执行 从', '分开始'],
specific: '具体分钟数(可多选)',
cycle: ['周期从', '到', '分'],
},
Hours: {
name: '时',
every: '每一小时',
interval: ['每隔', '小时执行 从', '小时开始'],
specific: '具体小时数(可多选)',
cycle: ['周期从', '到', '小时'],
},
Day: {
name: '天',
every: '每一天',
intervalWeek: ['每隔', '周执行 从', '开始'],
intervalDay: ['每隔', '天执行 从', '天开始'],
specificWeek: '具体星期几(可多选)',
specificDay: '具体天数(可多选)',
lastDay: '在这个月的最后一天',
lastWeekday: '在这个月的最后一个工作日',
lastWeek: ['在这个月的最后一个'],
beforeEndMonth: ['在本月底前', '天'],
nearestWeekday: ['最近的工作日(周一至周五)至本月', '日'],
someWeekday: ['在这个月的第', '个'],
},
Week: ['天', '一', '二', '三', '四', '五', '六'].map((val) => '星期' + val),
Month: {
name: '月',
every: '每一月',
interval: ['每隔', '月执行 从', '月开始'],
specific: '具体月数(可多选)',
cycle: ['从', '到', '月之间的每个月'],
},
Year: {
name: '年',
every: '每一年',
interval: ['每隔', '年执行 从', '年开始'],
specific: '具体年份(可多选)',
cycle: ['从', '到', '年之间的每一年'],
},
Save: '保存',
Close: '关闭',
}
/*
* @Description: 描述
* @Author: chd
* @Date: 2021-02-04 10:04:17
* @LastEditors: chd
* @LastEditTime: 2021-02-04 10:04:17
*/
export default {
Seconds: {
name: 'Seconds',
every: 'Every second',
interval: ['Every', 'second(s) starting at second'],
specific: 'Specific second (choose one or many)',
cycle: ['Every second between second', 'and second'],
},
Minutes: {
name: 'Minutes',
every: 'Every minute',
interval: ['Every', 'minute(s) starting at minute'],
specific: 'Specific minute (choose one or many)',
cycle: ['Every minute between minute', 'and minute'],
},
Hours: {
name: 'Hours',
every: 'Every hour',
interval: ['Every', 'hour(s) starting at hour'],
specific: 'Specific hour (choose one or many)',
cycle: ['Every hour between hour', 'and hour'],
},
Day: {
name: 'Day',
every: 'Every day',
intervalWeek: ['Every', 'day(s) starting on'],
intervalDay: ['Every', 'day(s) starting at the', 'of the month'],
specificWeek: 'Specific day of week (choose one or many)',
specificDay: 'Specific day of month (choose one or many)',
lastDay: 'On the last day of the month',
lastWeekday: 'On the last weekday of the month',
lastWeek: ['On the last', ' of the month'],
beforeEndMonth: ['day(s) before the end of the month'],
nearestWeekday: [
'Nearest weekday (Monday to Friday) to the',
'of the month',
],
someWeekday: ['On the', 'of the month'],
},
Week: [
'Sunday',
'Monday',
'Tuesday',
'Wednesday',
'Thursday',
'Friday',
'Saturday',
],
Month: {
name: 'Month',
every: 'Every month',
interval: ['Every', 'month(s) starting in'],
specific: 'Specific month (choose one or many)',
cycle: ['Every month between', 'and'],
},
Year: {
name: 'Year',
every: 'Any year',
interval: ['Every', 'year(s) starting in'],
specific: 'Specific year (choose one or many)',
cycle: ['Every year between', 'and'],
},
Save: 'Save',
Close: 'Close',
}
/*
* @Description: 描述
* @Author: chd
* @Date: 2021-02-04 10:03:33
* @LastEditors: chd
* @LastEditTime: 2021-02-04 10:04:59
*/
import en from './en'
import cn from './cn'
export default {
en,
cn,
}
...@@ -2,6 +2,7 @@ import Vue from 'vue' ...@@ -2,6 +2,7 @@ import Vue from 'vue'
import App from './App.vue' import App from './App.vue'
import router from './router' import router from './router'
import store from './store' import store from './store'
import './plugins/myui'
import element from '@/common/components/element-ui.js' import element from '@/common/components/element-ui.js'
import vxeTable from '@/common/components/vxeTable.js' import vxeTable from '@/common/components/vxeTable.js'
import './common/style/index.scss' import './common/style/index.scss'
......
/*
* @Description: 描述
* @Author: chd
* @Date: 2021-01-27 17:22:04
* @LastEditors: chd
* @LastEditTime: 2021-01-27 17:24:04
*/
export default {
data() {
return {
paginationOptions: {
pageSize: 100,
currentPage: 1,
total: 0,
},
pickListpaginationOptions: {
pageSize: 100,
currentPage: 1,
total: 0,
},
paginationPickOptions: {
pageSize: 100,
currentPage: 1,
total: 0,
},
}
},
methods: {
setpaginationOptions(opt) {
for (const key in opt) {
this.paginationOptions[key] = opt[key]
}
this.getlist()
},
setPickListPaginationOptions(opt) {
for (const key in opt) {
this.pickListpaginationOptions[key] = opt[key]
}
// TODO
this.getPickList()
},
setpaginationPickOptions(opt) {
for (const key in opt) {
this.paginationPickOptions[key] = opt[key]
}
},
},
}
/*
* @Description: 自定义组件
* @Author: Huidong Che
* @Date: 2020-04-03 15:33:04
* @LastEditors: chd
* @LastEditTime: 2020-10-09 17:20:07
*/
import Vue from 'vue'
import draggable from 'vuedraggable'
const context = require.context('../components/global', false, /\.vue$/)
context.keys().forEach((key) => {
const component = context(key).default
Vue.component(component.name, component)
})
Vue.component('draggable', draggable)
\ No newline at end of file
...@@ -177,12 +177,16 @@ export default { ...@@ -177,12 +177,16 @@ export default {
tableColumns() { tableColumns() {
return [ return [
{ {
label: '币种名称',
key: 'currencyName',
},
{
label: '币种代码', label: '币种代码',
key: 'currencyCode', key: 'currencyCode',
}, },
{ {
label: '币种名称', label: '币种日期',
key: 'currencyName', key: 'currencyDate',
}, },
{ {
label: '兑人民币汇率', label: '兑人民币汇率',
......
<template> <template>
<div class="wraper"> <layout class="drag">
<el-form <drag height="calc(54% - 20px)">
:inline="true" <div slot="header">
size="mini" <el-form
@submit.native.prevent :model="searchForm"
@keyup.enter.capture="search" ref="searchForm"
> :inline="true"
<el-form-item label="类型"> size="mini"
<el-select v-enter-submit="search"
style="width: 150px" @submit.native.prevent
v-model="searchForm.taskType"
value-key=""
placeholder="请选择"
clearable
>
<el-option
v-for="(item, index) in types"
:key="index"
:label="item.value"
:value="item.key"
></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button
native-type="submit"
type="primary"
@click="search()"
icon="el-icon-search"
>
查询
</el-button>
</el-form-item>
<el-form-item>
<el-button
type="success"
@click="addDialog(1)"
icon="el-icon-plus"
>新增</el-button
> >
</el-form-item> <el-form-item label="类型">
</el-form> <el-select
<div style="width: 150px"
v-loading="loading" v-model="searchForm.taskType"
class="table-wrap" value-key=""
style="height:460px" placeholder="请选择"
> @change="typeChange"
<table-vue clearable
:sourceData="sourceData" >
ref="multipleTable" <el-option
:tableColumns="tableColumns" v-for="(item, index) in types"
@currentChange="currentTabFn" :key="index"
:rowClassName="cellClass" :label="item.value"
:selection="true" :value="item.key"
@selectionChange="selectionChange" ></el-option>
></table-vue> </el-select>
</div> </el-form-item>
<el-tabs v-model="activeName"> <el-form-item>
<el-tab-pane label="日志" name="1"> <el-button
<div class="table-wrap" style="height:280px"> type="primary"
<table-vue native-type="submit"
@click="search"
>
查询
</el-button>
</el-form-item>
<el-form-item label="">
<el-button type="success" @click="showEdit()"
>新增</el-button
>
</el-form-item>
</el-form>
<div class="table_wrap" style="height: 100%">
<my-table
:sourceData="sourceData" :sourceData="sourceData"
ref="multipleTable"
:tableColumns="tableColumns" :tableColumns="tableColumns"
@currentChange="currentTabFn" :selection="true"
:rowClassName="cellClass" @currentChange="currentChange"
@selectionChange="selectionChange" ></my-table>
></table-vue>
<div class="pagination">
<el-pagination
layout="sizes, total, prev, pager, next, jumper"
background
:total="paginationOptions.total"
:page-size="paginationOptions.pageSize"
:current-page="paginationOptions.currentPage"
@size-change="sizeChange"
@current-change="onCurrentChange"
></el-pagination>
</div>
</div> </div>
</el-tab-pane> </div>
</el-tabs> <div slot="footer">
<!-- 弹出层 --> <el-tabs
v-model="activeName"
type="border-card"
style="height: 100%; width: 100%"
>
<el-tab-pane label="日志" name="1">
<div style="height: calc(100% - 30px)">
<my-table
:sourceData="logList"
:tableColumns="logTableColumns"
></my-table>
</div>
<pagination
:setValue="setpaginationOptions"
:options="paginationOptions"
:serialNumber="false"
/>
</el-tab-pane>
<!-- <el-tab-pane label="内部便签" name="2">配置管理</el-tab-pane>
-->
</el-tabs>
</div>
</drag>
<el-dialog <el-dialog
:title="isEdit ? '编辑' : '新增'"
:visible.sync="editVisible"
:close-on-click-modal="false" :close-on-click-modal="false"
:title="is_title == 1 ? '新增' : '编辑'" width="600px"
:visible.sync="dialogVisible"
width="800px"
> >
<el-form <el-form
label-position="right" :model="editForm"
label-width="140px" ref="editForm"
label-width="100px"
size="mini" size="mini"
:inline="true" :inline="true"
:model="addcurrencyform"
:rules="addrules"
ref="addcurrencyform"
> >
<el-form-item label="币种代码" prop="currencyCode"> <el-form-item label="类型" prop="taskType" required>
<el-input <el-select
v-model="addcurrencyform.currencyCode" style="width: 168px"
placeholder="请输入币种代码" v-model="editForm.taskType"
></el-input> value-key=""
</el-form-item> placeholder="请选择"
<el-form-item label="币种名称" prop="currencyName"> @change="typeChange"
<el-input >
v-model="addcurrencyform.currencyName" <el-option
placeholder="请输入币种名称" v-for="(item, index) in types"
></el-input> :key="index"
:label="item.value"
:value="item.key"
></el-option>
</el-select>
</el-form-item> </el-form-item>
<el-form-item <el-form-item
label="对人人民币汇率" label="任务开始时间"
prop="exchangeCnyRate" v-if="editForm.quartzType === 'SIMPLE'"
> >
<el-input <el-date-picker
v-model="addcurrencyform.exchangeCnyRate" style="width: 168px"
placeholder="对人人民币汇率" v-model="editForm.startTime"
></el-input> type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="选择日期时间"
></el-date-picker>
</el-form-item> </el-form-item>
<el-form-item <el-form-item
label="对美元汇率" label="执行频率:"
prop="exchangeUsdRate" prop="interval"
required
v-if="editForm.quartzType === 'SIMPLE'"
> >
<el-input <el-input
v-model="addcurrencyform.exchangeUsdRate" style="width: 50px"
placeholder="对美元汇率" v-model="editForm.interval"
placeholder="1"
></el-input> ></el-input>
&nbsp;
<el-select
style="width: 60px"
v-model="editForm.unit"
>
<el-option label="秒" value="s"></el-option>
<el-option label="分" value="m"></el-option>
<el-option label="时" value="h"></el-option>
<el-option label="天" value="day"></el-option>
<el-option label="月" value="month"></el-option>
</el-select>
<el-button @click="editForm.quartzType = 1"
>高级</el-button
>
</el-form-item> </el-form-item>
<el-form-item label="备注" prop="remark"> <cron
v-else
@change="changeCron"
@close="cronPopover = false"
v-model="editForm.cron"
>
<el-button @click="editForm.quartzType = 'SIMPLE'"
>返回</el-button
>
</cron>
<el-form-item label="任务描述" size="normal">
<el-input <el-input
v-model="addcurrencyform.remark" style="width: 438px"
placeholder="请输入备注" v-model="editForm.note"
placeholder=""
type="textarea"
></el-input> ></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
<span slot="footer" class="dialog-footer">
<el-button <span slot="footer">
@click="dialogVisible = false" <el-button @click="editVisible = false" size="mini"
size="mini" >取消</el-button
style="width: 100px"
> >
取消
</el-button>
<el-button <el-button
type="primary" type="primary"
@click="addCurrency()" @click="submit"
size="mini" size="mini"
style="width: 100px" >提交</el-button
> >
确认
</el-button>
</span> </span>
</el-dialog> </el-dialog>
</div> </layout>
</template> </template>
<script> <script>
import axios from '../../common/api/axios' import { get, post } from '../../common/api/axios'
import tableVue from '@/common/components/base/tableView.vue' import MyTable from '@/common/components/base/tableView.vue'
import pagination from '../../mixins/pagination'
import cron from '../../components/base/cron'
export default { export default {
name: 'system_timed_task', name: 'system_timed_task',
components: { components: {
tableVue, cron,
MyTable,
}, },
mixins: [pagination],
data() { data() {
return { return {
activeName: '1',
is_title: 1,
select: '',
types: [], types: [],
sourceData: [],
searchForm: {}, searchForm: {},
dialogVisible: false, sourceData: [],
addcurrencyform: { isEdit: false,
id: '', editVisible: false,
currencyCode: '', defaultEditForm: JSON.stringify({
currencyName: '', unit: '',
exchangeUsdRate: '', quartzType: 'SIMPLE',
exchangeCnyRate: '', cron: '',
remark: '', }),
}, editForm: {},
addcurrencyform2: null, cronPopover: true,
formId: null, activeName: '1',
addrules: { logList: [],
exchangeUsdRate: [
{
required: true,
message: '请输入汇率',
trigger: 'blur',
},
{
pattern: /^(\d+)?(\.\d+)?$/,
message: '只能输入数字',
},
],
exchangeCnyRate: [
{
required: true,
message: '请输入汇率',
trigger: 'blur',
},
{
pattern: /^(\d+)?(\.\d+)?$/,
message: '只能输入数字',
},
],
currencyCode: [
{
required: true,
message: '请输入币种代码',
trigger: 'blur',
},
],
currencyName: [
{
required: true,
message: '请输入币种名称',
trigger: 'blur',
},
],
},
paginationOptions: {
pageSize: 100,
currentPage: 1,
total: 0,
},
loading: false,
} }
}, },
created() {
this.getList()
this.addcurrencyform2 = JSON.parse(
JSON.stringify(this.addcurrencyform),
)
},
mounted() {
axios.get('quartzTask/typeList').then(res => {
this.types = res.data
})
},
computed: { computed: {
tableColumns() { tableColumns() {
return [ return [
...@@ -323,7 +294,7 @@ export default { ...@@ -323,7 +294,7 @@ export default {
> >
<i <i
class="el-icon-edit" class="el-icon-edit"
onClick={() => this.addDialog(item)} onClick={() => this.showEdit(item)}
></i> ></i>
</span> </span>
<span <span
...@@ -332,9 +303,7 @@ export default { ...@@ -332,9 +303,7 @@ export default {
> >
<i <i
class="el-icon-delete-solid" class="el-icon-delete-solid"
onClick={() => onClick={() => this.remove(item.id)}
this.deleteSection(item.id)
}
></i> ></i>
</span> </span>
<span <span
...@@ -364,8 +333,78 @@ export default { ...@@ -364,8 +333,78 @@ export default {
}, },
] ]
}, },
logTableColumns() {
return [
{
label: 'Task Id',
width: 100,
key: 'taskId',
align: 'right',
},
{
label: '状态',
width: 70,
key: 'status',
render: item => (
<span
style={{
color:
item.status === 'FAILURE'
? 'red'
: item.status === 'SUCCESS'
? 'green'
: '#ddd',
}}
>
{item.status}
</span>
),
},
{ label: '开始时间', width: 130, key: 'startTime' },
{ label: '结束时间', width: 130, key: 'endTime' },
{
label: '错误信息',
width: '',
key: 'errorMessage',
align: 'left',
},
]
},
},
mounted() {
this.getlist()
get('quartzTask/typeList').then(res => {
this.types = res.data
})
}, },
methods: { methods: {
clearLog(taskId) {
get('quartzTask/clearLogs', {
taskId: taskId,
}).then(res => {
this.$message.success(res.message)
this.getDetail(taskId)
})
},
currentChange(item) {
if (item.row) {
this.getDetail(item.row.id)
}
},
getDetail(id) {
const {
pageSize,
currentPage,
} = this.paginationOptions
get('quartzTask/logs', {
id,
currentPage,
pageSize,
}).then(res => {
this.paginationOptions.total = res.data.total
this.logList = res.data.records
})
},
statusChange(item, status) { statusChange(item, status) {
let url let url
if (status) { if (status) {
...@@ -373,207 +412,75 @@ export default { ...@@ -373,207 +412,75 @@ export default {
} else { } else {
url = 'quartzTask/pause' url = 'quartzTask/pause'
} }
axios.get(url, { id: item.id }).then(res => { get(url, { id: item.id }).then(res => {
this.$message.success(res.message) this.$message.success(res.message)
if (res.code === 200) { if (res.code === 200) {
this.$set(item, 'status', status) this.$set(item, 'status', status)
} }
}) })
}, },
// 清除日志
clearLog(taskId) { changeCron(val) {
axios console.log(val)
.get('quartzTask/clearLogs', {
taskId: taskId,
})
.then(res => {
this.$message.success(res.message)
this.getDetail(taskId)
})
},
onCurrentChange(currentPage) {
this.paginationOptions.currentPage = currentPage
this.getList()
},
sizeChange(pageSize) {
this.paginationOptions.pageSize = pageSize
this.getList()
},
cellClass({ row }) {
if (row.authAuditFlag === 1) {
return 'first'
} else {
return ''
}
}, },
selectionChange(selection) { remove(id) {
if (selection.length > 0) { get('quartzTask/delete', { ids: id }).then(res => {
this.select = selection this.$message.success(res.message)
} this.getlist()
})
}, },
search() { search() {
this.paginationOptions.currentPage = 1 this.getlist()
this.getList(1)
}, },
currentTabFn(val) { getlist() {
if (val.row) { post('quartzTask/list', {
this.formId = val.row.id ...this.searchForm,
} }).then(res => {
this.sourceData = res.data
})
}, },
// 修改新增 submit() {
addDialog(i, v = null) { this.$refs.editForm.validate(v => {
if (i === 2) { if (!v) return
if (v) this.formId = v.id const url = this.isEdit
if (!this.formId) { ? 'quartzTask/update'
return this.$message('请勾选至少一条记录') : 'quartzTask/add'
} delete this.editForm.createTime
this.selectSection() delete this.editForm.updateTime
} else { post(url, this.editForm).then(res => {
this.$nextTick(() => { this.$message.success(res.message)
this.addcurrencyform = JSON.parse( this.editVisible = false
JSON.stringify(this.addcurrencyform2), this.getlist()
)
}) })
this.is_title = i })
this.dialogVisible = true
}
if (this.$refs.addcurrencyform) {
this.$refs.addcurrencyform.resetFields()
}
}, },
addCurrency() { async showEdit(item) {
if (this.is_title === 1) { if (item) {
this.addSection() let res
try {
res = await get('quartzTask/get', { id: item.id })
this.editForm = res.data
} catch (error) {
console.log(error)
}
this.isEdit = true
} else { } else {
this.upSection() this.isEdit = false
this.editForm = JSON.parse(this.defaultEditForm)
} }
}, this.editVisible = true
setpaginationOptions(opt) { this.$nextTick(() => {
for (const key in opt) { this.$refs.editForm.clearValidate()
this.paginationOptions[key] = opt[key]
}
this.getList()
},
// 查询
getList() {
this.loading = true
const {
pageSize,
currentPage,
} = this.paginationOptions
axios
.post('platform/exchangeRateCur/list_page ', {
pageSize,
currentPage,
...this.searchForm,
})
.then(res => {
this.loading = false
if (res.code === 200) {
this.sourceData = res.data.records
this.paginationOptions.total = res.data.total
} else {
this.$alert(res.message, '错误提示', {
dangerouslyUseHTMLString: true,
})
}
})
},
// 修改
upSection() {
const url = 'platform/user/update'
this.$refs.addcurrencyform.validate(valid => {
if (valid) {
const data = JSON.parse(
JSON.stringify(this.addcurrencyform),
)
let roleIds = this.addcurrencyform.funcRoleIds.concat(
this.addcurrencyform.dataRoleIds,
)
roleIds = roleIds.join()
data.roleIds = roleIds
axios.post(url, data).then(res => {
if (res.code === 200) {
this.dialogVisible = false
this.$message({
message: '修改成功',
type: 'success',
})
this.getList(
this.paginationOptions.currentPage,
)
} else {
this.$alert(res.message, '错误提示', {
dangerouslyUseHTMLString: true,
})
}
})
}
}) })
}, },
// 新增 typeChange(v) {
addSection() { for (const iterator of this.types) {
const url = 'baseExchangeRateCur/add' if (iterator.value === v) {
this.$refs.addcurrencyform.validate(valid => { this.editForm.taskType = iterator.key
if (valid) { break
const data = JSON.parse(
JSON.stringify(this.addcurrencyform),
)
let roleIds = this.addcurrencyform.funcRoleIds.concat(
this.addcurrencyform.dataRoleIds,
)
roleIds = roleIds.join()
data.roleIds = roleIds
axios.post(url, data).then(res => {
if (res.code === 200) {
this.dialogVisible = false
this.$alert(
'添加成功\n\r 用户密码为:' +
res.data?.passWord || '',
)
this.getList()
} else {
this.$alert(res.message, '错误提示', {
dangerouslyUseHTMLString: true,
})
}
})
} }
}) }
},
// 删除
deleteSection(id) {
axios
.get('quartzTask/delete', { ids: id })
.then(res => {
this.$message.success(res.message)
})
}, },
}, },
} }
</script> </script>
<style scoped>
.wraper {
display: flex;
flex-direction: column;
height: 100%;
}
.table_wrap {
flex: 1;
}
.circle {
display: inline-block;
height: 10px;
width: 10px;
border-radius: 5px;
margin-right: 5px;
}
.my-table >>> .first {
background-color: red !important;
color: #fff !important;
}
</style>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment