This commit is contained in:
@@ -35,6 +35,14 @@ const formOptions: VbenFormProps = {
|
||||
},
|
||||
schema: querySchema(),
|
||||
wrapperClass: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4',
|
||||
handleReset: async () => {
|
||||
ordersType.value = '0';
|
||||
const { formApi, reload } = tableApi;
|
||||
await formApi.resetForm();
|
||||
const formValues = formApi.form.values;
|
||||
formApi.setLatestSubmissionValues(formValues);
|
||||
await reload(formValues);
|
||||
},
|
||||
};
|
||||
|
||||
const gridOptions: VxeGridProps = {
|
||||
@@ -53,6 +61,7 @@ const gridOptions: VxeGridProps = {
|
||||
proxyConfig: {
|
||||
ajax: {
|
||||
query: async ({page}, formValues = {}) => {
|
||||
formValues.type = ordersType.value=='0'?undefined:ordersType.value;
|
||||
return await workOrdersList({
|
||||
pageNum: page.currentPage,
|
||||
pageSize: page.pageSize,
|
||||
@@ -85,7 +94,7 @@ function handleAdd() {
|
||||
modalApi.setData({});
|
||||
modalApi.open();
|
||||
}
|
||||
function handleInfo(row) {
|
||||
function handleInfo(row:any) {
|
||||
detailApi.setData({id:row.id});
|
||||
detailApi.open();
|
||||
}
|
||||
@@ -139,21 +148,14 @@ async function queryOrderType() {
|
||||
onMounted(async () => {
|
||||
await queryOrderType()
|
||||
});
|
||||
|
||||
async function changeOrdersType(val: string) {
|
||||
await tableApi.formApi.setValues({
|
||||
type: val === '0' ? undefined : val, // '0' 表示全部工单,传 undefined 或清除该字段
|
||||
});
|
||||
console.log(tableApi.formApi.getValues(),'==================')
|
||||
await tableApi.query()
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Page :auto-content-height="true">
|
||||
<BasicTable table-title="工单处理列表">
|
||||
<BasicTable table-title="工单处理列表" class="order-work-left-radio">
|
||||
<template #table-title>
|
||||
<RadioGroup v-model:value="ordersType" button-style="solid" @change="changeOrdersType">
|
||||
<RadioGroup v-model:value="ordersType" button-style="solid"
|
||||
@change="() => tableApi.reload()">
|
||||
<RadioButton v-for="item in ordersTypeList"
|
||||
:value="item.value">{{ item.label }}
|
||||
</RadioButton>
|
||||
@@ -219,3 +221,18 @@ async function changeOrdersType(val: string) {
|
||||
<WorkOrdersDetail/>
|
||||
</Page>
|
||||
</template>
|
||||
<style lang="scss" scoped>
|
||||
:where(.css-dev-only-do-not-override-aza1th).ant-radio-group {
|
||||
white-space: nowrap;
|
||||
overflow-y: hidden;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
</style>
|
||||
<style lang="scss">
|
||||
.order-work-left-radio{
|
||||
.vxe-toolbar .vxe-buttons--wrapper, .vxe-toolbar .vxe-tools--wrapper {
|
||||
max-width: 70% !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
Reference in New Issue
Block a user