Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
XieYongHong 2023-07-07 17:25:00 +08:00
commit 7c2f4c410c
12 changed files with 50 additions and 35 deletions

View File

@ -1,7 +1,7 @@
<!-- 第三方账户绑定 --> <!-- 第三方账户绑定 -->
<template> <template>
<div class='page-container'> <div class='page-container'>
<div class='content'> <div class='content-bind'>
<div class='title'>第三方账户绑定</div> <div class='title'>第三方账户绑定</div>
<!-- 已登录-绑定三方账号 --> <!-- 已登录-绑定三方账号 -->
<template v-if='!!token'> <template v-if='!!token'>
@ -323,7 +323,7 @@ onMounted(() => {
align-items: center; align-items: center;
justify-content: center; justify-content: center;
.content { .content-bind {
box-sizing: border-box; box-sizing: border-box;
width: 928px; width: 928px;
min-height: 510px; min-height: 510px;

View File

@ -41,7 +41,7 @@
:value=" :value="
form.roleList.map((item) => item.name).join(',') form.roleList.map((item) => item.name).join(',')
" "
placeholder="请输入角色" placeholder="请选择角色"
disabled disabled
/> />
</j-form-item> </j-form-item>
@ -52,7 +52,7 @@
:value=" :value="
form.orgList.map((item) => item.name).join(',') form.orgList.map((item) => item.name).join(',')
" "
placeholder="请输入组织" placeholder="请选择组织"
disabled disabled
/> />
</j-form-item> </j-form-item>

View File

@ -49,7 +49,7 @@
<j-form-item <j-form-item
:name="['table', index, 'value']" :name="['table', index, 'value']"
:rules="{ :rules="{
required: true, required: record.required,
message: '该字段为必填字段', message: '该字段为必填字段',
}" }"
has-feedback has-feedback
@ -172,6 +172,7 @@ const newFunctions = computed(() => {
? tableItem['json']?.['properties'][0] ? tableItem['json']?.['properties'][0]
: undefined, : undefined,
value: undefined, value: undefined,
required: tableItem.expands?.required
}); });
} }

View File

@ -22,7 +22,7 @@
<ValueRender <ValueRender
type="table" type="table"
:data="_props.data" :data="_props.data"
:value="{ formatValue: record.value }" :value="{ ...record }"
/> />
</template> </template>
<template v-else-if="column.key === 'action'"> <template v-else-if="column.key === 'action'">

View File

