fix: 关系配置
This commit is contained in:
parent
4b63114795
commit
e121ae9a81
|
@ -21,7 +21,6 @@
|
||||||
<j-input
|
<j-input
|
||||||
v-model:value="form.data.name"
|
v-model:value="form.data.name"
|
||||||
placeholder="请输入名称"
|
placeholder="请输入名称"
|
||||||
:maxlength="64"
|
|
||||||
/>
|
/>
|
||||||
</j-form-item>
|
</j-form-item>
|
||||||
<j-form-item
|
<j-form-item
|
||||||
|
@ -36,7 +35,6 @@
|
||||||
<j-input
|
<j-input
|
||||||
v-model:value="form.data.relation"
|
v-model:value="form.data.relation"
|
||||||
placeholder="请输入标识"
|
placeholder="请输入标识"
|
||||||
:maxlength="64"
|
|
||||||
:disabled="!!form.data.id"
|
:disabled="!!form.data.id"
|
||||||
/>
|
/>
|
||||||
</j-form-item>
|
</j-form-item>
|
||||||
|
@ -51,12 +49,14 @@
|
||||||
<j-select
|
<j-select
|
||||||
v-model:value="form.data.objectType"
|
v-model:value="form.data.objectType"
|
||||||
:disabled="!!form.data.id"
|
:disabled="!!form.data.id"
|
||||||
|
@change="() => (form.data.targetType = undefined)"
|
||||||
>
|
>
|
||||||
<j-select-option
|
<j-select-option
|
||||||
v-for="item in form.objectList"
|
v-for="item in form.objectList"
|
||||||
:value="item.id"
|
:value="item.id"
|
||||||
>{{ item.name }}</j-select-option
|
|
||||||
>
|
>
|
||||||
|
{{ item.name }}.
|
||||||
|
</j-select-option>
|
||||||
</j-select>
|
</j-select>
|
||||||
</j-form-item>
|
</j-form-item>
|
||||||
</j-col>
|
</j-col>
|
||||||
|
@ -73,17 +73,14 @@
|
||||||
<j-select-option
|
<j-select-option
|
||||||
v-for="item in targetList"
|
v-for="item in targetList"
|
||||||
:value="item.id"
|
:value="item.id"
|
||||||
>{{ item.name }}</j-select-option
|
|
||||||
>
|
>
|
||||||
|
{{ item.name }}
|
||||||
|
</j-select-option>
|
||||||
</j-select>
|
</j-select>
|
||||||
</j-form-item>
|
</j-form-item>
|
||||||
</j-col>
|
</j-col>
|
||||||
</j-row>
|
</j-row>
|
||||||
<j-form-item
|
<j-form-item name="description" label="说明">
|
||||||
name="description"
|
|
||||||
label="说明"
|
|
||||||
:rules="[{ max: 200, message: '最多可输入200个字符' }]"
|
|
||||||
>
|
|
||||||
<j-textarea
|
<j-textarea
|
||||||
v-model:value="form.data.description"
|
v-model:value="form.data.description"
|
||||||
placeholder="请输入说明"
|
placeholder="请输入说明"
|
||||||
|
@ -134,7 +131,8 @@ const form = reactive({
|
||||||
data: props.data,
|
data: props.data,
|
||||||
rules: {
|
rules: {
|
||||||
checkRelation: (_rule: Rule, value: string): any => {
|
checkRelation: (_rule: Rule, value: string): any => {
|
||||||
if (!value) return '';
|
if (!value) return Promise.reject('');
|
||||||
|
else if (value.length > 64) return Promise.reject('');
|
||||||
const reg = new RegExp('^[0-9a-zA-Z_\\\\-]+$');
|
const reg = new RegExp('^[0-9a-zA-Z_\\\\-]+$');
|
||||||
|
|
||||||
return reg.test(value)
|
return reg.test(value)
|
||||||
|
@ -172,7 +170,7 @@ type formType = {
|
||||||
name: string;
|
name: string;
|
||||||
relation: string;
|
relation: string;
|
||||||
objectType: string;
|
objectType: string;
|
||||||
targetType: string;
|
targetType: string | undefined;
|
||||||
description: string;
|
description: string;
|
||||||
id?: string;
|
id?: string;
|
||||||
};
|
};
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
<template #headerTitle>
|
<template #headerTitle>
|
||||||
<PermissionButton
|
<PermissionButton
|
||||||
type="primary"
|
type="primary"
|
||||||
:uhasPermission="`${permission}:add`"
|
:hasPermission="`${permission}:add`"
|
||||||
@click="table.openDialog(undefined)"
|
@click="table.openDialog(undefined)"
|
||||||
>
|
>
|
||||||
<AIcon type="PlusOutlined" />新增
|
<AIcon type="PlusOutlined" />新增
|
||||||
|
@ -28,7 +28,7 @@
|
||||||
<template #action="slotProps">
|
<template #action="slotProps">
|
||||||
<j-space :size="16">
|
<j-space :size="16">
|
||||||
<PermissionButton
|
<PermissionButton
|
||||||
:uhasPermission="`${permission}:update`"
|
:hasPermission="`${permission}:update`"
|
||||||
type="link"
|
type="link"
|
||||||
:tooltip="{
|
:tooltip="{
|
||||||
title: '编辑',
|
title: '编辑',
|
||||||
|
@ -39,7 +39,7 @@
|
||||||
</PermissionButton>
|
</PermissionButton>
|
||||||
|
|
||||||
<PermissionButton
|
<PermissionButton
|
||||||
:uhasPermission="`${permission}:delete`"
|
:hasPermission="`${permission}:delete`"
|
||||||
type="link"
|
type="link"
|
||||||
:tooltip="{ title: '删除' }"
|
:tooltip="{ title: '删除' }"
|
||||||
:popConfirm="{
|
:popConfirm="{
|
||||||
|
|
Loading…
Reference in New Issue