导出excel加上日期
This commit is contained in:
1 parent
8bdf76ae3a
commit
5dce0acf8c
67 files changed
+2300
-2278
No files matched your search
@@ -8,10 +8,10 @@
|
||||
<el-row>
|
||||
<div class="mb8" style="width: 100%">
|
||||
<el-button @click="dicDialogRef.openDialog()" class="ml10" icon="folder-add" type="primary">
|
||||
{{ $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>
|
||||
</div>
|
||||
</el-row>
|
||||
@@ -42,7 +42,7 @@
|
||||
</el-scrollbar>
|
||||
<el-footer style="height: 40px; line-height: 40px">
|
||||
<el-button type="primary" size="small" icon="Download" style="width: 100%" @click="exportExcel">{{
|
||||
$t('common.exportBtn')
|
||||
$t("common.exportBtn")
|
||||
}}</el-button>
|
||||
</el-footer>
|
||||
</div>
|
||||
@@ -58,70 +58,70 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" name="systemDic" setup>
|
||||
import { delObj, fetchList, refreshCache } from '/@/api/admin/dict';
|
||||
import { useMessage, useMessageBox } from '/@/hooks/message';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { downBlobFile } from '/@/utils/other';
|
||||
import { delObj, fetchList, refreshCache } from "/@/api/admin/dict"
|
||||
import { useMessage, useMessageBox } from "/@/hooks/message"
|
||||
import { useI18n } from "vue-i18n"
|
||||
import { downBlobFile } from "/@/utils/other"
|
||||
|
||||
// 引入组件
|
||||
const DicDialog = defineAsyncComponent(() => import('./form.vue'));
|
||||
const DictItemDialog = defineAsyncComponent(() => import('./dictItem/index.vue'));
|
||||
const QueryTree = defineAsyncComponent(() => import('/@/components/QueryTree/index.vue'));
|
||||
const DicDialog = defineAsyncComponent(() => import("./form.vue"))
|
||||
const DictItemDialog = defineAsyncComponent(() => import("./dictItem/index.vue"))
|
||||
const QueryTree = defineAsyncComponent(() => import("/@/components/QueryTree/index.vue"))
|
||||
|
||||
const { t } = useI18n();
|
||||
const { t } = useI18n()
|
||||
// 定义变量内容
|
||||
const dicDialogRef = ref();
|
||||
const dictTreeRef = ref();
|
||||
const dictItemDialogRef = ref();
|
||||
const dicDialogRef = ref()
|
||||
const dictTreeRef = ref()
|
||||
const dictItemDialogRef = ref()
|
||||
const state = reactive({
|
||||
queryForm: {},
|
||||
queryList: (name?: string) => {
|
||||
return fetchList({
|
||||
name: name,
|
||||
});
|
||||
})
|
||||
},
|
||||
});
|
||||
})
|
||||
|
||||
// 导出EXCEL
|
||||
const exportExcel = () => {
|
||||
downBlobFile('/admin/dict/export', state.queryForm, 'dict.xlsx');
|
||||
};
|
||||
downBlobFile("/admin/dict/export", state.queryForm, "字典管理.xlsx")
|
||||
}
|
||||
|
||||
//刷新缓存
|
||||
const handleRefreshCache = () => {
|
||||
refreshCache().then(() => {
|
||||
useMessage().success('同步成功');
|
||||
});
|
||||
};
|
||||
useMessage().success("同步成功")
|
||||
})
|
||||
}
|
||||
|
||||
// 点击树
|
||||
const handleNodeClick = (data: any) => {
|
||||
dictItemDialogRef.value.open(data);
|
||||
};
|
||||
dictItemDialogRef.value.open(data)
|
||||
}
|
||||
|
||||
// 刷新树
|
||||
const handleRefreshTree = async (data: any) => {
|
||||
await dictTreeRef.value.getdeptTree();
|
||||
await dictTreeRef.value.getdeptTree()
|
||||
// 选择当前编辑、新增的节点
|
||||
handleNodeClick(data);
|
||||
};
|
||||
handleNodeClick(data)
|
||||
}
|
||||
|
||||
// 删除操作
|
||||
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);
|
||||
useMessage().success(t('common.delSuccessText'));
|
||||
dictTreeRef.value.getdeptTree();
|
||||
await delObj(ids)
|
||||
useMessage().success(t("common.delSuccessText"))
|
||||
dictTreeRef.value.getdeptTree()
|
||||
} catch (err: any) {
|
||||
useMessage().error(err.msg);
|
||||
useMessage().error(err.msg)
|
||||
}
|
||||
};
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
Reference in new issue
Block a user