@ -95,6 +95,7 @@ const columns = [
title: '名称', title: '名称',
dataIndex: 'name', dataIndex: 'name',
key: 'name', key: 'name',
ellipsis: true
}, },
{ {
title: '值', title: '值',

View File

@ -13,6 +13,12 @@ export const USER_CENTER_MENU_DATA = {
sortIndex: 9999, sortIndex: 9999,
granted: true, granted: true,
owner: 'iot', owner: 'iot',
permissions: [
{
permission: 'system_config',
actions: ['query'],
},
],
buttons: [ buttons: [
{ {
id: USER_CENTER_MENU_BUTTON_CODE, id: USER_CENTER_MENU_BUTTON_CODE,

View File

@ -15,26 +15,26 @@
:rules='IdRules' :rules='IdRules'
> >
<template #label> <template #label>
<span> <span>
插件ID 插件ID
<j-tooltip <j-tooltip
title='若不填写系统将自动生成唯一ID' title='若不填写系统将自动生成唯一ID'
> >
<AIcon <AIcon
type='QuestionCircleOutlined' type='QuestionCircleOutlined'
style='margin-left: 2px' style='margin-left: 2px'
/> />
</j-tooltip> </j-tooltip>
</span> </span>
</template> </template>
<j-input v-model:value='modelRef.id' :disabled='!!data.id' /> <j-input placeholder="请输入插件ID" v-model:value='modelRef.id' :disabled='!!data.id' />
</j-form-item> </j-form-item>
<j-form-item <j-form-item
label='插件名称' label='插件名称'
name='name' name='name'
:rules="nameRules" :rules="nameRules"
> >
<j-input v-model:value='modelRef.name' /> <j-input placeholder="请输入插件名称" v-model:value='modelRef.name' />
</j-form-item> </j-form-item>
<j-form-item <j-form-item
label='文件' label='文件'
@ -135,6 +135,7 @@ const handleSave = async () => {
const data = await formRef.value.validate() const data = await formRef.value.validate()
if (data) { if (data) {
loading.value = true loading.value = true
modelRef.id = modelRef.id ? modelRef.id : null;
const resp = props.data.id ? await update(modelRef).catch(() => { success: false }) : await add(modelRef).catch(() => { success: false }) const resp = props.data.id ? await update(modelRef).catch(() => { success: false }) : await add(modelRef).catch(() => { success: false })
loading.value = false loading.value = false
if (resp.success) { if (resp.success) {

View File

@ -353,7 +353,7 @@ const form = reactive<formType>({
title: [ title: [
{ {
required: true, required: true,
message: '名称必填', message: '请输入系统名称',
}, },
{ {
max: 64, max: 64,

View File

@ -199,8 +199,8 @@
validator: checkName, validator: checkName,
}, },
{ {
pattern: /^\w+$/, pattern: /^[a-zA-Z0-9_\u4e00-\u9fa5]+$/,
message: '名称只能由数字、字母、下划线、中划线组成', message: '名称只能由英文、汉字、下划线、数字组成',
trigger: 'change', trigger: 'change',
}, },
]" ]"
@ -445,8 +445,8 @@ watch(
}); });
leftData.treeData = [ leftData.treeData = [
{ {
title: info.data.shareConfig.schema, title: info.data.shareConfig?.schema,
key: info.data.shareConfig.schema, key: info.data.shareConfig?.schema,
root: true, root: true,
children: list.map((item) => ({ children: list.map((item) => ({
title: item.name, title: item.name,
@ -461,8 +461,8 @@ watch(
} else { } else {
leftData.treeData = [ leftData.treeData = [
{ {
title: info.data.shareConfig.schema, title: info.data.shareConfig?.schema,
key: info.data.shareConfig.schema, key: info.data.shareConfig?.schema,
root: true, root: true,
children: leftData.sourceTree.map((item) => ({ children: leftData.sourceTree.map((item) => ({
title: item.name, title: item.name,

View File

@ -181,7 +181,7 @@ const variableRef = ref();
const formRef = ref(); const formRef = ref();
const _variableDefinitions = computed(() => { const _variableDefinitions = computed(() => {
const arr = ['user', 'org']; const arr = ['user', 'org', 'tag'];
return variable.value.filter((item: any) => { return variable.value.filter((item: any) => {
const _type = item.expands?.businessType || item.type || ''; const _type = item.expands?.businessType || item.type || '';
return !arr.includes(_type); return !arr.includes(_type);
@ -189,7 +189,7 @@ const _variableDefinitions = computed(() => {
}); });
const handleVariable = (obj: any) => { const handleVariable = (obj: any) => {
const arr = ['user', 'org']; const arr = ['user', 'org', 'tag'];
const _array = variable.value const _array = variable.value
.filter((item: any) => { .filter((item: any) => {
const _type = item.expands?.businessType || item.type || ''; const _type = item.expands?.businessType || item.type || '';

View File

@ -6,6 +6,7 @@
@ok="confirm" @ok="confirm"
@cancel="emits('update:visible', false)" @cancel="emits('update:visible', false)"
:confirmLoading="loading" :confirmLoading="loading"
destroyOnClose
class="edit-dialog-container" class="edit-dialog-container"
> >
<j-form ref="formRef" :model="form.data" layout="vertical"> <j-form ref="formRef" :model="form.data" layout="vertical">
@ -131,6 +132,7 @@ import {
editPermission_api, editPermission_api,
addPermission_api, addPermission_api,
} from '@/api/system/permission'; } from '@/api/system/permission';
import { cloneDeep } from 'lodash-es';
const defaultAction = [ const defaultAction = [
{ action: 'query', name: '查询', describe: '查询' }, { action: 'query', name: '查询', describe: '查询' },
@ -144,7 +146,7 @@ const props = defineProps<{
}>(); }>();
const loading = ref(false); const loading = ref(false);
const dialogTitle = computed(() => (props.data.id ? '编辑' : '新增')); const dialogTitle = computed(() => (props.data?.id ? '编辑' : '新增'));
const confirm = () => { const confirm = () => {
loading.value = true; loading.value = true;
formRef.value formRef.value
@ -165,7 +167,7 @@ const form = reactive({
data: { data: {
name: '', name: '',
id: '', id: '',
...props.data, ...props?.data,
actionTableData: computed(() => { actionTableData: computed(() => {
const startIndex = (pager.current - 1) * pager.pageSize; const startIndex = (pager.current - 1) * pager.pageSize;
const endIndex = Math.min( const endIndex = Math.min(
@ -183,7 +185,7 @@ const form = reactive({
if (!id) return Promise.reject('请输入标识(ID)'); if (!id) return Promise.reject('请输入标识(ID)');
else if (id.length > 64) else if (id.length > 64)
return Promise.reject('最多可输入64个字符'); return Promise.reject('最多可输入64个字符');
else if (props.data.id && props.data.id === form.data.id) else if (props.data?.id && props.data?.id === form.data?.id)
return Promise.resolve(); return Promise.resolve();
else { else {
const resp: any = await checkId_api({ id }); const resp: any = await checkId_api({ id });
@ -197,7 +199,7 @@ const form = reactive({
...form.data, ...form.data,
actions: table.data.filter((item: any) => item.action && item.name), actions: table.data.filter((item: any) => item.action && item.name),
}; };
const api = props.data.id ? editPermission_api : addPermission_api; const api = props.data?.id ? editPermission_api : addPermission_api;
return api(params); return api(params);
}, },
@ -236,7 +238,7 @@ const table = reactive({
key: 'act', key: 'act',
}, },
], ],
data: props.data.id ? [...(props.data.actions || [])] : [...defaultAction], data: props.data?.id ? cloneDeep([...(props.data?.actions || [])]) : [...defaultAction],
clickRemove: (index: number) => { clickRemove: (index: number) => {
pager.total -= 1; pager.total -= 1;
table.data.splice(index, 1); table.data.splice(index, 1);

View File

@ -94,7 +94,11 @@
</j-row> </j-row>
<j-row :gutter="24" v-if="form.IsShow('add', 'edit')"> <j-row :gutter="24" v-if="form.IsShow('add', 'edit')">
<j-col :span="12"> <j-col :span="12">
<j-form-item name="roleIdList" label="角色" class="flex"> <j-form-item name="roleIdList" label="角色" class="flex"
:rules="[
{ required: true, message: '请选择角色' },
]"
>
<j-select <j-select
v-model:value="form.data.roleIdList" v-model:value="form.data.roleIdList"
mode="multiple" mode="multiple"