feat(app): 应用表单加性质 Switch+技术标识,列表加性质列且基石行模块/推送/删除置灰(消息卡片方案 B1)
This commit is contained in:
Vendored
+6
@@ -223,6 +223,8 @@ export interface ApplicationInfoRequest {
|
|||||||
name: string;
|
name: string;
|
||||||
categoryId: number;
|
categoryId: number;
|
||||||
desc?: string;
|
desc?: string;
|
||||||
|
appCode?: string;
|
||||||
|
appNature?: string;
|
||||||
clients?: number[];
|
clients?: number[];
|
||||||
pcUrl?: string;
|
pcUrl?: string;
|
||||||
pcIcon?: string;
|
pcIcon?: string;
|
||||||
@@ -230,6 +232,7 @@ export interface ApplicationInfoRequest {
|
|||||||
appIcon?: string;
|
appIcon?: string;
|
||||||
officialAccountUrl?: string;
|
officialAccountUrl?: string;
|
||||||
dingtalkUrl?: string;
|
dingtalkUrl?: string;
|
||||||
|
miniprogramUrl?: string;
|
||||||
}
|
}
|
||||||
export interface SysUserMoveRequest {
|
export interface SysUserMoveRequest {
|
||||||
userId: number;
|
userId: number;
|
||||||
@@ -766,6 +769,8 @@ export interface ApplicationInfoVo {
|
|||||||
desc?: string;
|
desc?: string;
|
||||||
appKey?: number;
|
appKey?: number;
|
||||||
appSecret?: string;
|
appSecret?: string;
|
||||||
|
appCode?: string;
|
||||||
|
appNature?: string;
|
||||||
clients?: number[];
|
clients?: number[];
|
||||||
pcUrl?: string;
|
pcUrl?: string;
|
||||||
pcIcon?: string;
|
pcIcon?: string;
|
||||||
@@ -773,6 +778,7 @@ export interface ApplicationInfoVo {
|
|||||||
appIcon?: string;
|
appIcon?: string;
|
||||||
officialAccountUrl?: string;
|
officialAccountUrl?: string;
|
||||||
dingtalkUrl?: string;
|
dingtalkUrl?: string;
|
||||||
|
miniprogramUrl?: string;
|
||||||
}
|
}
|
||||||
export interface BasePageResultApplicationInfoVo {
|
export interface BasePageResultApplicationInfoVo {
|
||||||
total?: number;
|
total?: number;
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ let onSuccessCallback: (() => void) | null = null;
|
|||||||
// useForm 托管提交
|
// useForm 托管提交
|
||||||
const { form, loading: submitting, send: sendForm, onSuccess, onError } = useForm(
|
const { form, loading: submitting, send: sendForm, onSuccess, onError } = useForm(
|
||||||
(dto) => Apis.AppSettings.addApp({ data: dto }),
|
(dto) => Apis.AppSettings.addApp({ data: dto }),
|
||||||
{ initialForm: { name: '', categoryId: undefined, desc: '', clients: [], pcUrl: '', pcIcon: '', appUrl: '', appIcon: '', officialAccountUrl: '', dingtalkUrl: '' }, resetAfterSubmiting: true }
|
{ initialForm: { name: '', categoryId: undefined, desc: '', appCode: '', appNature: 'BUSINESS', clients: [], pcUrl: '', pcIcon: '', appUrl: '', appIcon: '', officialAccountUrl: '', dingtalkUrl: '' }, resetAfterSubmiting: true }
|
||||||
);
|
);
|
||||||
|
|
||||||
onSuccess(() => {
|
onSuccess(() => {
|
||||||
@@ -50,6 +50,8 @@ async function handleSubmit(formData: Record<string, any>) {
|
|||||||
name: formData.name,
|
name: formData.name,
|
||||||
categoryId: formData.categoryId,
|
categoryId: formData.categoryId,
|
||||||
desc: formData.desc,
|
desc: formData.desc,
|
||||||
|
appCode: formData.appCode,
|
||||||
|
appNature: formData.appNature,
|
||||||
clients: formData.clients,
|
clients: formData.clients,
|
||||||
pcUrl: formData.pcUrl,
|
pcUrl: formData.pcUrl,
|
||||||
pcIcon: formData.pcIcon,
|
pcIcon: formData.pcIcon,
|
||||||
|
|||||||
@@ -33,6 +33,21 @@
|
|||||||
</Col>
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
|
|
||||||
|
<!-- 应用性质 / 技术标识(学校模式隐藏——性质与技术标识均为平台主数据) -->
|
||||||
|
<Row v-if="!schoolMode">
|
||||||
|
<Col span="12">
|
||||||
|
<FormItem label="应用性质:">
|
||||||
|
<Switch v-model="natureBase" size="small" />
|
||||||
|
<span class="nature-hint">{{ natureBase ? '基石应用(不进开通/授权/模块管理)' : '业务应用' }}</span>
|
||||||
|
</FormItem>
|
||||||
|
</Col>
|
||||||
|
<Col span="12">
|
||||||
|
<FormItem label="技术标识:" prop="appCode">
|
||||||
|
<Input v-model="form.appCode" placeholder="如 notice(= 部署名称,创建后尽量不改)" />
|
||||||
|
</FormItem>
|
||||||
|
</Col>
|
||||||
|
</Row>
|
||||||
|
|
||||||
<!-- 第三行:appKey / appSecret(编辑模式且非学校模式才显示) -->
|
<!-- 第三行:appKey / appSecret(编辑模式且非学校模式才显示) -->
|
||||||
<Row v-if="isEdit && !schoolMode">
|
<Row v-if="isEdit && !schoolMode">
|
||||||
<Col span="12">
|
<Col span="12">
|
||||||
@@ -173,6 +188,8 @@ const defaultForm = (): Record<string, any> => ({
|
|||||||
desc: '',
|
desc: '',
|
||||||
appKey: null,
|
appKey: null,
|
||||||
appSecret: '',
|
appSecret: '',
|
||||||
|
appCode: '',
|
||||||
|
appNature: 'BUSINESS',
|
||||||
clients: [] as number[],
|
clients: [] as number[],
|
||||||
pcUrl: '',
|
pcUrl: '',
|
||||||
pcIcon: '',
|
pcIcon: '',
|
||||||
@@ -221,12 +238,22 @@ const clientOptions = [
|
|||||||
{ value: 32, label: '钉钉' },
|
{ value: 32, label: '钉钉' },
|
||||||
];
|
];
|
||||||
|
|
||||||
|
/* ---------- 应用性质 Switch(开=BASE 基石 / 关=BUSINESS 业务) ---------- */
|
||||||
|
const natureBase = computed({
|
||||||
|
get: () => form.appNature === 'BASE',
|
||||||
|
set: (val: boolean) => { form.appNature = val ? 'BASE' : 'BUSINESS'; },
|
||||||
|
});
|
||||||
|
|
||||||
/* ---------- 校验规则(学校模式不校验 categoryId——类型字段不展示且不可改) ---------- */
|
/* ---------- 校验规则(学校模式不校验 categoryId——类型字段不展示且不可改) ---------- */
|
||||||
const rules = computed(() => ({
|
const rules = computed(() => ({
|
||||||
name: [{ required: true, message: '请输入应用名称', trigger: 'blur' }],
|
name: [{ required: true, message: '请输入应用名称', trigger: 'blur' }],
|
||||||
...(props.schoolMode ? {} : {
|
...(props.schoolMode ? {} : {
|
||||||
categoryId: [{ required: true, type: 'number' as const, message: '请选择应用类型', trigger: 'change' }],
|
categoryId: [{ required: true, type: 'number' as const, message: '请选择应用类型', trigger: 'change' }],
|
||||||
}),
|
}),
|
||||||
|
// 技术标识仅新增必填(后端 Create 组同口径);编辑留空 = 保持原值(存量孤儿行允许继续观察)
|
||||||
|
...((props.schoolMode || props.isEdit) ? {} : {
|
||||||
|
appCode: [{ required: true, message: '请输入技术标识', trigger: 'blur' }],
|
||||||
|
}),
|
||||||
}));
|
}));
|
||||||
|
|
||||||
/* ---------- 提交 ---------- */
|
/* ---------- 提交 ---------- */
|
||||||
@@ -348,4 +375,11 @@ function onVisibleChange(val: boolean) {
|
|||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 应用性质说明文字 */
|
||||||
|
.nature-hint {
|
||||||
|
margin-left: 8px;
|
||||||
|
color: #808695;
|
||||||
|
font-size: 12px;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -168,18 +168,26 @@ const columns = [
|
|||||||
return h("span", arr.map((v) => map[v] ?? v).join("、"));
|
return h("span", arr.map((v) => map[v] ?? v).join("、"));
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title: "性质",
|
||||||
|
key: "appNature",
|
||||||
|
width: 80,
|
||||||
|
render: (h: any, { row }: any) => h("span", row.appNature === "BASE" ? "基石" : "业务"),
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: "操作",
|
title: "操作",
|
||||||
key: "action",
|
key: "action",
|
||||||
align: 'center',
|
align: 'center',
|
||||||
width: 280,
|
width: 280,
|
||||||
render: (h: any, { row }: any) => {
|
render: (h: any, { row }: any) => {
|
||||||
// SCHOOL 模式:仅编辑(名称/描述/图标,写学校覆盖表);模块管理/推送设置/删除全部隐藏
|
// SCHOOL 模式:仅编辑(名称/描述/图标,写学校覆盖表);模块管理/推送设置/删除全部隐藏。
|
||||||
|
// 基石应用(app_nature=BASE)只做身份注册:模块/推送/删除置灰,「编辑」保持可用(密钥轮换入口)
|
||||||
|
const base = row.appNature === "BASE";
|
||||||
const actions = [$utils.operatingTextHandle(h, '编辑', '', () => handleEdit(row))];
|
const actions = [$utils.operatingTextHandle(h, '编辑', '', () => handleEdit(row))];
|
||||||
if (!isSchoolMode.value) {
|
if (!isSchoolMode.value) {
|
||||||
actions.push($utils.operatingTextHandle(h, '模块管理', '', () => goModuleManage(row)));
|
actions.push($utils.operatingTextHandle(h, '模块管理', '', () => goModuleManage(row), base));
|
||||||
actions.push($utils.operatingTextHandle(h, '推送设置', '', () => openPushSetting(row)));
|
actions.push($utils.operatingTextHandle(h, '推送设置', '', () => openPushSetting(row), base));
|
||||||
actions.push($utils.operatingTextHandle(h, '删除', 'text-error', () => handleDelete(row)));
|
actions.push($utils.operatingTextHandle(h, '删除', 'text-error', () => handleDelete(row), base));
|
||||||
}
|
}
|
||||||
return actions;
|
return actions;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ const { form, loading: submitting, send: sendForm, onSuccess, onError } = useFor
|
|||||||
data: dto,
|
data: dto,
|
||||||
params: props.schoolId != null ? { schoolId: props.schoolId } : undefined,
|
params: props.schoolId != null ? { schoolId: props.schoolId } : undefined,
|
||||||
}),
|
}),
|
||||||
{ initialForm: { id: null, name: '', categoryId: undefined, desc: '', clients: [], pcUrl: '', pcIcon: '', appUrl: '', appIcon: '', officialAccountUrl: '', dingtalkUrl: '' }, resetAfterSubmiting: true }
|
{ initialForm: { id: null, name: '', categoryId: undefined, desc: '', appCode: '', appNature: 'BUSINESS', clients: [], pcUrl: '', pcIcon: '', appUrl: '', appIcon: '', officialAccountUrl: '', dingtalkUrl: '' }, resetAfterSubmiting: true }
|
||||||
);
|
);
|
||||||
|
|
||||||
onSuccess(() => {
|
onSuccess(() => {
|
||||||
@@ -80,6 +80,8 @@ async function handleSubmit(formData: Record<string, any>) {
|
|||||||
name: formData.name,
|
name: formData.name,
|
||||||
categoryId: formData.categoryId,
|
categoryId: formData.categoryId,
|
||||||
desc: formData.desc,
|
desc: formData.desc,
|
||||||
|
appCode: formData.appCode,
|
||||||
|
appNature: formData.appNature,
|
||||||
clients: formData.clients,
|
clients: formData.clients,
|
||||||
pcUrl: formData.pcUrl,
|
pcUrl: formData.pcUrl,
|
||||||
pcIcon: formData.pcIcon,
|
pcIcon: formData.pcIcon,
|
||||||
|
|||||||
Reference in New Issue
Block a user