补全功能模块的授权问题

main
huojin\hj 2025-06-06 16:47:53 +08:00
parent 367886890f
commit 9c261a8f6a
33 changed files with 500 additions and 428 deletions

View File

@ -42,7 +42,7 @@
</template> </template>
新建 新建
</a-button> </a-button>
<a-button @click="confirmBatchDelete" type="primary" danger v-privilege="'address:batchDelete'" <a-button @click="confirmBatchDelete" type="primary" danger v-privilege="'address:delete'"
:disabled="selectedRowKeyList.length == 0"> :disabled="selectedRowKeyList.length == 0">
<template #icon> <template #icon>
<DeleteOutlined/> <DeleteOutlined/>

View File

@ -48,7 +48,7 @@
</template> </template>
新建 新建
</a-button> </a-button>
<a-button @click="confirmBatchDelete" type="primary" danger v-privilege="'area:batchDelete'" <a-button @click="confirmBatchDelete" type="primary" danger v-privilege="'area:delete'"
:disabled="selectedRowKeyList.length == 0"> :disabled="selectedRowKeyList.length == 0">
<template #icon> <template #icon>
<DeleteOutlined/> <DeleteOutlined/>

View File

@ -48,7 +48,7 @@
</template> </template>
新建 新建
</a-button> </a-button>
<a-button @click="confirmBatchDelete" type="primary" danger v-privilege="'customer:batchDelete'" <a-button @click="confirmBatchDelete" type="primary" danger v-privilege="'customer:delete'"
:disabled="selectedRowKeyList.length == 0"> :disabled="selectedRowKeyList.length == 0">
<template #icon> <template #icon>
<DeleteOutlined/> <DeleteOutlined/>

View File

@ -49,7 +49,7 @@
</template> </template>
新建 新建
</a-button> </a-button>
<a-button @click="confirmBatchDelete" type="primary" danger v-privilege="'item:batchDelete'" <a-button @click="confirmBatchDelete" type="primary" danger v-privilege="'item:delete'"
:disabled="selectedRowKeyList.length == 0"> :disabled="selectedRowKeyList.length == 0">
<template #icon> <template #icon>
<DeleteOutlined/> <DeleteOutlined/>

View File

@ -57,7 +57,7 @@
</template> </template>
新建 新建
</a-button> </a-button>
<a-button @click="confirmBatchDelete" type="primary" danger v-privilege="'location:batchDelete'" <a-button @click="confirmBatchDelete" type="primary" danger v-privilege="'location:delete'"
:disabled="selectedRowKeyList.length == 0"> :disabled="selectedRowKeyList.length == 0">
<template #icon> <template #icon>
<DeleteOutlined/> <DeleteOutlined/>

View File

@ -56,7 +56,7 @@
</template> </template>
新建 新建
</a-button> </a-button>
<a-button @click="confirmBatchDelete" type="primary" danger v-privilege="'stock:batchDelete'" <a-button @click="confirmBatchDelete" type="primary" danger v-privilege="'stock:delete'"
:disabled="selectedRowKeyList.length == 0"> :disabled="selectedRowKeyList.length == 0">
<template #icon> <template #icon>
<DeleteOutlined/> <DeleteOutlined/>

View File

@ -0,0 +1,30 @@
<!--
* 积木大屏
*
* @Author: hj
* @Date: 2024-12-26 15:35:23
* @Copyright 友仓
-->
<template>
<iframe
width="100%"
:src="url"
frameborder="0"
allowfullscreen
class="no-scrollbar"
/>
</template>
<script setup lang="ts">
import { localRead } from "/@/utils/local-util";
import LocalStorageKeyConst from "/@/constants/local-storage-key-const";
const base = import.meta.env.VITE_APP_API_URL;
const token = localRead(LocalStorageKeyConst.USER_TOKEN);
const url = `${base}/drag/list?token=${token}`;
</script>
<style scoped>.no-scrollbar {
overflow: hidden; /* 隐藏滚动条 */
height: 100vh; /* 使用视口高度 */
}
</style>

View File

@ -0,0 +1,30 @@
<!--
* 积木报表
*
* @Author: hj
* @Date: 2024-12-26 15:35:23
* @Copyright 友仓
-->
<template>
<iframe
width="100%"
:src="url"
frameborder="0"
allowfullscreen
class="no-scrollbar"
/>
</template>
<script setup lang="ts">
import { localRead } from "/@/utils/local-util";
import LocalStorageKeyConst from "/@/constants/local-storage-key-const";
const base = import.meta.env.VITE_APP_API_URL;
const token = localRead(LocalStorageKeyConst.USER_TOKEN);
const url = `${base}/jmreport/list?token=${token}`;
</script>
<style scoped>.no-scrollbar {
overflow: hidden; /* 隐藏滚动条 */
height: 100vh; /* 使用视口高度 */
}
</style>

View File

@ -53,7 +53,7 @@
</template> </template>
新建 新建
</a-button> </a-button>
<a-button @click="confirmBatchDelete" type="primary" danger v-privilege="'asn:batchDelete'" <a-button @click="confirmBatchDelete" type="primary" danger v-privilege="'asn:delete'"
:disabled="selectedRowKeyList.length == 0"> :disabled="selectedRowKeyList.length == 0">
<template #icon> <template #icon>
<DeleteOutlined/> <DeleteOutlined/>

View File

@ -32,7 +32,7 @@
</template> </template>
批量收货 批量收货
</a-button> </a-button>
<a-button class="button-style" type="primary" v-privilege="'asnDetail:batchDelete'" @click="confirmBatchDelete" <a-button class="button-style" type="primary" v-privilege="'asnDetail:delete'" @click="confirmBatchDelete"
danger danger
:disabled="props.asnId==0 || selectedRowKeyList.length == 0"> :disabled="props.asnId==0 || selectedRowKeyList.length == 0">
<template #icon> <template #icon>

View File

