Merge pull request #23 from linhaojun857/dev

merge dev
master
花未眠 4 years ago committed by GitHub
commit 249b484ce4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -8,11 +8,9 @@
import { generaMenu } from './assets/js/menu'
export default {
created() {
//
if (this.$store.state.userInfo != null) {
generaMenu()
}
// 访
this.axios.post('/api/report')
}
}

@ -1,177 +1,174 @@
@font-face {
font-family: "iconfont"; /* Project id 1531054 */
src: url('iconfont.eot?t=1642953623912'); /* IE9 */
src: url('iconfont.eot?t=1642953623912#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('iconfont.woff2?t=1642953623912') format('woff2'),
url('iconfont.woff?t=1642953623912') format('woff'),
url('iconfont.ttf?t=1642953623912') format('truetype'),
url('iconfont.svg?t=1642953623912#iconfont') format('svg');
font-family: 'iconfont';
src: url('iconfont.eot?t=1642953623912');
src: url('iconfont.eot?t=1642953623912#iefix') format('embedded-opentype'),
url('iconfont.woff2?t=1642953623912') format('woff2'), url('iconfont.woff?t=1642953623912') format('woff'),
url('iconfont.ttf?t=1642953623912') format('truetype'), url('iconfont.svg?t=1642953623912#iconfont') format('svg');
}
.iconfont {
font-family: "iconfont" !important;
font-family: 'iconfont' !important;
font-style: normal;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.el-icon-myiconfontdongtaidianji:before {
content: "\e62f";
content: '\e62f';
}
.el-icon-myzhiding:before {
content: "\e64a";
content: '\e64a';
}
.el-icon-mypinglun:before {
content: "\e63a";
content: '\e63a';
}
.el-icon-mybiaoqing:before {
content: "\e644";
content: '\e644';
}
.el-icon-mytupian:before {
content: "\e691";
content: '\e691';
}
.el-icon-myfabusekuai:before {
content: "\ec46";
content: '\ec46';
}
.el-icon-mygongkai:before {
content: "\e6a9";
content: '\e6a9';
}
.el-icon-mycaogaoxiang:before {
content: "\e726";
content: '\e726';
}
.el-icon-myyemianpeizhi:before {
content: "\e61f";
content: '\e61f';
}
.el-icon-myjiekouguanli:before {
content: "\e624";
content: '\e624';
}
.el-icon-mydaohanglantubiao_quanxianguanli:before {
content: "\e604";
content: '\e604';
}
.el-icon-myhuishouzhan:before {
content: "\e7f2";
content: '\e7f2';
}
.el-icon-myzhaopian:before {
content: "\e623";
content: '\e623';
}
.el-icon-myFiles-59:before {
content: "\e7f3";
content: '\e7f3';
}
.el-icon-myimage-fill:before {
content: "\eb61";
content: '\eb61';
}
.el-icon-myjiaoseliebiao:before {
content: "\e610";
content: '\e610';
}
.el-icon-mycaozuorizhi:before {
content: "\e7e8";
content: '\e7e8';
}
.el-icon-mycaidan:before {
content: "\e60e";
content: '\e60e';
}
.el-icon-myfabiaowenzhang:before {
content: "\e69e";
content: '\e69e';
}
.el-icon-mywenzhangliebiao:before {
content: "\e62c";
content: '\e62c';
}
.el-icon-myyonghuliebiao:before {
content: "\e613";
content: '\e613';
}
.el-icon-myxiaoxi:before {
content: "\e60d";
content: '\e60d';
}
.el-icon-myliuyan:before {
content: "\e606";
content: '\e606';
}
.el-icon-myfenlei:before {
content: "\e86c";
content: '\e86c';
}
.el-icon-myshouye:before {
content: "\e61e";
content: '\e61e';
}
.el-icon-mywendang:before {
content: "\e622";
content: '\e622';
}
.el-icon-myxitong:before {
content: "\e600";
content: '\e600';
}
.el-icon-mypinglunzu:before {
content: "\e765";
content: '\e765';
}
.el-icon-myshezhi:before {
content: "\e654";
content: '\e654';
}
.el-icon-mydashujukeshihuaico-:before {
content: "\e7ff";
content: '\e7ff';
}
.el-icon-myicontag:before {
content: "\e61d";
content: '\e61d';
}
.el-icon-myliebiao:before {
content: "\e645";
content: '\e645';
}
.el-icon-myuser:before {
content: "\e607";
content: '\e607';
}
.el-icon-myfangwenliang:before {
content: "\e676";
content: '\e676';
}
.el-icon-mymima:before {
content: "\e62e";
content: '\e62e';
}
.el-icon-mytuichu:before {
content: "\e6c2";
content: '\e6c2';
}
.el-icon-myicwindowzoom48px:before {
content: "\e603";
content: '\e603';
}
.el-icon-mydianzan:before {
content: "\e60c";
content: '\e60c';
}
.el-icon-mywenzhang-copy:before {
content: "\e643";
content: '\e643';
}
.el-icon-myguanyuwo:before {
content: "\e62b";
content: '\e62b';
}

@ -3,11 +3,9 @@
<el-form-item>
<el-radio v-model="radioValue" :label="1"> [, - * ? / L W] </el-radio>
</el-form-item>
<el-form-item>
<el-radio v-model="radioValue" :label="2"> </el-radio>
</el-form-item>
<el-form-item>
<el-radio v-model="radioValue" :label="3">
周期从
@ -15,7 +13,6 @@
<el-input-number v-model="cycle02" :min="cycle01 ? cycle01 + 1 : 2" :max="31" />
</el-radio>
</el-form-item>
<el-form-item>
<el-radio v-model="radioValue" :label="4">
@ -23,18 +20,15 @@
<el-input-number v-model="average02" :min="1" :max="31 - average01 || 1" /> 日执行一次
</el-radio>
</el-form-item>
<el-form-item>
<el-radio v-model="radioValue" :label="5">
每月
<el-input-number v-model="workday" :min="1" :max="31" /> 号最近的那个工作日
</el-radio>
</el-form-item>
<el-form-item>
<el-radio v-model="radioValue" :label="6"> </el-radio>
</el-form-item>
<el-form-item>
<el-radio v-model="radioValue" :label="7">
指定
@ -63,7 +57,6 @@ export default {
name: 'crontab-day',
props: ['check', 'cron'],
methods: {
//
radioChange() {
;('day rachange')
if (this.radioValue !== 2 && this.cron.week !== '?') {
@ -95,25 +88,21 @@ export default {
}
;('day rachange end')
},
//
cycleChange() {
if (this.radioValue == '3') {
this.$emit('update', 'day', this.cycleTotal)
}
},
//
averageChange() {
if (this.radioValue == '4') {
this.$emit('update', 'day', this.averageTotal)
}
},
//
workdayChange() {
if (this.radioValue == '5') {
this.$emit('update', 'day', this.workdayCheck + 'W')
}
},
// checkbox
checkboxChange() {
if (this.radioValue == '7') {
this.$emit('update', 'day', this.checkboxString)
@ -128,24 +117,20 @@ export default {
checkboxString: 'checkboxChange'
},
computed: {
//
cycleTotal: function () {
const cycle01 = this.checkNum(this.cycle01, 1, 30)
const cycle02 = this.checkNum(this.cycle02, cycle01 ? cycle01 + 1 : 2, 31, 31)
return cycle01 + '-' + cycle02
},
//
averageTotal: function () {
const average01 = this.checkNum(this.average01, 1, 30)
const average02 = this.checkNum(this.average02, 1, 31 - average01 || 0)
return average01 + '/' + average02
},
//
workdayCheck: function () {
const workday = this.checkNum(this.workday, 1, 31)
return workday
},
// checkbox
checkboxString: function () {
let str = this.checkboxList.join()
return str == '' ? '*' : str

@ -3,7 +3,6 @@
<el-form-item>
<el-radio v-model="radioValue" :label="1"> [, - * /] </el-radio>
</el-form-item>
<el-form-item>
<el-radio v-model="radioValue" :label="2">
周期从
@ -11,7 +10,6 @@
<el-input-number v-model="cycle02" :min="cycle01 ? cycle01 + 1 : 1" :max="23" /> 小时
</el-radio>
</el-form-item>
<el-form-item>
<el-radio v-model="radioValue" :label="3">
@ -19,7 +17,6 @@
<el-input-number v-model="average02" :min="1" :max="23 - average01 || 0" /> 小时执行一次
</el-radio>
</el-form-item>
<el-form-item>
<el-radio v-model="radioValue" :label="4">
指定
@ -47,7 +44,6 @@ export default {
name: 'crontab-hour',
props: ['check', 'cron'],
methods: {
//
radioChange() {
switch (this.radioValue) {
case 1:
@ -64,19 +60,16 @@ export default {
break
}
},
//
cycleChange() {
if (this.radioValue == '2') {
this.$emit('update', 'hour', this.cycleTotal)
}
},
//
averageChange() {
if (this.radioValue == '3') {
this.$emit('update', 'hour', this.averageTotal)
}
},
// checkbox
checkboxChange() {
if (this.radioValue == '4') {
this.$emit('update', 'hour', this.checkboxString)
@ -90,19 +83,16 @@ export default {
checkboxString: 'checkboxChange'
},
computed: {
//
cycleTotal: function () {
const cycle01 = this.checkNum(this.cycle01, 0, 22)
const cycle02 = this.checkNum(this.cycle02, cycle01 ? cycle01 + 1 : 1, 23)
return cycle01 + '-' + cycle02
},
//
averageTotal: function () {
const average01 = this.checkNum(this.average01, 0, 22)
const average02 = this.checkNum(this.average02, 1, 23 - average01 || 0)
return average01 + '/' + average02
},
// checkbox
checkboxString: function () {
let str = this.checkboxList.join()
return str == '' ? '*' : str

@ -1,35 +1,28 @@
<template>
<div>
<el-tabs type="border-card">
<el-tab-pane label="秒" v-if="shouldHide('second')">
<el-tab-pane label="秒">
<CrontabSecond @update="updateCrontabValue" :check="checkNumber" :cron="crontabValueObj" ref="cronsecond" />
</el-tab-pane>
<el-tab-pane label="分钟" v-if="shouldHide('min')">
<el-tab-pane label="分钟">
<CrontabMin @update="updateCrontabValue" :check="checkNumber" :cron="crontabValueObj" ref="cronmin" />
</el-tab-pane>
<el-tab-pane label="小时" v-if="shouldHide('hour')">
<el-tab-pane label="小时">
<CrontabHour @update="updateCrontabValue" :check="checkNumber" :cron="crontabValueObj" ref="cronhour" />
</el-tab-pane>
<el-tab-pane label="日" v-if="shouldHide('day')">
<el-tab-pane label="日">
<CrontabDay @update="updateCrontabValue" :check="checkNumber" :cron="crontabValueObj" ref="cronday" />
</el-tab-pane>
<el-tab-pane label="月" v-if="shouldHide('month')">
<el-tab-pane label="月">
<CrontabMonth @update="updateCrontabValue" :check="checkNumber" :cron="crontabValueObj" ref="cronmonth" />
</el-tab-pane>
<el-tab-pane label="周" v-if="shouldHide('week')">
<el-tab-pane label="周">
<CrontabWeek @update="updateCrontabValue" :check="checkNumber" :cron="crontabValueObj" ref="cronweek" />
</el-tab-pane>
<el-tab-pane label="年" v-if="shouldHide('year')">
<el-tab-pane label="年">
<CrontabYear @update="updateCrontabValue" :check="checkNumber" :cron="crontabValueObj" ref="cronyear" />
</el-tab-pane>
</el-tabs>
<div class="popup-main">
<div class="popup-result">
<table>
@ -66,7 +59,6 @@
</table>
</div>
<CrontabResult :ex="crontabValueString"></CrontabResult>
<div class="pop_btn">
<el-button size="small" type="primary" @click="submitFill"></el-button>
<el-button size="small" type="warning" @click="clearCron"></el-button>
@ -103,19 +95,23 @@ export default {
}
}
},
name: 'vcrontab',
name: 'crontab',
props: ['expression', 'hideComponent'],
components: {
CrontabSecond,
CrontabMin,
CrontabHour,
CrontabDay,
CrontabMonth,
CrontabWeek,
CrontabYear,
CrontabResult
},
methods: {
shouldHide(key) {
if (this.hideComponent && this.hideComponent.includes(key)) return false
return true
},
resolveExp() {
//
if (this.expression) {
let arr = this.expression.split(' ')
if (arr.length >= 6) {
//6
let obj = {
second: arr[0],
min: arr[1],
@ -133,31 +129,24 @@ export default {
}
}
} else {
//
this.clearCron()
}
},
// tab
tabCheck(index) {
this.tabActive = index
},
//
updateCrontabValue(name, value, from) {
'updateCrontabValue', name, value, from
this.crontabValueObj[name] = value
if (from && from !== name) {
console.log(`来自组件 ${from} 改变了 ${name} ${value}`)
this.changeRadio(name, value)
}
},
//
changeRadio(name, value) {
let arr = ['second', 'min', 'hour', 'month'],
refName = 'cron' + name,
insValue
if (!this.$refs[refName]) return
if (arr.includes(name)) {
if (value === '*') {
insValue = 1
@ -239,9 +228,7 @@ export default {
}
this.$refs[refName].radioValue = insValue
},
// -props
checkNumber(value, minLimit, maxLimit) {
//
value = Math.floor(value)
if (value < minLimit) {
value = minLimit
@ -250,18 +237,14 @@ export default {
}
return value
},
//
hidePopup() {
this.$emit('hide')
},
//
submitFill() {
this.$emit('fill', this.crontabValueString)
this.hidePopup()
},
clearCron() {
//
;('准备还原')
this.crontabValueObj = {
second: '*',
min: '*',
@ -295,21 +278,8 @@ export default {
return str
}
},
components: {
CrontabSecond,
CrontabMin,
CrontabHour,
CrontabDay,
CrontabMonth,
CrontabWeek,
CrontabYear,
CrontabResult
},
watch: {
expression: 'resolveExp',
hideComponent(value) {
//
}
expression: 'resolveExp'
},
mounted: function () {
this.resolveExp()

@ -3,7 +3,6 @@
<el-form-item>
<el-radio v-model="radioValue" :label="1"> [, - * /] </el-radio>
</el-form-item>
<el-form-item>
<el-radio v-model="radioValue" :label="2">
周期从
@ -11,7 +10,6 @@
<el-input-number v-model="cycle02" :min="cycle01 ? cycle01 + 1 : 1" :max="59" /> 分钟
</el-radio>
</el-form-item>
<el-form-item>
<el-radio v-model="radioValue" :label="3">
@ -19,7 +17,6 @@
<el-input-number v-model="average02" :min="1" :max="59 - average01 || 0" /> 分钟执行一次
</el-radio>
</el-form-item>
<el-form-item>
<el-radio v-model="radioValue" :label="4">
指定
@ -47,7 +44,6 @@ export default {
name: 'crontab-min',
props: ['check', 'cron'],
methods: {
//
radioChange() {
switch (this.radioValue) {
case 1:
@ -64,19 +60,16 @@ export default {
break
}
},
//
cycleChange() {
if (this.radioValue == '2') {
this.$emit('update', 'min', this.cycleTotal, 'min')
}
},
//
averageChange() {
if (this.radioValue == '3') {
this.$emit('update', 'min', this.averageTotal, 'min')
}
},
// checkbox
checkboxChange() {
if (this.radioValue == '4') {
this.$emit('update', 'min', this.checkboxString, 'min')
@ -90,19 +83,16 @@ export default {
checkboxString: 'checkboxChange'
},
computed: {
//
cycleTotal: function () {
const cycle01 = this.checkNum(this.cycle01, 0, 58)
const cycle02 = this.checkNum(this.cycle02, cycle01 ? cycle01 + 1 : 1, 59)
return cycle01 + '-' + cycle02
},
//
averageTotal: function () {
const average01 = this.checkNum(this.average01, 0, 58)
const average02 = this.checkNum(this.average02, 1, 59 - average01 || 0)
return average01 + '/' + average02
},
// checkbox
checkboxString: function () {
let str = this.checkboxList.join()
return str == '' ? '*' : str

@ -3,7 +3,6 @@
<el-form-item>
<el-radio v-model="radioValue" :label="1"> [, - * /] </el-radio>
</el-form-item>
<el-form-item>
<el-radio v-model="radioValue" :label="2">
周期从
@ -11,7 +10,6 @@
<el-input-number v-model="cycle02" :min="cycle01 ? cycle01 + 1 : 2" :max="12" />
</el-radio>
</el-form-item>
<el-form-item>
<el-radio v-model="radioValue" :label="3">
@ -19,7 +17,6 @@
<el-input-number v-model="average02" :min="1" :max="12 - average01 || 0" /> 月月执行一次
</el-radio>
</el-form-item>
<el-form-item>
<el-radio v-model="radioValue" :label="4">
指定
@ -47,7 +44,6 @@ export default {
name: 'crontab-month',
props: ['check', 'cron'],
methods: {
//
radioChange() {
switch (this.radioValue) {
case 1:
@ -64,19 +60,16 @@ export default {
break
}
},
//
cycleChange() {
if (this.radioValue == '2') {
this.$emit('update', 'month', this.cycleTotal)
}
},
//
averageChange() {
if (this.radioValue == '3') {
this.$emit('update', 'month', this.averageTotal)
}
},
// checkbox
checkboxChange() {
if (this.radioValue == '4') {
this.$emit('update', 'month', this.checkboxString)
@ -90,19 +83,16 @@ export default {
checkboxString: 'checkboxChange'
},
computed: {
//
cycleTotal: function () {
const cycle01 = this.checkNum(this.cycle01, 1, 11)
const cycle02 = this.checkNum(this.cycle02, cycle01 ? cycle01 + 1 : 2, 12)
return cycle01 + '-' + cycle02
},
//
averageTotal: function () {
const average01 = this.checkNum(this.average01, 1, 11)
const average02 = this.checkNum(this.average02, 1, 12 - average01 || 0)
return average01 + '/' + average02
},
// checkbox
checkboxString: function () {
let str = this.checkboxList.join()
return str == '' ? '*' : str

@ -23,17 +23,11 @@ export default {
},
name: 'crontab-result',
methods: {
//
expressionChange() {
// -
this.isShow = false
// [0123456]
let ruleArr = this.$options.propsData.ex.split(' ')
//
let nums = 0
//
let resultArr = []
// []
let nTime = new Date()
let nYear = nTime.getFullYear()
let nMonth = nTime.getMonth() + 1
@ -41,7 +35,6 @@ export default {
let nHour = nTime.getHours()
let nMin = nTime.getMinutes()
let nSecond = nTime.getSeconds()
// 100
this.getSecondArr(ruleArr[0])
this.getMinArr(ruleArr[1])
this.getHourArr(ruleArr[2])
@ -49,21 +42,18 @@ export default {
this.getMonthArr(ruleArr[4])
this.getWeekArr(ruleArr[5])
this.getYearArr(ruleArr[6], nYear)
// -便使
let sDate = this.dateArr[0]
let mDate = this.dateArr[1]
let hDate = this.dateArr[2]
let DDate = this.dateArr[3]
let MDate = this.dateArr[4]
let YDate = this.dateArr[5]
//
let sIdx = this.getIndex(sDate, nSecond)
let mIdx = this.getIndex(mDate, nMin)
let hIdx = this.getIndex(hDate, nHour)
let DIdx = this.getIndex(DDate, nDay)
let MIdx = this.getIndex(MDate, nMonth)
let YIdx = this.getIndex(YDate, nYear)
// ()
const resetSecond = function () {
sIdx = 0
nSecond = sDate[sIdx]
@ -88,41 +78,30 @@ export default {
nMonth = MDate[MIdx]
resetDay()
}
//
if (nYear !== YDate[YIdx]) {
resetMonth()
}
//
if (nMonth !== MDate[MIdx]) {
resetDay()
}
//
if (nDay !== DDate[DIdx]) {
resetHour()
}
//
if (nHour !== hDate[hIdx]) {
resetMin()
}
//
if (nMin !== mDate[mIdx]) {
resetSecond()
}
//
goYear: for (let Yi = YIdx; Yi < YDate.length; Yi++) {
let YY = YDate[Yi]
//
if (nMonth > MDate[MDate.length - 1]) {
resetMonth()
continue
}
//
goMonth: for (let Mi = MIdx; Mi < MDate.length; Mi++) {
// 便
let MM = MDate[Mi]
MM = MM < 10 ? '0' + MM : MM
//
if (nDay > DDate[DDate.length - 1]) {
resetDay()
if (Mi == MDate.length - 1) {
@ -131,13 +110,9 @@ export default {
}
continue
}
//
goDay: for (let Di = DIdx; Di < DDate.length; Di++) {
// 便
let DD = DDate[Di]
let thisDD = DD < 10 ? '0' + DD : DD
//
if (nHour > hDate[hDate.length - 1]) {
resetHour()
if (Di == DDate.length - 1) {
@ -150,8 +125,6 @@ export default {
}
continue
}
//
if (
this.checkDate(YY + '-' + MM + '-' + thisDD + ' 00:00:00') !== true &&
this.dayRule !== 'workDay' &&
@ -161,10 +134,7 @@ export default {
resetDay()
continue goMonth
}
//
if (this.dayRule == 'lastDay') {
//
if (this.checkDate(YY + '-' + MM + '-' + thisDD + ' 00:00:00') !== true) {
while (DD > 0 && this.checkDate(YY + '-' + MM + '-' + thisDD + ' 00:00:00') !== true) {
DD--
@ -173,26 +143,20 @@ export default {
}
}
} else if (this.dayRule == 'workDay') {
// 230
if (this.checkDate(YY + '-' + MM + '-' + thisDD + ' 00:00:00') !== true) {
while (DD > 0 && this.checkDate(YY + '-' + MM + '-' + thisDD + ' 00:00:00') !== true) {
DD--
thisDD = DD < 10 ? '0' + DD : DD
}
}
// X
let thisWeek = this.formatDate(new Date(YY + '-' + MM + '-' + thisDD + ' 00:00:00'), 'week')
//
if (thisWeek == 1) {
//
DD++
thisDD = DD < 10 ? '0' + DD : DD
//
if (this.checkDate(YY + '-' + MM + '-' + thisDD + ' 00:00:00') !== true) {
DD -= 3
}
} else if (thisWeek == 7) {
// 61
if (this.dayRuleSup !== 1) {
DD--
} else {
@ -200,12 +164,8 @@ export default {
}
}
} else if (this.dayRule == 'weekDay') {
//
//
let thisWeek = this.formatDate(new Date(YY + '-' + MM + '-' + DD + ' 00:00:00'), 'week')
// dayRuleSup
if (this.dayRuleSup.indexOf(thisWeek) < 0) {
//
if (Di == DDate.length - 1) {
resetDay()
if (Mi == MDate.length - 1) {
@ -217,8 +177,6 @@ export default {
continue
}
} else if (this.dayRule == 'assWeek') {
//
// 1
let thisWeek = this.formatDate(new Date(YY + '-' + MM + '-' + DD + ' 00:00:00'), 'week')
if (this.dayRuleSup[1] >= thisWeek) {
DD = (this.dayRuleSup[0] - 1) * 7 + this.dayRuleSup[1] - thisWeek + 1
@ -226,31 +184,22 @@ export default {
DD = this.dayRuleSup[0] * 7 + this.dayRuleSup[1] - thisWeek + 1
}
} else if (this.dayRule == 'lastWeek') {
//
// 230
if (this.checkDate(YY + '-' + MM + '-' + thisDD + ' 00:00:00') !== true) {
while (DD > 0 && this.checkDate(YY + '-' + MM + '-' + thisDD + ' 00:00:00') !== true) {
DD--
thisDD = DD < 10 ? '0' + DD : DD
}
}
//
let thisWeek = this.formatDate(new Date(YY + '-' + MM + '-' + thisDD + ' 00:00:00'), 'week')
//
if (this.dayRuleSup < thisWeek) {
DD -= thisWeek - this.dayRuleSup
} else if (this.dayRuleSup > thisWeek) {
DD -= 7 - (this.dayRuleSup - thisWeek)
}
}
// 1005
DD = DD < 10 ? '0' + DD : DD
//
goHour: for (let hi = hIdx; hi < hDate.length; hi++) {
let hh = hDate[hi] < 10 ? '0' + hDate[hi] : hDate[hi]
//
if (nMin > mDate[mDate.length - 1]) {
resetMin()
if (hi == hDate.length - 1) {
@ -267,11 +216,8 @@ export default {
}
continue
}
// ""
goMin: for (let mi = mIdx; mi < mDate.length; mi++) {
let mm = mDate[mi] < 10 ? '0' + mDate[mi] : mDate[mi]
//
if (nSecond > sDate[sDate.length - 1]) {
resetSecond()
if (mi == mDate.length - 1) {
@ -292,17 +238,13 @@ export default {
}
continue
}
// ""
goSecond: for (let si = sIdx; si <= sDate.length - 1; si++) {
let ss = sDate[si] < 10 ? '0' + sDate[si] : sDate[si]
//
if (MM !== '00' && DD !== '00') {
resultArr.push(YY + '-' + MM + '-' + DD + ' ' + hh + ':' + mm + ':' + ss)
nums++
}
// 退
if (nums == 5) break goYear
//
if (si == sDate.length - 1) {
resetSecond()
if (mi == mDate.length - 1) {
@ -323,13 +265,12 @@ export default {
}
continue goMin
}
} //goSecond
} //goMin
} //goHour
} //goDay
} //goMonth
}
}
}
}
}
}
// 100
if (resultArr.length == 0) {
this.resultList = ['没有达到条件的结果!']
} else {
@ -338,10 +279,8 @@ export default {
this.resultList.push('最近100年内只有上面' + resultArr.length + '条结果!')
}
}
// -
this.isShow = true
},
//
getIndex(arr, value) {
if (value <= arr[0] || value > arr[arr.length - 1]) {
return 0
@ -353,7 +292,6 @@ export default {
}
}
},
// ""
getYearArr(rule, year) {
this.dateArr[5] = this.getOrderArr(year, year + 100)
if (rule !== undefined) {
@ -366,7 +304,6 @@ export default {
}
}
},
// ""
getMonthArr(rule) {
this.dateArr[4] = this.getOrderArr(1, 12)
if (rule.indexOf('-') >= 0) {
@ -377,9 +314,7 @@ export default {
this.dateArr[4] = this.getAssignArr(rule)
}
},
// ""-
getWeekArr(rule) {
//
if (this.dayRule == '' && this.dayRuleSup == '') {
if (rule.indexOf('-') >= 0) {
this.dayRule = 'weekDay'
@ -405,7 +340,6 @@ export default {
}
}
},
// ""-
getDayArr(rule) {
this.dateArr[3] = this.getOrderArr(1, 31)
this.dayRule = ''
@ -431,7 +365,6 @@ export default {
this.dayRuleSup = 'null'
}
},
// ""
getHourArr(rule) {
this.dateArr[2] = this.getOrderArr(0, 23)
if (rule.indexOf('-') >= 0) {
@ -442,7 +375,6 @@ export default {
this.dateArr[2] = this.getAssignArr(rule)
}
},
// ""
getMinArr(rule) {
this.dateArr[1] = this.getOrderArr(0, 59)
if (rule.indexOf('-') >= 0) {
@ -453,7 +385,6 @@ export default {
this.dateArr[1] = this.getAssignArr(rule)
}
},
// ""
getSecondArr(rule) {
this.dateArr[0] = this.getOrderArr(0, 59)
if (rule.indexOf('-') >= 0) {
@ -464,7 +395,6 @@ export default {
this.dateArr[0] = this.getAssignArr(rule)
}
},
// min-max
getOrderArr(min, max) {
let arr = []
for (let i = min; i <= max; i++) {
@ -472,7 +402,6 @@ export default {
}
return arr
},
//
getAssignArr(rule) {
let arr = []
let assiginArr = rule.split(',')
@ -482,7 +411,6 @@ export default {
arr.sort(this.compare)
return arr
},
//
getAverageArr(rule, limit) {
let arr = []
let agArr = rule.split('/')
@ -494,9 +422,7 @@ export default {
}
return arr
},
//
getCycleArr(rule, limit, status) {
// status--01
let arr = []
let cycleArr = rule.split('-')
let min = Number(cycleArr[0])
@ -514,7 +440,6 @@ export default {
arr.sort(this.compare)
return arr
},
// Array.sort
compare(value1, value2) {
if (value2 - value1 > 0) {
return -1
@ -522,9 +447,7 @@ export default {
return 1
}
},
// 2017-9-19 18:04:33
formatDate(value, type) {
//
let time = typeof value == 'number' ? new Date(value) : value
let Y = time.getFullYear()
let M = time.getMonth() + 1
@ -533,7 +456,6 @@ export default {
let m = time.getMinutes()
let s = time.getSeconds()
let week = time.getDay()
// type
if (type == undefined) {
return (
Y +
@ -549,11 +471,9 @@ export default {
(s < 10 ? '0' + s : s)
)
} else if (type == 'week') {
// quartz 1
return week + 1
}
},
//
checkDate(value) {
let time = new Date(value)
let format = this.formatDate(time)
@ -565,7 +485,6 @@ export default {
},
props: ['ex'],
mounted: function () {
//
this.expressionChange()
}
}

@ -3,7 +3,6 @@
<el-form-item>
<el-radio v-model="radioValue" :label="1"> [, - * /] </el-radio>
</el-form-item>
<el-form-item>
<el-radio v-model="radioValue" :label="2">
周期从
@ -11,7 +10,6 @@
<el-input-number v-model="cycle02" :min="cycle01 ? cycle01 + 1 : 1" :max="59" />
</el-radio>
</el-form-item>
<el-form-item>
<el-radio v-model="radioValue" :label="3">
@ -19,7 +17,6 @@
<el-input-number v-model="average02" :min="1" :max="59 - average01 || 0" /> 秒执行一次
</el-radio>
</el-form-item>
<el-form-item>
<el-radio v-model="radioValue" :label="4">
指定
@ -47,7 +44,6 @@ export default {
name: 'crontab-second',
props: ['check', 'radioParent'],
methods: {
//
radioChange() {
switch (this.radioValue) {
case 1:
@ -64,19 +60,16 @@ export default {
break
}
},
//
cycleChange() {
if (this.radioValue == '2') {
this.$emit('update', 'second', this.cycleTotal)
}
},
//
averageChange() {
if (this.radioValue == '3') {
this.$emit('update', 'second', this.averageTotal)
}
},
// checkbox
checkboxChange() {
if (this.radioValue == '4') {
this.$emit('update', 'second', this.checkboxString)
@ -93,19 +86,16 @@ export default {
}
},
computed: {
//
cycleTotal: function () {
const cycle01 = this.checkNum(this.cycle01, 0, 58)
const cycle02 = this.checkNum(this.cycle02, cycle01 ? cycle01 + 1 : 1, 59)
return cycle01 + '-' + cycle02
},
//
averageTotal: function () {
const average01 = this.checkNum(this.average01, 0, 58)
const average02 = this.checkNum(this.average02, 1, 59 - average01 || 0)
return average01 + '/' + average02
},
// checkbox
checkboxString: function () {
let str = this.checkboxList.join()
return str == '' ? '*' : str

@ -3,11 +3,9 @@
<el-form-item>
<el-radio v-model="radioValue" :label="1"> [, - * ? / L #] </el-radio>
</el-form-item>
<el-form-item>
<el-radio v-model="radioValue" :label="2"> </el-radio>
</el-form-item>
<el-form-item>
<el-radio v-model="radioValue" :label="3">
周期从星期
@ -34,7 +32,6 @@
</el-select>
</el-radio>
</el-form-item>
<el-form-item>
<el-radio v-model="radioValue" :label="4">
@ -46,7 +43,6 @@
</el-select>
</el-radio>
</el-form-item>
<el-form-item>
<el-radio v-model="radioValue" :label="5">
本月最后一个星期
@ -57,7 +53,6 @@
</el-select>
</el-radio>
</el-form-item>
<el-form-item>
<el-radio v-model="radioValue" :label="6">
指定
@ -118,7 +113,6 @@ export default {
name: 'crontab-week',
props: ['check', 'cron'],
methods: {
//
radioChange() {
if (this.radioValue !== 2 && this.cron.day !== '?') {
this.$emit('update', 'day', '?', 'week')
@ -145,25 +139,21 @@ export default {
}
},
//
cycleChange() {
if (this.radioValue == '3') {
this.$emit('update', 'week', this.cycleTotal)
}
},
//
averageChange() {
if (this.radioValue == '4') {
this.$emit('update', 'week', this.averageTotal)
}
},
//
weekdayChange() {
if (this.radioValue == '5') {
this.$emit('update', 'week', this.weekday + 'L')
}
},
// checkbox
checkboxChange() {
if (this.radioValue == '6') {
this.$emit('update', 'week', this.checkboxString)
@ -178,24 +168,20 @@ export default {
checkboxString: 'checkboxChange'
},
computed: {
//
cycleTotal: function () {
this.cycle01 = this.checkNum(this.cycle01, 1, 7)
this.cycle02 = this.checkNum(this.cycle02, 1, 7)
return this.cycle01 + '-' + this.cycle02
},
//
averageTotal: function () {
this.average01 = this.checkNum(this.average01, 1, 4)
this.average02 = this.checkNum(this.average02, 1, 7)
return this.average02 + '#' + this.average01
},
//
weekdayCheck: function () {
this.weekday = this.checkNum(this.weekday, 1, 7)
return this.weekday
},
// checkbox
checkboxString: function () {
let str = this.checkboxList.join()
return str == '' ? '*' : str

@ -3,11 +3,9 @@
<el-form-item>
<el-radio :label="1" v-model="radioValue"> [, - * /] </el-radio>
</el-form-item>
<el-form-item>
<el-radio :label="2" v-model="radioValue"> </el-radio>
</el-form-item>
<el-form-item>
<el-radio :label="3" v-model="radioValue">
周期从
@ -15,7 +13,6 @@
<el-input-number v-model="cycle02" :min="cycle01 ? cycle01 + 1 : fullYear + 1" :max="2099" />
</el-radio>
</el-form-item>
<el-form-item>
<el-radio :label="4" v-model="radioValue">
@ -23,7 +20,6 @@
<el-input-number v-model="average02" :min="1" :max="2099 - average01 || fullYear" /> 年执行一次
</el-radio>
</el-form-item>
<el-form-item>
<el-radio :label="5" v-model="radioValue">
指定
@ -52,7 +48,6 @@ export default {
name: 'crontab-year',
props: ['check', 'month', 'cron'],
methods: {
//
radioChange() {
switch (this.radioValue) {
case 1:
@ -72,19 +67,16 @@ export default {
break
}
},
//
cycleChange() {
if (this.radioValue == '3') {
this.$emit('update', 'year', this.cycleTotal)
}
},
//
averageChange() {
if (this.radioValue == '4') {
this.$emit('update', 'year', this.averageTotal)
}
},
// checkbox
checkboxChange() {
if (this.radioValue == '5') {
this.$emit('update', 'year', this.checkboxString)
@ -98,26 +90,22 @@ export default {
checkboxString: 'checkboxChange'
},
computed: {
//
cycleTotal: function () {
const cycle01 = this.checkNum(this.cycle01, this.fullYear, 2098)
const cycle02 = this.checkNum(this.cycle02, cycle01 ? cycle01 + 1 : this.fullYear + 1, 2099)
return cycle01 + '-' + cycle02
},
//
averageTotal: function () {
const average01 = this.checkNum(this.average01, this.fullYear, 2098)
const average02 = this.checkNum(this.average02, 1, 2099 - average01 || this.fullYear)
return average01 + '/' + average02
},
// checkbox
checkboxString: function () {
let str = this.checkboxList.join()
return str
}
},
mounted: function () {
//
this.fullYear = Number(new Date().getFullYear())
this.cycle01 = this.fullYear
this.average01 = this.fullYear

@ -1,6 +1,3 @@
/* eslint-disable no-redeclare */
/* eslint-disable no-unused-vars */
/* eslint-disable no-undef */
!(function (t, e) {
'object' == typeof exports && 'object' == typeof module
? (module.exports = e())

@ -1,25 +1,19 @@
<template>
<div>
<!-- 导航栏 -->
<div class="nav-bar">
<!-- 折叠按钮 -->
<div class="hambuger-container" @click="trigger">
<i :class="isFold" />
</div>
<!-- 面包屑导航 -->
<el-breadcrumb>
<el-breadcrumb-item v-for="item of breadcrumbs" :key="item.path">
<span v-if="item.redirect">{{ item.name }}</span>
<router-link v-else :to="item.path">{{ item.name }}</router-link>
</el-breadcrumb-item>
</el-breadcrumb>
<!-- 右侧菜单 -->
<div class="right-menu">
<!-- 全屏按钮 -->
<div class="screen-full" @click="fullScreen">
<i class="iconfont el-icon-myicwindowzoom48px" />
</div>
<!-- 用户选项 -->
<el-dropdown @command="handleCommand">
<el-avatar :size="40" :src="this.$store.state.userInfo.avatar" />
<i class="el-icon-caret-bottom" />
@ -32,7 +26,6 @@
</el-dropdown>
</div>
</div>
<!-- 历史标签栏 -->
<div class="tabs-view-container">
<div class="tabs-wrapper">
<span :class="isActive(item)" v-for="item of this.$store.state.tabList" :key="item.path" @click="goTo(item)">
@ -49,14 +42,12 @@
import { resetRouter } from '../../router'
export default {
created() {
//
let matched = this.$route.matched.filter((item) => item.name)
const first = matched[0]
if (first && first.name !== '首页') {
matched = [{ path: '/', name: '首页' }].concat(matched)
}
this.breadcrumbs = matched
//
this.$store.commit('saveTab', this.$route)
},
data: function () {
@ -68,13 +59,10 @@ export default {
},
methods: {
goTo(tab) {
//
this.$router.push({ path: tab.path })
},
removeTab(tab) {
//
this.$store.commit('removeTab', tab)
//
if (tab.path == this.$route.path) {
var tabList = this.$store.state.tabList
this.$router.push({ path: tabList[tabList.length - 1].path })
@ -88,12 +76,9 @@ export default {
this.$router.push({ path: '/setting' })
}
if (command == 'logout') {
//
this.axios.post('/api/users/logout').then(({ data }) => {
//
this.$store.commit('logout')
this.$store.commit('resetTab')
//
resetRouter()
this.$router.push({ path: '/login' })
})
@ -130,7 +115,6 @@ export default {
}
},
computed: {
//
isActive() {
return function (tab) {
if (tab.path == this.$route.path) {

@ -9,15 +9,12 @@
text-color="#BFCBD9"
active-text-color="#409EFF">
<template v-for="route of this.$store.state.userMenus">
<!-- 二级菜单 -->
<template v-if="route.name && route.children && !route.hidden">
<el-submenu :key="route.path" :index="route.path">
<!-- 二级菜单标题 -->
<template slot="title">
<i :class="route.icon" />
<span>{{ route.name }}</span>
</template>
<!-- 二级菜单选项 -->
<template v-for="(item, index) of route.children">
<el-menu-item v-if="!item.hidden" :key="index" :index="item.path">
<i :class="item.icon" />
@ -26,7 +23,6 @@
</template>
</el-submenu>
</template>
<!-- 一级菜单 -->
<template v-else-if="!route.hidden">
<el-menu-item :index="route.path" :key="route.path">
<i :class="route.children[0].icon" />

@ -1,15 +1,12 @@
<template>
<el-container>
<!-- 侧边栏 -->
<el-aside width="auto">
<SideBar />
</el-aside>
<el-container :class="'main-container ' + isHide">
<!-- 导航栏 -->
<el-header height="84px" style="padding: 0">
<NavBar :key="$route.fullPath" />
</el-header>
<!-- 内容 -->
<el-main style="background: #f7f9fb">
<div class="fade-transform-box">
<transition name="fade-transform" mode="out-in">

@ -1,31 +0,0 @@
export default {
// 设置带过期时间的storage
setExpire: (key, value, expire) => {
let obj = {
data: value,
time: Date.now(),
expire: expire
}
//localStorage 设置的值不能为对象,转为json字符串
window['localStorage'].setItem(key, JSON.stringify(obj))
},
// 获取带过期时间的storage
getExpire: (key) => {
let val = window['localStorage'].getItem(key)
val = JSON.parse(val)
// storage不存在 或者不是一个对象
if (!val || Object.prototype.toString.call(val) !== '[object Object]') {
return val
}
// 未设置过期时间 则永久有效 直接返回
if (!val.expire) {
return val.data
}
// 判断是否过期
if (Date.now() - val.time > val.expire) {
window['localStorage'].removeItem(key)
return null
}
return val.data
}
}

@ -35,7 +35,6 @@ export default {
this.$refs.md.$img2Url(pos, data.data)
})
} else {
// 200KB,200,
imageConversion.compressAccurately(file, this.config.UPLOAD_SIZE).then((res) => {
formdata.append('file', new window.File([res], file.name, { type: file.type }))
this.axios.post('/api/admin/articles/images', formdata).then(({ data }) => {

@ -1,7 +1,6 @@
<template>
<el-card class="main-card">
<div class="title">{{ this.$route.name }}</div>
<!-- 文章标题 -->
<div class="article-title-container">
<el-input v-model="article.articleTitle" size="medium" placeholder="输入文章标题" />
<el-button
@ -14,14 +13,10 @@
</el-button>
<el-button type="danger" size="medium" @click="openModel" style="margin-left: 10px"> 发布文章 </el-button>
</div>
<!-- 文章内容 -->
<mavon-editor ref="md" v-model="article.articleContent" @imgAdd="uploadImg" style="height: calc(100vh - 260px)" />
<!-- 添加文章对话框 -->
<el-dialog :visible.sync="addOrEdit" width="40%" top="3vh">
<div class="dialog-title-container" slot="title">发布文章</div>
<!-- 文章数据 -->
<el-form label-width="80px" size="medium" :model="article">
<!-- 文章分类 -->
<el-form-item label="文章分类">
<el-tag
type="success"
@ -31,10 +26,8 @@
@close="removeCategory">
{{ article.categoryName }}
</el-tag>
<!-- 分类选项 -->
<el-popover placement="bottom-start" width="460" trigger="click" v-if="!article.categoryName">
<div class="popover-title">分类</div>
<!-- 搜索框 -->
<el-autocomplete
style="width: 100%"
v-model="categoryName"
@ -47,7 +40,6 @@
<div>{{ item.categoryName }}</div>
</template>
</el-autocomplete>
<!-- 分类 -->
<div class="popover-container">
<div v-for="item of categorys" :key="item.id" class="category-item" @click="addCategory(item)">
{{ item.categoryName }}
@ -56,7 +48,6 @@
<el-button type="success" plain slot="reference" size="small"> 添加分类 </el-button>
</el-popover>
</el-form-item>
<!-- 文章标签 -->
<el-form-item label="文章标签">
<el-tag
v-for="(item, index) of article.tagNames"
@ -66,10 +57,8 @@
@close="removeTag(item)">
{{ item }}
</el-tag>
<!-- 标签选项 -->
<el-popover placement="bottom-start" width="460" trigger="click" v-if="article.tagNames.length < 3">
<div class="popover-title">标签</div>
<!-- 搜索框 -->
<el-autocomplete
style="width: 100%"
v-model="tagName"
@ -82,7 +71,6 @@
<div>{{ item.tagName }}</div>
</template>
</el-autocomplete>
<!-- 标签 -->
<div class="popover-container">
<div style="margin-bottom: 1rem">添加标签</div>
<el-tag v-for="(item, index) of tagList" :key="index" :class="tagClass(item)" @click="addTag(item)">
@ -97,7 +85,6 @@
<el-option v-for="item in typeList" :key="item.type" :label="item.desc" :value="item.type" />
</el-select>
</el-form-item>
<!-- 文章类型 -->
<el-form-item label="原文地址" v-if="article.type != 1">
<el-input v-model="article.originalUrl" placeholder="请填写原文链接" />
</el-form-item>
@ -168,7 +155,6 @@ export default {
}
},
destroyed() {
//
this.autoSaveArticle()
},
data: function () {
@ -239,7 +225,6 @@ export default {
if (file.size / 1024 < this.config.UPLOAD_SIZE) {
resolve(file)
}
// 200KB,200,
imageConversion.compressAccurately(file, this.config.UPLOAD_SIZE).then((res) => {
resolve(res)
})
@ -253,7 +238,6 @@ export default {
this.$refs.md.$img2Url(pos, data.data)
})
} else {
// 200KB,200,
imageConversion.compressAccurately(file, this.config.UPLOAD_SIZE).then((res) => {
formdata.append('file', new window.File([res], file.name, { type: file.type }))
this.axios.post('/api/admin/articles/images', formdata).then(({ data }) => {
@ -292,8 +276,6 @@ export default {
})
}
})
//
this.autoSave = false
},
saveOrUpdateArticle() {
@ -338,11 +320,9 @@ export default {
}
this.addOrEdit = false
})
//
this.autoSave = false
},
autoSaveArticle() {
//
if (
this.autoSave &&
this.article.articleTitle.trim() != '' &&
@ -363,7 +343,6 @@ export default {
}
})
}
//
if (this.autoSave && this.article.id == null) {
sessionStorage.setItem('article', JSON.stringify(this.article))
}

@ -1,7 +1,6 @@
<template>
<el-card class="main-card">
<div class="title">{{ this.$route.name }}</div>
<!-- 文章状态 -->
<div class="article-status-menu">
<span>状态</span>
<span @click="changeStatus('all')" :class="isActive('all')">全部</span>
@ -10,7 +9,6 @@
<span @click="changeStatus('draft')" :class="isActive('draft')"> 草稿箱 </span>
<span @click="changeStatus('delete')" :class="isActive('delete')"> 回收站 </span>
</div>
<!-- 表格操作 -->
<div class="operation-container">
<el-button
v-if="isDelete == 0"
@ -48,9 +46,7 @@
:on-success="uploadArticle">
<el-button type="primary" size="small" icon="el-icon-upload"> 批量导入 </el-button>
</el-upload>
<!-- 条件筛选 -->
<div style="margin-left: auto">
<!-- 文章类型 -->
<el-select
clearable
v-model="type"
@ -60,7 +56,6 @@
<el-option label="全部" value="" />
<el-option v-for="item in types" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
<!-- 分类 -->
<el-select
clearable
size="small"
@ -71,7 +66,6 @@
<el-option label="全部" value="" />
<el-option v-for="item in categories" :key="item.id" :label="item.categoryName" :value="item.id" />
</el-select>
<!-- 标签 -->
<el-select
clearable
size="small"
@ -82,7 +76,6 @@
<el-option label="全部" value="" />
<el-option v-for="item in tags" :key="item.id" :label="item.tagName" :value="item.id" />
</el-select>
<!-- 文章名 -->
<el-input
clearable
v-model="keywords"
@ -96,11 +89,8 @@
</el-button>
</div>
</div>
<!-- 表格展示 -->
<el-table border :data="articles" @selection-change="selectionChange" v-loading="loading">
<!-- 表格列 -->
<el-table-column type="selection" width="55" />
<!-- 文章修改时间 -->
<el-table-column prop="articleCover" label="文章封面" width="180" align="center">
<template slot-scope="scope">
<el-image
@ -115,11 +105,8 @@
<i v-if="scope.row.status == 3" class="iconfont el-icon-mycaogaoxiang article-status-icon" />
</template>
</el-table-column>
<!-- 文章标题 -->
<el-table-column prop="articleTitle" label="标题" align="center" />
<!-- 文章分类 -->
<el-table-column prop="categoryName" label="分类" width="110" align="center" />
<!-- 文章标签 -->
<el-table-column prop="tagDTOs" label="标签" width="170" align="center">
<template slot-scope="scope">
<el-tag v-for="item of scope.row.tagDTOs" :key="item.tagId" style="margin-right: 0.2rem; margin-top: 0.2rem">
@ -127,7 +114,6 @@
</el-tag>
</template>
</el-table-column>
<!-- 文章浏览量 -->
<el-table-column prop="viewsCount" label="浏览量" width="70" align="center">
<template slot-scope="scope">
<span v-if="scope.row.viewsCount">
@ -136,7 +122,6 @@
<span v-else>0</span>
</template>
</el-table-column>
<!-- 文章类型 -->
<el-table-column prop="type" label="类型" width="80" align="center">
<template slot-scope="scope">
<el-tag :type="articleType(scope.row.type).tagType">
@ -144,14 +129,12 @@
</el-tag>
</template>
</el-table-column>
<!-- 文章发表时间 -->
<el-table-column prop="createTime" label="发表时间" width="130" align="center">
<template slot-scope="scope">
<i class="el-icon-time" style="margin-right: 5px" />
{{ scope.row.createTime | date }}
</template>
</el-table-column>
<!-- 文章置顶 -->
<el-table-column prop="isTop" label="置顶" width="80" align="center">
<template slot-scope="scope">
<el-switch
@ -176,7 +159,6 @@
@change="changeTopAndFeatured(scope.row)" />
</template>
</el-table-column>
<!-- 列操作 -->
<el-table-column label="操作" align="center" width="150">
<template slot-scope="scope">
<el-button type="primary" size="mini" @click="editArticle(scope.row.id)" v-if="scope.row.isDelete == 0">
@ -205,7 +187,6 @@
</template>
</el-table-column>
</el-table>
<!-- 分页 -->
<el-pagination
class="pagination-container"
background
@ -216,7 +197,6 @@
:total="count"
:page-sizes="[10, 20]"
layout="total, sizes, prev, pager, next, jumper" />
<!-- 批量逻辑删除对话框 -->
<el-dialog :visible.sync="updateIsDelete" width="30%">
<div class="dialog-title-container" slot="title"><i class="el-icon-warning" style="color: #ff9900" />提示</div>
<div style="font-size: 1rem">是否删除选中项</div>
@ -225,7 +205,6 @@
<el-button type="primary" @click="updateArticleDelete(null)"> </el-button>
</div>
</el-dialog>
<!-- 批量彻底删除对话框 -->
<el-dialog :visible.sync="remove" width="30%">
<div class="dialog-title-container" slot="title"><i class="el-icon-warning" style="color: #ff9900" />提示</div>
<div style="font-size: 1rem">是否彻底删除选中项</div>
@ -234,7 +213,6 @@
<el-button type="primary" @click="deleteArticles(null)"> </el-button>
</div>
</el-dialog>
<!-- 批量导出对话框 -->
<el-dialog :visible.sync="isExport" width="30%">
<div class="dialog-title-container" slot="title"><i class="el-icon-warning" style="color: #ff9900" />提示</div>
<div style="font-size: 1rem">是否导出选中文章</div>

@ -1,7 +1,6 @@
<template>
<el-card class="main-card">
<div class="title">{{ this.$route.name }}</div>
<!-- 表格操作 -->
<div class="operation-container">
<el-button type="primary" size="small" icon="el-icon-plus" @click="openModel(null)"> </el-button>
<el-button
@ -30,22 +29,16 @@
</el-button>
</div>
</div>
<!-- 表格展示 -->
<el-table border :data="categories" @selection-change="selectionChange" v-loading="loading">
<!-- 表格列 -->
<el-table-column type="selection" width="55" />
<!-- 分类名 -->
<el-table-column prop="categoryName" label="分类名" align="center" />
<!-- 文章量 -->
<el-table-column prop="articleCount" label="文章量" align="center" />
<!-- 分类创建时间 -->
<el-table-column prop="createTime" label="创建时间" align="center">
<template slot-scope="scope">
<i class="el-icon-time" style="margin-right: 5px" />
{{ scope.row.createTime | date }}
</template>
</el-table-column>
<!-- 列操作 -->
<el-table-column label="操作" width="160" align="center">
<template slot-scope="scope">
<el-button type="primary" size="mini" @click="openModel(scope.row)"> </el-button>
@ -55,7 +48,6 @@
</template>
</el-table-column>
</el-table>
<!-- 分页 -->
<el-pagination
class="pagination-container"
background
@ -66,7 +58,6 @@
:total="count"
:page-sizes="[10, 20]"
layout="total, sizes, prev, pager, next, jumper" />
<!-- 批量删除对话框 -->
<el-dialog :visible.sync="isDelete" width="30%">
<div class="dialog-title-container" slot="title"><i class="el-icon-warning" style="color: #ff9900" />提示</div>
<div style="font-size: 1rem">是否删除选中项</div>
@ -75,7 +66,6 @@
<el-button type="primary" @click="deleteCategory(null)"> </el-button>
</div>
</el-dialog>
<!-- 添加编辑对话框 -->
<el-dialog :visible.sync="addOrEdit" width="30%">
<div class="dialog-title-container" slot="title" ref="categoryTitle" />
<el-form label-width="80px" size="medium" :model="categoryForm">

@ -7,7 +7,6 @@
<span @click="changeReview(1)" :class="isReview == 1 ? 'active-review' : 'review'"> 正常 </span>
<span @click="changeReview(0)" :class="isReview == 0 ? 'active-review' : 'review'"> 审核中 </span>
</div>
<!-- 表格操作 -->
<div class="operation-container">
<el-button
type="danger"
@ -25,7 +24,6 @@
@click="updateCommentReview(null)">
批量通过
</el-button>
<!-- 数据筛选 -->
<div style="margin-left: auto">
<el-select clearable v-model="type" placeholder="请选择来源" size="small" style="margin-right: 1rem">
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
@ -42,18 +40,14 @@
</el-button>
</div>
</div>
<!-- 表格展示 -->
<el-table border :data="comments" @selection-change="selectionChange" v-loading="loading">
<!-- 表格列 -->
<el-table-column type="selection" width="55" />
<el-table-column prop="avatar" label="头像" align="center" width="120">
<template slot-scope="scope">
<img :src="scope.row.avatar" width="40" height="40" />
</template>
</el-table-column>
<!-- 评论人昵称 -->
<el-table-column prop="nickname" label="评论人" align="center" width="120" />
<!-- 回复人昵称 -->
<el-table-column prop="replyNickname" label="回复人" align="center" width="120">
<template slot-scope="scope">
<span v-if="scope.row.replyNickname">
@ -62,7 +56,6 @@
<span v-else></span>
</template>
</el-table-column>
<!-- 评论文章标题 -->
<el-table-column prop="articleTitle" label="文章标题" align="center">
<template slot-scope="scope">
<span v-if="scope.row.articleTitle">
@ -71,27 +64,23 @@
<span v-else></span>
</template>
</el-table-column>
<!-- 评论内容 -->
<el-table-column prop="commentContent" label="评论内容" align="center">
<template slot-scope="scope">
<span v-html="scope.row.commentContent" class="comment-content" />
</template>
</el-table-column>
<!-- 评论时间 -->
<el-table-column prop="createTime" label="评论时间" width="150" align="center">
<template slot-scope="scope">
<i class="el-icon-time" style="margin-right: 5px" />
{{ scope.row.createTime | date }}
</template>
</el-table-column>
<!-- 状态 -->
<el-table-column prop="isReview" label="状态" width="80" align="center">
<template slot-scope="scope">
<el-tag v-if="scope.row.isReview == 0" type="warning"></el-tag>
<el-tag v-if="scope.row.isReview == 1" type="success"></el-tag>
</template>
</el-table-column>
<!-- 来源 -->
<el-table-column label="来源" align="center" width="100">
<template slot-scope="scope">
<el-tag v-if="scope.row.type == 1"></el-tag>
@ -101,7 +90,6 @@
<el-tag v-if="scope.row.type == 5" type="warning"></el-tag>
</template>
</el-table-column>
<!-- 列操作 -->
<el-table-column label="操作" width="160" align="center">
<template slot-scope="scope">
<el-button
@ -118,7 +106,6 @@
</template>
</el-table-column>
</el-table>
<!-- 分页 -->
<el-pagination
class="pagination-container"
background
@ -129,7 +116,6 @@
:total="count"
:page-sizes="[10, 20]"
layout="total, sizes, prev, pager, next, jumper" />
<!-- 批量彻底删除对话框 -->
<el-dialog :visible.sync="remove" width="30%">
<div class="dialog-title-container" slot="title"><i class="el-icon-warning" style="color: #ff9900" />提示</div>
<div style="font-size: 1rem">是否彻底删除选中项</div>

@ -1,7 +1,6 @@
<template>
<el-card class="main-card">
<div class="title">{{ this.$route.name }}</div>
<!-- 表格操作 -->
<div class="operation-container">
<el-button type="primary" size="small" icon="el-icon-plus" @click="openModel(null)"> </el-button>
<el-button
@ -12,7 +11,6 @@
@click="deleteFlag = true">
批量删除
</el-button>
<!-- 条件筛选 -->
<div style="margin-left: auto">
<el-input
v-model="keywords"
@ -26,9 +24,7 @@
</el-button>
</div>
</div>
<!-- 表格展示 -->
<el-table border :data="linkList" @selection-change="selectionChange" v-loading="loading">
<!-- 表格列 -->
<el-table-column type="selection" width="55" />
<el-table-column prop="linkAvatar" label="链接头像" align="center" width="180">
<template slot-scope="scope">
@ -44,7 +40,6 @@
{{ scope.row.createTime | date }}
</template>
</el-table-column>
<!-- 列操作 -->
<el-table-column label="操作" align="center" width="160">
<template slot-scope="scope">
<el-button type="primary" size="mini" @click="openModel(scope.row)"> </el-button>
@ -54,7 +49,6 @@
</template>
</el-table-column>
</el-table>
<!-- 分页 -->
<el-pagination
class="pagination-container"
background
@ -65,7 +59,6 @@
:total="count"
:page-sizes="[10, 20]"
layout="total, sizes, prev, pager, next, jumper" />
<!-- 批量删除对话框 -->
<el-dialog :visible.sync="deleteFlag" width="30%">
<div class="dialog-title-container" slot="title"><i class="el-icon-warning" style="color: #ff9900" />提示</div>
<div style="font-size: 1rem">是否删除选中项</div>
@ -74,7 +67,6 @@
<el-button type="primary" @click="deleteLink(null)"> </el-button>
</div>
</el-dialog>
<!-- 添加对话框 -->
<el-dialog :visible.sync="addOrEdit" width="30%">
<div class="dialog-title-container" slot="title" ref="linkTitle" />
<el-form label-width="80px" size="medium" :model="linkForm">

@ -1,6 +1,5 @@
<template>
<div>
<!-- 统计数据 -->
<el-row :gutter="30">
<el-col :span="6">
<el-card>
@ -47,14 +46,12 @@
</el-card>
</el-col>
</el-row>
<!-- 一周访问量展示 -->
<el-card style="margin-top: 1.25rem">
<div class="e-title">一周访问量</div>
<div style="height: 350px">
<v-chart :options="viewCount" v-loading="loading" />
</div>
</el-card>
<!-- 文章贡献统计 -->
<el-card style="margin-top: 1.25rem">
<div class="e-title">文章贡献统计</div>
<div v-loading="loading">
@ -62,7 +59,6 @@
</div>
</el-card>
<el-row :gutter="20" style="margin-top: 1.25rem">
<!-- 文章浏览量排行 -->
<el-col :span="16">
<el-card>
<div class="e-title">文章浏览量排行</div>
@ -71,7 +67,6 @@
</div>
</el-card>
</el-col>
<!-- 分类数据统计 -->
<el-col :span="8">
<el-card>
<div class="e-title">文章分类统计</div>
@ -82,7 +77,6 @@
</el-col>
</el-row>
<el-row :gutter="20" style="margin-top: 1.25rem">
<!-- 用户地域分布 -->
<el-col :span="16">
<el-card>
<div class="e-title">用户地域分布</div>
@ -97,7 +91,6 @@
</div>
</el-card>
</el-col>
<!-- 文章标签统计 -->
<el-col :span="8">
<el-card>
<div class="e-title">文章标签统计</div>
@ -149,7 +142,6 @@ export default {
data: [],
axisLine: {
lineStyle: {
// x
color: '#666'
}
}
@ -157,7 +149,6 @@ export default {
yAxis: {
axisLine: {
lineStyle: {
// y
color: '#048CCE'
}
}
@ -259,14 +250,7 @@ export default {
geo: {
map: 'china',
zoom: 1.2,
layoutCenter: ['50%', '50%'], //
// label: {
// normal: {
// show: !0,
// fontSize: "12",
// color: "rgba(0,0,0,0.7)"
// }
// },
layoutCenter: ['50%', '50%'],
itemStyle: {
normal: {
borderColor: 'rgba(0, 0, 0, 0.2)'

@ -1,6 +1,5 @@
<template>
<el-card class="main-card">
<!-- 标题 -->
<div class="title">{{ this.$route.name }}</div>
<div class="operation-container">
<el-button
@ -11,7 +10,6 @@
@click="isDelete = true">
批量删除
</el-button>
<!-- 数据筛选 -->
<div style="margin-left: auto">
<el-input
v-model="keywords"
@ -25,7 +23,6 @@
</el-button>
</div>
</div>
<!-- 权限列表 -->
<el-table @selection-change="selectionChange" v-loading="loading" :data="logs">
<el-table-column type="selection" width="55" align="center" />
<el-table-column prop="optModule" label="系统模块" align="center" width="120" />
@ -58,7 +55,6 @@
</template>
</el-table-column>
</el-table>
<!-- 分页 -->
<el-pagination
class="pagination-container"
background
@ -69,10 +65,8 @@
:total="count"
:page-sizes="[10, 20]"
layout="total, sizes, prev, pager, next, jumper" />
<!-- 查看模态框 -->
<el-dialog :visible.sync="isCheck" width="40%">
<div class="dialog-title-container" slot="title"><i class="el-icon-more" />详细信息</div>
<el-form ref="form" :model="optLog" label-width="100px" size="mini">
<el-form-item label="操作模块:">
{{ optLog.optModule }}
@ -99,7 +93,6 @@
</el-form-item>
</el-form>
</el-dialog>
<!-- 批量删除对话框 -->
<el-dialog :visible.sync="isDelete" width="30%">
<div class="dialog-title-container" slot="title"><i class="el-icon-warning" style="color: #ff9900" />提示</div>
<div style="font-size: 1rem">是否删除选中项</div>

@ -2,9 +2,7 @@
<div class="login-container">
<div class="login-card">
<div class="login-title">管理员登录</div>
<!-- 登录表单 -->
<el-form status-icon :model="loginForm" :rules="rules" ref="ruleForm" class="login-form">
<!-- 用户名输入框 -->
<el-form-item prop="username">
<el-input
v-model="loginForm.username"
@ -12,7 +10,6 @@
placeholder="用户名"
@keyup.enter.native="login" />
</el-form-item>
<!-- 密码输入框 -->
<el-form-item prop="password">
<el-input
v-model="loginForm.password"
@ -22,7 +19,6 @@
@keyup.enter.native="login" />
</el-form-item>
</el-form>
<!-- 登录按钮 -->
<el-button type="primary" @click="login"></el-button>
</div>
</div>
@ -50,15 +46,12 @@ export default {
const that = this
var captcha = new TencentCaptcha(this.config.TENCENT_CAPTCHA, function (res) {
if (res.ret === 0) {
//
let param = new URLSearchParams()
param.append('username', that.loginForm.username)
param.append('password', that.loginForm.password)
that.axios.post('/api/users/login', param).then(({ data }) => {
if (data.flag) {
//
that.$store.commit('login', data.data)
//
generaMenu()
that.$message.success('登录成功')
that.$router.push({ path: '/' })
@ -86,7 +79,8 @@ export default {
bottom: 0;
right: 0;
left: 0;
background: url(https://static.linhaojun.top/photos/765664a8a75211296a9cd89671d6d660.png) center center / cover no-repeat;
background: url(https://static.linhaojun.top/photos/765664a8a75211296a9cd89671d6d660.png) center center / cover
no-repeat;
}
.login-card {
position: absolute;

@ -1,10 +1,8 @@
<template>
<el-card class="main-card">
<!-- 标题 -->
<div class="title">{{ this.$route.name }}</div>
<div class="operation-container">
<el-button type="primary" size="small" icon="el-icon-plus" @click="openModel(null)"> </el-button>
<!-- 数据筛选 -->
<div style="margin-left: auto">
<el-input
v-model="keywords"
@ -18,27 +16,20 @@
</el-button>
</div>
</div>
<!-- 权限列表 -->
<el-table
v-loading="loading"
:data="menus"
row-key="id"
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }">
<!-- 菜单名称 -->
<el-table-column prop="name" label="菜单名称" width="140" />
<!-- 菜单icon -->
<el-table-column prop="icon" align="center" label="图标" width="100">
<template slot-scope="scope">
<i :class="'iconfont ' + scope.row.icon" />
</template>
</el-table-column>
<!-- 菜单排序 -->
<el-table-column prop="orderNum" align="center" label="排序" width="100" />
<!-- 访问路径 -->
<el-table-column prop="path" label="访问路径" />
<!-- 组件路径 -->
<el-table-column prop="component" label="组件路径" />
<!-- 是否隐藏 -->
<el-table-column prop="isHidden" label="隐藏" align="center" width="80">
<template slot-scope="scope">
<el-switch
@ -50,14 +41,12 @@
@change="changeDisable(scope.row)" />
</template>
</el-table-column>
<!-- 创建时间 -->
<el-table-column prop="createTime" label="创建时间" align="center" width="150">
<template slot-scope="scope">
<i class="el-icon-time" style="margin-right: 5px" />
{{ scope.row.createTime | date }}
</template>
</el-table-column>
<!-- 操作 -->
<el-table-column label="操作" align="center" width="200">
<template slot-scope="scope">
<el-button type="text" size="mini" @click="openModel(scope.row, 1)" v-if="scope.row.children">
@ -72,22 +61,18 @@
</template>
</el-table-column>
</el-table>
<!-- 新增模态框 -->
<el-dialog :visible.sync="addMenu" width="30%" top="12vh">
<div class="dialog-title-container" slot="title" ref="menuTitle" />
<el-form label-width="80px" size="medium" :model="menuForm">
<!-- 菜单类型 -->
<el-form-item label="菜单类型" v-if="show">
<el-radio-group v-model="isCatalog">
<el-radio :label="true">目录</el-radio>
<el-radio :label="false">一级菜单</el-radio>
</el-radio-group>
</el-form-item>
<!-- 菜单名称 -->
<el-form-item label="菜单名称">
<el-input v-model="menuForm.name" style="width: 220px" />
</el-form-item>
<!-- 菜单图标 -->
<el-form-item label="菜单图标">
<el-popover placement="bottom-start" width="300" trigger="click">
<el-row>
@ -102,19 +87,15 @@
style="width: 220px" />
</el-popover>
</el-form-item>
<!-- 组件路径 -->
<el-form-item label="组件路径" v-show="!isCatalog">
<el-input v-model="menuForm.component" style="width: 220px" />
</el-form-item>
<!-- 路由地址 -->
<el-form-item label="访问路径">
<el-input v-model="menuForm.path" style="width: 220px" />
</el-form-item>
<!-- 显示排序 -->
<el-form-item label="显示排序">
<el-input-number v-model="menuForm.orderNum" controls-position="right" :min="1" :max="10" />
</el-form-item>
<!-- 显示状态 -->
<el-form-item label="显示状态">
<el-radio-group v-model="menuForm.isHidden">
<el-radio :label="0">显示</el-radio>

@ -51,9 +51,7 @@
<div style="margin-top: 5px">
<el-table border style="width: 100%" :data="jobs" @selection-change="selectionChange" v-loading="loading">
<el-table-column type="selection" width="55" align="center" />
<!--任务名称 -->
<el-table-column label="任务名称" width="160" align="center" prop="jobName" :show-overflow-tooltip="true" />
<!-- 任务组名 -->
<el-table-column label="任务组名" align="center" prop="jobGroup">
<template slot-scope="scope">
<el-tag>
@ -61,11 +59,8 @@
</el-tag>
</template>
</el-table-column>
<!-- 调用目标字符串 -->
<el-table-column label="调用目标字符串" align="center" prop="invokeTarget" :show-overflow-tooltip="true" />
<!-- cron执行表达式 -->
<el-table-column label="cron执行表达式" align="center" prop="cronExpression" :show-overflow-tooltip="true" />
<!-- 状态 -->
<el-table-column label="状态" align="center">
<template slot-scope="scope">
<el-switch
@ -77,19 +72,16 @@
@change="changeStatus(scope.row)"></el-switch>
</template>
</el-table-column>
<!-- 创建时间 -->
<el-table-column label="创建时间" align="center" width="160">
<template slot-scope="scope">
{{ scope.row.createTime | dateTime }}
</template>
</el-table-column>
<!-- 创建时间 -->
<el-table-column label="备注" align="center" width="160">
<template slot-scope="scope">
{{ scope.row.remark }}
</template>
</el-table-column>
<!-- 操作 -->
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button size="mini" type="text" @click="handleChange(scope.row.id)"></el-button>
@ -108,8 +100,6 @@
</el-table-column>
</el-table>
</div>
<!--分页区域-->
<el-pagination
class="pagination-container"
background
@ -120,7 +110,6 @@
:total="count"
:page-sizes="[10, 20]"
layout="total, sizes, prev, pager, next, jumper" />
<el-dialog :visible.sync="isDelete" width="30%">
<div class="dialog-title-container" slot="title"><i class="el-icon-warning" style="color: #ff9900" />提示</div>
<div style="font-size: 1rem">是否删除选中项</div>
@ -210,12 +199,9 @@
<el-button type="primary" @click="handleEditOrUpdate"> </el-button>
</div>
</el-dialog>
<el-dialog title="Cron表达式生成器" :visible.sync="openCron" append-to-body destroy-on-close class="scrollbar">
<crontab @hide="openCron = false" @fill="crontabFill" :expression="expression"></crontab>
</el-dialog>
<!-- 任务日志详细 -->
<el-dialog title="任务详细" :visible.sync="openView" @closed="afterClosed" width="700px" append-to-body>
<el-form ref="form" :model="job" label-width="120px" size="mini">
<el-row>
@ -429,7 +415,6 @@ export default {
this.dialogFormVisible = false
})
} else if (this.editOrUpdate === false) {
//
this.axios.post('/api/admin/jobs', this.job).then(({ data }) => {
if (data.flag) {
this.$notify.success({

@ -1,10 +1,8 @@
<template>
<el-card class="main-card">
<!-- 标题 -->
<div class="title">{{ this.$route.name }}</div>
<div class="operation-container">
<el-button type="primary" size="small" icon="el-icon-plus" @click="openModel(null)"> </el-button>
<!-- 数据筛选 -->
<div style="margin-left: auto">
<el-input
v-model="keywords"
@ -18,7 +16,6 @@
</el-button>
</div>
</div>
<!-- 权限列表 -->
<el-table
v-loading="loading"
:data="resources"
@ -65,7 +62,6 @@
</template>
</el-table-column>
</el-table>
<!-- 新增模态框 -->
<el-dialog :visible.sync="addModule" width="30%">
<div class="dialog-title-container" slot="title" ref="moduleTitle" />
<el-form label-width="80px" size="medium" :model="resourceForm">
@ -78,7 +74,6 @@
<el-button type="primary" @click="addOrEditResource"> </el-button>
</span>
</el-dialog>
<!-- 新增模态框 -->
<el-dialog :visible.sync="addResource" width="30%">
<div class="dialog-title-container" slot="title" ref="resourceTitle" />
<el-form label-width="80px" size="medium" :model="resourceForm">

@ -1,7 +1,6 @@
<template>
<el-card class="main-card">
<div class="title">{{ this.$route.name }}</div>
<!-- 表格操作 -->
<div class="operation-container">
<el-button type="primary" size="small" icon="el-icon-plus" @click="openMenuModel(null)"> </el-button>
<el-button
@ -12,7 +11,6 @@
@click="isDelete = true">
批量删除
</el-button>
<!-- 条件筛选 -->
<div style="margin-left: auto">
<el-input
v-model="keywords"
@ -26,9 +24,7 @@
</el-button>
</div>
</div>
<!-- 表格展示 -->
<el-table border :data="roles" @selection-change="selectionChange" v-loading="loading">
<!-- 表格列 -->
<el-table-column type="selection" width="55" />
<el-table-column prop="roleName" label="角色名" align="center" />
<el-table-column prop="roleLabel" label="权限标签" align="center">
@ -38,24 +34,12 @@
</el-tag>
</template>
</el-table-column>
<!-- <el-table-column prop="isDisable" label="禁用" align="center" width="100">
<template slot-scope="scope">
<el-switch
v-model="scope.row.isDisable"
active-color="#13ce66"
inactive-color="#F4F4F5"
:active-value="1"
:inactive-value="0"
@change="changeDisable(scope.row)" />
</template>
</el-table-column> -->
<el-table-column prop="createTime" label="创建时间" width="150" align="center">
<template slot-scope="scope">
<i class="el-icon-time" style="margin-right: 5px" />
{{ scope.row.createTime | date }}
</template>
</el-table-column>
<!-- 列操作 -->
<el-table-column label="操作" align="center" width="220">
<template slot-scope="scope">
<el-button type="text" size="mini" @click="openMenuModel(scope.row)">
@ -70,7 +54,6 @@
</template>
</el-table-column>
</el-table>
<!-- 分页 -->
<el-pagination
class="pagination-container"
background
@ -81,7 +64,6 @@
:total="count"
:page-sizes="[10, 20]"
layout="total, sizes, prev, pager, next, jumper" />
<!-- 菜单对话框 -->
<el-dialog :visible.sync="roleMenu" width="30%">
<div class="dialog-title-container" slot="title" ref="roleTitle" />
<el-form label-width="80px" size="medium" :model="roleForm">
@ -97,7 +79,6 @@
<el-button type="primary" @click="saveOrUpdateRoleMenu"> </el-button>
</div>
</el-dialog>
<!-- 资源对话框 -->
<el-dialog :visible.sync="roleResource" width="30%" top="9vh">
<div class="dialog-title-container" slot="title">修改资源权限</div>
<el-form label-width="80px" size="medium" :model="roleForm">
@ -118,7 +99,6 @@
<el-button type="primary" @click="saveOrUpdateRoleResource"> </el-button>
</div>
</el-dialog>
<!-- 批量删除对话框 -->
<el-dialog :visible.sync="isDelete" width="30%">
<div class="dialog-title-container" slot="title"><i class="el-icon-warning" style="color: #ff9900" />提示</div>
<div style="font-size: 1rem">是否删除选中项</div>

@ -1,7 +1,6 @@
<template>
<el-card class="main-card">
<el-tabs v-model="activeName" @tab-click="handleClick">
<!-- 修改信息 -->
<el-tab-pane label="修改信息" name="info">
<div class="info-container">
<el-upload
@ -27,7 +26,6 @@
</el-form>
</div>
</el-tab-pane>
<!-- 修改密码 -->
<el-tab-pane label="修改密码" name="password">
<el-form label-width="70px" :model="passwordForm" style="width: 320px">
<el-form-item label="旧密码">

@ -1,7 +1,6 @@
<template>
<el-card class="main-card">
<div class="title">{{ this.$route.name }}</div>
<!-- 表格操作 -->
<div class="operation-container">
<el-button type="primary" size="small" icon="el-icon-plus" @click="openModel(null)"> </el-button>
<el-button
@ -25,11 +24,8 @@
</el-button>
</div>
</div>
<!-- 表格展示 -->
<el-table border :data="tags" v-loading="loading" @selection-change="selectionChange">
<!-- 表格列 -->
<el-table-column type="selection" width="55" />
<!-- 标签名 -->
<el-table-column prop="tagName" label="标签名" align="center">
<template slot-scope="scope">
<el-tag>
@ -37,16 +33,13 @@
</el-tag>
</template>
</el-table-column>
<!-- 文章量 -->
<el-table-column prop="articleCount" label="文章量" align="center" />
<!-- 标签创建时间 -->
<el-table-column prop="createTime" label="创建时间" align="center">
<template slot-scope="scope">
<i class="el-icon-time" style="margin-right: 5px" />
{{ scope.row.createTime | date }}
</template>
</el-table-column>
<!-- 列操作 -->
<el-table-column label="操作" align="center" width="160">
<template slot-scope="scope">
<el-button type="primary" size="mini" @click="openModel(scope.row)"> </el-button>
@ -56,7 +49,6 @@
</template>
</el-table-column>
</el-table>
<!-- 分页 -->
<el-pagination
class="pagination-container"
background
@ -67,7 +59,6 @@
:total="count"
:page-sizes="[10, 20]"
layout="total, sizes, prev, pager, next, jumper" />
<!-- 批量删除对话框 -->
<el-dialog :visible.sync="isDelete" width="30%">
<div class="dialog-title-container" slot="title"><i class="el-icon-warning" style="color: #ff9900" />提示</div>
<div style="font-size: 1rem">是否删除选中项</div>
@ -76,7 +67,6 @@
<el-button type="primary" @click="deleteTag(null)"> </el-button>
</div>
</el-dialog>
<!-- 编辑对话框 -->
<el-dialog :visible.sync="addOrEdit" width="30%">
<div class="dialog-title-container" slot="title" ref="tagTitle" />
<el-form label-width="80px" size="medium" :model="tagForm">

@ -2,12 +2,9 @@
<el-card class="main-card">
<div class="title">{{ this.$route.name }}</div>
<div class="talk-container">
<!-- 输入框 -->
<Editor ref="editor" class="editor-wrapper" v-model="talk.content" placeholder="说点什么吧" />
<!-- 操作菜单 -->
<div class="operation-wrapper">
<div class="left-wrapper">
<!-- 图片上传 -->
<el-upload
action="/api/admin/talks/images"
multiple
@ -19,14 +16,12 @@
</el-upload>
</div>
<div class="right-wrapper">
<!-- 是否置顶 -->
<el-switch
style="margin-right: 16px"
v-model="talk.isTop"
inactive-text="置顶"
:active-value="1"
:inactive-value="0" />
<!-- 说说状态 -->
<el-dropdown trigger="click" @command="handleCommand" style="margin-right: 16px">
<span class="talk-status"> {{ dropdownTitle }}<i class="el-icon-arrow-down el-icon--right" /> </span>
<el-dropdown-menu slot="dropdown">
@ -40,7 +35,6 @@
</el-button>
</div>
</div>
<!-- 图片上传 -->
<el-upload
class="talk-image-upload"
v-show="uploads.length > 0"
@ -113,7 +107,6 @@ export default {
if (file.size / 1024 < this.config.UPLOAD_SIZE) {
resolve(file)
}
// 200KB,200,
imageConversion.compressAccurately(file, this.config.UPLOAD_SIZE).then((res) => {
resolve(res)
})
@ -124,7 +117,6 @@ export default {
this.$message.error('说说内容不能为空')
return false
}
//
if (this.uploads.length > 0) {
var img = []
this.uploads.forEach((item) => {
@ -215,4 +207,4 @@ export default {
.talk-image-upload {
margin-top: 8px;
}
</style>
</style>

@ -1,7 +1,6 @@
<template>
<el-card class="main-card">
<div class="title">{{ this.$route.name }}</div>
<!-- 文章状态 -->
<div class="status-menu">
<span>状态</span>
<span @click="changeStatus(null)" :class="isActive(null)">全部</span>
@ -9,15 +8,12 @@
<span @click="changeStatus(2)" :class="isActive(2)"> 私密 </span>
</div>
<el-empty v-if="talks == null" description="暂无说说" />
<!-- 说说列表 -->
<div class="talk-item" v-for="item of talks" :key="item.id">
<!-- 用户信息 -->
<div class="user-info-wrapper">
<el-avatar class="user-avatar" :src="item.avatar" :size="36" />
<div class="user-detail-wrapper">
<div class="user-nickname">
<div>{{ item.nickname }}</div>
<!-- 操作 -->
<el-dropdown trigger="click" @command="handleCommand">
<i class="el-icon-more" style="color: #333; cursor: pointer" />
<el-dropdown-menu slot="dropdown">
@ -26,15 +22,12 @@
</el-dropdown-menu>
</el-dropdown>
</div>
<!-- 发表时间 -->
<div class="time">
{{ item.createTime | dateTime }}
<span class="top" v-if="item.isTop == 1"> <i class="iconfont el-icon-myzhiding" /> 置顶 </span>
<span class="secret" v-if="item.status == 2"> <i class="iconfont el-icon-mymima" /> 私密 </span>
</div>
<!-- 说说信息 -->
<div class="talk-content" v-html="item.content" />
<!-- 图片列表 -->
<el-row :gutter="4" class="talk-images" v-if="item.imgs">
<el-col :md="8" :cols="6" v-for="(img, index) of item.imgs" :key="index">
<el-image class="images-items" :src="img" :preview-src-list="previews" />
@ -43,7 +36,6 @@
</div>
</div>
</div>
<!-- 分页 -->
<el-pagination
:hide-on-single-page="false"
class="pagination-container"
@ -53,7 +45,6 @@
:page-size="size"
:total="count"
layout="prev, pager, next" />
<!-- 删除对话框 -->
<el-dialog :visible.sync="isdelete" width="30%">
<div class="dialog-title-container" slot="title"><i class="el-icon-warning" style="color: #ff9900" />提示</div>
<div style="font-size: 1rem">是否删除该说说</div>

@ -1,9 +1,7 @@
<template>
<el-card class="main-card">
<!-- 标题 -->
<div class="title">{{ this.$route.name }}</div>
<div class="operation-container">
<!-- 数据筛选 -->
<div style="margin-left: auto">
<el-input
v-model="keywords"
@ -17,7 +15,6 @@
</el-button>
</div>
</div>
<!-- 权限列表 -->
<el-table v-loading="loading" :data="users">
<el-table-column type="selection" width="55" align="center" />
<el-table-column prop="avatar" label="头像" align="center" width="100">
@ -44,7 +41,6 @@
</template>
</el-table-column>
</el-table>
<!-- 分页 -->
<el-pagination
class="pagination-container"
background

@ -1,11 +1,8 @@
<template>
<el-card class="main-card">
<div class="title">{{ this.$route.name }}</div>
<!-- 表格操作 -->
<div class="operation-container">
<!-- 条件筛选 -->
<div style="margin-left: auto">
<!-- 登录方式 -->
<el-select clearable v-model="loginType" placeholder="请选择登录方式" size="small" style="margin-right: 1rem">
<el-option v-for="item in typeList" :key="item.type" :label="item.desc" :value="item.type" />
</el-select>
@ -21,9 +18,7 @@
</el-button>
</div>
</div>
<!-- 表格展示 -->
<el-table border :data="userList" v-loading="loading">
<!-- 表格列 -->
<el-table-column prop="linkAvatar" label="头像" align="center" width="100">
<template slot-scope="scope">
<img :src="scope.row.avatar" width="40" height="40" />
@ -69,14 +64,12 @@
{{ scope.row.lastLoginTime | date }}
</template>
</el-table-column>
<!-- 列操作 -->
<el-table-column label="操作" align="center" width="100">
<template slot-scope="scope">
<el-button type="primary" size="mini" @click="openEditModel(scope.row)"> </el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页 -->
<el-pagination
class="pagination-container"
background
@ -87,7 +80,6 @@
:total="count"
:page-sizes="[10, 20]"
layout="total, sizes, prev, pager, next, jumper" />
<!-- 修改对话框 -->
<el-dialog :visible.sync="isEdit" width="30%">
<div class="dialog-title-container" slot="title">修改用户</div>
<el-form label-width="60px" size="medium" :model="userForm">
@ -136,10 +128,6 @@ export default {
{
type: 2,
desc: 'QQ'
},
{
type: 3,
desc: '微博'
}
],
keywords: null,

@ -1,7 +1,6 @@
<template>
<el-card class="main-card">
<el-tabs v-model="activeName">
<!-- 修改信息 -->
<el-tab-pane label="网站信息" name="info">
<el-form label-width="100px" :model="websiteConfigForm" label-position="left">
<el-form-item label="作者头像">
@ -76,7 +75,6 @@
</el-button>
</el-form>
</el-tab-pane>
<!-- 网站公告 -->
<el-tab-pane label="社交信息" name="notice">
tip:空白默认不显示
<el-form label-width="70px" :model="websiteConfigForm">
@ -115,7 +113,6 @@
</el-button>
</el-form>
</el-tab-pane>
<!-- 修改密码 -->
<el-tab-pane label="其他设置" name="password">
<el-form label-width="120px" :model="websiteConfigForm" label-position="left">
<el-row style="width: 600px">

@ -65,6 +65,9 @@ export default defineComponent({
'nprogress-custom-parent': false
})
const wrapperStyle = ref({ 'min-height': '100vh' })
const isMobile = computed(() => {
return commonStore.isMobile
})
onMounted(() => {
initialApp()
})
@ -75,6 +78,7 @@ export default defineComponent({
const initialApp = async () => {
initResizeEvent()
intialCopy()
initWindowOnload()
fetchWebsiteConfig()
let wrapperHeight = screen.height
const footerEl = document.getElementById('footer')
@ -108,9 +112,6 @@ export default defineComponent({
const intialCopy = () => {
document.addEventListener('copy', copyEventHandler)
}
const isMobile = computed(() => {
return commonStore.isMobile
})
const resizeHander = () => {
const rect = document.body.getBoundingClientRect()
const mobileState = rect.width - 1 < MOBILE_WITH
@ -120,6 +121,15 @@ export default defineComponent({
resizeHander()
window.addEventListener('resize', resizeHander)
}
const initWindowOnload = () => {
window.onload = () => {
setTimeout(() => {
window.scrollTo({
top: 0
})
}, 10)
}
}
return {
title: metaStore.title,
theme: computed(() => appStore.themeConfig.theme),

@ -86,6 +86,12 @@ export default defineComponent({
let scrollingHandler: any
let menuReopenHandler: any
let needReopen = ref(false)
onMounted(() => {
document.addEventListener('scroll', scrollHandler)
})
onUnmounted(() => {
document.removeEventListener('scroll', scrollHandler)
})
const scrollHandler = () => {
clearTimeout(scrollingHandler)
clearTimeout(menuReopenHandler)
@ -134,12 +140,6 @@ export default defineComponent({
navigatorStore.setOpenNavigator(false)
searchStore.setOpenModal(status)
}
onMounted(() => {
document.addEventListener('scroll', scrollHandler)
})
onUnmounted(() => {
document.removeEventListener('scroll', scrollHandler)
})
return {
gradient: computed(() => {
return { background: appStore.themeConfig.header_gradient_css }

@ -63,5 +63,3 @@ export default defineComponent({
}
})
</script>
<style lang="scss" scoped></style>

@ -24,5 +24,3 @@ export default defineComponent({
}
})
</script>
<style lang="scss" scoped></style>

@ -23,7 +23,7 @@
</template>
<script lang="ts">
import { computed, defineComponent, onMounted } from 'vue'
import { computed, defineComponent } from 'vue'
import { useAppStore } from '@/stores/app'
import { useI18n } from 'vue-i18n'
@ -50,5 +50,3 @@ export default defineComponent({
}
})
</script>
<style lang="scss" scoped></style>

@ -156,5 +156,3 @@ export default defineComponent({
}
})
</script>
<style lang="scss" scoped></style>

@ -16,5 +16,3 @@ export default defineComponent({
}
})
</script>
<style lang="scss" scoped></style>

@ -60,4 +60,3 @@ export default defineComponent({
}
})
</script>
<style lang="scss" scoped></style>

@ -40,5 +40,3 @@ export default defineComponent({
}
})
</script>
<style lang="scss" scoped></style>

@ -206,7 +206,7 @@ export default defineComponent({
const handleTabChange = (categoryId: any) => {
pagination.current = 1
activeTab.value = categoryId
toPageTop()
toArticleOffset()
nowCategoryId = categoryId
if (categoryId === 0) {
fetchArticles()
@ -214,7 +214,7 @@ export default defineComponent({
fetchArticlesByCategoryId(categoryId)
}
}
const toPageTop = () => {
const toArticleOffset = () => {
window.scrollTo({
top: articleOffset.value
})
@ -225,7 +225,7 @@ export default defineComponent({
}
const pageChangeHanlder = (current: number) => {
pagination.current = current
toPageTop()
toArticleOffset()
if (nowCategoryId === 0) {
fetchArticles()
} else {

Loading…
Cancel
Save