Files
aida_front/src/component/HomePage/generalModel.vue
2024-03-26 15:45:32 +08:00

272 lines
7.2 KiB
Vue

<template>
<a-modal
class="modal_component generalModel_modal"
v-model:visible="showPayOrder"
:footer="null"
width="78%"
:maskClosable="false"
:centered="true"
:closable="false"
wrapClassName="#app"
:keyboard="false"
>
<div class="generalModel_page ">
<div class="closeIcon">
<i class="fi fi-rr-cross-small" @click.stop="cancelDsign()"></i>
</div>
<div class="creditsDetail_table_search generalModel_table_search">
<div class="creditsDetail_state generalModel_state">
<div class="generalModel_state_item">
<span>Time:</span>
<a-range-picker
class="range_picker"
v-model:value="rangePickerValue"
style="width:35rem"
:placeholder="[
$t('HistoryPage.StartDate'),
$t('HistoryPage.EndDate'),
]"
:show-time="{ format: 'HH:mm:ss' }"
format="YYYY-MM-DD HH:mm:ss"
valueFormat="YYYY-MM-DD HH:mm:ss"
>
<template #suffixIcon>
<span
class="icon iconfont range_picker_icon icon-rili"
></span>
</template>
</a-range-picker>
</div>
<div class="creditsDetail_state_item generalModel_state_item">
<span>State:</span>
<a-select style="width:25rem" v-model:value="currentState.value" size="large" optionFilterProp="label" :options="state" placeholder="Please select" allowClear show-search></a-select>
</div>
</div>
<div class="creditsDetail_search generalModel_search">
<div
class="creditsDetail_search_item generalModel_search_item"
@click="searchcreditsDetailList()"
>
<span
class="icon iconfont icon-sousuo"
></span>
</div>
</div>
</div>
<div class="generalModel_table_content" ref="historyTable">
<a-table
:columns="columns"
:data-source="collectionList"
:scroll="{ y: historyTableHeight }"
@change="changePage"
:pagination="{
showSizeChanger: true,
current: currentPage,
pageSize: pageSize,
total: total,
showQuickJumper: true,
bordered: false,
}"
>
<template #bodyCell="{ column, text, record, index }">
<template v-if="column.inputImage">
<img :src="text.inputImage" :title="column.title">
</template>
<template v-else-if="column.outputImage">
<img :src="text.outputImage" :title="column.title">
</template>
<template v-else-if="column.Operations">
<div class="operate_list">
<div class="operate_item" @click="openExport(text)">下载</div>
</div>
<!-- <div v-else class="operate_item">/</div> -->
</template>
</template>
<!-- <template
#bodyCell="{ column, text, record, index }"
>
<div
class="operate_list"
v-if="column?.Operations"
>
<div class="operate_item">{{ $t('HistoryPage.Delete') }}</div>
</div>
</template> -->
</a-table>
</div>
</div>
</a-modal>
<div class="mark_loading" v-show="loadingShow">
<a-spin size="large" />
</div>
</template>
<script lang="ts">
import { defineComponent, ref, createVNode, computed, nextTick } from "vue";
import { Https } from "@/tool/https";
import { downloadIamge } from "@/tool/util";
import { Modal, message } from "ant-design-vue";
import { ExclamationCircleOutlined } from "@ant-design/icons-vue";
import { useI18n } from "vue-i18n";
export default defineComponent({
components: {
},
setup() {
let presentState: any = ref('paypal');
let showPayOrder: any = ref(false);
let loadingShow: any = ref(false);//原因
let { t } = useI18n();
const columns: any = computed(() => {
return [
{
title: "Input",
align: "center",
ellipsis: true,
// dataIndex: "inputImage",
key: "inputImage",
inputImage:true,
},
{
title: "Output",
align: "center",
ellipsis: true,
// dataIndex: "outputImage",
key: "outputImage",
outputImage:true,
},
{
title: "Name",
align: "center",
ellipsis: true,
dataIndex: "imageName",
key: "imageName",
},
{
title: "CreateDate",
align: "center",
ellipsis: true,
dataIndex: "createDate",
key: "createDate",
},
{
title: "Scale",
align: "center",
ellipsis: true,
dataIndex: "otherInput",
key: "otherInput",
},
{
title: useI18n().t("HistoryPage.Operations"),
key: "operation",
align: "center",
// slots:{customRender:'action'}
Operations: true,
},
];
});
let currentState = ref({
value:'SR',
})
let state:any = ref([
{
label:'SR',
value:'SR',
},
// {
// label:'Expend',
// value:'expend',
// },
])
let collectionList: any = ref([]);
let rangePickerValue: any = ref([]);
return {
presentState,
showPayOrder,
loadingShow,
t,
columns,
currentState,
state,
collectionList,
rangePickerValue,
};
},
data() {
return {
currentPage: 1,
pageSize: 10,
total: 0,
historyTableHeight: 0,
};
},
mounted() {
},
methods: {
init() {
this.showPayOrder = true;
this.currentPage = 1
this.pageSize = 10
nextTick().then(()=>{
let historyTable: any = this.$refs.historyTable;
this.historyTableHeight = historyTable.clientHeight - 130;
})
this.getTaskDetail()
},
//改变页码
changePage(e: any) {
this.currentPage = e.current
this.pageSize = e.pageSize
this.getTaskDetail();
},
//查询列表
searchcreditsDetailList() {
this.currentPage = 1;
this.getTaskDetail();
},
getTaskDetail() {
let startDate: any = this.rangePickerValue[0]?this.rangePickerValue[0] : "";
let endDate: any = this.rangePickerValue[1]?this.rangePickerValue[1] : "";
let data = {
size:this.pageSize,
page: this.currentPage,
type:this.currentState.value,
endTime: endDate,
startTime: startDate,
}
Https.axiosPost(Https.httpUrls.getTasksHistory,data).then((rv: any) => {
if(this.currentPage > 1 && rv.content.length == 0){
this.currentPage = 1
this.getTaskDetail()
}else{
this.collectionList = rv.content
this.total = rv.total
}
});
},
openExport(exportObj:any){
downloadIamge(exportObj.outputImage,exportObj.imageName)
},
cancelDsign(){
this.showPayOrder = false
}
},
});
</script>
<style lang="less">
// .generalModel_modal {
.closeIcon {
z-index: 2;
}
</style>