@ -57,7 +57,7 @@
</template> </template>
新建 新建
</a-button> </a-button>
<a-button @click="confirmBatchDelete" type="primary" danger v-privilege="'pick:batchDelete'" <a-button @click="confirmBatchDelete" type="primary" danger v-privilege="'pick:delete'"
:disabled="selectedRowKeyList.length == 0"> :disabled="selectedRowKeyList.length == 0">
<template #icon> <template #icon>
<DeleteOutlined/> <DeleteOutlined/>

View File

@ -26,7 +26,7 @@
添加明细 添加明细
</a-button> </a-button>
<a-button class="button-style" type="primary" v-privilege="'pickDetail:batchDelete'" @click="confirmBatchDelete" <a-button class="button-style" type="primary" v-privilege="'pickDetail:delete'" @click="confirmBatchDelete"
danger danger
:disabled="props.pickId==0 || selectedRowKeyList.length == 0"> :disabled="props.pickId==0 || selectedRowKeyList.length == 0">
<template #icon> <template #icon>

View File

@ -39,7 +39,7 @@
<a-input-number v-model:value="requestEncryptForm.age" placeholder="年龄" /> <a-input-number v-model:value="requestEncryptForm.age" placeholder="年龄" />
</a-form-item> </a-form-item>
<a-form-item class="smart-query-form-item"> <a-form-item class="smart-query-form-item">
<a-button type="primary" @click="testRequestEncrypt"> </a-button> <a-button type="primary" v-privilege="'support:apiEncrypt:testRequestEncrypt'" @click="testRequestEncrypt"> </a-button>
</a-form-item> </a-form-item>
</a-row> </a-row>
<a-row class="smart-query-form-row"> <a-row class="smart-query-form-row">
@ -66,7 +66,7 @@
<a-input-number v-model:value="responseEncryptForm.age" placeholder="年龄" /> <a-input-number v-model:value="responseEncryptForm.age" placeholder="年龄" />
</a-form-item> </a-form-item>
<a-form-item class="smart-query-form-item"> <a-form-item class="smart-query-form-item">
<a-button type="primary" @click="testResponseEncrypt"> </a-button> <a-button type="primary" v-privilege="'support:apiEncrypt:testResponseEncrypt'" @click="testResponseEncrypt"> </a-button>
</a-form-item> </a-form-item>
</a-row> </a-row>
<a-row class="smart-query-form-row"> <a-row class="smart-query-form-row">
@ -94,7 +94,7 @@
<a-input-number v-model:value="form.age" placeholder="年龄" /> <a-input-number v-model:value="form.age" placeholder="年龄" />
</a-form-item> </a-form-item>
<a-form-item class="smart-query-form-item"> <a-form-item class="smart-query-form-item">
<a-button type="primary" @click="testBoth"> </a-button> <a-button type="primary" v-privilege="'support:apiEncrypt:testDecryptAndEncrypt'" @click="testBoth"> </a-button>
</a-form-item> </a-form-item>
</a-row> </a-row>
<a-row class="smart-query-form-row"> <a-row class="smart-query-form-row">
@ -119,7 +119,7 @@
<a-form class="smart-query-form"> <a-form class="smart-query-form">
<a-row class="smart-query-form-row"> <a-row class="smart-query-form-row">
<a-form-item class="smart-query-form-item"> <a-form-item class="smart-query-form-item">
<a-button type="primary" @click="testArray"> </a-button> <a-button type="primary" v-privilege="'support:apiEncrypt:testArray'" @click="testArray"> </a-button>
</a-form-item> </a-form-item>
</a-row> </a-row>
<a-row class="smart-query-form-row"> <a-row class="smart-query-form-row">

View File

@ -16,13 +16,13 @@
<a-form-item class="smart-query-form-item smart-margin-left10"> <a-form-item class="smart-query-form-item smart-margin-left10">
<a-button-group> <a-button-group>
<a-button type="primary" @click="onSearch"> <a-button type="primary" @click="onSearch" v-privilege="'support:codeGenerator:queryTableList'">
<template #icon> <template #icon>
<SearchOutlined /> <SearchOutlined />
</template> </template>
查询 查询
</a-button> </a-button>
<a-button @click="resetQuery"> <a-button @click="resetQuery" v-privilege="'support:codeGenerator:queryTableList'">
<template #icon> <template #icon>
<ReloadOutlined /> <ReloadOutlined />
</template> </template>
@ -54,9 +54,9 @@
</template> </template>
<template v-if="column.dataIndex === 'action'"> <template v-if="column.dataIndex === 'action'">
<div class="smart-table-operate"> <div class="smart-table-operate">
<a-button @click="showConfig(record)" type="link">代码配置</a-button> <a-button @click="showConfig(record)" v-privilege="'support:codeGenerator:getConfig'" type="link"></a-button>
<a-button @click="showPreview(record)" type="link">代码预览</a-button> <a-button @click="showPreview(record)" v-privilege="'support:codeGenerator:preview'" type="link"></a-button>
<a-button @click="download(record)" type="link">下载代码</a-button> <a-button @click="download(record)" v-privilege="'support:codeGenerator:download'" type="link"></a-button>
</div> </div>
</template> </template>
</template> </template>

View File

@ -77,7 +77,7 @@
<template #footer> <template #footer>
<a-space> <a-space>
<a-button @click="onClose"></a-button> <a-button @click="onClose"></a-button>
<a-button type="primary" @click="save"></a-button> <a-button type="primary" v-privilege="'support:codeGenerator:updateConfig'" @click="save"></a-button>
</a-space> </a-space>
</template> </template>
</a-drawer> </a-drawer>

View File

