导出excel加上日期
This commit is contained in:
1 parent
8bdf76ae3a
commit
5dce0acf8c
67 files changed
+2300
-2278
No files matched your search
+3
-2
@@ -1,5 +1,6 @@
|
||||
import { CellStyle, ElMessage } from "element-plus"
|
||||
import other from "/@/utils/other"
|
||||
import { formatDate } from "../utils/formatTime"
|
||||
|
||||
/**
|
||||
* 表格组件基础配置属性
|
||||
@@ -220,11 +221,11 @@ export function useTable(options?: BasicTableProps) {
|
||||
*/
|
||||
const downBlobFile = (url: string, query: any, fileName: string) => {
|
||||
ElMessage.info("下载中,请稍后")
|
||||
return other.downBlobFile(url, query, fileName)
|
||||
return other.downBlobFile(url, query, formatDate(new Date(), "YYYY年mm月dd日") + " " + fileName)
|
||||
}
|
||||
|
||||
const postDownBlobFile = (url: string, data: any, fileName: string) => {
|
||||
return other.postDownBlobFile(url, data, fileName)
|
||||
return other.postDownBlobFile(url, data, formatDate(new Date(), "YYYY年mm月dd日") + " " + fileName)
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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>
|
||||
@@ -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>
|
||||
@@ -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>
|
||||
|
||||
@@ -171,7 +171,7 @@ const resetQuery = () => {
|
||||
|
||||
// 导出excel
|
||||
const exportExcel = () => {
|
||||
downBlobFile("/admin/log/export", state.queryForm, "log.xlsx")
|
||||
downBlobFile("/admin/log/export", state.queryForm, "操作日志.xlsx")
|
||||
}
|
||||
|
||||
// 多选事件
|
||||
|
||||
@@ -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
@@ -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>
|
||||
@@ -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
@@ -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>
|
||||
@@ -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 = () => {
|
||||
|
||||
@@ -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>
|
||||
@@ -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>
|
||||
@@ -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>
|
||||
@@ -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")
|
||||
}
|
||||
|
||||
// 是否可以多选
|
||||
|
||||
@@ -16,7 +16,13 @@
|
||||
</el-row>
|
||||
<el-row>
|
||||
<div class="mb8" style="width: 100%">
|
||||
<el-button icon="folder-add" type="primary" class="ml10" @click="formDialogRef.openDialog()" v-auth="'canteen_boxesAvailability_add'">
|
||||
<el-button
|
||||
icon="folder-add"
|
||||
type="primary"
|
||||
class="ml10"
|
||||
@click="formDialogRef.openDialog()"
|
||||
v-auth="'canteen_boxesAvailability_add'"
|
||||
>
|
||||
新 增
|
||||
</el-button>
|
||||
<el-button
|
||||
@@ -63,7 +69,13 @@
|
||||
<el-table-column prop="hourIndex" label="时间索引(0-24)" show-overflow-tooltip />
|
||||
<el-table-column label="操作" width="150">
|
||||
<template #default="scope">
|
||||
<el-button icon="edit-pen" text type="primary" v-auth="'canteen_boxesAvailability_edit'" @click="formDialogRef.openDialog(scope.row.id)">
|
||||
<el-button
|
||||
icon="edit-pen"
|
||||
text
|
||||
type="primary"
|
||||
v-auth="'canteen_boxesAvailability_edit'"
|
||||
@click="formDialogRef.openDialog(scope.row.id)"
|
||||
>
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button icon="delete" text type="primary" v-auth="'canteen_boxesAvailability_del'" @click="handleDelete([scope.row.id])">
|
||||
@@ -81,67 +93,67 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="systemBoxesAvailability">
|
||||
import { BasicTableProps, useTable } from '/@/hooks/table';
|
||||
import { fetchList, delObjs } from '/@/api/canteen/boxesAvailability';
|
||||
import { useMessage, useMessageBox } from '/@/hooks/message';
|
||||
import { useDict } from '/@/hooks/dict';
|
||||
import { BasicTableProps, useTable } from "/@/hooks/table"
|
||||
import { fetchList, delObjs } from "/@/api/canteen/boxesAvailability"
|
||||
import { useMessage, useMessageBox } from "/@/hooks/message"
|
||||
import { useDict } from "/@/hooks/dict"
|
||||
|
||||
// 引入组件
|
||||
const FormDialog = defineAsyncComponent(() => import('./form.vue'));
|
||||
const FormDialog = defineAsyncComponent(() => import("./form.vue"))
|
||||
// 定义查询字典
|
||||
|
||||
const { booking_status } = useDict('booking_status');
|
||||
const { booking_status } = useDict("booking_status")
|
||||
// 定义变量内容
|
||||
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,
|
||||
});
|
||||
})
|
||||
|
||||
// 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();
|
||||
queryRef.value?.resetFields()
|
||||
// 清空多选
|
||||
selectObjs.value = [];
|
||||
getDataList();
|
||||
};
|
||||
selectObjs.value = []
|
||||
getDataList()
|
||||
}
|
||||
|
||||
// 导出excel
|
||||
const exportExcel = () => {
|
||||
downBlobFile('/canteen/boxesAvailability/export', Object.assign(state.queryForm, { ids: selectObjs }), 'boxesAvailability.xlsx');
|
||||
};
|
||||
downBlobFile("/canteen/boxesAvailability/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('此操作将永久删除');
|
||||
await useMessageBox().confirm("此操作将永久删除")
|
||||
} catch {
|
||||
return;
|
||||
return
|
||||
}
|
||||
|
||||
try {
|
||||
await delObjs(ids);
|
||||
getDataList();
|
||||
useMessage().success('删除成功');
|
||||
await delObjs(ids)
|
||||
getDataList()
|
||||
useMessage().success("删除成功")
|
||||
} catch (err: any) {
|
||||
useMessage().error(err.msg);
|
||||
useMessage().error(err.msg)
|
||||
}
|
||||
};
|
||||
}
|
||||
</script>
|
||||
@@ -23,7 +23,14 @@
|
||||
<el-button icon="folder-add" type="primary" class="ml10" @click="formDialogRef.openDialog()" v-auth="'canteen_boxesBooking_add'">
|
||||
新 增
|
||||
</el-button>
|
||||
<el-button plain :disabled="multiple" icon="Delete" type="primary" v-auth="'canteen_boxesBooking_del'" @click="handleDelete(selectObjs)">
|
||||
<el-button
|
||||
plain
|
||||
:disabled="multiple"
|
||||
icon="Delete"
|
||||
type="primary"
|
||||
v-auth="'canteen_boxesBooking_del'"
|
||||
@click="handleDelete(selectObjs)"
|
||||
>
|
||||
删 除
|
||||
</el-button>
|
||||
<right-toolbar
|
||||
@@ -66,10 +73,18 @@
|
||||
<el-table-column prop="createTime" label="创建时间" show-overflow-tooltip min-width="160" />
|
||||
<el-table-column label="操作" width="150" fixed="right">
|
||||
<template #default="scope">
|
||||
<el-button icon="edit-pen" text type="primary" v-auth="'canteen_boxesBooking_edit'" @click="formDialogRef.openDialog(scope.row.id)">
|
||||
<el-button
|
||||
icon="edit-pen"
|
||||
text
|
||||
type="primary"
|
||||
v-auth="'canteen_boxesBooking_edit'"
|
||||
@click="formDialogRef.openDialog(scope.row.id)"
|
||||
>
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button icon="delete" text type="primary" v-auth="'canteen_boxesBooking_del'" @click="handleDelete([scope.row.id])">删除</el-button>
|
||||
<el-button icon="delete" text type="primary" v-auth="'canteen_boxesBooking_del'" @click="handleDelete([scope.row.id])"
|
||||
>删除</el-button
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -82,67 +97,67 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="systemBoxesBooking">
|
||||
import { BasicTableProps, useTable } from '/@/hooks/table';
|
||||
import { fetchList, delObjs } from '/@/api/canteen/boxesBooking';
|
||||
import { useMessage, useMessageBox } from '/@/hooks/message';
|
||||
import { useDict } from '/@/hooks/dict';
|
||||
import { BasicTableProps, useTable } from "/@/hooks/table"
|
||||
import { fetchList, delObjs } from "/@/api/canteen/boxesBooking"
|
||||
import { useMessage, useMessageBox } from "/@/hooks/message"
|
||||
import { useDict } from "/@/hooks/dict"
|
||||
|
||||
// 引入组件
|
||||
const FormDialog = defineAsyncComponent(() => import('./form.vue'));
|
||||
const FormDialog = defineAsyncComponent(() => import("./form.vue"))
|
||||
// 定义查询字典
|
||||
|
||||
const { check_status } = useDict('check_status');
|
||||
const { check_status } = useDict("check_status")
|
||||
// 定义变量内容
|
||||
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,
|
||||
});
|
||||
})
|
||||
|
||||
// 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();
|
||||
queryRef.value?.resetFields()
|
||||
// 清空多选
|
||||
selectObjs.value = [];
|
||||
getDataList();
|
||||
};
|
||||
selectObjs.value = []
|
||||
getDataList()
|
||||
}
|
||||
|
||||
// 导出excel
|
||||
const exportExcel = () => {
|
||||
downBlobFile('/canteen/boxesBooking/export', Object.assign(state.queryForm, { ids: selectObjs }), 'boxesBooking.xlsx');
|
||||
};
|
||||
downBlobFile("/canteen/boxesBooking/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('此操作将永久删除');
|
||||
await useMessageBox().confirm("此操作将永久删除")
|
||||
} catch {
|
||||
return;
|
||||
return
|
||||
}
|
||||
|
||||
try {
|
||||
await delObjs(ids);
|
||||
getDataList();
|
||||
useMessage().success('删除成功');
|
||||
await delObjs(ids)
|
||||
getDataList()
|
||||
useMessage().success("删除成功")
|
||||
} catch (err: any) {
|
||||
useMessage().error(err.msg);
|
||||
useMessage().error(err.msg)
|
||||
}
|
||||
};
|
||||
}
|
||||
</script>
|
||||
@@ -17,7 +17,14 @@
|
||||
<el-button icon="folder-add" type="primary" class="ml10" @click="formDialogRef.openDialog()" v-auth="'canteen_boxesInfo_add'">
|
||||
新 增
|
||||
</el-button>
|
||||
<el-button plain :disabled="multiple" icon="Delete" type="primary" v-auth="'canteen_boxesInfo_del'" @click="handleDelete(selectObjs)">
|
||||
<el-button
|
||||
plain
|
||||
:disabled="multiple"
|
||||
icon="Delete"
|
||||
type="primary"
|
||||
v-auth="'canteen_boxesInfo_del'"
|
||||
@click="handleDelete(selectObjs)"
|
||||
>
|
||||
删 除
|
||||
</el-button>
|
||||
<right-toolbar
|
||||
@@ -59,10 +66,18 @@
|
||||
<el-table-column prop="merchantId" label="商户id" show-overflow-tooltip />
|
||||
<el-table-column label="操作" width="150" fixed="right">
|
||||
<template #default="scope">
|
||||
<el-button icon="edit-pen" text type="primary" v-auth="'canteen_boxesInfo_edit'" @click="formDialogRef.openDialog(scope.row.id)">
|
||||
<el-button
|
||||
icon="edit-pen"
|
||||
text
|
||||
type="primary"
|
||||
v-auth="'canteen_boxesInfo_edit'"
|
||||
@click="formDialogRef.openDialog(scope.row.id)"
|
||||
>
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button icon="delete" text type="primary" v-auth="'canteen_boxesInfo_del'" @click="handleDelete([scope.row.id])">删除</el-button>
|
||||
<el-button icon="delete" text type="primary" v-auth="'canteen_boxesInfo_del'" @click="handleDelete([scope.row.id])"
|
||||
>删除</el-button
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -75,67 +90,67 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="systemBoxesInfo">
|
||||
import { BasicTableProps, useTable } from '/@/hooks/table';
|
||||
import { fetchList, delObjs } from '/@/api/canteen/boxesInfo';
|
||||
import { useMessage, useMessageBox } from '/@/hooks/message';
|
||||
import { useDict } from '/@/hooks/dict';
|
||||
import { BasicTableProps, useTable } from "/@/hooks/table"
|
||||
import { fetchList, delObjs } from "/@/api/canteen/boxesInfo"
|
||||
import { useMessage, useMessageBox } from "/@/hooks/message"
|
||||
import { useDict } from "/@/hooks/dict"
|
||||
|
||||
// 引入组件
|
||||
const FormDialog = defineAsyncComponent(() => import('./form.vue'));
|
||||
const FormDialog = defineAsyncComponent(() => import("./form.vue"))
|
||||
// 定义查询字典
|
||||
|
||||
const { boxes_status } = useDict('boxes_status');
|
||||
const { boxes_status } = useDict("boxes_status")
|
||||
// 定义变量内容
|
||||
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,
|
||||
});
|
||||
})
|
||||
|
||||
// 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();
|
||||
queryRef.value?.resetFields()
|
||||
// 清空多选
|
||||
selectObjs.value = [];
|
||||
getDataList();
|
||||
};
|
||||
selectObjs.value = []
|
||||
getDataList()
|
||||
}
|
||||
|
||||
// 导出excel
|
||||
const exportExcel = () => {
|
||||
downBlobFile('/canteen/boxesInfo/export', Object.assign(state.queryForm, { ids: selectObjs }), 'boxesInfo.xlsx');
|
||||
};
|
||||
downBlobFile("/canteen/boxesInfo/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('此操作将永久删除');
|
||||
await useMessageBox().confirm("此操作将永久删除")
|
||||
} catch {
|
||||
return;
|
||||
return
|
||||
}
|
||||
|
||||
try {
|
||||
await delObjs(ids);
|
||||
getDataList();
|
||||
useMessage().success('删除成功');
|
||||
await delObjs(ids)
|
||||
getDataList()
|
||||
useMessage().success("删除成功")
|
||||
} catch (err: any) {
|
||||
useMessage().error(err.msg);
|
||||
useMessage().error(err.msg)
|
||||
}
|
||||
};
|
||||
}
|
||||
</script>
|
||||
@@ -7,9 +7,7 @@
|
||||
<el-input placeholder="请输入分类名称" v-model="state.queryForm.name" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button icon="search" type="primary" @click="getDataList" v-auth="'canteen_canteenCategory_view'">
|
||||
查询
|
||||
</el-button>
|
||||
<el-button icon="search" type="primary" @click="getDataList" v-auth="'canteen_canteenCategory_view'"> 查询 </el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery" v-auth="'canteen_canteenCategory_view'">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
@@ -81,13 +79,7 @@
|
||||
>
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
icon="delete"
|
||||
text
|
||||
type="primary"
|
||||
v-auth="'canteen_canteenCategory_del'"
|
||||
@click="handleDelete([scope.row.id])"
|
||||
>
|
||||
<el-button icon="delete" text type="primary" v-auth="'canteen_canteenCategory_del'" @click="handleDelete([scope.row.id])">
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
@@ -126,8 +118,7 @@ const state: BasicTableProps = reactive<BasicTableProps>({
|
||||
})
|
||||
|
||||
// table hook
|
||||
const { getDataList, currentChangeHandle, sizeChangeHandle, sortChangeHandle, downBlobFile, tableStyle } =
|
||||
useTable(state)
|
||||
const { getDataList, currentChangeHandle, sizeChangeHandle, sortChangeHandle, downBlobFile, tableStyle } = useTable(state)
|
||||
|
||||
// 清空搜索条件
|
||||
const resetQuery = () => {
|
||||
@@ -140,11 +131,7 @@ const resetQuery = () => {
|
||||
|
||||
// 导出excel
|
||||
const exportExcel = () => {
|
||||
downBlobFile(
|
||||
"/canteen/canteenCategory/export",
|
||||
Object.assign(state.queryForm, { ids: selectObjs }),
|
||||
"canteenCategory.xlsx",
|
||||
)
|
||||
downBlobFile("/canteen/canteenCategory/export", Object.assign(state.queryForm, { ids: selectObjs }), "每日菜品分类.xlsx")
|
||||
}
|
||||
|
||||
// 多选事件
|
||||
|
||||
@@ -7,9 +7,7 @@
|
||||
<el-input placeholder="请输入分类名称" v-model="state.queryForm.name" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button icon="search" type="primary" @click="getDataList" v-auth="'canteen_canteenOnlineCategory_view'">
|
||||
查询
|
||||
</el-button>
|
||||
<el-button icon="search" type="primary" @click="getDataList" v-auth="'canteen_canteenOnlineCategory_view'"> 查询 </el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery" v-auth="'canteen_canteenOnlineCategory_view'">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
@@ -75,13 +73,7 @@
|
||||
>
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
icon="delete"
|
||||
text
|
||||
type="primary"
|
||||
v-auth="'canteen_canteenOnlineCategory_del'"
|
||||
@click="handleDelete([scope.row.id])"
|
||||
>
|
||||
<el-button icon="delete" text type="primary" v-auth="'canteen_canteenOnlineCategory_del'" @click="handleDelete([scope.row.id])">
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
@@ -118,8 +110,7 @@ const state: BasicTableProps = reactive<BasicTableProps>({
|
||||
})
|
||||
|
||||
// table hook
|
||||
const { getDataList, currentChangeHandle, sizeChangeHandle, sortChangeHandle, downBlobFile, tableStyle } =
|
||||
useTable(state)
|
||||
const { getDataList, currentChangeHandle, sizeChangeHandle, sortChangeHandle, downBlobFile, tableStyle } = useTable(state)
|
||||
|
||||
// 清空搜索条件
|
||||
const resetQuery = () => {
|
||||
@@ -132,11 +123,7 @@ const resetQuery = () => {
|
||||
|
||||
// 导出excel
|
||||
const exportExcel = () => {
|
||||
downBlobFile(
|
||||
"/canteen/canteenOnlineCategory/export",
|
||||
Object.assign(state.queryForm, { ids: selectObjs }),
|
||||
"canteenOnlineCategory.xlsx",
|
||||
)
|
||||
downBlobFile("/canteen/canteenOnlineCategory/export", Object.assign(state.queryForm, { ids: selectObjs }), "线上菜品分类.xlsx")
|
||||
}
|
||||
|
||||
// 多选事件
|
||||
|
||||
@@ -10,9 +10,7 @@
|
||||
<select-ctcgol v-model="state.queryForm.categoryId" style="width: 200px" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button icon="search" type="primary" @click="getDataList" v-auth="'canteen_canteenOnlineSpu_view'">
|
||||
查询
|
||||
</el-button>
|
||||
<el-button icon="search" type="primary" @click="getDataList" v-auth="'canteen_canteenOnlineSpu_view'"> 查询 </el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery" v-auth="'canteen_canteenOnlineSpu_view'">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
@@ -100,13 +98,7 @@
|
||||
>
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
icon="delete"
|
||||
text
|
||||
type="primary"
|
||||
v-auth="'canteen_canteenOnlineSpu_del'"
|
||||
@click="handleDelete([scope.row.id])"
|
||||
>
|
||||
<el-button icon="delete" text type="primary" v-auth="'canteen_canteenOnlineSpu_del'" @click="handleDelete([scope.row.id])">
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
@@ -156,8 +148,7 @@ onMounted(async () => {
|
||||
})
|
||||
|
||||
// table hook
|
||||
const { getDataList, currentChangeHandle, sizeChangeHandle, sortChangeHandle, downBlobFile, tableStyle } =
|
||||
useTable(state)
|
||||
const { getDataList, currentChangeHandle, sizeChangeHandle, sortChangeHandle, downBlobFile, tableStyle } = useTable(state)
|
||||
|
||||
// 清空搜索条件
|
||||
const resetQuery = () => {
|
||||
@@ -170,11 +161,7 @@ const resetQuery = () => {
|
||||
|
||||
// 导出excel
|
||||
const exportExcel = () => {
|
||||
downBlobFile(
|
||||
"/canteen/canteenOnlineSpu/export",
|
||||
Object.assign(state.queryForm, { ids: selectObjs }),
|
||||
"canteenOnlineSpu.xlsx",
|
||||
)
|
||||
downBlobFile("/canteen/canteenOnlineSpu/export", Object.assign(state.queryForm, { ids: selectObjs }), "线上菜品列表.xlsx")
|
||||
}
|
||||
|
||||
// 多选事件
|
||||
|
||||
@@ -10,22 +10,14 @@
|
||||
<select-ctcg v-model="state.queryForm.categoryId" style="width: 200px" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button icon="search" type="primary" @click="getDataList" v-auth="'canteen_canteenSpu_view'">
|
||||
查询
|
||||
</el-button>
|
||||
<el-button icon="search" type="primary" @click="getDataList" v-auth="'canteen_canteenSpu_view'"> 查询 </el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery" v-auth="'canteen_canteenSpu_view'">重置</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="'canteen_canteenSpu_add'"
|
||||
>
|
||||
<el-button icon="folder-add" type="primary" class="ml10" @click="formDialogRef.openDialog()" v-auth="'canteen_canteenSpu_add'">
|
||||
新 增
|
||||
</el-button>
|
||||
<el-button
|
||||
@@ -104,13 +96,7 @@
|
||||
>
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
icon="delete"
|
||||
text
|
||||
type="primary"
|
||||
v-auth="'canteen_canteenSpu_del'"
|
||||
@click="handleDelete([scope.row.id])"
|
||||
>
|
||||
<el-button icon="delete" text type="primary" v-auth="'canteen_canteenSpu_del'" @click="handleDelete([scope.row.id])">
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
@@ -161,8 +147,7 @@ onMounted(async () => {
|
||||
})
|
||||
|
||||
// table hook
|
||||
const { getDataList, currentChangeHandle, sizeChangeHandle, sortChangeHandle, downBlobFile, tableStyle } =
|
||||
useTable(state)
|
||||
const { getDataList, currentChangeHandle, sizeChangeHandle, sortChangeHandle, downBlobFile, tableStyle } = useTable(state)
|
||||
|
||||
// 清空搜索条件
|
||||
const resetQuery = () => {
|
||||
@@ -175,7 +160,7 @@ const resetQuery = () => {
|
||||
|
||||
// 导出excel
|
||||
const exportExcel = () => {
|
||||
downBlobFile("/canteen/canteenSpu/export", Object.assign(state.queryForm, { ids: selectObjs }), "canteenSpu.xlsx")
|
||||
downBlobFile("/canteen/canteenSpu/export", Object.assign(state.queryForm, { ids: selectObjs }), "菜品列表.xlsx")
|
||||
}
|
||||
|
||||
// 多选事件
|
||||
|
||||
@@ -1,100 +1,121 @@
|
||||
<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="name">
|
||||
<el-select @change="getDataList" placeholder="请选择数据源" v-model="state.queryForm.dsName">
|
||||
<el-option label="默认数据源" value="master"></el-option>
|
||||
<el-option :key="ds.id" :label="ds.name" :value="ds.name" v-for="ds in datasourceList"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('createTable.tableName')" prop="tableName">
|
||||
<el-input :placeholder="t('createTable.inputTableNameTip')" v-model="state.queryForm.tableName"/>
|
||||
</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" v-auth="'codegen_table_add'"
|
||||
@click="formDialogRef.openDialog('add',null,state.queryForm.dsName)">
|
||||
{{ $t('common.addBtn') }}
|
||||
</el-button>
|
||||
<el-button plain :disabled="multiple" v-auth="'codegen_table_add'" icon="Delete" type="primary" class="ml10"
|
||||
@click="handleDelete(selectObjs)">
|
||||
{{ $t('common.delBtn') }}
|
||||
</el-button>
|
||||
<right-toolbar v-model:showSearch="showSearch" :export="'order_createtable_export'"
|
||||
@exportExcel="exportExcel" class="ml10" style="float: right;margin-right: 20px"
|
||||
@queryTable="getDataList"></right-toolbar>
|
||||
</div>
|
||||
</el-row>
|
||||
<el-table :data="state.dataList" v-loading="state.loading" style="width: 100%"
|
||||
:cell-style="tableStyle.cellStyle"
|
||||
border
|
||||
:header-cell-style="tableStyle.headerCellStyle"
|
||||
@selection-change="handleSelectionChange" @sort-change="sortChangeHandle">
|
||||
<el-table-column type="selection" width="40" align="center"/>
|
||||
<el-table-column type="index" fixed="left" :label="t('createTable.index')" width="40"/>
|
||||
<el-table-column prop="tableName" :label="t('createTable.tableName')" show-overflow-tooltip/>
|
||||
<el-table-column prop="comments" :label="t('createTable.comments')" show-overflow-tooltip/>
|
||||
<el-table-column prop="primary" :label="t('createTable.primary')" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
<!-- 获取主键列名称-->
|
||||
{{ JSON.parse(scope.row.columnInfo).find(col => col.primary === 1)?.name }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="createTime" :label="t('createTable.createTime')" show-overflow-tooltip/>
|
||||
<el-table-column :label="$t('common.action')" fixed="right" width="200">
|
||||
<template #default="scope">
|
||||
<el-button text type="primary" icon="view" @click="formDialogRef.openDialog('view', scope.row.id)">
|
||||
{{ $t('common.viewBtn') }}
|
||||
</el-button>
|
||||
<el-button icon="FolderOpened" @click="openGen(scope.row)" text type="primary">{{
|
||||
$t('gen.genBtn')
|
||||
}}
|
||||
</el-button>
|
||||
<el-button icon="edit-pen" text type="primary" v-auth="'order_createtable_edit'"
|
||||
@click="formDialogRef.openDialog('edit', scope.row.id)">{{ $t('common.editBtn') }}
|
||||
</el-button>
|
||||
<el-button icon="delete" text type="primary" @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="数据源" prop="name">
|
||||
<el-select @change="getDataList" placeholder="请选择数据源" v-model="state.queryForm.dsName">
|
||||
<el-option label="默认数据源" value="master"></el-option>
|
||||
<el-option :key="ds.id" :label="ds.name" :value="ds.name" v-for="ds in datasourceList"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('createTable.tableName')" prop="tableName">
|
||||
<el-input :placeholder="t('createTable.inputTableNameTip')" v-model="state.queryForm.tableName" />
|
||||
</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"
|
||||
v-auth="'codegen_table_add'"
|
||||
@click="formDialogRef.openDialog('add', null, state.queryForm.dsName)"
|
||||
>
|
||||
{{ $t("common.addBtn") }}
|
||||
</el-button>
|
||||
<el-button
|
||||
plain
|
||||
:disabled="multiple"
|
||||
v-auth="'codegen_table_add'"
|
||||
icon="Delete"
|
||||
type="primary"
|
||||
class="ml10"
|
||||
@click="handleDelete(selectObjs)"
|
||||
>
|
||||
{{ $t("common.delBtn") }}
|
||||
</el-button>
|
||||
<right-toolbar
|
||||
v-model:showSearch="showSearch"
|
||||
:export="'order_createtable_export'"
|
||||
@exportExcel="exportExcel"
|
||||
class="ml10"
|
||||
style="float: right; margin-right: 20px"
|
||||
@queryTable="getDataList"
|
||||
></right-toolbar>
|
||||
</div>
|
||||
</el-row>
|
||||
<el-table
|
||||
:data="state.dataList"
|
||||
v-loading="state.loading"
|
||||
style="width: 100%"
|
||||
:cell-style="tableStyle.cellStyle"
|
||||
border
|
||||
:header-cell-style="tableStyle.headerCellStyle"
|
||||
@selection-change="handleSelectionChange"
|
||||
@sort-change="sortChangeHandle"
|
||||
>
|
||||
<el-table-column type="selection" width="40" align="center" />
|
||||
<el-table-column type="index" fixed="left" :label="t('createTable.index')" width="40" />
|
||||
<el-table-column prop="tableName" :label="t('createTable.tableName')" show-overflow-tooltip />
|
||||
<el-table-column prop="comments" :label="t('createTable.comments')" show-overflow-tooltip />
|
||||
<el-table-column prop="primary" :label="t('createTable.primary')" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
<!-- 获取主键列名称-->
|
||||
{{ JSON.parse(scope.row.columnInfo).find((col) => col.primary === 1)?.name }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="createTime" :label="t('createTable.createTime')" show-overflow-tooltip />
|
||||
<el-table-column :label="$t('common.action')" fixed="right" width="200">
|
||||
<template #default="scope">
|
||||
<el-button text type="primary" icon="view" @click="formDialogRef.openDialog('view', scope.row.id)">
|
||||
{{ $t("common.viewBtn") }}
|
||||
</el-button>
|
||||
<el-button icon="FolderOpened" @click="openGen(scope.row)" text type="primary">{{ $t("gen.genBtn") }} </el-button>
|
||||
<el-button
|
||||
icon="edit-pen"
|
||||
text
|
||||
type="primary"
|
||||
v-auth="'order_createtable_edit'"
|
||||
@click="formDialogRef.openDialog('edit', scope.row.id)"
|
||||
>{{ $t("common.editBtn") }}
|
||||
</el-button>
|
||||
<el-button icon="delete" text type="primary" @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="systemCreateTable">
|
||||
import {BasicTableProps, useTable} from "/@/hooks/table";
|
||||
import {fetchList, delObjs} from "/@/api/gen/create-table";
|
||||
import {useMessage, useMessageBox} from "/@/hooks/message";
|
||||
import { BasicTableProps, useTable } from "/@/hooks/table"
|
||||
import { fetchList, delObjs } from "/@/api/gen/create-table"
|
||||
import { useMessage, useMessageBox } from "/@/hooks/message"
|
||||
|
||||
import {useI18n} from "vue-i18n";
|
||||
import {list} from "/@/api/gen/datasource";
|
||||
import {useSyncTableApi, useTableApi} from "/@/api/gen/table";
|
||||
import {validateNull} from "/@/utils/validate";
|
||||
import { useI18n } from "vue-i18n"
|
||||
import { list } from "/@/api/gen/datasource"
|
||||
import { useSyncTableApi, useTableApi } from "/@/api/gen/table"
|
||||
import { validateNull } from "/@/utils/validate"
|
||||
|
||||
// 引入组件
|
||||
const FormDialog = defineAsyncComponent(() => import('./form.vue'));
|
||||
const {t} = useI18n()
|
||||
const FormDialog = defineAsyncComponent(() => import("./form.vue"))
|
||||
const { t } = useI18n()
|
||||
// 定义变量内容
|
||||
const formDialogRef = ref()
|
||||
const datasourceList = ref();
|
||||
const router = useRouter();
|
||||
const datasourceList = ref()
|
||||
const router = useRouter()
|
||||
|
||||
// 搜索变量
|
||||
const queryRef = ref()
|
||||
@@ -104,88 +125,80 @@ const selectObjs = ref([]) as any
|
||||
const multiple = ref(true)
|
||||
|
||||
const state: BasicTableProps = reactive<BasicTableProps>({
|
||||
queryForm: {
|
||||
},
|
||||
pageList: fetchList,
|
||||
descs: ["create_time"]
|
||||
queryForm: {},
|
||||
pageList: fetchList,
|
||||
descs: ["create_time"],
|
||||
})
|
||||
|
||||
// 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('/order/create-table/export', state.queryForm, 'create-table.xlsx')
|
||||
downBlobFile("/order/create-table/export", state.queryForm, "数据表管理.xlsx")
|
||||
}
|
||||
|
||||
// 多选事件
|
||||
const handleSelectionChange = (objs: any) => {
|
||||
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)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 打开生成代码页面
|
||||
* @param row
|
||||
*/
|
||||
const openGen = (row: { tableName: string }) => {
|
||||
useTableApi(state.queryForm.dsName, row.tableName)
|
||||
.then((res) => {
|
||||
if (validateNull(res.data.fieldList)) {
|
||||
useSyncTableApi(state.queryForm.dsName, row.tableName);
|
||||
}
|
||||
})
|
||||
.finally(() => {
|
||||
router.push({
|
||||
path: '/gen/gener/index',
|
||||
query: {
|
||||
tableName: row.tableName,
|
||||
dsName: state.queryForm.dsName,
|
||||
},
|
||||
});
|
||||
});
|
||||
};
|
||||
useTableApi(state.queryForm.dsName, row.tableName)
|
||||
.then((res) => {
|
||||
if (validateNull(res.data.fieldList)) {
|
||||
useSyncTableApi(state.queryForm.dsName, row.tableName)
|
||||
}
|
||||
})
|
||||
.finally(() => {
|
||||
router.push({
|
||||
path: "/gen/gener/index",
|
||||
query: {
|
||||
tableName: row.tableName,
|
||||
dsName: state.queryForm.dsName,
|
||||
},
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
// 初始化数据
|
||||
onMounted(() => {
|
||||
list().then((res) => {
|
||||
datasourceList.value = res.data;
|
||||
// 默认去第一个数据源
|
||||
state.queryForm.dsName = datasourceList.value[0]?.name || 'master';
|
||||
getDataList();
|
||||
});
|
||||
});
|
||||
list().then((res) => {
|
||||
datasourceList.value = res.data
|
||||
// 默认去第一个数据源
|
||||
state.queryForm.dsName = datasourceList.value[0]?.name || "master"
|
||||
getDataList()
|
||||
})
|
||||
})
|
||||
</script>
|
||||
@@ -4,23 +4,28 @@
|
||||
<el-row class="ml10" v-show="showSearch">
|
||||
<el-form :inline="true" :model="state.queryForm" @keyup.enter="getDataList" ref="queryRef">
|
||||
<el-form-item :label="$t('fieldtype.columnType')" prop="columnType">
|
||||
<el-input :placeholder="$t('fieldtype.inputcolumnTypeTip')" formDialogRef style="max-width: 180px" v-model="state.queryForm.columnType" />
|
||||
<el-input
|
||||
:placeholder="$t('fieldtype.inputcolumnTypeTip')"
|
||||
formDialogRef
|
||||
style="max-width: 180px"
|
||||
v-model="state.queryForm.columnType"
|
||||
/>
|
||||
</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" 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 @click="formDialogRef.openDialog()" class="ml10" icon="folder-add" type="primary">
|
||||
{{ $t('common.addBtn') }}
|
||||
{{ $t("common.addBtn") }}
|
||||
</el-button>
|
||||
<el-button plain :disabled="multiple" @click="handleDelete(selectObjs)" class="ml10" icon="Delete" type="primary">
|
||||
{{ $t('common.delBtn') }}
|
||||
{{ $t("common.delBtn") }}
|
||||
</el-button>
|
||||
<right-toolbar
|
||||
:export="true"
|
||||
@@ -49,9 +54,11 @@
|
||||
<el-table-column :label="t('fieldtype.createTime')" prop="createTime" show-overflow-tooltip />
|
||||
<el-table-column :label="$t('common.action')" width="150">
|
||||
<template #default="scope">
|
||||
<el-button icon="edit-pen" @click="formDialogRef.openDialog(scope.row.id)" text type="primary">{{ $t('common.editBtn') }} </el-button>
|
||||
<el-button icon="edit-pen" @click="formDialogRef.openDialog(scope.row.id)" text type="primary"
|
||||
>{{ $t("common.editBtn") }}
|
||||
</el-button>
|
||||
|
||||
<el-button icon="delete" @click="handleDelete([scope.row.id])" text type="primary">{{ $t('common.delBtn') }} </el-button>
|
||||
<el-button icon="delete" @click="handleDelete([scope.row.id])" text type="primary">{{ $t("common.delBtn") }} </el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -64,63 +71,63 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" name="systemFieldType" setup>
|
||||
import { BasicTableProps, useTable } from '/@/hooks/table';
|
||||
import { delObj, fetchList } from '/@/api/gen/fieldtype';
|
||||
import { useMessage, useMessageBox } from '/@/hooks/message';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { BasicTableProps, useTable } from "/@/hooks/table"
|
||||
import { delObj, fetchList } from "/@/api/gen/fieldtype"
|
||||
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 formDialogRef = ref()
|
||||
// 搜索变量
|
||||
const queryRef = ref();
|
||||
const showSearch = ref(true);
|
||||
const queryRef = ref()
|
||||
const showSearch = ref(true)
|
||||
// 多选rows
|
||||
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('/gen/fieldtype/export', state.queryForm, 'fieldtype.xlsx');
|
||||
};
|
||||
downBlobFile("/gen/fieldtype/export", state.queryForm, "字段管理.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>
|
||||
@@ -8,16 +8,23 @@
|
||||
</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 @click="formDialogRef.openDialog()" class="ml10" formDialogRef icon="folder-add" type="primary" v-auth="'codegen_group_add'">
|
||||
{{ $t('common.addBtn') }}
|
||||
<el-button
|
||||
@click="formDialogRef.openDialog()"
|
||||
class="ml10"
|
||||
formDialogRef
|
||||
icon="folder-add"
|
||||
type="primary"
|
||||
v-auth="'codegen_group_add'"
|
||||
>
|
||||
{{ $t("common.addBtn") }}
|
||||
</el-button>
|
||||
<el-button
|
||||
plain
|
||||
@@ -29,7 +36,7 @@
|
||||
type="primary"
|
||||
v-auth="'codegen_group_del'"
|
||||
>
|
||||
{{ $t('common.delBtn') }}
|
||||
{{ $t("common.delBtn") }}
|
||||
</el-button>
|
||||
<right-toolbar
|
||||
:export="'codegen_group_export'"
|
||||
@@ -59,10 +66,10 @@
|
||||
<el-table-column :label="$t('common.action')" width="200">
|
||||
<template #default="scope">
|
||||
<el-button icon="edit-pen" @click="formDialogRef.openDialog(scope.row.id)" text type="primary" v-auth="'codegen_group_edit'"
|
||||
>{{ $t('common.editBtn') }}
|
||||
>{{ $t("common.editBtn") }}
|
||||
</el-button>
|
||||
<el-button icon="delete" @click="handleDelete([scope.row.id])" text type="primary" v-auth="'codegen_group_del'"
|
||||
>{{ $t('common.delBtn') }}
|
||||
>{{ $t("common.delBtn") }}
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@@ -76,68 +83,68 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" name="systemGenGroup" setup>
|
||||
import { BasicTableProps, useTable } from '/@/hooks/table';
|
||||
import { delObjs, fetchList } from '/@/api/gen/group';
|
||||
import { useMessage, useMessageBox } from '/@/hooks/message';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { BasicTableProps, useTable } from "/@/hooks/table"
|
||||
import { delObjs, fetchList } from "/@/api/gen/group"
|
||||
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 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, sortChangeHandle, downBlobFile, tableStyle } = useTable(state);
|
||||
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('/gen/group/export', state.queryForm, 'group.xlsx');
|
||||
};
|
||||
downBlobFile("/gen/group/export", state.queryForm, "模板分组.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>
|
||||
+118
-124
@@ -1,154 +1,148 @@
|
||||
<template>
|
||||
<div class="layout-padding">
|
||||
<div class="layout-padding-auto layout-padding-view">
|
||||
<el-row class="ml10" v-show="showSearch">
|
||||
<el-form :inline="true" :model="state.queryForm" @keyup.enter="getDataList" ref="queryRef">
|
||||
<el-form-item label="数据源" prop="name">
|
||||
<el-select @change="getDataList" placeholder="请选择数据源" v-model="state.queryForm.dsName">
|
||||
<el-option label="默认数据源" value="master"></el-option>
|
||||
<el-option :key="ds.id" :label="ds.name" :value="ds.name" v-for="ds in datasourceList"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('table.tableName')" prop="tableName">
|
||||
<el-input :placeholder="$t('table.inputtableNameTip')" v-model="state.queryForm.tableName"/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="getDataList" icon="search" type="primary">
|
||||
{{ $t('common.queryBtn') }}
|
||||
</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%">
|
||||
<right-toolbar
|
||||
:export="true"
|
||||
@exportExcel="exportExcel"
|
||||
@queryTable="getDataList"
|
||||
class="ml10"
|
||||
style="float: right; margin-right: 20px"
|
||||
v-model:showSearch="showSearch"
|
||||
></right-toolbar>
|
||||
</div>
|
||||
</el-row>
|
||||
<el-table
|
||||
:data="state.dataList"
|
||||
style="width: 100%"
|
||||
v-loading="state.loading"
|
||||
border
|
||||
:cell-style="tableStyle.cellStyle"
|
||||
:header-cell-style="tableStyle.headerCellStyle"
|
||||
>
|
||||
<el-table-column :label="t('table.index')" type="index" width="60"/>
|
||||
<el-table-column :label="t('table.tableName')" prop="name" show-overflow-tooltip/>
|
||||
<el-table-column :label="t('table.tableDesc')" prop="comment" show-overflow-tooltip/>
|
||||
<el-table-column :label="t('table.createTime')" prop="createTime" show-overflow-tooltip/>
|
||||
<el-table-column :label="$t('common.action')" width="250">
|
||||
<template #default="scope">
|
||||
<el-button icon="Refresh" @click="syncTable(scope.row)" text type="primary">
|
||||
{{ $t('gen.syncBtn') }}
|
||||
</el-button>
|
||||
<el-button icon="FolderOpened" @click="openGen(scope.row)" text type="primary">{{
|
||||
$t('gen.genBtn')
|
||||
}}
|
||||
</el-button>
|
||||
<el-button icon="MagicStick" @click="openDesign(scope.row)" text type="primary">{{
|
||||
$t('gen.designBtn')
|
||||
}}
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination @current-change="currentChangeHandle" @size-change="sizeChangeHandle" v-bind="state.pagination"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layout-padding">
|
||||
<div class="layout-padding-auto layout-padding-view">
|
||||
<el-row class="ml10" v-show="showSearch">
|
||||
<el-form :inline="true" :model="state.queryForm" @keyup.enter="getDataList" ref="queryRef">
|
||||
<el-form-item label="数据源" prop="name">
|
||||
<el-select @change="getDataList" placeholder="请选择数据源" v-model="state.queryForm.dsName">
|
||||
<el-option label="默认数据源" value="master"></el-option>
|
||||
<el-option :key="ds.id" :label="ds.name" :value="ds.name" v-for="ds in datasourceList"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('table.tableName')" prop="tableName">
|
||||
<el-input :placeholder="$t('table.inputtableNameTip')" v-model="state.queryForm.tableName" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="getDataList" icon="search" type="primary">
|
||||
{{ $t("common.queryBtn") }}
|
||||
</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%">
|
||||
<right-toolbar
|
||||
:export="true"
|
||||
@exportExcel="exportExcel"
|
||||
@queryTable="getDataList"
|
||||
class="ml10"
|
||||
style="float: right; margin-right: 20px"
|
||||
v-model:showSearch="showSearch"
|
||||
></right-toolbar>
|
||||
</div>
|
||||
</el-row>
|
||||
<el-table
|
||||
:data="state.dataList"
|
||||
style="width: 100%"
|
||||
v-loading="state.loading"
|
||||
border
|
||||
:cell-style="tableStyle.cellStyle"
|
||||
:header-cell-style="tableStyle.headerCellStyle"
|
||||
>
|
||||
<el-table-column :label="t('table.index')" type="index" width="60" />
|
||||
<el-table-column :label="t('table.tableName')" prop="name" show-overflow-tooltip />
|
||||
<el-table-column :label="t('table.tableDesc')" prop="comment" show-overflow-tooltip />
|
||||
<el-table-column :label="t('table.createTime')" prop="createTime" show-overflow-tooltip />
|
||||
<el-table-column :label="$t('common.action')" width="250">
|
||||
<template #default="scope">
|
||||
<el-button icon="Refresh" @click="syncTable(scope.row)" text type="primary">
|
||||
{{ $t("gen.syncBtn") }}
|
||||
</el-button>
|
||||
<el-button icon="FolderOpened" @click="openGen(scope.row)" text type="primary">{{ $t("gen.genBtn") }} </el-button>
|
||||
<el-button icon="MagicStick" @click="openDesign(scope.row)" text type="primary">{{ $t("gen.designBtn") }} </el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination @current-change="currentChangeHandle" @size-change="sizeChangeHandle" v-bind="state.pagination" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" name="systemTable" setup>
|
||||
import {BasicTableProps, useTable} from '/@/hooks/table';
|
||||
import {fetchList, useSyncTableApi, useTableApi} from '/@/api/gen/table';
|
||||
import {list} from '/@/api/gen/datasource';
|
||||
import {useMessage} from '/@/hooks/message';
|
||||
import {useI18n} from 'vue-i18n';
|
||||
import {validateNull} from '/@/utils/validate';
|
||||
import { BasicTableProps, useTable } from "/@/hooks/table"
|
||||
import { fetchList, useSyncTableApi, useTableApi } from "/@/api/gen/table"
|
||||
import { list } from "/@/api/gen/datasource"
|
||||
import { useMessage } from "/@/hooks/message"
|
||||
import { useI18n } from "vue-i18n"
|
||||
import { validateNull } from "/@/utils/validate"
|
||||
|
||||
// 定义变量内容
|
||||
const router = useRouter();
|
||||
const router = useRouter()
|
||||
// 引入组件
|
||||
const {t} = useI18n();
|
||||
const { t } = useI18n()
|
||||
// 搜索变量
|
||||
const queryRef = ref();
|
||||
const showSearch = ref(true);
|
||||
const queryRef = ref()
|
||||
const showSearch = ref(true)
|
||||
// 多选变量
|
||||
const datasourceList = ref();
|
||||
const datasourceList = ref()
|
||||
|
||||
const state: BasicTableProps = reactive<BasicTableProps>({
|
||||
queryForm: {
|
||||
dsName: 'master',
|
||||
},
|
||||
pageList: fetchList,
|
||||
createdIsNeed: false,
|
||||
});
|
||||
queryForm: {
|
||||
dsName: "master",
|
||||
},
|
||||
pageList: fetchList,
|
||||
createdIsNeed: false,
|
||||
})
|
||||
|
||||
// table hook
|
||||
const {getDataList, currentChangeHandle, sizeChangeHandle, downBlobFile, tableStyle} = useTable(state);
|
||||
const { getDataList, currentChangeHandle, sizeChangeHandle, downBlobFile, tableStyle } = useTable(state)
|
||||
|
||||
// 初始化数据
|
||||
onMounted(() => {
|
||||
list().then((res) => {
|
||||
datasourceList.value = res.data;
|
||||
// 默认去第一个数据源
|
||||
if (datasourceList.value.length > 0) {
|
||||
state.queryForm.dsName = datasourceList.value[0].name;
|
||||
}
|
||||
getDataList();
|
||||
});
|
||||
});
|
||||
list().then((res) => {
|
||||
datasourceList.value = res.data
|
||||
// 默认去第一个数据源
|
||||
if (datasourceList.value.length > 0) {
|
||||
state.queryForm.dsName = datasourceList.value[0].name
|
||||
}
|
||||
getDataList()
|
||||
})
|
||||
})
|
||||
|
||||
const openGen = (row) => {
|
||||
useTableApi(state.queryForm.dsName, row.name)
|
||||
.then((res) => {
|
||||
if (validateNull(res.data.fieldList)) {
|
||||
syncTable(row);
|
||||
}
|
||||
})
|
||||
.finally(() => {
|
||||
router.push({
|
||||
path: '/gen/gener/index',
|
||||
query: {
|
||||
tableName: row.name,
|
||||
dsName: state.queryForm.dsName,
|
||||
},
|
||||
});
|
||||
});
|
||||
};
|
||||
useTableApi(state.queryForm.dsName, row.name)
|
||||
.then((res) => {
|
||||
if (validateNull(res.data.fieldList)) {
|
||||
syncTable(row)
|
||||
}
|
||||
})
|
||||
.finally(() => {
|
||||
router.push({
|
||||
path: "/gen/gener/index",
|
||||
query: {
|
||||
tableName: row.name,
|
||||
dsName: state.queryForm.dsName,
|
||||
},
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
const openDesign = (row) => {
|
||||
router.push({
|
||||
path: '/gen/design/index',
|
||||
query: {
|
||||
tableName: row.name,
|
||||
dsName: state.queryForm.dsName,
|
||||
},
|
||||
});
|
||||
};
|
||||
router.push({
|
||||
path: "/gen/design/index",
|
||||
query: {
|
||||
tableName: row.name,
|
||||
dsName: state.queryForm.dsName,
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
// 同步表数据
|
||||
const syncTable = (row) => {
|
||||
useSyncTableApi(state.queryForm.dsName, row.name).then(() => {
|
||||
useMessage().success(t('common.optSuccessText'));
|
||||
});
|
||||
};
|
||||
useSyncTableApi(state.queryForm.dsName, row.name).then(() => {
|
||||
useMessage().success(t("common.optSuccessText"))
|
||||
})
|
||||
}
|
||||
|
||||
// 清空搜索条件
|
||||
const resetQuery = () => {
|
||||
queryRef.value.resetFields();
|
||||
getDataList();
|
||||
};
|
||||
queryRef.value.resetFields()
|
||||
getDataList()
|
||||
}
|
||||
|
||||
// 导出excel
|
||||
const exportExcel = () => {
|
||||
downBlobFile('/gen/table/export', state.queryForm, 'table.xlsx');
|
||||
};
|
||||
downBlobFile("/gen/table/export", state.queryForm, "代码生成.xlsx")
|
||||
}
|
||||
</script>
|
||||
+127
-132
@@ -1,164 +1,159 @@
|
||||
<template>
|
||||
<div class="layout-padding">
|
||||
<div class="layout-padding-auto layout-padding-view">
|
||||
<el-row class="ml10" v-show="showSearch">
|
||||
<el-form :inline="true" :model="state.queryForm" @keyup.enter="getDataList" ref="queryRef">
|
||||
<el-form-item :label="$t('template.templateName')" prop="templateName">
|
||||
<el-input :placeholder="t('template.inputTemplateNameTip')" style="max-width: 180px"
|
||||
v-model="state.queryForm.templateName"/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="getDataList" formDialogRef icon="search" type="primary">
|
||||
{{ $t('common.queryBtn') }}
|
||||
</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 @click="formDialogRef.openDialog()" class="ml10" icon="folder-add" type="primary"
|
||||
v-auth="'codegen_template_add'">
|
||||
{{ $t('common.addBtn') }}
|
||||
</el-button>
|
||||
<el-button
|
||||
plain
|
||||
:disabled="multiple"
|
||||
@click="handleDelete(selectObjs)"
|
||||
class="ml10"
|
||||
icon="Delete"
|
||||
type="primary"
|
||||
v-auth="'codegen_template_del'"
|
||||
>
|
||||
{{ $t('common.delBtn') }}
|
||||
</el-button>
|
||||
<el-button @click="onlineUpdate" class="ml10" icon="download" plain :disabled="updateDisabled"
|
||||
v-auth="'codegen_template_add'">
|
||||
更新
|
||||
</el-button>
|
||||
<right-toolbar
|
||||
:export="'codegen_template_export'"
|
||||
@exportExcel="exportExcel"
|
||||
@queryTable="getDataList"
|
||||
class="ml10"
|
||||
style="float: right; margin-right: 20px"
|
||||
v-model:showSearch="showSearch"
|
||||
></right-toolbar>
|
||||
</div>
|
||||
</el-row>
|
||||
<el-table
|
||||
:data="state.dataList"
|
||||
@selection-change="handleSelectionChange"
|
||||
style="width: 100%"
|
||||
v-loading="state.loading"
|
||||
border
|
||||
:cell-style="tableStyle.cellStyle"
|
||||
:header-cell-style="tableStyle.headerCellStyle"
|
||||
>
|
||||
<el-table-column align="center" type="selection" width="40"/>
|
||||
<el-table-column :label="t('template.index')" type="index" width="60"/>
|
||||
<el-table-column :label="t('template.templateName')" prop="templateName" show-overflow-tooltip/>
|
||||
<el-table-column :label="t('template.generatorPath')" prop="generatorPath" show-overflow-tooltip/>
|
||||
<el-table-column :label="t('template.desc')" prop="templateDesc" show-overflow-tooltip/>
|
||||
<el-table-column :label="t('template.createTime')" prop="createTime" show-overflow-tooltip/>
|
||||
<el-table-column :label="$t('common.action')" width="150">
|
||||
<template #default="scope">
|
||||
<el-button icon="edit-pen" @click="formDialogRef.openDialog(scope.row.id)" text type="primary"
|
||||
v-auth="'codegen_template_edit'"
|
||||
>{{ $t('common.editBtn') }}
|
||||
</el-button>
|
||||
<el-button icon="delete" @click="handleDelete([scope.row.id])" text type="primary"
|
||||
v-auth="'codegen_template_del'"
|
||||
>{{ $t('common.delBtn') }}
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination @current-change="currentChangeHandle" @size-change="sizeChangeHandle" v-bind="state.pagination"/>
|
||||
</div>
|
||||
<div class="layout-padding">
|
||||
<div class="layout-padding-auto layout-padding-view">
|
||||
<el-row class="ml10" v-show="showSearch">
|
||||
<el-form :inline="true" :model="state.queryForm" @keyup.enter="getDataList" ref="queryRef">
|
||||
<el-form-item :label="$t('template.templateName')" prop="templateName">
|
||||
<el-input :placeholder="t('template.inputTemplateNameTip')" style="max-width: 180px" v-model="state.queryForm.templateName" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="getDataList" formDialogRef icon="search" type="primary">
|
||||
{{ $t("common.queryBtn") }}
|
||||
</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 @click="formDialogRef.openDialog()" class="ml10" icon="folder-add" type="primary" v-auth="'codegen_template_add'">
|
||||
{{ $t("common.addBtn") }}
|
||||
</el-button>
|
||||
<el-button
|
||||
plain
|
||||
:disabled="multiple"
|
||||
@click="handleDelete(selectObjs)"
|
||||
class="ml10"
|
||||
icon="Delete"
|
||||
type="primary"
|
||||
v-auth="'codegen_template_del'"
|
||||
>
|
||||
{{ $t("common.delBtn") }}
|
||||
</el-button>
|
||||
<el-button @click="onlineUpdate" class="ml10" icon="download" plain :disabled="updateDisabled" v-auth="'codegen_template_add'">
|
||||
更新
|
||||
</el-button>
|
||||
<right-toolbar
|
||||
:export="'codegen_template_export'"
|
||||
@exportExcel="exportExcel"
|
||||
@queryTable="getDataList"
|
||||
class="ml10"
|
||||
style="float: right; margin-right: 20px"
|
||||
v-model:showSearch="showSearch"
|
||||
></right-toolbar>
|
||||
</div>
|
||||
</el-row>
|
||||
<el-table
|
||||
:data="state.dataList"
|
||||
@selection-change="handleSelectionChange"
|
||||
style="width: 100%"
|
||||
v-loading="state.loading"
|
||||
border
|
||||
:cell-style="tableStyle.cellStyle"
|
||||
:header-cell-style="tableStyle.headerCellStyle"
|
||||
>
|
||||
<el-table-column align="center" type="selection" width="40" />
|
||||
<el-table-column :label="t('template.index')" type="index" width="60" />
|
||||
<el-table-column :label="t('template.templateName')" prop="templateName" show-overflow-tooltip />
|
||||
<el-table-column :label="t('template.generatorPath')" prop="generatorPath" show-overflow-tooltip />
|
||||
<el-table-column :label="t('template.desc')" prop="templateDesc" show-overflow-tooltip />
|
||||
<el-table-column :label="t('template.createTime')" prop="createTime" show-overflow-tooltip />
|
||||
<el-table-column :label="$t('common.action')" width="150">
|
||||
<template #default="scope">
|
||||
<el-button icon="edit-pen" @click="formDialogRef.openDialog(scope.row.id)" text type="primary" v-auth="'codegen_template_edit'"
|
||||
>{{ $t("common.editBtn") }}
|
||||
</el-button>
|
||||
<el-button icon="delete" @click="handleDelete([scope.row.id])" text type="primary" v-auth="'codegen_template_del'"
|
||||
>{{ $t("common.delBtn") }}
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination @current-change="currentChangeHandle" @size-change="sizeChangeHandle" v-bind="state.pagination" />
|
||||
</div>
|
||||
|
||||
<!-- 编辑、新增 -->
|
||||
<form-dialog @refresh="getDataList()" ref="formDialogRef"/>
|
||||
</div>
|
||||
<!-- 编辑、新增 -->
|
||||
<form-dialog @refresh="getDataList()" ref="formDialogRef" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" name="systemGenTemplate" setup>
|
||||
import {BasicTableProps, useTable} from '/@/hooks/table';
|
||||
import {delObjs, fetchList, online} from '/@/api/gen/template';
|
||||
import {useMessage, useMessageBox} from '/@/hooks/message';
|
||||
import {useI18n} from 'vue-i18n';
|
||||
import { BasicTableProps, useTable } from "/@/hooks/table"
|
||||
import { delObjs, fetchList, online } from "/@/api/gen/template"
|
||||
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 updateDisabled = ref(false);
|
||||
const formDialogRef = ref()
|
||||
const updateDisabled = ref(false)
|
||||
// 搜索变量
|
||||
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'],
|
||||
});
|
||||
queryForm: {},
|
||||
pageList: fetchList,
|
||||
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();
|
||||
// 清空多选
|
||||
selectObjs.value = [];
|
||||
getDataList();
|
||||
};
|
||||
// 清空搜索条件
|
||||
queryRef.value.resetFields()
|
||||
// 清空多选
|
||||
selectObjs.value = []
|
||||
getDataList()
|
||||
}
|
||||
|
||||
// 导出excel
|
||||
const exportExcel = () => {
|
||||
downBlobFile('/gen/template/export', state.queryForm, 'template.xlsx');
|
||||
};
|
||||
downBlobFile("/gen/template/export", state.queryForm, "模板管理.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'));
|
||||
} 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 onlineUpdate = async () => {
|
||||
try {
|
||||
updateDisabled.value = true;
|
||||
const {data} = await online();
|
||||
getDataList();
|
||||
useMessage().success(data);
|
||||
} catch (err: any) {
|
||||
useMessage().error(err.msg);
|
||||
} finally {
|
||||
updateDisabled.value = false;
|
||||
}
|
||||
};
|
||||
try {
|
||||
updateDisabled.value = true
|
||||
const { data } = await online()
|
||||
getDataList()
|
||||
useMessage().success(data)
|
||||
} catch (err: any) {
|
||||
useMessage().error(err.msg)
|
||||
} finally {
|
||||
updateDisabled.value = false
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -131,7 +131,7 @@ const resetQuery = () => {
|
||||
|
||||
// 导出excel
|
||||
const exportExcel = () => {
|
||||
downBlobFile("/hard/hardAfterSale/export", Object.assign(state.queryForm, { ids: selectObjs }), "hardAfterSale.xlsx")
|
||||
downBlobFile("/hard/hardAfterSale/export", Object.assign(state.queryForm, { ids: selectObjs }), "售后订单.xlsx")
|
||||
}
|
||||
|
||||
// 多选事件
|
||||
|
||||
@@ -107,7 +107,7 @@ const resetQuery = () => {
|
||||
|
||||
// 导出excel
|
||||
const exportExcel = () => {
|
||||
downBlobFile("/hard/hardGroup/export", Object.assign(state.queryForm, { ids: selectObjs }), "hardGroup.xlsx")
|
||||
downBlobFile("/hard/hardGroup/export", Object.assign(state.queryForm, { ids: selectObjs }), "设备分组.xlsx")
|
||||
}
|
||||
|
||||
// 多选事件
|
||||
|
||||
@@ -169,7 +169,7 @@ const doRefund = (row: any) => {
|
||||
|
||||
// 导出excel
|
||||
const exportExcel = () => {
|
||||
downBlobFile("/hard/hardInvoice/export", Object.assign(state.queryForm, { ids: selectObjs }), "hardInvoice.xlsx")
|
||||
downBlobFile("/hard/hardInvoice/export", Object.assign(state.queryForm, { ids: selectObjs }), "开票记录.xlsx")
|
||||
}
|
||||
|
||||
// 多选事件
|
||||
|
||||
@@ -158,7 +158,7 @@ const changeTakeFood = async (e: any, row: any) => {
|
||||
|
||||
// 导出excel
|
||||
const exportExcel = () => {
|
||||
downBlobFile("/hard/hardManager/export", Object.assign(state.queryForm, { ids: selectObjs }), "hardManager.xlsx")
|
||||
downBlobFile("/hard/hardManager/export", Object.assign(state.queryForm, { ids: selectObjs }), "设备列表.xlsx")
|
||||
}
|
||||
|
||||
// 多选事件
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
:header-cell-style="tableStyle.headerCellStyle"
|
||||
@selection-change="selectionChangHandle"
|
||||
@sort-change="sortChangeHandle"
|
||||
:show-summary="false"
|
||||
show-summary
|
||||
:summary-method="getSummaries"
|
||||
>
|
||||
<el-table-column type="selection" width="60" align="center" />
|
||||
@@ -368,7 +368,7 @@ const handleGetSelectNode = (curClickedNode: any, checkedTreeNodes: any, isDeepT
|
||||
|
||||
// 导出excel
|
||||
const exportExcel = () => {
|
||||
downBlobFile("/hard/hard-order/export", Object.assign(state.queryForm, { ids: selectObjs }), "订单.xlsx")
|
||||
downBlobFile("/hard/hard-order/export", Object.assign(state.queryForm, { ids: selectObjs }), "订单记录.xlsx")
|
||||
}
|
||||
|
||||
// 多选事件
|
||||
|
||||
@@ -51,66 +51,66 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="systemMchManage">
|
||||
import { BasicTableProps, useTable } from '/@/hooks/table';
|
||||
import { fetchList, delObjs } from '../../../api/mch/mch-manage';
|
||||
import { useMessage, useMessageBox } from '/@/hooks/message';
|
||||
import { useDict } from '/@/hooks/dict';
|
||||
import { BasicTableProps, useTable } from "/@/hooks/table"
|
||||
import { fetchList, delObjs } from "../../../api/mch/mch-manage"
|
||||
import { useMessage, useMessageBox } from "/@/hooks/message"
|
||||
import { useDict } from "/@/hooks/dict"
|
||||
|
||||
// 引入组件
|
||||
const FormDialog = defineAsyncComponent(() => import('./form.vue'));
|
||||
const FormDialog = defineAsyncComponent(() => import("./form.vue"))
|
||||
// 定义查询字典
|
||||
|
||||
// 定义变量内容
|
||||
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,
|
||||
});
|
||||
})
|
||||
|
||||
// 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();
|
||||
queryRef.value?.resetFields()
|
||||
// 清空多选
|
||||
selectObjs.value = [];
|
||||
getDataList();
|
||||
};
|
||||
selectObjs.value = []
|
||||
getDataList()
|
||||
}
|
||||
|
||||
// 导出excel
|
||||
const exportExcel = () => {
|
||||
downBlobFile('/mch/mchManage/export', Object.assign(state.queryForm, { ids: selectObjs }), 'mchManage.xlsx');
|
||||
};
|
||||
downBlobFile("/mch/mchManage/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('此操作将永久删除');
|
||||
await useMessageBox().confirm("此操作将永久删除")
|
||||
} catch {
|
||||
return;
|
||||
return
|
||||
}
|
||||
|
||||
try {
|
||||
await delObjs(ids);
|
||||
getDataList();
|
||||
useMessage().success('删除成功');
|
||||
await delObjs(ids)
|
||||
getDataList()
|
||||
useMessage().success("删除成功")
|
||||
} catch (err: any) {
|
||||
useMessage().error(err.msg);
|
||||
useMessage().error(err.msg)
|
||||
}
|
||||
};
|
||||
}
|
||||
</script>
|
||||
@@ -16,13 +16,7 @@
|
||||
</el-row>
|
||||
<el-row>
|
||||
<div class="mb8" style="width: 100%">
|
||||
<el-button
|
||||
icon="folder-add"
|
||||
type="primary"
|
||||
class="ml10"
|
||||
@click="formDialogRef.openDialog()"
|
||||
v-auth="'supermarket_smSpu_add'"
|
||||
>
|
||||
<el-button icon="folder-add" type="primary" class="ml10" @click="formDialogRef.openDialog()" v-auth="'supermarket_smSpu_add'">
|
||||
新 增
|
||||
</el-button>
|
||||
<el-button
|
||||
@@ -74,20 +68,10 @@
|
||||
<el-table-column prop="salesCount" label="销量" show-overflow-tooltip />
|
||||
<el-table-column label="操作" width="150">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
icon="edit-pen"
|
||||
text
|
||||
type="primary"
|
||||
v-auth="'supermarket_smSpu_edit'"
|
||||
@click="formDialogRef.openDialog(scope.row.id)"
|
||||
<el-button icon="edit-pen" text type="primary" v-auth="'supermarket_smSpu_edit'" @click="formDialogRef.openDialog(scope.row.id)"
|
||||
>编辑</el-button
|
||||
>
|
||||
<el-button
|
||||
icon="delete"
|
||||
text
|
||||
type="primary"
|
||||
v-auth="'supermarket_smSpu_del'"
|
||||
@click="handleDelete([scope.row.id])"
|
||||
<el-button icon="delete" text type="primary" v-auth="'supermarket_smSpu_del'" @click="handleDelete([scope.row.id])"
|
||||
>删除</el-button
|
||||
>
|
||||
</template>
|
||||
@@ -127,8 +111,7 @@ const state: BasicTableProps = reactive<BasicTableProps>({
|
||||
})
|
||||
|
||||
// table hook
|
||||
const { getDataList, currentChangeHandle, sizeChangeHandle, sortChangeHandle, downBlobFile, tableStyle } =
|
||||
useTable(state)
|
||||
const { getDataList, currentChangeHandle, sizeChangeHandle, sortChangeHandle, downBlobFile, tableStyle } = useTable(state)
|
||||
|
||||
// 清空搜索条件
|
||||
const resetQuery = () => {
|
||||
@@ -141,7 +124,7 @@ const resetQuery = () => {
|
||||
|
||||
// 导出excel
|
||||
const exportExcel = () => {
|
||||
downBlobFile("/supermarket/smSpu/export", Object.assign(state.queryForm, { ids: selectObjs }), "smSpu.xlsx")
|
||||
downBlobFile("/supermarket/smSpu/export", Object.assign(state.queryForm, { ids: selectObjs }), "线上超市商品.xlsx")
|
||||
}
|
||||
|
||||
// 多选事件
|
||||
|
||||
@@ -149,7 +149,7 @@ const resetQuery = () => {
|
||||
|
||||
// 导出excel
|
||||
const exportExcel = () => {
|
||||
downBlobFile("/supermarket/smErpInventoryRecords/export", Object.assign(state.queryForm, { ids: selectObjs }), "smErpCgInventory.xlsx")
|
||||
// downBlobFile("/supermarket/smErpInventoryRecords/export", Object.assign(state.queryForm, { ids: selectObjs }), "采购退货.xlsx")
|
||||
}
|
||||
|
||||
// 多选事件
|
||||
|
||||
@@ -105,7 +105,7 @@ const { getDataList, currentChangeHandle, sizeChangeHandle, sortChangeHandle, do
|
||||
|
||||
// 导出excel
|
||||
const exportExcel = () => {
|
||||
downBlobFile("/supermarket/smErpCgDd/export", Object.assign(state.queryForm, { ids: selectObjs }), "smErpCgDd.xlsx")
|
||||
downBlobFile("/supermarket/smErpCgDd/export", Object.assign(state.queryForm, { ids: selectObjs }), "采购订单.xlsx")
|
||||
}
|
||||
|
||||
// 多选事件
|
||||
|
||||
@@ -149,7 +149,7 @@ const resetQuery = () => {
|
||||
|
||||
// 导出excel
|
||||
const exportExcel = () => {
|
||||
downBlobFile("/supermarket/smErpInventoryRecords/export", Object.assign(state.queryForm, { ids: selectObjs }), "smErpCgInventory.xlsx")
|
||||
downBlobFile("/supermarket/smErpInventoryRecords/export", Object.assign(state.queryForm, { ids: selectObjs }), "采购入库.xlsx")
|
||||
}
|
||||
|
||||
// 多选事件
|
||||
|
||||
@@ -120,7 +120,7 @@ const resetQuery = () => {
|
||||
|
||||
// 导出excel
|
||||
const exportExcel = () => {
|
||||
downBlobFile("/supermarket/smErpCgPlan/export", Object.assign(state.queryForm, { ids: selectObjs }), "smErpCgPlan.xlsx")
|
||||
downBlobFile("/supermarket/smErpCgPlan/export", Object.assign(state.queryForm, { ids: selectObjs }), "补货申请.xlsx")
|
||||
}
|
||||
|
||||
// 多选事件
|
||||
|
||||
@@ -147,7 +147,7 @@ const resetQuery = () => {
|
||||
|
||||
// 导出excel
|
||||
const exportExcel = () => {
|
||||
downBlobFile("/supermarket/smErpRetailBack/export", Object.assign(state.queryForm, { ids: selectObjs }), "smErpRetailBack.xlsx")
|
||||
downBlobFile("/supermarket/smErpRetailBack/export", Object.assign(state.queryForm, { ids: selectObjs }), "零售退货.xlsx")
|
||||
}
|
||||
|
||||
// 多选事件
|
||||
|
||||
@@ -149,7 +149,7 @@ const resetQuery = () => {
|
||||
|
||||
// 导出excel
|
||||
const exportExcel = () => {
|
||||
downBlobFile("/supermarket/smErpRetailDelivery/export", Object.assign(state.queryForm, { ids: selectObjs }), "smErpRetailDelivery.xlsx")
|
||||
downBlobFile("/supermarket/smErpRetailDelivery/export", Object.assign(state.queryForm, { ids: selectObjs }), "零售出库.xlsx")
|
||||
}
|
||||
|
||||
// 多选事件
|
||||
|
||||
@@ -106,7 +106,7 @@ const selectionChangHandle = (objs: { supplierId: string }[]) => {
|
||||
|
||||
// 导出excel
|
||||
const exportExcel = () => {
|
||||
downBlobFile("/supermarketerp/smErpInventoryWarning/export", Object.assign(state.queryForm, { ids: selectObjs }), "smErpSupplier.xlsx")
|
||||
downBlobFile("/supermarketerp/smErpInventoryWarning/export", Object.assign(state.queryForm, { ids: selectObjs }), "库存预警.xlsx")
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
|
||||
@@ -168,7 +168,7 @@ const resetQuery = () => {
|
||||
|
||||
// 导出excel
|
||||
const exportExcel = () => {
|
||||
downBlobFile("/supermarketerp/smErpSupplier/export", Object.assign(state.queryForm, { ids: selectObjs }), "smErpSupplier.xlsx")
|
||||
downBlobFile("/supermarketerp/smErpSupplier/export", Object.assign(state.queryForm, { ids: selectObjs }), "货商管理.xlsx")
|
||||
}
|
||||
|
||||
// 多选事件
|
||||
|
||||
@@ -73,7 +73,13 @@
|
||||
>
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button icon="delete" text type="primary" v-auth="'supermarketerp_smErpSupplierType_del'" @click="handleDelete([scope.row.id])">
|
||||
<el-button
|
||||
icon="delete"
|
||||
text
|
||||
type="primary"
|
||||
v-auth="'supermarketerp_smErpSupplierType_del'"
|
||||
@click="handleDelete([scope.row.id])"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
@@ -88,66 +94,66 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="systemSmErpSupplierType">
|
||||
import { BasicTableProps, useTable } from '/@/hooks/table';
|
||||
import { fetchList, delObjs } from '/@/api/supermarketerp/smErpSupplierType';
|
||||
import { useMessage, useMessageBox } from '/@/hooks/message';
|
||||
import { useDict } from '/@/hooks/dict';
|
||||
import { BasicTableProps, useTable } from "/@/hooks/table"
|
||||
import { fetchList, delObjs } from "/@/api/supermarketerp/smErpSupplierType"
|
||||
import { useMessage, useMessageBox } from "/@/hooks/message"
|
||||
import { useDict } from "/@/hooks/dict"
|
||||
|
||||
// 引入组件
|
||||
const FormDialog = defineAsyncComponent(() => import('./form.vue'));
|
||||
const FormDialog = defineAsyncComponent(() => import("./form.vue"))
|
||||
// 定义查询字典
|
||||
|
||||
// 定义变量内容
|
||||
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,
|
||||
});
|
||||
})
|
||||
|
||||
// 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();
|
||||
queryRef.value?.resetFields()
|
||||
// 清空多选
|
||||
selectObjs.value = [];
|
||||
getDataList();
|
||||
};
|
||||
selectObjs.value = []
|
||||
getDataList()
|
||||
}
|
||||
|
||||
// 导出excel
|
||||
const exportExcel = () => {
|
||||
downBlobFile('/supermarketerp/smErpSupplierType/export', Object.assign(state.queryForm, { ids: selectObjs }), 'smErpSupplierType.xlsx');
|
||||
};
|
||||
downBlobFile("/supermarketerp/smErpSupplierType/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('此操作将永久删除');
|
||||
await useMessageBox().confirm("此操作将永久删除")
|
||||
} catch {
|
||||
return;
|
||||
return
|
||||
}
|
||||
|
||||
try {
|
||||
await delObjs(ids);
|
||||
getDataList();
|
||||
useMessage().success('删除成功');
|
||||
await delObjs(ids)
|
||||
getDataList()
|
||||
useMessage().success("删除成功")
|
||||
} catch (err: any) {
|
||||
useMessage().error(err.msg);
|
||||
useMessage().error(err.msg)
|
||||
}
|
||||
};
|
||||
}
|
||||
</script>
|
||||
@@ -71,7 +71,12 @@
|
||||
@click="formDialogRef.openDialog(scope.row.id)"
|
||||
>编辑</el-button
|
||||
>
|
||||
<el-button icon="delete" text type="primary" v-auth="'supermarket_supermarketAuxiliaryCode_del'" @click="handleDelete([scope.row.id])"
|
||||
<el-button
|
||||
icon="delete"
|
||||
text
|
||||
type="primary"
|
||||
v-auth="'supermarket_supermarketAuxiliaryCode_del'"
|
||||
@click="handleDelete([scope.row.id])"
|
||||
>删除</el-button
|
||||
>
|
||||
</template>
|
||||
@@ -86,64 +91,64 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="systemSupermarketAuxiliaryCode">
|
||||
import { BasicTableProps, useTable } from '/@/hooks/table';
|
||||
import { fetchList, delObjs } from '/src/api/supermarketerp/supermarketAuxiliaryCode';
|
||||
import { useMessage, useMessageBox } from '/@/hooks/message';
|
||||
import { BasicTableProps, useTable } from "/@/hooks/table"
|
||||
import { fetchList, delObjs } from "/src/api/supermarketerp/supermarketAuxiliaryCode"
|
||||
import { useMessage, useMessageBox } from "/@/hooks/message"
|
||||
|
||||
// 引入组件
|
||||
const FormDialog = defineAsyncComponent(() => import('./form.vue'));
|
||||
const FormDialog = defineAsyncComponent(() => import("./form.vue"))
|
||||
|
||||
// 定义变量内容
|
||||
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,
|
||||
});
|
||||
})
|
||||
|
||||
// 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();
|
||||
queryRef.value?.resetFields()
|
||||
// 清空多选
|
||||
selectObjs.value = [];
|
||||
getDataList();
|
||||
};
|
||||
selectObjs.value = []
|
||||
getDataList()
|
||||
}
|
||||
|
||||
// 导出excel
|
||||
const exportExcel = () => {
|
||||
downBlobFile('/supermarket/supermarketAuxiliaryCode/export', Object.assign(state.queryForm, { ids: selectObjs }), 'supermarketAuxiliaryCode.xlsx');
|
||||
};
|
||||
downBlobFile("/supermarket/supermarketAuxiliaryCode/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('此操作将永久删除');
|
||||
await useMessageBox().confirm("此操作将永久删除")
|
||||
} catch {
|
||||
return;
|
||||
return
|
||||
}
|
||||
|
||||
try {
|
||||
await delObjs(ids);
|
||||
getDataList();
|
||||
useMessage().success('删除成功');
|
||||
await delObjs(ids)
|
||||
getDataList()
|
||||
useMessage().success("删除成功")
|
||||
} catch (err: any) {
|
||||
useMessage().error(err.msg);
|
||||
useMessage().error(err.msg)
|
||||
}
|
||||
};
|
||||
}
|
||||
</script>
|
||||
@@ -78,13 +78,7 @@
|
||||
>
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
icon="delete"
|
||||
text
|
||||
type="primary"
|
||||
v-auth="'supermarket_supermarketBrand_del'"
|
||||
@click="handleDelete([scope.row.id])"
|
||||
>
|
||||
<el-button icon="delete" text type="primary" v-auth="'supermarket_supermarketBrand_del'" @click="handleDelete([scope.row.id])">
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
@@ -123,8 +117,7 @@ const state: BasicTableProps = reactive<BasicTableProps>({
|
||||
})
|
||||
|
||||
// table hook
|
||||
const { getDataList, currentChangeHandle, sizeChangeHandle, sortChangeHandle, downBlobFile, tableStyle } =
|
||||
useTable(state)
|
||||
const { getDataList, currentChangeHandle, sizeChangeHandle, sortChangeHandle, downBlobFile, tableStyle } = useTable(state)
|
||||
|
||||
// 清空搜索条件
|
||||
const resetQuery = () => {
|
||||
@@ -137,11 +130,7 @@ const resetQuery = () => {
|
||||
|
||||
// 导出excel
|
||||
const exportExcel = () => {
|
||||
downBlobFile(
|
||||
"/supermarket/supermarketBrand/export",
|
||||
Object.assign(state.queryForm, { ids: selectObjs }),
|
||||
"supermarketBrand.xlsx",
|
||||
)
|
||||
downBlobFile("/supermarket/supermarketBrand/export", Object.assign(state.queryForm, { ids: selectObjs }), "商品品牌.xlsx")
|
||||
}
|
||||
|
||||
// 多选事件
|
||||
|
||||
@@ -125,8 +125,7 @@ const state: BasicTableProps = reactive<BasicTableProps>({
|
||||
})
|
||||
|
||||
// table hook
|
||||
const { getDataList, currentChangeHandle, sizeChangeHandle, sortChangeHandle, downBlobFile, tableStyle } =
|
||||
useTable(state)
|
||||
const { getDataList, currentChangeHandle, sizeChangeHandle, sortChangeHandle, downBlobFile, tableStyle } = useTable(state)
|
||||
|
||||
// 清空搜索条件
|
||||
const resetQuery = () => {
|
||||
@@ -139,11 +138,7 @@ const resetQuery = () => {
|
||||
|
||||
// 导出excel
|
||||
const exportExcel = () => {
|
||||
downBlobFile(
|
||||
"/supermarket/supermarketCategory/export",
|
||||
Object.assign(state.queryForm, { ids: selectObjs }),
|
||||
"supermarketCategory.xlsx",
|
||||
)
|
||||
downBlobFile("/supermarket/supermarketCategory/export", Object.assign(state.queryForm, { ids: selectObjs }), "商品分类.xlsx")
|
||||
}
|
||||
|
||||
// 多选事件
|
||||
|
||||
@@ -180,7 +180,7 @@ const resetQuery = () => {
|
||||
|
||||
// 导出excel
|
||||
const exportExcel = () => {
|
||||
downBlobFile("/supermarket/supermarketSpu/export", Object.assign(state.queryForm, { ids: selectObjs }), "supermarketSpu.xlsx")
|
||||
downBlobFile("/supermarket/supermarketSpu/export", Object.assign(state.queryForm, { ids: selectObjs }), "库存商品.xlsx")
|
||||
}
|
||||
|
||||
// 多选事件
|
||||
|
||||
@@ -86,64 +86,64 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="systemSupermarketAuxiliaryCode">
|
||||
import { BasicTableProps, useTable } from '/src/hooks/table';
|
||||
import { fetchList, delObjs } from '/src/api/supermarketerp/supermarketUnit';
|
||||
import { useMessage, useMessageBox } from '/src/hooks/message';
|
||||
import { BasicTableProps, useTable } from "/src/hooks/table"
|
||||
import { fetchList, delObjs } from "/src/api/supermarketerp/supermarketUnit"
|
||||
import { useMessage, useMessageBox } from "/src/hooks/message"
|
||||
|
||||
// 引入组件
|
||||
const FormDialog = defineAsyncComponent(() => import('./form.vue'));
|
||||
const FormDialog = defineAsyncComponent(() => import("./form.vue"))
|
||||
|
||||
// 定义变量内容
|
||||
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,
|
||||
});
|
||||
})
|
||||
|
||||
// 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();
|
||||
queryRef.value?.resetFields()
|
||||
// 清空多选
|
||||
selectObjs.value = [];
|
||||
getDataList();
|
||||
};
|
||||
selectObjs.value = []
|
||||
getDataList()
|
||||
}
|
||||
|
||||
// 导出excel
|
||||
const exportExcel = () => {
|
||||
downBlobFile('/supermarket/supermarketUnit/export', Object.assign(state.queryForm, { ids: selectObjs }), 'supermarketUnit.xlsx');
|
||||
};
|
||||
downBlobFile("/supermarket/supermarketUnit/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('此操作将永久删除');
|
||||
await useMessageBox().confirm("此操作将永久删除")
|
||||
} catch {
|
||||
return;
|
||||
return
|
||||
}
|
||||
|
||||
try {
|
||||
await delObjs(ids);
|
||||
getDataList();
|
||||
useMessage().success('删除成功');
|
||||
await delObjs(ids)
|
||||
getDataList()
|
||||
useMessage().success("删除成功")
|
||||
} catch (err: any) {
|
||||
useMessage().error(err.msg);
|
||||
useMessage().error(err.msg)
|
||||
}
|
||||
};
|
||||
}
|
||||
</script>
|
||||
@@ -1,427 +1,451 @@
|
||||
<template>
|
||||
<div class="layout-padding">
|
||||
<div class="layout-padding-auto layout-padding-view">
|
||||
<el-row class="ml10" v-show="showSearch">
|
||||
<el-form :inline="true" :model="state.queryForm" ref="queryRef">
|
||||
<el-form-item :label="$t('job.jobName')" prop="jobName">
|
||||
<el-input :placeholder="$t('job.inputjobNameTip')" @keyup.enter="getDataList" clearable
|
||||
v-model="state.queryForm.jobName"/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="t('job.jobStatus')" prop="jobStatus">
|
||||
<el-select :placeholder="t('job.inputjobStatusTip')" v-model="state.queryForm.jobStatus">
|
||||
<el-option :key="index" :label="item.label" :value="item.value"
|
||||
v-for="(item, index) in job_status"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="t('job.jobExecuteStatus')" prop="jobExecuteStatus">
|
||||
<el-select :placeholder="t('job.inputjobExecuteStatusTip')" v-model="state.queryForm.jobExecuteStatus">
|
||||
<el-option :key="index" :label="item.label" :value="item.value"
|
||||
v-for="(item, index) in job_execute_status"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<div class="layout-padding">
|
||||
<div class="layout-padding-auto layout-padding-view">
|
||||
<el-row class="ml10" v-show="showSearch">
|
||||
<el-form :inline="true" :model="state.queryForm" ref="queryRef">
|
||||
<el-form-item :label="$t('job.jobName')" prop="jobName">
|
||||
<el-input :placeholder="$t('job.inputjobNameTip')" @keyup.enter="getDataList" clearable v-model="state.queryForm.jobName" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="t('job.jobStatus')" prop="jobStatus">
|
||||
<el-select :placeholder="t('job.inputjobStatusTip')" v-model="state.queryForm.jobStatus">
|
||||
<el-option :key="index" :label="item.label" :value="item.value" v-for="(item, index) in job_status"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="t('job.jobExecuteStatus')" prop="jobExecuteStatus">
|
||||
<el-select :placeholder="t('job.inputjobExecuteStatusTip')" v-model="state.queryForm.jobExecuteStatus">
|
||||
<el-option :key="index" :label="item.label" :value="item.value" v-for="(item, index) in job_execute_status"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-button @click="getDataList" icon="Search" type="primary">{{ $t('common.queryBtn') }}</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="'job_sys_job_add'" @click="formDialogRef.openDialog()" class="ml10" icon="folder-add"
|
||||
type="primary">
|
||||
{{ $t('common.addBtn') }}
|
||||
</el-button>
|
||||
<el-button plain v-auth="'job_sys_job_del'" :disabled="multiple" @click="handleDelete(undefined)" class="ml10"
|
||||
icon="Delete" type="primary">
|
||||
{{ $t('common.delBtn') }}
|
||||
</el-button>
|
||||
<right-toolbar
|
||||
:export="'job_sys_job_add'"
|
||||
@exportExcel="exportExcel"
|
||||
@queryTable="getDataList"
|
||||
class="ml10"
|
||||
style="float: right; margin-right: 20px"
|
||||
v-model:showSearch="showSearch"
|
||||
>
|
||||
<el-tooltip class="item" effect="dark" :content="$t('queryTree.view')" placement="top">
|
||||
<el-button circle icon="Grid" @click="tableViewRef = !tableViewRef"></el-button>
|
||||
</el-tooltip>
|
||||
</right-toolbar>
|
||||
</div>
|
||||
</el-row>
|
||||
<el-form-item>
|
||||
<el-button @click="getDataList" icon="Search" type="primary">{{ $t("common.queryBtn") }}</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="'job_sys_job_add'" @click="formDialogRef.openDialog()" class="ml10" icon="folder-add" type="primary">
|
||||
{{ $t("common.addBtn") }}
|
||||
</el-button>
|
||||
<el-button
|
||||
plain
|
||||
v-auth="'job_sys_job_del'"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete(undefined)"
|
||||
class="ml10"
|
||||
icon="Delete"
|
||||
type="primary"
|
||||
>
|
||||
{{ $t("common.delBtn") }}
|
||||
</el-button>
|
||||
<right-toolbar
|
||||
:export="'job_sys_job_add'"
|
||||
@exportExcel="exportExcel"
|
||||
@queryTable="getDataList"
|
||||
class="ml10"
|
||||
style="float: right; margin-right: 20px"
|
||||
v-model:showSearch="showSearch"
|
||||
>
|
||||
<el-tooltip class="item" effect="dark" :content="$t('queryTree.view')" placement="top">
|
||||
<el-button circle icon="Grid" @click="tableViewRef = !tableViewRef"></el-button>
|
||||
</el-tooltip>
|
||||
</right-toolbar>
|
||||
</div>
|
||||
</el-row>
|
||||
|
||||
<!-- 表格视图 -->
|
||||
<el-table
|
||||
v-if="tableViewRef"
|
||||
:data="state.dataList"
|
||||
@selection-change="handleSelectionChange"
|
||||
style="width: 100%"
|
||||
row-key="jobId"
|
||||
v-loading="state.loading"
|
||||
border
|
||||
:cell-style="tableStyle.cellStyle"
|
||||
:header-cell-style="tableStyle.headerCellStyle"
|
||||
>
|
||||
<el-table-column align="center" type="selection" width="40"/>
|
||||
<el-table-column :label="t('job.index')" fixed="left" type="index" width="60"/>
|
||||
<el-table-column :label="t('job.jobName')" fixed="left" prop="jobName" show-overflow-tooltip width="120"/>
|
||||
<el-table-column :label="t('job.jobGroup')" prop="jobGroup" show-overflow-tooltip width="120"/>
|
||||
<el-table-column :label="t('job.jobStatus')" prop="jobStatus" show-overflow-tooltip width="120">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="job_status" :value="scope.row.jobStatus"></dict-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="t('job.jobExecuteStatus')" prop="jobExecuteStatus" show-overflow-tooltip width="120">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="job_execute_status" :value="scope.row.jobExecuteStatus"></dict-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- 表格视图 -->
|
||||
<el-table
|
||||
v-if="tableViewRef"
|
||||
:data="state.dataList"
|
||||
@selection-change="handleSelectionChange"
|
||||
style="width: 100%"
|
||||
row-key="jobId"
|
||||
v-loading="state.loading"
|
||||
border
|
||||
:cell-style="tableStyle.cellStyle"
|
||||
:header-cell-style="tableStyle.headerCellStyle"
|
||||
>
|
||||
<el-table-column align="center" type="selection" width="40" />
|
||||
<el-table-column :label="t('job.index')" fixed="left" type="index" width="60" />
|
||||
<el-table-column :label="t('job.jobName')" fixed="left" prop="jobName" show-overflow-tooltip width="120" />
|
||||
<el-table-column :label="t('job.jobGroup')" prop="jobGroup" show-overflow-tooltip width="120" />
|
||||
<el-table-column :label="t('job.jobStatus')" prop="jobStatus" show-overflow-tooltip width="120">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="job_status" :value="scope.row.jobStatus"></dict-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="t('job.jobExecuteStatus')" prop="jobExecuteStatus" show-overflow-tooltip width="120">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="job_execute_status" :value="scope.row.jobExecuteStatus"></dict-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column :label="t('job.startTime')" prop="startTime" show-overflow-tooltip width="120"/>
|
||||
<el-table-column :label="t('job.startTime')" prop="startTime" show-overflow-tooltip width="120" />
|
||||
|
||||
<el-table-column :label="t('job.previousTime')" prop="previousTime" show-overflow-tooltip width="120"/>
|
||||
<el-table-column :label="t('job.nextTime')" prop="nextTime" show-overflow-tooltip width="120"/>
|
||||
<el-table-column :label="t('job.jobType')" prop="jobType" show-overflow-tooltip width="120">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="job_type" :value="scope.row.jobType"></dict-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="t('job.executePath')" prop="executePath" show-overflow-tooltip width="120"/>
|
||||
<el-table-column :label="t('job.className')" prop="className" show-overflow-tooltip width="120"/>
|
||||
<el-table-column :label="t('job.methodName')" prop="methodName" show-overflow-tooltip width="120"/>
|
||||
<el-table-column :label="t('job.methodParamsValue')" prop="methodParamsValue" show-overflow-tooltip
|
||||
width="120"/>
|
||||
<el-table-column :label="t('job.cronExpression')" prop="cronExpression" show-overflow-tooltip width="120"/>
|
||||
<el-table-column :label="t('job.misfirePolicy')" prop="misfirePolicy" show-overflow-tooltip width="200">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="misfire_policy" :value="scope.row.misfirePolicy"></dict-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('common.action')" fixed="right" width="300">
|
||||
<template #default="scope">
|
||||
<el-button @click="handleJobLog(scope.row)" text type="primary">{{ $t('job.jobLogBtn') }}</el-button>
|
||||
<el-table-column :label="t('job.previousTime')" prop="previousTime" show-overflow-tooltip width="120" />
|
||||
<el-table-column :label="t('job.nextTime')" prop="nextTime" show-overflow-tooltip width="120" />
|
||||
<el-table-column :label="t('job.jobType')" prop="jobType" show-overflow-tooltip width="120">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="job_type" :value="scope.row.jobType"></dict-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="t('job.executePath')" prop="executePath" show-overflow-tooltip width="120" />
|
||||
<el-table-column :label="t('job.className')" prop="className" show-overflow-tooltip width="120" />
|
||||
<el-table-column :label="t('job.methodName')" prop="methodName" show-overflow-tooltip width="120" />
|
||||
<el-table-column :label="t('job.methodParamsValue')" prop="methodParamsValue" show-overflow-tooltip width="120" />
|
||||
<el-table-column :label="t('job.cronExpression')" prop="cronExpression" show-overflow-tooltip width="120" />
|
||||
<el-table-column :label="t('job.misfirePolicy')" prop="misfirePolicy" show-overflow-tooltip width="200">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="misfire_policy" :value="scope.row.misfirePolicy"></dict-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('common.action')" fixed="right" width="300">
|
||||
<template #default="scope">
|
||||
<el-button @click="handleJobLog(scope.row)" text type="primary">{{ $t("job.jobLogBtn") }}</el-button>
|
||||
|
||||
<el-button v-auth="'job_sys_job_start_job'" @click="handleStartJob(scope.row)" text type="primary"
|
||||
v-if="scope.row.jobStatus !== '2'"
|
||||
>
|
||||
{{ $t('job.jobStartBtn') }}
|
||||
</el-button>
|
||||
<el-button
|
||||
v-auth="'job_sys_job_start_job'"
|
||||
@click="handleStartJob(scope.row)"
|
||||
text
|
||||
type="primary"
|
||||
v-if="scope.row.jobStatus !== '2'"
|
||||
>
|
||||
{{ $t("job.jobStartBtn") }}
|
||||
</el-button>
|
||||
|
||||
<el-button
|
||||
v-auth="'job_sys_job_shutdown_job'"
|
||||
@click="handleShutDownJob(scope.row)"
|
||||
text
|
||||
type="primary"
|
||||
v-if="scope.row.jobStatus === '2'"
|
||||
>
|
||||
{{ $t('job.jobPauseBtn') }}
|
||||
</el-button>
|
||||
<el-button
|
||||
v-auth="'job_sys_job_shutdown_job'"
|
||||
@click="handleShutDownJob(scope.row)"
|
||||
text
|
||||
type="primary"
|
||||
v-if="scope.row.jobStatus === '2'"
|
||||
>
|
||||
{{ $t("job.jobPauseBtn") }}
|
||||
</el-button>
|
||||
|
||||
<el-button v-auth="'job_sys_job_edit'" @click="handleEditJob(scope.row)" text type="primary">
|
||||
{{ $t('common.editBtn') }}
|
||||
</el-button>
|
||||
<el-button v-auth="'job_sys_job_edit'" @click="handleEditJob(scope.row)" text type="primary">
|
||||
{{ $t("common.editBtn") }}
|
||||
</el-button>
|
||||
|
||||
<el-button v-auth="'job_sys_job_start_job'" @click="handleRunJob(scope.row)" text type="primary">
|
||||
{{ $t('job.jobRunBtn') }}
|
||||
</el-button>
|
||||
<el-button v-auth="'job_sys_job_start_job'" @click="handleRunJob(scope.row)" text type="primary">
|
||||
{{ $t("job.jobRunBtn") }}
|
||||
</el-button>
|
||||
|
||||
<el-button v-auth="'job_sys_job_del'" @click="handleDelete(scope.row)" text type="primary"
|
||||
:disabled="scope.row.jobStatus === '2'">{{ $t('common.delBtn') }}
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!-- 卡片视图 -->
|
||||
<el-scrollbar v-if="!tableViewRef">
|
||||
<div class="p-4">
|
||||
<div class="mx-auto">
|
||||
<!-- Main -->
|
||||
<div class="grid grid-cols-4 gap-x-4 gap-y-6">
|
||||
<div
|
||||
v-for="job in state.dataList"
|
||||
:key="job.jobId"
|
||||
class="w-full max-w-sm mt-2 bg-gray-100 dark:bg-[#1d1e1f] rounded-lg border dark:border-[#303030]"
|
||||
>
|
||||
<div aria-label="header" class="flex items-center p-4 space-x-4">
|
||||
<div aria-label="avatar" class="flex items-center mr-auto space-x-4">
|
||||
<div class="flex flex-col flex-1 space-y-2">
|
||||
<div class="text-lg font-bold text-gray-900 dark:text-gray-100">
|
||||
{{ job.jobName }}
|
||||
</div>
|
||||
<p class="text-base font-normal text-gray-500 truncate dark:text-gray-400">
|
||||
{{ job.jobGroup }} / {{ job_type.find((item: any) => item.value === job.jobType)?.label }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div aria-label="navigation" class="py-2">
|
||||
<nav class="grid gap-1">
|
||||
<div class="flex items-center w-full px-4 py-1 space-x-3 leading-6 text-gray-600 dark:text-gray-300 hover:bg-white dark:hover:bg-[#303030] rounded-md">
|
||||
<span class="font-medium">{{ $t('job.jobStatus') }}:</span>
|
||||
<span>{{ job_status.find((item: any) => item.value === job.jobStatus)?.label }}</span>
|
||||
</div>
|
||||
<div class="flex items-center w-full px-4 py-1 space-x-3 leading-6 text-gray-600 dark:text-gray-300 hover:bg-white dark:hover:bg-[#303030] rounded-md">
|
||||
<span class="font-medium">{{ $t('job.cronExpression') }}:</span>
|
||||
<span>{{ job.cronExpression }}</span>
|
||||
</div>
|
||||
<div class="flex items-center w-full px-4 py-1 space-x-3 leading-6 text-gray-600 dark:text-gray-300 hover:bg-white dark:hover:bg-[#303030] rounded-md">
|
||||
<span class="font-medium">{{ $t('job.previousTime') }}:</span>
|
||||
<span>{{ job.previousTime }}</span>
|
||||
</div>
|
||||
<div class="flex items-center w-full px-4 py-1 space-x-3 leading-6 text-gray-600 dark:text-gray-300 hover:bg-white dark:hover:bg-[#303030] rounded-md">
|
||||
<span class="font-medium">{{ $t('job.nextTime') }}:</span>
|
||||
<span>{{ job.nextTime }}</span>
|
||||
</div>
|
||||
<div class="flex items-center w-full px-4 py-1 space-x-3 leading-6 text-gray-600 dark:text-gray-300 hover:bg-white dark:hover:bg-[#303030] rounded-md">
|
||||
<span class="font-medium">{{ $t('job.jobExecuteStatus') }}:</span>
|
||||
<span>
|
||||
<el-icon v-if="job.jobExecuteStatus === '1'"><CircleCloseFilled/></el-icon>
|
||||
<el-icon v-if="job.jobExecuteStatus === '0'"><CircleCheckFilled/></el-icon>
|
||||
</span>
|
||||
</div>
|
||||
</nav>
|
||||
</div>
|
||||
<div aria-label="footer" class="pt-2 border-t dark:border-[#303030]">
|
||||
<div class="flex items-center justify-center min-w-full">
|
||||
<nav class="flex">
|
||||
<a
|
||||
@click="handleJobLog(job)"
|
||||
href="javascript:;"
|
||||
class="px-2 py-2 text-primary hover:text-primary-400 dark:text-primary-300"
|
||||
>
|
||||
<span>{{ $t('job.jobLogBtn') }}</span>
|
||||
</a>
|
||||
<a
|
||||
v-auth="'job_sys_job_start_job'"
|
||||
@click="handleStartJob(job)"
|
||||
v-if="job.jobStatus !== '2'"
|
||||
href="javascript:;"
|
||||
class="px-2 py-2 text-primary hover:text-primary-400 dark:text-primary-300"
|
||||
>
|
||||
<span>{{ $t('job.jobStartBtn') }}</span>
|
||||
</a>
|
||||
<a
|
||||
v-auth="'job_sys_job_shutdown_job'"
|
||||
@click="handleShutDownJob(job)"
|
||||
v-if="job.jobStatus === '2'"
|
||||
href="javascript:;"
|
||||
class="px-2 py-2 text-primary hover:text-primary-400 dark:text-primary-300"
|
||||
>
|
||||
<span>{{ $t('job.jobPauseBtn') }}</span>
|
||||
</a>
|
||||
<a
|
||||
v-auth="'job_sys_job_edit'" @click="handleEditJob(job)"
|
||||
href="javascript:;"
|
||||
class="px-2 py-2 text-primary hover:text-primary-400 dark:text-primary-300"
|
||||
>
|
||||
<span> {{ $t('common.editBtn') }}</span>
|
||||
</a>
|
||||
<a
|
||||
v-auth="'job_sys_job_start_job'" @click="handleRunJob(job)"
|
||||
href="javascript:;"
|
||||
class="px-2 py-2 text-primary hover:text-primary-400 dark:text-primary-300"
|
||||
>
|
||||
<span>{{ $t('job.jobRunBtn') }}</span>
|
||||
</a>
|
||||
<el-button
|
||||
v-auth="'job_sys_job_del'"
|
||||
@click="handleDelete(scope.row)"
|
||||
text
|
||||
type="primary"
|
||||
:disabled="scope.row.jobStatus === '2'"
|
||||
>{{ $t("common.delBtn") }}
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!-- 卡片视图 -->
|
||||
<el-scrollbar v-if="!tableViewRef">
|
||||
<div class="p-4">
|
||||
<div class="mx-auto">
|
||||
<!-- Main -->
|
||||
<div class="grid grid-cols-4 gap-x-4 gap-y-6">
|
||||
<div
|
||||
v-for="job in state.dataList"
|
||||
:key="job.jobId"
|
||||
class="w-full max-w-sm mt-2 bg-gray-100 dark:bg-[#1d1e1f] rounded-lg border dark:border-[#303030]"
|
||||
>
|
||||
<div aria-label="header" class="flex items-center p-4 space-x-4">
|
||||
<div aria-label="avatar" class="flex items-center mr-auto space-x-4">
|
||||
<div class="flex flex-col flex-1 space-y-2">
|
||||
<div class="text-lg font-bold text-gray-900 dark:text-gray-100">
|
||||
{{ job.jobName }}
|
||||
</div>
|
||||
<p class="text-base font-normal text-gray-500 truncate dark:text-gray-400">
|
||||
{{ job.jobGroup }} / {{ job_type.find((item: any) => item.value === job.jobType)?.label }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div aria-label="navigation" class="py-2">
|
||||
<nav class="grid gap-1">
|
||||
<div
|
||||
class="flex items-center w-full px-4 py-1 space-x-3 leading-6 text-gray-600 dark:text-gray-300 hover:bg-white dark:hover:bg-[#303030] rounded-md"
|
||||
>
|
||||
<span class="font-medium">{{ $t("job.jobStatus") }}:</span>
|
||||
<span>{{ job_status.find((item: any) => item.value === job.jobStatus)?.label }}</span>
|
||||
</div>
|
||||
<div
|
||||
class="flex items-center w-full px-4 py-1 space-x-3 leading-6 text-gray-600 dark:text-gray-300 hover:bg-white dark:hover:bg-[#303030] rounded-md"
|
||||
>
|
||||
<span class="font-medium">{{ $t("job.cronExpression") }}:</span>
|
||||
<span>{{ job.cronExpression }}</span>
|
||||
</div>
|
||||
<div
|
||||
class="flex items-center w-full px-4 py-1 space-x-3 leading-6 text-gray-600 dark:text-gray-300 hover:bg-white dark:hover:bg-[#303030] rounded-md"
|
||||
>
|
||||
<span class="font-medium">{{ $t("job.previousTime") }}:</span>
|
||||
<span>{{ job.previousTime }}</span>
|
||||
</div>
|
||||
<div
|
||||
class="flex items-center w-full px-4 py-1 space-x-3 leading-6 text-gray-600 dark:text-gray-300 hover:bg-white dark:hover:bg-[#303030] rounded-md"
|
||||
>
|
||||
<span class="font-medium">{{ $t("job.nextTime") }}:</span>
|
||||
<span>{{ job.nextTime }}</span>
|
||||
</div>
|
||||
<div
|
||||
class="flex items-center w-full px-4 py-1 space-x-3 leading-6 text-gray-600 dark:text-gray-300 hover:bg-white dark:hover:bg-[#303030] rounded-md"
|
||||
>
|
||||
<span class="font-medium">{{ $t("job.jobExecuteStatus") }}:</span>
|
||||
<span>
|
||||
<el-icon v-if="job.jobExecuteStatus === '1'"><CircleCloseFilled /></el-icon>
|
||||
<el-icon v-if="job.jobExecuteStatus === '0'"><CircleCheckFilled /></el-icon>
|
||||
</span>
|
||||
</div>
|
||||
</nav>
|
||||
</div>
|
||||
<div aria-label="footer" class="pt-2 border-t dark:border-[#303030]">
|
||||
<div class="flex items-center justify-center min-w-full">
|
||||
<nav class="flex">
|
||||
<a
|
||||
@click="handleJobLog(job)"
|
||||
href="javascript:;"
|
||||
class="px-2 py-2 text-primary hover:text-primary-400 dark:text-primary-300"
|
||||
>
|
||||
<span>{{ $t("job.jobLogBtn") }}</span>
|
||||
</a>
|
||||
<a
|
||||
v-auth="'job_sys_job_start_job'"
|
||||
@click="handleStartJob(job)"
|
||||
v-if="job.jobStatus !== '2'"
|
||||
href="javascript:;"
|
||||
class="px-2 py-2 text-primary hover:text-primary-400 dark:text-primary-300"
|
||||
>
|
||||
<span>{{ $t("job.jobStartBtn") }}</span>
|
||||
</a>
|
||||
<a
|
||||
v-auth="'job_sys_job_shutdown_job'"
|
||||
@click="handleShutDownJob(job)"
|
||||
v-if="job.jobStatus === '2'"
|
||||
href="javascript:;"
|
||||
class="px-2 py-2 text-primary hover:text-primary-400 dark:text-primary-300"
|
||||
>
|
||||
<span>{{ $t("job.jobPauseBtn") }}</span>
|
||||
</a>
|
||||
<a
|
||||
v-auth="'job_sys_job_edit'"
|
||||
@click="handleEditJob(job)"
|
||||
href="javascript:;"
|
||||
class="px-2 py-2 text-primary hover:text-primary-400 dark:text-primary-300"
|
||||
>
|
||||
<span> {{ $t("common.editBtn") }}</span>
|
||||
</a>
|
||||
<a
|
||||
v-auth="'job_sys_job_start_job'"
|
||||
@click="handleRunJob(job)"
|
||||
href="javascript:;"
|
||||
class="px-2 py-2 text-primary hover:text-primary-400 dark:text-primary-300"
|
||||
>
|
||||
<span>{{ $t("job.jobRunBtn") }}</span>
|
||||
</a>
|
||||
|
||||
<a
|
||||
v-auth="'job_sys_job_del'" @click="handleDelete(job)" type="primary"
|
||||
v-if="job.jobStatus !== '2'"
|
||||
href="javascript:;"
|
||||
class="px-2 py-2 text-primary hover:text-primary-400 dark:text-primary-300"
|
||||
>
|
||||
<span>{{ $t('common.delBtn') }}</span>
|
||||
</a>
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<a
|
||||
v-auth="'job_sys_job_del'"
|
||||
@click="handleDelete(job)"
|
||||
type="primary"
|
||||
v-if="job.jobStatus !== '2'"
|
||||
href="javascript:;"
|
||||
class="px-2 py-2 text-primary hover:text-primary-400 dark:text-primary-300"
|
||||
>
|
||||
<span>{{ $t("common.delBtn") }}</span>
|
||||
</a>
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-scrollbar>
|
||||
|
||||
</div>
|
||||
</el-scrollbar>
|
||||
<pagination @current-change="currentChangeHandle" @size-change="sizeChangeHandle" v-bind="state.pagination" />
|
||||
</div>
|
||||
|
||||
<pagination @current-change="currentChangeHandle" @size-change="sizeChangeHandle" v-bind="state.pagination"/>
|
||||
</div>
|
||||
|
||||
<!-- 编辑、新增 -->
|
||||
<form-dialog @refresh="getDataList()" ref="formDialogRef"/>
|
||||
<job-log ref="jobLogRef"></job-log>
|
||||
</div>
|
||||
<!-- 编辑、新增 -->
|
||||
<form-dialog @refresh="getDataList()" ref="formDialogRef" />
|
||||
<job-log ref="jobLogRef"></job-log>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" name="systemSysJob" setup>
|
||||
import {BasicTableProps, useTable} from '/@/hooks/table';
|
||||
import {delObj, fetchList, runJobRa, shutDownJobRa, startJobRa} from '/@/api/daemon/job';
|
||||
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, runJobRa, shutDownJobRa, startJobRa } from "/@/api/daemon/job"
|
||||
import { useMessage, useMessageBox } from "/@/hooks/message"
|
||||
import { useDict } from "/@/hooks/dict"
|
||||
import { useI18n } from "vue-i18n"
|
||||
|
||||
// 引入组件
|
||||
const FormDialog = defineAsyncComponent(() => import('./form.vue'));
|
||||
const JobLog = defineAsyncComponent(() => import('./job-log.vue'));
|
||||
const FormDialog = defineAsyncComponent(() => import("./form.vue"))
|
||||
const JobLog = defineAsyncComponent(() => import("./job-log.vue"))
|
||||
|
||||
// 获取国际化方法
|
||||
const {t} = useI18n();
|
||||
const { t } = useI18n()
|
||||
|
||||
/** 表单弹窗引用 */
|
||||
const formDialogRef = ref();
|
||||
const formDialogRef = ref()
|
||||
/** 作业日志引用 */
|
||||
const jobLogRef = ref();
|
||||
const jobLogRef = ref()
|
||||
/** 表格视图 */
|
||||
const tableViewRef = ref(false)
|
||||
/** 搜索表单信息 */
|
||||
const queryForm = reactive({
|
||||
jobName: '',
|
||||
jobGroup: '',
|
||||
jobStatus: '',
|
||||
jobExecuteStatus: '',
|
||||
});
|
||||
jobName: "",
|
||||
jobGroup: "",
|
||||
jobStatus: "",
|
||||
jobExecuteStatus: "",
|
||||
})
|
||||
/** 是否展示搜索表单 */
|
||||
const showSearch = ref(true);
|
||||
const showSearch = ref(true)
|
||||
|
||||
// 多选变量
|
||||
/** 选中的行 */
|
||||
const selectedRows = ref([]);
|
||||
const selectedRows = ref([])
|
||||
/** 是否可以多选 */
|
||||
const multiple = ref(true);
|
||||
const multiple = ref(true)
|
||||
|
||||
/** 查询字典 */
|
||||
const {
|
||||
job_status,
|
||||
job_execute_status,
|
||||
misfire_policy,
|
||||
job_type
|
||||
} = useDict('job_status', 'job_execute_status', 'misfire_policy', 'job_type');
|
||||
const { job_status, job_execute_status, misfire_policy, job_type } = useDict(
|
||||
"job_status",
|
||||
"job_execute_status",
|
||||
"misfire_policy",
|
||||
"job_type",
|
||||
)
|
||||
|
||||
/** 表格状态变量 */
|
||||
const state = reactive<BasicTableProps>({
|
||||
queryForm,
|
||||
pageList: fetchList,
|
||||
pagination: {
|
||||
size: 8,
|
||||
pageSizes: [4, 8, 12]
|
||||
}
|
||||
});
|
||||
queryForm,
|
||||
pageList: fetchList,
|
||||
pagination: {
|
||||
size: 8,
|
||||
pageSizes: [4, 8, 12],
|
||||
},
|
||||
})
|
||||
|
||||
/** 获取表格数据方法 */
|
||||
const {getDataList, currentChangeHandle, sizeChangeHandle, downBlobFile, tableStyle} = useTable(state);
|
||||
const { getDataList, currentChangeHandle, sizeChangeHandle, downBlobFile, tableStyle } = useTable(state)
|
||||
|
||||
/** 重置查询表单 */
|
||||
const resetQuery = () => {
|
||||
Object.keys(queryForm).forEach((key) => (queryForm[key] = ''));
|
||||
getDataList();
|
||||
};
|
||||
Object.keys(queryForm).forEach((key) => (queryForm[key] = ""))
|
||||
getDataList()
|
||||
}
|
||||
|
||||
/** 行选中事件 */
|
||||
const handleSelectionChange = (rows: any) => {
|
||||
selectedRows.value = rows;
|
||||
multiple.value = !rows.length;
|
||||
};
|
||||
selectedRows.value = rows
|
||||
multiple.value = !rows.length
|
||||
}
|
||||
|
||||
/** 导出Excel */
|
||||
const exportExcel = () => {
|
||||
downBlobFile('/job/sys-job/export', Object.assign(state.queryForm, {ids: selectedRows}), 'job.xlsx');
|
||||
};
|
||||
downBlobFile("/job/sys-job/export", Object.assign(state.queryForm, { ids: selectedRows }), "Quartz管理.xlsx")
|
||||
}
|
||||
|
||||
/** 查看作业日志 */
|
||||
const handleJobLog = (row) => {
|
||||
jobLogRef.value.openDialog(row.jobId);
|
||||
};
|
||||
jobLogRef.value.openDialog(row.jobId)
|
||||
}
|
||||
|
||||
/** 编辑作业 */
|
||||
const handleEditJob = (row) => {
|
||||
const jobStatus = row.jobStatus;
|
||||
if (jobStatus === '1' || jobStatus === '3') {
|
||||
formDialogRef.value.openDialog(row.jobId);
|
||||
} else {
|
||||
useMessage().error('运行中定时任务不可修改,请先暂停后操作');
|
||||
}
|
||||
};
|
||||
const jobStatus = row.jobStatus
|
||||
if (jobStatus === "1" || jobStatus === "3") {
|
||||
formDialogRef.value.openDialog(row.jobId)
|
||||
} else {
|
||||
useMessage().error("运行中定时任务不可修改,请先暂停后操作")
|
||||
}
|
||||
}
|
||||
|
||||
/** 启动作业 */
|
||||
const handleStartJob = async (row) => {
|
||||
const jobStatus = row.jobStatus;
|
||||
if (jobStatus === '1' || jobStatus === '3') {
|
||||
try {
|
||||
await useMessageBox().confirm(`即将发布或启动(任务名称: ${row.jobName}), 是否继续?`);
|
||||
} catch {
|
||||
return;
|
||||
}
|
||||
const jobStatus = row.jobStatus
|
||||
if (jobStatus === "1" || jobStatus === "3") {
|
||||
try {
|
||||
await useMessageBox().confirm(`即将发布或启动(任务名称: ${row.jobName}), 是否继续?`)
|
||||
} catch {
|
||||
return
|
||||
}
|
||||
|
||||
try {
|
||||
await startJobRa(row.jobId);
|
||||
getDataList();
|
||||
useMessage().success(t('common.optSuccessText'));
|
||||
} catch (err: any) {
|
||||
useMessage().error(err.msg);
|
||||
}
|
||||
} else {
|
||||
useMessage().error('定时任务已运行');
|
||||
}
|
||||
};
|
||||
try {
|
||||
await startJobRa(row.jobId)
|
||||
getDataList()
|
||||
useMessage().success(t("common.optSuccessText"))
|
||||
} catch (err: any) {
|
||||
useMessage().error(err.msg)
|
||||
}
|
||||
} else {
|
||||
useMessage().error("定时任务已运行")
|
||||
}
|
||||
}
|
||||
|
||||
/** 暂停作业 */
|
||||
const handleShutDownJob = async (row) => {
|
||||
const jobStatus = row.jobStatus;
|
||||
if (jobStatus === '2') {
|
||||
try {
|
||||
await useMessageBox().confirm(`即将暂停(任务名称: ${row.jobName}), 是否继续?`);
|
||||
} catch {
|
||||
return;
|
||||
}
|
||||
const jobStatus = row.jobStatus
|
||||
if (jobStatus === "2") {
|
||||
try {
|
||||
await useMessageBox().confirm(`即将暂停(任务名称: ${row.jobName}), 是否继续?`)
|
||||
} catch {
|
||||
return
|
||||
}
|
||||
|
||||
try {
|
||||
await shutDownJobRa(row.jobId);
|
||||
getDataList();
|
||||
useMessage().success(t('common.optSuccessText'));
|
||||
} catch (err: any) {
|
||||
useMessage().error(err.msg);
|
||||
}
|
||||
} else {
|
||||
useMessage().error('已暂停,不要重复操作');
|
||||
}
|
||||
};
|
||||
try {
|
||||
await shutDownJobRa(row.jobId)
|
||||
getDataList()
|
||||
useMessage().success(t("common.optSuccessText"))
|
||||
} catch (err: any) {
|
||||
useMessage().error(err.msg)
|
||||
}
|
||||
} else {
|
||||
useMessage().error("已暂停,不要重复操作")
|
||||
}
|
||||
}
|
||||
|
||||
/** 运行作业 */
|
||||
const handleRunJob = async (row) => {
|
||||
try {
|
||||
await useMessageBox().confirm(`立刻执行一次任务(任务名称: ${row.jobName}), 是否继续?`);
|
||||
} catch {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
await useMessageBox().confirm(`立刻执行一次任务(任务名称: ${row.jobName}), 是否继续?`)
|
||||
} catch {
|
||||
return
|
||||
}
|
||||
|
||||
try {
|
||||
await runJobRa(row.jobId);
|
||||
getDataList();
|
||||
useMessage().success(t('common.optSuccessText'));
|
||||
} catch (err: any) {
|
||||
useMessage().error('运行失败');
|
||||
}
|
||||
};
|
||||
try {
|
||||
await runJobRa(row.jobId)
|
||||
getDataList()
|
||||
useMessage().success(t("common.optSuccessText"))
|
||||
} catch (err: any) {
|
||||
useMessage().error("运行失败")
|
||||
}
|
||||
}
|
||||
|
||||
/** 删除操作 */
|
||||
const handleDelete = async (row) => {
|
||||
if (!row) {
|
||||
selectedRows.value.forEach(handleDelete);
|
||||
return;
|
||||
}
|
||||
if (!row) {
|
||||
selectedRows.value.forEach(handleDelete)
|
||||
return
|
||||
}
|
||||
|
||||
const {jobId, jobName} = row;
|
||||
try {
|
||||
await useMessageBox().confirm(`${t('common.delConfirmText')}(任务名称:${jobName})`);
|
||||
} catch {
|
||||
return;
|
||||
}
|
||||
const { jobId, jobName } = row
|
||||
try {
|
||||
await useMessageBox().confirm(`${t("common.delConfirmText")}(任务名称:${jobName})`)
|
||||
} catch {
|
||||
return
|
||||
}
|
||||
|
||||
try {
|
||||
await delObj(jobId);
|
||||
getDataList();
|
||||
useMessage().success(t('common.delSuccessText'));
|
||||
} catch (error: any) {
|
||||
useMessage().error('删除失败');
|
||||
}
|
||||
};
|
||||
try {
|
||||
await delObj(jobId)
|
||||
getDataList()
|
||||
useMessage().success(t("common.delSuccessText"))
|
||||
} catch (error: any) {
|
||||
useMessage().error("删除失败")
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -1,89 +1,90 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-row v-show="showSearch">
|
||||
<el-form :model="state.queryForm" ref="queryRef" :inline="true" @keyup.enter="getDataList">
|
||||
<el-form-item label="业务名称" prop="configName">
|
||||
<el-input placeholder="请输入业务名称" v-model="state.queryForm.configName"/>
|
||||
</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="'sys_message_add'">
|
||||
新 增
|
||||
</el-button>
|
||||
<el-button plain :disabled="multiple" icon="Delete" type="primary"
|
||||
v-auth="'sys_message_del'" @click="handleDelete(selectObjs)">
|
||||
删除
|
||||
</el-button>
|
||||
<right-toolbar v-model:showSearch="showSearch" :export="'admin_sysMessage_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="configName" label="业务名称" show-overflow-tooltip/>
|
||||
<el-table-column prop="configKey" label="业务标识" show-overflow-tooltip/>
|
||||
<el-table-column prop="configValue.supplier" label="服务地址" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
{{ JSON.parse(scope.row.configValue).smtpServer }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="configStatus" label="启用状态" show-overflow-tooltip width="100">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="yes_no_type" :value="scope.row.configStatus"></dict-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="300">
|
||||
<template #default="scope">
|
||||
<el-button icon="view" text type="primary" v-auth="'sys_message_edit'"
|
||||
@click="senderDialogRef.openDialog(scope.row.id)">测试
|
||||
</el-button>
|
||||
<el-button icon="edit-pen" text type="primary" v-auth="'sys_message_edit'"
|
||||
@click="formDialogRef.openDialog(scope.row.id)">编辑
|
||||
</el-button>
|
||||
<el-button icon="delete" text type="primary" v-auth="'sys_message_del'"
|
||||
@click="handleDelete([scope.row.id])">删除
|
||||
</el-button>
|
||||
<el-button icon="Tickets" text type="primary" v-auth="'sys_message_del'"
|
||||
@click="handleLog">日志
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle" v-bind="state.pagination"/>
|
||||
<div>
|
||||
<el-row v-show="showSearch">
|
||||
<el-form :model="state.queryForm" ref="queryRef" :inline="true" @keyup.enter="getDataList">
|
||||
<el-form-item label="业务名称" prop="configName">
|
||||
<el-input placeholder="请输入业务名称" v-model="state.queryForm.configName" />
|
||||
</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="'sys_message_add'">
|
||||
新 增
|
||||
</el-button>
|
||||
<el-button plain :disabled="multiple" icon="Delete" type="primary" v-auth="'sys_message_del'" @click="handleDelete(selectObjs)">
|
||||
删除
|
||||
</el-button>
|
||||
<right-toolbar
|
||||
v-model:showSearch="showSearch"
|
||||
:export="'admin_sysMessage_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="configName" label="业务名称" show-overflow-tooltip />
|
||||
<el-table-column prop="configKey" label="业务标识" show-overflow-tooltip />
|
||||
<el-table-column prop="configValue.supplier" label="服务地址" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
{{ JSON.parse(scope.row.configValue).smtpServer }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="configStatus" label="启用状态" show-overflow-tooltip width="100">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="yes_no_type" :value="scope.row.configStatus"></dict-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="300">
|
||||
<template #default="scope">
|
||||
<el-button icon="view" text type="primary" v-auth="'sys_message_edit'" @click="senderDialogRef.openDialog(scope.row.id)"
|
||||
>测试
|
||||
</el-button>
|
||||
<el-button icon="edit-pen" text type="primary" v-auth="'sys_message_edit'" @click="formDialogRef.openDialog(scope.row.id)"
|
||||
>编辑
|
||||
</el-button>
|
||||
<el-button icon="delete" text type="primary" v-auth="'sys_message_del'" @click="handleDelete([scope.row.id])">删除 </el-button>
|
||||
<el-button icon="Tickets" text type="primary" v-auth="'sys_message_del'" @click="handleLog">日志 </el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle" v-bind="state.pagination" />
|
||||
|
||||
<!-- 编辑、新增 -->
|
||||
<form-dialog ref="formDialogRef" @refresh="getDataList(false)"/>
|
||||
<sender-dialog ref="senderDialogRef"/>
|
||||
|
||||
</div>
|
||||
<!-- 编辑、新增 -->
|
||||
<form-dialog ref="formDialogRef" @refresh="getDataList(false)" />
|
||||
<sender-dialog ref="senderDialogRef" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="systemEmailMessage">
|
||||
import {BasicTableProps, useTable} from "/@/hooks/table";
|
||||
import {delObjs, fetchList} from "/@/api/admin/config";
|
||||
import {useMessage, useMessageBox} from "/@/hooks/message";
|
||||
import {useDict} from '/@/hooks/dict';
|
||||
import { BasicTableProps, useTable } from "/@/hooks/table"
|
||||
import { delObjs, fetchList } from "/@/api/admin/config"
|
||||
import { useMessage, useMessageBox } from "/@/hooks/message"
|
||||
import { useDict } from "/@/hooks/dict"
|
||||
|
||||
// 引入组件
|
||||
const FormDialog = defineAsyncComponent(() => import('./form.vue'));
|
||||
const SenderDialog = defineAsyncComponent(() => import('./sender.vue'));
|
||||
const FormDialog = defineAsyncComponent(() => import("./form.vue"))
|
||||
const SenderDialog = defineAsyncComponent(() => import("./sender.vue"))
|
||||
|
||||
// 定义查询字典
|
||||
const {yes_no_type} = useDict('yes_no_type')
|
||||
const { yes_no_type } = useDict("yes_no_type")
|
||||
// 定义变量内容
|
||||
const formDialogRef = ref()
|
||||
const senderDialogRef = ref()
|
||||
@@ -96,64 +97,56 @@ const selectObjs = ref([]) as any
|
||||
const multiple = ref(true)
|
||||
|
||||
const state: BasicTableProps = reactive<BasicTableProps>({
|
||||
queryForm: {
|
||||
configType: 'email',
|
||||
configName: ''
|
||||
},
|
||||
pageList: fetchList
|
||||
queryForm: {
|
||||
configType: "email",
|
||||
configName: "",
|
||||
},
|
||||
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/sysMessage/export', Object.assign(state.queryForm, {ids: selectObjs}), 'sysMessage.xlsx')
|
||||
downBlobFile("/admin/sysMessage/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('此操作将永久删除');
|
||||
} catch {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
await useMessageBox().confirm("此操作将永久删除")
|
||||
} catch {
|
||||
return
|
||||
}
|
||||
|
||||
try {
|
||||
await delObjs(ids);
|
||||
getDataList();
|
||||
useMessage().success('删除成功');
|
||||
} catch (err: any) {
|
||||
useMessage().error(err.msg);
|
||||
}
|
||||
};
|
||||
|
||||
// 跳转日志
|
||||
const router = useRouter();
|
||||
const handleLog = () => {
|
||||
router.push({path: '/admin/log/index', query: {serviceId: 'email'}})
|
||||
try {
|
||||
await delObjs(ids)
|
||||
getDataList()
|
||||
useMessage().success("删除成功")
|
||||
} catch (err: any) {
|
||||
useMessage().error(err.msg)
|
||||
}
|
||||
}
|
||||
|
||||
// 跳转日志
|
||||
const router = useRouter()
|
||||
const handleLog = () => {
|
||||
router.push({ path: "/admin/log/index", query: { serviceId: "email" } })
|
||||
}
|
||||
</script>
|
||||
@@ -1,103 +1,121 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-row v-show="showSearch">
|
||||
<el-form :model="state.queryForm" ref="queryRef" :inline="true" @keyup.enter="getDataList">
|
||||
<el-form-item label="标题" prop="title">
|
||||
<el-input placeholder="请输入标题" v-model="state.queryForm.title"/>
|
||||
</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="'sys_message_add'">
|
||||
新 增
|
||||
</el-button>
|
||||
<el-button plain :disabled="multiple" icon="Delete" type="primary"
|
||||
v-auth="'sys_message_del'" @click="handleDelete(selectObjs)">
|
||||
删除
|
||||
</el-button>
|
||||
<right-toolbar v-model:showSearch="showSearch" :export="'admin_sysMessage_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="category" label="分类" show-overflow-tooltip width="100">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="message_type" :value="scope.row.category"></dict-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="title" label="标题" show-overflow-tooltip/>
|
||||
<el-table-column prop="allFlag" label="全部通知" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
<dict-tag :options="yes_no_type" :value="scope.row.allFlag"></dict-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="sendFlag" label="已发送" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
<dict-tag :options="yes_no_type" :value="scope.row.sendFlag"></dict-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="sort" label="排序" show-overflow-tooltip/>
|
||||
<el-table-column label="操作" width="300">
|
||||
<template #default="scope">
|
||||
<el-button icon="view" text type="primary" @click="contentRef.openDialog(scope.row)">详情
|
||||
</el-button>
|
||||
<el-button icon="BellFilled" text type="primary" v-auth="'sys_message_edit'"
|
||||
v-if="scope.row.sendFlag !== '1'"
|
||||
@click="handleSend(scope.row.id)">群发
|
||||
</el-button>
|
||||
<el-button icon="edit-pen" text type="primary" v-auth="'sys_message_edit'"
|
||||
v-if="scope.row.sendFlag === '0'"
|
||||
@click="formDialogRef.openDialog(scope.row.id)">编辑
|
||||
</el-button>
|
||||
<el-button icon="delete" text type="primary" v-auth="'sys_message_del'"
|
||||
@click="handleDelete([scope.row.id])">删除
|
||||
</el-button>
|
||||
<el-button icon="List" text type="primary" v-auth="'sys_message_edit'"
|
||||
v-if="scope.row.sendFlag === '1'"
|
||||
@click="receiveRef.openDialog(scope.row.id)">接收情况
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle" v-bind="state.pagination"/>
|
||||
<div>
|
||||
<el-row v-show="showSearch">
|
||||
<el-form :model="state.queryForm" ref="queryRef" :inline="true" @keyup.enter="getDataList">
|
||||
<el-form-item label="标题" prop="title">
|
||||
<el-input placeholder="请输入标题" v-model="state.queryForm.title" />
|
||||
</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="'sys_message_add'">
|
||||
新 增
|
||||
</el-button>
|
||||
<el-button plain :disabled="multiple" icon="Delete" type="primary" v-auth="'sys_message_del'" @click="handleDelete(selectObjs)">
|
||||
删除
|
||||
</el-button>
|
||||
<right-toolbar
|
||||
v-model:showSearch="showSearch"
|
||||
:export="'admin_sysMessage_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="category" label="分类" show-overflow-tooltip width="100">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="message_type" :value="scope.row.category"></dict-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="title" label="标题" show-overflow-tooltip />
|
||||
<el-table-column prop="allFlag" label="全部通知" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
<dict-tag :options="yes_no_type" :value="scope.row.allFlag"></dict-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="sendFlag" label="已发送" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
<dict-tag :options="yes_no_type" :value="scope.row.sendFlag"></dict-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="sort" label="排序" show-overflow-tooltip />
|
||||
<el-table-column label="操作" width="300">
|
||||
<template #default="scope">
|
||||
<el-button icon="view" text type="primary" @click="contentRef.openDialog(scope.row)">详情 </el-button>
|
||||
<el-button
|
||||
icon="BellFilled"
|
||||
text
|
||||
type="primary"
|
||||
v-auth="'sys_message_edit'"
|
||||
v-if="scope.row.sendFlag !== '1'"
|
||||
@click="handleSend(scope.row.id)"
|
||||
>群发
|
||||
</el-button>
|
||||
<el-button
|
||||
icon="edit-pen"
|
||||
text
|
||||
type="primary"
|
||||
v-auth="'sys_message_edit'"
|
||||
v-if="scope.row.sendFlag === '0'"
|
||||
@click="formDialogRef.openDialog(scope.row.id)"
|
||||
>编辑
|
||||
</el-button>
|
||||
<el-button icon="delete" text type="primary" v-auth="'sys_message_del'" @click="handleDelete([scope.row.id])">删除 </el-button>
|
||||
<el-button
|
||||
icon="List"
|
||||
text
|
||||
type="primary"
|
||||
v-auth="'sys_message_edit'"
|
||||
v-if="scope.row.sendFlag === '1'"
|
||||
@click="receiveRef.openDialog(scope.row.id)"
|
||||
>接收情况
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle" v-bind="state.pagination" />
|
||||
|
||||
<!-- 编辑、新增 -->
|
||||
<form-dialog ref="formDialogRef" @refresh="getDataList(false)"/>
|
||||
<!-- 编辑、新增 -->
|
||||
<form-dialog ref="formDialogRef" @refresh="getDataList(false)" />
|
||||
|
||||
<!-- 消息内容 -->
|
||||
<news-content ref="contentRef"/>
|
||||
<!-- 消息内容 -->
|
||||
<news-content ref="contentRef" />
|
||||
|
||||
<!-- 接收列表 -->
|
||||
<receive ref="receiveRef"/>
|
||||
</div>
|
||||
<!-- 接收列表 -->
|
||||
<receive ref="receiveRef" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="systemSysMessage">
|
||||
import {BasicTableProps, useTable} from "/@/hooks/table";
|
||||
import {delObjs, fetchList, sendObj} from "/@/api/admin/message";
|
||||
import {useMessage, useMessageBox} from "/@/hooks/message";
|
||||
import {useDict} from '/@/hooks/dict';
|
||||
import { BasicTableProps, useTable } from "/@/hooks/table"
|
||||
import { delObjs, fetchList, sendObj } from "/@/api/admin/message"
|
||||
import { useMessage, useMessageBox } from "/@/hooks/message"
|
||||
import { useDict } from "/@/hooks/dict"
|
||||
|
||||
// 引入组件
|
||||
const FormDialog = defineAsyncComponent(() => import('./form.vue'));
|
||||
const Receive = defineAsyncComponent(() => import('./receive.vue'));
|
||||
const NewsContent = defineAsyncComponent(() => import('/@/views/home/news/content.vue'));
|
||||
const FormDialog = defineAsyncComponent(() => import("./form.vue"))
|
||||
const Receive = defineAsyncComponent(() => import("./receive.vue"))
|
||||
const NewsContent = defineAsyncComponent(() => import("/@/views/home/news/content.vue"))
|
||||
// 定义查询字典
|
||||
const {message_type, yes_no_type} = useDict('message_type', 'yes_no_type')
|
||||
const { message_type, yes_no_type } = useDict("message_type", "yes_no_type")
|
||||
// 定义变量内容
|
||||
const formDialogRef = ref()
|
||||
// 搜索变量
|
||||
@@ -110,71 +128,64 @@ 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/sysMessage/export', Object.assign(state.queryForm, {ids: selectObjs}), 'sysMessage.xlsx')
|
||||
downBlobFile("/admin/sysMessage/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('此操作将永久删除');
|
||||
} 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 handleSend = async (id: string) => {
|
||||
try {
|
||||
await useMessageBox().confirm('此操作将消息推送给目标用户');
|
||||
} catch {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
await useMessageBox().confirm("此操作将消息推送给目标用户")
|
||||
} catch {
|
||||
return
|
||||
}
|
||||
|
||||
try {
|
||||
await sendObj({id: id});
|
||||
getDataList();
|
||||
useMessage().success('推送成功');
|
||||
} catch (err: any) {
|
||||
useMessage().error(err.msg);
|
||||
}
|
||||
};
|
||||
try {
|
||||
await sendObj({ id: id })
|
||||
getDataList()
|
||||
useMessage().success("推送成功")
|
||||
} catch (err: any) {
|
||||
useMessage().error(err.msg)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -1,87 +1,89 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-row v-show="showSearch">
|
||||
<el-form :model="state.queryForm" ref="queryRef" :inline="true" @keyup.enter="getDataList">
|
||||
<el-form-item label="业务名称" prop="configName">
|
||||
<el-input placeholder="请输入业务名称" v-model="state.queryForm.configName"/>
|
||||
</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="'sys_message_add'">
|
||||
新 增
|
||||
</el-button>
|
||||
<el-button plain :disabled="multiple" icon="Delete" type="primary"
|
||||
v-auth="'sys_message_del'" @click="handleDelete(selectObjs)">
|
||||
删除
|
||||
</el-button>
|
||||
<right-toolbar v-model:showSearch="showSearch" :export="'admin_sysMessage_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="configName" label="业务名称" show-overflow-tooltip/>
|
||||
<el-table-column prop="configKey" label="业务标识" show-overflow-tooltip/>
|
||||
<el-table-column prop="configValue.supplier" label="厂商" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
{{ formDialogRef?.supplierList.find((item: any) => item.value === JSON.parse(scope.row.configValue).supplier)?.label}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="configStatus" label="启用状态" show-overflow-tooltip width="100">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="yes_no_type" :value="scope.row.configStatus"></dict-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="300">
|
||||
<template #default="scope">
|
||||
<el-button icon="view" text type="primary" v-auth="'sys_message_edit'"
|
||||
@click="senderDialogRef.openDialog(scope.row.id)">测试
|
||||
</el-button>
|
||||
<el-button icon="edit-pen" text type="primary" v-auth="'sys_message_edit'"
|
||||
@click="formDialogRef.openDialog(scope.row.id)">编辑
|
||||
</el-button>
|
||||
<el-button icon="delete" text type="primary" v-auth="'sys_message_del'"
|
||||
@click="handleDelete([scope.row.id])">删除
|
||||
</el-button>
|
||||
<el-button icon="Tickets" text type="primary" v-auth="'sys_message_del'"
|
||||
@click="handleLog">日志
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle" v-bind="state.pagination"/>
|
||||
<div>
|
||||
<el-row v-show="showSearch">
|
||||
<el-form :model="state.queryForm" ref="queryRef" :inline="true" @keyup.enter="getDataList">
|
||||
<el-form-item label="业务名称" prop="configName">
|
||||
<el-input placeholder="请输入业务名称" v-model="state.queryForm.configName" />
|
||||
</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="'sys_message_add'">
|
||||
新 增
|
||||
</el-button>
|
||||
<el-button plain :disabled="multiple" icon="Delete" type="primary" v-auth="'sys_message_del'" @click="handleDelete(selectObjs)">
|
||||
删除
|
||||
</el-button>
|
||||
<right-toolbar
|
||||
v-model:showSearch="showSearch"
|
||||
:export="'admin_sysMessage_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="configName" label="业务名称" show-overflow-tooltip />
|
||||
<el-table-column prop="configKey" label="业务标识" show-overflow-tooltip />
|
||||
<el-table-column prop="configValue.supplier" label="厂商" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
{{ formDialogRef?.supplierList.find((item: any) => item.value === JSON.parse(scope.row.configValue).supplier)?.label }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="configStatus" label="启用状态" show-overflow-tooltip width="100">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="yes_no_type" :value="scope.row.configStatus"></dict-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="300">
|
||||
<template #default="scope">
|
||||
<el-button icon="view" text type="primary" v-auth="'sys_message_edit'" @click="senderDialogRef.openDialog(scope.row.id)"
|
||||
>测试
|
||||
</el-button>
|
||||
<el-button icon="edit-pen" text type="primary" v-auth="'sys_message_edit'" @click="formDialogRef.openDialog(scope.row.id)"
|
||||
>编辑
|
||||
</el-button>
|
||||
<el-button icon="delete" text type="primary" v-auth="'sys_message_del'" @click="handleDelete([scope.row.id])">删除 </el-button>
|
||||
<el-button icon="Tickets" text type="primary" v-auth="'sys_message_del'" @click="handleLog">日志 </el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle" v-bind="state.pagination" />
|
||||
|
||||
<!-- 编辑、新增 -->
|
||||
<form-dialog ref="formDialogRef" @refresh="getDataList(false)"/>
|
||||
<sender-dialog ref="senderDialogRef"/>
|
||||
</div>
|
||||
<!-- 编辑、新增 -->
|
||||
<form-dialog ref="formDialogRef" @refresh="getDataList(false)" />
|
||||
<sender-dialog ref="senderDialogRef" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="systemSmsMessage">
|
||||
import {BasicTableProps, useTable} from "/@/hooks/table";
|
||||
import {delObjs, fetchList} from "/@/api/admin/config";
|
||||
import {useMessage, useMessageBox} from "/@/hooks/message";
|
||||
import {useDict} from '/@/hooks/dict';
|
||||
import { BasicTableProps, useTable } from "/@/hooks/table"
|
||||
import { delObjs, fetchList } from "/@/api/admin/config"
|
||||
import { useMessage, useMessageBox } from "/@/hooks/message"
|
||||
import { useDict } from "/@/hooks/dict"
|
||||
|
||||
// 引入组件
|
||||
const FormDialog = defineAsyncComponent(() => import('./form.vue'));
|
||||
const SenderDialog = defineAsyncComponent(() => import('./sender.vue'));
|
||||
const FormDialog = defineAsyncComponent(() => import("./form.vue"))
|
||||
const SenderDialog = defineAsyncComponent(() => import("./sender.vue"))
|
||||
// 定义查询字典
|
||||
const {yes_no_type} = useDict('yes_no_type')
|
||||
const { yes_no_type } = useDict("yes_no_type")
|
||||
// 定义变量内容
|
||||
const formDialogRef = ref()
|
||||
const senderDialogRef = ref()
|
||||
@@ -93,63 +95,56 @@ const selectObjs = ref([]) as any
|
||||
const multiple = ref(true)
|
||||
|
||||
const state: BasicTableProps = reactive<BasicTableProps>({
|
||||
queryForm: {
|
||||
configType: 'sms',
|
||||
configName: ''
|
||||
},
|
||||
pageList: fetchList
|
||||
queryForm: {
|
||||
configType: "sms",
|
||||
configName: "",
|
||||
},
|
||||
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/sysMessage/export', Object.assign(state.queryForm, {ids: selectObjs}), 'sysMessage.xlsx')
|
||||
downBlobFile("/admin/sysMessage/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('此操作将永久删除');
|
||||
} 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 router = useRouter();
|
||||
const router = useRouter()
|
||||
const handleLog = () => {
|
||||
router.push({path: '/admin/log/index', query: {serviceId: 'sms'}})
|
||||
router.push({ path: "/admin/log/index", query: { serviceId: "sms" } })
|
||||
}
|
||||
</script>
|
||||
@@ -1,89 +1,91 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-row v-show="showSearch">
|
||||
<el-form :model="state.queryForm" ref="queryRef" :inline="true" @keyup.enter="getDataList">
|
||||
<el-form-item label="业务名称" prop="configName">
|
||||
<el-input placeholder="请输入业务名称" v-model="state.queryForm.configName"/>
|
||||
</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="'sys_message_add'">
|
||||
新 增
|
||||
</el-button>
|
||||
<el-button plain :disabled="multiple" icon="Delete" type="primary"
|
||||
v-auth="'sys_message_del'" @click="handleDelete(selectObjs)">
|
||||
删除
|
||||
</el-button>
|
||||
<right-toolbar v-model:showSearch="showSearch" :export="'admin_sysMessage_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="configName" label="业务名称" show-overflow-tooltip/>
|
||||
<el-table-column prop="configKey" label="业务标识" show-overflow-tooltip/>
|
||||
<el-table-column prop="configValue.supplier" label="厂商" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
{{ formDialogRef?.supplierList.find((item: any) => item.value === JSON.parse(scope.row.configValue).supplier)?.label}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="configStatus" label="启用状态" show-overflow-tooltip width="100">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="yes_no_type" :value="scope.row.configStatus"></dict-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="300">
|
||||
<template #default="scope">
|
||||
<el-button icon="view" text type="primary" v-auth="'sys_message_edit'"
|
||||
@click="senderDialogRef.openDialog(scope.row.id)">测试
|
||||
</el-button>
|
||||
<el-button icon="edit-pen" text type="primary" v-auth="'sys_message_edit'"
|
||||
@click="formDialogRef.openDialog(scope.row.id)">编辑
|
||||
</el-button>
|
||||
<el-button icon="delete" text type="primary" v-auth="'sys_message_del'"
|
||||
@click="handleDelete([scope.row.id])">删除
|
||||
</el-button>
|
||||
<el-button icon="Tickets" text type="primary" v-auth="'sys_message_del'"
|
||||
@click="handleLog">日志
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle" v-bind="state.pagination"/>
|
||||
<div>
|
||||
<el-row v-show="showSearch">
|
||||
<el-form :model="state.queryForm" ref="queryRef" :inline="true" @keyup.enter="getDataList">
|
||||
<el-form-item label="业务名称" prop="configName">
|
||||
<el-input placeholder="请输入业务名称" v-model="state.queryForm.configName" />
|
||||
</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="'sys_message_add'">
|
||||
新 增
|
||||
</el-button>
|
||||
<el-button plain :disabled="multiple" icon="Delete" type="primary" v-auth="'sys_message_del'" @click="handleDelete(selectObjs)">
|
||||
删除
|
||||
</el-button>
|
||||
<right-toolbar
|
||||
v-model:showSearch="showSearch"
|
||||
:export="'admin_sysMessage_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="configName" label="业务名称" show-overflow-tooltip />
|
||||
<el-table-column prop="configKey" label="业务标识" show-overflow-tooltip />
|
||||
<el-table-column prop="configValue.supplier" label="厂商" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
{{ formDialogRef?.supplierList.find((item: any) => item.value === JSON.parse(scope.row.configValue).supplier)?.label }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="configStatus" label="启用状态" show-overflow-tooltip width="100">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="yes_no_type" :value="scope.row.configStatus"></dict-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="300">
|
||||
<template #default="scope">
|
||||
<el-button icon="view" text type="primary" v-auth="'sys_message_edit'" @click="senderDialogRef.openDialog(scope.row.id)"
|
||||
>测试
|
||||
</el-button>
|
||||
<el-button icon="edit-pen" text type="primary" v-auth="'sys_message_edit'" @click="formDialogRef.openDialog(scope.row.id)"
|
||||
>编辑
|
||||
</el-button>
|
||||
<el-button icon="delete" text type="primary" v-auth="'sys_message_del'" @click="handleDelete([scope.row.id])">删除 </el-button>
|
||||
<el-button icon="Tickets" text type="primary" v-auth="'sys_message_del'" @click="handleLog">日志 </el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle" v-bind="state.pagination" />
|
||||
|
||||
<!-- 编辑、新增 -->
|
||||
<form-dialog ref="formDialogRef" @refresh="getDataList(false)"/>
|
||||
<sender-dialog ref="senderDialogRef"/>
|
||||
</div>
|
||||
<!-- 编辑、新增 -->
|
||||
<form-dialog ref="formDialogRef" @refresh="getDataList(false)" />
|
||||
<sender-dialog ref="senderDialogRef" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="systemSysHookMessage">
|
||||
import {BasicTableProps, useTable} from "/@/hooks/table";
|
||||
import {delObjs, fetchList} from "/@/api/admin/config";
|
||||
import {useMessage, useMessageBox} from "/@/hooks/message";
|
||||
import {useDict} from '/@/hooks/dict';
|
||||
import { BasicTableProps, useTable } from "/@/hooks/table"
|
||||
import { delObjs, fetchList } from "/@/api/admin/config"
|
||||
import { useMessage, useMessageBox } from "/@/hooks/message"
|
||||
import { useDict } from "/@/hooks/dict"
|
||||
|
||||
// 引入组件
|
||||
const FormDialog = defineAsyncComponent(() => import('./form.vue'));
|
||||
const SenderDialog = defineAsyncComponent(() => import('./sender.vue'));
|
||||
const FormDialog = defineAsyncComponent(() => import("./form.vue"))
|
||||
const SenderDialog = defineAsyncComponent(() => import("./sender.vue"))
|
||||
const senderDialogRef = ref()
|
||||
|
||||
// 定义查询字典
|
||||
const {yes_no_type} = useDict('yes_no_type')
|
||||
const { yes_no_type } = useDict("yes_no_type")
|
||||
// 定义变量内容
|
||||
const formDialogRef = ref()
|
||||
// 搜索变量
|
||||
@@ -94,63 +96,56 @@ const selectObjs = ref([]) as any
|
||||
const multiple = ref(true)
|
||||
|
||||
const state: BasicTableProps = reactive<BasicTableProps>({
|
||||
queryForm: {
|
||||
configType: 'webhook',
|
||||
configName: ''
|
||||
},
|
||||
pageList: fetchList
|
||||
queryForm: {
|
||||
configType: "webhook",
|
||||
configName: "",
|
||||
},
|
||||
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/sysMessage/export', Object.assign(state.queryForm, {ids: selectObjs}), 'sysMessage.xlsx')
|
||||
downBlobFile("/admin/sysMessage/export", Object.assign(state.queryForm, { ids: selectObjs }), "信息推送-hook.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('此操作将永久删除');
|
||||
} 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 router = useRouter();
|
||||
const router = useRouter()
|
||||
const handleLog = () => {
|
||||
router.push({path: '/admin/log/index', query: {serviceId: 'webhook'}})
|
||||
router.push({ path: "/admin/log/index", query: { serviceId: "webhook" } })
|
||||
}
|
||||
</script>
|
||||
@@ -125,7 +125,7 @@ const resetQuery = () => {
|
||||
|
||||
// 导出excel
|
||||
const exportExcel = () => {
|
||||
downBlobFile("/canteen/merchantInfo/export", Object.assign(state.queryForm, { ids: selectObjs }), "merchantInfo.xlsx")
|
||||
downBlobFile("/canteen/merchantInfo/export", Object.assign(state.queryForm, { ids: selectObjs }), "商户管理.xlsx")
|
||||
}
|
||||
|
||||
// 多选事件
|
||||
|
||||
@@ -163,7 +163,7 @@ const resetQuery = () => {
|
||||
|
||||
// 导出excel
|
||||
const exportExcel = () => {
|
||||
downBlobFile("/wallet/walletActive/export", Object.assign(state.queryForm, { ids: selectObjs }), "walletActive.xlsx")
|
||||
downBlobFile("/wallet/walletActive/export", Object.assign(state.queryForm, { ids: selectObjs }), "钱包开卡.xlsx")
|
||||
}
|
||||
|
||||
// 多选事件
|
||||
|
||||
@@ -175,7 +175,7 @@ const exportExcel = () => {
|
||||
postDownBlobFile(
|
||||
"/wallet/wallet-transaction/export-cz",
|
||||
Object.assign(state.queryForm, { current: state.pagination?.current, size: state.pagination?.size }),
|
||||
"walletRecharge.xlsx",
|
||||
"充值记录.xlsx",
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -133,7 +133,7 @@ const doInfo = (row: any) => {
|
||||
|
||||
// 导出excel
|
||||
const exportExcel = () => {
|
||||
downBlobFile("/wallet/walletForeign/export", Object.assign(state.queryForm, { ids: selectObjs }), "walletForeign.xlsx")
|
||||
downBlobFile("/wallet/walletForeign/export", Object.assign(state.queryForm, { ids: selectObjs }), "外来人员电子餐券.xlsx")
|
||||
}
|
||||
|
||||
// 多选事件
|
||||
|
||||
@@ -134,7 +134,7 @@ const doInfo = (row: any) => {
|
||||
|
||||
// 导出excel
|
||||
const exportExcel = () => {
|
||||
downBlobFile("/wallet/walletFreeze/export", Object.assign(state.queryForm, { ids: selectObjs }), "walletFreeze.xlsx")
|
||||
downBlobFile("/wallet/walletFreeze/export", Object.assign(state.queryForm, { ids: selectObjs }), "饭卡冻结记录.xlsx")
|
||||
}
|
||||
|
||||
// 多选事件
|
||||
|
||||
@@ -183,7 +183,7 @@ const exportExcel = () => {
|
||||
postDownBlobFile(
|
||||
"/wallet/wallet-manage/export",
|
||||
Object.assign(state.queryForm, { current: state.pagination?.current, size: state.pagination?.size }),
|
||||
"walletManage.xlsx",
|
||||
"电子钱包.xlsx",
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -159,7 +159,7 @@ const exportExcel = () => {
|
||||
postDownBlobFile(
|
||||
"/wallet/wallet-manage/export-qb",
|
||||
Object.assign(state.queryForm, { current: state.pagination?.current, size: state.pagination?.size }),
|
||||
"wallet_walletRecord.xlsx",
|
||||
"钱包记录.xlsx",
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -184,7 +184,7 @@ const resetQuery = () => {
|
||||
|
||||
// 导出excel
|
||||
const exportExcel = () => {
|
||||
downBlobFile("/wallet/walletRechargeApply/export", Object.assign(state.queryForm, { ids: selectObjs }), "walletRechargeApply.xlsx")
|
||||
downBlobFile("/wallet/walletRechargeApply/export", Object.assign(state.queryForm, { ids: selectObjs }), "充值/扣款申请.xlsx")
|
||||
}
|
||||
|
||||
const doApply = async (row: any) => {
|
||||
|
||||
@@ -70,15 +70,12 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="preview-excel">
|
||||
import { computed } from "vue"
|
||||
import { BasicTableProps, useTable } from "/@/hooks/table"
|
||||
import { useDict } from "/@/hooks/dict"
|
||||
import { useTable } from "/@/hooks/table"
|
||||
import { displayPrice } from "/@/utils/formatMoney"
|
||||
import * as walletRechargeApplyApi from "/@/api/wallet/wallet-recharge-apply"
|
||||
import type { VNode } from "vue"
|
||||
import type { TableColumnCtx } from "element-plus"
|
||||
import { h } from "vue"
|
||||
import { downBlobFile } from "/@/utils/other"
|
||||
|
||||
interface SummaryMethodProps<T = any> {
|
||||
columns: TableColumnCtx<T>[]
|
||||
@@ -87,9 +84,6 @@ interface SummaryMethodProps<T = any> {
|
||||
|
||||
const { query } = useRoute()
|
||||
|
||||
// 定义变量内容
|
||||
const dialogVisible = ref(false)
|
||||
|
||||
onMounted(async () => {
|
||||
const id = query.id as unknown as any
|
||||
state.queryForm.id = id
|
||||
@@ -108,7 +102,7 @@ const state = reactive<any>({
|
||||
})
|
||||
|
||||
// table hook
|
||||
const { tableStyle } = useTable(state)
|
||||
const { tableStyle, downBlobFile } = useTable(state)
|
||||
|
||||
const data = reactive<any>({
|
||||
list: [],
|
||||
@@ -149,7 +143,7 @@ const getList = async () => {
|
||||
|
||||
// 导出excel
|
||||
const exportExcel = () => {
|
||||
downBlobFile("/wallet/wallet-recharge-apply/export-excel", Object.assign(state.queryForm), "walletManage.xlsx")
|
||||
downBlobFile("/wallet/wallet-recharge-apply/export-excel", Object.assign(state.queryForm), "充值/扣款申请-数据.xlsx")
|
||||
}
|
||||
|
||||
// 表格行尾合计
|
||||
|
||||
@@ -180,7 +180,7 @@ const getSummaries = (param: any) => {
|
||||
|
||||
// 导出excel
|
||||
const exportExcel = () => {
|
||||
postDownBlobFile("/wallet/wallet-recharge-import/export", Object.assign(state.queryForm, { ids: selectObjs }), "walletRechargeApply.xlsx")
|
||||
postDownBlobFile("/wallet/wallet-recharge-import/export", Object.assign(state.queryForm, { ids: selectObjs }), "充值/扣款流水.xlsx")
|
||||
}
|
||||
|
||||
// 多选事件
|
||||
|
||||
@@ -125,7 +125,7 @@ const resetQuery = () => {
|
||||
|
||||
// 导出excel
|
||||
const exportExcel = () => {
|
||||
downBlobFile("/wallet/wallet-recharge-package/export", Object.assign(state.queryForm, { ids: selectObjs }), "walletRechargePackage.xlsx")
|
||||
downBlobFile("/wallet/wallet-recharge-package/export", Object.assign(state.queryForm, { ids: selectObjs }), "钱包配置中心-充值套餐.xlsx")
|
||||
}
|
||||
|
||||
// 多选事件
|
||||
|
||||
@@ -135,7 +135,7 @@ const doInfo = (row: any) => {
|
||||
|
||||
// 导出excel
|
||||
const exportExcel = () => {
|
||||
downBlobFile("/admin/walletStride/export", Object.assign(state.queryForm, { ids: selectObjs }), "walletStride.xlsx")
|
||||
downBlobFile("/admin/walletStride/export", Object.assign(state.queryForm, { ids: selectObjs }), "跨单位就餐.xlsx")
|
||||
}
|
||||
|
||||
// 多选事件
|
||||
|
||||
@@ -176,7 +176,7 @@ const exportExcel = () => {
|
||||
postDownBlobFile(
|
||||
"/wallet/wallet-transaction/export-tk",
|
||||
Object.assign(state.queryForm, { current: state.pagination?.current, size: state.pagination?.size }),
|
||||
"walletRecharge.xlsx",
|
||||
"退款记录.xlsx",
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -3,13 +3,7 @@
|
||||
<div class="layout-padding-auto layout-padding-view">
|
||||
<el-row>
|
||||
<div class="mb8" style="width: 100%">
|
||||
<el-button
|
||||
icon="folder-add"
|
||||
type="primary"
|
||||
class="ml10"
|
||||
@click="formDialogRef.openDialog()"
|
||||
v-auth="'wallet_walletType_add'"
|
||||
>
|
||||
<el-button icon="folder-add" type="primary" class="ml10" @click="formDialogRef.openDialog()" v-auth="'wallet_walletType_add'">
|
||||
新 增
|
||||
</el-button>
|
||||
<el-button
|
||||
@@ -57,20 +51,10 @@
|
||||
</el-table-column>
|
||||
<el-table-column v-auths="['wallet_walletType_edit', 'wallet_walletType_del']" label="操作" width="150">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
icon="edit-pen"
|
||||
text
|
||||
type="primary"
|
||||
v-auth="'wallet_walletType_edit'"
|
||||
@click="formDialogRef.openDialog(scope.row.id)"
|
||||
<el-button icon="edit-pen" text type="primary" v-auth="'wallet_walletType_edit'" @click="formDialogRef.openDialog(scope.row.id)"
|
||||
>编辑</el-button
|
||||
>
|
||||
<el-button
|
||||
icon="delete"
|
||||
text
|
||||
type="primary"
|
||||
v-auth="'wallet_walletType_del'"
|
||||
@click="handleDelete([scope.row.id])"
|
||||
<el-button icon="delete" text type="primary" v-auth="'wallet_walletType_del'" @click="handleDelete([scope.row.id])"
|
||||
>删除</el-button
|
||||
>
|
||||
</template>
|
||||
@@ -109,8 +93,7 @@ const state: BasicTableProps = reactive<BasicTableProps>({
|
||||
})
|
||||
|
||||
// table hook
|
||||
const { getDataList, currentChangeHandle, sizeChangeHandle, sortChangeHandle, downBlobFile, tableStyle } =
|
||||
useTable(state)
|
||||
const { getDataList, currentChangeHandle, sizeChangeHandle, sortChangeHandle, downBlobFile, tableStyle } = useTable(state)
|
||||
|
||||
// 清空搜索条件
|
||||
const resetQuery = () => {
|
||||
@@ -123,7 +106,7 @@ const resetQuery = () => {
|
||||
|
||||
// 导出excel
|
||||
const exportExcel = () => {
|
||||
downBlobFile("/wallet/walletType/export", Object.assign(state.queryForm, { ids: selectObjs }), "walletType.xlsx")
|
||||
downBlobFile("/wallet/walletType/export", Object.assign(state.queryForm, { ids: selectObjs }), "多钱包.xlsx")
|
||||
}
|
||||
|
||||
// 多选事件
|
||||
|
||||
@@ -170,7 +170,7 @@ const exportExcel = () => {
|
||||
postDownBlobFile(
|
||||
"/wallet/wallet-transaction/export-xf",
|
||||
Object.assign(state.queryForm, { current: state.pagination?.current, size: state.pagination?.size }),
|
||||
"walletRecharge.xlsx",
|
||||
"消费记录.xlsx",
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user