feat(web): 增加权属管理界面
This commit is contained in:
@@ -1,26 +1,26 @@
|
|||||||
const information = {
|
const information = {
|
||||||
debug: false,
|
debug: false,
|
||||||
// baseUrl: '',
|
// baseUrl: '',
|
||||||
baseUrl: 'http://127.0.0.1:20080',
|
baseUrl: 'http://127.0.0.1:20080',
|
||||||
title: '可信供给中心',
|
title: '可信供给中心',
|
||||||
}
|
}
|
||||||
|
|
||||||
export function useAmis(amisObject) {
|
export function useAmis(amisObject) {
|
||||||
document.title = information.title
|
document.title = information.title
|
||||||
let amis = amisRequire('amis/embed')
|
let amis = amisRequire('amis/embed')
|
||||||
amis.embed(
|
amis.embed(
|
||||||
'#app',
|
'#app',
|
||||||
amisObject(information),
|
amisObject(information),
|
||||||
{
|
{
|
||||||
data: {
|
data: {
|
||||||
base: information.baseUrl,
|
base: information.baseUrl,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
theme: 'antd',
|
theme: 'antd',
|
||||||
enableAMISDebug: information.debug,
|
enableAMISDebug: information.debug,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
export function crudCommonOptions() {
|
export function crudCommonOptions() {
|
||||||
@@ -202,4 +202,11 @@ export const role = {
|
|||||||
export const administratorOnly = roleCheck([role.administrator])
|
export const administratorOnly = roleCheck([role.administrator])
|
||||||
export const checkerOnly = roleCheck([role.administrator, role.checker])
|
export const checkerOnly = roleCheck([role.administrator, role.checker])
|
||||||
export const userOnly = roleCheck([role.administrator, role.provider, role.customer])
|
export const userOnly = roleCheck([role.administrator, role.provider, role.customer])
|
||||||
|
export const providerOnly = roleCheck([role.administrator, role.provider])
|
||||||
|
export const customerOnly = roleCheck([role.administrator, role.customer])
|
||||||
|
|
||||||
|
|
||||||
|
export const formInputClearable = {
|
||||||
|
clearable: true,
|
||||||
|
clearValueOnEmpty: true,
|
||||||
|
}
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
textarea {
|
||||||
|
resize: none !important;
|
||||||
|
}
|
||||||
@@ -0,0 +1,48 @@
|
|||||||
|
import './dialog-permission.css'
|
||||||
|
import {horizontalFormOptions} from "../constants.js";
|
||||||
|
|
||||||
|
function detailForm() {
|
||||||
|
return {
|
||||||
|
id: 'resource_data_form',
|
||||||
|
type: 'form',
|
||||||
|
...horizontalFormOptions(),
|
||||||
|
horizontal: {
|
||||||
|
left: 2,
|
||||||
|
},
|
||||||
|
body: [
|
||||||
|
{
|
||||||
|
type: 'hidden',
|
||||||
|
name: 'id',
|
||||||
|
},
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export function permissionAddDialog() {
|
||||||
|
return {
|
||||||
|
actionType: 'dialog',
|
||||||
|
dialog: {
|
||||||
|
title: '新增确权申请',
|
||||||
|
size: 'md',
|
||||||
|
actions: [
|
||||||
|
{
|
||||||
|
type: 'reset',
|
||||||
|
label: '重置',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'submit',
|
||||||
|
label: '确定',
|
||||||
|
level: 'primary',
|
||||||
|
}
|
||||||
|
],
|
||||||
|
body: {
|
||||||
|
debug: true,
|
||||||
|
...detailForm(),
|
||||||
|
// api: apiPost('${base}/data_resource/save'),
|
||||||
|
data: {
|
||||||
|
add: true,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -2,17 +2,13 @@ import './dialog-resource.css'
|
|||||||
import {
|
import {
|
||||||
apiGet,
|
apiGet,
|
||||||
apiPost,
|
apiPost,
|
||||||
|
formInputClearable,
|
||||||
horizontalFormOptions,
|
horizontalFormOptions,
|
||||||
inputFileFormItemCommonOptions,
|
inputFileFormItemCommonOptions,
|
||||||
size1GB,
|
size1GB,
|
||||||
size500MB
|
size500MB
|
||||||
} from "../constants.js";
|
} from "../constants.js";
|
||||||
|
|
||||||
const clearable = {
|
|
||||||
clearable: true,
|
|
||||||
clearValueOnEmpty: true,
|
|
||||||
}
|
|
||||||
|
|
||||||
function inputFileFormItemUpdateFieldOptions(target) {
|
function inputFileFormItemUpdateFieldOptions(target) {
|
||||||
let value = {}
|
let value = {}
|
||||||
value[target] = '${event.data.value}'
|
value[target] = '${event.data.value}'
|
||||||
@@ -51,13 +47,13 @@ function detailForm() {
|
|||||||
name: 'name',
|
name: 'name',
|
||||||
label: '资源名称',
|
label: '资源名称',
|
||||||
required: true,
|
required: true,
|
||||||
...clearable,
|
...formInputClearable,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'textarea',
|
type: 'textarea',
|
||||||
name: 'description',
|
name: 'description',
|
||||||
label: '资源描述',
|
label: '资源描述',
|
||||||
...clearable,
|
...formInputClearable,
|
||||||
showCounter: true,
|
showCounter: true,
|
||||||
trimContents: true,
|
trimContents: true,
|
||||||
minRows: 2,
|
minRows: 2,
|
||||||
@@ -90,19 +86,19 @@ function detailForm() {
|
|||||||
label: 'API地址',
|
label: 'API地址',
|
||||||
name: 'apiUrl',
|
name: 'apiUrl',
|
||||||
required: true,
|
required: true,
|
||||||
...clearable,
|
...formInputClearable,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'input-text',
|
type: 'input-text',
|
||||||
label: '用户名',
|
label: '用户名',
|
||||||
name: 'apiUsername',
|
name: 'apiUsername',
|
||||||
...clearable,
|
...formInputClearable,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'input-password',
|
type: 'input-password',
|
||||||
label: '密码',
|
label: '密码',
|
||||||
name: 'apiPassword',
|
name: 'apiPassword',
|
||||||
...clearable,
|
...formInputClearable,
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@@ -149,19 +145,19 @@ function detailForm() {
|
|||||||
label: 'JDBC',
|
label: 'JDBC',
|
||||||
name: 'databaseJdbc',
|
name: 'databaseJdbc',
|
||||||
required: true,
|
required: true,
|
||||||
...clearable,
|
...formInputClearable,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'input-text',
|
type: 'input-text',
|
||||||
label: '用户名',
|
label: '用户名',
|
||||||
name: 'databaseUsername',
|
name: 'databaseUsername',
|
||||||
...clearable,
|
...formInputClearable,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'input-password',
|
type: 'input-password',
|
||||||
label: '密码',
|
label: '密码',
|
||||||
name: 'databasePassword',
|
name: 'databasePassword',
|
||||||
...clearable,
|
...formInputClearable,
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@@ -210,33 +206,33 @@ function detailForm() {
|
|||||||
label: 'FTP地址',
|
label: 'FTP地址',
|
||||||
name: 'ftpUrl',
|
name: 'ftpUrl',
|
||||||
required: true,
|
required: true,
|
||||||
...clearable,
|
...formInputClearable,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'input-text',
|
type: 'input-text',
|
||||||
label: 'FTP账号',
|
label: 'FTP账号',
|
||||||
name: 'ftpUsername',
|
name: 'ftpUsername',
|
||||||
...clearable,
|
...formInputClearable,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'input-password',
|
type: 'input-password',
|
||||||
label: 'FTP密码',
|
label: 'FTP密码',
|
||||||
name: 'ftpPassword',
|
name: 'ftpPassword',
|
||||||
...clearable,
|
...formInputClearable,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'input-text',
|
type: 'input-text',
|
||||||
label: '相对路径',
|
label: '相对路径',
|
||||||
name: 'ftpPath',
|
name: 'ftpPath',
|
||||||
description: '若为空,则使用用户根目录',
|
description: '若为空,则使用用户根目录',
|
||||||
...clearable,
|
...formInputClearable,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'input-text',
|
type: 'input-text',
|
||||||
label: '文件筛选',
|
label: '文件筛选',
|
||||||
name: 'ftpRegexFilter',
|
name: 'ftpRegexFilter',
|
||||||
description: '正则表达式,用于匹配文件的路径,只有符合筛选条件的文件才会被采集;若为空则默认采集全部文件',
|
description: '正则表达式,用于匹配文件的路径,只有符合筛选条件的文件才会被采集;若为空则默认采集全部文件',
|
||||||
...clearable,
|
...formInputClearable,
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import {tabUser} from "./tab-user.js";
|
|||||||
import {tabData} from "./tab-data.js";
|
import {tabData} from "./tab-data.js";
|
||||||
import {tabSettings} from "./tab-settings.js";
|
import {tabSettings} from "./tab-settings.js";
|
||||||
import {tabCheck} from "./tab-check.js";
|
import {tabCheck} from "./tab-check.js";
|
||||||
|
import {tabPermissions} from "./tab-permissions.js";
|
||||||
|
|
||||||
useAmis(information => {
|
useAmis(information => {
|
||||||
return {
|
return {
|
||||||
@@ -58,6 +59,7 @@ useAmis(information => {
|
|||||||
tabs: [
|
tabs: [
|
||||||
// tabOverview(),
|
// tabOverview(),
|
||||||
// tabMarket(),
|
// tabMarket(),
|
||||||
|
tabPermissions(),
|
||||||
tabData(),
|
tabData(),
|
||||||
tabCheck(),
|
tabCheck(),
|
||||||
tabUser(),
|
tabUser(),
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ export function tabData() {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '操作',
|
label: '操作',
|
||||||
width: 200,
|
width: 100,
|
||||||
type: 'operation',
|
type: 'operation',
|
||||||
fixed: 'right',
|
fixed: 'right',
|
||||||
className: 'nowrap',
|
className: 'nowrap',
|
||||||
@@ -53,27 +53,36 @@ export function tabData() {
|
|||||||
{
|
{
|
||||||
type: 'action',
|
type: 'action',
|
||||||
label: '查看',
|
label: '查看',
|
||||||
icon: 'fa fa-eye',
|
|
||||||
level: 'link',
|
level: 'link',
|
||||||
...resourceDetailDialog(),
|
...resourceDetailDialog(),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'action',
|
type: 'action',
|
||||||
label: '编辑',
|
label: '编辑',
|
||||||
icon: 'fa fa-pen-fancy',
|
|
||||||
level: 'link',
|
level: 'link',
|
||||||
...resourceEditeDialog(),
|
...resourceEditeDialog(),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'action',
|
type: 'dropdown-button',
|
||||||
label: '删除',
|
|
||||||
icon: 'fa fa-remove',
|
|
||||||
level: 'link',
|
level: 'link',
|
||||||
className: 'text-danger',
|
icon: 'fa fa-ellipsis-h',
|
||||||
confirmTitle: '确认删除',
|
hideCaret: true,
|
||||||
confirmText: '确认删除名称为「${name}」的数据资源吗?',
|
trigger: 'hover',
|
||||||
actionType: 'ajax',
|
buttons: [
|
||||||
api: apiGet('${base}/data_resource/remove/${id}')
|
{
|
||||||
|
type: 'action',
|
||||||
|
label: '申请确权',
|
||||||
|
level: 'link',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'action',
|
||||||
|
label: '删除',
|
||||||
|
confirmTitle: '确认删除',
|
||||||
|
confirmText: '确认删除名称为「${name}」的数据资源吗?',
|
||||||
|
actionType: 'ajax',
|
||||||
|
api: apiGet('${base}/data_resource/remove/${id}')
|
||||||
|
},
|
||||||
|
]
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|||||||
31
gringotts-frontend/pages/index/tab-permissions.js
Normal file
31
gringotts-frontend/pages/index/tab-permissions.js
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
import {providerOnly, userOnly} from "../../components/constants.js";
|
||||||
|
import {permissionAddDialog} from "../../components/permission/dialog-permission.js";
|
||||||
|
|
||||||
|
export function tabPermissions() {
|
||||||
|
return {
|
||||||
|
visibleOn: userOnly,
|
||||||
|
title: '权属管理',
|
||||||
|
icon: 'fa fa-user-shield',
|
||||||
|
body: {
|
||||||
|
type: 'tabs',
|
||||||
|
tabs: [
|
||||||
|
{
|
||||||
|
visibleOn: providerOnly,
|
||||||
|
title: '确权管理',
|
||||||
|
body: [
|
||||||
|
{
|
||||||
|
type: 'action',
|
||||||
|
label: '',
|
||||||
|
icon: 'fa fa-plus',
|
||||||
|
...permissionAddDialog()
|
||||||
|
},
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '授权管理',
|
||||||
|
body: []
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user