@ -11,19 +11,23 @@
<a-form class="smart-query-form"> <a-form class="smart-query-form">
<a-row class="smart-query-form-row"> <a-row class="smart-query-form-row">
<a-form-item label="关键字" class="smart-query-form-item"> <a-form-item label="关键字" class="smart-query-form-item">
<a-input style="width: 300px" v-model:value="keywords" @change="search" placeholder="关键字" /> <a-input style="width: 300px" v-model:value="keywords" @change="search" placeholder="关键字"/>
</a-form-item> </a-form-item>
<a-form-item label="禁用" class="smart-query-form-item"> <a-form-item label="禁用" class="smart-query-form-item">
<BooleanSelect v-model:value="disabledFlag" @change="search" style="width: 150px" /> <BooleanSelect v-model:value="disabledFlag" @change="search" style="width: 150px"/>
</a-form-item> </a-form-item>
<a-form-item class="smart-query-form-item smart-margin-left10"> <a-form-item class="smart-query-form-item smart-margin-left10">
<a-button type="primary" @click="queryData"> <a-button type="primary" @click="queryData" v-privilege="'support:dictData:query'">
<template #icon> <SearchOutlined /> </template> <template #icon>
<SearchOutlined/>
</template>
查询 查询
</a-button> </a-button>
<a-button @click="resetQuery" class="smart-margin-left10"> <a-button @click="resetQuery" class="smart-margin-left10" v-privilege="'support:dictData:query'">
<template #icon> <ReloadOutlined /> </template> <template #icon>
<ReloadOutlined/>
</template>
重置 重置
</a-button> </a-button>
</a-form-item> </a-form-item>
@ -34,7 +38,7 @@
<div class="smart-table-operate-block"> <div class="smart-table-operate-block">
<a-button @click="addOrUpdateData" type="primary" v-privilege="'support:dictData:add'"> <a-button @click="addOrUpdateData" type="primary" v-privilege="'support:dictData:add'">
<template #icon> <template #icon>
<PlusOutlined /> <PlusOutlined/>
</template> </template>
新建 新建
</a-button> </a-button>
@ -47,7 +51,7 @@
v-privilege="'support:dictData:delete'" v-privilege="'support:dictData:delete'"
> >
<template #icon> <template #icon>
<DeleteOutlined /> <DeleteOutlined/>
</template> </template>
批量删除 批量删除
</a-button> </a-button>
@ -67,6 +71,7 @@
<template #bodyCell="{ record, column }"> <template #bodyCell="{ record, column }">
<template v-if="column.dataIndex === 'disabledFlag'"> <template v-if="column.dataIndex === 'disabledFlag'">
<a-switch <a-switch
v-privilege="'support:dictData:updateDisabled'"
@change="(checked) => handleChangeDisabled(checked, record)" @change="(checked) => handleChangeDisabled(checked, record)"
v-model:checked="record.enabled" v-model:checked="record.enabled"
checked-children="启用中" checked-children="启用中"
@ -80,39 +85,39 @@
</a-table> </a-table>
<div class="smart-query-table-page">共计 {{ tableData.length }} </div> <div class="smart-query-table-page">共计 {{ tableData.length }} </div>
<DictDataFormModal ref="dictDataFormModalRef" @reloadList="queryData" /> <DictDataFormModal ref="dictDataFormModalRef" @reloadList="queryData"/>
</a-drawer> </a-drawer>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { reactive, ref } from 'vue'; import {reactive, ref} from 'vue';
import DictDataFormModal from './dict-data-form-modal.vue'; import DictDataFormModal from './dict-data-form-modal.vue';
import { dictApi } from '/@/api/support/dict-api'; import {dictApi} from '/@/api/support/dict-api';
import { SmartLoading } from '/@/components/framework/smart-loading'; import {SmartLoading} from '/@/components/framework/smart-loading';
import { Modal } from 'ant-design-vue'; import {Modal} from 'ant-design-vue';
import { message } from 'ant-design-vue'; import {message} from 'ant-design-vue';
import { smartSentry } from '/@/lib/smart-sentry'; import {smartSentry} from '/@/lib/smart-sentry';
import BooleanSelect from '/@/components/framework/boolean-select/index.vue'; import BooleanSelect from '/@/components/framework/boolean-select/index.vue';
import _ from 'lodash'; import _ from 'lodash';
// //
const visible = ref(false); const visible = ref(false);
const dictId = ref(undefined); const dictId = ref(undefined);
const dictCode = ref(undefined); const dictCode = ref(undefined);
function showModal(id, code) { function showModal(id, code) {
dictId.value = id; dictId.value = id;
dictCode.value = code; dictCode.value = code;
visible.value = true; visible.value = true;
queryData(); queryData();
} }
function onClose() { function onClose() {
visible.value = false; visible.value = false;
dictId.value = undefined; dictId.value = undefined;
dictCode.value = undefined; dictCode.value = undefined;
} }
const columns = reactive([ const columns = reactive([
{ {
title: '值', title: '值',
dataIndex: 'dataValue', dataIndex: 'dataValue',
@ -147,22 +152,22 @@
width: 70, width: 70,
dataIndex: 'action', dataIndex: 'action',
}, },
]); ]);
// ----------------------- ------------------------ // ----------------------- ------------------------
const keywords = ref(undefined); const keywords = ref(undefined);
const disabledFlag = ref(null); const disabledFlag = ref(null);
const selectedRowKeyList = ref([]); const selectedRowKeyList = ref([]);
const tableLoading = ref(false); const tableLoading = ref(false);
const dictDataList = ref([]); const dictDataList = ref([]);
const tableData = ref([]); const tableData = ref([]);
function onSelectChange(selectedRowKeys) { function onSelectChange(selectedRowKeys) {
selectedRowKeyList.value = selectedRowKeys; selectedRowKeyList.value = selectedRowKeys;
} }
function search() { function search() {
tableData.value = dictDataList.value.filter((item) => { tableData.value = dictDataList.value.filter((item) => {
let keywordsFilterFlag = true; let keywordsFilterFlag = true;
if (keywords.value) { if (keywords.value) {
@ -174,15 +179,15 @@
let disabledFilterFlag = _.isNull(disabledFlag.value) ? true : item.disabledFlag === disabledFlag.value; let disabledFilterFlag = _.isNull(disabledFlag.value) ? true : item.disabledFlag === disabledFlag.value;
return disabledFilterFlag && keywordsFilterFlag; return disabledFilterFlag && keywordsFilterFlag;
}); });
} }
function resetQuery() { function resetQuery() {
keywords.value = null; keywords.value = null;
disabledFlag.value = null; disabledFlag.value = null;
queryData(); queryData();
} }
async function queryData() { async function queryData() {
try { try {
tableLoading.value = true; tableLoading.value = true;
let responseData = await dictApi.queryDictData(dictId.value); let responseData = await dictApi.queryDictData(dictId.value);
@ -194,10 +199,10 @@
} finally { } finally {
tableLoading.value = false; tableLoading.value = false;
} }
} }
// ----------------------- / ------------------------ // ----------------------- / ------------------------
async function handleChangeDisabled(disabledFlag, dictData) { async function handleChangeDisabled(disabledFlag, dictData) {
SmartLoading.show(); SmartLoading.show();
try { try {
await dictApi.updateDictDataDisabled(dictData.dictDataId); await dictApi.updateDictDataDisabled(dictData.dictDataId);
@ -208,11 +213,11 @@
} finally { } finally {
SmartLoading.hide(); SmartLoading.hide();
} }
} }
// ----------------------- ------------------------ // ----------------------- ------------------------
function confirmBatchDelete() { function confirmBatchDelete() {
Modal.confirm({ Modal.confirm({
title: '提示', title: '提示',
content: '确定要删除选中值吗?', content: '确定要删除选中值吗?',
@ -222,11 +227,12 @@
batchDelete(); batchDelete();
}, },
cancelText: '取消', cancelText: '取消',
onCancel() {}, onCancel() {
},
}); });
} }
async function batchDelete() { async function batchDelete() {
try { try {
SmartLoading.show(); SmartLoading.show();
await dictApi.batchDeleteDictData(selectedRowKeyList.value); await dictApi.batchDeleteDictData(selectedRowKeyList.value);
@ -237,16 +243,17 @@
} finally { } finally {
SmartLoading.hide(); SmartLoading.hide();
} }
} }
// ----------------------- ------------------------ // ----------------------- ------------------------
const dictDataFormModalRef = ref(); const dictDataFormModalRef = ref();
function addOrUpdateData(rowData) {
function addOrUpdateData(rowData) {
dictDataFormModalRef.value.showModal(rowData, dictId.value, dictCode.value); dictDataFormModalRef.value.showModal(rowData, dictId.value, dictCode.value);
} }
defineExpose({ defineExpose({
showModal, showModal,
}); });
</script> </script>

