fix: 修改未执行eslint的代码

This commit is contained in:
zhangyu
2022-04-11 17:24:10 +08:00
parent 29289e9235
commit f0b5f13a70
23 changed files with 256 additions and 1457 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@@ -297,4 +297,3 @@ export default {
setChart(this.chartId, null)
}
}

View File

@@ -149,7 +149,6 @@ export default {
})
},
returnColor (obj) {
console.log(obj, this.severityDataWeight)
let color = ''
if (!obj) {
color = '#23bf9a'

View File

@@ -108,7 +108,7 @@ export default {
label: this.$t('project.endpoint.state'),
prop: 'state',
show: true,
minWidth: 200,
minWidth: 200
}
// {
// label: this.$t('project.endpoint.status'),

View File

@@ -205,10 +205,8 @@ export function datePicker (rule, value, callback) { // 校验时间选择
} else {
callback(new Error(vm.$t('validate.required')))
}
}
export function sysObjectIdInput (rule, value, callback) {
const sysId = /^(\d{1,9}\.){0,}[\d]+$/
setTimeout(() => {

View File

@@ -5,7 +5,7 @@ export default {
type: Array
},
targetTab: String,
from: String,
from: String
},
data () {
return {

View File

@@ -114,7 +114,7 @@ export default {
label: this.$t('asset.alertNum'),
prop: 'alertNum',
show: true,
width: 120,
width: 120
}, {
label: this.$t('asset.endpointNum2'),
prop: 'endpointNum',

View File

@@ -169,88 +169,88 @@
</template>
<script>
import bus from "@/libs/bus";
import { put } from "@/http";
import { arrLength, datePicker } from "@/components/common/js/validate";
import moment from "moment-timezone";
import bus from '@/libs/bus'
import { put } from '@/http'
import { arrLength, datePicker } from '@/components/common/js/validate'
import moment from 'moment-timezone'
export default {
name: "backupsBox",
name: 'backupsBox',
props: {
obj: {
type: Object,
},
type: Object
}
},
data () {
return {
editBackup: {
status: "",
status: '',
checkDays: [],
checkDay: [],
timepicker: "",
datepicker: "",
retention: "",
state: "",
timepicker: '',
datepicker: '',
retention: '',
state: '',
schedule: {
repeat: "",
stime: "",
type: "",
nums: [],
repeat: '',
stime: '',
type: '',
nums: []
}
},
},
whoshow: "",
activeName: "",
dateFormatStr: localStorage.getItem("nz-default-dateFormat")
? localStorage.getItem("nz-default-dateFormat")
: "YYYY-MM-DD HH:ss:mm",
whoshow: '',
activeName: '',
dateFormatStr: localStorage.getItem('nz-default-dateFormat')
? localStorage.getItem('nz-default-dateFormat')
: 'YYYY-MM-DD HH:ss:mm',
rules: {
type: [
{
required: true,
message: this.$t("validate.required"),
trigger: "change",
},
message: this.$t('validate.required'),
trigger: 'change'
}
],
datepicker: [{ validator: datePicker, trigger: "blur" }],
datepicker: [{ validator: datePicker, trigger: 'blur' }],
checkDays: [
{
required: true,
message: this.$t("validate.required"),
trigger: "change",
message: this.$t('validate.required'),
trigger: 'change'
},
{ validator: arrLength, trigger: "blur" },
{ validator: arrLength, trigger: 'blur' }
],
retention: [
{
required: true,
message: this.$t("validate.required"),
trigger: ["blur", "change"],
},
message: this.$t('validate.required'),
trigger: ['blur', 'change']
}
],
Status: [
{
required: true,
message: this.$t("validate.required"),
trigger: "change",
},
message: this.$t('validate.required'),
trigger: 'change'
}
],
repeat: [
{
required: true,
message: this.$t("validate.required"),
trigger: "blur",
},
message: this.$t('validate.required'),
trigger: 'blur'
}
],
checkDay: [{ validator: arrLength, trigger: "blur" }],
checkDay: [{ validator: arrLength, trigger: 'blur' }]
},
week: [
this.$t("week.Mon"),
this.$t("week.Tue"),
this.$t("week.Wed"),
this.$t("week.Thu"),
this.$t("week.Fri"),
this.$t("week.Sat"),
this.$t("week.Sun"),
this.$t('week.Mon'),
this.$t('week.Tue'),
this.$t('week.Wed'),
this.$t('week.Thu'),
this.$t('week.Fri'),
this.$t('week.Sat'),
this.$t('week.Sun')
],
month: [
1,
@@ -284,9 +284,9 @@ export default {
29,
30,
31,
"Last",
],
};
'Last'
]
}
},
components: {},
@@ -294,11 +294,11 @@ export default {
computed: {},
created () {
const dateFormatStr = localStorage.getItem("nz-default-dateFormat");
const dateFormatStr = localStorage.getItem('nz-default-dateFormat')
if (dateFormatStr) {
this.dateFormatStr = dateFormatStr.split(" ")[0];
this.dateFormatStr = dateFormatStr.split(' ')[0]
} else {
this.dateFormatStr = "YYYY-MM-DD";
this.dateFormatStr = 'YYYY-MM-DD'
}
},
@@ -309,33 +309,32 @@ export default {
methods: {
changeCheck (item) {
if (this.editBackup.type == 3) {
const nums = [];
this.editBackup.nums = [];
const nums = []
this.editBackup.nums = []
for (const i in this.editBackup.checkDay) {
nums.push(Number(this.editBackup.checkDay[i]) + 1);
nums.push(Number(this.editBackup.checkDay[i]) + 1)
}
this.editBackup.nums = nums;
this.editBackup.nums = nums
} else if (this.editBackup.type == 4) {
const nums = [];
this.editBackup.nums = [];
const nums = []
this.editBackup.nums = []
this.editBackup.checkDays.forEach((e, i) => {
if (e === 31) {
nums.push(-1);
nums.push(-1)
} else {
nums.push(Number(this.editBackup.checkDays[i]) + 1);
nums.push(Number(this.editBackup.checkDays[i]) + 1)
}
});
this.editBackup.nums = nums;
})
this.editBackup.nums = nums
}
this.$forceUpdate();
this.$forceUpdate()
},
statusChange (item) {
this.$forceUpdate();
this.$forceUpdate()
if (item == true) {
this.editBackup.state = 1;
this.editBackup.state = 1
} else {
this.editBackup.state = 0;
this.editBackup.state = 0
}
},
save () {
@@ -343,59 +342,59 @@ export default {
if (valid) {
this.editBackup.datepicker[0] = bus
.timeFormate(this.editBackup.datepicker[0])
.split(" ")[0];
.split(' ')[0]
this.editBackup.stime = this.editBackup.datepicker.join(" ");
let offset = localStorage.getItem("nz-sys-timezone");
offset = moment.tz(offset).format("Z");
this.editBackup.stime = new Date(this.editBackup.stime).getTime();
offset = Number.parseInt(offset);
this.editBackup.stime -= offset * 60 * 60 * 1000;
this.editBackup.stime = this.editBackup.datepicker.join(' ')
let offset = localStorage.getItem('nz-sys-timezone')
offset = moment.tz(offset).format('Z')
this.editBackup.stime = new Date(this.editBackup.stime).getTime()
offset = Number.parseInt(offset)
this.editBackup.stime -= offset * 60 * 60 * 1000
put("/sys/backup", {
put('/sys/backup', {
state: Number(this.editBackup.state),
schedule: {
type: Number(this.editBackup.type),
stime: this.editBackup.stime,
repeat: Number(this.editBackup.repeat),
nums: this.editBackup.nums,
nums: this.editBackup.nums
},
retention: Number(this.editBackup.retention),
retention: Number(this.editBackup.retention)
}).then((res) => {
if (res.code === 200) {
this.esc(true);
this.esc(true)
}
});
})
}
});
})
},
inputchange (n) {
this.$forceUpdate();
this.$forceUpdate()
},
datasourceChange (tab) {
switch (tab.name) {
case "2":
this.whoshow = 2;
break;
case "1":
this.whoshow = 1;
break;
case "3":
this.whoshow = 3;
break;
case "4":
this.whoshow = 4;
break;
case '2':
this.whoshow = 2
break
case '1':
this.whoshow = 1
break
case '3':
this.whoshow = 3
break
case '4':
this.whoshow = 4
break
}
this.$forceUpdate();
this.$forceUpdate()
},
clickOutside () {
this.esc(false);
this.esc(false)
},
/* 关闭弹框 */
esc (refresh) {
this.$emit("close", refresh);
},
this.$emit('close', refresh)
}
},
watch: {
@@ -403,90 +402,89 @@ export default {
deep: true,
immediate: true,
handler (n) {
this.editBackup = JSON.parse(JSON.stringify(n));
this.editBackup.checkDay = [];
this.editBackup.checkDays = [];
this.editBackup.type = this.editBackup.type + "";
const stime1 = this.utcTimeToTimezoneStr(this.editBackup.stime);
const stime = this.utcTimeToTimezone(this.editBackup.stime);
const time = stime1.split(" ");
time[0] = stime;
this.$set(this.editBackup, "datepicker", time);
this.editBackup = JSON.parse(JSON.stringify(n))
this.editBackup.checkDay = []
this.editBackup.checkDays = []
this.editBackup.type = this.editBackup.type + ''
const stime1 = this.utcTimeToTimezoneStr(this.editBackup.stime)
const stime = this.utcTimeToTimezone(this.editBackup.stime)
const time = stime1.split(' ')
time[0] = stime
this.$set(this.editBackup, 'datepicker', time)
if (this.editBackup.state == 1) {
this.editBackup.status = true;
this.$emit("statechange", true);
this.editBackup.status = true
this.$emit('statechange', true)
} else {
this.editBackup.status = false;
this.$emit("statechange", false);
this.editBackup.status = false
this.$emit('statechange', false)
}
switch (this.editBackup.type) {
case "1":
this.activeName = "1";
this.whoshow = 1;
break;
case "2":
this.activeName = "2";
this.whoshow = 2;
break;
case "3":
this.activeName = "3";
this.whoshow = 3;
break;
case "4":
this.activeName = "4";
this.whoshow = 4;
break;
case '1':
this.activeName = '1'
this.whoshow = 1
break
case '2':
this.activeName = '2'
this.whoshow = 2
break
case '3':
this.activeName = '3'
this.whoshow = 3
break
case '4':
this.activeName = '4'
this.whoshow = 4
break
}
const checkdays = [];
const checkdays = []
this.checkDay = [];
this.checkDay = []
if (this.editBackup.type == 3) {
this.editBackup.nums.forEach((e) => {
if (e == -1) {
checkdays.push(6);
checkdays.push(6)
} else {
checkdays.push(e - 1);
checkdays.push(e - 1)
}
});
this.$set(this.editBackup, "checkDay", checkdays);
})
this.$set(this.editBackup, 'checkDay', checkdays)
} else if (this.editBackup.type == 4) {
this.editBackup.nums.forEach((e) => {
if (e == -1) {
checkdays.push(31);
checkdays.push(31)
} else {
checkdays.push(e - 1);
checkdays.push(e - 1)
}
});
this.$set(this.editBackup, "checkDays", checkdays);
})
this.$set(this.editBackup, 'checkDays', checkdays)
}
this.$forceUpdate()
}
this.$forceUpdate();
},
},
"editBackup.status": {
'editBackup.status': {
deep: true,
handler (n) {
if (n) {
this.editBackup.state = 1;
this.editBackup.status = n;
this.$emit("statechange", true);
this.editBackup.state = 1
this.editBackup.status = n
this.$emit('statechange', true)
} else {
this.editBackup.state = 0;
this.editBackup.status = n;
this.$emit("statechange", false);
this.editBackup.state = 0
this.editBackup.status = n
this.$emit('statechange', false)
}
}
},
},
"editBackup.datepicker": {
'editBackup.datepicker': {
deep: true,
handler (n) {
this.editBackup.datepicker[0] = bus
.timeFormate(new Date(n[0]))
.split(" ")[0];
},
},
},
};
.split(' ')[0]
}
}
}
}
</script>
<style lang='' scoped>
</style>

