1
This commit is contained in:
@@ -25,11 +25,14 @@ export function executeInstructionWithForce(data) {
|
|||||||
* @param limit 条数上限
|
* @param limit 条数上限
|
||||||
* @param keyword 可选,搜索关键词;传则后端在全部数据中过滤后返回
|
* @param keyword 可选,搜索关键词;传则后端在全部数据中过滤后返回
|
||||||
*/
|
*/
|
||||||
export function getHistory(type, limit, keyword) {
|
export function getHistory(type, limit, keyword, days) {
|
||||||
const params = { type, limit }
|
const params = { type, limit }
|
||||||
if (keyword != null && String(keyword).trim() !== '') {
|
if (keyword != null && String(keyword).trim() !== '') {
|
||||||
params.keyword = String(keyword).trim()
|
params.keyword = String(keyword).trim()
|
||||||
}
|
}
|
||||||
|
if (days != null && Number(days) > 0) {
|
||||||
|
params.days = Number(days)
|
||||||
|
}
|
||||||
return request({
|
return request({
|
||||||
url: '/jarvis/instruction/history',
|
url: '/jarvis/instruction/history',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
|
|||||||
@@ -175,7 +175,7 @@
|
|||||||
/>
|
/>
|
||||||
<el-button type="primary" :loading="historyLoading" @click="searchHistory">搜索</el-button>
|
<el-button type="primary" :loading="historyLoading" @click="searchHistory">搜索</el-button>
|
||||||
</div>
|
</div>
|
||||||
<p class="history-hint">待填写(生成后未补全)排在前面,已落库记录也保留。</p>
|
<p class="history-hint">仅查最近 3 天。待填写排在前面,已落库记录也保留。</p>
|
||||||
<div class="history-list" v-loading="historyLoading">
|
<div class="history-list" v-loading="historyLoading">
|
||||||
<div v-if="!historyList.length && !historyLoading" class="history-empty">暂无历史记录</div>
|
<div v-if="!historyList.length && !historyLoading" class="history-empty">暂无历史记录</div>
|
||||||
<div
|
<div
|
||||||
@@ -878,17 +878,32 @@ export default {
|
|||||||
id: row.id
|
id: row.id
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
historyDateRange(days) {
|
||||||
|
const end = new Date()
|
||||||
|
const start = new Date()
|
||||||
|
start.setDate(start.getDate() - (days || 3))
|
||||||
|
const fmt = d => {
|
||||||
|
const y = d.getFullYear()
|
||||||
|
const m = String(d.getMonth() + 1).padStart(2, '0')
|
||||||
|
const day = String(d.getDate()).padStart(2, '0')
|
||||||
|
return `${y}-${m}-${day}`
|
||||||
|
}
|
||||||
|
return { beginTime: fmt(start), endTime: fmt(end) }
|
||||||
|
},
|
||||||
async loadHistory() {
|
async loadHistory() {
|
||||||
this.historyLoading = true
|
this.historyLoading = true
|
||||||
try {
|
try {
|
||||||
const kw = (this.historyKeyword || '').trim()
|
const kw = (this.historyKeyword || '').trim()
|
||||||
|
const range = this.historyDateRange(3)
|
||||||
const [histRes, orderRes] = await Promise.all([
|
const [histRes, orderRes] = await Promise.all([
|
||||||
getHistory('response', 300, kw || undefined),
|
getHistory('response', 300, kw || undefined, 3),
|
||||||
listJDOrders({
|
listJDOrders({
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 100,
|
pageSize: 100,
|
||||||
orderBy: 'id',
|
orderBy: 'id',
|
||||||
isAsc: 'desc',
|
isAsc: 'desc',
|
||||||
|
beginTime: range.beginTime,
|
||||||
|
endTime: range.endTime,
|
||||||
quickRecordSearch: kw || undefined
|
quickRecordSearch: kw || undefined
|
||||||
})
|
})
|
||||||
])
|
])
|
||||||
|
|||||||
Reference in New Issue
Block a user