View File

@ -17,13 +17,13 @@
</a-form-item> </a-form-item>
<a-form-item class="smart-query-form-item smart-margin-left10"> <a-form-item class="smart-query-form-item smart-margin-left10">
<a-button-group> <a-button-group>
<a-button type="primary" @click="onSearch" v-privilege="'support:dict:add'"> <a-button type="primary" @click="onSearch" v-privilege="'support:dict:query'">
<template #icon> <template #icon>
<SearchOutlined /> <SearchOutlined />
</template> </template>
查询 查询
</a-button> </a-button>
<a-button @click="resetQuery" v-privilege="'support:dict:add'"> <a-button @click="resetQuery" v-privilege="'support:dict:query'">
<template #icon> <template #icon>
<ReloadOutlined /> <ReloadOutlined />
</template> </template>
@ -78,6 +78,7 @@
</template> </template>
<template v-if="column.dataIndex === 'disabledFlag'"> <template v-if="column.dataIndex === 'disabledFlag'">
<a-switch <a-switch
v-privilege="'support:dict:updateDisabled'"
@change="(checked) => handleChangeDisabled(checked, record)" @change="(checked) => handleChangeDisabled(checked, record)"
v-model:checked="record.enabled" v-model:checked="record.enabled"
checked-children="启用中" checked-children="启用中"

View File

