mirror of
https://gitee.com/durcframework/SOP.git
synced 2025-08-11 21:57:56 +08:00
5.0
This commit is contained in:
@@ -2,3 +2,8 @@ export enum StatusEnum {
|
||||
ENABLE = 1,
|
||||
DISABLE = 2
|
||||
}
|
||||
|
||||
export enum KeyFormatEnum {
|
||||
PKCS8 = 1,
|
||||
PKCS1 = 2
|
||||
}
|
||||
|
@@ -1,13 +1,14 @@
|
||||
import { computed, ref } from "vue";
|
||||
import { computed, type Ref, ref } from "vue";
|
||||
import {
|
||||
type ButtonsCallBackParams,
|
||||
type FieldValues,
|
||||
type OptionsRow,
|
||||
type PageInfo,
|
||||
type PlusColumn,
|
||||
useTable
|
||||
} from "plus-pro-components";
|
||||
import { ElMessage } from "element-plus";
|
||||
import { StatusEnum } from "@/model/enums";
|
||||
import { KeyFormatEnum, StatusEnum } from "@/model/enums";
|
||||
import { api } from "@/api/isvList";
|
||||
|
||||
const isAdd = ref(false);
|
||||
@@ -66,7 +67,7 @@ export const tableColumns: PlusColumn[] = [
|
||||
{
|
||||
label: "AppID",
|
||||
prop: "appId",
|
||||
width: 230
|
||||
width: 250
|
||||
},
|
||||
{
|
||||
label: "秘钥",
|
||||
@@ -76,7 +77,7 @@ export const tableColumns: PlusColumn[] = [
|
||||
{
|
||||
label: "角色",
|
||||
prop: "roleNames",
|
||||
width: 120
|
||||
width: 200
|
||||
},
|
||||
{
|
||||
label: "状态",
|
||||
@@ -102,11 +103,13 @@ export const tableColumns: PlusColumn[] = [
|
||||
},
|
||||
{
|
||||
label: "添加时间",
|
||||
prop: "addTime"
|
||||
prop: "addTime",
|
||||
width: 160
|
||||
},
|
||||
{
|
||||
label: "修改时间",
|
||||
prop: "updateTime"
|
||||
prop: "updateTime",
|
||||
width: 160
|
||||
}
|
||||
];
|
||||
// 表格按钮定义
|
||||
@@ -165,52 +168,82 @@ export const dlgTitle = ref("");
|
||||
// 表单值
|
||||
const editFormDataGen = () => {
|
||||
return {
|
||||
id: "",
|
||||
appId: "",
|
||||
status: "",
|
||||
remark: "",
|
||||
addTime: "",
|
||||
updateTime: ""
|
||||
id: 0,
|
||||
status: StatusEnum.ENABLE,
|
||||
keyFormat: KeyFormatEnum.PKCS8,
|
||||
remark: ""
|
||||
};
|
||||
};
|
||||
export const editFormData = ref<FieldValues>(editFormDataGen());
|
||||
export const editFormRules = {
|
||||
id: [{ required: true, message: "请输入id" }],
|
||||
appId: [{ required: true, message: "请输入appKey" }],
|
||||
status: [{ required: true, message: "请输入1启用,2禁用" }]
|
||||
export const editFormRules = {};
|
||||
|
||||
// options推荐写法
|
||||
// 1. 定义一个 `ref`数组
|
||||
const roleList: Ref<OptionsRow[]> = ref([]);
|
||||
// 2. 异步函数获取到值赋值到 `ref`
|
||||
const loadRole = async () => {
|
||||
//
|
||||
};
|
||||
loadRole();
|
||||
|
||||
// 表单内容
|
||||
export const editFormColumns: PlusColumn[] = [
|
||||
{
|
||||
label: "id",
|
||||
prop: "id",
|
||||
valueType: "copy"
|
||||
},
|
||||
{
|
||||
label: "AppID",
|
||||
prop: "appId",
|
||||
valueType: "copy"
|
||||
valueType: "copy",
|
||||
fieldProps: {
|
||||
disabled: true,
|
||||
placeholder: "自动生成"
|
||||
}
|
||||
},
|
||||
{
|
||||
label: "1启用,2禁用",
|
||||
label: "秘钥格式",
|
||||
prop: "keyFormat",
|
||||
valueType: "radio",
|
||||
options: [
|
||||
{
|
||||
label: "PKCS8(Java适用)",
|
||||
value: KeyFormatEnum.PKCS8
|
||||
},
|
||||
{
|
||||
label: "PKCS1(非Java适用)",
|
||||
value: KeyFormatEnum.PKCS1
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
label: "角色",
|
||||
prop: "roleCodes",
|
||||
valueType: "checkbox",
|
||||
// options推荐写法
|
||||
// 3. 用 computed 返回 ref 的 value
|
||||
options: computed(() => roleList.value)
|
||||
},
|
||||
{
|
||||
label: "状态",
|
||||
prop: "status",
|
||||
valueType: "copy"
|
||||
valueType: "radio",
|
||||
options: [
|
||||
{
|
||||
label: "启用",
|
||||
value: StatusEnum.ENABLE
|
||||
},
|
||||
{
|
||||
label: "禁用",
|
||||
value: StatusEnum.DISABLE
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
label: "备注",
|
||||
prop: "remark",
|
||||
valueType: "copy"
|
||||
},
|
||||
{
|
||||
label: "addTime",
|
||||
prop: "addTime",
|
||||
valueType: "copy"
|
||||
},
|
||||
{
|
||||
label: "updateTime",
|
||||
prop: "updateTime",
|
||||
valueType: "copy"
|
||||
valueType: "textarea",
|
||||
fieldProps: {
|
||||
maxlength: 300,
|
||||
showWordLimit: true,
|
||||
autosize: { minRows: 2, maxRows: 4 }
|
||||
}
|
||||
}
|
||||
];
|
||||
|
||||
|
@@ -77,7 +77,7 @@ export const showKeysFormColumns: PlusFormGroupRow[] = [
|
||||
|
||||
export const viewKeys = (row: any) => {
|
||||
const params = {
|
||||
isvInfoId: row.id
|
||||
isvId: row.id
|
||||
};
|
||||
api.viewKeys(params).then(resp => {
|
||||
showKeysFormData.value = resp.data;
|
||||
|
Reference in New Issue
Block a user