导出excel加上日期

This commit is contained in:
weiwei committed 2025-03-06 14:38:52 +08:00
1 parent 8bdf76ae3a
commit 5dce0acf8c
67 files changed
+2300 -2278

No files matched your search

+43 -43
View File
@@ -8,20 +8,20 @@
</el-form-item>
<el-form-item>
<el-button @click="getDataList" icon="search" type="primary">
{{ $t('common.queryBtn') }}
{{ $t("common.queryBtn") }}
</el-button>
<el-button @click="resetQuery" icon="Refresh">{{ $t('common.resetBtn') }}</el-button>
<el-button @click="resetQuery" icon="Refresh">{{ $t("common.resetBtn") }}</el-button>
</el-form-item>
</el-form>
</el-row>
<el-row>
<div class="mb8" style="width: 100%">
<el-button @click="formDialogRef.openDialog()" class="ml10" icon="folder-add" type="primary" v-auth="'sys_systenant_add'">
{{ $t('common.addBtn') }}
{{ $t("common.addBtn") }}
</el-button>
<el-button plain @click="handleRefreshCache()" class="ml10" icon="refresh-left" type="primary">
{{ $t('common.refreshCacheBtn') }}
{{ $t("common.refreshCacheBtn") }}
</el-button>
<el-button
@@ -33,7 +33,7 @@
type="primary"
v-auth="'sys_systenant_del'"
>
{{ $t('common.delBtn') }}
{{ $t("common.delBtn") }}
</el-button>
<right-toolbar
@@ -113,7 +113,7 @@
text
type="primary"
v-auth="'sys_systenant_edit'"
>{{ $t('tenant.individuationBtn') }}
>{{ $t("tenant.individuationBtn") }}
</el-button>
<el-button
class="!p-0"
@@ -122,7 +122,7 @@
text
type="primary"
v-auth="'sys_systenant_edit'"
>{{ $t('common.editBtn') }}
>{{ $t("common.editBtn") }}
</el-button>
<el-button
class="!p-0"
@@ -132,7 +132,7 @@
text
type="primary"
v-auth="'sys_systenant_del'"
>{{ $t('common.delBtn') }}
>{{ $t("common.delBtn") }}
</el-button>
</div>
</div>
@@ -163,31 +163,31 @@
</template>
<script lang="ts" name="systemTenant" setup>
import { BasicTableProps, useTable } from '/@/hooks/table';
import { delObj, fetchPage, fetchList } from '/@/api/admin/tenant';
import { useMessage, useMessageBox } from '/@/hooks/message';
import { useI18n } from 'vue-i18n';
import { useDict } from '/@/hooks/dict';
import { BasicTableProps, useTable } from "/@/hooks/table"
import { delObj, fetchPage, fetchList } from "/@/api/admin/tenant"
import { useMessage, useMessageBox } from "/@/hooks/message"
import { useI18n } from "vue-i18n"
import { useDict } from "/@/hooks/dict"
// 引入组件
const FormDialog = defineAsyncComponent(() => import('./form.vue'));
const Individuation = defineAsyncComponent(() => import('./individuation.vue'));
const { t } = useI18n();
const FormDialog = defineAsyncComponent(() => import("./form.vue"))
const Individuation = defineAsyncComponent(() => import("./individuation.vue"))
const { t } = useI18n()
// 定义变量内容
const formDialogRef = ref();
const individuationRef = ref();
const excelUploadRef = ref();
const tenantMenuRef = ref();
const formDialogRef = ref()
const individuationRef = ref()
const excelUploadRef = ref()
const tenantMenuRef = ref()
// 搜索变量
const queryRef = ref();
const showSearch = ref(true);
const queryRef = ref()
const showSearch = ref(true)
// 多选变量
const selectObjs = ref([]) as any;
const multiple = ref(true);
const selectObjs = ref([]) as any
const multiple = ref(true)
// 字典
const { status_type } = useDict('status_type');
const { status_type } = useDict("status_type")
const state: BasicTableProps = reactive<BasicTableProps>({
queryForm: {},
@@ -196,45 +196,45 @@ const state: BasicTableProps = reactive<BasicTableProps>({
size: 6,
pageSizes: [3, 6, 9, 12],
},
});
})
// table hook
const { getDataList, currentChangeHandle, sizeChangeHandle, downBlobFile, tableStyle } = useTable(state);
const { getDataList, currentChangeHandle, sizeChangeHandle, downBlobFile, tableStyle } = useTable(state)
// 清空搜索条件
const resetQuery = () => {
queryRef.value.resetFields();
getDataList();
};
queryRef.value.resetFields()
getDataList()
}
// 导出excel
const exportExcel = () => {
downBlobFile('/admin/tenant/export', Object.assign(state.queryForm, { ids: selectObjs }), 'tenant.xlsx');
};
downBlobFile("/admin/tenant/export", Object.assign(state.queryForm, { ids: selectObjs }), "租户管理.xlsx")
}
// 删除操作
const handleDelete = async (ids: string[]) => {
try {
await useMessageBox().confirm(t('common.delConfirmText'));
await useMessageBox().confirm(t("common.delConfirmText"))
} catch {
return;
return
}
try {
await delObj(ids);
getDataList();
useMessage().success(t('common.delSuccessText'));
await delObj(ids)
getDataList()
useMessage().success(t("common.delSuccessText"))
} catch (err: any) {
useMessage().error(err.msg);
useMessage().error(err.msg)
} finally {
handleRefreshCache();
handleRefreshCache()
}
};
}
//刷新缓存
const handleRefreshCache = () => {
fetchList().then(() => {
useMessage().success('同步成功');
});
};
useMessage().success("同步成功")
})
}
</script>