@ -7,37 +7,39 @@
--> -->
<template> <template>
<!---------- 查询表单form begin -----------> <!---------- 查询表单form begin ----------->
<a-form class="smart-query-form" v-privilege="'support:file:query'"> <a-form class="smart-query-form">
<a-row class="smart-query-form-row"> <a-row class="smart-query-form-row">
<a-form-item label="文件夹类型" class="smart-query-form-item"> <a-form-item label="文件夹类型" class="smart-query-form-item">
<SmartEnumSelect width="150px" v-model:value="queryForm.folderType" enumName="FILE_FOLDER_TYPE_ENUM" placeholder="文件夹类型" /> <SmartEnumSelect width="150px" v-model:value="queryForm.folderType" enumName="FILE_FOLDER_TYPE_ENUM"
placeholder="文件夹类型"/>
</a-form-item> </a-form-item>
<a-form-item label="文件名" class="smart-query-form-item"> <a-form-item label="文件名" class="smart-query-form-item">
<a-input style="width: 150px" v-model:value="queryForm.fileName" placeholder="文件名" /> <a-input style="width: 150px" v-model:value="queryForm.fileName" placeholder="文件名"/>
</a-form-item> </a-form-item>
<a-form-item label="文件Key" class="smart-query-form-item"> <a-form-item label="文件Key" class="smart-query-form-item">
<a-input style="width: 150px" v-model:value="queryForm.fileKey" placeholder="文件Key" /> <a-input style="width: 150px" v-model:value="queryForm.fileKey" placeholder="文件Key"/>
</a-form-item> </a-form-item>
<a-form-item label="文件类型" class="smart-query-form-item"> <a-form-item label="文件类型" class="smart-query-form-item">
<a-input style="width: 150px" v-model:value="queryForm.fileType" placeholder="文件类型" /> <a-input style="width: 150px" v-model:value="queryForm.fileType" placeholder="文件类型"/>
</a-form-item> </a-form-item>
<a-form-item label="创建人" class="smart-query-form-item"> <a-form-item label="创建人" class="smart-query-form-item">
<a-input style="width: 150px" v-model:value="queryForm.creatorName" placeholder="创建人" /> <a-input style="width: 150px" v-model:value="queryForm.creatorName" placeholder="创建人"/>
</a-form-item> </a-form-item>
<a-form-item label="创建时间" class="smart-query-form-item"> <a-form-item label="创建时间" class="smart-query-form-item">
<a-range-picker v-model:value="queryForm.createTime" :presets="defaultTimeRanges" style="width: 220px" @change="onChangeCreateTime" /> <a-range-picker v-model:value="queryForm.createTime" :presets="defaultTimeRanges" style="width: 220px"
@change="onChangeCreateTime"/>
</a-form-item> </a-form-item>
<a-form-item class="smart-query-form-item"> <a-form-item class="smart-query-form-item">
<a-button-group> <a-button-group>
<a-button type="primary" @click="queryData"> <a-button type="primary" @click="queryData" v-privilege="'support:file:query'">
<template #icon> <template #icon>
<SearchOutlined /> <SearchOutlined/>
</template> </template>
查询 查询
</a-button> </a-button>
<a-button @click="resetQuery"> <a-button @click="resetQuery" v-privilege="'support:file:query'">
<template #icon> <template #icon>
<ReloadOutlined /> <ReloadOutlined/>
</template> </template>
重置 重置
</a-button> </a-button>
@ -53,13 +55,13 @@
<div class="smart-table-operate-block"> <div class="smart-table-operate-block">
<a-button type="primary" @click="showUploadModal"> <a-button type="primary" @click="showUploadModal">
<template #icon> <template #icon>
<cloud-upload-outlined /> <cloud-upload-outlined/>
</template> </template>
上传文件 上传文件
</a-button> </a-button>
</div> </div>
<div class="smart-table-setting-block"> <div class="smart-table-setting-block">
<TableOperator v-model="columns" :tableId="null" :refresh="queryData" /> <TableOperator v-model="columns" :tableId="null" :refresh="queryData"/>
</div> </div>
</a-row> </a-row>
<!---------- 表格操作行 end -----------> <!---------- 表格操作行 end ----------->
@ -84,8 +86,8 @@
</template> </template>
<template v-if="column.dataIndex === 'action'"> <template v-if="column.dataIndex === 'action'">
<div class="smart-table-operate"> <div class="smart-table-operate">
<a-button @click="view(record)" type="link">查看</a-button> <a-button @click="view(record)" v-privilege="'support:file:getFileUrl'" type="link"></a-button>
<a-button @click="download(record)" type="link">下载</a-button> <a-button @click="download(record)" v-privilege="'support:file:download'" type="link"></a-button>
</div> </div>
</template> </template>
</template> </template>
@ -108,10 +110,11 @@
/> />
</div> </div>
<FilePreviewModal ref="filePreviewModalRef" /> <FilePreviewModal ref="filePreviewModalRef"/>
<a-modal v-model:open="uploadModalFlag" title="上传文件" @onCancel="hideUploadModal" @ok="hideUploadModal"> <a-modal v-model:open="uploadModalFlag" title="上传文件" @onCancel="hideUploadModal" @ok="hideUploadModal">
<FileUpload <FileUpload
v-privilege="'support:file:upload'"
list-type="text" list-type="text"
:maxUploadSize="5" :maxUploadSize="5"
buttonText="点击上传文件" buttonText="点击上传文件"
@ -123,19 +126,19 @@
</a-card> </a-card>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { onMounted, reactive, ref } from 'vue'; import {onMounted, reactive, ref} from 'vue';
import { fileApi } from '/@/api/support/file-api'; import {fileApi} from '/@/api/support/file-api';
import SmartEnumSelect from '/@/components/framework/smart-enum-select/index.vue'; import SmartEnumSelect from '/@/components/framework/smart-enum-select/index.vue';
import TableOperator from '/@/components/support/table-operator/index.vue'; import TableOperator from '/@/components/support/table-operator/index.vue';
import { PAGE_SIZE_OPTIONS } from '/@/constants/common-const'; import {PAGE_SIZE_OPTIONS} from '/@/constants/common-const';
import { defaultTimeRanges } from '/@/lib/default-time-ranges'; import {defaultTimeRanges} from '/@/lib/default-time-ranges';
import { smartSentry } from '/@/lib/smart-sentry'; import {smartSentry} from '/@/lib/smart-sentry';
import FilePreviewModal from '/@/components/support/file-preview-modal/index.vue'; import FilePreviewModal from '/@/components/support/file-preview-modal/index.vue';
import FileUpload from '/@/components/support/file-upload/index.vue'; import FileUpload from '/@/components/support/file-upload/index.vue';
import { FILE_FOLDER_TYPE_ENUM } from '/@/constants/support/file-const'; import {FILE_FOLDER_TYPE_ENUM} from '/@/constants/support/file-const';
// ---------------------------- ---------------------------- // ---------------------------- ----------------------------
const columns = ref([ const columns = ref([
{ {
title: '主键ID', title: '主键ID',
dataIndex: 'fileId', dataIndex: 'fileId',
@ -189,11 +192,11 @@
width: 120, width: 120,
fixed: 'right', fixed: 'right',
}, },
]); ]);
// ---------------------------- ---------------------------- // ---------------------------- ----------------------------
const queryFormState = { const queryFormState = {
folderType: undefined, // folderType: undefined, //
fileName: undefined, // fileName: undefined, //
fileKey: undefined, //Key fileKey: undefined, //Key
@ -204,32 +207,32 @@
createTimeEnd: undefined, // createTimeEnd: undefined, //
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
}; };
// form // form
const queryForm = reactive({ ...queryFormState }); const queryForm = reactive({...queryFormState});
// loading // loading
const tableLoading = ref(false); const tableLoading = ref(false);
// //
const tableData = ref([]); const tableData = ref([]);
// //
const total = ref(0); const total = ref(0);
// //
function resetQuery() { function resetQuery() {
let pageSize = queryForm.pageSize; let pageSize = queryForm.pageSize;
Object.assign(queryForm, queryFormState); Object.assign(queryForm, queryFormState);
queryForm.pageSize = pageSize; queryForm.pageSize = pageSize;
queryData(); queryData();
} }
// //
function onSearch() { function onSearch() {
queryForm.pageNum = 1; queryForm.pageNum = 1;
queryData(); queryData();
} }
async function queryData() { async function queryData() {
tableLoading.value = true; tableLoading.value = true;
try { try {
let queryResult = await fileApi.queryPage(queryForm); let queryResult = await fileApi.queryPage(queryForm);
@ -243,14 +246,14 @@
} finally { } finally {
tableLoading.value = false; tableLoading.value = false;
} }
} }
function onChangeCreateTime(dates, dateStrings) { function onChangeCreateTime(dates, dateStrings) {
queryForm.createTimeBegin = dateStrings[0]; queryForm.createTimeBegin = dateStrings[0];
queryForm.createTimeEnd = dateStrings[1]; queryForm.createTimeEnd = dateStrings[1];
} }
function getFileSize(size) { function getFileSize(size) {
// //
if (!size) return ''; if (!size) return '';
var num = 1024.0; //byte var num = 1024.0; //byte
@ -259,34 +262,35 @@
if (size < Math.pow(num, 3)) return (size / Math.pow(num, 2)).toFixed(2) + 'MB'; //M if (size < Math.pow(num, 3)) return (size / Math.pow(num, 2)).toFixed(2) + 'MB'; //M
if (size < Math.pow(num, 4)) return (size / Math.pow(num, 3)).toFixed(2) + 'G'; //G if (size < Math.pow(num, 4)) return (size / Math.pow(num, 3)).toFixed(2) + 'G'; //G
return (size / Math.pow(num, 4)).toFixed(2) + 'T'; //T return (size / Math.pow(num, 4)).toFixed(2) + 'T'; //T
} }
// //
const filePreviewModalRef = ref(); const filePreviewModalRef = ref();
function view(file) {
function view(file) {
filePreviewModalRef.value.showPreview(file); filePreviewModalRef.value.showPreview(file);
} }
// //
async function download(file) { async function download(file) {
try { try {
await fileApi.downLoadFile(file.fileKey); await fileApi.downLoadFile(file.fileKey);
} catch (e) { } catch (e) {
smartSentry.captureError(e); smartSentry.captureError(e);
} }
} }
onMounted(queryData); onMounted(queryData);
// ------------- -------------------- // ------------- --------------------
const uploadModalFlag = ref(false); const uploadModalFlag = ref(false);
function showUploadModal() { function showUploadModal() {
uploadModalFlag.value = true; uploadModalFlag.value = true;
} }
function hideUploadModal() { function hideUploadModal() {
uploadModalFlag.value = false; uploadModalFlag.value = false;
queryData(); queryData();
} }
</script> </script>

