fix:合并代码后部分SQL不兼容shardingsphereSQL

This commit is contained in:
zhouz
2026-02-04 09:55:30 +08:00
parent 8bc1783734
commit 0ff15043b9
15 changed files with 219 additions and 82 deletions

View File

@@ -46,7 +46,7 @@
start-placeholder="开始日期"
end-placeholder="结束日期"
:default-time="['00:00:00', '23:59:59']"
@change="crud.toQuery"
@change="mytoQuery"
/>
</el-form-item>
@@ -192,6 +192,7 @@ export default {
del: ['admin', 'inbill:del']
},
storlist: [],
query_flag: true,
tableDataDtl: [],
open_type: null,
lock_type: null,
@@ -214,6 +215,38 @@ export default {
this.initQuery()
},
methods: {
[CRUD.HOOK.beforeRefresh]() {
debugger
if (this.query_flag) {
const end = new Date()
const start = new Date()
const endYear = end.getFullYear()
var endMonth = end.getMonth() + 1
if (end.getMonth() + 1 < 10) {
endMonth = '0' + endMonth.toString()
}
var endDay = end.getDate()
if (end.getDate() < 10) {
endDay = '0' + endDay.toString()
}
const endDate = endYear + '-' + endMonth + '-' + endDay + ' 23:59:59'
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7)
const startYear = start.getFullYear()
var startMonth = start.getMonth() + 1
if (start.getMonth() + 1 < 10) {
startMonth = '0' + startMonth.toString()
}
var startDay = start.getDate()
if (start.getDate() < 10) {
startDay = '0' + startDay.toString()
}
const startDate = startYear + '-' + startMonth + '-' + startDay + ' 00:00:00'
this.crud.query.createTime = [startDate, endDate]
this.crud.query.begin_time = startDate
this.crud.query.end_time = endDate
this.query_flag = false
}
},
/* 搜索框创建时间默认最近一周*/
initQuery() {
const end = new Date()
@@ -240,6 +273,15 @@ export default {
}
const startDate = startYear + '-' + startMonth + '-' + startDay + ' 00:00:00'
this.$set(this.query, 'createTime', [startDate, endDate])
},
mytoQuery(array1) {
if (array1 === null) {
this.crud.query.begin_time = ''
this.crud.query.end_time = ''
} else {
this.crud.query.begin_time = array1[0]
this.crud.query.end_time = array1[1]
}
this.crud.toQuery()
},
addDialog(type) {