导出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

+33 -33
View File
@@ -14,9 +14,9 @@
</el-form-item>
<el-form-item>
<el-button formDialogRef icon="search" type="primary" @click="getDataList">
{{ $t('common.queryBtn') }}
{{ $t("common.queryBtn") }}
</el-button>
<el-button icon="Refresh" formDialogRef @click="resetQuery">{{ $t('common.resetBtn') }}</el-button>
<el-button icon="Refresh" formDialogRef @click="resetQuery">{{ $t("common.resetBtn") }}</el-button>
</el-form-item>
</el-form>
</el-row>
@@ -32,7 +32,7 @@
v-auth="'sys_audit_del'"
@click="handleDelete(selectObjs)"
>
{{ $t('common.delBtn') }}
{{ $t("common.delBtn") }}
</el-button>
<right-toolbar
v-model:showSearch="showSearch"
@@ -48,7 +48,7 @@
:data="state.dataList"
v-loading="state.loading"
style="width: 100%"
row-key="id"
row-key="id"
@selection-change="handleSelectionChange"
@sort-change="sortChangeHandle"
border
@@ -66,7 +66,7 @@
<el-table-column :label="$t('common.action')" width="150">
<template #default="scope">
<el-button icon="delete" text type="primary" v-auth="'sys_audit_del'" @click="handleDelete([scope.row.id])"
>{{ $t('common.delBtn') }}
>{{ $t("common.delBtn") }}
</el-button>
</template>
</el-table-column>
@@ -77,61 +77,61 @@
</template>
<script setup lang="ts" name="systemSysAuditLog">
import { BasicTableProps, useTable } from '/@/hooks/table';
import { fetchList, delObjs } from '/@/api/admin/audit';
import { useMessage, useMessageBox } from '/@/hooks/message';
import { useI18n } from 'vue-i18n';
import { BasicTableProps, useTable } from "/@/hooks/table"
import { fetchList, delObjs } from "/@/api/admin/audit"
import { useMessage, useMessageBox } from "/@/hooks/message"
import { useI18n } from "vue-i18n"
const { t } = useI18n();
const { t } = useI18n()
// 搜索变量
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)
// table hook
const state: BasicTableProps = reactive<BasicTableProps>({
queryForm: {},
pageList: fetchList,
descs: ['create_time'],
});
const { getDataList, currentChangeHandle, sizeChangeHandle, sortChangeHandle, downBlobFile, tableStyle } = useTable(state);
descs: ["create_time"],
})
const { getDataList, currentChangeHandle, sizeChangeHandle, sortChangeHandle, downBlobFile, tableStyle } = useTable(state)
// 清空搜索条件
const resetQuery = () => {
// 清空搜索条件
queryRef.value?.resetFields();
queryRef.value?.resetFields()
// 清空多选
selectObjs.value = [];
getDataList();
};
selectObjs.value = []
getDataList()
}
// 导出excel
const exportExcel = () => {
downBlobFile('/admin/audit/export', Object.assign(state.queryForm,{ids:selectObjs}), 'audit.xlsx');
};
downBlobFile("/admin/audit/export", Object.assign(state.queryForm, { ids: selectObjs }), "审计日志.xlsx")
}
// 多选事件
const handleSelectionChange = (objs: { id: string }[]) => {
selectObjs.value = objs.map(({ id }) => id);
multiple.value = !objs.length;
};
selectObjs.value = objs.map(({ id }) => id)
multiple.value = !objs.length
}
// 删除操作
const handleDelete = async (ids: string[]) => {
try {
await useMessageBox().confirm(t('common.delConfirmText'));
await useMessageBox().confirm(t("common.delConfirmText"))
} catch {
return;
return
}
try {
await delObjs(ids);
getDataList();
useMessage().success(t('common.delSuccessText'));
await delObjs(ids)
getDataList()
useMessage().success(t("common.delSuccessText"))
} catch (err: any) {
useMessage().error(err.msg);
useMessage().error(err.msg)
}
};
}
</script>
+52 -44
View File
@@ -11,23 +11,31 @@
</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 v-auth="'sys_client_add'" @click="formDialogRef.openDialog()" class="ml10" icon="folder-add" type="primary">
{{ $t('common.addBtn') }}
{{ $t("common.addBtn") }}
</el-button>
<el-button v-auth="'sys_client_del'" plain @click="handleRefreshCache()" class="ml10" icon="refresh-left" type="primary">
{{ $t('common.refreshCacheBtn') }}
{{ $t("common.refreshCacheBtn") }}
</el-button>
<el-button plain :disabled="multiple" @click="handleDelete(selectObjs)" class="ml10" icon="Delete" type="primary" v-auth="'sys_client_del'">
{{ $t('common.delBtn') }}
<el-button
plain
:disabled="multiple"
@click="handleDelete(selectObjs)"
class="ml10"
icon="Delete"
type="primary"
v-auth="'sys_client_del'"
>
{{ $t("common.delBtn") }}
</el-button>
<right-toolbar
@@ -44,7 +52,7 @@
:data="state.dataList"
@selection-change="handleSelectionChange"
style="width: 100%"
row-key="id"
row-key="id"
v-loading="state.loading"
border
:cell-style="tableStyle.cellStyle"
@@ -65,10 +73,10 @@
<el-table-column :label="$t('common.action')" width="150">
<template #default="scope">
<el-button icon="edit-pen" @click="formDialogRef.openDialog(scope.row.clientId)" text type="primary" v-auth="'sys_client_add'"
>{{ $t('common.editBtn') }}
>{{ $t("common.editBtn") }}
</el-button>
<el-button icon="delete" @click="handleDelete([scope.row.id])" text type="primary" v-auth="'sys_client_del'">
{{ $t('common.delBtn') }}
{{ $t("common.delBtn") }}
</el-button>
</template>
</el-table-column>
@@ -81,75 +89,75 @@
</template>
<script lang="ts" name="systemSysOauthClientDetails" setup>
import { BasicTableProps, useTable } from '/@/hooks/table';
import { delObj, fetchList, refreshCache } from '/@/api/admin/client';
import { useMessage, useMessageBox } from '/@/hooks/message';
import { useDict } from '/@/hooks/dict';
import { useI18n } from 'vue-i18n';
import { BasicTableProps, useTable } from "/@/hooks/table"
import { delObj, fetchList, refreshCache } from "/@/api/admin/client"
import { useMessage, useMessageBox } from "/@/hooks/message"
import { useDict } from "/@/hooks/dict"
import { useI18n } from "vue-i18n"
// 引入组件
const FormDialog = defineAsyncComponent(() => import('./form.vue'));
const { t } = useI18n();
const FormDialog = defineAsyncComponent(() => import("./form.vue"))
const { t } = useI18n()
// 定义查询字典
const { grant_types } = useDict('grant_types');
const { grant_types } = useDict("grant_types")
// 定义变量内容
const formDialogRef = ref();
const queryRef = ref();
const formDialogRef = ref()
const queryRef = ref()
// 搜索变量
const showSearch = ref(true);
const showSearch = ref(true)
// 多选变量
const selectObjs = ref([]) as any;
const multiple = ref(true);
const selectObjs = ref([]) as any
const multiple = ref(true)
const state: BasicTableProps = reactive<BasicTableProps>({
queryForm: {},
pageList: fetchList,
descs: ['id'],
});
descs: ["id"],
})
// table hook
const { getDataList, currentChangeHandle, sizeChangeHandle, downBlobFile, tableStyle } = useTable(state);
const { getDataList, currentChangeHandle, sizeChangeHandle, downBlobFile, tableStyle } = useTable(state)
// 删除缓存
const handleRefreshCache = () => {
refreshCache().then(() => {
useMessage().success('同步成功');
});
};
useMessage().success("同步成功")
})
}
const resetQuery = () => {
queryRef.value.resetFields();
queryRef.value.resetFields()
// state.queryForm = {};
selectObjs.value = [];
getDataList();
};
selectObjs.value = []
getDataList()
}
// 导出excel
const exportExcel = () => {
downBlobFile('/admin/client/export', Object.assign(state.queryForm,{ids:selectObjs}), 'client.xlsx');
};
downBlobFile("/admin/client/export", Object.assign(state.queryForm, { ids: selectObjs }), "终端管理.xlsx")
}
// 多选事件
const handleSelectionChange = (objs: { id: string }[]) => {
selectObjs.value = objs.map(({ id }) => id);
multiple.value = !objs.length;
};
selectObjs.value = objs.map(({ id }) => id)
multiple.value = !objs.length
}
// 删除操作
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)
}
};
}
</script>
+33 -33
View File
@@ -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>
+1 -1
View File
@@ -171,7 +171,7 @@ const resetQuery = () => {
// 导出excel
const exportExcel = () => {
downBlobFile("/admin/log/export", state.queryForm, "log.xlsx")
downBlobFile("/admin/log/export", state.queryForm, "操作日志.xlsx")
}
// 多选事件
+45 -45
View File
@@ -16,20 +16,20 @@
</el-form-item>
<el-form-item>
<el-button @click="getDataList" formDialogRef icon="search" type="primary">
{{ $t('common.queryBtn') }}
{{ $t("common.queryBtn") }}
</el-button>
<el-button @click="resetQuery" formDialogRef icon="Refresh">{{ $t('common.resetBtn') }} </el-button>
<el-button @click="resetQuery" formDialogRef icon="Refresh">{{ $t("common.resetBtn") }} </el-button>
</el-form-item>
</el-form>
</el-row>
<el-row>
<div class="mb8" style="width: 100%">
<el-button v-auth="'sys_syspublicparam_add'" @click="formDialogRef.openDialog()" class="ml10" icon="folder-add" type="primary">
{{ $t('common.addBtn') }}
{{ $t("common.addBtn") }}
</el-button>
<el-button plain v-auth="'sys_syspublicparam_del'" @click="handleRefreshCache()" class="ml10" icon="refresh-left" type="primary">
{{ $t('common.refreshCacheBtn') }}
{{ $t("common.refreshCacheBtn") }}
</el-button>
<el-button
@@ -41,7 +41,7 @@
icon="Delete"
type="primary"
>
{{ $t('common.delBtn') }}
{{ $t("common.delBtn") }}
</el-button>
<right-toolbar
@@ -58,7 +58,7 @@
:data="state.dataList"
@selection-change="handleSelectionChange"
style="width: 100%"
row-key="publicId"
row-key="publicId"
v-loading="state.loading"
border
:cell-style="tableStyle.cellStyle"
@@ -83,7 +83,7 @@
<el-table-column :label="$t('common.action')" width="150">
<template #default="scope">
<el-button icon="edit-pen" @click="formDialogRef.openDialog(scope.row.publicId)" text type="primary"
>{{ $t('common.editBtn') }}
>{{ $t("common.editBtn") }}
</el-button>
<el-tooltip :content="$t('sysdict.deleteDisabledTip')" :disabled="scope.row.systemFlag === '0'" placement="top">
@@ -96,7 +96,7 @@
text
type="primary"
>
{{ $t('common.delBtn') }}
{{ $t("common.delBtn") }}
</el-button>
</span>
</el-tooltip>
@@ -112,81 +112,81 @@
</template>
<script lang="ts" name="systemSysPublicParam" setup>
import { BasicTableProps, useTable } from '/@/hooks/table';
import { delObj, fetchList, refreshCache } from '/@/api/admin/param';
import { useMessage, useMessageBox } from '/@/hooks/message';
import { useDict } from '/@/hooks/dict';
import { useI18n } from 'vue-i18n';
import { BasicTableProps, useTable } from "/@/hooks/table"
import { delObj, fetchList, refreshCache } from "/@/api/admin/param"
import { useMessage, useMessageBox } from "/@/hooks/message"
import { useDict } from "/@/hooks/dict"
import { useI18n } from "vue-i18n"
// 引入组件
const FormDialog = defineAsyncComponent(() => import('./form.vue'));
const { t } = useI18n();
const FormDialog = defineAsyncComponent(() => import("./form.vue"))
const { t } = useI18n()
// 定义查询字典
const { dict_type, status_type } = useDict('dict_type', 'status_type');
const { dict_type, status_type } = useDict("dict_type", "status_type")
// 定义变量内容
const formDialogRef = ref();
const formDialogRef = 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 state: BasicTableProps = reactive<BasicTableProps>({
queryForm: {
systemFlag: '',
systemFlag: "",
},
pageList: fetchList,
descs: ['create_time'],
});
descs: ["create_time"],
})
// 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()
}
// 是否可以多选
const handleSelectable = (row: any) => {
// 系统类不可多选删除
return row.systemFlag !== '1';
};
return row.systemFlag !== "1"
}
// 导出excel
const exportExcel = () => {
downBlobFile('/admin/param/export', Object.assign(state.queryForm,{ids:selectObjs}), 'param.xlsx');
};
downBlobFile("/admin/param/export", Object.assign(state.queryForm, { ids: selectObjs }), "参数管理.xlsx")
}
const handleRefreshCache = () => {
refreshCache().then(() => {
useMessage().success('同步成功');
});
};
useMessage().success("同步成功")
})
}
// 多选事件
const handleSelectionChange = (objs: { publicId: string }[]) => {
selectObjs.value = objs.map(({ publicId }) => publicId);
multiple.value = !objs.length;
};
selectObjs.value = objs.map(({ publicId }) => publicId)
multiple.value = !objs.length
}
// 删除操作
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)
}
};
}
</script>
+140 -120
View File
@@ -1,95 +1,122 @@
<template>
<div class="layout-padding">
<div class="layout-padding-auto layout-padding-view">
<el-row v-show="showSearch">
<el-form :model="state.queryForm" ref="queryRef" :inline="true" @keyup.enter="getDataList">
<el-form-item label="敏感词" prop="sensitiveWord">
<el-input placeholder="请输入敏感词" v-model="state.queryForm.sensitiveWord"/>
</el-form-item>
<el-form-item label="类型" prop="sensitiveType">
<el-radio-group v-model="state.queryForm.sensitiveType">
<el-radio :label="item.value" v-for="(item, index) in sensitive_type" border :key="index">{{ item.label }}
</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item>
<el-button icon="search" type="primary" @click="getDataList">
查询
</el-button>
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
</el-row>
<el-row>
<div class="mb8" style="width: 100%">
<el-button icon="folder-add" type="primary" class="ml10" @click="formDialogRef.openDialog()"
v-auth="'admin_sysSensitiveWord_add'">
新 增
</el-button>
<el-button plain :disabled="multiple" icon="Delete" type="primary"
v-auth="'admin_sysSensitiveWord_del'" @click="handleDelete(selectObjs)">
删 除
</el-button>
<el-button plain icon="Check" type="primary"
v-auth="'admin_sysSensitiveWord_del'" @click="matchDialogRef.openDialog()">
匹配测试
</el-button>
<el-button plain @click="handleRefreshCache()" class="ml10" icon="refresh-left" type="primary">
{{ $t('common.refreshCacheBtn') }}
</el-button>
<div class="layout-padding">
<div class="layout-padding-auto layout-padding-view">
<el-row v-show="showSearch">
<el-form :model="state.queryForm" ref="queryRef" :inline="true" @keyup.enter="getDataList">
<el-form-item label="敏感词" prop="sensitiveWord">
<el-input placeholder="请输入敏感词" v-model="state.queryForm.sensitiveWord" />
</el-form-item>
<el-form-item label="类型" prop="sensitiveType">
<el-radio-group v-model="state.queryForm.sensitiveType">
<el-radio :label="item.value" v-for="(item, index) in sensitive_type" border :key="index">{{ item.label }} </el-radio>
</el-radio-group>
</el-form-item>
<el-form-item>
<el-button icon="search" type="primary" @click="getDataList"> 查询 </el-button>
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
</el-row>
<el-row>
<div class="mb8" style="width: 100%">
<el-button
icon="folder-add"
type="primary"
class="ml10"
@click="formDialogRef.openDialog()"
v-auth="'admin_sysSensitiveWord_add'"
>
新 增
</el-button>
<el-button
plain
:disabled="multiple"
icon="Delete"
type="primary"
v-auth="'admin_sysSensitiveWord_del'"
@click="handleDelete(selectObjs)"
>
删 除
</el-button>
<el-button plain icon="Check" type="primary" v-auth="'admin_sysSensitiveWord_del'" @click="matchDialogRef.openDialog()">
匹配测试
</el-button>
<el-button plain @click="handleRefreshCache()" class="ml10" icon="refresh-left" type="primary">
{{ $t("common.refreshCacheBtn") }}
</el-button>
<right-toolbar v-model:showSearch="showSearch" :export="'admin_sysSensitiveWord_export'"
@exportExcel="exportExcel" class="ml10 mr20" style="float: right;"
@queryTable="getDataList"></right-toolbar>
</div>
</el-row>
<el-table :data="state.dataList" v-loading="state.loading" border
:cell-style="tableStyle.cellStyle" :header-cell-style="tableStyle.headerCellStyle"
@selection-change="selectionChangHandle"
@sort-change="sortChangeHandle">
<el-table-column type="selection" width="40" align="center"/>
<el-table-column type="index" label="#" width="40"/>
<el-table-column prop="sensitiveWord" label="敏感词" show-overflow-tooltip/>
<el-table-column prop="sensitiveType" label="类型" show-overflow-tooltip>
<template #default="scope">
<dict-tag :options="sensitive_type" :value="scope.row.sensitiveType"></dict-tag>
</template>
</el-table-column>
<el-table-column prop="remark" label="备注" width="200" show-overflow-tooltip/>
<el-table-column label="操作" width="150">
<template #default="scope">
<el-button icon="edit-pen" text type="primary" v-auth="'admin_sysSensitiveWord_edit'"
@click="formDialogRef.openDialog(scope.row.sensitiveId)">编辑
</el-button>
<el-button icon="delete" text type="primary" v-auth="'admin_sysSensitiveWord_del'"
@click="handleDelete([scope.row.sensitiveId])">删除
</el-button>
</template>
</el-table-column>
</el-table>
<pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle" v-bind="state.pagination"/>
</div>
<right-toolbar
v-model:showSearch="showSearch"
:export="'admin_sysSensitiveWord_export'"
@exportExcel="exportExcel"
class="ml10 mr20"
style="float: right"
@queryTable="getDataList"
></right-toolbar>
</div>
</el-row>
<el-table
:data="state.dataList"
v-loading="state.loading"
border
:cell-style="tableStyle.cellStyle"
:header-cell-style="tableStyle.headerCellStyle"
@selection-change="selectionChangHandle"
@sort-change="sortChangeHandle"
>
<el-table-column type="selection" width="40" align="center" />
<el-table-column type="index" label="#" width="40" />
<el-table-column prop="sensitiveWord" label="敏感词" show-overflow-tooltip />
<el-table-column prop="sensitiveType" label="类型" show-overflow-tooltip>
<template #default="scope">
<dict-tag :options="sensitive_type" :value="scope.row.sensitiveType"></dict-tag>
</template>
</el-table-column>
<el-table-column prop="remark" label="备注" width="200" show-overflow-tooltip />
<el-table-column label="操作" width="150">
<template #default="scope">
<el-button
icon="edit-pen"
text
type="primary"
v-auth="'admin_sysSensitiveWord_edit'"
@click="formDialogRef.openDialog(scope.row.sensitiveId)"
>编辑
</el-button>
<el-button
icon="delete"
text
type="primary"
v-auth="'admin_sysSensitiveWord_del'"
@click="handleDelete([scope.row.sensitiveId])"
>删除
</el-button>
</template>
</el-table-column>
</el-table>
<pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle" v-bind="state.pagination" />
</div>
<!-- 编辑、新增 -->
<form-dialog ref="formDialogRef" @refresh="getDataList(false)"/>
<!-- 编辑、新增 -->
<form-dialog ref="formDialogRef" @refresh="getDataList(false)" />
<!-- 匹配测试 -->
<match-dialog ref="matchDialogRef" @refresh="getDataList(false)"/>
</div>
<!-- 匹配测试 -->
<match-dialog ref="matchDialogRef" @refresh="getDataList(false)" />
</div>
</template>
<script setup lang="ts" name="systemSysSensitiveWord">
import {BasicTableProps, useTable} from "/@/hooks/table";
import {fetchList, delObjs, refreshObj} from "/@/api/admin/sensitive";
import {useMessage, useMessageBox} from "/@/hooks/message";
import {useDict} from '/@/hooks/dict';
import { BasicTableProps, useTable } from "/@/hooks/table"
import { fetchList, delObjs, refreshObj } from "/@/api/admin/sensitive"
import { useMessage, useMessageBox } from "/@/hooks/message"
import { useDict } from "/@/hooks/dict"
// 引入组件
const FormDialog = defineAsyncComponent(() => import('./form.vue'));
const MatchDialog = defineAsyncComponent(() => import('./match.vue'));
const FormDialog = defineAsyncComponent(() => import("./form.vue"))
const MatchDialog = defineAsyncComponent(() => import("./match.vue"))
// 定义查询字典
const {sensitive_type} = useDict('sensitive_type')
const { sensitive_type } = useDict("sensitive_type")
// 定义变量内容
const formDialogRef = ref()
const matchDialogRef = ref()
@@ -101,65 +128,58 @@ const selectObjs = ref([]) as any
const multiple = ref(true)
const state: BasicTableProps = reactive<BasicTableProps>({
queryForm: {},
pageList: fetchList
queryForm: {},
pageList: fetchList,
})
// table hook
const {
getDataList,
currentChangeHandle,
sizeChangeHandle,
sortChangeHandle,
downBlobFile,
tableStyle
} = useTable(state)
const { getDataList, currentChangeHandle, sizeChangeHandle, sortChangeHandle, downBlobFile, tableStyle } = useTable(state)
// 清空搜索条件
const resetQuery = () => {
// 清空搜索条件
queryRef.value?.resetFields()
// 清空多选
selectObjs.value = []
getDataList()
// 清空搜索条件
queryRef.value?.resetFields()
// 清空多选
selectObjs.value = []
getDataList()
}
// 导出excel
const exportExcel = () => {
downBlobFile('/admin/sysSensitiveWord/export', Object.assign(state.queryForm, {ids: selectObjs}), 'sysSensitiveWord.xlsx')
downBlobFile("/admin/sysSensitiveWord/export", Object.assign(state.queryForm, { ids: selectObjs }), "敏感词管理.xlsx")
}
// 多选事件
const selectionChangHandle = (objs: { sensitiveId: string }[]) => {
selectObjs.value = objs.map(({sensitiveId}) => sensitiveId);
multiple.value = !objs.length;
};
selectObjs.value = objs.map(({ sensitiveId }) => sensitiveId)
multiple.value = !objs.length
}
// 删除操作
const handleDelete = async (ids: string[]) => {
try {
await useMessageBox().confirm('此操作将永久删除');
} catch {
return;
}
try {
await useMessageBox().confirm("此操作将永久删除")
} catch {
return
}
try {
await delObjs(ids);
getDataList();
useMessage().success('删除成功');
} catch (err: any) {
useMessage().error(err.msg);
}
};
try {
await delObjs(ids)
getDataList()
useMessage().success("删除成功")
} catch (err: any) {
useMessage().error(err.msg)
}
}
// 刷新缓存
const handleRefreshCache = async () => {
try {
await refreshObj();
getDataList();
useMessage().success('刷新成功');
} catch (err: any) {
useMessage().error(err.msg);
}
try {
await refreshObj()
getDataList()
useMessage().success("刷新成功")
} catch (err: any) {
useMessage().error(err.msg)
}
}
</script>
+44 -39
View File
@@ -10,16 +10,16 @@
</el-form-item>
<el-form-item>
<el-button formDialogRef icon="search" type="primary" @click="getDataList">
{{ $t('common.queryBtn') }}
{{ $t("common.queryBtn") }}
</el-button>
<el-button formDialogRef icon="Refresh" @click="resetQuery">{{ $t('common.resetBtn') }}</el-button>
<el-button formDialogRef icon="Refresh" @click="resetQuery">{{ $t("common.resetBtn") }}</el-button>
</el-form-item>
</el-form>
</el-row>
<el-row>
<div class="mb8" style="width: 100%">
<el-button v-auth="'sys_social_details_add'" class="ml10" icon="folder-add" type="primary" @click="formDialogRef.openDialog()">
{{ $t('common.addBtn') }}
{{ $t("common.addBtn") }}
</el-button>
<el-button
v-auth="'sys_social_details_del'"
@@ -29,7 +29,7 @@
type="primary"
@click="handleDelete(selectObjs)"
>
{{ $t('common.delBtn') }}
{{ $t("common.delBtn") }}
</el-button>
<right-toolbar
:export="'sys_social_details_del'"
@@ -45,7 +45,7 @@
v-loading="state.loading"
:data="state.dataList"
style="width: 100%"
row-key="id"
row-key="id"
@selection-change="handleSelectionChange"
border
:cell-style="tableStyle.cellStyle"
@@ -64,11 +64,16 @@
<el-table-column :label="t('social.createTime')" prop="createTime" show-overflow-tooltip />
<el-table-column :label="$t('common.action')" width="150">
<template #default="scope">
<el-button icon="edit-pen" v-auth="'sys_social_details_edit'" text type="primary" @click="formDialogRef.openDialog(scope.row.id)"
>{{ $t('common.editBtn') }}
<el-button
icon="edit-pen"
v-auth="'sys_social_details_edit'"
text
type="primary"
@click="formDialogRef.openDialog(scope.row.id)"
>{{ $t("common.editBtn") }}
</el-button>
<el-button icon="delete" v-auth="'sys_social_details_del'" text type="primary" @click="handleDelete([scope.row.id])"
>{{ $t('common.delBtn') }}
>{{ $t("common.delBtn") }}
</el-button>
</template>
</el-table-column>
@@ -82,67 +87,67 @@
</template>
<script lang="ts" name="systemAppSocialDetails" setup>
import { BasicTableProps, useTable } from '/@/hooks/table';
import { delObj, fetchList } from '/@/api/admin/social';
import { useMessage, useMessageBox } from '/@/hooks/message';
import { useDict } from '/@/hooks/dict';
import { useI18n } from 'vue-i18n';
import { BasicTableProps, useTable } from "/@/hooks/table"
import { delObj, fetchList } from "/@/api/admin/social"
import { useMessage, useMessageBox } from "/@/hooks/message"
import { useDict } from "/@/hooks/dict"
import { useI18n } from "vue-i18n"
// 引入组件
const FormDialog = defineAsyncComponent(() => import('./form.vue'));
const { t } = useI18n();
const FormDialog = defineAsyncComponent(() => import("./form.vue"))
const { t } = useI18n()
// 定义查询字典
const { social_type } = useDict('social_type');
const { social_type } = useDict("social_type")
// 定义变量内容
const formDialogRef = ref();
const formDialogRef = 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 state: BasicTableProps = reactive<BasicTableProps>({
queryForm: {},
pageList: fetchList,
descs: ['create_time'],
});
descs: ["create_time"],
})
// 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/social/export', Object.assign(state.queryForm,{ids:selectObjs}), 'social.xlsx');
};
downBlobFile("/admin/social/export", Object.assign(state.queryForm, { ids: selectObjs }), "密钥管理.xlsx")
}
// 多选事件
const handleSelectionChange = (objs: { id: string }[]) => {
selectObjs.value = objs.map(({ id }) => id);
multiple.value = !objs.length;
};
selectObjs.value = objs.map(({ id }) => id)
multiple.value = !objs.length
}
// 删除操作
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)
}
};
}
</script>
+127 -128
View File
@@ -1,103 +1,109 @@
<template>
<div class="layout-padding">
<div class="layout-padding-auto layout-padding-view">
<el-row v-show="showSearch">
<el-form :model="state.queryForm" ref="queryRef" :inline="true" @keyup.enter="getDataList">
<el-form-item :label="t('area.pid')" prop="adcode">
<china-area :type="3" :placeholder="t('area.inputPidByTip')" v-model="pid" :plus="true" @change="handleChange"/>
</el-form-item>
<el-form-item :label="t('area.name')" prop="name">
<el-input :placeholder="t('area.inputNameByTip')" v-model="state.queryForm.name"/>
</el-form-item>
<el-form-item>
<el-button icon="search" type="primary" @click="getDataList">
{{ $t('common.queryBtn') }}
</el-button>
<el-button icon="Refresh" @click="resetQuery">{{ $t('common.resetBtn') }}</el-button>
</el-form-item>
</el-form>
</el-row>
<el-row>
<div class="mb8" style="width: 100%">
<el-button icon="folder-add" type="primary" class="ml10" @click="formDialogRef.openDialog()"
v-auth="'sys_sysArea_add'">
{{ $t('common.addBtn') }}
</el-button>
<el-button plain :disabled="multiple" icon="Delete" type="primary"
v-auth="'sys_sysArea_del'" @click="handleDelete(selectObjs)">
{{ $t('common.delBtn') }}
</el-button>
<right-toolbar v-model:showSearch="showSearch" :export="'sys_sysArea_export'"
@exportExcel="exportExcel" class="ml10 mr20" style="float: right;"
@queryTable="getDataList"></right-toolbar>
</div>
</el-row>
<el-table :data="state.dataList" v-loading="state.loading" border
:cell-style="tableStyle.cellStyle" :header-cell-style="tableStyle.headerCellStyle"
@selection-change="selectionChangHandle"
@sort-change="sortChangeHandle">
<el-table-column type="selection" width="40" align="center"/>
<el-table-column type="index" label="#" width="40"/>
<el-table-column prop="name" :label="t('area.name')" show-overflow-tooltip/>
<el-table-column prop="adcode" :label="t('area.adcode')" show-overflow-tooltip/>
<el-table-column prop="areaType" :label="t('area.areaType')" show-overflow-tooltip>
<template #default="scope">
<dict-tag :options="area_type_dict" :value="scope.row.areaType"></dict-tag>
</template>
</el-table-column>
<el-table-column prop="hot" :label="t('area.hot')" show-overflow-tooltip>
<template #default="scope">
<dict-tag :options="yes_no_type" :value="scope.row.hot"></dict-tag>
</template>
</el-table-column>
<el-table-column prop="areaStatus" :label="t('area.areaStatus')" show-overflow-tooltip>
<template #default="scope">
<dict-tag :options="yes_no_type" :value="scope.row.areaStatus"></dict-tag>
</template>
</el-table-column>
<el-table-column prop="areaSort" :label="t('area.areaSort')" width="100" sortable="custom"
show-overflow-tooltip/>
<el-table-column :label="$t('common.action')" width="150">
<template #default="scope">
<el-button icon="edit-pen" text type="primary" v-auth="'sys_sysArea_edit'"
@click="formDialogRef.openDialog(scope.row.id)">{{ $t('common.editBtn') }}
</el-button>
<el-button icon="delete" text type="primary" v-auth="'sys_sysArea_del'"
@click="handleDelete([scope.row.id])">{{ $t('common.delBtn') }}
</el-button>
</template>
</el-table-column>
</el-table>
<pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle" v-bind="state.pagination"/>
</div>
<div class="layout-padding">
<div class="layout-padding-auto layout-padding-view">
<el-row v-show="showSearch">
<el-form :model="state.queryForm" ref="queryRef" :inline="true" @keyup.enter="getDataList">
<el-form-item :label="t('area.pid')" prop="adcode">
<china-area :type="3" :placeholder="t('area.inputPidByTip')" v-model="pid" :plus="true" @change="handleChange" />
</el-form-item>
<el-form-item :label="t('area.name')" prop="name">
<el-input :placeholder="t('area.inputNameByTip')" v-model="state.queryForm.name" />
</el-form-item>
<el-form-item>
<el-button icon="search" type="primary" @click="getDataList">
{{ $t("common.queryBtn") }}
</el-button>
<el-button icon="Refresh" @click="resetQuery">{{ $t("common.resetBtn") }}</el-button>
</el-form-item>
</el-form>
</el-row>
<el-row>
<div class="mb8" style="width: 100%">
<el-button icon="folder-add" type="primary" class="ml10" @click="formDialogRef.openDialog()" v-auth="'sys_sysArea_add'">
{{ $t("common.addBtn") }}
</el-button>
<el-button plain :disabled="multiple" icon="Delete" type="primary" v-auth="'sys_sysArea_del'" @click="handleDelete(selectObjs)">
{{ $t("common.delBtn") }}
</el-button>
<right-toolbar
v-model:showSearch="showSearch"
:export="'sys_sysArea_export'"
@exportExcel="exportExcel"
class="ml10 mr20"
style="float: right"
@queryTable="getDataList"
></right-toolbar>
</div>
</el-row>
<el-table
:data="state.dataList"
v-loading="state.loading"
border
:cell-style="tableStyle.cellStyle"
:header-cell-style="tableStyle.headerCellStyle"
@selection-change="selectionChangHandle"
@sort-change="sortChangeHandle"
>
<el-table-column type="selection" width="40" align="center" />
<el-table-column type="index" label="#" width="40" />
<el-table-column prop="name" :label="t('area.name')" show-overflow-tooltip />
<el-table-column prop="adcode" :label="t('area.adcode')" show-overflow-tooltip />
<el-table-column prop="areaType" :label="t('area.areaType')" show-overflow-tooltip>
<template #default="scope">
<dict-tag :options="area_type_dict" :value="scope.row.areaType"></dict-tag>
</template>
</el-table-column>
<el-table-column prop="hot" :label="t('area.hot')" show-overflow-tooltip>
<template #default="scope">
<dict-tag :options="yes_no_type" :value="scope.row.hot"></dict-tag>
</template>
</el-table-column>
<el-table-column prop="areaStatus" :label="t('area.areaStatus')" show-overflow-tooltip>
<template #default="scope">
<dict-tag :options="yes_no_type" :value="scope.row.areaStatus"></dict-tag>
</template>
</el-table-column>
<el-table-column prop="areaSort" :label="t('area.areaSort')" width="100" sortable="custom" show-overflow-tooltip />
<el-table-column :label="$t('common.action')" width="150">
<template #default="scope">
<el-button icon="edit-pen" text type="primary" v-auth="'sys_sysArea_edit'" @click="formDialogRef.openDialog(scope.row.id)"
>{{ $t("common.editBtn") }}
</el-button>
<el-button icon="delete" text type="primary" v-auth="'sys_sysArea_del'" @click="handleDelete([scope.row.id])"
>{{ $t("common.delBtn") }}
</el-button>
</template>
</el-table-column>
</el-table>
<pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle" v-bind="state.pagination" />
</div>
<!-- 编辑、新增 -->
<form-dialog ref="formDialogRef" @refresh="getDataList(false)"/>
</div>
<!-- 编辑、新增 -->
<form-dialog ref="formDialogRef" @refresh="getDataList(false)" />
</div>
</template>
<script setup lang="ts" name="systemSysArea">
import {BasicTableProps, useTable} from "/@/hooks/table";
import {delObjs, fetchList} from "/@/api/admin/sysArea";
import {useMessage, useMessageBox} from "/@/hooks/message";
import {useDict} from '/@/hooks/dict';
import {useI18n} from "vue-i18n";
import { BasicTableProps, useTable } from "/@/hooks/table"
import { delObjs, fetchList } from "/@/api/admin/sysArea"
import { useMessage, useMessageBox } from "/@/hooks/message"
import { useDict } from "/@/hooks/dict"
import { useI18n } from "vue-i18n"
const {t} = useI18n();
const { t } = useI18n()
// 省市区查询组件
const ChinaArea = defineAsyncComponent(() => import("/@/components/ChinaArea/index.vue"));
const ChinaArea = defineAsyncComponent(() => import("/@/components/ChinaArea/index.vue"))
// 引入组件
const FormDialog = defineAsyncComponent(() => import('./form.vue'));
const FormDialog = defineAsyncComponent(() => import("./form.vue"))
// 定义查询字典
const {yes_no_type} = useDict('yes_no_type');
const { yes_no_type } = useDict("yes_no_type")
const area_type_dict = [
{value: '0', label: '国家'},
{value: '1', label: '省份'},
{value: '2', label: '城市'},
{value: '3', label: '县区'},
{value: '4', label: '街道'}
{ value: "0", label: "国家" },
{ value: "1", label: "省份" },
{ value: "2", label: "城市" },
{ value: "3", label: "县区" },
{ value: "4", label: "街道" },
]
// 定义变量内容
const formDialogRef = ref()
@@ -110,65 +116,58 @@ const multiple = ref(true)
const pid = ref()
const state: BasicTableProps = reactive<BasicTableProps>({
queryForm: {
adcode: '',
name: ''
},
ascs: ['adcode'],
pageList: fetchList
queryForm: {
adcode: "",
name: "",
},
ascs: ["adcode"],
pageList: fetchList,
})
// table hook
const {
getDataList,
currentChangeHandle,
sizeChangeHandle,
sortChangeHandle,
downBlobFile,
tableStyle
} = useTable(state)
const { getDataList, currentChangeHandle, sizeChangeHandle, sortChangeHandle, downBlobFile, tableStyle } = useTable(state)
// 清空搜索条件
const resetQuery = () => {
// 清空搜索条件
queryRef.value?.resetFields()
pid.value = ''
// 清空多选
selectObjs.value = []
getDataList()
// 清空搜索条件
queryRef.value?.resetFields()
pid.value = ""
// 清空多选
selectObjs.value = []
getDataList()
}
// 导出excel
const exportExcel = () => {
downBlobFile('/admin/sysArea/export', Object.assign(state.queryForm, {ids: selectObjs}), 'sysArea.xlsx')
downBlobFile("/admin/sysArea/export", Object.assign(state.queryForm, { ids: selectObjs }), "行政区域.xlsx")
}
// 多选事件
const selectionChangHandle = (objs: { id: string }[]) => {
selectObjs.value = objs.map(({id}) => id);
multiple.value = !objs.length;
};
selectObjs.value = objs.map(({ id }) => id)
multiple.value = !objs.length
}
// 删除操作
const handleDelete = async (ids: string[]) => {
try {
await useMessageBox().confirm(t('common.delConfirmText'));
} catch {
return;
}
try {
await useMessageBox().confirm(t("common.delConfirmText"))
} catch {
return
}
try {
await delObjs(ids);
getDataList();
useMessage().success(t('common.delSuccessText'));
} catch (err: any) {
useMessage().error(err.msg);
}
};
try {
await delObjs(ids)
getDataList()
useMessage().success(t("common.delSuccessText"))
} catch (err: any) {
useMessage().error(err.msg)
}
}
// 地区查询
const handleChange = (data: string) => {
let dataArray = data.split(",");
state.queryForm.adcode = dataArray[dataArray.length - 1];
let dataArray = data.split(",")
state.queryForm.adcode = dataArray[dataArray.length - 1]
}
</script>
+2 -6
View File
@@ -4,11 +4,7 @@
<el-row shadow="hover" v-show="showSearch" class="ml10">
<el-form :model="state.queryForm" ref="queryRef" :inline="true" @keyup.enter="filter">
<el-form-item prop="deptName" :label="$t('sysdept.name')">
<el-input
:placeholder="$t('sysdept.inputdeptNameTip')"
style="max-width: 180px"
v-model="state.queryForm.deptName"
></el-input>
<el-input :placeholder="$t('sysdept.inputdeptNameTip')" style="max-width: 180px" v-model="state.queryForm.deptName"></el-input>
</el-form-item>
<el-form-item>
<el-button icon="search" type="primary" @click="filter">
@@ -121,7 +117,7 @@ const handleExpand = () => {
* 导出Excel
*/
const exportExcel = () => {
downBlobFile("/admin/dept/export", state.queryForm, "dept.xlsx")
downBlobFile("/admin/dept/export", state.queryForm, "部门管理.xlsx")
}
const getDataList = () => {
+46 -38
View File
@@ -8,22 +8,30 @@
</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_post_add'">
{{ $t('common.addBtn') }}
{{ $t("common.addBtn") }}
</el-button>
<el-button plain @click="excelUploadRef.show()" class="ml10" icon="upload-filled" type="primary" v-auth="'sys_post_add'">
{{ $t('common.importBtn') }}
{{ $t("common.importBtn") }}
</el-button>
<el-button plain :disabled="multiple" @click="handleDelete(selectObjs)" class="ml10" icon="Delete" type="primary" v-auth="'sys_post_del'">
{{ $t('common.delBtn') }}
<el-button
plain
:disabled="multiple"
@click="handleDelete(selectObjs)"
class="ml10"
icon="Delete"
type="primary"
v-auth="'sys_post_del'"
>
{{ $t("common.delBtn") }}
</el-button>
<right-toolbar
:export="'sys_post_export'"
@@ -40,7 +48,7 @@
@selection-change="handleSelectionChange"
style="width: 100%"
v-loading="state.loading"
row-key="postId"
row-key="postId"
border
:cell-style="tableStyle?.cellStyle"
:header-cell-style="tableStyle?.headerCellStyle"
@@ -54,11 +62,11 @@
<el-table-column :label="$t('common.action')" width="200">
<template #default="scope">
<el-button icon="edit-pen" @click="formDialogRef.openDialog(scope.row.postId)" text type="primary" v-auth="'sys_post_edit'"
>{{ $t('common.editBtn') }}
>{{ $t("common.editBtn") }}
</el-button>
<el-button icon="delete" @click="handleDelete([scope.row.postId])" text type="primary" v-auth="'sys_post_del'"
>{{ $t('common.delBtn') }}
>{{ $t("common.delBtn") }}
</el-button>
</template>
</el-table-column>
@@ -80,64 +88,64 @@
</template>
<script lang="ts" name="systemPost" setup>
import { BasicTableProps, useTable } from '/@/hooks/table';
import { delObj, fetchList } from '/@/api/admin/post';
import { useMessage, useMessageBox } from '/@/hooks/message';
import { useI18n } from 'vue-i18n';
import { BasicTableProps, useTable } from "/@/hooks/table"
import { delObj, fetchList } from "/@/api/admin/post"
import { useMessage, useMessageBox } from "/@/hooks/message"
import { useI18n } from "vue-i18n"
// 引入组件
const FormDialog = defineAsyncComponent(() => import('./form.vue'));
const { t } = useI18n();
const FormDialog = defineAsyncComponent(() => import("./form.vue"))
const { t } = useI18n()
// 定义变量内容
const formDialogRef = ref();
const excelUploadRef = ref();
const formDialogRef = ref()
const excelUploadRef = 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 state: BasicTableProps = reactive<BasicTableProps>({
queryForm: {},
pageList: fetchList,
});
})
// 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/post/export', Object.assign(state.queryForm,{ids:selectObjs}), 'post.xlsx');
};
downBlobFile("/admin/post/export", Object.assign(state.queryForm, { ids: selectObjs }), "岗位管理.xlsx")
}
// 多选事件
const handleSelectionChange = (objs: { postId: string }[]) => {
selectObjs.value = objs.map(({ postId }) => postId);
multiple.value = !objs.length;
};
selectObjs.value = objs.map(({ postId }) => postId)
multiple.value = !objs.length
}
// 删除操作
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)
}
};
}
</script>
+67 -59
View File
@@ -8,22 +8,30 @@
</el-form-item>
<el-form-item>
<el-button icon="search" type="primary" @click="getDataList">
{{ $t('common.queryBtn') }}
{{ $t("common.queryBtn") }}
</el-button>
<el-button icon="Refresh" @click="resetQuery">{{ $t('common.resetBtn') }}</el-button>
<el-button icon="Refresh" @click="resetQuery">{{ $t("common.resetBtn") }}</el-button>
</el-form-item>
</el-form>
</el-row>
<el-row>
<div class="mb8" style="width: 100%">
<el-button icon="folder-add" type="primary" class="ml10" @click="roleDialogRef.openDialog()" v-auth="'sys_role_add'">
{{ $t('common.addBtn') }}
{{ $t("common.addBtn") }}
</el-button>
<el-button plain icon="upload-filled" type="primary" class="ml10" @click="excelUploadRef.show()" v-auth="'sys_user_add'">
{{ $t('common.importBtn') }}
{{ $t("common.importBtn") }}
</el-button>
<el-button plain :disabled="multiple" icon="Delete" type="primary" class="ml10" v-auth="'sys_user_del'" @click="handleDelete(selectObjs)">
{{ $t('common.delBtn') }}
<el-button
plain
:disabled="multiple"
icon="Delete"
type="primary"
class="ml10"
v-auth="'sys_user_del'"
@click="handleDelete(selectObjs)"
>
{{ $t("common.delBtn") }}
</el-button>
<right-toolbar
v-model:showSearch="showSearch"
@@ -39,8 +47,8 @@
:data="state.dataList"
v-loading="state.loading"
style="width: 100%"
row-key="roleId"
@selection-change="handleSelectionChange"
row-key="roleId"
@selection-change="handleSelectionChange"
border
:cell-style="tableStyle.cellStyle"
:header-cell-style="tableStyle.headerCellStyle"
@@ -59,11 +67,11 @@
<el-table-column :label="$t('common.action')" width="250">
<template #default="scope">
<el-button text type="primary" icon="edit-pen" v-auth="'sys_role_edit'" @click="roleDialogRef.openDialog(scope.row.roleId)">{{
$t('common.editBtn')
$t("common.editBtn")
}}</el-button>
<el-button text type="primary" icon="turn-off" v-auth="'sys_role_perm'" @click="permessionRef.openDialog(scope.row)">{{
$t('sysrole.permissionTip')
$t("sysrole.permissionTip")
}}</el-button>
<el-tooltip :content="$t('sysrole.deleteDisabledTip')" :disabled="scope.row.roleId !== '1'" placement="top">
@@ -75,7 +83,7 @@
:disabled="scope.row.roleId === '1'"
v-auth="'sys_role_del'"
@click="handleDelete([scope.row.roleId])"
>{{ $t('common.delBtn') }}
>{{ $t("common.delBtn") }}
</el-button>
</span>
</el-tooltip>
@@ -101,97 +109,97 @@
</template>
<script setup lang="ts" name="systemRole">
import { BasicTableProps, useTable } from '/@/hooks/table';
import { pageList, delObj } from '/@/api/admin/role';
import { useMessage, useMessageBox } from '/@/hooks/message';
import { useI18n } from 'vue-i18n';
import { BasicTableProps, useTable } from "/@/hooks/table"
import { pageList, delObj } from "/@/api/admin/role"
import { useMessage, useMessageBox } from "/@/hooks/message"
import { useI18n } from "vue-i18n"
// 引入组件
const RoleDialog = defineAsyncComponent(() => import('./form.vue'));
const Permession = defineAsyncComponent(() => import('./permession.vue'));
const { t } = useI18n();
const RoleDialog = defineAsyncComponent(() => import("./form.vue"))
const Permession = defineAsyncComponent(() => import("./permession.vue"))
const { t } = useI18n()
// 定义变量内容
const roleDialogRef = ref();
const permessionRef = ref();
const excelUploadRef = ref();
const queryRef = ref();
const showSearch = ref(true);
const roleDialogRef = ref()
const permessionRef = ref()
const excelUploadRef = ref()
const queryRef = ref()
const showSearch = ref(true)
// 多选rows
const selectObjs = ref([]) as any;
const selectObjs = ref([]) as any
// 是否可以多选
const multiple = ref(true);
const multiple = ref(true)
const state: BasicTableProps = reactive<BasicTableProps>({
queryForm: {
roleName: '',
roleName: "",
},
pageList: pageList, // H
descs: ['create_time'],
});
descs: ["create_time"],
})
const dictType = ref([
{
label: '全部',
value: '0',
label: "全部",
value: "0",
},
{
label: '自定义',
value: '1',
label: "自定义",
value: "1",
},
{
label: '本级及子级',
value: '2',
label: "本级及子级",
value: "2",
},
{
label: '本级',
value: '3',
label: "本级",
value: "3",
},
{
label: '本人',
value: '4',
},
]);
{
label: "本人",
value: "4",
},
])
// 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/role/export',Object.assign(state.queryForm,{ids:selectObjs}), 'role.xlsx');
};
downBlobFile("/admin/role/export", Object.assign(state.queryForm, { ids: selectObjs }), "角色管理.xlsx")
}
// 是否可以多选
const handleSelectable = (row: any) => {
return row.roleId !== '1';
};
return row.roleId !== "1"
}
// 多选事件
const handleSelectionChange = (objs: { roleId: string }[]) => {
selectObjs.value = objs.map(({ roleId }) => roleId);
multiple.value = !objs.length;
};
selectObjs.value = objs.map(({ roleId }) => roleId)
multiple.value = !objs.length
}
// 删除操作
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)
}
};
}
</script>
+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>
+1 -1
View File
@@ -243,7 +243,7 @@ const handleGetSelectNode = (curClickedNode: any, checkedTreeNodes: any, isDeepT
// 导出excel
const exportExcel = () => {
postDownBlobFile("/admin/user/export", Object.assign(state.queryForm, { ids: selectObjs }), "users.xlsx")
postDownBlobFile("/admin/user/export", Object.assign(state.queryForm, { ids: selectObjs }), "用户管理.xlsx")
}
// 是否可以多选