View File

@ -39,13 +39,13 @@
<a-form-item class="smart-query-form-item smart-margin-left10"> <a-form-item class="smart-query-form-item smart-margin-left10">
<a-button-group> <a-button-group>
<a-button type="primary" @click="onSearch"> <a-button type="primary" @click="onSearch" v-privilege="'support:heartBeat:query'">
<template #icon> <template #icon>
<SearchOutlined /> <SearchOutlined />
</template> </template>
查询 查询
</a-button> </a-button>
<a-button @click="resetQuery"> <a-button @click="resetQuery" v-privilege="'support:heartBeat:query'">
<template #icon> <template #icon>
<ReloadOutlined /> <ReloadOutlined />
</template> </template>

View File

@ -118,7 +118,7 @@
<a-button v-privilege="'support:job:update'" @click="openUpdateModal(record)" type="link"></a-button> <a-button v-privilege="'support:job:update'" @click="openUpdateModal(record)" type="link"></a-button>
<a-button v-privilege="'support:job:execute'" type="link" @click="openExecuteModal(record)"></a-button> <a-button v-privilege="'support:job:execute'" type="link" @click="openExecuteModal(record)"></a-button>
<a-button v-privilege="'support:job:log:query'" @click="openJobLogModal(record.jobId, record.jobName)" type="link"></a-button> <a-button v-privilege="'support:job:log:query'" @click="openJobLogModal(record.jobId, record.jobName)" type="link"></a-button>
<a-button danger v-privilege="'support:job:log:delete'" @click="confirmDelete(record.jobId, record.jobName)" type="link" <a-button danger v-privilege="'support:job:delete'" @click="confirmDelete(record.jobId, record.jobName)" type="link"
>删除</a-button >删除</a-button
> >
</div> </div>

View File

@ -30,7 +30,7 @@
<a-row class="smart-query-form-row"> <a-row class="smart-query-form-row">
<a-form-item class="smart-query-form-item smart-margin-left10"> <a-form-item class="smart-query-form-item smart-margin-left10">
<a-button-group> <a-button-group>
<a-button type="primary" @click="onSearch"> <a-button type="primary" @click="onSearch" v-privilege="'support:dataMasking:query'">
<template #icon> <template #icon>
<SearchOutlined /> <SearchOutlined />
</template> </template>

View File

@ -96,9 +96,9 @@
</a-form-item> </a-form-item>
<br /> <br />
<a-form-item :wrapper-col="{ span: 14, offset: 6 }"> <a-form-item :wrapper-col="{ span: 14, offset: 6 }">
<a-button type="primary" style="margin-right: 20px" @click.prevent="onSubmit">保存配置</a-button> <a-button type="primary" style="margin-right: 20px" v-privilege="'support:level3protect:updateConfig'" @click.prevent="onSubmit"></a-button>
<a-button style="margin-right: 20px" @click="reset"></a-button> <a-button style="margin-right: 20px" @click="reset" v-privilege="'support:level3protect:updateConfig'"></a-button>
<a-button danger @click="clear"></a-button> <a-button danger @click="clear" v-privilege="'support:level3protect:updateConfig'"></a-button>
</a-form-item> </a-form-item>
</a-form> </a-form>
</a-card> </a-card>

