|
|
@ -71,7 +71,7 @@ |
|
|
|
import mixinViewModule from '@/mixins/view-module' |
|
|
|
import AddOrUpdate from './typicalcase-add-or-update' |
|
|
|
import CaseInfoDetailView from './typicalcase-detail' |
|
|
|
import {debounce} from 'lodash' |
|
|
|
import { debounce } from 'lodash' |
|
|
|
export default { |
|
|
|
mixins: [mixinViewModule], |
|
|
|
name: 'CaseInfoList', |
|
|
@ -88,22 +88,22 @@ export default { |
|
|
|
startTime: '', |
|
|
|
endTime: '' |
|
|
|
}, |
|
|
|
pickerBeginDateBefore: { |
|
|
|
disabledDate: (time) => { |
|
|
|
let beginDateVal = this.dataForm.startTime |
|
|
|
if (beginDateVal) { |
|
|
|
return time.getTime() > new Date(beginDateVal).getTime() |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
pickerBeginDateAfter: { |
|
|
|
disabledDate: (time) => { |
|
|
|
let EndDateVal = this.dataForm.endTime |
|
|
|
if (EndDateVal) { |
|
|
|
return time.getTime() < new Date(EndDateVal).getTime() |
|
|
|
} |
|
|
|
} |
|
|
|
pickerBeginDateBefore: { |
|
|
|
disabledDate: (time) => { |
|
|
|
let beginDateVal = this.dataForm.startTime |
|
|
|
if (beginDateVal) { |
|
|
|
return time.getTime() > new Date(beginDateVal).getTime() |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
pickerBeginDateAfter: { |
|
|
|
disabledDate: (time) => { |
|
|
|
let EndDateVal = this.dataForm.endTime |
|
|
|
if (EndDateVal) { |
|
|
|
return time.getTime() < new Date(EndDateVal).getTime() |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
components: { |
|
|
@ -120,17 +120,17 @@ export default { |
|
|
|
}, |
|
|
|
formatState: function (row, column) { |
|
|
|
let state = row.state |
|
|
|
if (state == 1) { |
|
|
|
if (state === 1) { |
|
|
|
return '上架' |
|
|
|
} else if (state == 0) { |
|
|
|
} else if (state === 0) { |
|
|
|
return '下架' |
|
|
|
} |
|
|
|
}, |
|
|
|
changeGroundingText(state){ |
|
|
|
changeGroundingText (state) { |
|
|
|
let status = state |
|
|
|
if (status == 1) { |
|
|
|
if (status === 1) { |
|
|
|
return '下架' |
|
|
|
} else if (status == 0) { |
|
|
|
} else if (status === 0) { |
|
|
|
return '上架' |
|
|
|
} |
|
|
|
}, |
|
|
@ -139,25 +139,25 @@ export default { |
|
|
|
this.$router.push({ path: '/case-typicalcase' }) |
|
|
|
}, |
|
|
|
changeGroundingHandle: debounce(function (row) { |
|
|
|
this.$confirm(this.$t('prompt.info', { 'handle': this.changeGroundingText(row.state) }), this.$t('prompt.title'), { |
|
|
|
confirmButtonText: this.$t('confirm'), |
|
|
|
cancelButtonText: this.$t('cancel'), |
|
|
|
type: 'warning' |
|
|
|
}).then(() => { |
|
|
|
this.$http.get(`/cloudAnalysis/typicalcase/updateState/${row.id}`).then(({ data: res }) => { |
|
|
|
if (res.code !== 0) { |
|
|
|
return this.$message.error(res.msg) |
|
|
|
} |
|
|
|
this.$message({ |
|
|
|
message: this.$t('prompt.success'), |
|
|
|
type: 'success', |
|
|
|
duration: 500, |
|
|
|
onClose: () => { |
|
|
|
this.getDataList() |
|
|
|
} |
|
|
|
}) |
|
|
|
}).catch(() => {}) |
|
|
|
this.$confirm(this.$t('prompt.info', { 'handle': this.changeGroundingText(row.state) }), this.$t('prompt.title'), { |
|
|
|
confirmButtonText: this.$t('confirm'), |
|
|
|
cancelButtonText: this.$t('cancel'), |
|
|
|
type: 'warning' |
|
|
|
}).then(() => { |
|
|
|
this.$http.get(`/cloudAnalysis/typicalcase/updateState/${row.id}`).then(({ data: res }) => { |
|
|
|
if (res.code !== 0) { |
|
|
|
return this.$message.error(res.msg) |
|
|
|
} |
|
|
|
this.$message({ |
|
|
|
message: this.$t('prompt.success'), |
|
|
|
type: 'success', |
|
|
|
duration: 500, |
|
|
|
onClose: () => { |
|
|
|
this.getDataList() |
|
|
|
} |
|
|
|
}) |
|
|
|
}).catch(() => {}) |
|
|
|
}).catch(() => {}) |
|
|
|
}, 1000, { 'leading': true, 'trailing': false }) |
|
|
|
} |
|
|
|
} |
|
|
|