View File

@@ -642,7 +642,7 @@ export default {
handler (n, o) {
this.isEdit = true
this.editAlertRule = JSON.parse(JSON.stringify(n))
console.log(this.editAlertRule);
console.log(this.editAlertRule)
if (this.editAlertRule.id || this.editAlertRule.name) {
this.expressions = [this.editAlertRule.expr]
this.showTypeSelect = true // 当 edit 时禁用 type下拉框

View File

@@ -148,7 +148,7 @@ import alertMessageLabelMixin from '@/components/common/alert/alertMessageLabelM
export default {
name: 'alertMessageTable',
components: {
alertRuleInfo: alertRuleInfo,
alertRuleInfo: alertRuleInfo
},
props: {
nowTime: {

View File

@@ -300,7 +300,7 @@ export default {
hideTableTooltip,
tableDataSort (item) {
let orderBy = ''
let str = item.prop
const str = item.prop
if (str === 'dc') {
orderBy = str
}

View File

@@ -69,7 +69,6 @@ import { post ,put} from '@/http'
import lodash from 'lodash'
import bus from '@/libs/bus'
export default {
name: 'backupsTable',
mixins: [],
@@ -79,7 +78,7 @@ export default {
customTableTitle: Array,
isConfigurations: Boolean,
tableData: Array,
tableData2: Array,
tableData2: Array
},
data () {
return {
@@ -110,8 +109,6 @@ export default {
computed: {},
methods: {
Restore (row) {
put('/sys/backup/restore', { filename: row.fileName }).then(res => {
@@ -121,11 +118,11 @@ export default {
})
},
del (item) {
console.log(item);
console.log(item)
},
changeDate (item) {
let time =Date.parse(item)
let time1 = this.timeFormate(time)
const time = Date.parse(item)
const time1 = this.timeFormate(time)
return time1
},
getNum (item) {

View File

@@ -115,12 +115,12 @@ export default {
label: 'MAC',
prop: 'mac',
show: true,
minWidth: 200,
minWidth: 200
}, {
label: this.$t('config.ipamip.asset'),
prop: 'asset',
show: true,
width: 200,
width: 200
}, {
label: this.$t('overall.state'),
prop: 'state',

View File

@@ -35,7 +35,7 @@ export default {
},
data () {
return {
containerShow: true,
containerShow: true
}
},
methods: {

View File

@@ -112,7 +112,7 @@ export default {
if (res.code === 200) {
if (res.data) {
this.tableData[0].retention = res.data.retention
this.tableData[0].state = res.data.state == 1? true :false
this.tableData[0].state = res.data.state == 1
for (const i in res.data.schedule) {
this.tableData[0].schedule[i] = res.data.schedule[i]
}
@@ -123,7 +123,6 @@ export default {
if (res.code === 200) {
if (res.data) {
this.tableData2 = res.data
}
}
})
@@ -132,7 +131,7 @@ export default {
if (res.code === 200) {
if (res.data) {
this.tableData[0].retention = res.data.retention
this.tableData[0].state = res.data.state == 1? true :false
this.tableData[0].state = res.data.state == 1
for (const i in res.data.schedule) {
this.tableData[0].schedule[i] = res.data.schedule[i]
}
@@ -144,14 +143,14 @@ export default {
if (res.code === 200) {
if (res.data) {
this.tableData2 = res.data
}
}
})
}
},
edit (row) {
this.object = { ...row ,
this.object = {
...row,
checkDay: '',
checkDays: '',
datepicker: ''
@@ -169,7 +168,7 @@ export default {
this.getTableData('backup')
}
this.rightBoxshow = false
},
}
},
watch: {}

View File

@@ -82,7 +82,6 @@ export default {
},
methods: {
edit (row, copyFlag) {
console.log(row,copyFlag);
this.object = { ...row }
if (copyFlag) {
this.object.name = this.object.name + '-copy'