View File

@ -51,7 +51,7 @@
<!---------- 表格操作行 begin -----------> <!---------- 表格操作行 begin ----------->
<a-row class="smart-table-btn-block"> <a-row class="smart-table-btn-block">
<div class="smart-table-operate-block"> <div class="smart-table-operate-block">
<a-button @click="confirmBatchDelete" danger :disabled="selectedRowKeyList.length === 0"> <a-button @click="confirmBatchDelete" v-privilege="'support:loginFail:batchDelete'" danger :disabled="selectedRowKeyList.length === 0">
<template #icon> <template #icon>
<DeleteOutlined /> <DeleteOutlined />
</template> </template>
@ -59,7 +59,7 @@
</a-button> </a-button>
</div> </div>
<div class="smart-table-setting-block"> <div class="smart-table-setting-block">
<TableOperator v-model="columns" :tableId="null" :refresh="queryData" /> <TableOperator v-model="columns" :tableId="null" :refresh="queryData" v-privilege="'support:loginFail:queryPage'" />
</div> </div>
</a-row> </a-row>
<!---------- 表格操作行 end -----------> <!---------- 表格操作行 end ----------->

View File

@ -23,13 +23,13 @@
<a-form-item class="smart-query-form-item smart-margin-left10"> <a-form-item class="smart-query-form-item smart-margin-left10">
<a-button-group> <a-button-group>
<a-button type="primary" @click="onSearch"> <a-button type="primary" @click="onSearch" v-privilege="'support:loginLog:query'">
<template #icon> <template #icon>
<SearchOutlined /> <SearchOutlined />
</template> </template>
查询 查询
</a-button> </a-button>
<a-button @click="resetQuery"> <a-button @click="resetQuery" v-privilege="'support:loginLog:query'">
<template #icon> <template #icon>
<ReloadOutlined /> <ReloadOutlined />
</template> </template>

View File

@ -33,13 +33,13 @@
<a-form-item class="smart-query-form-item smart-margin-left10"> <a-form-item class="smart-query-form-item smart-margin-left10">
<a-button-group> <a-button-group>
<a-button type="primary" @click="ajaxQuery"> <a-button type="primary" @click="ajaxQuery" v-privilege="'support:operateLog:query'">
<template #icon> <template #icon>
<SearchOutlined /> <SearchOutlined />
</template> </template>
查询 查询
</a-button> </a-button>
<a-button @click="resetQuery"> <a-button @click="resetQuery" v-privilege="'support:operateLog:query'">
<template #icon> <template #icon>
<ReloadOutlined /> <ReloadOutlined />
</template> </template>

View File

@ -30,7 +30,13 @@
</a-alert> </a-alert>
<a-row justify="end"> <a-row justify="end">
<TableOperator class="smart-margin-bottom5 smart-margin-top5" v-model="columns" :tableId="TABLE_ID_CONST.SUPPORT.RELOAD" :refresh="ajaxQuery" /> <TableOperator
class="smart-margin-bottom5 smart-margin-top5"
v-model="columns"
:tableId="TABLE_ID_CONST.SUPPORT.RELOAD"
:refresh="ajaxQuery"
v-privilege="'support:reload:query'"
/>
</a-row> </a-row>
<a-table <a-table
@ -46,7 +52,7 @@
<template #bodyCell="{ record, column }"> <template #bodyCell="{ record, column }">
<template v-if="column.dataIndex === 'action'"> <template v-if="column.dataIndex === 'action'">
<div class="smart-table-operate"> <div class="smart-table-operate">
<a-button @click="doReload(record.tag)" v-privilege="'support:reload:execute'" type="link"></a-button> <a-button @click="doReload(record.tag)" v-privilege="'support:reload:update'" type="link"></a-button>
<a-button @click="showResultList(record.tag)" v-privilege="'support:reload:result'" type="link"></a-button> <a-button @click="showResultList(record.tag)" v-privilege="'support:reload:result'" type="link"></a-button>
</div> </div>
</template> </template>

View File

@ -8,7 +8,7 @@
--> -->
<template> <template>
<a-modal :open="visible" title="reload结果列表" width="60%" :footer="null" @cancel="onClose"> <a-modal :open="visible" title="reload结果列表" width="60%" :footer="null" @cancel="onClose">
<a-button type="primary" @click="ajaxQuery" size="small"> <a-button type="primary" @click="ajaxQuery" v-privilege="'support:reload:result'" size="small">
<template #icon> <template #icon>
<ReloadOutlined /> <ReloadOutlined />
</template> </template>

View File

@ -29,6 +29,7 @@
v-model="columns" v-model="columns"
:tableId="TABLE_ID_CONST.SUPPORT.SERIAL_NUMBER" :tableId="TABLE_ID_CONST.SUPPORT.SERIAL_NUMBER"
:refresh="ajaxQuery" :refresh="ajaxQuery"
v-privilege="'support:serialNumber:all'"
/> />
</a-row> </a-row>

View File

@ -13,7 +13,7 @@
<a-input-password class="form-item" v-model:value.trim="form.confirmPwd" type="password" placeholder="请输入确认密码" autocomplete="off" /> <a-input-password class="form-item" v-model:value.trim="form.confirmPwd" type="password" placeholder="请输入确认密码" autocomplete="off" />
</a-form-item> </a-form-item>
</a-form> </a-form>
<a-button type="primary" style="margin: 20px 0 0 250px" @click="onSubmit"></a-button> <a-button type="primary" v-privilege="'system:employee:password'" style="margin: 20px 0 0 250px" @click="onSubmit"></a-button>
</div> </div>
</div> </div>
</template> </template>

View File

