This commit is contained in:
孟帅
2023-04-10 15:31:08 +08:00
parent 075a12ce7e
commit 9ac036a542
35 changed files with 506 additions and 143 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "hotgo",
"version": "2.4.9",
"version": "2.5.3",
"author": {
"name": "MengShuai",
"email": "133814250@qq.com",

View File

@@ -264,7 +264,7 @@
const headerH = 64;
let paginationH = 2;
let marginH = 24;
if (!isBoolean(pagination)) {
if (!isBoolean(unref(pagination))) {
paginationEl = tableEl.querySelector('.n-data-table__pagination') as HTMLElement;
if (paginationEl) {
const offsetHeight = paginationEl.offsetHeight;

View File

@@ -21,7 +21,8 @@
ref="actionRef"
:actionColumn="actionColumn"
@update:checked-row-keys="onCheckedRow"
:scroll-x="1090"
:scroll-x="1800"
:resizeHeightOffset="-20000"
>
<template #tableTitle>
<n-button type="primary" @click="addTable">
@@ -157,10 +158,10 @@
const checkedIds = ref([]);
const actionColumn = reactive({
width: 220,
width: 150,
title: '操作',
key: 'action',
// fixed: 'right',
fixed: 'right',
render(record) {
return h(TableAction as any, {
style: 'button',

View File

@@ -26,8 +26,8 @@
ref="actionRef"
:actionColumn="actionColumn"
@update:checked-row-keys="onCheckedRow"
:scroll-x="1090"
:resizeHeightOffset="-10000"
:scroll-x="1800"
:resizeHeightOffset="-20000"
>
<template #tableTitle>
<n-button
@@ -312,10 +312,10 @@
let formParams = ref<any>(cloneDeep(resetFormParams));
const actionColumn = reactive({
width: 220,
width: 180,
title: '操作',
key: 'action',
// fixed: 'right',
fixed: 'right',
render(record) {
return h(TableAction as any, {
style: 'button',

View File

@@ -83,6 +83,6 @@ export const columns = [
{
title: '访问时间',
key: 'createdAt',
width: 150,
width: 180,
},
];

View File

@@ -20,7 +20,7 @@
ref="actionRef"
:actionColumn="actionColumn"
@update:checked-row-keys="onCheckedRow"
:scroll-x="1090"
:scroll-x="1800"
:resizeHeightOffset="-20000"
>
<template #tableTitle>
@@ -183,10 +183,10 @@
});
const actionColumn = reactive({
width: 220,
width: 150,
title: '操作',
key: 'action',
// fixed: 'right',
fixed: 'right',
render(record) {
return h(TableAction as any, {
style: 'button',

View File

@@ -24,8 +24,8 @@
ref="actionRef"
:actionColumn="actionColumn"
@update:checked-row-keys="onCheckedRow"
:scroll-x="1090"
:resizeHeightOffset="-10000"
:scroll-x="1800"
:resizeHeightOffset="-20000"
>
<template #tableTitle>
<n-button
@@ -82,10 +82,10 @@
const checkedIds = ref([]);
const actionColumn = reactive({
width: 300,
width: 150,
title: '操作',
key: 'action',
// fixed: 'right',
fixed: 'right',
render(record) {
return h(TableAction as any, {
style: 'button',

View File

@@ -23,7 +23,7 @@
ref="actionRef"
:actionColumn="actionColumn"
@update:checked-row-keys="onCheckedRow"
:scroll-x="1090"
:scroll-x="1800"
>
<template #tableTitle>
<n-button type="error" @click="batchDelete" :disabled="batchDeleteDisabled">
@@ -205,10 +205,10 @@
const actionRef = ref();
const actionColumn = reactive({
width: 220,
width: 120,
title: '操作',
key: 'action',
// fixed: 'right',
fixed: 'right',
render(record) {
return h(TableAction as any, {
style: 'button',
@@ -229,13 +229,7 @@
});
function onCheckedRow(rowKeys) {
console.log(rowKeys);
if (rowKeys.length > 0) {
batchDeleteDisabled.value = false;
} else {
batchDeleteDisabled.value = true;
}
batchDeleteDisabled.value = rowKeys.length <= 0;
checkedIds.value = rowKeys;
}

View File

@@ -12,7 +12,7 @@
:row-key="(row) => row.id"
ref="actionRef"
:actionColumn="actionColumn"
:scroll-x="1090"
:scroll-x="1800"
/>
</n-card>
</template>
@@ -58,10 +58,10 @@
const formParams = ref({});
const actionColumn = reactive({
width: 220,
width: 120,
title: '操作',
key: 'action',
// fixed: 'right',
fixed: 'right',
render(record) {
return h(TableAction as any, {
style: 'button',

View File

@@ -26,7 +26,7 @@
ref="actionRef"
:actionColumn="actionColumn"
@update:checked-row-keys="onCheckedRow"
:scroll-x="1090"
:scroll-x="1800"
:resizeHeightOffset="-10000"
size="small"
>
@@ -122,10 +122,10 @@
const showModal = ref(false);
const actionColumn = reactive({
width: 300,
width: 120,
title: '操作',
key: 'action',
// fixed: 'right',
fixed: 'right',
render(record) {
return h(TableAction as any, {
style: 'button',

View File

@@ -118,7 +118,7 @@ export const columns = [
{
title: '创建时间',
key: 'createdAt',
width: 150,
width: 180,
render: (rows, _) => {
return rows.createdAt;
},

View File

@@ -327,7 +327,7 @@
width: 220,
title: '操作',
key: 'action',
// fixed: 'right',
fixed: 'right',
render(record) {
return h(TableAction as any, {
style: 'button',

View File

@@ -37,12 +37,12 @@ export const columns = [
}
);
},
width: 150,
width: 200,
},
{
title: '角色编码',
key: 'key',
width: 150,
// width: 150,
},
// {
// title: '上级角色',
@@ -62,22 +62,22 @@ export const columns = [
}
);
},
width: 80,
// width: 80,
},
{
title: '排序',
key: 'sort',
width: 100,
// width: 100,
},
{
title: '备注',
key: 'remark',
width: 300,
// width: 300,
},
{
title: '状态',
key: 'status',
width: 80,
// width: 80,
render(row) {
return h(
NTag,

View File

@@ -131,8 +131,9 @@
<n-form-item label="自定义权限" path="customDept" v-if="dataForm.dataScope === 4">
<n-tree-select
multiple
key-field="id"
:options="deptList"
:default-value="dataForm.customDept"
v-model:value="dataForm.customDept"
:default-expand-all="true"
@update:value="handleUpdateDeptValue"
/>
@@ -221,7 +222,7 @@
width: 320,
title: '操作',
key: 'action',
// fixed: 'right',
fixed: 'right',
render(record) {
return h(TableAction, {
style: 'primary',
@@ -439,7 +440,8 @@
}
async function loadDeptList() {
deptList.value = await getDeptList({});
const tmp = await getDeptList({});
deptList.value = tmp?.list;
if (deptList.value === undefined || deptList.value === null) {
deptList.value = [];
}

View File

@@ -36,17 +36,17 @@
</n-form-item>
<n-divider title-placement="left">阿里云</n-divider>
<n-form-item label="AccessKeyID" path="smsAliyunAccessKeyID">
<n-input v-model:value="formValue.smsAliyunAccessKeyID" placeholder="" />
<n-form-item label="AccessKeyID" path="smsAliYunAccessKeyID">
<n-input v-model:value="formValue.smsAliYunAccessKeyID" placeholder="" />
<template #feedback
>应用key和密钥你可以通过 https://ram.console.aliyun.com/manage/ak 获取</template
>
</n-form-item>
<n-form-item label="AccessKeySecret" path="smsAliyunAccessKeySecret">
<n-form-item label="AccessKeySecret" path="smsAliYunAccessKeySecret">
<n-input
type="password"
v-model:value="formValue.smsAliyunAccessKeySecret"
v-model:value="formValue.smsAliYunAccessKeySecret"
show-password-on="click"
>
<template #password-visible-icon>
@@ -58,22 +58,83 @@
</n-input>
</n-form-item>
<n-form-item label="签名" path="smsAliyunSign">
<n-input v-model:value="formValue.smsAliyunSign" placeholder="" />
<n-form-item label="签名" path="smsAliYunSign">
<n-input v-model:value="formValue.smsAliYunSign" placeholder="" />
<template #feedback
>申请地址https://dysms.console.aliyun.com/domestic/text/sign</template
>
</n-form-item>
<n-form-item label="短信模板" path="smsAliyunTemplate">
<n-form-item label="短信模板" path="smsAliYunTemplate">
<n-dynamic-input
v-model:value="formValue.smsAliyunTemplate"
v-model:value="formValue.smsAliYunTemplate"
preset="pair"
key-placeholder="事件KEY"
value-placeholder="模板CODE"
/>
</n-form-item>
<n-divider title-placement="left">腾讯云</n-divider>
<n-form-item label="SecretId" path="smsTencentSecretId">
<n-input v-model:value="formValue.smsTencentSecretId" placeholder="" />
<template #feedback
>应用key和密钥你可以通过 https://ram.console.aliyun.com/manage/ak 获取</template
>
</n-form-item>
<n-form-item label="SecretKey" path="smsTencentSecretKey">
<n-input
type="password"
v-model:value="formValue.smsTencentSecretKey"
show-password-on="click"
>
<template #password-visible-icon>
<n-icon :size="16" :component="GlassesOutline" />
</template>
<template #password-invisible-icon>
<n-icon :size="16" :component="Glasses" />
</template>
</n-input>
</n-form-item>
<n-form-item label="接入地域域名" path="smsTencentEndpoint">
<n-input v-model:value="formValue.smsTencentEndpoint" placeholder="" />
<template #feedback
>默认就近地域接入域名为 sms.tencentcloudapi.com
也支持指定地域域名访问例如广州地域的域名为
sms.ap-guangzhou.tencentcloudapi.com</template
>
</n-form-item>
<n-form-item label="地域信息" path="smsTencentRegion">
<n-input v-model:value="formValue.smsTencentRegion" placeholder="" />
<template #feedback
>支持的地域列表参考
https://cloud.tencent.com/document/api/382/52071#.E5.9C.B0.E5.9F.9F.E5.88.97.E8.A1.A8</template
>
</n-form-item>
<n-form-item label="短信应用ID" path="smsTencentAppId">
<n-input v-model:value="formValue.smsTencentAppId" placeholder="" />
<template #feedback
>查看地址https://console.cloud.tencent.com/smsv2/app-manage</template
>
</n-form-item>
<n-form-item label="签名" path="smsTencentSign">
<n-input v-model:value="formValue.smsTencentSign" placeholder="" />
<template #feedback>查看地址https://console.cloud.tencent.com/smsv2/csms-sign</template>
</n-form-item>
<n-form-item label="短信模板" path="smsTencentTemplate">
<n-dynamic-input
v-model:value="formValue.smsTencentTemplate"
preset="pair"
key-placeholder="事件KEY"
value-placeholder="模板ID"
/>
</n-form-item>
<div>
<n-space>
<n-button type="primary" @click="formSubmit">保存更新</n-button>
@@ -163,13 +224,20 @@
const formValue = ref({
smsDrive: 'aliyun',
smsAliyunAccessKeyID: '',
smsAliyunAccessKeySecret: '',
smsAliyunSign: '',
smsAliyunTemplate: null,
smsMinInterval: 60,
smsMaxIpLimit: 10,
smsCodeExpire: 600,
smsAliYunAccessKeyID: '',
smsAliYunAccessKeySecret: '',
smsAliYunSign: '',
smsAliYunTemplate: null,
smsTencentSecretId: '',
smsTencentSecretKey: '',
smsTencentEndpoint: 'sms.tencentcloudapi.com',
smsTencentRegion: 'ap-guangzhou',
smsTencentAppId: '',
smsTencentSign: '',
smsTencentTemplate: null,
});
function sendTest() {
@@ -200,7 +268,8 @@
new Promise((_resolve, _reject) => {
getConfig({ group: group.value })
.then((res) => {
res.list.smsAliyunTemplate = JSON.parse(res.list.smsAliyunTemplate);
res.list.smsAliYunTemplate = JSON.parse(res.list.smsAliYunTemplate);
res.list.smsTencentTemplate = JSON.parse(res.list.smsTencentTemplate);
formValue.value = res.list;
})
.finally(() => {