mirror of
https://gitee.com/lab1024/smart-admin.git
synced 2025-11-16 15:43:49 +08:00
v3.0.0
This commit is contained in:
@@ -0,0 +1,238 @@
|
||||
<!--
|
||||
* 接口加密、解密
|
||||
*
|
||||
* @Author: 1024创新实验室-主任-卓大
|
||||
* @Date: 2023-10-17 22:02:37
|
||||
* @Copyright 1024创新实验室
|
||||
-->
|
||||
<template>
|
||||
<a-alert closable>
|
||||
<template v-slot:message>
|
||||
<h4>接口加解密:</h4>
|
||||
</template>
|
||||
<template v-slot:description>
|
||||
<pre>
|
||||
简介:接口加解密分为: 前端请求参数加解密 和 后端返回结果加解密。
|
||||
|
||||
- 支持国密SM、AES加密算法。前端修改:/lib/encrypt.js文件,后端:启动 ApiEncryptServiceAesImpl 或者 ApiEncryptServiceSmImpl
|
||||
- 前端请看:/lib/encrypt.js、/lib/axios.js /api/support/api-encrypt/api-encrypt-api.js 等文件
|
||||
- 后端请看:@ApiEncrypt 和 @ApiDecrypt 注解,具体请看 sa-common项目中的 net.lab1024.sa.common.module.support.apiencrypt 包
|
||||
- demo请看:前端:/views/support/api-encrypt 目录,后端 请看:sa-admin项目的:net.lab1024.sa.admin.module.system.support.AdminApiEncryptController
|
||||
</pre
|
||||
>
|
||||
</template>
|
||||
</a-alert>
|
||||
<br />
|
||||
<a-alert
|
||||
message="当前加密算法为:SM2,若想改为 AES,前端请修改 'lib/encrypt.js'文件中的EncryptObject,后端请修改 ApiEncryptService 的实现类"
|
||||
type="error"
|
||||
/>
|
||||
<br />
|
||||
<!---------- 请求参数加密 begin ----------->
|
||||
<a-card title="一、请求加密 Demo">
|
||||
<a-form class="smart-query-form">
|
||||
<a-row class="smart-query-form-row">
|
||||
<a-form-item label="姓名" class="smart-query-form-item">
|
||||
<a-input v-model:value="requestEncryptForm.name" placeholder="姓名" />
|
||||
</a-form-item>
|
||||
<a-form-item label="年龄" class="smart-query-form-item">
|
||||
<a-input-number v-model:value="requestEncryptForm.age" placeholder="年龄" />
|
||||
</a-form-item>
|
||||
<a-form-item class="smart-query-form-item">
|
||||
<a-button type="primary" @click="testRequestEncrypt"> 测试:请求加密</a-button>
|
||||
</a-form-item>
|
||||
</a-row>
|
||||
<a-row class="smart-query-form-row">
|
||||
<div v-if="requestEncryptFormStr">请求参数:{{ requestEncryptFormStr }}</div>
|
||||
</a-row>
|
||||
<a-row class="smart-query-form-row">
|
||||
<div v-if="requestEncryptFormEncryptStr">请求参数加密:{{ requestEncryptFormEncryptStr }}</div>
|
||||
</a-row>
|
||||
<a-row class="smart-query-form-row">
|
||||
<div v-if="requestEncryptResponse">返回结果(不加密):{{ requestEncryptResponse }}</div>
|
||||
</a-row>
|
||||
</a-form>
|
||||
</a-card>
|
||||
<!---------- 请求参数加密 end ----------->
|
||||
<br />
|
||||
<!---------- 返回结果解密 begin ----------->
|
||||
<a-card title="二、返回加密 Demo">
|
||||
<a-form class="smart-query-form">
|
||||
<a-row class="smart-query-form-row">
|
||||
<a-form-item label="姓名" class="smart-query-form-item">
|
||||
<a-input v-model:value="responseEncryptForm.name" placeholder="姓名" />
|
||||
</a-form-item>
|
||||
<a-form-item label="年龄" class="smart-query-form-item">
|
||||
<a-input-number v-model:value="responseEncryptForm.age" placeholder="年龄" />
|
||||
</a-form-item>
|
||||
<a-form-item class="smart-query-form-item">
|
||||
<a-button type="primary" @click="testResponseEncrypt"> 测试:返回加密 </a-button>
|
||||
</a-form-item>
|
||||
</a-row>
|
||||
<a-row class="smart-query-form-row">
|
||||
<div v-if="responseEncryptFormStr">请求参数: {{ responseEncryptFormStr }}</div>
|
||||
</a-row>
|
||||
<a-row class="smart-query-form-row">
|
||||
<div v-if="responseEncryptStr">返回结果:{{ responseEncryptStr }}</div>
|
||||
</a-row>
|
||||
<a-row class="smart-query-form-row">
|
||||
<div v-if="responseStr">返回结果 解密:{{ responseStr }}</div>
|
||||
</a-row>
|
||||
</a-form>
|
||||
</a-card>
|
||||
<!---------- 返回结果解密 end ----------->
|
||||
|
||||
<br />
|
||||
<!---------- 请求和返回都加密 begin ----------->
|
||||
<a-card title="三、请求和返回都加密 Demo">
|
||||
<a-form class="smart-query-form">
|
||||
<a-row class="smart-query-form-row">
|
||||
<a-form-item label="姓名" class="smart-query-form-item">
|
||||
<a-input v-model:value="form.name" placeholder="姓名" />
|
||||
</a-form-item>
|
||||
<a-form-item label="年龄" class="smart-query-form-item">
|
||||
<a-input-number v-model:value="form.age" placeholder="年龄" />
|
||||
</a-form-item>
|
||||
<a-form-item class="smart-query-form-item">
|
||||
<a-button type="primary" @click="testBoth"> 测试:请求和返回都加密 </a-button>
|
||||
</a-form-item>
|
||||
</a-row>
|
||||
<a-row class="smart-query-form-row">
|
||||
<div v-if="formStr">请求参数: {{ formStr }}</div>
|
||||
</a-row>
|
||||
<a-row class="smart-query-form-row">
|
||||
<div v-if="formEncryptStr">请求参数加密: {{ formEncryptStr }}</div>
|
||||
</a-row>
|
||||
<a-row class="smart-query-form-row">
|
||||
<div v-if="responseEncrypt">返回结果:{{ responseEncrypt }}</div>
|
||||
</a-row>
|
||||
<a-row class="smart-query-form-row">
|
||||
<div v-if="responseDecryptStr">返回结果 解密:{{ responseDecryptStr }}</div>
|
||||
</a-row>
|
||||
</a-form>
|
||||
</a-card>
|
||||
<!---------- 返回结果解密 end ----------->
|
||||
|
||||
<br />
|
||||
<!---------- 测试数组 begin ----------->
|
||||
<a-card title="四、测试数组 Demo">
|
||||
<a-form class="smart-query-form">
|
||||
<a-row class="smart-query-form-row">
|
||||
<a-form-item class="smart-query-form-item">
|
||||
<a-button type="primary" @click="testArray"> 测试:数组加解密 </a-button>
|
||||
</a-form-item>
|
||||
</a-row>
|
||||
<a-row class="smart-query-form-row">
|
||||
<div v-if="arrayFormStr">请求参数: {{ arrayFormStr }}</div>
|
||||
</a-row>
|
||||
<a-row class="smart-query-form-row">
|
||||
<div v-if="arrayFormEncryptStr">请求参数加密: {{ arrayFormEncryptStr }}</div>
|
||||
</a-row>
|
||||
<a-row class="smart-query-form-row">
|
||||
<div v-if="arrayFormResponseEncrypt">返回结果:{{ arrayFormResponseEncrypt }}</div>
|
||||
</a-row>
|
||||
<a-row class="smart-query-form-row">
|
||||
<div v-if="arrayFormResponseDecryptStr">返回结果 解密:{{ arrayFormResponseDecryptStr }}</div>
|
||||
</a-row>
|
||||
</a-form>
|
||||
</a-card>
|
||||
<!---------- 返回结果解密 end ----------->
|
||||
</template>
|
||||
<script setup>
|
||||
import { reactive, ref } from 'vue';
|
||||
import { encryptApi } from '/@/api/support/api-encrypt-api';
|
||||
import { encryptData } from '/@/lib/encrypt';
|
||||
|
||||
// ---------------------------- 第一种:请求参数加密 ----------------------------
|
||||
|
||||
//请求参数加密
|
||||
const requestEncryptForm = reactive({
|
||||
age: 100, // 年龄
|
||||
name: '卓大', //姓名
|
||||
});
|
||||
|
||||
// 参数字符串
|
||||
const requestEncryptFormStr = ref('');
|
||||
// 参数字符串 加密
|
||||
const requestEncryptFormEncryptStr = ref('');
|
||||
// 返回结果
|
||||
const requestEncryptResponse = ref('');
|
||||
|
||||
async function testRequestEncrypt() {
|
||||
// 参数加密
|
||||
requestEncryptFormStr.value = JSON.stringify(requestEncryptForm);
|
||||
requestEncryptFormEncryptStr.value = encryptData(requestEncryptForm);
|
||||
|
||||
// 发送请求
|
||||
const result = await encryptApi.testRequestEncrypt(requestEncryptForm);
|
||||
requestEncryptResponse.value = JSON.stringify(result.data);
|
||||
}
|
||||
|
||||
// ---------------------------- 第二种:返回结果解密 ----------------------------
|
||||
|
||||
const responseEncryptForm = reactive({
|
||||
age: 100, // 年龄
|
||||
name: '卓大', //姓名
|
||||
});
|
||||
|
||||
const responseEncryptFormStr = ref('');
|
||||
const responseEncryptStr = ref('');
|
||||
const responseStr = ref('');
|
||||
|
||||
async function testResponseEncrypt() {
|
||||
responseEncryptFormStr.value = JSON.stringify(responseEncryptForm);
|
||||
const result = await encryptApi.testResponseEncrypt(responseEncryptForm);
|
||||
responseEncryptStr.value = result.encryptData;
|
||||
responseStr.value = JSON.stringify(result.data);
|
||||
}
|
||||
|
||||
// ---------------------------- 第三种:请求加密、返回解密 ----------------------------
|
||||
|
||||
const form = reactive({
|
||||
age: 100, // 年龄
|
||||
name: '卓大', //姓名
|
||||
});
|
||||
|
||||
const formStr = ref('');
|
||||
const formEncryptStr = ref('');
|
||||
const responseEncrypt = ref('');
|
||||
const responseDecryptStr = ref('');
|
||||
|
||||
async function testBoth() {
|
||||
formStr.value = JSON.stringify(form);
|
||||
formEncryptStr.value = encryptData(form);
|
||||
const result = await encryptApi.testDecryptAndEncrypt(form);
|
||||
responseEncrypt.value = result.encryptData;
|
||||
responseDecryptStr.value = JSON.stringify(result.data);
|
||||
}
|
||||
|
||||
// ---------------------------- 第四种:测试数组 ----------------------------
|
||||
|
||||
const arrayForm = reactive([
|
||||
{
|
||||
age: 1, // 年龄
|
||||
name: '卓1', //姓名
|
||||
},
|
||||
{
|
||||
age: 2, // 年龄
|
||||
name: '卓2', //姓名
|
||||
},
|
||||
{
|
||||
age: 3, // 年龄
|
||||
name: '卓3', //姓名
|
||||
},
|
||||
]);
|
||||
|
||||
const arrayFormStr = ref('');
|
||||
const arrayFormEncryptStr = ref('');
|
||||
const arrayFormResponseEncrypt = ref('');
|
||||
const arrayFormResponseDecryptStr = ref('');
|
||||
|
||||
async function testArray() {
|
||||
arrayFormStr.value = JSON.stringify(arrayForm);
|
||||
arrayFormEncryptStr.value = encryptData(arrayForm);
|
||||
const result = await encryptApi.testArray(arrayForm);
|
||||
arrayFormResponseEncrypt.value = result.encryptData;
|
||||
arrayFormResponseDecryptStr.value = JSON.stringify(result.data);
|
||||
}
|
||||
</script>
|
||||
@@ -40,7 +40,7 @@ Caffeine :
|
||||
<script setup>
|
||||
import { message } from 'ant-design-vue';
|
||||
import { onMounted, reactive, ref, h } from 'vue';
|
||||
import { cacheApi } from '/@/api/support/cache/cache-api';
|
||||
import { cacheApi } from '/@/api/support/cache-api';
|
||||
import { SmartLoading } from '/@/components/framework/smart-loading';
|
||||
import { Modal } from 'ant-design-vue';
|
||||
import _ from 'lodash';
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
:title="form.changeLogId ? '编辑' : '添加'"
|
||||
width="600px"
|
||||
:closable="true"
|
||||
:visible="visibleFlag"
|
||||
:open="visibleFlag"
|
||||
@close="onClose"
|
||||
:onCancel="onClose"
|
||||
:maskClosable="false"
|
||||
@@ -50,7 +50,7 @@
|
||||
import _ from 'lodash';
|
||||
import { message } from 'ant-design-vue';
|
||||
import { SmartLoading } from '/@/components/framework/smart-loading';
|
||||
import { changeLogApi } from '/@/api/support/change-log/change-log-api';
|
||||
import { changeLogApi } from '/@/api/support/change-log-api';
|
||||
import { smartSentry } from '/@/lib/smart-sentry';
|
||||
import SmartEnumSelect from '/@/components/framework/smart-enum-select/index.vue';
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
-->
|
||||
<template>
|
||||
<!---------- 查询表单form begin ----------->
|
||||
<a-form class="smart-query-form" v-privilege="'changeLog:query'">
|
||||
<a-form class="smart-query-form" v-privilege="'support:changeLog:query'">
|
||||
<a-row class="smart-query-form-row">
|
||||
<a-form-item label="更新类型" class="smart-query-form-item">
|
||||
<SmartEnumSelect width="200px" v-model:value="queryForm.type" enumName="CHANGE_LOG_TYPE_ENUM" placeholder="更新类型" />
|
||||
@@ -16,13 +16,13 @@
|
||||
<a-input style="width: 200px" v-model:value="queryForm.keyword" placeholder="关键字" />
|
||||
</a-form-item>
|
||||
<a-form-item label="发布日期" class="smart-query-form-item">
|
||||
<a-range-picker v-model:value="queryForm.publicDate" :ranges="defaultTimeRanges" style="width: 240px" @change="onChangePublicDate" />
|
||||
<a-range-picker v-model:value="queryForm.publicDate" :presets="defaultTimeRanges" style="width: 240px" @change="onChangePublicDate" />
|
||||
</a-form-item>
|
||||
<a-form-item label="创建时间" class="smart-query-form-item">
|
||||
<a-date-picker valueFormat="YYYY-MM-DD" v-model:value="queryForm.createTime" style="width: 150px" />
|
||||
</a-form-item>
|
||||
<a-form-item class="smart-query-form-item">
|
||||
<a-button type="primary" @click="queryData">
|
||||
<a-button type="primary" @click="onSearch">
|
||||
<template #icon>
|
||||
<ReloadOutlined />
|
||||
</template>
|
||||
@@ -43,13 +43,19 @@
|
||||
<!---------- 表格操作行 begin ----------->
|
||||
<a-row class="smart-table-btn-block">
|
||||
<div class="smart-table-operate-block">
|
||||
<a-button @click="showForm" type="primary" size="small" v-privilege="'changeLog:add'">
|
||||
<a-button @click="showForm" type="primary" size="small" v-privilege="'support:changeLog:add'">
|
||||
<template #icon>
|
||||
<PlusOutlined />
|
||||
</template>
|
||||
新建
|
||||
</a-button>
|
||||
<a-button @click="confirmBatchDelete" type="danger" size="small" :disabled="selectedRowKeyList.length == 0" v-privilege="'changeLog:batchDelete'">
|
||||
<a-button
|
||||
@click="confirmBatchDelete"
|
||||
danger
|
||||
size="small"
|
||||
:disabled="selectedRowKeyList.length === 0"
|
||||
v-privilege="'support:changeLog:batchDelete'"
|
||||
>
|
||||
<template #icon>
|
||||
<DeleteOutlined />
|
||||
</template>
|
||||
@@ -74,7 +80,7 @@
|
||||
>
|
||||
<template #bodyCell="{ text, record, column }">
|
||||
<template v-if="column.dataIndex === 'version'">
|
||||
<a-button @click="showModal(record)" type="link">{{text}}</a-button>
|
||||
<a-button @click="showModal(record)" type="link">{{ text }}</a-button>
|
||||
</template>
|
||||
<template v-if="column.dataIndex === 'type'">
|
||||
<a-tag color="success">
|
||||
@@ -86,8 +92,8 @@
|
||||
</template>
|
||||
<template v-if="column.dataIndex === 'action'">
|
||||
<div class="smart-table-operate">
|
||||
<a-button @click="showForm(record)" type="link" v-privilege="'changeLog:update'">编辑</a-button>
|
||||
<a-button @click="onDelete(record)" danger type="link" v-privilege="'changeLog:delete'">删除</a-button>
|
||||
<a-button @click="showForm(record)" type="link" v-privilege="'support:changeLog:update'">编辑</a-button>
|
||||
<a-button @click="onDelete(record)" danger type="link" v-privilege="'support:changeLog:delete'">删除</a-button>
|
||||
</div>
|
||||
</template>
|
||||
</template>
|
||||
@@ -119,7 +125,7 @@
|
||||
import { reactive, ref, onMounted } from 'vue';
|
||||
import { message, Modal } from 'ant-design-vue';
|
||||
import { SmartLoading } from '/@/components/framework/smart-loading';
|
||||
import { changeLogApi } from '/@/api/support/change-log/change-log-api';
|
||||
import { changeLogApi } from '/@/api/support/change-log-api';
|
||||
import { PAGE_SIZE_OPTIONS } from '/@/constants/common-const';
|
||||
import { smartSentry } from '/@/lib/smart-sentry';
|
||||
import TableOperator from '/@/components/support/table-operator/index.vue';
|
||||
@@ -209,6 +215,12 @@
|
||||
queryData();
|
||||
}
|
||||
|
||||
// 搜索
|
||||
function onSearch() {
|
||||
queryForm.pageNum = 1;
|
||||
queryData();
|
||||
}
|
||||
|
||||
// 查询数据
|
||||
async function queryData() {
|
||||
tableLoading.value = true;
|
||||
@@ -264,9 +276,6 @@
|
||||
async function requestDelete(data) {
|
||||
SmartLoading.show();
|
||||
try {
|
||||
let deleteForm = {
|
||||
goodsIdList: selectedRowKeyList.value,
|
||||
};
|
||||
await changeLogApi.delete(data.changeLogId);
|
||||
message.success('删除成功');
|
||||
queryData();
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* @Copyright 1024创新实验室
|
||||
-->
|
||||
<template>
|
||||
<a-modal title="更新日志" width="700px" :visible="visibleFlag" @close="onClose" >
|
||||
<a-modal title="更新日志" width="700px" :open="visibleFlag" @close="onClose" >
|
||||
|
||||
<div>
|
||||
<pre>{{ content }}</pre>
|
||||
|
||||
@@ -16,13 +16,13 @@
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item class="smart-query-form-item smart-margin-left10">
|
||||
<a-button type="primary" @click="ajaxQuery">
|
||||
<a-button type="primary" @click="onSearch">
|
||||
<template #icon>
|
||||
<ReloadOutlined />
|
||||
</template>
|
||||
查询
|
||||
</a-button>
|
||||
<a-button @click="resetQuery">
|
||||
<a-button @click="resetQuery" class="smart-margin-left10">
|
||||
<template #icon>
|
||||
<SearchOutlined />
|
||||
</template>
|
||||
@@ -69,13 +69,13 @@
|
||||
</div>
|
||||
</a-card>
|
||||
|
||||
<CodeGeneratorTableConfigForm ref="codeGeneratorTableConfigFormRef" @reloadList="ajaxQuery"/>
|
||||
<CodeGeneratorTableConfigForm ref="codeGeneratorTableConfigFormRef" @reloadList="ajaxQuery" />
|
||||
<CodeGeneratorPreviewModal ref="codeGeneratorPreviewModalRef" />
|
||||
</div>
|
||||
</template>
|
||||
<script setup>
|
||||
import { onMounted, reactive, ref, nextTick } from 'vue';
|
||||
import { codeGeneratorApi } from '/@/api/support/code-generator/code-generator-api';
|
||||
import { onMounted, reactive, ref } from 'vue';
|
||||
import { codeGeneratorApi } from '/@/api/support/code-generator-api';
|
||||
import { PAGE_SIZE_OPTIONS } from '/@/constants/common-const';
|
||||
import { smartSentry } from '/@/lib/smart-sentry';
|
||||
import CodeGeneratorTableConfigForm from './components/form/code-generator-table-config-form.vue';
|
||||
@@ -140,6 +140,12 @@
|
||||
Object.assign(queryForm, queryFormState);
|
||||
ajaxQuery();
|
||||
}
|
||||
|
||||
function onSearch() {
|
||||
queryForm.pageNum = 1;
|
||||
ajaxQuery();
|
||||
}
|
||||
|
||||
async function ajaxQuery() {
|
||||
try {
|
||||
tableLoading.value = true;
|
||||
@@ -169,7 +175,7 @@
|
||||
}
|
||||
|
||||
// ------------------------- 下载 ------------------------------
|
||||
|
||||
|
||||
function download(rowData) {
|
||||
codeGeneratorApi.downloadCode(rowData.tableName);
|
||||
}
|
||||
|
||||
@@ -8,7 +8,12 @@
|
||||
* @Copyright 1024创新实验室 ( https://1024lab.net ),Since 2012
|
||||
-->
|
||||
<template>
|
||||
<a-alert :closable="true" message="默认数据库表名前缀为:t_, 如果想修改默认前缀,请修改前端 code-generator-table-config-form-basic.vue 文件的 tablePrefix 变量" type="success" show-icon>
|
||||
<a-alert
|
||||
:closable="true"
|
||||
message="默认数据库表名前缀为:t_, 如果想修改默认前缀,请修改前端 code-generator-table-config-form-basic.vue 文件的 tablePrefix 变量"
|
||||
type="success"
|
||||
show-icon
|
||||
>
|
||||
<template #icon><smile-outlined /></template>
|
||||
</a-alert>
|
||||
<a-row type="flex" class="smart-margin-top10">
|
||||
@@ -133,7 +138,7 @@
|
||||
<script setup>
|
||||
import { message } from 'ant-design-vue';
|
||||
import dayjs from 'dayjs';
|
||||
import lodash from 'lodash';
|
||||
import _ from 'lodash';
|
||||
import { computed, inject, reactive, ref } from 'vue';
|
||||
import { convertLowerHyphen, convertUpperCamel } from '/@/utils/str-util';
|
||||
|
||||
@@ -176,8 +181,8 @@
|
||||
|
||||
//命名
|
||||
let removePrefixTableName = tableInfo.tableName;
|
||||
if (lodash.startsWith(tableInfo.tableName, tablePrefix.value)) {
|
||||
removePrefixTableName = lodash.trim(removePrefixTableName, tablePrefix.value);
|
||||
if (_.startsWith(tableInfo.tableName, tablePrefix.value)) {
|
||||
removePrefixTableName = _.trim(removePrefixTableName, tablePrefix.value);
|
||||
}
|
||||
formData.moduleName = basic && basic.moduleName ? basic.moduleName : removePrefixTableName;
|
||||
formData.moduleName = convertUpperCamel(formData.moduleName);
|
||||
@@ -197,10 +202,10 @@
|
||||
formData.copyright = basic && basic.copyright ? basic.copyright : null;
|
||||
}
|
||||
|
||||
function onChangeTablePrefix(e){
|
||||
function onChangeTablePrefix(e) {
|
||||
let removePrefixTableName = tableInfo.tableName;
|
||||
if (lodash.startsWith(tableInfo.tableName, tablePrefix.value)) {
|
||||
removePrefixTableName = lodash.trim(removePrefixTableName, tablePrefix.value);
|
||||
if (_.startsWith(tableInfo.tableName, tablePrefix.value)) {
|
||||
removePrefixTableName = _.trim(removePrefixTableName, tablePrefix.value);
|
||||
}
|
||||
formData.moduleName = convertUpperCamel(removePrefixTableName);
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
|
||||
<script setup>
|
||||
import { message } from 'ant-design-vue';
|
||||
import lodash from 'lodash';
|
||||
import _ from 'lodash';
|
||||
import { inject, reactive, ref } from 'vue';
|
||||
import SmartEnumSelect from '/@/components/framework/smart-enum-select/index.vue';
|
||||
import { CODE_DELETE_ENUM } from '/@/constants/support/code-generator-const';
|
||||
@@ -73,7 +73,7 @@
|
||||
let deleteInfo = config.delete;
|
||||
|
||||
formData.isSupportDelete = deleteInfo && deleteInfo.isSupportDelete ? deleteInfo.isSupportDelete : true;
|
||||
formData.isPhysicallyDeleted = deleteInfo && deleteInfo.isPhysicallyDeleted ? deleteInfo.isPhysicallyDeleted : deletedFlagColumn ? false : true;
|
||||
formData.isPhysicallyDeleted = deleteInfo && deleteInfo.isPhysicallyDeleted ? deleteInfo.isPhysicallyDeleted : !deletedFlagColumn;
|
||||
formData.deleteEnum = deleteInfo && deleteInfo.deleteEnum ? deleteInfo.deleteEnum : CODE_DELETE_ENUM.SINGLE_AND_BATCH.value;
|
||||
}
|
||||
|
||||
@@ -83,7 +83,7 @@
|
||||
return null;
|
||||
}
|
||||
|
||||
let result = configFields.filter((e) => lodash.startsWith(e.columnName, 'deleted_flag' || lodash.startsWith(e.columnName, 'delete_flag')));
|
||||
let result = configFields.filter((e) => _.startsWith(e.columnName, 'deleted_flag' || _.startsWith(e.columnName, 'delete_flag')));
|
||||
return result && result.length > 0 ? result[0] : null;
|
||||
}
|
||||
|
||||
|
||||
@@ -79,7 +79,7 @@
|
||||
import { checkExistEnum, convertJavaEnumName, getJavaType, getJsType, JavaTypeList, JsTypeList } from '../../code-generator-util';
|
||||
import DictKeySelect from '/@/components/support/dict-key-select/index.vue';
|
||||
import { convertUpperCamel, convertLowerCamel } from '/@/utils/str-util';
|
||||
import lodash from 'lodash';
|
||||
import _ from 'lodash';
|
||||
|
||||
//------------------------ 全局数据 ---------------------
|
||||
const tableInfo = inject('tableInfo');
|
||||
@@ -154,8 +154,8 @@
|
||||
|
||||
//命名
|
||||
let removePrefixTableName = tableInfo.tableName;
|
||||
if (lodash.startsWith(tableInfo.tableName, 't_')) {
|
||||
removePrefixTableName = lodash.trim(removePrefixTableName, '_t');
|
||||
if (_.startsWith(tableInfo.tableName, 't_')) {
|
||||
removePrefixTableName = _.trim(removePrefixTableName, '_t');
|
||||
}
|
||||
let moduleName = basic && basic.moduleName ? basic.moduleName : removePrefixTableName;
|
||||
moduleName = convertUpperCamel(moduleName);
|
||||
@@ -167,9 +167,9 @@
|
||||
columnName: column.columnName,
|
||||
columnComment: column.columnComment,
|
||||
dataType: column.dataType,
|
||||
nullableFlag: column.isNullable === 'NO' ? true : false,
|
||||
primaryKeyFlag: column.columnKey === 'PRI' ? true : false,
|
||||
autoIncreaseFlag: column.extra === 'auto_increment' ? true : false,
|
||||
nullableFlag: column.isNullable === 'NO',
|
||||
primaryKeyFlag: column.columnKey === 'PRI',
|
||||
autoIncreaseFlag: column.extra === 'auto_increment',
|
||||
//表单
|
||||
fieldName: configField ? configField.fieldName : convertLowerCamel(column.columnName),
|
||||
label: configField ? configField.label : column.columnComment,
|
||||
@@ -203,7 +203,7 @@
|
||||
return tableData.value.map((e) => {
|
||||
return {
|
||||
columnName: e.columnName,
|
||||
columnComment:e.columnComment,
|
||||
columnComment: e.columnComment,
|
||||
label: e.label,
|
||||
fieldName: e.fieldName,
|
||||
javaType: e.javaType,
|
||||
|
||||
@@ -19,11 +19,16 @@
|
||||
</a-form-item>
|
||||
<a-form-item label="页面方式" name="pageType" v-if="formData.isSupportInsertAndUpdate">
|
||||
<a-radio-group v-model:value="formData.pageType" button-style="solid">
|
||||
<a-radio-button :value="CODE_INSERT_AND_UPDATE_PAGE_ENUM.MODAL.value">{{CODE_INSERT_AND_UPDATE_PAGE_ENUM.MODAL.desc}}</a-radio-button>
|
||||
<a-radio-button :value="CODE_INSERT_AND_UPDATE_PAGE_ENUM.DRAWER.value">{{CODE_INSERT_AND_UPDATE_PAGE_ENUM.DRAWER.desc}}</a-radio-button>
|
||||
<a-radio-button :value="CODE_INSERT_AND_UPDATE_PAGE_ENUM.MODAL.value">{{ CODE_INSERT_AND_UPDATE_PAGE_ENUM.MODAL.desc }}</a-radio-button>
|
||||
<a-radio-button :value="CODE_INSERT_AND_UPDATE_PAGE_ENUM.DRAWER.value">{{ CODE_INSERT_AND_UPDATE_PAGE_ENUM.DRAWER.desc }}</a-radio-button>
|
||||
</a-radio-group>
|
||||
</a-form-item>
|
||||
<a-form-item label="页面宽度" v-show="formData.pageType !== CODE_INSERT_AND_UPDATE_PAGE_ENUM.PAGE.value" name="width" v-if="formData.isSupportInsertAndUpdate">
|
||||
<a-form-item
|
||||
label="页面宽度"
|
||||
v-show="formData.pageType !== CODE_INSERT_AND_UPDATE_PAGE_ENUM.PAGE.value"
|
||||
name="width"
|
||||
v-if="formData.isSupportInsertAndUpdate"
|
||||
>
|
||||
<a-input v-model:value="formData.width" placeholder="Modal或者Drawer的width属性 " />
|
||||
</a-form-item>
|
||||
<a-form-item label="每行数量" name="countPerLine" v-if="formData.isSupportInsertAndUpdate">
|
||||
@@ -52,7 +57,16 @@
|
||||
</a-col>
|
||||
</a-row>
|
||||
|
||||
<a-table size="small" bordered class="smart-margin-top10" :dataSource="tableData" :columns="columns" rowKey="columnName" :pagination="false" v-if="formData.isSupportInsertAndUpdate">
|
||||
<a-table
|
||||
size="small"
|
||||
bordered
|
||||
class="smart-margin-top10"
|
||||
:dataSource="tableData"
|
||||
:columns="columns"
|
||||
rowKey="columnName"
|
||||
:pagination="false"
|
||||
v-if="formData.isSupportInsertAndUpdate"
|
||||
>
|
||||
<template #bodyCell="{ text, record, index, column }">
|
||||
<template v-if="column.dataIndex === 'no'">
|
||||
{{ index + 1 }}
|
||||
@@ -95,13 +109,11 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { inject, ref, reactive, computed } from 'vue';
|
||||
import { computed, inject, reactive, ref } from 'vue';
|
||||
import { checkExistEnum, getFrontComponent } from '../../code-generator-util';
|
||||
import SmartEnumRadio from '/@/components/framework/smart-enum-radio/index.vue';
|
||||
import { CODE_INSERT_AND_UPDATE_PAGE_ENUM } from '/@/constants/support/code-generator-const';
|
||||
import { CODE_FRONT_COMPONENT_ENUM, CODE_INSERT_AND_UPDATE_PAGE_ENUM } from '/@/constants/support/code-generator-const';
|
||||
import SmartEnumSelect from '/@/components/framework/smart-enum-select/index.vue';
|
||||
import { message } from 'ant-design-vue';
|
||||
import { CODE_FRONT_COMPONENT_ENUM } from '/@/constants/support/code-generator-const';
|
||||
|
||||
//------------------------ 全局数据 ---------------------
|
||||
const tableInfo = inject('tableInfo');
|
||||
@@ -203,9 +215,9 @@
|
||||
columnName: column.columnName,
|
||||
columnComment: column.columnComment,
|
||||
dataType: column.dataType,
|
||||
nullableFlag: column.isNullable === 'NO' ? true : false,
|
||||
primaryKeyFlag: column.columnKey === 'PRI' ? true : false,
|
||||
autoIncreaseFlag: column.extra === 'auto_increment' ? true : false,
|
||||
nullableFlag: column.isNullable === 'NO',
|
||||
primaryKeyFlag: column.columnKey === 'PRI',
|
||||
autoIncreaseFlag: column.extra === 'auto_increment',
|
||||
};
|
||||
|
||||
//表单
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
rowKey="rowKey"
|
||||
:pagination="false"
|
||||
>
|
||||
<template #bodyCell="{ text, record, index, column }">
|
||||
<template #bodyCell="{ record, index, column }">
|
||||
<template v-if="column.dataIndex === 'drag'">
|
||||
<a-button type="text" class="handle" size="small" style="width: 100%; text-align: left">
|
||||
<template #icon> <drag-outlined /> </template>
|
||||
@@ -75,7 +75,7 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import lodash from 'lodash';
|
||||
import _ from 'lodash';
|
||||
import Sortable from 'sortablejs';
|
||||
import { inject, nextTick, ref } from 'vue';
|
||||
import SmartEnumSelect from '/@/components/framework/smart-enum-select/index.vue';
|
||||
@@ -103,7 +103,7 @@
|
||||
title: '查询列',
|
||||
dataIndex: 'columnNameList',
|
||||
},
|
||||
|
||||
|
||||
{
|
||||
title: '条件名称',
|
||||
dataIndex: 'label',
|
||||
@@ -161,7 +161,7 @@
|
||||
}
|
||||
|
||||
function onDelete(index) {
|
||||
lodash.pullAt(tableData.value, index);
|
||||
_.pullAt(tableData.value, index);
|
||||
}
|
||||
|
||||
//初始化拖拽
|
||||
|
||||
@@ -11,8 +11,17 @@
|
||||
<a-alert :closable="true" message="请务必将每一个字段的 “ 字段名词 ” 填写完整!!!" type="success" show-icon>
|
||||
<template #icon><smile-outlined /></template>
|
||||
</a-alert>
|
||||
<a-table size="small" bordered :scroll="{ x: 1000 }" class="smart-margin-top10" :dataSource="tableData" :columns="columns" rowKey="columnName" :pagination="false">
|
||||
<template #bodyCell="{ text, record, index, column }">
|
||||
<a-table
|
||||
size="small"
|
||||
bordered
|
||||
:scroll="{ x: 1000 }"
|
||||
class="smart-margin-top10"
|
||||
:dataSource="tableData"
|
||||
:columns="columns"
|
||||
rowKey="columnName"
|
||||
:pagination="false"
|
||||
>
|
||||
<template #bodyCell="{ record, index, column }">
|
||||
<template v-if="column.dataIndex === 'no'">
|
||||
{{ index + 1 }}
|
||||
</template>
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<a-drawer
|
||||
title="代码配置"
|
||||
style=""
|
||||
:visible="visibleFlag"
|
||||
:open="visibleFlag"
|
||||
:width="1000"
|
||||
:footerStyle="{ textAlign: 'right' }"
|
||||
@close="onClose"
|
||||
@@ -89,7 +89,7 @@
|
||||
import { SmartLoading } from '/@/components/framework/smart-loading';
|
||||
import { smartSentry } from '/@/lib/smart-sentry';
|
||||
import CodeGeneratorTableConfigFormBasic from './code-generator-table-config-form-basic.vue';
|
||||
import { codeGeneratorApi } from '/@/api/support/code-generator/code-generator-api';
|
||||
import { codeGeneratorApi } from '/@/api/support/code-generator-api';
|
||||
import CodeGeneratorTableConfigFormField from './code-generator-table-config-form-field.vue';
|
||||
import CodeGeneratorTableConfigFormInsertAndUpdate from './code-generator-table-config-form-insert-and-update.vue';
|
||||
import CodeGeneratorTableConfigFormDelete from './code-generator-table-config-form-delete.vue';
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<template>
|
||||
<a-drawer
|
||||
title="代码预览"
|
||||
:visible="visibleFlag"
|
||||
:open="visibleFlag"
|
||||
:width="1200"
|
||||
:footerStyle="{ textAlign: 'right' }"
|
||||
:bodyStyle="{ padding: '8px 24px' }"
|
||||
@@ -38,7 +38,7 @@
|
||||
|
||||
<script setup>
|
||||
import { computed, nextTick, ref, watch } from 'vue';
|
||||
import { codeGeneratorApi } from '/@/api/support/code-generator/code-generator-api';
|
||||
import { codeGeneratorApi } from '/@/api/support/code-generator-api';
|
||||
import { JAVA_FILE_LIST, LANGUAGE_LIST, JS_FILE_LIST,TS_FILE_LIST, JAVA_DOMAIN_FILE_LIST } from '../../code-generator-util';
|
||||
import { smartSentry } from '/@/lib/smart-sentry';
|
||||
import { lineNumbersBlock } from '/@/lib/highlight-line-number';
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
* @Copyright 1024创新实验室 ( https://1024lab.net ),Since 2012
|
||||
-->
|
||||
<template>
|
||||
<a-modal :visible="visible" :title="form.configId ? '编辑' : '添加'" ok-text="确认" cancel-text="取消" @ok="onSubmit" @cancel="onClose">
|
||||
<a-modal :open="visible" :title="form.configId ? '编辑' : '添加'" ok-text="确认" cancel-text="取消" @ok="onSubmit" @cancel="onClose">
|
||||
<a-form ref="formRef" :model="form" :rules="rules" :label-col="{ span: 5 }">
|
||||
<a-form-item label="参数Key" name="configKey">
|
||||
<a-input v-model:value="form.configKey" placeholder="请输入参数Key" />
|
||||
@@ -28,12 +28,12 @@
|
||||
<script setup>
|
||||
import { message } from 'ant-design-vue';
|
||||
import { reactive, ref } from 'vue';
|
||||
import { configApi } from '/@/api/support/config/config-api';
|
||||
import { configApi } from '/@/api/support/config-api';
|
||||
import { smartSentry } from '/@/lib/smart-sentry';
|
||||
import { SmartLoading } from '/@/components/framework/smart-loading';
|
||||
|
||||
// emit
|
||||
const emit = defineEmits('reloadList');
|
||||
const emit = defineEmits(['reloadList']);
|
||||
|
||||
// 组件
|
||||
const formRef = ref();
|
||||
|
||||
@@ -16,13 +16,13 @@
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item class="smart-query-form-item smart-margin-left10">
|
||||
<a-button type="primary" @click="ajaxQuery" v-privilege="'support:config:query'">
|
||||
<a-button type="primary" @click="onSearch" v-privilege="'support:config:query'">
|
||||
<template #icon>
|
||||
<ReloadOutlined />
|
||||
</template>
|
||||
查询
|
||||
</a-button>
|
||||
<a-button @click="resetQuery" v-privilege="'support:config:query'">
|
||||
<a-button @click="resetQuery" v-privilege="'support:config:query'" class="smart-margin-left10">
|
||||
<template #icon>
|
||||
<SearchOutlined />
|
||||
</template>
|
||||
@@ -40,8 +40,8 @@
|
||||
</a-form>
|
||||
|
||||
<a-card size="small" :bordered="false" :hoverable="true">
|
||||
<a-row justify="end" >
|
||||
<TableOperator class="smart-margin-bottom5" v-model="columns" :tableId="TABLE_ID_CONST.SUPPORT.CONFIG" :refresh="ajaxQuery" />
|
||||
<a-row justify="end">
|
||||
<TableOperator class="smart-margin-bottom5" v-model="columns" :tableId="TABLE_ID_CONST.SUPPORT.CONFIG" :refresh="ajaxQuery" />
|
||||
</a-row>
|
||||
|
||||
<a-table size="small" :loading="tableLoading" bordered :dataSource="tableData" :columns="columns" rowKey="configId" :pagination="false">
|
||||
@@ -75,7 +75,7 @@
|
||||
</template>
|
||||
<script setup>
|
||||
import { onMounted, reactive, ref } from 'vue';
|
||||
import { configApi } from '/@/api/support/config/config-api';
|
||||
import { configApi } from '/@/api/support/config-api';
|
||||
import ConfigFormModal from './config-form-modal.vue';
|
||||
import { PAGE_SIZE_OPTIONS } from '/@/constants/common-const';
|
||||
import { smartSentry } from '/@/lib/smart-sentry';
|
||||
@@ -145,6 +145,12 @@
|
||||
Object.assign(queryForm, queryFormState);
|
||||
ajaxQuery();
|
||||
}
|
||||
|
||||
function onSearch() {
|
||||
queryForm.pageNum = 1;
|
||||
ajaxQuery();
|
||||
}
|
||||
|
||||
async function ajaxQuery() {
|
||||
try {
|
||||
tableLoading.value = true;
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
* @Copyright 1024创新实验室 ( https://1024lab.net ),Since 2012
|
||||
-->
|
||||
<template>
|
||||
<a-modal :visible="visible" :title="form.dictKeyId ? '编辑' : '添加'" ok-text="确认" cancel-text="取消" @ok="onSubmit" @cancel="onClose">
|
||||
<a-modal :open="visible" :title="form.dictKeyId ? '编辑' : '添加'" ok-text="确认" cancel-text="取消" @ok="onSubmit" @cancel="onClose">
|
||||
<a-form ref="formRef" :model="form" :rules="rules" :label-col="{ span: 5 }" :wrapper-col="{ span: 12 }">
|
||||
<a-form-item label="编码" name="keyCode">
|
||||
<a-input v-model:value="form.keyCode" placeholder="请输入编码" />
|
||||
@@ -27,7 +27,7 @@
|
||||
import { ref, reactive } from 'vue';
|
||||
import { message } from 'ant-design-vue';
|
||||
import { SmartLoading } from '/@/components/framework/smart-loading';
|
||||
import { dictApi } from '/@/api/support/dict/dict-api';
|
||||
import { dictApi } from '/@/api/support/dict-api';
|
||||
import { smartSentry } from '/@/lib/smart-sentry';
|
||||
|
||||
// emit
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
* @Copyright 1024创新实验室 ( https://1024lab.net ),Since 2012
|
||||
-->
|
||||
<template>
|
||||
<a-drawer :width="800" :visible="visible" :body-style="{ paddingBottom: '80px' }" title="字典值" @close="onClose">
|
||||
<a-drawer :width="800" :open="visible" :body-style="{ paddingBottom: '80px' }" title="字典值" @close="onClose">
|
||||
<a-form class="smart-query-form">
|
||||
<a-row class="smart-query-form-row">
|
||||
<a-form-item label="关键字" class="smart-query-form-item">
|
||||
@@ -42,7 +42,7 @@
|
||||
新建
|
||||
</a-button>
|
||||
|
||||
<a-button @click="confirmBatchDelete" type="danger" size="small" :disabled="selectedRowKeyList.length == 0">
|
||||
<a-button @click="confirmBatchDelete" type="text" danger size="small" :disabled="selectedRowKeyList.length == 0">
|
||||
<template #icon>
|
||||
<DeleteOutlined />
|
||||
</template>
|
||||
@@ -91,7 +91,7 @@
|
||||
import { reactive, ref } from 'vue';
|
||||
import DictValueOperateModal from './dict-value-operate-modal.vue';
|
||||
import { PAGE_SIZE_OPTIONS } from '/@/constants/common-const';
|
||||
import { dictApi } from '/@/api/support/dict/dict-api';
|
||||
import { dictApi } from '/@/api/support/dict-api';
|
||||
import { SmartLoading } from '/@/components/framework/smart-loading';
|
||||
import { Modal } from 'ant-design-vue';
|
||||
import { message } from 'ant-design-vue';
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
* @Copyright 1024创新实验室 ( https://1024lab.net ),Since 2012
|
||||
-->
|
||||
<template>
|
||||
<a-modal :visible="visible" :title="form.dictValueId ? '编辑' : '添加'" ok-text="确认" cancel-text="取消" @ok="onSubmit" @cancel="onClose">
|
||||
<a-modal :open="visible" :title="form.dictValueId ? '编辑' : '添加'" ok-text="确认" cancel-text="取消" @ok="onSubmit" @cancel="onClose">
|
||||
<a-form ref="formRef" :model="form" :rules="rules" :label-col="{ span: 5 }" :wrapper-col="{ span: 12 }">
|
||||
<a-form-item label="编码" name="valueCode">
|
||||
<a-input v-model:value="form.valueCode" placeholder="请输入编码" />
|
||||
@@ -29,7 +29,7 @@
|
||||
import { ref, reactive } from 'vue';
|
||||
import { message } from 'ant-design-vue';
|
||||
import { SmartLoading } from '/@/components/framework/smart-loading';
|
||||
import { dictApi } from '/@/api/support/dict/dict-api';
|
||||
import { dictApi } from '/@/api/support/dict-api';
|
||||
import { smartSentry } from '/@/lib/smart-sentry';
|
||||
|
||||
// emit
|
||||
|
||||
@@ -15,13 +15,13 @@
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item class="smart-query-form-item smart-margin-left10">
|
||||
<a-button type="primary" @click="ajaxQuery">
|
||||
<a-button type="primary" @click="onSearch">
|
||||
<template #icon>
|
||||
<ReloadOutlined />
|
||||
</template>
|
||||
查询
|
||||
</a-button>
|
||||
<a-button @click="resetQuery">
|
||||
<a-button @click="resetQuery" class="smart-margin-left10">
|
||||
<template #icon>
|
||||
<SearchOutlined />
|
||||
</template>
|
||||
@@ -41,7 +41,14 @@
|
||||
新建
|
||||
</a-button>
|
||||
|
||||
<a-button @click="confirmBatchDelete" v-privilege="'support:dict:batch:delete'" type="danger" size="small" :disabled="selectedRowKeyList.length == 0">
|
||||
<a-button
|
||||
@click="confirmBatchDelete"
|
||||
v-privilege="'support:dict:batchDelete'"
|
||||
type="text"
|
||||
danger
|
||||
size="small"
|
||||
:disabled="selectedRowKeyList.length === 0"
|
||||
>
|
||||
<template #icon>
|
||||
<DeleteOutlined />
|
||||
</template>
|
||||
@@ -76,7 +83,7 @@
|
||||
</template>
|
||||
<template v-else-if="column.dataIndex === 'action'">
|
||||
<div class="smart-table-operate">
|
||||
<a-button @click="addOrUpdateKey(record)" v-privilege="'support:dict:update'" type="link">编辑</a-button>
|
||||
<a-button @click="addOrUpdateKey(record)" v-privilege="'support:dict:edit'" type="link">编辑</a-button>
|
||||
</div>
|
||||
</template>
|
||||
</template>
|
||||
@@ -109,7 +116,7 @@
|
||||
import { reactive, ref, onMounted } from 'vue';
|
||||
import { message, Modal } from 'ant-design-vue';
|
||||
import { SmartLoading } from '/@/components/framework/smart-loading';
|
||||
import { dictApi } from '/@/api/support/dict/dict-api';
|
||||
import { dictApi } from '/@/api/support/dict-api';
|
||||
import { PAGE_SIZE_OPTIONS } from '/@/constants/common-const';
|
||||
import { smartSentry } from '/@/lib/smart-sentry';
|
||||
import TableOperator from '/@/components/support/table-operator/index.vue';
|
||||
@@ -169,7 +176,7 @@
|
||||
Object.assign(queryForm, queryFormState);
|
||||
ajaxQuery();
|
||||
}
|
||||
function onSearch(){
|
||||
function onSearch() {
|
||||
queryForm.pageNum = 1;
|
||||
ajaxQuery();
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
<a-range-picker
|
||||
v-model:value="chooseTimeRange"
|
||||
@change="changeCreateDate"
|
||||
:ranges="defaultTimeRanges"
|
||||
:presets="defaultTimeRanges"
|
||||
format="YYYY-MM-DD"
|
||||
style="width: 240px"
|
||||
/>
|
||||
@@ -43,7 +43,7 @@
|
||||
|
||||
<a-card size="small">
|
||||
<a-table rowKey="feedbackId" :dataSource="tableData" :columns="tableColumns" :pagination="false" :loading="tableLoading" size="small" bordered>
|
||||
<template #bodyCell="{ text, record, column }">
|
||||
<template #bodyCell="{ text, column }">
|
||||
<template v-if="column.dataIndex === 'feedbackAttachment'">
|
||||
<FilePreview :fileList="text" />
|
||||
</template>
|
||||
@@ -75,7 +75,7 @@
|
||||
import { onMounted, reactive, ref } from 'vue';
|
||||
import { PAGE_SIZE, PAGE_SIZE_OPTIONS } from '/@/constants/common-const';
|
||||
import { defaultTimeRanges } from '/@/lib/default-time-ranges';
|
||||
import { feedbackApi } from '/@/api/support/feedback/feedback-api';
|
||||
import { feedbackApi } from '/@/api/support/feedback-api';
|
||||
import FilePreview from '/@/components/support/file-preview/index.vue';
|
||||
import { smartSentry } from '/@/lib/smart-sentry';
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
<a-input style="width: 150px" v-model:value="queryForm.creatorName" placeholder="创建人" />
|
||||
</a-form-item>
|
||||
<a-form-item label="创建时间" class="smart-query-form-item">
|
||||
<a-range-picker v-model:value="queryForm.createTime" :ranges="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 class="smart-query-form-item">
|
||||
<a-button type="primary" @click="queryData">
|
||||
@@ -99,7 +99,7 @@
|
||||
|
||||
<FilePreviewModal ref="filePreviewModalRef" />
|
||||
|
||||
<a-modal v-model:visible="uploadModalFlag" title="上传文件" @onCancel="hideUploadModal" @ok="hideUploadModal">
|
||||
<a-modal v-model:open="uploadModalFlag" title="上传文件" @onCancel="hideUploadModal" @ok="hideUploadModal">
|
||||
<FileUpload
|
||||
list-type="text"
|
||||
:maxUploadSize="5"
|
||||
@@ -113,7 +113,7 @@
|
||||
</template>
|
||||
<script setup>
|
||||
import { onMounted, reactive, ref } from 'vue';
|
||||
import { fileApi } from '/@/api/support/file/file-api';
|
||||
import { fileApi } from '/@/api/support/file-api';
|
||||
import SmartEnumSelect from '/@/components/framework/smart-enum-select/index.vue';
|
||||
import TableOperator from '/@/components/support/table-operator/index.vue';
|
||||
import { PAGE_SIZE_OPTIONS } from '/@/constants/common-const';
|
||||
@@ -217,6 +217,12 @@
|
||||
}
|
||||
|
||||
// 查询数据
|
||||
|
||||
function onSearch(){
|
||||
queryForm.pageNum = 1;
|
||||
queryData();
|
||||
}
|
||||
|
||||
async function queryData() {
|
||||
tableLoading.value = true;
|
||||
try {
|
||||
|
||||
@@ -34,11 +34,11 @@
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item label="心跳时间" class="smart-query-form-item">
|
||||
<a-range-picker @change="changeCreateDate" v-model:value="createDateRange" :ranges="defaultChooseTimeRange" style="width: 240px" />
|
||||
<a-range-picker @change="changeCreateDate" v-model:value="createDateRange" :presets="defaultChooseTimeRange" style="width: 240px" />
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item class="smart-query-form-item smart-margin-left10">
|
||||
<a-button type="primary" @click="ajaxQuery">
|
||||
<a-button type="primary" @click="onSearch" class="smart-margin-right10">
|
||||
<template #icon>
|
||||
<ReloadOutlined />
|
||||
</template>
|
||||
@@ -53,39 +53,39 @@
|
||||
</a-form-item>
|
||||
</a-row>
|
||||
</a-form>
|
||||
<a-row justify="end">
|
||||
<TableOperator class="smart-margin-bottom5" v-model="columns" :tableId="TABLE_ID_CONST.SUPPORT.HEART_BEAT" :refresh="ajaxQuery" />
|
||||
</a-row>
|
||||
<a-table
|
||||
size="small"
|
||||
bordered
|
||||
:loading="tableLoading"
|
||||
class="smart-margin-top10"
|
||||
:dataSource="tableData"
|
||||
:columns="columns"
|
||||
rowKey="goodsId"
|
||||
:pagination="false"
|
||||
<a-row justify="end">
|
||||
<TableOperator class="smart-margin-bottom5" v-model="columns" :tableId="TABLE_ID_CONST.SUPPORT.HEART_BEAT" :refresh="ajaxQuery" />
|
||||
</a-row>
|
||||
<a-table
|
||||
size="small"
|
||||
bordered
|
||||
:loading="tableLoading"
|
||||
class="smart-margin-top10"
|
||||
:dataSource="tableData"
|
||||
:columns="columns"
|
||||
rowKey="goodsId"
|
||||
:pagination="false"
|
||||
/>
|
||||
<div class="smart-query-table-page">
|
||||
<a-pagination
|
||||
showSizeChanger
|
||||
showQuickJumper
|
||||
show-less-items
|
||||
:pageSizeOptions="PAGE_SIZE_OPTIONS"
|
||||
:defaultPageSize="queryForm.pageSize"
|
||||
v-model:current="queryForm.pageNum"
|
||||
v-model:pageSize="queryForm.pageSize"
|
||||
:total="total"
|
||||
@change="ajaxQuery"
|
||||
@showSizeChange="ajaxQuery"
|
||||
:show-total="(total) => `共${total}条`"
|
||||
/>
|
||||
<div class="smart-query-table-page">
|
||||
<a-pagination
|
||||
showSizeChanger
|
||||
showQuickJumper
|
||||
show-less-items
|
||||
:pageSizeOptions="PAGE_SIZE_OPTIONS"
|
||||
:defaultPageSize="queryForm.pageSize"
|
||||
v-model:current="queryForm.pageNum"
|
||||
v-model:pageSize="queryForm.pageSize"
|
||||
:total="total"
|
||||
@change="ajaxQuery"
|
||||
@showSizeChange="ajaxQuery"
|
||||
:show-total="(total) => `共${total}条`"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</a-card>
|
||||
</template>
|
||||
<script setup>
|
||||
import { onMounted, reactive, ref } from 'vue';
|
||||
import { heartBeatApi } from '/@/api/support/heart-beat/heart-beat-api';
|
||||
import { heartBeatApi } from '/@/api/support/heart-beat-api';
|
||||
import { PAGE_SIZE_OPTIONS } from '/@/constants/common-const';
|
||||
import { defaultTimeRanges } from '/@/lib/default-time-ranges';
|
||||
import { smartSentry } from '/@/lib/smart-sentry';
|
||||
@@ -117,17 +117,17 @@
|
||||
{
|
||||
title: '进程号',
|
||||
dataIndex: 'processNo',
|
||||
width:100
|
||||
width: 100,
|
||||
},
|
||||
{
|
||||
title: '进程开启时间',
|
||||
dataIndex: 'processStartTime',
|
||||
width:150
|
||||
width: 150,
|
||||
},
|
||||
{
|
||||
title: '心跳当前时间',
|
||||
dataIndex: 'heartBeatTime',
|
||||
width:150
|
||||
width: 150,
|
||||
},
|
||||
]);
|
||||
|
||||
@@ -148,6 +148,12 @@
|
||||
createDateRange.value = [];
|
||||
ajaxQuery();
|
||||
}
|
||||
|
||||
function onSearch() {
|
||||
queryForm.pageNum = 1;
|
||||
ajaxQuery();
|
||||
}
|
||||
|
||||
async function ajaxQuery() {
|
||||
try {
|
||||
tableLoading.value = true;
|
||||
|
||||
@@ -8,9 +8,9 @@
|
||||
* @Copyright 1024创新实验室 ( https://1024lab.net ),Since 2012
|
||||
-->
|
||||
<template>
|
||||
<a-modal v-model:visible="visible" :title="formState.helpDocCatalogId ? '编辑目录' : '添加目录'" @ok="handleOk" destroyOnClose>
|
||||
<a-modal v-model:open="visible" :title="formState.helpDocCatalogId ? '编辑目录' : '添加目录'" @ok="handleOk" destroyOnClose>
|
||||
<a-form ref="formRef" :model="formState" :rules="rules" layout="vertical">
|
||||
<a-form-item label="上级目录" name="parentId" v-if="formState.parentId != 0">
|
||||
<a-form-item label="上级目录" name="parentId" v-if="formState.parentId !== 0">
|
||||
<HelpDocCatalogTreeSelect ref="helpDocCatalogTreeSelect" v-model:value="formState.parentId" :defaultValueFlag="false" width="100%" />
|
||||
</a-form-item>
|
||||
<a-form-item label="目录名称" name="name">
|
||||
@@ -22,13 +22,13 @@
|
||||
</a-form>
|
||||
</a-modal>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
<script setup>
|
||||
import message from 'ant-design-vue/lib/message';
|
||||
import { reactive, ref } from 'vue';
|
||||
import { helpDocCatalogApi } from '/@/api/support/help-doc/help-doc-catalog-api';
|
||||
import { helpDocCatalogApi } from '/@/api/support/help-doc-catalog-api';
|
||||
import HelpDocCatalogTreeSelect from './help-doc-catalog-tree-select.vue';
|
||||
import { SmartLoading } from '/@/components/framework/smart-loading';
|
||||
import { smartSentry } from '/@/lib/smart-sentry';
|
||||
import { smartSentry } from '/@/lib/smart-sentry';
|
||||
|
||||
// ----------------------- 对外暴漏 ---------------------
|
||||
|
||||
@@ -116,7 +116,7 @@ import { smartSentry } from '/@/lib/smart-sentry';
|
||||
async function updateHelpDocCatalog() {
|
||||
SmartLoading.show();
|
||||
try {
|
||||
if (formState.parentId == formState.helpDocCatalogId) {
|
||||
if (formState.parentId === formState.helpDocCatalogId) {
|
||||
message.warning('上级菜单不能为自己');
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
<script setup>
|
||||
import { onMounted, ref } from 'vue';
|
||||
import _ from 'lodash';
|
||||
import { helpDocCatalogApi } from '/@/api/support/help-doc/help-doc-catalog-api';
|
||||
import { helpDocCatalogApi } from '/@/api/support/help-doc-catalog-api';
|
||||
|
||||
const props = defineProps({
|
||||
// 绑定值
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
<template v-if="showSortFlag"> (越小越靠前) </template>
|
||||
:<a-switch v-model:checked="showSortFlag" />
|
||||
</span>
|
||||
<a-button type="primary" @click="addTop" size="small" v-privilege="'helpDocCatalog:addCategory'">新建</a-button>
|
||||
<a-button type="primary" @click="addTop" size="small" v-privilege="'support:helpDocCatalog:addCategory'">新建</a-button>
|
||||
</a-row>
|
||||
<a-tree
|
||||
v-if="!_.isEmpty(helpDocCatalogTreeData)"
|
||||
@@ -40,13 +40,13 @@
|
||||
<a-popover placement="right" v-if="props.showMenu">
|
||||
<template #content>
|
||||
<div style="display: flex; flex-direction: column">
|
||||
<a-button type="text" @click="addHelpDocCatalog(item.dataRef)" v-privilege="'helpDocCatalog:addCategory'">添加下级</a-button>
|
||||
<a-button type="text" @click="updateHelpDocCatalog(item.dataRef)" v-privilege="'helpDocCatalog:edit'">修改</a-button>
|
||||
<a-button type="text" @click="addHelpDocCatalog(item.dataRef)" v-privilege="'support:helpDocCatalog:addCategory'">添加下级</a-button>
|
||||
<a-button type="text" @click="updateHelpDocCatalog(item.dataRef)" v-privilege="'support:helpDocCatalog:edit'">修改</a-button>
|
||||
<a-button
|
||||
type="text"
|
||||
v-if="item.helpDocCatalogId != topHelpDocCatalogId"
|
||||
v-if="item.helpDocCatalogId !== topHelpDocCatalogId"
|
||||
@click="deleteHelpDocCatalog(item.helpDocCatalogId)"
|
||||
v-privilege="'helpDocCatalog:delete'"
|
||||
v-privilege="'support:helpDocCatalog:delete'"
|
||||
>删除</a-button
|
||||
>
|
||||
</div>
|
||||
@@ -65,7 +65,7 @@
|
||||
<HelpDocCatalogFormModal ref="helpDocCatalogFormModal" @refresh="refresh" />
|
||||
</a-card>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
<script setup>
|
||||
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
|
||||
import { ref } from 'vue';
|
||||
import { onUnmounted, watch } from 'vue';
|
||||
@@ -73,10 +73,10 @@
|
||||
import _ from 'lodash';
|
||||
import { createVNode, onMounted } from 'vue';
|
||||
import HelpDocCatalogFormModal from './help-doc-catalog-form-modal.vue';
|
||||
import { helpDocCatalogApi } from '/@/api/support/help-doc/help-doc-catalog-api';
|
||||
import { helpDocCatalogApi } from '/@/api/support/help-doc-catalog-api';
|
||||
import { SmartLoading } from '/@/components/framework/smart-loading';
|
||||
import helpDocCatalogEmitter from '../help-doc-mitt';
|
||||
import { smartSentry } from '/@/lib/smart-sentry';
|
||||
import { smartSentry } from '/@/lib/smart-sentry';
|
||||
|
||||
const HELP_DOC_CATALOG_PARENT_ID = 0;
|
||||
|
||||
@@ -194,7 +194,7 @@ import { smartSentry } from '/@/lib/smart-sentry';
|
||||
return;
|
||||
}
|
||||
let id = idList[0];
|
||||
selectedHelpDocCatalogChildren.value = helpDocCatalogList.value.filter((e) => e.parentId == id);
|
||||
selectedHelpDocCatalogChildren.value = helpDocCatalogList.value.filter((e) => e.parentId === id);
|
||||
let filterHelpDocCatalogList = [];
|
||||
recursionFilterHelpDocCatalog(filterHelpDocCatalogList, id, true);
|
||||
breadcrumb.value = filterHelpDocCatalogList.map((e) => e.name);
|
||||
@@ -233,7 +233,7 @@ import { smartSentry } from '/@/lib/smart-sentry';
|
||||
// 根据ID递归筛选目录
|
||||
function recursionFilterHelpDocCatalog(resList, id, unshift) {
|
||||
let info = idInfoMap.value.get(id);
|
||||
if (!info || resList.some((e) => e.helpDocCatalogId == id)) {
|
||||
if (!info || resList.some((e) => e.helpDocCatalogId === id)) {
|
||||
return;
|
||||
}
|
||||
if (unshift) {
|
||||
@@ -241,7 +241,7 @@ import { smartSentry } from '/@/lib/smart-sentry';
|
||||
} else {
|
||||
resList.push(info);
|
||||
}
|
||||
if (info.parentId && info.parentId != 0) {
|
||||
if (info.parentId && info.parentId !== 0) {
|
||||
recursionFilterHelpDocCatalog(resList, info.parentId, unshift);
|
||||
}
|
||||
}
|
||||
@@ -289,8 +289,8 @@ import { smartSentry } from '/@/lib/smart-sentry';
|
||||
let selectedKey = null;
|
||||
if (!_.isEmpty(selectedKeys.value)) {
|
||||
selectedKey = selectedKeys.value[0];
|
||||
if (selectedKey == id) {
|
||||
let selectInfo = helpDocCatalogList.value.find((e) => e.helpDocCatalogId == id);
|
||||
if (selectedKey === id) {
|
||||
let selectInfo = helpDocCatalogList.value.find((e) => e.helpDocCatalogId === id);
|
||||
if (selectInfo && selectInfo.parentId) {
|
||||
selectedKey = selectInfo.parentId;
|
||||
}
|
||||
@@ -345,7 +345,6 @@ import { smartSentry } from '/@/lib/smart-sentry';
|
||||
|
||||
.sort-span {
|
||||
margin-left: 5px;
|
||||
color: @success-color;
|
||||
}
|
||||
.no-data {
|
||||
margin: 10px;
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<template>
|
||||
<a-drawer
|
||||
:title="formData.helpDocId ? '编辑系统手册' : '新建系统手册'"
|
||||
:visible="visibleFlag"
|
||||
:open="visibleFlag"
|
||||
:width="1000"
|
||||
:footerStyle="{ textAlign: 'right' }"
|
||||
@close="onClose"
|
||||
@@ -64,17 +64,16 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { reactive, ref, nextTick } from 'vue';
|
||||
import { message, Modal } from 'ant-design-vue';
|
||||
import lodash from 'lodash';
|
||||
import { nextTick, reactive, ref } from 'vue';
|
||||
import { message } from 'ant-design-vue';
|
||||
import _ from 'lodash';
|
||||
import { SmartLoading } from '/@/components/framework/smart-loading';
|
||||
import { FILE_FOLDER_TYPE_ENUM } from '/@/constants/support/file-const';
|
||||
import { helpDocApi } from '/@/api/support/help-doc/help-doc-api';
|
||||
import { helpDocApi } from '/@/api/support/help-doc-api';
|
||||
import Wangeditor from '/@/components/framework/wangeditor/index.vue';
|
||||
import Upload from '/@/components/support/file-upload/index.vue';
|
||||
import HelpDocCatalogTreeSelect from './help-doc-catalog-tree-select.vue';
|
||||
import MenuTreeSelect from '/@/components/system/menu-tree-select/index.vue';
|
||||
import _ from 'lodash';
|
||||
import { smartSentry } from '/@/lib/smart-sentry';
|
||||
|
||||
const emits = defineEmits(['reloadList']);
|
||||
@@ -104,7 +103,6 @@
|
||||
|
||||
const formRef = ref();
|
||||
const contentRef = ref();
|
||||
const noticeFormVisibleModal = ref();
|
||||
const relateHomeFlag = ref(false);
|
||||
|
||||
const defaultFormData = {
|
||||
@@ -135,7 +133,7 @@
|
||||
SmartLoading.show();
|
||||
const result = await helpDocApi.getDetail(helpDocId);
|
||||
const attachment = result.data.attachment;
|
||||
if (!lodash.isEmpty(attachment)) {
|
||||
if (!_.isEmpty(attachment)) {
|
||||
defaultFileList.value = attachment;
|
||||
} else {
|
||||
defaultFileList.value = [];
|
||||
@@ -160,7 +158,7 @@
|
||||
formData.contentHtml = contentRef.value.getHtml();
|
||||
formData.contentText = contentRef.value.getText();
|
||||
await formRef.value.validateFields();
|
||||
save();
|
||||
await save();
|
||||
} catch (err) {
|
||||
message.error('参数验证错误,请仔细填写表单数据!');
|
||||
}
|
||||
@@ -206,7 +204,7 @@
|
||||
const defaultFileList = ref([]);
|
||||
function changeAttachment(fileList) {
|
||||
defaultFileList.value = fileList;
|
||||
formData.attachment = lodash.isEmpty(fileList) ? [] : fileList;
|
||||
formData.attachment = _.isEmpty(fileList) ? [] : fileList;
|
||||
}
|
||||
|
||||
// ----------------------- 以下是暴露的方法内容 ------------------------
|
||||
|
||||
@@ -8,14 +8,14 @@
|
||||
* @Copyright 1024创新实验室 ( https://1024lab.net ),Since 2012
|
||||
-->
|
||||
<template>
|
||||
<a-form class="smart-query-form" v-privilege="'helpDoc:query'">
|
||||
<a-form class="smart-query-form" v-privilege="'support:helpDoc:query'">
|
||||
<a-row class="smart-query-form-row">
|
||||
<a-form-item label="关键字" class="smart-query-form-item">
|
||||
<a-input style="width: 300px" v-model:value="queryForm.keywords" placeholder="标题、作者" />
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item label="创建时间" class="smart-query-form-item">
|
||||
<a-range-picker :ranges="defaultTimeRanges" v-model:value="createDate" @change="createDateChange" style="width: 220px" />
|
||||
<a-range-picker :presets="defaultTimeRanges" v-model:value="createDate" @change="createDateChange" style="width: 220px" />
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item class="smart-query-form-item smart-margin-left10">
|
||||
@@ -40,7 +40,7 @@
|
||||
<a-card size="small" :bordered="false">
|
||||
<a-row class="smart-table-btn-block">
|
||||
<div class="smart-table-operate-block">
|
||||
<a-button type="primary" size="small" @click="addOrUpdate()" v-privilege="'helpDoc:add'">
|
||||
<a-button type="primary" size="small" @click="addOrUpdate()" v-privilege="'support:helpDoc:add'">
|
||||
<template #icon>
|
||||
<PlusOutlined />
|
||||
</template>
|
||||
@@ -70,8 +70,8 @@
|
||||
</template>
|
||||
<template v-else-if="column.dataIndex === 'action'">
|
||||
<div class="smart-table-operate">
|
||||
<a-button type="link" @click="addOrUpdate(record.helpDocId)" v-privilege="'helpDoc:update'">编辑</a-button>
|
||||
<a-button type="link" danger @click="onDelete(record.helpDocId)" v-privilege="'helpDoc:delete'">删除</a-button>
|
||||
<a-button type="link" @click="addOrUpdate(record.helpDocId)" v-privilege="'support:helpDoc:update'">编辑</a-button>
|
||||
<a-button type="link" danger @click="onDelete(record.helpDocId)" v-privilege="'support:helpDoc:delete'">删除</a-button>
|
||||
</div>
|
||||
</template>
|
||||
</template>
|
||||
@@ -101,7 +101,7 @@
|
||||
import { message, Modal } from 'ant-design-vue';
|
||||
import { onMounted, reactive, ref, watch } from 'vue';
|
||||
import HelpDocFormDrawer from './help-doc-form-drawer.vue';
|
||||
import { helpDocApi } from '/@/api/support/help-doc/help-doc-api';
|
||||
import { helpDocApi } from '/@/api/support/help-doc-api';
|
||||
import { PAGE_SIZE, PAGE_SIZE_OPTIONS } from '/@/constants/common-const';
|
||||
import { smartSentry } from '/@/lib/smart-sentry';
|
||||
import TableOperator from '/@/components/support/table-operator/index.vue';
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
</template>
|
||||
<script setup>
|
||||
import { reactive, ref } from 'vue';
|
||||
import { helpDocApi } from '/@/api/support/help-doc/help-doc-api';
|
||||
import { helpDocApi } from '/@/api/support/help-doc-api';
|
||||
import { PAGE_SIZE, PAGE_SIZE_OPTIONS } from '/@/constants/common-const';
|
||||
import uaparser from 'ua-parser-js';
|
||||
import { smartSentry } from '/@/lib/smart-sentry';
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
import { onMounted, ref } from 'vue';
|
||||
import { useRoute } from 'vue-router';
|
||||
import HelpDocViewRecordList from './components/help-doc-view-record-list.vue';
|
||||
import { helpDocApi } from '/@/api/support/help-doc/help-doc-api';
|
||||
import { helpDocApi } from '/@/api/support/help-doc-api';
|
||||
import { SmartLoading } from '/@/components/framework/smart-loading';
|
||||
import FilePreview from '/@/components/support/file-preview/index.vue';
|
||||
import { smartSentry } from '/@/lib/smart-sentry';
|
||||
|
||||
@@ -0,0 +1,245 @@
|
||||
<!--
|
||||
* 登录失败锁定
|
||||
*
|
||||
* @Author: 1024创新实验室-主任-卓大
|
||||
* @Date: 2023-10-17 18:02:37
|
||||
* @Copyright 1024创新实验室
|
||||
-->
|
||||
<template>
|
||||
<!---------- 查询表单form begin ----------->
|
||||
<a-form class="smart-query-form">
|
||||
<a-row class="smart-query-form-row">
|
||||
<a-form-item label="登录名" class="smart-query-form-item">
|
||||
<a-input style="width: 300px" v-model:value="queryForm.loginName" placeholder="登录名" />
|
||||
</a-form-item>
|
||||
<a-form-item label="快速筛选" class="smart-query-form-item">
|
||||
<a-radio-group v-model:value="queryForm.lockFlag" @change="onSearch" button-style="solid">
|
||||
<a-radio-button :value="undefined">全部</a-radio-button>
|
||||
<a-radio-button :value="true">已锁定</a-radio-button>
|
||||
<a-radio-button :value="false">未锁定</a-radio-button>
|
||||
</a-radio-group>
|
||||
</a-form-item>
|
||||
<a-form-item label="锁定时间" class="smart-query-form-item">
|
||||
<a-range-picker
|
||||
v-model:value="queryForm.loginLockBeginTime"
|
||||
:presets="defaultTimeRanges"
|
||||
style="width: 220px"
|
||||
@change="onChangeLoginLockBeginTime"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item class="smart-query-form-item">
|
||||
<a-button type="primary" @click="onSearch">
|
||||
<template #icon>
|
||||
<SearchOutlined />
|
||||
</template>
|
||||
查询
|
||||
</a-button>
|
||||
<a-button @click="resetQuery" class="smart-margin-left10">
|
||||
<template #icon>
|
||||
<ReloadOutlined />
|
||||
</template>
|
||||
重置
|
||||
</a-button>
|
||||
</a-form-item>
|
||||
</a-row>
|
||||
</a-form>
|
||||
<!---------- 查询表单form end ----------->
|
||||
|
||||
<a-card size="small" :bordered="false" :hoverable="true">
|
||||
<!---------- 表格操作行 begin ----------->
|
||||
<a-row class="smart-table-btn-block">
|
||||
<div class="smart-table-operate-block">
|
||||
<a-button @click="confirmBatchDelete" danger size="small" :disabled="selectedRowKeyList.length === 0">
|
||||
<template #icon>
|
||||
<DeleteOutlined />
|
||||
</template>
|
||||
解除锁定
|
||||
</a-button>
|
||||
</div>
|
||||
<div class="smart-table-setting-block">
|
||||
<TableOperator v-model="columns" :tableId="null" :refresh="queryData" />
|
||||
</div>
|
||||
</a-row>
|
||||
<!---------- 表格操作行 end ----------->
|
||||
|
||||
<!---------- 表格 begin ----------->
|
||||
<a-table
|
||||
size="small"
|
||||
:dataSource="tableData"
|
||||
:columns="columns"
|
||||
rowKey="loginFailId"
|
||||
bordered
|
||||
:loading="tableLoading"
|
||||
:pagination="false"
|
||||
:row-selection="{ selectedRowKeys: selectedRowKeyList, onChange: onSelectChange }"
|
||||
>
|
||||
<template #bodyCell="{ text, column }">
|
||||
<template v-if="column.dataIndex === 'userType'">
|
||||
<span>{{ $smartEnumPlugin.getDescByValue('USER_TYPE_ENUM', text) }}</span>
|
||||
</template>
|
||||
<template v-if="column.dataIndex === 'lockFlag'">
|
||||
<template v-if="text">
|
||||
<a-tag color="error">已锁定</a-tag>
|
||||
</template>
|
||||
<template v-if="!text">
|
||||
<a-tag color="success">未锁定</a-tag>
|
||||
</template>
|
||||
</template>
|
||||
</template>
|
||||
</a-table>
|
||||
<!---------- 表格 end ----------->
|
||||
|
||||
<div class="smart-query-table-page">
|
||||
<a-pagination
|
||||
showSizeChanger
|
||||
showQuickJumper
|
||||
show-less-items
|
||||
:pageSizeOptions="PAGE_SIZE_OPTIONS"
|
||||
:defaultPageSize="queryForm.pageSize"
|
||||
v-model:current="queryForm.pageNum"
|
||||
v-model:pageSize="queryForm.pageSize"
|
||||
:total="total"
|
||||
@change="onSearch"
|
||||
@showSizeChange="onSearch"
|
||||
:show-total="(total) => `共${total}条`"
|
||||
/>
|
||||
</div>
|
||||
</a-card>
|
||||
</template>
|
||||
<script setup>
|
||||
import { reactive, ref, onMounted } from 'vue';
|
||||
import { message, Modal } from 'ant-design-vue';
|
||||
import { SmartLoading } from '/@/components/framework/smart-loading';
|
||||
import { loginFailApi } from '/@/api/support/login-fail-api';
|
||||
import { PAGE_SIZE_OPTIONS } from '/@/constants/common-const';
|
||||
import { smartSentry } from '/@/lib/smart-sentry';
|
||||
import TableOperator from '/@/components/support/table-operator/index.vue';
|
||||
import { defaultTimeRanges } from '/@/lib/default-time-ranges';
|
||||
|
||||
// ---------------------------- 表格列 ----------------------------
|
||||
|
||||
const columns = ref([
|
||||
{
|
||||
title: '登录名',
|
||||
dataIndex: 'loginName',
|
||||
},
|
||||
{
|
||||
title: '用户类型',
|
||||
dataIndex: 'userType',
|
||||
},
|
||||
{
|
||||
title: '登录失败次数',
|
||||
dataIndex: 'loginFailCount',
|
||||
},
|
||||
{
|
||||
title: '锁定状态',
|
||||
dataIndex: 'lockFlag',
|
||||
},
|
||||
{
|
||||
title: '锁定开始时间',
|
||||
dataIndex: 'loginLockBeginTime',
|
||||
},
|
||||
{
|
||||
title: '创建时间',
|
||||
dataIndex: 'createTime',
|
||||
},
|
||||
{
|
||||
title: '更新时间',
|
||||
dataIndex: 'updateTime',
|
||||
},
|
||||
]);
|
||||
|
||||
// ---------------------------- 查询数据表单和方法 ----------------------------
|
||||
|
||||
const queryFormState = {
|
||||
loginName: undefined, //登录名
|
||||
lockFlag: true, // 锁定状态
|
||||
loginLockBeginTime: [], //登录失败锁定时间
|
||||
loginLockBeginTimeBegin: undefined, //登录失败锁定时间 开始
|
||||
loginLockBeginTimeEnd: undefined, //登录失败锁定时间 结束
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
};
|
||||
// 查询表单form
|
||||
const queryForm = reactive({ ...queryFormState });
|
||||
// 表格加载loading
|
||||
const tableLoading = ref(false);
|
||||
// 表格数据
|
||||
const tableData = ref([]);
|
||||
// 总数
|
||||
const total = ref(0);
|
||||
|
||||
// 重置查询条件
|
||||
function resetQuery() {
|
||||
let pageSize = queryForm.pageSize;
|
||||
Object.assign(queryForm, queryFormState);
|
||||
queryForm.pageSize = pageSize;
|
||||
queryForm.lockFlag = undefined;
|
||||
queryData();
|
||||
}
|
||||
|
||||
// 查询数据
|
||||
|
||||
function onSearch() {
|
||||
queryForm.pageNum = 1;
|
||||
queryData();
|
||||
}
|
||||
|
||||
async function queryData() {
|
||||
tableLoading.value = true;
|
||||
try {
|
||||
let queryResult = await loginFailApi.queryPage(queryForm);
|
||||
tableData.value = queryResult.data.list;
|
||||
total.value = queryResult.data.total;
|
||||
} catch (e) {
|
||||
smartSentry.captureError(e);
|
||||
} finally {
|
||||
tableLoading.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
function onChangeLoginLockBeginTime(dates, dateStrings) {
|
||||
queryForm.loginLockBeginTimeBegin = dateStrings[0];
|
||||
queryForm.loginLockBeginTimeEnd = dateStrings[1];
|
||||
}
|
||||
|
||||
onMounted(queryData);
|
||||
|
||||
// ---------------------------- 批量解除锁定 ----------------------------
|
||||
|
||||
// 选择表格行
|
||||
const selectedRowKeyList = ref([]);
|
||||
|
||||
function onSelectChange(selectedRowKeys) {
|
||||
selectedRowKeyList.value = selectedRowKeys;
|
||||
}
|
||||
|
||||
// 批量解除锁定
|
||||
function confirmBatchDelete() {
|
||||
Modal.confirm({
|
||||
title: '提示',
|
||||
content: '确定要批量解除锁定这些数据吗?',
|
||||
okText: '解锁',
|
||||
okType: 'danger',
|
||||
onOk() {
|
||||
requestBatchDelete();
|
||||
},
|
||||
cancelText: '取消',
|
||||
onCancel() {},
|
||||
});
|
||||
}
|
||||
|
||||
//请求批量删除
|
||||
async function requestBatchDelete() {
|
||||
try {
|
||||
SmartLoading.show();
|
||||
await loginFailApi.batchDelete(selectedRowKeyList.value);
|
||||
message.success('解锁成功');
|
||||
queryData();
|
||||
} catch (e) {
|
||||
smartSentry.captureError(e);
|
||||
} finally {
|
||||
SmartLoading.hide();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -8,7 +8,7 @@
|
||||
* @Copyright 1024创新实验室 ( https://1024lab.net ),Since 2012
|
||||
-->
|
||||
<template>
|
||||
<a-form class="smart-query-form" v-privilege="'loginLog:query'" ref="queryFormRef">
|
||||
<a-form class="smart-query-form" v-privilege="'support:loginLog:query'" ref="queryFormRef">
|
||||
<a-row class="smart-query-form-row">
|
||||
<a-form-item label="用户名称" class="smart-query-form-item">
|
||||
<a-input style="width: 300px" v-model:value="queryForm.userName" placeholder="用户名称" />
|
||||
@@ -19,17 +19,17 @@
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item label="时间" class="smart-query-form-item">
|
||||
<a-range-picker @change="changeCreateDate" v-model:value="createDateRange" :ranges="defaultChooseTimeRange" style="width: 240px" />
|
||||
<a-range-picker @change="changeCreateDate" v-model:value="createDateRange" :presets="defaultChooseTimeRange" style="width: 240px" />
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item class="smart-query-form-item smart-margin-left10">
|
||||
<a-button type="primary" @click="ajaxQuery">
|
||||
<a-button type="primary" @click="onSearch">
|
||||
<template #icon>
|
||||
<ReloadOutlined />
|
||||
</template>
|
||||
查询
|
||||
</a-button>
|
||||
<a-button @click="resetQuery">
|
||||
<a-button @click="resetQuery" class="smart-margin-left10">
|
||||
<template #icon>
|
||||
<SearchOutlined />
|
||||
</template>
|
||||
@@ -99,7 +99,7 @@
|
||||
import { defaultTimeRanges } from '/@/lib/default-time-ranges';
|
||||
import uaparser from 'ua-parser-js';
|
||||
import { LOGIN_RESULT_ENUM } from '/@/constants/support/login-log-const';
|
||||
import { loginLogApi } from '/@/api/support/login-log/login-log-api';
|
||||
import { loginLogApi } from '/@/api/support/login-log-api';
|
||||
import { smartSentry } from '/@/lib/smart-sentry';
|
||||
import TableOperator from '/@/components/support/table-operator/index.vue';
|
||||
import { TABLE_ID_CONST } from '/@/constants/support/table-id-const';
|
||||
@@ -127,6 +127,11 @@
|
||||
dataIndex: 'loginIp',
|
||||
ellipsis: true,
|
||||
},
|
||||
{
|
||||
title: 'IP地区',
|
||||
dataIndex: 'loginIpRegion',
|
||||
ellipsis: true,
|
||||
},
|
||||
{
|
||||
title: '设备信息',
|
||||
dataIndex: 'userAgent',
|
||||
@@ -175,6 +180,12 @@
|
||||
createDateRange.value = [];
|
||||
ajaxQuery();
|
||||
}
|
||||
|
||||
function onSearch() {
|
||||
queryForm.pageNum = 1;
|
||||
ajaxQuery();
|
||||
}
|
||||
|
||||
async function ajaxQuery() {
|
||||
try {
|
||||
tableLoading.value = true;
|
||||
|
||||
@@ -8,37 +8,42 @@
|
||||
* @Copyright 1024创新实验室 ( https://1024lab.net ),Since 2012
|
||||
-->
|
||||
<template>
|
||||
<a-modal :visible="visible" title="请求详情" width="60%" :footer="null" @cancel="close">
|
||||
<a-modal :open="visible" title="请求详情" width="60%" :footer="null" @cancel="close">
|
||||
<div class="info-box">
|
||||
<a-row class="smart-margin-top10">
|
||||
<a-col :span="16">
|
||||
<a-row class="detail-info">
|
||||
<a-col :span="12"> 请求地址: {{ detail.url }}</a-col>
|
||||
<a-col :span="12"> 请求url: {{ detail.url }}</a-col>
|
||||
<a-col :span="12"> 请求日期: {{ detail.createTime }}</a-col>
|
||||
</a-row>
|
||||
<a-row class="detail-info">
|
||||
<a-col> 请求方法: {{ detail.method }}</a-col>
|
||||
<a-col :span="12"> 请求IP: {{ detail.ip }}</a-col>
|
||||
<a-col :span="12"> IP地区: {{ detail.ipRegion }}</a-col>
|
||||
</a-row>
|
||||
<a-row class="detail-info">
|
||||
<a-col :span="12"> 用户id:{{ detail.operateUserId }}</a-col>
|
||||
<a-col :span="12"> 用户名称: {{ detail.operateUserName }}</a-col>
|
||||
<a-col :span="24"> 请求内容: {{ detail.module }} - {{ detail.content }}</a-col>
|
||||
</a-row>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<p class="detail-right-title">请求状态</p>
|
||||
<p :class="['detail-right', detail.successFlag ? 'success' : 'error']">
|
||||
<a-typography-text class="detail-right" :type="detail.successFlag ? 'success' : 'danger'">
|
||||
{{ detail.successFlag ? '成功' : '失败' }}
|
||||
</p>
|
||||
</a-typography-text>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</div>
|
||||
<div class="info-box">
|
||||
<h4>请求明细:</h4>
|
||||
<a-col :span="24"> 方法: {{ detail.method }}</a-col>
|
||||
<a-col :span="24"> 说明: {{ detail.module }} - {{ detail.content }}</a-col>
|
||||
</div>
|
||||
<div class="info-box">
|
||||
<h4>请求参数:</h4>
|
||||
<JsonViewer :value="detail.param ? JSON.parse(detail.param) : ''" theme="jv-dark" copyable boxed sort />
|
||||
</div>
|
||||
<div class="info-box">
|
||||
<h4>请求参数:</h4>
|
||||
<div class="info-box" v-if="detail.failReason">
|
||||
<h4>请求失败原因:</h4>
|
||||
<div>
|
||||
{{ detail.failReason }}
|
||||
</div>
|
||||
@@ -49,8 +54,8 @@
|
||||
<script setup>
|
||||
import { reactive, ref } from 'vue';
|
||||
import { JsonViewer } from 'vue3-json-viewer';
|
||||
import { operateLogApi } from '/@/api/support/operate-log/operate-log-api';
|
||||
import { smartSentry } from '/@/lib/smart-sentry';
|
||||
import { operateLogApi } from '/@/api/support/operate-log-api';
|
||||
import { smartSentry } from '/@/lib/smart-sentry';
|
||||
import { SmartLoading } from '/@/components/framework/smart-loading';
|
||||
|
||||
defineExpose({
|
||||
@@ -127,13 +132,6 @@ import { smartSentry } from '/@/lib/smart-sentry';
|
||||
font-size: 20px;
|
||||
font-weight: bold;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.success {
|
||||
color: @success-color;
|
||||
}
|
||||
|
||||
.error {
|
||||
color: @error-color;
|
||||
float: right;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -8,18 +8,18 @@
|
||||
* @Copyright 1024创新实验室 ( https://1024lab.net ),Since 2012
|
||||
-->
|
||||
<template>
|
||||
<a-form class="smart-query-form" v-privilege="'operateLog:query'">
|
||||
<a-form class="smart-query-form" v-privilege="'support:operateLog:query'">
|
||||
<a-row class="smart-query-form-row">
|
||||
<a-form-item label="用户名称" class="smart-query-form-item">
|
||||
<a-input style="width: 300px" v-model:value="queryForm.userName" placeholder="用户名称" />
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item label="请求时间" class="smart-query-form-item">
|
||||
<a-range-picker @change="changeCreateDate" v-model:value="createDateRange" :ranges="defaultChooseTimeRange" style="width: 240px" />
|
||||
<a-range-picker @change="changeCreateDate" v-model:value="createDateRange" :presets="defaultChooseTimeRange" style="width: 240px" />
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item label="快速筛选" class="smart-query-form-item">
|
||||
<a-radio-group v-model:value="queryForm.successFlag" @change="ajaxQuery">
|
||||
<a-radio-group v-model:value="queryForm.successFlag" @change="onSearch">
|
||||
<a-radio-button :value="undefined">全部</a-radio-button>
|
||||
<a-radio-button :value="true">成功</a-radio-button>
|
||||
<a-radio-button :value="false">失败</a-radio-button>
|
||||
@@ -27,7 +27,7 @@
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item class="smart-query-form-item smart-margin-left10">
|
||||
<a-button type="primary" @click="ajaxQuery">
|
||||
<a-button type="primary" @click="ajaxQuery" class="smart-margin-right10">
|
||||
<template #icon>
|
||||
<ReloadOutlined />
|
||||
</template>
|
||||
@@ -43,11 +43,11 @@
|
||||
</a-row>
|
||||
</a-form>
|
||||
|
||||
<a-card size="small" :bordered="false" :hoverable="true" style="height:100%">
|
||||
<a-card size="small" :bordered="false" :hoverable="true" style="height: 100%">
|
||||
<a-row justify="end">
|
||||
<TableOperator class="smart-margin-bottom5" v-model="columns" :tableId="TABLE_ID_CONST.SUPPORT.CONFIG" :refresh="ajaxQuery" />
|
||||
</a-row>
|
||||
<a-table size="small" :loading="tableLoading" :dataSource="tableData" :columns="columns" bordered rowKey="operateLogId" :pagination="false" >
|
||||
<a-table size="small" :loading="tableLoading" :dataSource="tableData" :columns="columns" bordered rowKey="operateLogId" :pagination="false">
|
||||
<template #bodyCell="{ text, record, column }">
|
||||
<template v-if="column.dataIndex === 'successFlag'">
|
||||
<a-tag :color="text ? 'success' : 'error'">{{ text ? '成功' : '失败' }}</a-tag>
|
||||
@@ -63,7 +63,7 @@
|
||||
|
||||
<template v-else-if="column.dataIndex === 'action'">
|
||||
<div class="smart-table-operate">
|
||||
<a-button @click="showDetail(record.operateLogId)" type="link" v-privilege="'operateLog:detail'">详情</a-button>
|
||||
<a-button @click="showDetail(record.operateLogId)" type="link" v-privilege="'support:operateLog:detail'">详情</a-button>
|
||||
</div>
|
||||
</template>
|
||||
</template>
|
||||
@@ -91,7 +91,7 @@
|
||||
<script setup>
|
||||
import { onMounted, reactive, ref } from 'vue';
|
||||
import OperateLogDetailModal from './operate-log-detail-modal.vue';
|
||||
import { operateLogApi } from '/@/api/support/operate-log/operate-log-api';
|
||||
import { operateLogApi } from '/@/api/support/operate-log-api';
|
||||
import { PAGE_SIZE_OPTIONS } from '/@/constants/common-const';
|
||||
import { defaultTimeRanges } from '/@/lib/default-time-ranges';
|
||||
import uaparser from 'ua-parser-js';
|
||||
@@ -131,6 +131,11 @@
|
||||
dataIndex: 'ip',
|
||||
ellipsis: true,
|
||||
},
|
||||
{
|
||||
title: 'IP地区',
|
||||
dataIndex: 'ipRegion',
|
||||
ellipsis: true,
|
||||
},
|
||||
{
|
||||
title: '客户端',
|
||||
dataIndex: 'userAgent',
|
||||
@@ -185,6 +190,12 @@
|
||||
createDateRange.value = [];
|
||||
ajaxQuery();
|
||||
}
|
||||
|
||||
function onSearch() {
|
||||
queryForm.pageNum = 1;
|
||||
ajaxQuery();
|
||||
}
|
||||
|
||||
async function ajaxQuery() {
|
||||
try {
|
||||
tableLoading.value = true;
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
* @Copyright 1024创新实验室 ( https://1024lab.net ),Since 2012
|
||||
-->
|
||||
<template>
|
||||
<a-modal :visible="visible" title="执行Reload" ok-text="确认" cancel-text="取消" @ok="onSubmit" @cancel="onClose">
|
||||
<a-modal :open="visible" title="执行Reload" ok-text="确认" cancel-text="取消" @ok="onSubmit" @cancel="onClose">
|
||||
<a-form ref="formRef" :model="form" :rules="rules" :label-col="{ span: 5 }">
|
||||
<a-form-item label="标签">
|
||||
<a-input v-model:value="form.tag" :disabled="true" />
|
||||
@@ -25,7 +25,7 @@
|
||||
<script setup>
|
||||
import { message } from 'ant-design-vue';
|
||||
import { reactive, ref } from 'vue';
|
||||
import { reloadApi } from '/@/api/support/reload/reload-api';
|
||||
import { reloadApi } from '/@/api/support/reload-api';
|
||||
import { smartSentry } from '/@/lib/smart-sentry';
|
||||
import { SmartLoading } from '/@/components/framework/smart-loading';
|
||||
|
||||
|
||||
@@ -44,11 +44,11 @@
|
||||
rowKey="tag"
|
||||
:pagination="false"
|
||||
>
|
||||
<template #bodyCell="{ text, record, index, column }">
|
||||
<template #bodyCell="{ record, column }">
|
||||
<template v-if="column.dataIndex === 'action'">
|
||||
<div class="smart-table-operate">
|
||||
<a-button @click="doReload(record.tag)" v-privilege="'reload:execute'" type="link">执行</a-button>
|
||||
<a-button @click="showResultList(record.tag)" v-privilege="'reload:result'" type="link">查看结果</a-button>
|
||||
<a-button @click="doReload(record.tag)" v-privilege="'support:reload:execute'" type="link">执行</a-button>
|
||||
<a-button @click="showResultList(record.tag)" v-privilege="'support:reload:result'" type="link">查看结果</a-button>
|
||||
</div>
|
||||
</template>
|
||||
</template>
|
||||
@@ -59,10 +59,10 @@
|
||||
</a-card>
|
||||
</template>
|
||||
<script setup>
|
||||
import { onMounted, reactive, ref } from 'vue';
|
||||
import { onMounted, ref } from 'vue';
|
||||
import DoReloadForm from './do-reload-form-modal.vue';
|
||||
import ReloadResultList from './reload-result-list.vue';
|
||||
import { reloadApi } from '/@/api/support/reload/reload-api';
|
||||
import { reloadApi } from '/@/api/support/reload-api';
|
||||
import { smartSentry } from '/@/lib/smart-sentry';
|
||||
import TableOperator from '/@/components/support/table-operator/index.vue';
|
||||
import { TABLE_ID_CONST } from '/@/constants/support/table-id-const';
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
* @Copyright 1024创新实验室 ( https://1024lab.net ),Since 2012
|
||||
-->
|
||||
<template>
|
||||
<a-modal :visible="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">
|
||||
<template #icon>
|
||||
<ReloadOutlined />
|
||||
@@ -31,7 +31,7 @@
|
||||
</template>
|
||||
<script setup>
|
||||
import { reactive, ref } from 'vue';
|
||||
import { reloadApi } from '/@/api/support/reload/reload-api';
|
||||
import { reloadApi } from '/@/api/support/reload-api';
|
||||
import { smartSentry } from '/@/lib/smart-sentry';
|
||||
defineExpose({
|
||||
showModal,
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
* @Copyright 1024创新实验室 ( https://1024lab.net ),Since 2012
|
||||
-->
|
||||
<template>
|
||||
<a-modal :visible="visible" title="生成单号" ok-text="生成" cancel-text="关闭" @ok="onSubmit" @cancel="onClose">
|
||||
<a-modal :open="visible" title="生成单号" ok-text="生成" cancel-text="关闭" @ok="onSubmit" @cancel="onClose">
|
||||
<a-form ref="formRef" :model="form" :rules="rules" :label-col="{ span: 5 }">
|
||||
<a-form-item label="业务">
|
||||
<a-input v-model:value="form.businessName" :disabled="true" />
|
||||
@@ -34,7 +34,7 @@
|
||||
<script setup>
|
||||
import { message } from 'ant-design-vue';
|
||||
import { reactive, ref } from 'vue';
|
||||
import { serialNumberApi } from '/@/api/support/serial-number/serial-number-api';
|
||||
import { serialNumberApi } from '/@/api/support/serial-number-api';
|
||||
import { SmartLoading } from '/@/components/framework/smart-loading';
|
||||
import _ from 'lodash';
|
||||
import { smartSentry } from '/@/lib/smart-sentry';
|
||||
|
||||
@@ -25,7 +25,12 @@
|
||||
</a-alert>
|
||||
|
||||
<a-row justify="end">
|
||||
<TableOperator class="smart-margin-bottom5 smart-margin-top5" v-model="columns" :tableId="TABLE_ID_CONST.SUPPORT.SERIAL_NUMBER" :refresh="ajaxQuery" />
|
||||
<TableOperator
|
||||
class="smart-margin-bottom5 smart-margin-top5"
|
||||
v-model="columns"
|
||||
:tableId="TABLE_ID_CONST.SUPPORT.SERIAL_NUMBER"
|
||||
:refresh="ajaxQuery"
|
||||
/>
|
||||
</a-row>
|
||||
|
||||
<a-table
|
||||
@@ -41,8 +46,8 @@
|
||||
<template #bodyCell="{ record, column }">
|
||||
<template v-if="column.dataIndex === 'action'">
|
||||
<div class="smart-table-operate">
|
||||
<a-button @click="generate(record)" v-privilege="'support:serial:number:generate'" type="link">生成</a-button>
|
||||
<a-button @click="showRecord(record.serialNumberId)" v-privilege="'support:serial:number:record'" type="link">查看记录</a-button>
|
||||
<a-button @click="generate(record)" v-privilege="'support:serialNumber:generate'" type="link">生成</a-button>
|
||||
<a-button @click="showRecord(record.serialNumberId)" v-privilege="'support:serialNumber:record'" type="link">查看记录</a-button>
|
||||
</div>
|
||||
</template>
|
||||
</template>
|
||||
@@ -55,14 +60,13 @@
|
||||
<SerialNumberRecordList ref="recordList" />
|
||||
</template>
|
||||
<script setup>
|
||||
import { onMounted, reactive, ref } from 'vue';
|
||||
import SerialNumberGenerateFormModal from './serial-number-generate-form-modal.vue';
|
||||
import SerialNumberRecordList from './serial-number-record-list.vue';
|
||||
import { serialNumberApi } from '/@/api/support/serial-number/serial-number-api';
|
||||
import TableOperator from '/@/components/support/table-operator/index.vue';
|
||||
import { TABLE_ID_CONST } from '/@/constants/support/table-id-const';
|
||||
import { smartSentry } from '/@/lib/smart-sentry';
|
||||
|
||||
import { onMounted, ref } from 'vue';
|
||||
import SerialNumberGenerateFormModal from './serial-number-generate-form-modal.vue';
|
||||
import SerialNumberRecordList from './serial-number-record-list.vue';
|
||||
import { serialNumberApi } from '/@/api/support/serial-number-api';
|
||||
import TableOperator from '/@/components/support/table-operator/index.vue';
|
||||
import { TABLE_ID_CONST } from '/@/constants/support/table-id-const';
|
||||
import { smartSentry } from '/@/lib/smart-sentry';
|
||||
|
||||
//------------------------ 表格渲染 ---------------------
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
* @Copyright 1024创新实验室 ( https://1024lab.net ),Since 2012
|
||||
-->
|
||||
<template>
|
||||
<a-modal :visible="visible" title="每日生成结果记录" width="60%" :footer="null" @cancel="onClose">
|
||||
<a-modal :open="visible" title="每日生成结果记录" width="60%" :footer="null" @cancel="onClose">
|
||||
<a-table size="small" :dataSource="tableData" :columns="columns" bordered :pagination="false">
|
||||
<template #bodyCell="{ text, record, column }">
|
||||
<template v-if="column.dataIndex === 'successFlag'">
|
||||
@@ -40,7 +40,7 @@
|
||||
</template>
|
||||
<script setup>
|
||||
import { reactive, ref } from 'vue';
|
||||
import { serialNumberApi } from '/@/api/support/serial-number/serial-number-api';
|
||||
import { serialNumberApi } from '/@/api/support/serial-number-api';
|
||||
import { PAGE_SIZE_OPTIONS } from '/@/constants/common-const';
|
||||
import { smartSentry } from '/@/lib/smart-sentry';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user