@ -7,13 +7,13 @@
<a-form-item class="smart-query-form-item smart-margin-left10"> <a-form-item class="smart-query-form-item smart-margin-left10">
<a-button-group> <a-button-group>
<a-button v-privilege="'support:department:query'" type="primary" @click="onSearch"> <a-button v-privilege="'system:department:query'" type="primary" @click="onSearch">
<template #icon> <template #icon>
<SearchOutlined /> <SearchOutlined />
</template> </template>
查询 查询
</a-button> </a-button>
<a-button v-privilege="'support:department:query'" @click="resetQuery"> <a-button v-privilege="'system:department:query'" @click="resetQuery">
<template #icon> <template #icon>
<ReloadOutlined /> <ReloadOutlined />
</template> </template>

View File

@ -18,7 +18,7 @@
</a-radio-group> </a-radio-group>
<a-input-search v-model:value.trim="params.keyword" placeholder="姓名/手机号/登录账号" @search="queryEmployeeByKeyword(true)"> <a-input-search v-model:value.trim="params.keyword" placeholder="姓名/手机号/登录账号" @search="queryEmployeeByKeyword(true)">
<template #enterButton> <template #enterButton>
<a-button type="primary"> <a-button type="primary" v-privilege="'system:employee:query'">
<template #icon> <template #icon>
<SearchOutlined /> <SearchOutlined />
</template> </template>
@ -26,7 +26,7 @@
</a-button> </a-button>
</template> </template>
</a-input-search> </a-input-search>
<a-button @click="reset" class="smart-margin-left10"> <a-button @click="reset" v-privilege="'system:employee:query'" class="smart-margin-left10">
<template #icon> <template #icon>
<ReloadOutlined /> <ReloadOutlined />
</template> </template>

View File

@ -61,16 +61,8 @@
import { SmartLoading } from '/@/components/framework/smart-loading'; import { SmartLoading } from '/@/components/framework/smart-loading';
import { LOGIN_DEVICE_ENUM } from '/@/constants/system/login-device-const'; import { LOGIN_DEVICE_ENUM } from '/@/constants/system/login-device-const';
import { useUserStore } from '/@/store/modules/system/user'; import { useUserStore } from '/@/store/modules/system/user';
import loginQR from '/@/assets/images/login/login-qr.png';
import leftBg2 from '/@/assets/images/login/left-bg2.png';
import loginGif from '/@/assets/images/login/login.gif'; import loginGif from '/@/assets/images/login/login.gif';
import wechatIcon from '/@/assets/images/login/wechat-icon.png';
import aliIcon from '/@/assets/images/login/ali-icon.png';
import douyinIcon from '/@/assets/images/login/douyin-icon.png';
import qqIcon from '/@/assets/images/login/qq-icon.png';
import weiboIcon from '/@/assets/images/login/weibo-icon.png';
import feishuIcon from '/@/assets/images/login/feishu-icon.png';
import googleIcon from '/@/assets/images/login/google-icon.png';
import { buildRoutes } from '/@/router/index'; import { buildRoutes } from '/@/router/index';
import { smartSentry } from '/@/lib/smart-sentry'; import { smartSentry } from '/@/lib/smart-sentry';
@ -87,6 +79,7 @@
password: '', password: '',
captchaCode: '', captchaCode: '',
captchaUuid: '', captchaUuid: '',
emailCode: '',
loginDevice: LOGIN_DEVICE_ENUM.PC.value, loginDevice: LOGIN_DEVICE_ENUM.PC.value,
}); });
const rules = { const rules = {

View File

@ -13,13 +13,13 @@
<a-input style="width: 200px" v-model:value="queryForm.keywords" placeholder="关键字查询" /> <a-input style="width: 200px" v-model:value="queryForm.keywords" placeholder="关键字查询" />
</a-form-item> </a-form-item>
<a-form-item class="smart-query-form-item"> <a-form-item class="smart-query-form-item">
<a-button type="primary" @click="queryData"> <a-button type="primary" v-privilege="'system:position:query'" @click="queryData" >
<template #icon> <template #icon>
<SearchOutlined /> <SearchOutlined />
</template> </template>
查询 查询
</a-button> </a-button>
<a-button @click="resetQuery" class="smart-margin-left10"> <a-button @click="resetQuery" v-privilege="'system:position:query'" class="smart-margin-left10">
<template #icon> <template #icon>
<ReloadOutlined /> <ReloadOutlined />
</template> </template>
@ -34,13 +34,13 @@
<!---------- 表格操作行 begin -----------> <!---------- 表格操作行 begin ----------->
<a-row class="smart-table-btn-block"> <a-row class="smart-table-btn-block">
<div class="smart-table-operate-block"> <div class="smart-table-operate-block">
<a-button @click="showForm" type="primary"> <a-button @click="showForm" v-privilege="'system:position:add'" type="primary">
<template #icon> <template #icon>
<PlusOutlined /> <PlusOutlined />
</template> </template>
新建 新建
</a-button> </a-button>
<a-button @click="confirmBatchDelete" type="primary" danger :disabled="selectedRowKeyList.length === 0"> <a-button @click="confirmBatchDelete" v-privilege="'system:position:delete'" type="primary" danger :disabled="selectedRowKeyList.length === 0">
<template #icon> <template #icon>
<DeleteOutlined /> <DeleteOutlined />
</template> </template>
@ -67,8 +67,8 @@
<template #bodyCell="{ text, record, column }"> <template #bodyCell="{ text, record, column }">
<template v-if="column.dataIndex === 'action'"> <template v-if="column.dataIndex === 'action'">
<div class="smart-table-operate"> <div class="smart-table-operate">
<a-button @click="showForm(record)" type="link">编辑</a-button> <a-button @click="showForm(record)" v-privilege="'system:position:update'" type="link"></a-button>
<a-button @click="onDelete(record)" danger type="link">删除</a-button> <a-button @click="onDelete(record)" v-privilege="'system:position:delete'" danger type="link"></a-button>
</div> </div>
</template> </template>
</template> </template>