diff --git a/gringotts-frontend/components/constants.js b/gringotts-frontend/components/constants.js
index 697087d..4945354 100644
--- a/gringotts-frontend/components/constants.js
+++ b/gringotts-frontend/components/constants.js
@@ -1,91 +1,91 @@
export const information = {
- debug: false,
- // baseUrl: '',
- baseUrl: 'http://127.0.0.1:20080',
- title: '可信供给中心',
+ debug: false,
+ // baseUrl: '',
+ baseUrl: 'http://127.0.0.1:20080',
+ title: '可信供给中心',
}
export function useAmis(amisObject) {
- document.title = information.title
- let amis = amisRequire('amis/embed')
- let struct = amisObject(information)
- if (information.debug) {
- console.log(struct)
+ document.title = information.title
+ let amis = amisRequire('amis/embed')
+ let struct = amisObject(information)
+ if (information.debug) {
+ console.log(struct)
+ }
+ amis.embed(
+ '#app',
+ struct,
+ {
+ data: {
+ debug: information.debug,
+ base: information.baseUrl,
+ },
+ },
+ {
+ theme: 'antd',
+ enableAMISDebug: information.debug,
}
- amis.embed(
- '#app',
- struct,
- {
- data: {
- debug: information.debug,
- base: information.baseUrl,
- },
- },
- {
- theme: 'antd',
- enableAMISDebug: information.debug,
- }
- )
+ )
}
export function crudCommonOptions() {
- return {
- affixHeader: false,
- stopAutoRefreshWhenModalIsOpen: true,
- resizable: false,
- syncLocation: false,
- silentPolling: true,
- }
+ return {
+ affixHeader: false,
+ stopAutoRefreshWhenModalIsOpen: true,
+ resizable: false,
+ syncLocation: false,
+ silentPolling: true,
+ }
}
export function readOnlyDialogOptions() {
- return {
- actions: [],
- showCloseButton: false,
- closeOnEsc: true,
- closeOnOutside: true,
- disabled: true,
- }
+ return {
+ actions: [],
+ showCloseButton: false,
+ closeOnEsc: true,
+ closeOnOutside: true,
+ disabled: true,
+ }
}
export function horizontalFormOptions() {
- return {
- mode: 'horizontal',
- canAccessSuperData: false,
- horizontal: {
- left: 3,
- },
- }
+ return {
+ mode: 'horizontal',
+ canAccessSuperData: false,
+ horizontal: {
+ left: 3,
+ },
+ }
}
export function paginationCommonOptions(perPage = true, maxButtons = 5) {
- let option = {
- type: 'pagination',
- layout: [
- 'pager'
- ],
- maxButtons: maxButtons,
- showPageInput: false,
- perPageAvailable: [10, 15, 20, 50, 100, 200],
- }
- if (perPage) {
- option.layout.push('perPage')
- }
- return option
+ let option = {
+ type: 'pagination',
+ layout: [
+ 'pager'
+ ],
+ maxButtons: maxButtons,
+ showPageInput: false,
+ perPageAvailable: [10, 15, 20, 50, 100, 200],
+ }
+ if (perPage) {
+ option.layout.push('perPage')
+ }
+ return option
}
export function paginationTemplate(perPage = 20, maxButtons = 5) {
- return {
- perPage: perPage,
- headerToolbar: [
- "reload",
- paginationCommonOptions(true, maxButtons),
- ],
- footerToolbar: [
- "statistics",
- paginationCommonOptions(true, maxButtons),
- ],
- }
+ return {
+ perPage: perPage,
+ headerToolbar: [
+ "reload",
+ paginationCommonOptions(true, maxButtons),
+ ],
+ footerToolbar: [
+ "statistics",
+ paginationCommonOptions(true, maxButtons),
+ ],
+ }
}
export const size5MB = 5242880
@@ -94,16 +94,16 @@ export const size500MB = 524288000
export const size1GB = 1073741824
export function inputFileFormItemCommonOptions(accept = '*', maxSize = size5MB) {
- return {
- useChunk: true,
- accept: accept,
- maxSize: maxSize,
- autoUpload: false,
- drag: true,
- startChunkApi: apiPost('${base}/upload/start'),
- chunkApi: apiPost('${base}/upload/slice'),
- finishChunkApi: apiPost('${base}/upload/finish'),
- }
+ return {
+ useChunk: true,
+ accept: accept,
+ maxSize: maxSize,
+ autoUpload: false,
+ drag: true,
+ startChunkApi: apiPost('${base}/upload/start'),
+ chunkApi: apiPost('${base}/upload/slice'),
+ finishChunkApi: apiPost('${base}/upload/finish'),
+ }
}
/**
@@ -114,41 +114,41 @@ export function inputFileFormItemCommonOptions(accept = '*', maxSize = size5MB)
* @param {{}} extra
*/
export function copyField(field, label, tips = '复制', ignoreLength = 0, extra = undefined) {
- let tpl = ignoreLength === 0 ? `\${${field}}` : `\${TRUNCATE(${field}, ${ignoreLength})}`
- let content = extra
- ? {
- type: 'action',
- level: 'link',
- label: `\${${field}}`,
- className: 'text-current underline',
- size: 'xs',
- ...extra,
- }
- : {
- type: 'tpl',
- className: 'mr-1',
- tpl: tpl,
- }
- return {
- name: field,
- label: label,
- type: 'wrapper',
- size: 'none',
- className: 'nowrap',
- body: [
- content,
- {
- type: 'action',
- level: 'link',
- label: '',
- icon: 'fa fa-copy',
- size: 'xs',
- actionType: 'copy',
- content: `\$${field}`,
- tooltip: `${tips}`,
- },
- ]
+ let tpl = ignoreLength === 0 ? `\${${field}}` : `\${TRUNCATE(${field}, ${ignoreLength})}`
+ let content = extra
+ ? {
+ type: 'action',
+ level: 'link',
+ label: `\${${field}}`,
+ className: 'text-current underline',
+ size: 'xs',
+ ...extra,
}
+ : {
+ type: 'tpl',
+ className: 'mr-1',
+ tpl: tpl,
+ }
+ return {
+ name: field,
+ label: label,
+ type: 'wrapper',
+ size: 'none',
+ className: 'nowrap',
+ body: [
+ content,
+ {
+ type: 'action',
+ level: 'link',
+ label: '',
+ icon: 'fa fa-copy',
+ size: 'xs',
+ actionType: 'copy',
+ content: `\$${field}`,
+ tooltip: `${tips}`,
+ },
+ ]
+ }
}
/**
@@ -157,14 +157,14 @@ export function copyField(field, label, tips = '复制', ignoreLength = 0, extra
* @param {Array} buttons
*/
export function operationField(label, width = 100, buttons = []) {
- return {
- label: label,
- width: width,
- type: 'operation',
- fixed: 'right',
- className: 'nowrap',
- buttons: buttons,
- }
+ return {
+ label: label,
+ width: width,
+ type: 'operation',
+ fixed: 'right',
+ className: 'nowrap',
+ buttons: buttons,
+ }
}
/**
@@ -173,17 +173,17 @@ export function operationField(label, width = 100, buttons = []) {
* @param {number} width
*/
export function timeField(field, label, width = 150) {
- return {
- label: label,
- width: width,
- align: 'center',
- type: 'tpl',
- tpl: `\${IF(${field}, DATETOSTR(${field}), '-')}`
- }
+ return {
+ label: label,
+ width: width,
+ align: 'center',
+ type: 'tpl',
+ tpl: `\${IF(${field}, DATETOSTR(${field}), '-')}`
+ }
}
export function stringWrapField(field, label, width = undefined) {
- return stringField(field, label, width, true)
+ return stringField(field, label, width, true)
}
/**
@@ -193,17 +193,17 @@ export function stringWrapField(field, label, width = undefined) {
* @param {boolean} wrap
*/
export function stringField(field, label, width = undefined, wrap = false) {
- let data = {
- name: field,
- label: label,
- }
- if (width) {
- data['width'] = width
- }
- if (!wrap) {
- data['className'] = 'nowrap'
- }
- return data
+ let data = {
+ name: field,
+ label: label,
+ }
+ if (width) {
+ data['width'] = width
+ }
+ if (!wrap) {
+ data['className'] = 'nowrap'
+ }
+ return data
}
/**
@@ -213,107 +213,107 @@ export function stringField(field, label, width = undefined, wrap = false) {
* @param {number} width
*/
export function mappingField(field, label, mapping, width = 80) {
- let mapData = {
- '*': `\${${field}}`,
- }
- mapping.forEach(item => {
- mapData[item['value']] = `${item['label']}`
- })
- return {
- label: label,
- type: 'mapping',
- width: width,
- value: `\${${field}}`,
- align: 'center',
- map: mapData,
- }
+ let mapData = {
+ '*': `\${${field}}`,
+ }
+ mapping.forEach(item => {
+ mapData[item['value']] = `${item['label']}`
+ })
+ return {
+ label: label,
+ type: 'mapping',
+ width: width,
+ value: `\${${field}}`,
+ align: 'center',
+ map: mapData,
+ }
}
function mappingItem(label, value, color = 'bg-info') {
- return {
- label: label,
- value: value,
- color: color,
- }
+ return {
+ label: label,
+ value: value,
+ color: color,
+ }
}
export const userRoleMapping = [
- mappingItem('数据提供方', 'PROVIDER', 'bg-blue-500'),
- mappingItem('数据使用方', 'CUSTOMER', 'bg-purple-500'),
- mappingItem('审核监管方', 'CHECKER', 'bg-cyan-500'),
- mappingItem('系统管理员', 'ADMINISTRATOR', 'bg-green-500'),
+ mappingItem('数据提供方', 'PROVIDER', 'bg-blue-500'),
+ mappingItem('数据使用方', 'CUSTOMER', 'bg-purple-500'),
+ mappingItem('审核监管方', 'CHECKER', 'bg-cyan-500'),
+ mappingItem('系统管理员', 'ADMINISTRATOR', 'bg-green-500'),
]
export const userStateMapping = [
- mappingItem('审查中', 'CHECKING', 'bg-warning'),
- mappingItem('正常', 'NORMAL', 'bg-success'),
- mappingItem('禁用', 'DISABLED', 'bg-danger'),
+ mappingItem('审查中', 'CHECKING', 'bg-warning'),
+ mappingItem('正常', 'NORMAL', 'bg-success'),
+ mappingItem('禁用', 'DISABLED', 'bg-danger'),
]
export const permissionStateMapping = [
- mappingItem('未确权', 'NONE'),
- mappingItem('草稿', 'DRAFT', 'bg-primary'),
- mappingItem('审查中', 'CHECKING', 'bg-warning'),
- mappingItem('用户审查中', 'OWNER_CHECKING', 'bg-warning'),
- mappingItem('通过', 'NORMAL', 'bg-success'),
- mappingItem('驳回', 'REJECT', 'bg-danger'),
+ mappingItem('未确权', 'NONE'),
+ mappingItem('草稿', 'DRAFT', 'bg-primary'),
+ mappingItem('审查中', 'CHECKING', 'bg-warning'),
+ mappingItem('用户审查中', 'OWNER_CHECKING', 'bg-warning'),
+ mappingItem('通过', 'NORMAL', 'bg-success'),
+ mappingItem('驳回', 'REJECT', 'bg-danger'),
]
export const checkTypeMapping = [
- mappingItem('确权审查', 'CONFIRMATION', 'bg-blue-500'),
- mappingItem('授权审查', 'AUTHENTICATION', 'bg-purple-500'),
- mappingItem('上架审查', 'MARKET', 'bg-green-500'),
+ mappingItem('确权审查', 'CONFIRMATION', 'bg-blue-500'),
+ mappingItem('授权审查', 'AUTHENTICATION', 'bg-purple-500'),
+ mappingItem('上架审查', 'MARKET', 'bg-green-500'),
]
export const checkOverMapping = [
- mappingItem('进行中', 'CHECKING', 'bg-warning'),
- mappingItem('已撤销', 'RETRACT', 'bg-primary'),
- mappingItem('已办结', 'OVER', 'bg-success'),
+ mappingItem('进行中', 'CHECKING', 'bg-warning'),
+ mappingItem('已撤销', 'RETRACT', 'bg-primary'),
+ mappingItem('已办结', 'OVER', 'bg-success'),
]
function api(method, url) {
- return {
- method: method,
- url: url,
- headers: {
- token: '${token|default:undefined}',
- }
+ return {
+ method: method,
+ url: url,
+ headers: {
+ token: '${token|default:undefined}',
}
+ }
}
export function apiGet(url) {
- return api('get', url)
+ return api('get', url)
}
export function apiPost(url) {
- return api('post', url)
+ return api('post', url)
}
export function arrayInCheck(array, field) {
- return `\${ARRAYINCLUDES(['${array.join("','")}'], ${field})}`
+ return `\${ARRAYINCLUDES(['${array.join("','")}'], ${field})}`
}
export function arrayOutCheck(array, field) {
- return `\${!ARRAYINCLUDES(['${array.join("','")}'], ${field})}`
+ return `\${!ARRAYINCLUDES(['${array.join("','")}'], ${field})}`
}
export const checkState = {
- none: 'NONE',
- draft: 'DRAFT',
- checking: 'CHECKING',
- ownerChecking: 'OWNER_CHECKING',
- normal: 'NORMAL',
+ none: 'NONE',
+ draft: 'DRAFT',
+ checking: 'CHECKING',
+ ownerChecking: 'OWNER_CHECKING',
+ normal: 'NORMAL',
}
export function roleCheck(roles) {
- return `\${ARRAYINCLUDES(['${roles.join("','")}'], role)}`
+ return `\${ARRAYINCLUDES(['${roles.join("','")}'], role)}`
}
export const role = {
- administrator: 'ADMINISTRATOR',
- checker: 'CHECKER',
- provider: 'PROVIDER',
- customer: 'CUSTOMER',
+ administrator: 'ADMINISTRATOR',
+ checker: 'CHECKER',
+ provider: 'PROVIDER',
+ customer: 'CUSTOMER',
}
export const administratorOnly = roleCheck([role.administrator])
@@ -324,98 +324,98 @@ export const customerOnly = roleCheck([role.administrator, role.customer])
export const formInputClearable = {
- clearable: true,
- clearValueOnEmpty: true,
+ clearable: true,
+ clearValueOnEmpty: true,
}
const formInputFileStaticColumns = [
- {
- name: 'filename',
- label: '文件名',
- },
- {
- type: 'operation',
- label: '操作',
- width: 140,
- buttons: [
- {
- type: 'action',
- label: '预览',
- level: 'link',
- icon: 'fas fa-eye'
- },
- {
- type: 'action',
- label: '下载',
- level: 'link',
- icon: 'fa fa-download',
- actionType: 'ajax',
- api: {
- ...apiGet('${base}/upload/download/${id}'),
- responseType: 'blob',
- }
- }
- ]
- }
+ {
+ name: 'filename',
+ label: '文件名',
+ },
+ {
+ type: 'operation',
+ label: '操作',
+ width: 140,
+ buttons: [
+ {
+ type: 'action',
+ label: '预览',
+ level: 'link',
+ icon: 'fas fa-eye'
+ },
+ {
+ type: 'action',
+ label: '下载',
+ level: 'link',
+ icon: 'fa fa-download',
+ actionType: 'ajax',
+ api: {
+ ...apiGet('${base}/upload/download/${id}'),
+ responseType: 'blob',
+ }
+ }
+ ]
+ }
]
export function formInputSingleFileStatic(field, label) {
- return {
- visibleOn: '${detail}',
- type: 'control',
- label: label,
- required: true,
- body: {
- type: 'table',
- source: `\${${field}|asArray}`,
- columns: formInputFileStaticColumns,
- }
+ return {
+ visibleOn: '${detail}',
+ type: 'control',
+ label: label,
+ required: true,
+ body: {
+ type: 'table',
+ source: `\${${field}|asArray}`,
+ columns: formInputFileStaticColumns,
}
+ }
}
export function formInputMultiFileStatic(field, label) {
- return {
- visibleOn: '${detail}',
- type: 'input-table',
- label: label,
- name: field,
- required: true,
- resizable: false,
- columns: formInputFileStaticColumns,
- }
+ return {
+ visibleOn: '${detail}',
+ type: 'input-table',
+ label: label,
+ name: field,
+ required: true,
+ resizable: false,
+ columns: formInputFileStaticColumns,
+ }
}
export function formCreatedUserAndModifiedUser() {
- return [
+ return [
+ {
+ type: 'group',
+ body: [
{
- type: 'group',
- body: [
- {
- type: 'input-text',
- name: 'createdUsername',
- label: '创建人',
- },
- {
- type: 'input-datetime',
- name: 'createdTime',
- label: '创建时间',
- },
- ]
+ type: 'input-text',
+ name: 'createdUsername',
+ label: '创建人',
},
{
- type: 'group',
- body: [
- {
- type: 'input-text',
- name: 'modifiedUsername',
- label: '最后修改人',
- },
- {
- type: 'input-datetime',
- name: 'modifiedTime',
- label: '最后修改时间',
- },
- ]
+ type: 'input-datetime',
+ name: 'createdTime',
+ label: '创建时间',
},
- ]
+ ]
+ },
+ {
+ type: 'group',
+ body: [
+ {
+ type: 'input-text',
+ name: 'modifiedUsername',
+ label: '最后修改人',
+ },
+ {
+ type: 'input-datetime',
+ name: 'modifiedTime',
+ label: '最后修改时间',
+ },
+ ]
+ },
+ ]
}
diff --git a/gringotts-frontend/components/permission/dialog-permission.js b/gringotts-frontend/components/permission/dialog-permission.js
index 7d845ce..0e69d35 100644
--- a/gringotts-frontend/components/permission/dialog-permission.js
+++ b/gringotts-frontend/components/permission/dialog-permission.js
@@ -1,14 +1,14 @@
import './dialog-permission.css'
import {
- apiGet,
- apiPost,
- formCreatedUserAndModifiedUser,
- formInputClearable,
- formInputMultiFileStatic,
- horizontalFormOptions,
- information,
- inputFileFormItemCommonOptions,
- size100MB
+ apiGet,
+ apiPost,
+ formCreatedUserAndModifiedUser,
+ formInputClearable,
+ formInputMultiFileStatic,
+ horizontalFormOptions,
+ information,
+ inputFileFormItemCommonOptions,
+ size100MB
} from "../constants.js";
import {resourceList} from "../../pages/index/tab-data.js";
import {resourceDetailDialog} from "../resource/dialog-resource.js";
@@ -17,192 +17,192 @@ const CONFIRMATION_TYPE = 'confirmation'
const AUTHENTICATION_TYPE = 'authentication'
const CONFIRMATION = {
- type: 'confirmation',
- pickerApi: apiGet('${base}/data_resource/list_no_confirmation')
+ type: 'confirmation',
+ pickerApi: apiGet('${base}/data_resource/list_no_confirmation')
}
const AUTHENTICATION = {
- type: 'authentication',
- pickerApi: apiGet('${base}/data_resource/list_no_authentication')
+ type: 'authentication',
+ pickerApi: apiGet('${base}/data_resource/list_no_authentication')
}
function detailForm(pickerApi = apiGet('${base}/data_resource/list'), showCreatedUserAndModifiedUser = false) {
- return {
- debug: information.debug,
- id: 'permission_form',
- type: 'form',
- ...horizontalFormOptions(),
- horizontal: {
- left: 2,
+ return {
+ debug: information.debug,
+ id: 'permission_form',
+ type: 'form',
+ ...horizontalFormOptions(),
+ horizontal: {
+ left: 2,
+ },
+ body: [
+ {
+ type: 'hidden',
+ name: 'id',
+ },
+ {
+ type: 'picker',
+ name: 'targetId',
+ label: '数据资源',
+ required: true,
+ multiple: false,
+ size: 'md',
+ valueField: 'id',
+ labelField: 'name',
+ source: pickerApi,
+ pickerSchema: {
+ ...resourceList(),
},
- body: [
- {
- type: 'hidden',
- name: 'id',
- },
- {
- type: 'picker',
- name: 'targetId',
- label: '数据资源',
- required: true,
- multiple: false,
- size: 'md',
- valueField: 'id',
- labelField: 'name',
- source: pickerApi,
- pickerSchema: {
- ...resourceList(),
- },
- staticSchema: {
- type: 'tpl',
- tpl: "${targetName}",
- onEvent: {
- click: {
- actions: [
- {
- actionType: 'dialog',
- ...resourceDetailDialog('targetId'),
- }
- ]
- }
- }
+ staticSchema: {
+ type: 'tpl',
+ tpl: "${targetName}",
+ onEvent: {
+ click: {
+ actions: [
+ {
+ actionType: 'dialog',
+ ...resourceDetailDialog('targetId'),
}
- },
- {
- type: 'textarea',
- placeholder: '请输入确权说明',
- label: '确权说明',
- name: 'description',
- ...formInputClearable,
- },
- formInputMultiFileStatic('evidenceFiles', '相关材料'),
- {
- visibleOn: '${!detail}',
- type: 'input-file',
- label: '相关材料',
- name: 'evidenceFiles',
- multiple: true,
- required: true,
- joinValues: false,
- ...inputFileFormItemCommonOptions(undefined, size100MB),
- },
- {
- visibleOn: `\${${AUTHENTICATION_TYPE}}`,
- type: 'input-datetime-range',
- name: 'activeTime',
- extraName: 'expiredTime',
- label: '授权时间',
- required: true,
- format: 'YYYY-MM-DD HH:mm:ss',
- shortcuts: [
- '7dayslater',
- '14dayslater',
- '30dayslater',
- '180dayslater',
- '365dayslater',
- ]
- },
- ...(showCreatedUserAndModifiedUser ? formCreatedUserAndModifiedUser() : [])
+ ]
+ }
+ }
+ }
+ },
+ {
+ type: 'textarea',
+ placeholder: '请输入确权说明',
+ label: '确权说明',
+ name: 'description',
+ ...formInputClearable,
+ },
+ formInputMultiFileStatic('evidenceFiles', '相关材料'),
+ {
+ visibleOn: '${!detail}',
+ type: 'input-file',
+ label: '相关材料',
+ name: 'evidenceFiles',
+ multiple: true,
+ required: true,
+ joinValues: false,
+ ...inputFileFormItemCommonOptions(undefined, size100MB),
+ },
+ {
+ visibleOn: `\${${AUTHENTICATION_TYPE}}`,
+ type: 'input-datetime-range',
+ name: 'activeTime',
+ extraName: 'expiredTime',
+ label: '授权时间',
+ required: true,
+ format: 'YYYY-MM-DD HH:mm:ss',
+ shortcuts: [
+ '7dayslater',
+ '14dayslater',
+ '30dayslater',
+ '180dayslater',
+ '365dayslater',
]
- }
+ },
+ ...(showCreatedUserAndModifiedUser ? formCreatedUserAndModifiedUser() : [])
+ ]
+ }
}
export function confirmationAddDialog() {
- return permissionAddDialog(CONFIRMATION)
+ return permissionAddDialog(CONFIRMATION)
}
export function authenticationAddDialog() {
- return permissionAddDialog(AUTHENTICATION)
+ return permissionAddDialog(AUTHENTICATION)
}
function permissionAddDialog(config) {
- let data = {add: true}
- data[config.type] = true
- return {
- actionType: 'dialog',
- dialog: {
- title: '新增确权申请',
- size: 'md',
- actions: [
- {
- type: 'reset',
- label: '重置',
- },
- {
- type: 'submit',
- label: '确定',
- level: 'primary',
- }
- ],
- body: {
- ...detailForm(config.pickerApi),
- api: apiPost(`\${base}/${config.type}/save`),
- data: data,
- }
+ let data = {add: true}
+ data[config.type] = true
+ return {
+ actionType: 'dialog',
+ dialog: {
+ title: '新增确权申请',
+ size: 'md',
+ actions: [
+ {
+ type: 'reset',
+ label: '重置',
+ },
+ {
+ type: 'submit',
+ label: '确定',
+ level: 'primary',
}
+ ],
+ body: {
+ ...detailForm(config.pickerApi),
+ api: apiPost(`\${base}/${config.type}/save`),
+ data: data,
+ }
}
+ }
}
export function confirmationDetailDialog(field = 'id', actions = []) {
- return permissionDetailDialog(CONFIRMATION, field, actions)
+ return permissionDetailDialog(CONFIRMATION, field, actions)
}
export function authenticationDetailDialog(field = 'id', actions = []) {
- return permissionDetailDialog(AUTHENTICATION, field, actions)
+ return permissionDetailDialog(AUTHENTICATION, field, actions)
}
function permissionDetailDialog(config, field = 'id', actions = []) {
- let data = {detail: true}
- data[config.type] = true
- return {
- actionType: 'dialog',
- dialog: {
- title: '确权申请详情',
- size: 'md',
- actions: actions,
- body: {
- ...detailForm(config.pickerApi, true),
- initApi: apiGet(`\${base}/${config.type}/detail/\${${field}}`),
- static: true,
- data: data,
- }
- }
+ let data = {detail: true}
+ data[config.type] = true
+ return {
+ actionType: 'dialog',
+ dialog: {
+ title: '确权申请详情',
+ size: 'md',
+ actions: actions,
+ body: {
+ ...detailForm(config.pickerApi, true),
+ initApi: apiGet(`\${base}/${config.type}/detail/\${${field}}`),
+ static: true,
+ data: data,
+ }
}
+ }
}
export function confirmationEditeDialog(field = 'id') {
- return permissionEditeDialog(CONFIRMATION, field)
+ return permissionEditeDialog(CONFIRMATION, field)
}
export function authenticationEditeDialog(field = 'id') {
- return permissionEditeDialog(AUTHENTICATION, field)
+ return permissionEditeDialog(AUTHENTICATION, field)
}
function permissionEditeDialog(config, field = 'id') {
- let data = {edit: true}
- data[config.type] = true
- return {
- actionType: 'dialog',
- dialog: {
- title: '确权申请详情',
- size: 'md',
- actions: [
- {
- type: 'reset',
- label: '重置',
- },
- {
- type: 'submit',
- label: '确定',
- level: 'primary',
- }
- ],
- body: {
- ...detailForm(config.pickerApi),
- api: apiPost(`\${base}/${config.type}/save`),
- initApi: apiGet(`\${base}/${config.type}/detail/\${${field}}`),
- data: data,
- },
+ let data = {edit: true}
+ data[config.type] = true
+ return {
+ actionType: 'dialog',
+ dialog: {
+ title: '确权申请详情',
+ size: 'md',
+ actions: [
+ {
+ type: 'reset',
+ label: '重置',
+ },
+ {
+ type: 'submit',
+ label: '确定',
+ level: 'primary',
}
+ ],
+ body: {
+ ...detailForm(config.pickerApi),
+ api: apiPost(`\${base}/${config.type}/save`),
+ initApi: apiGet(`\${base}/${config.type}/detail/\${${field}}`),
+ data: data,
+ },
}
+ }
}
diff --git a/gringotts-frontend/components/resource/dialog-resource.js b/gringotts-frontend/components/resource/dialog-resource.js
index 78af8cc..178dbbb 100644
--- a/gringotts-frontend/components/resource/dialog-resource.js
+++ b/gringotts-frontend/components/resource/dialog-resource.js
@@ -1,378 +1,378 @@
import './dialog-resource.css'
import {
- apiGet,
- apiPost,
- formCreatedUserAndModifiedUser,
- formInputClearable,
- formInputSingleFileStatic,
- horizontalFormOptions,
- inputFileFormItemCommonOptions,
- size1GB,
- size500MB
+ apiGet,
+ apiPost,
+ formCreatedUserAndModifiedUser,
+ formInputClearable,
+ formInputSingleFileStatic,
+ horizontalFormOptions,
+ inputFileFormItemCommonOptions,
+ size1GB,
+ size500MB
} from "../constants.js";
function detailForm(showCreatedUserAndModifiedUser = false) {
- return {
- type: 'form',
- ...horizontalFormOptions(),
- horizontal: {
- left: 2,
- },
+ return {
+ type: 'form',
+ ...horizontalFormOptions(),
+ horizontal: {
+ left: 2,
+ },
+ body: [
+ {
+ type: 'hidden',
+ name: 'id',
+ },
+ {
+ type: 'input-text',
+ name: 'name',
+ label: '资源名称',
+ maxLength: 10,
+ showCounter: true,
+ required: true,
+ ...formInputClearable,
+ },
+ {
+ type: 'textarea',
+ name: 'description',
+ label: '资源描述',
+ ...formInputClearable,
+ showCounter: true,
+ trimContents: true,
+ minRows: 2,
+ maxRows: 2,
+ },
+ {
+ type: 'fieldSet',
+ title: '资源类型定义',
body: [
- {
- type: 'hidden',
- name: 'id',
- },
- {
+ {
+ name: 'resourceType',
+ type: 'select',
+ label: '资源类型',
+ selectFirst: true,
+ required: true,
+ options: [
+ {label: 'API', value: 'API'},
+ {label: '文件', value: 'FILE'},
+ {label: '数据库', value: 'DATABASE'},
+ {label: 'HDFS', value: 'HDFS'},
+ {label: 'FTP', value: 'FTP'},
+ ]
+ },
+ {
+ visibleOn: "${resourceType === 'API'}",
+ type: 'fieldSet',
+ body: [
+ {
type: 'input-text',
- name: 'name',
- label: '资源名称',
- maxLength: 10,
- showCounter: true,
+ label: 'API地址',
+ name: 'apiUrl',
required: true,
...formInputClearable,
- },
- {
- type: 'textarea',
- name: 'description',
- label: '资源描述',
+ },
+ {
+ type: 'input-text',
+ label: '用户名',
+ name: 'apiUsername',
...formInputClearable,
- showCounter: true,
- trimContents: true,
- minRows: 2,
- maxRows: 2,
- },
- {
- type: 'fieldSet',
- title: '资源类型定义',
- body: [
- {
- name: 'resourceType',
- type: 'select',
- label: '资源类型',
- selectFirst: true,
- required: true,
- options: [
- {label: 'API', value: 'API'},
- {label: '文件', value: 'FILE'},
- {label: '数据库', value: 'DATABASE'},
- {label: 'HDFS', value: 'HDFS'},
- {label: 'FTP', value: 'FTP'},
- ]
- },
- {
- visibleOn: "${resourceType === 'API'}",
- type: 'fieldSet',
- body: [
- {
- type: 'input-text',
- label: 'API地址',
- name: 'apiUrl',
- required: true,
- ...formInputClearable,
- },
- {
- type: 'input-text',
- label: '用户名',
- name: 'apiUsername',
- ...formInputClearable,
- },
- {
- type: 'input-password',
- label: '密码',
- name: 'apiPassword',
- ...formInputClearable,
- },
- ]
- },
- {
- visibleOn: "${resourceType === 'FILE'}",
- type: 'fieldSet',
- body: [
- formInputSingleFileStatic('file', '数据文件'),
- {
- visibleOn: "${!detail}",
- type: 'input-file',
- label: '数据文件',
- description: '只适合小于1GB的资源文件使用,大文件请使用其他资源类型',
- name: 'file',
- multiple: false,
- required: true,
- joinValues: false,
- ...inputFileFormItemCommonOptions('.zip', size1GB),
- },
- ]
- },
- {
- visibleOn: "${resourceType === 'DATABASE'}",
- type: 'fieldSet',
- body: [
- {
- type: 'select',
- label: '数据库类型',
- name: 'databaseType',
- required: true,
- options: [
- {label: 'MySQL', value: 'MYSQL'},
- {label: 'Oracle', value: 'ORACLE'},
- {label: 'PostgreSQL', value: 'POSTGRESQL'},
- ]
- },
- {
- type: 'input-text',
- label: 'JDBC',
- name: 'databaseJdbc',
- required: true,
- ...formInputClearable,
- },
- {
- type: 'input-text',
- label: '用户名',
- name: 'databaseUsername',
- ...formInputClearable,
- },
- {
- type: 'input-password',
- label: '密码',
- name: 'databasePassword',
- ...formInputClearable,
- },
- ]
- },
- {
- visibleOn: "${resourceType === 'HDFS'}",
- type: 'fieldSet',
- body: [
- formInputSingleFileStatic('coreSiteFile', 'core-site.xml'),
- {
- visibleOn: "${!detail}",
- type: 'input-file',
- label: 'core-site.xml',
- name: 'coreSiteFile',
- multiple: false,
- required: true,
- joinValues: false,
- ...inputFileFormItemCommonOptions('.xml'),
- },
- formInputSingleFileStatic('hdfsSiteFile', 'hdfs-site.xml'),
- {
- visibleOn: "${!detail}",
- type: 'input-file',
- label: 'hdfs-site.xml',
- name: 'hdfsSiteFile',
- multiple: false,
- required: true,
- joinValues: false,
- ...inputFileFormItemCommonOptions('.xml'),
- },
- ]
- },
- {
- visibleOn: "${resourceType === 'FTP'}",
- type: 'fieldSet',
- body: [
- {
- type: 'input-text',
- label: 'FTP地址',
- name: 'ftpUrl',
- required: true,
- ...formInputClearable,
- },
- {
- type: 'input-text',
- label: 'FTP账号',
- name: 'ftpUsername',
- ...formInputClearable,
- },
- {
- type: 'input-password',
- label: 'FTP密码',
- name: 'ftpPassword',
- ...formInputClearable,
- },
- {
- type: 'input-text',
- label: '相对路径',
- name: 'ftpPath',
- description: '若为空,则使用用户根目录',
- ...formInputClearable,
- },
- {
- type: 'input-text',
- label: '文件筛选',
- name: 'ftpRegexFilter',
- description: '正则表达式,用于匹配文件的路径,只有符合筛选条件的文件才会被采集;若为空则默认采集全部文件',
- ...formInputClearable,
- },
- ]
- },
+ },
+ {
+ type: 'input-password',
+ label: '密码',
+ name: 'apiPassword',
+ ...formInputClearable,
+ },
+ ]
+ },
+ {
+ visibleOn: "${resourceType === 'FILE'}",
+ type: 'fieldSet',
+ body: [
+ formInputSingleFileStatic('file', '数据文件'),
+ {
+ visibleOn: "${!detail}",
+ type: 'input-file',
+ label: '数据文件',
+ description: '只适合小于1GB的资源文件使用,大文件请使用其他资源类型',
+ name: 'file',
+ multiple: false,
+ required: true,
+ joinValues: false,
+ ...inputFileFormItemCommonOptions('.zip', size1GB),
+ },
+ ]
+ },
+ {
+ visibleOn: "${resourceType === 'DATABASE'}",
+ type: 'fieldSet',
+ body: [
+ {
+ type: 'select',
+ label: '数据库类型',
+ name: 'databaseType',
+ required: true,
+ options: [
+ {label: 'MySQL', value: 'MYSQL'},
+ {label: 'Oracle', value: 'ORACLE'},
+ {label: 'PostgreSQL', value: 'POSTGRESQL'},
]
- },
- {
- type: 'fieldSet',
- title: '资源格式定义',
- className: 'mt-5',
- body: [
- {
- name: 'formatType',
- type: 'select',
- label: '资源格式',
- selectFirst: true,
- required: true,
- options: [
- {label: '无', value: 'NONE'},
- {label: 'Line', value: 'LINE'},
- {label: 'JSON', value: 'JSON'},
- {label: 'JSON Line', value: 'JSON_LINE'},
- {label: 'CSV', value: 'CSV'},
- ]
- },
- {
- visibleOn: "${formatType === 'JSON' && !detail}",
- type: 'json-schema-editor',
- name: 'jsonSchema',
- label: 'JSON格式',
- description: '(使用JSON Schema格式)',
- required: true,
- enableAdvancedSetting: true,
- mini: true,
- },
- {
- visibleOn: "${formatType === 'JSON' && detail}",
- type: 'editor',
- name: 'jsonSchemaText',
- label: 'JSON格式',
- language: 'json',
- },
- {
- visibleOn: "${formatType === 'JSON_LINE' && !detail}",
- type: 'json-schema-editor',
- name: 'jsonLineSchema',
- label: 'JSON格式',
- description: 'JSON Line类型请定义单行JSON数据格式(使用JSON Schema格式)',
- required: true,
- enableAdvancedSetting: true,
- mini: true,
- },
- {
- visibleOn: "${formatType === 'JSON_LINE' && detail}",
- type: 'editor',
- name: 'jsonLineSchemaText',
- label: 'JSON格式',
- language: 'json',
- },
- {
- visibleOn: "${formatType === 'CSV' && !detail}",
- type: 'json-schema-editor',
- name: 'csvSchema',
- label: 'CSV格式',
- description: '请定义单行数据中各个字段的格式(使用JSON Schema格式)',
- required: true,
- enableAdvancedSetting: true,
- mini: true,
- disabledTypes: [
- 'object',
- 'array',
- 'null',
- ]
- },
- {
- visibleOn: "${formatType === 'CSV' && detail}",
- type: 'editor',
- name: 'csvSchemaText',
- label: 'JSON格式',
- language: 'json',
- },
- formInputSingleFileStatic('exampleFile', '资源示例'),
- {
- visibleOn: "${!detail}",
- type: 'input-file',
- label: '资源示例',
- name: 'exampleFile',
- description: '可以上传用于作为格式示范的样例数据',
- multiple: false,
- joinValues: false,
- ...inputFileFormItemCommonOptions(undefined, size500MB),
- },
- ]
- },
- ...(showCreatedUserAndModifiedUser ? formCreatedUserAndModifiedUser() : [])
+ },
+ {
+ type: 'input-text',
+ label: 'JDBC',
+ name: 'databaseJdbc',
+ required: true,
+ ...formInputClearable,
+ },
+ {
+ type: 'input-text',
+ label: '用户名',
+ name: 'databaseUsername',
+ ...formInputClearable,
+ },
+ {
+ type: 'input-password',
+ label: '密码',
+ name: 'databasePassword',
+ ...formInputClearable,
+ },
+ ]
+ },
+ {
+ visibleOn: "${resourceType === 'HDFS'}",
+ type: 'fieldSet',
+ body: [
+ formInputSingleFileStatic('coreSiteFile', 'core-site.xml'),
+ {
+ visibleOn: "${!detail}",
+ type: 'input-file',
+ label: 'core-site.xml',
+ name: 'coreSiteFile',
+ multiple: false,
+ required: true,
+ joinValues: false,
+ ...inputFileFormItemCommonOptions('.xml'),
+ },
+ formInputSingleFileStatic('hdfsSiteFile', 'hdfs-site.xml'),
+ {
+ visibleOn: "${!detail}",
+ type: 'input-file',
+ label: 'hdfs-site.xml',
+ name: 'hdfsSiteFile',
+ multiple: false,
+ required: true,
+ joinValues: false,
+ ...inputFileFormItemCommonOptions('.xml'),
+ },
+ ]
+ },
+ {
+ visibleOn: "${resourceType === 'FTP'}",
+ type: 'fieldSet',
+ body: [
+ {
+ type: 'input-text',
+ label: 'FTP地址',
+ name: 'ftpUrl',
+ required: true,
+ ...formInputClearable,
+ },
+ {
+ type: 'input-text',
+ label: 'FTP账号',
+ name: 'ftpUsername',
+ ...formInputClearable,
+ },
+ {
+ type: 'input-password',
+ label: 'FTP密码',
+ name: 'ftpPassword',
+ ...formInputClearable,
+ },
+ {
+ type: 'input-text',
+ label: '相对路径',
+ name: 'ftpPath',
+ description: '若为空,则使用用户根目录',
+ ...formInputClearable,
+ },
+ {
+ type: 'input-text',
+ label: '文件筛选',
+ name: 'ftpRegexFilter',
+ description: '正则表达式,用于匹配文件的路径,只有符合筛选条件的文件才会被采集;若为空则默认采集全部文件',
+ ...formInputClearable,
+ },
+ ]
+ },
]
- }
+ },
+ {
+ type: 'fieldSet',
+ title: '资源格式定义',
+ className: 'mt-5',
+ body: [
+ {
+ name: 'formatType',
+ type: 'select',
+ label: '资源格式',
+ selectFirst: true,
+ required: true,
+ options: [
+ {label: '无', value: 'NONE'},
+ {label: 'Line', value: 'LINE'},
+ {label: 'JSON', value: 'JSON'},
+ {label: 'JSON Line', value: 'JSON_LINE'},
+ {label: 'CSV', value: 'CSV'},
+ ]
+ },
+ {
+ visibleOn: "${formatType === 'JSON' && !detail}",
+ type: 'json-schema-editor',
+ name: 'jsonSchema',
+ label: 'JSON格式',
+ description: '(使用JSON Schema格式)',
+ required: true,
+ enableAdvancedSetting: true,
+ mini: true,
+ },
+ {
+ visibleOn: "${formatType === 'JSON' && detail}",
+ type: 'editor',
+ name: 'jsonSchemaText',
+ label: 'JSON格式',
+ language: 'json',
+ },
+ {
+ visibleOn: "${formatType === 'JSON_LINE' && !detail}",
+ type: 'json-schema-editor',
+ name: 'jsonLineSchema',
+ label: 'JSON格式',
+ description: 'JSON Line类型请定义单行JSON数据格式(使用JSON Schema格式)',
+ required: true,
+ enableAdvancedSetting: true,
+ mini: true,
+ },
+ {
+ visibleOn: "${formatType === 'JSON_LINE' && detail}",
+ type: 'editor',
+ name: 'jsonLineSchemaText',
+ label: 'JSON格式',
+ language: 'json',
+ },
+ {
+ visibleOn: "${formatType === 'CSV' && !detail}",
+ type: 'json-schema-editor',
+ name: 'csvSchema',
+ label: 'CSV格式',
+ description: '请定义单行数据中各个字段的格式(使用JSON Schema格式)',
+ required: true,
+ enableAdvancedSetting: true,
+ mini: true,
+ disabledTypes: [
+ 'object',
+ 'array',
+ 'null',
+ ]
+ },
+ {
+ visibleOn: "${formatType === 'CSV' && detail}",
+ type: 'editor',
+ name: 'csvSchemaText',
+ label: 'JSON格式',
+ language: 'json',
+ },
+ formInputSingleFileStatic('exampleFile', '资源示例'),
+ {
+ visibleOn: "${!detail}",
+ type: 'input-file',
+ label: '资源示例',
+ name: 'exampleFile',
+ description: '可以上传用于作为格式示范的样例数据',
+ multiple: false,
+ joinValues: false,
+ ...inputFileFormItemCommonOptions(undefined, size500MB),
+ },
+ ]
+ },
+ ...(showCreatedUserAndModifiedUser ? formCreatedUserAndModifiedUser() : [])
+ ]
+ }
}
export function resourceAddDialog() {
- return {
- actionType: 'dialog',
- dialog: {
- title: '新增数据资源',
- size: 'md',
- actions: [
- {
- type: 'reset',
- label: '重置',
- },
- {
- type: 'submit',
- label: '确定',
- level: 'primary',
- }
- ],
- body: {
- ...detailForm(),
- api: apiPost('${base}/data_resource/save'),
- data: {
- add: true,
- }
- }
+ return {
+ actionType: 'dialog',
+ dialog: {
+ title: '新增数据资源',
+ size: 'md',
+ actions: [
+ {
+ type: 'reset',
+ label: '重置',
+ },
+ {
+ type: 'submit',
+ label: '确定',
+ level: 'primary',
}
+ ],
+ body: {
+ ...detailForm(),
+ api: apiPost('${base}/data_resource/save'),
+ data: {
+ add: true,
+ }
+ }
}
+ }
}
export function resourceDetailDialog(field = 'id') {
- return {
- actionType: 'dialog',
- dialog: {
- title: '账号详情',
- actions: [],
- size: 'md',
- body: {
- ...detailForm(true),
- static: true,
- initApi: apiGet(`\${base}/data_resource/detail/\${${field}}`),
- data: {
- detail: true,
- }
- },
+ return {
+ actionType: 'dialog',
+ dialog: {
+ title: '账号详情',
+ actions: [],
+ size: 'md',
+ body: {
+ ...detailForm(true),
+ static: true,
+ initApi: apiGet(`\${base}/data_resource/detail/\${${field}}`),
+ data: {
+ detail: true,
}
+ },
}
+ }
}
export function resourceEditeDialog() {
- return {
- actionType: 'dialog',
- dialog: {
- title: '账号详情',
- size: 'md',
- actions: [
- {
- type: 'reset',
- label: '重置',
- },
- {
- type: 'submit',
- label: '确定',
- level: 'primary',
- }
- ],
- body: {
- ...detailForm(),
- api: apiPost('${base}/data_resource/save'),
- initApi: apiGet('${base}/data_resource/detail/${id}'),
- data: {
- edit: true,
- }
- },
+ return {
+ actionType: 'dialog',
+ dialog: {
+ title: '账号详情',
+ size: 'md',
+ actions: [
+ {
+ type: 'reset',
+ label: '重置',
+ },
+ {
+ type: 'submit',
+ label: '确定',
+ level: 'primary',
}
+ ],
+ body: {
+ ...detailForm(),
+ api: apiPost('${base}/data_resource/save'),
+ initApi: apiGet('${base}/data_resource/detail/${id}'),
+ data: {
+ edit: true,
+ }
+ },
}
+ }
}
\ No newline at end of file
diff --git a/gringotts-frontend/components/user/dialog-user-change-password.js b/gringotts-frontend/components/user/dialog-user-change-password.js
index f036c05..0c3ce5f 100644
--- a/gringotts-frontend/components/user/dialog-user-change-password.js
+++ b/gringotts-frontend/components/user/dialog-user-change-password.js
@@ -1,38 +1,38 @@
-import {horizontalFormOptions, apiPost} from '../constants.js'
+import {apiPost, horizontalFormOptions} from '../constants.js'
import {confirmPasswordFormItem, passwordFormItem} from "./dialog-user-item.js";
export function userChangePasswordDialog() {
- return {
- actionType: 'dialog',
- dialog: {
- title: '修改密码',
- actions: [
- {
- type: 'reset',
- label: '清空',
- },
- {
- type: 'submit',
- label: '修改',
- level: 'primary',
- }
- ],
- body: {
- type: 'form',
- api: apiPost('${base}/user_management/change_password'),
- ...horizontalFormOptions(),
- body: [
- {
- type: 'input-password',
- name: 'oldPassword',
- label: '旧密码',
- placeholder: '请输入旧密码',
- required: true,
- },
- passwordFormItem('newPassword', '新密码'),
- confirmPasswordFormItem('confirmNewPassword', 'newPassword', '新密码'),
- ]
- }
+ return {
+ actionType: 'dialog',
+ dialog: {
+ title: '修改密码',
+ actions: [
+ {
+ type: 'reset',
+ label: '清空',
+ },
+ {
+ type: 'submit',
+ label: '修改',
+ level: 'primary',
}
+ ],
+ body: {
+ type: 'form',
+ api: apiPost('${base}/user_management/change_password'),
+ ...horizontalFormOptions(),
+ body: [
+ {
+ type: 'input-password',
+ name: 'oldPassword',
+ label: '旧密码',
+ placeholder: '请输入旧密码',
+ required: true,
+ },
+ passwordFormItem('newPassword', '新密码'),
+ confirmPasswordFormItem('confirmNewPassword', 'newPassword', '新密码'),
+ ]
+ }
}
+ }
}
\ No newline at end of file
diff --git a/gringotts-frontend/components/user/dialog-user-check.js b/gringotts-frontend/components/user/dialog-user-check.js
index 071c706..b847817 100644
--- a/gringotts-frontend/components/user/dialog-user-check.js
+++ b/gringotts-frontend/components/user/dialog-user-check.js
@@ -1,106 +1,106 @@
import {
- apiGet,
- formCreatedUserAndModifiedUser,
- horizontalFormOptions,
- mappingField,
- userRoleMapping,
- userStateMapping
+ apiGet,
+ formCreatedUserAndModifiedUser,
+ horizontalFormOptions,
+ mappingField,
+ userRoleMapping,
+ userStateMapping
} from "../constants.js";
const dialogBody = [
- {
- type: 'input-email',
- name: 'username',
- label: '邮箱',
- },
- {
- type: 'group',
- body: [
- {
- type: 'control',
- label: '角色',
- body: mappingField('role', '角色', userRoleMapping, 120),
- },
- {
- type: 'control',
- label: '账号状态',
- body: mappingField('state', '账号状态', userStateMapping),
- }
- ]
- },
- ...formCreatedUserAndModifiedUser(),
- {
- type: 'group',
- body: [
- {
- type: 'input-text',
- name: 'checkedUsername',
- label: '审核人',
- },
- {
- type: 'input-datetime',
- name: 'checkedTime',
- label: '审核时间',
- },
- ]
- },
+ {
+ type: 'input-email',
+ name: 'username',
+ label: '邮箱',
+ },
+ {
+ type: 'group',
+ body: [
+ {
+ type: 'control',
+ label: '角色',
+ body: mappingField('role', '角色', userRoleMapping, 120),
+ },
+ {
+ type: 'control',
+ label: '账号状态',
+ body: mappingField('state', '账号状态', userStateMapping),
+ }
+ ]
+ },
+ ...formCreatedUserAndModifiedUser(),
+ {
+ type: 'group',
+ body: [
+ {
+ type: 'input-text',
+ name: 'checkedUsername',
+ label: '审核人',
+ },
+ {
+ type: 'input-datetime',
+ name: 'checkedTime',
+ label: '审核时间',
+ },
+ ]
+ },
]
export function userDetailDialog() {
- return {
- actionType: 'dialog',
- dialog: {
- title: '账号详情',
- actions: [],
- size: 'md',
- body: {
- type: 'form',
- initApi: apiGet('${base}/user_management/detail/${username}'),
- ...horizontalFormOptions(),
- horizontal: {
- left: 2,
- },
- static: true,
- body: [
- ...dialogBody,
- {
- type: 'input-datetime',
- name: 'lastLoginTime',
- label: '上次登陆时间',
- },
- ],
- }
- }
+ return {
+ actionType: 'dialog',
+ dialog: {
+ title: '账号详情',
+ actions: [],
+ size: 'md',
+ body: {
+ type: 'form',
+ initApi: apiGet('${base}/user_management/detail/${username}'),
+ ...horizontalFormOptions(),
+ horizontal: {
+ left: 2,
+ },
+ static: true,
+ body: [
+ ...dialogBody,
+ {
+ type: 'input-datetime',
+ name: 'lastLoginTime',
+ label: '上次登陆时间',
+ },
+ ],
+ }
}
+ }
}
export function userCheckDialog() {
- return {
- actionType: 'dialog',
- dialog: {
- title: '账号审核',
- actions: [
- {
- type: 'action',
- label: '同意',
- level: 'primary',
- actionType: 'submit',
- confirmTitle: '审核通过',
- confirmText: '确认通过账号为${username}通过审核吗?审核通过后将无法撤销。',
- },
- ],
- size: 'md',
- body: {
- type: 'form',
- api: apiGet('${base}/user_management/check/${username}'),
- initApi: apiGet('${base}/user_management/detail/${username}'),
- ...horizontalFormOptions(),
- horizontal: {
- left: 2,
- },
- static: true,
- body: dialogBody,
- }
- }
+ return {
+ actionType: 'dialog',
+ dialog: {
+ title: '账号审核',
+ actions: [
+ {
+ type: 'action',
+ label: '同意',
+ level: 'primary',
+ actionType: 'submit',
+ confirmTitle: '审核通过',
+ confirmText: '确认通过账号为${username}通过审核吗?审核通过后将无法撤销。',
+ },
+ ],
+ size: 'md',
+ body: {
+ type: 'form',
+ api: apiGet('${base}/user_management/check/${username}'),
+ initApi: apiGet('${base}/user_management/detail/${username}'),
+ ...horizontalFormOptions(),
+ horizontal: {
+ left: 2,
+ },
+ static: true,
+ body: dialogBody,
+ }
}
+ }
}
\ No newline at end of file
diff --git a/gringotts-frontend/components/user/dialog-user-item.js b/gringotts-frontend/components/user/dialog-user-item.js
index b8827e9..671d0c4 100644
--- a/gringotts-frontend/components/user/dialog-user-item.js
+++ b/gringotts-frontend/components/user/dialog-user-item.js
@@ -1,49 +1,49 @@
export function emailFormItem(name) {
- return {
- type: 'input-email',
- name: name,
- label: '邮箱',
- placeholder: '请输入邮箱',
- required: true,
- clearable: true,
- clearValueOnEmpty: true,
- validateApi: '${base}/user/exists_username/${username}',
- }
+ return {
+ type: 'input-email',
+ name: name,
+ label: '邮箱',
+ placeholder: '请输入邮箱',
+ required: true,
+ clearable: true,
+ clearValueOnEmpty: true,
+ validateApi: '${base}/user/exists_username/${username}',
+ }
}
export function passwordFormItem(name, label = '密码') {
- return {
- type: 'input-password',
- name: name,
- label: label,
- placeholder: `请输入${label}`,
- required: true,
- clearable: true,
- clearValueOnEmpty: true,
- validations: {
- matchRegexp:
- /^(?=.*\d)(?!.*(\d)\1{2})(?!.*(012|123|234|345|456|567|678|789|987|876|765|654|543|432|321|210))(?=.*[a-zA-Z])(?=.*[^\da-zA-Z\s]).{8,16}$/,
- },
- validationErrors: {
- matchRegexp:
- `${label}至少包含字母、数字、特殊字符,8-16位,并且不能连续出现3个大小连续或相同的数字`,
- },
- }
+ return {
+ type: 'input-password',
+ name: name,
+ label: label,
+ placeholder: `请输入${label}`,
+ required: true,
+ clearable: true,
+ clearValueOnEmpty: true,
+ validations: {
+ matchRegexp:
+ /^(?=.*\d)(?!.*(\d)\1{2})(?!.*(012|123|234|345|456|567|678|789|987|876|765|654|543|432|321|210))(?=.*[a-zA-Z])(?=.*[^\da-zA-Z\s]).{8,16}$/,
+ },
+ validationErrors: {
+ matchRegexp:
+ `${label}至少包含字母、数字、特殊字符,8-16位,并且不能连续出现3个大小连续或相同的数字`,
+ },
+ }
}
export function confirmPasswordFormItem(name, target, label = '密码') {
- return {
- type: 'input-password',
- name: name,
- label: `确认${label}`,
- placeholder: `请再次输入${label}`,
- required: true,
- clearable: true,
- validations: {
- equalsField: target,
- },
- validationErrors: {
- equalsField: `两次输入${label}不一致`,
- },
- }
+ return {
+ type: 'input-password',
+ name: name,
+ label: `确认${label}`,
+ placeholder: `请再次输入${label}`,
+ required: true,
+ clearable: true,
+ validations: {
+ equalsField: target,
+ },
+ validationErrors: {
+ equalsField: `两次输入${label}不一致`,
+ },
+ }
}
\ No newline at end of file
diff --git a/gringotts-frontend/components/user/dialog-user-register.js b/gringotts-frontend/components/user/dialog-user-register.js
index df3a445..657f1a2 100644
--- a/gringotts-frontend/components/user/dialog-user-register.js
+++ b/gringotts-frontend/components/user/dialog-user-register.js
@@ -32,9 +32,9 @@ export function userRegisterDialog() {
required: true,
selectFirst: true,
options: [
- { label: '数据提供方', value: 'PROVIDER' },
- { label: '数据使用方', value: 'CUSTOMER' },
- { label: '审查监管方', value: 'CHECKER' },
+ {label: '数据提供方', value: 'PROVIDER'},
+ {label: '数据使用方', value: 'CUSTOMER'},
+ {label: '审查监管方', value: 'CHECKER'},
],
},
],
@@ -76,9 +76,9 @@ export function userAdministratorRegisterDialog() {
inline: false,
columnsCount: 2,
options: [
- { label: '数据提供方', value: 'PROVIDER' },
- { label: '数据使用方', value: 'CUSTOMER' },
- { label: '审查监管方', value: 'CHECKER' },
+ {label: '数据提供方', value: 'PROVIDER'},
+ {label: '数据使用方', value: 'CUSTOMER'},
+ {label: '审查监管方', value: 'CHECKER'},
],
},
],
diff --git a/gringotts-frontend/components/ware/dialog-ware.js b/gringotts-frontend/components/ware/dialog-ware.js
index 35c608a..fa98752 100644
--- a/gringotts-frontend/components/ware/dialog-ware.js
+++ b/gringotts-frontend/components/ware/dialog-ware.js
@@ -4,188 +4,188 @@ import {resourceList} from '../../pages/index/tab-data.js'
import {resourceDetailDialog} from '../resource/dialog-resource.js'
function detailForm() {
- return {
- id: 'ware-form',
- debug: information.debug,
- type: 'form',
- ...horizontalFormOptions(),
- horizontal: {
- left: 2,
+ return {
+ id: 'ware-form',
+ debug: information.debug,
+ type: 'form',
+ ...horizontalFormOptions(),
+ horizontal: {
+ left: 2,
+ },
+ body: [
+ {
+ type: 'hidden',
+ name: 'id',
+ },
+ {
+ visibleOn: '${!detail}',
+ type: 'input-image',
+ name: 'icon',
+ label: '图标',
+ required: true,
+ receiver: apiPost("${base}/upload"),
+ onEvent: {
+ success: {
+ actions: [
+ {
+ actionType: 'setValue',
+ componentId: 'ware-form',
+ args: {
+ value: {
+ iconId: '${event.data.result.id}'
+ }
+ }
+ }
+ ]
+ }
+ }
+ },
+ {
+ visibleOn: '${detail}',
+ type: 'control',
+ name: 'icon',
+ label: '图标',
+ required: true,
+ body: {
+ type: 'image',
+ src: '${icon}',
+ innerClassName: 'no-border',
+ }
+ },
+ {
+ type: 'picker',
+ name: 'resourceId',
+ label: '数据资源',
+ required: true,
+ multiple: false,
+ size: 'md',
+ valueField: 'id',
+ labelField: 'name',
+ source: apiGet('${base}/data_resource/list_no_ware'),
+ pickerSchema: {
+ ...resourceList(),
},
- body: [
- {
- type: 'hidden',
- name: 'id',
- },
- {
- visibleOn: '${!detail}',
- type: 'input-image',
- name: 'icon',
- label: '图标',
- required: true,
- receiver: apiPost("${base}/upload"),
- onEvent: {
- success: {
- actions: [
- {
- actionType: 'setValue',
- componentId: 'ware-form',
- args: {
- value: {
- iconId: '${event.data.result.id}'
- }
- }
- }
- ]
- }
- }
- },
- {
- visibleOn: '${detail}',
- type: 'control',
- name: 'icon',
- label: '图标',
- required: true,
- body: {
- type: 'image',
- src: '${icon}',
- innerClassName: 'no-border',
- }
- },
- {
- type: 'picker',
- name: 'resourceId',
- label: '数据资源',
- required: true,
- multiple: false,
- size: 'md',
- valueField: 'id',
- labelField: 'name',
- source: apiGet('${base}/data_resource/list_no_ware'),
- pickerSchema: {
- ...resourceList(),
- },
- staticSchema: {
- type: 'tpl',
- tpl: "${resourceName}",
- onEvent: {
- click: {
- actions: [
- {
- actionType: 'dialog',
- ...resourceDetailDialog('resourceId'),
- }
- ]
- }
- }
- }
- },
- {
- type: 'input-text',
- name: 'name',
- label: '商品名称',
- maxLength: 10,
- showCounter: true,
- required: true,
- ...formInputClearable,
- },
- {
- type: 'textarea',
- name: 'description',
- label: '商品简介',
- required: true,
- ...formInputClearable,
- showCounter: true,
- trimContents: true,
- minRows: 2,
- maxRows: 2,
- },
- {
- type: 'input-rich-text',
- name: 'content',
- label: '商品详情',
- required: true,
- receiver: apiPost("${base}/upload"),
- options: {
- min_height: 300,
+ staticSchema: {
+ type: 'tpl',
+ tpl: "${resourceName}",
+ onEvent: {
+ click: {
+ actions: [
+ {
+ actionType: 'dialog',
+ ...resourceDetailDialog('resourceId'),
}
+ ]
}
- ]
- }
+ }
+ }
+ },
+ {
+ type: 'input-text',
+ name: 'name',
+ label: '商品名称',
+ maxLength: 10,
+ showCounter: true,
+ required: true,
+ ...formInputClearable,
+ },
+ {
+ type: 'textarea',
+ name: 'description',
+ label: '商品简介',
+ required: true,
+ ...formInputClearable,
+ showCounter: true,
+ trimContents: true,
+ minRows: 2,
+ maxRows: 2,
+ },
+ {
+ type: 'input-rich-text',
+ name: 'content',
+ label: '商品详情',
+ required: true,
+ receiver: apiPost("${base}/upload"),
+ options: {
+ min_height: 300,
+ }
+ }
+ ]
+ }
}
export function wareAddDialog() {
- return {
- actionType: 'dialog',
- dialog: {
- title: '上架数据产品',
- size: 'md',
- actions: [
- {
- type: 'reset',
- label: '重置',
- },
- {
- type: 'submit',
- label: '确定',
- level: 'primary',
- }
- ],
- body: {
- ...detailForm(),
- api: apiPost(`\${base}/ware/save`),
- data: {
- add: true,
- }
- }
+ return {
+ actionType: 'dialog',
+ dialog: {
+ title: '上架数据产品',
+ size: 'md',
+ actions: [
+ {
+ type: 'reset',
+ label: '重置',
+ },
+ {
+ type: 'submit',
+ label: '确定',
+ level: 'primary',
}
+ ],
+ body: {
+ ...detailForm(),
+ api: apiPost(`\${base}/ware/save`),
+ data: {
+ add: true,
+ }
+ }
}
+ }
}
export function wareDetailDialog(field = 'id', actions = []) {
- return {
- actionType: 'dialog',
- dialog: {
- title: '数据产品详情',
- size: 'md',
- actions: actions,
- body: {
- ...detailForm(),
- initApi: apiGet(`\${base}/ware/detail/\${${field}}`),
- static: true,
- data: {
- detail: true,
- }
- }
+ return {
+ actionType: 'dialog',
+ dialog: {
+ title: '数据产品详情',
+ size: 'md',
+ actions: actions,
+ body: {
+ ...detailForm(),
+ initApi: apiGet(`\${base}/ware/detail/\${${field}}`),
+ static: true,
+ data: {
+ detail: true,
}
+ }
}
+ }
}
export function wareEditeDialog() {
- return {
- actionType: 'dialog',
- dialog: {
- title: '数据产品详情',
- size: 'md',
- actions: [
- {
- type: 'reset',
- label: '重置',
- },
- {
- type: 'submit',
- label: '确定',
- level: 'primary',
- }
- ],
- body: {
- ...detailForm(),
- api: apiPost(`\${base}/ware/save`),
- initApi: apiGet(`\${base}/ware/detail/\${id}`),
- data: {
- edit: true
- }
- },
+ return {
+ actionType: 'dialog',
+ dialog: {
+ title: '数据产品详情',
+ size: 'md',
+ actions: [
+ {
+ type: 'reset',
+ label: '重置',
+ },
+ {
+ type: 'submit',
+ label: '确定',
+ level: 'primary',
}
+ ],
+ body: {
+ ...detailForm(),
+ api: apiPost(`\${base}/ware/save`),
+ initApi: apiGet(`\${base}/ware/detail/\${id}`),
+ data: {
+ edit: true
+ }
+ },
}
+ }
}
diff --git a/gringotts-frontend/pages/index/index.html b/gringotts-frontend/pages/index/index.html
index dae0101..82658dd 100644
--- a/gringotts-frontend/pages/index/index.html
+++ b/gringotts-frontend/pages/index/index.html
@@ -2,7 +2,7 @@
-
+
@@ -20,6 +20,6 @@
-
+
diff --git a/gringotts-frontend/pages/index/main.js b/gringotts-frontend/pages/index/main.js
index ec62db0..6b6aabf 100644
--- a/gringotts-frontend/pages/index/main.js
+++ b/gringotts-frontend/pages/index/main.js
@@ -8,66 +8,66 @@ import {tabPermissions} from "./tab-permissions.js";
import {tabMarket} from "./tab-market.js";
useAmis(information => {
- return {
- id: 'header-service',
- className: 'h-full',
- type: 'service',
- api: apiGet('${base}/user/state'),
- onEvent: {
- fetchInited: {
- actions: [
- {
- expression: '${!event.data.responseData.token}',
- actionType: 'url',
- args: {
- url: '/pages/login/index.html',
- blank: false,
- }
- }
- ]
- }
- },
- body: [
- {
- type: 'page',
- title: information.title,
- subTitle: '提供合法合规的数据要素可信供给工具',
- toolbar: [
- {
- type: 'dropdown-button',
- label: '${username}',
- align: 'right',
- trigger: 'hover',
- buttons: [
- {
- label: '修改密码',
- ...userChangePasswordDialog(),
- },
- {
- label: '退出登陆',
- actionType: 'ajax',
- api: apiGet('${base}/user/logout'),
- reload: 'header-service',
- }
- ]
- }
- ],
- bodyClassName: 'p-0',
- body: {
- className: 'h-full border-0',
- type: 'tabs',
- tabsMode: 'vertical',
- tabs: [
- // tabOverview(),
- tabMarket(),
- tabPermissions(),
- tabCheck(),
- tabData(),
- tabUser(),
- tabSettings(),
- ]
- },
+ return {
+ id: 'header-service',
+ className: 'h-full',
+ type: 'service',
+ api: apiGet('${base}/user/state'),
+ onEvent: {
+ fetchInited: {
+ actions: [
+ {
+ expression: '${!event.data.responseData.token}',
+ actionType: 'url',
+ args: {
+ url: '/pages/login/index.html',
+ blank: false,
}
+ }
]
- }
+ }
+ },
+ body: [
+ {
+ type: 'page',
+ title: information.title,
+ subTitle: '提供合法合规的数据要素可信供给工具',
+ toolbar: [
+ {
+ type: 'dropdown-button',
+ label: '${username}',
+ align: 'right',
+ trigger: 'hover',
+ buttons: [
+ {
+ label: '修改密码',
+ ...userChangePasswordDialog(),
+ },
+ {
+ label: '退出登陆',
+ actionType: 'ajax',
+ api: apiGet('${base}/user/logout'),
+ reload: 'header-service',
+ }
+ ]
+ }
+ ],
+ bodyClassName: 'p-0',
+ body: {
+ className: 'h-full border-0',
+ type: 'tabs',
+ tabsMode: 'vertical',
+ tabs: [
+ // tabOverview(),
+ tabMarket(),
+ tabPermissions(),
+ tabCheck(),
+ tabData(),
+ tabUser(),
+ tabSettings(),
+ ]
+ },
+ }
+ ]
+ }
})
diff --git a/gringotts-frontend/pages/index/tab-check.js b/gringotts-frontend/pages/index/tab-check.js
index 1a185e2..ee87fdf 100644
--- a/gringotts-frontend/pages/index/tab-check.js
+++ b/gringotts-frontend/pages/index/tab-check.js
@@ -1,146 +1,146 @@
import {
- apiGet,
- checkerOnly,
- checkOverMapping,
- checkTypeMapping,
- crudCommonOptions,
- mappingField,
- operationField,
- stringField,
- timeField,
+ apiGet,
+ checkerOnly,
+ checkOverMapping,
+ checkTypeMapping,
+ crudCommonOptions,
+ mappingField,
+ operationField,
+ stringField,
+ timeField,
} from "../../components/constants.js";
import {authenticationDetailDialog, confirmationDetailDialog} from "../../components/permission/dialog-permission.js";
import {wareDetailDialog} from "../../components/ware/dialog-ware.js";
export function tabCheck() {
- return {
- visibleOn: checkerOnly,
- title: '审核审查',
- icon: 'fa fa-shield-halved',
- reload: true,
- body: [
- {
- name: 'check_order_list',
- type: 'crud',
- api: apiGet('${base}/check_order/list'),
- ...crudCommonOptions(),
- headerToolbar: [
- 'reload',
- ],
- columns: [
- stringField('description', '描述'),
- mappingField('type', '类型', checkTypeMapping),
- mappingField('state', '状态', checkOverMapping),
- timeField('createdTime', '创建时间'),
- stringField('createdUsername', '创建人', 100),
- timeField('modifiedTime', '最后修改时间'),
- stringField('modifiedUsername', '最后操作人', 100),
- operationField('操作', undefined, [
- {
- visibleOn: `\${type === 'CONFIRMATION' && state === 'CHECKING'}`,
- type: 'action',
- label: '处理',
- level: 'link',
- ...confirmationDetailDialog(
- 'parameters.confirmationId',
- [
- {
- type: 'action',
- label: '同意',
- actionType: 'ajax',
- close: true,
- api: apiGet('${base}/check_order/operation/${checkOrderId}/APPLY'),
- reload: 'check_order_list',
- },
- {
- type: 'action',
- label: '拒绝',
- actionType: 'ajax',
- close: true,
- api: apiGet('${base}/check_order/operation/${checkOrderId}/REJECT'),
- reload: 'check_order_list',
- },
- ],
- ),
- },
- {
- visibleOn: `\${type === 'CONFIRMATION' && state !== NORMAL}`,
- type: 'action',
- label: '查看',
- level: 'link',
- ...confirmationDetailDialog('parameters.confirmationId'),
- },
- {
- visibleOn: `\${type === 'AUTHENTICATION' && state === 'CHECKING'}`,
- type: 'action',
- label: '处理',
- level: 'link',
- ...authenticationDetailDialog(
- 'parameters.authenticationId',
- [
- {
- type: 'action',
- label: '同意',
- actionType: 'ajax',
- close: true,
- api: apiGet('${base}/check_order/operation/${checkOrderId}/APPLY'),
- reload: 'check_order_list',
- },
- {
- type: 'action',
- label: '拒绝',
- actionType: 'ajax',
- close: true,
- api: apiGet('${base}/check_order/operation/${checkOrderId}/REJECT'),
- reload: 'check_order_list',
- },
- ],
- ),
- },
- {
- visibleOn: `\${type === 'AUTHENTICATION' && state !== NORMAL}`,
- type: 'action',
- label: '查看',
- level: 'link',
- ...authenticationDetailDialog('parameters.authenticationId'),
- },
- {
- visibleOn: `\${type === 'MARKET' && state === 'CHECKING'}`,
- type: 'action',
- label: '处理',
- level: 'link',
- ...wareDetailDialog(
- 'parameters.wareId',
- [
- {
- type: 'action',
- label: '同意',
- actionType: 'ajax',
- close: true,
- api: apiGet('${base}/check_order/operation/${checkOrderId}/APPLY'),
- reload: 'check_order_list',
- },
- {
- type: 'action',
- label: '拒绝',
- actionType: 'ajax',
- close: true,
- api: apiGet('${base}/check_order/operation/${checkOrderId}/REJECT'),
- reload: 'check_order_list',
- },
- ],
- ),
- },
- {
- visibleOn: `\${type === 'MARKET' && state !== NORMAL}`,
- type: 'action',
- label: '查看',
- level: 'link',
- ...wareDetailDialog('parameters.wareId'),
- },
- ]),
- ],
- },
+ return {
+ visibleOn: checkerOnly,
+ title: '审核审查',
+ icon: 'fa fa-shield-halved',
+ reload: true,
+ body: [
+ {
+ name: 'check_order_list',
+ type: 'crud',
+ api: apiGet('${base}/check_order/list'),
+ ...crudCommonOptions(),
+ headerToolbar: [
+ 'reload',
],
- }
+ columns: [
+ stringField('description', '描述'),
+ mappingField('type', '类型', checkTypeMapping),
+ mappingField('state', '状态', checkOverMapping),
+ timeField('createdTime', '创建时间'),
+ stringField('createdUsername', '创建人', 100),
+ timeField('modifiedTime', '最后修改时间'),
+ stringField('modifiedUsername', '最后操作人', 100),
+ operationField('操作', undefined, [
+ {
+ visibleOn: `\${type === 'CONFIRMATION' && state === 'CHECKING'}`,
+ type: 'action',
+ label: '处理',
+ level: 'link',
+ ...confirmationDetailDialog(
+ 'parameters.confirmationId',
+ [
+ {
+ type: 'action',
+ label: '同意',
+ actionType: 'ajax',
+ close: true,
+ api: apiGet('${base}/check_order/operation/${checkOrderId}/APPLY'),
+ reload: 'check_order_list',
+ },
+ {
+ type: 'action',
+ label: '拒绝',
+ actionType: 'ajax',
+ close: true,
+ api: apiGet('${base}/check_order/operation/${checkOrderId}/REJECT'),
+ reload: 'check_order_list',
+ },
+ ],
+ ),
+ },
+ {
+ visibleOn: `\${type === 'CONFIRMATION' && state !== NORMAL}`,
+ type: 'action',
+ label: '查看',
+ level: 'link',
+ ...confirmationDetailDialog('parameters.confirmationId'),
+ },
+ {
+ visibleOn: `\${type === 'AUTHENTICATION' && state === 'CHECKING'}`,
+ type: 'action',
+ label: '处理',
+ level: 'link',
+ ...authenticationDetailDialog(
+ 'parameters.authenticationId',
+ [
+ {
+ type: 'action',
+ label: '同意',
+ actionType: 'ajax',
+ close: true,
+ api: apiGet('${base}/check_order/operation/${checkOrderId}/APPLY'),
+ reload: 'check_order_list',
+ },
+ {
+ type: 'action',
+ label: '拒绝',
+ actionType: 'ajax',
+ close: true,
+ api: apiGet('${base}/check_order/operation/${checkOrderId}/REJECT'),
+ reload: 'check_order_list',
+ },
+ ],
+ ),
+ },
+ {
+ visibleOn: `\${type === 'AUTHENTICATION' && state !== NORMAL}`,
+ type: 'action',
+ label: '查看',
+ level: 'link',
+ ...authenticationDetailDialog('parameters.authenticationId'),
+ },
+ {
+ visibleOn: `\${type === 'MARKET' && state === 'CHECKING'}`,
+ type: 'action',
+ label: '处理',
+ level: 'link',
+ ...wareDetailDialog(
+ 'parameters.wareId',
+ [
+ {
+ type: 'action',
+ label: '同意',
+ actionType: 'ajax',
+ close: true,
+ api: apiGet('${base}/check_order/operation/${checkOrderId}/APPLY'),
+ reload: 'check_order_list',
+ },
+ {
+ type: 'action',
+ label: '拒绝',
+ actionType: 'ajax',
+ close: true,
+ api: apiGet('${base}/check_order/operation/${checkOrderId}/REJECT'),
+ reload: 'check_order_list',
+ },
+ ],
+ ),
+ },
+ {
+ visibleOn: `\${type === 'MARKET' && state !== NORMAL}`,
+ type: 'action',
+ label: '查看',
+ level: 'link',
+ ...wareDetailDialog('parameters.wareId'),
+ },
+ ]),
+ ],
+ },
+ ],
+ }
}
\ No newline at end of file
diff --git a/gringotts-frontend/pages/index/tab-data.js b/gringotts-frontend/pages/index/tab-data.js
index abc0ebe..38b8b82 100644
--- a/gringotts-frontend/pages/index/tab-data.js
+++ b/gringotts-frontend/pages/index/tab-data.js
@@ -1,94 +1,94 @@
import {
- resourceAddDialog,
- resourceDetailDialog,
- resourceEditeDialog
+ resourceAddDialog,
+ resourceDetailDialog,
+ resourceEditeDialog
} from "../../components/resource/dialog-resource.js";
import {
- apiGet,
- arrayInCheck,
- arrayOutCheck,
- checkState,
- crudCommonOptions,
- mappingField,
- operationField,
- permissionStateMapping,
- timeField,
- userOnly
+ apiGet,
+ arrayInCheck,
+ arrayOutCheck,
+ checkState,
+ crudCommonOptions,
+ mappingField,
+ operationField,
+ permissionStateMapping,
+ timeField,
+ userOnly
} from "../../components/constants.js";
export function resourceList() {
- return {
- type: 'crud',
- api: apiGet('${base}/data_resource/list'),
- ...crudCommonOptions(),
- headerToolbar: [
- 'reload',
+ return {
+ type: 'crud',
+ api: apiGet('${base}/data_resource/list'),
+ ...crudCommonOptions(),
+ headerToolbar: [
+ 'reload',
+ {
+ type: 'action',
+ label: '',
+ icon: 'fa fa-plus',
+ ...resourceAddDialog()
+ },
+ ],
+ columns: [
+ {
+ label: '名称',
+ name: 'name',
+ width: 150,
+ },
+ {
+ label: '描述',
+ name: 'description',
+ },
+ mappingField('confirmationState', '确权状态', permissionStateMapping),
+ timeField('createdTime', '创建时间'),
+ operationField('操作', undefined, [
+ {
+ type: 'action',
+ label: '详情',
+ level: 'link',
+ ...resourceDetailDialog(),
+ },
+ {
+ type: 'dropdown-button',
+ level: 'link',
+ icon: 'fa fa-ellipsis-h',
+ hideCaret: true,
+ trigger: 'hover',
+ buttons: [
{
- type: 'action',
- label: '',
- icon: 'fa fa-plus',
- ...resourceAddDialog()
- },
- ],
- columns: [
- {
- label: '名称',
- name: 'name',
- width: 150,
+ disabledOn: arrayOutCheck([checkState.none, checkState.draft], 'confirmationState'),
+ disabledTip: '审查或确权成功后无法编辑',
+ tooltipPlacement: 'top',
+ type: 'action',
+ label: '编辑',
+ level: 'link',
+ ...resourceEditeDialog(),
},
{
- label: '描述',
- name: 'description',
+ disabledOn: arrayInCheck([checkState.checking], 'confirmationState'),
+ disabledTip: '审查中无法删除',
+ tooltipPlacement: 'bottom',
+ type: 'action',
+ label: "删除",
+ confirmTitle: '确认删除',
+ confirmText: '确认删除名称为「${name}」的数据资源吗?',
+ actionType: 'ajax',
+ api: apiGet('${base}/data_resource/remove/${id}')
},
- mappingField('confirmationState', '确权状态', permissionStateMapping),
- timeField('createdTime', '创建时间'),
- operationField('操作', undefined, [
- {
- type: 'action',
- label: '详情',
- level: 'link',
- ...resourceDetailDialog(),
- },
- {
- type: 'dropdown-button',
- level: 'link',
- icon: 'fa fa-ellipsis-h',
- hideCaret: true,
- trigger: 'hover',
- buttons: [
- {
- disabledOn: arrayOutCheck([checkState.none, checkState.draft], 'confirmationState'),
- disabledTip: '审查或确权成功后无法编辑',
- tooltipPlacement: 'top',
- type: 'action',
- label: '编辑',
- level: 'link',
- ...resourceEditeDialog(),
- },
- {
- disabledOn: arrayInCheck([checkState.checking], 'confirmationState'),
- disabledTip: '审查中无法删除',
- tooltipPlacement: 'bottom',
- type: 'action',
- label: "删除",
- confirmTitle: '确认删除',
- confirmText: '确认删除名称为「${name}」的数据资源吗?',
- actionType: 'ajax',
- api: apiGet('${base}/data_resource/remove/${id}')
- },
- ]
- },
- ]),
- ]
- }
+ ]
+ },
+ ]),
+ ]
+ }
}
export function tabData() {
- return {
- visibleOn: userOnly,
- title: '数据资源',
- icon: 'fa fa-database',
- reload: true,
- body: resourceList(),
- }
+ return {
+ visibleOn: userOnly,
+ title: '数据资源',
+ icon: 'fa fa-database',
+ reload: true,
+ body: resourceList(),
+ }
}
\ No newline at end of file
diff --git a/gringotts-frontend/pages/index/tab-market.js b/gringotts-frontend/pages/index/tab-market.js
index 07af0b1..cae211b 100644
--- a/gringotts-frontend/pages/index/tab-market.js
+++ b/gringotts-frontend/pages/index/tab-market.js
@@ -1,153 +1,153 @@
import {wareAddDialog, wareDetailDialog, wareEditeDialog} from "../../components/ware/dialog-ware.js";
import {
- apiGet,
- crudCommonOptions,
- mappingField,
- operationField,
- permissionStateMapping,
- timeField
+ apiGet,
+ crudCommonOptions,
+ mappingField,
+ operationField,
+ permissionStateMapping,
+ timeField
} from "../../components/constants.js";
import {authenticationAddDialog} from "../../components/permission/dialog-permission.js";
export function tabMarket() {
- return {
- title: '数据市场',
- icon: 'fa fa-store',
- reload: true,
- body: [
- {
- type: 'tabs',
- tabs: [
- {
- title: '公开数据',
- body: {
- type: 'crud',
- api: {
- ...apiGet('${base}/ware/list_public'),
- adaptor: (payload, response, api, context) => {
- payload.data = payload.data.map(i => {
- return {
- ...i,
- targetId: i.resourceId,
- }
- })
- return payload
- }
- },
- ...crudCommonOptions(),
- headerToolbar: [
- 'reload',
- ],
- mode: 'cards',
- card: {
- header: {
- title: '${name}',
- subTitle: '${createdTime}',
- description: '${description}',
- avatar: '${icon}',
- avatarClassName: 'pull-left thumb-md avatar b-3x m-r'
- },
- actions: [
- {
- type: 'action',
- label: '查看',
- ...wareDetailDialog(),
- },
- {
- type: 'action',
- label: '申请授权',
- ...authenticationAddDialog(),
- }
- ]
- },
- }
- },
- {
- title: '我的数据',
- body: {
- type: 'crud',
- api: apiGet('${base}/ware/list'),
- ...crudCommonOptions(),
- headerToolbar: [
- 'reload',
- {
- type: 'action',
- label: '',
- icon: 'fa fa-plus',
- ...wareAddDialog()
- },
- ],
- columns: [
- {
- name: 'name',
- label: '名称',
- width: 200,
- },
- {
- name: 'description',
- label: '描述',
- },
- mappingField('state', '状态', permissionStateMapping),
- timeField('createdTime', '创建时间'),
- operationField('操作', undefined, [
- {
- type: 'action',
- label: '查看',
- level: 'link',
- ...wareDetailDialog(),
- },
- {
- visibleOn: "${state === 'CHECKING'}",
- type: 'action',
- label: '撤销',
- level: 'link',
- confirmTitle: '确认撤销',
- confirmText: '确认撤销名称为「${name}」的确权申请吗?',
- actionType: 'ajax',
- api: apiGet('${base}/ware/retract/${id}'),
- },
- {
- visibleOn: "${state === 'DRAFT' || state === 'REJECT'}",
- type: 'action',
- label: '提交',
- level: 'link',
- confirmTitle: '确认提交',
- confirmText: '确认提交名称为「${name}」的确权申请吗?',
- actionType: 'ajax',
- api: apiGet('${base}/ware/submit/${id}'),
- },
- {
- visibleOn: "${!public}",
- type: 'dropdown-button',
- level: 'link',
- icon: 'fa fa-ellipsis-h',
- hideCaret: true,
- trigger: 'hover',
- buttons: [
- {
- disabledOn: "${state !== 'DRAFT'}",
- type: 'action',
- label: '编辑',
- level: 'link',
- ...wareEditeDialog(),
- },
- {
- disabledOn: "${state === 'CHECKING'}",
- type: 'action',
- label: "删除",
- confirmTitle: '确认删除',
- confirmText: '确认删除名称为「${name}」的确权申请吗?删除后对应的数据资源处于未确权状态。',
- actionType: 'ajax',
- api: apiGet('${base}/ware/remove/${id}'),
- },
- ]
- },
- ]),
- ]
- }
- },
+ return {
+ title: '数据市场',
+ icon: 'fa fa-store',
+ reload: true,
+ body: [
+ {
+ type: 'tabs',
+ tabs: [
+ {
+ title: '公开数据',
+ body: {
+ type: 'crud',
+ api: {
+ ...apiGet('${base}/ware/list_public'),
+ adaptor: (payload, response, api, context) => {
+ payload.data = payload.data.map(i => {
+ return {
+ ...i,
+ targetId: i.resourceId,
+ }
+ })
+ return payload
+ }
+ },
+ ...crudCommonOptions(),
+ headerToolbar: [
+ 'reload',
+ ],
+ mode: 'cards',
+ card: {
+ header: {
+ title: '${name}',
+ subTitle: '${createdTime}',
+ description: '${description}',
+ avatar: '${icon}',
+ avatarClassName: 'pull-left thumb-md avatar b-3x m-r'
+ },
+ actions: [
+ {
+ type: 'action',
+ label: '查看',
+ ...wareDetailDialog(),
+ },
+ {
+ type: 'action',
+ label: '申请授权',
+ ...authenticationAddDialog(),
+ }
]
+ },
}
+ },
+ {
+ title: '我的数据',
+ body: {
+ type: 'crud',
+ api: apiGet('${base}/ware/list'),
+ ...crudCommonOptions(),
+ headerToolbar: [
+ 'reload',
+ {
+ type: 'action',
+ label: '',
+ icon: 'fa fa-plus',
+ ...wareAddDialog()
+ },
+ ],
+ columns: [
+ {
+ name: 'name',
+ label: '名称',
+ width: 200,
+ },
+ {
+ name: 'description',
+ label: '描述',
+ },
+ mappingField('state', '状态', permissionStateMapping),
+ timeField('createdTime', '创建时间'),
+ operationField('操作', undefined, [
+ {
+ type: 'action',
+ label: '查看',
+ level: 'link',
+ ...wareDetailDialog(),
+ },
+ {
+ visibleOn: "${state === 'CHECKING'}",
+ type: 'action',
+ label: '撤销',
+ level: 'link',
+ confirmTitle: '确认撤销',
+ confirmText: '确认撤销名称为「${name}」的确权申请吗?',
+ actionType: 'ajax',
+ api: apiGet('${base}/ware/retract/${id}'),
+ },
+ {
+ visibleOn: "${state === 'DRAFT' || state === 'REJECT'}",
+ type: 'action',
+ label: '提交',
+ level: 'link',
+ confirmTitle: '确认提交',
+ confirmText: '确认提交名称为「${name}」的确权申请吗?',
+ actionType: 'ajax',
+ api: apiGet('${base}/ware/submit/${id}'),
+ },
+ {
+ visibleOn: "${!public}",
+ type: 'dropdown-button',
+ level: 'link',
+ icon: 'fa fa-ellipsis-h',
+ hideCaret: true,
+ trigger: 'hover',
+ buttons: [
+ {
+ disabledOn: "${state !== 'DRAFT'}",
+ type: 'action',
+ label: '编辑',
+ level: 'link',
+ ...wareEditeDialog(),
+ },
+ {
+ disabledOn: "${state === 'CHECKING'}",
+ type: 'action',
+ label: "删除",
+ confirmTitle: '确认删除',
+ confirmText: '确认删除名称为「${name}」的确权申请吗?删除后对应的数据资源处于未确权状态。',
+ actionType: 'ajax',
+ api: apiGet('${base}/ware/remove/${id}'),
+ },
+ ]
+ },
+ ]),
+ ]
+ }
+ },
]
- }
+ }
+ ]
+ }
}
\ No newline at end of file
diff --git a/gringotts-frontend/pages/index/tab-overview.js b/gringotts-frontend/pages/index/tab-overview.js
index a149562..be0abf6 100644
--- a/gringotts-frontend/pages/index/tab-overview.js
+++ b/gringotts-frontend/pages/index/tab-overview.js
@@ -1,9 +1,9 @@
export function tabOverview() {
- return {
- title: '概览',
- icon: 'fa fa-house',
- body: [
- 'hello world'
- ]
- }
+ return {
+ title: '概览',
+ icon: 'fa fa-house',
+ body: [
+ 'hello world'
+ ]
+ }
}
\ No newline at end of file
diff --git a/gringotts-frontend/pages/index/tab-permissions.js b/gringotts-frontend/pages/index/tab-permissions.js
index d6eaae8..bb84eed 100644
--- a/gringotts-frontend/pages/index/tab-permissions.js
+++ b/gringotts-frontend/pages/index/tab-permissions.js
@@ -1,196 +1,196 @@
import {
- apiGet,
- arrayInCheck,
- arrayOutCheck,
- checkState,
- crudCommonOptions,
- customerOnly,
- mappingField,
- operationField,
- permissionStateMapping,
- providerOnly,
- stringField,
- stringWrapField,
- timeField,
- userOnly,
+ apiGet,
+ arrayInCheck,
+ arrayOutCheck,
+ checkState,
+ crudCommonOptions,
+ customerOnly,
+ mappingField,
+ operationField,
+ permissionStateMapping,
+ providerOnly,
+ stringField,
+ stringWrapField,
+ timeField,
+ userOnly,
} from "../../components/constants.js";
import {
- authenticationAddDialog,
- authenticationDetailDialog,
- authenticationEditeDialog,
- confirmationAddDialog,
- confirmationDetailDialog,
- confirmationEditeDialog,
+ authenticationAddDialog,
+ authenticationDetailDialog,
+ authenticationEditeDialog,
+ confirmationAddDialog,
+ confirmationDetailDialog,
+ confirmationEditeDialog,
} from "../../components/permission/dialog-permission.js";
export function tabPermissions() {
- return {
- visibleOn: userOnly,
- title: '权属管理',
- icon: 'fa fa-key',
- reload: true,
- body: {
- type: 'tabs',
- tabs: [
+ return {
+ visibleOn: userOnly,
+ title: '权属管理',
+ icon: 'fa fa-key',
+ reload: true,
+ body: {
+ type: 'tabs',
+ tabs: [
+ {
+ visibleOn: providerOnly,
+ title: '确权管理',
+ body: {
+ type: 'crud',
+ api: {
+ ...apiGet('${base}/confirmation/list')
+ },
+ ...crudCommonOptions(),
+ headerToolbar: [
+ 'reload',
+ {
+ type: 'action',
+ label: '',
+ icon: 'fa fa-plus',
+ ...confirmationAddDialog()
+ },
+ ],
+ columns: [
+ stringField('name', '名称', 200),
+ stringWrapField('description', '描述'),
+ mappingField('state', '状态', permissionStateMapping),
+ timeField('createdTime', '创建时间'),
+ operationField('操作', undefined, [
{
- visibleOn: providerOnly,
- title: '确权管理',
- body: {
- type: 'crud',
- api: {
- ...apiGet('${base}/confirmation/list')
- },
- ...crudCommonOptions(),
- headerToolbar: [
- 'reload',
- {
- type: 'action',
- label: '',
- icon: 'fa fa-plus',
- ...confirmationAddDialog()
- },
- ],
- columns: [
- stringField('name', '名称', 200),
- stringWrapField('description', '描述'),
- mappingField('state', '状态', permissionStateMapping),
- timeField('createdTime', '创建时间'),
- operationField('操作', undefined, [
- {
- type: 'action',
- label: '查看',
- level: 'link',
- ...confirmationDetailDialog(),
- },
- {
- visibleOn: "${state === 'CHECKING'}",
- type: 'action',
- label: '撤销',
- level: 'link',
- confirmTitle: '确认撤销',
- confirmText: '确认撤销名称为「${name}」的确权申请吗?',
- actionType: 'ajax',
- api: apiGet('${base}/confirmation/retract/${id}'),
- },
- {
- visibleOn: "${state === 'DRAFT' || state === 'REJECT'}",
- type: 'action',
- label: '提交',
- level: 'link',
- confirmTitle: '确认提交',
- confirmText: '确认提交名称为「${name}」的确权申请吗?',
- actionType: 'ajax',
- api: apiGet('${base}/confirmation/submit/${id}'),
- },
- {
- type: 'dropdown-button',
- level: 'link',
- icon: 'fa fa-ellipsis-h',
- hideCaret: true,
- trigger: 'hover',
- buttons: [
- {
- disabledOn: "${state !== 'DRAFT'}",
- type: 'action',
- label: '编辑',
- level: 'link',
- ...confirmationEditeDialog(),
- },
- {
- disabledOn: "${state === 'CHECKING'}",
- type: 'action',
- label: "删除",
- confirmTitle: '确认删除',
- confirmText: '确认删除名称为「${name}」的确权申请吗?删除后对应的数据资源处于未确权状态。',
- actionType: 'ajax',
- api: apiGet('${base}/confirmation/remove/${id}'),
- },
- ]
- },
- ]),
- ]
- }
+ type: 'action',
+ label: '查看',
+ level: 'link',
+ ...confirmationDetailDialog(),
},
{
- visibleOn: customerOnly,
- title: '授权管理',
- body: {
- type: 'crud',
- api: {
- ...apiGet('${base}/authentication/list')
- },
- ...crudCommonOptions(),
- headerToolbar: [
- 'reload',
- {
- type: 'action',
- label: '',
- icon: 'fa fa-plus',
- ...authenticationAddDialog()
- },
- ],
- columns: [
- stringField('name', '名称', 200),
- stringWrapField('description', '描述'),
- mappingField('state', '状态', permissionStateMapping),
- timeField('createdTime', '创建时间'),
- operationField('操作', undefined, [
- {
- type: 'action',
- label: '查看',
- level: 'link',
- ...authenticationDetailDialog(),
- },
- {
- visibleOn: arrayInCheck([checkState.ownerChecking, checkState.checking], 'state'),
- type: 'action',
- label: '撤销',
- level: 'link',
- confirmTitle: '确认撤销',
- confirmText: '确认撤销名称为「${name}」的授权申请吗?',
- actionType: 'ajax',
- api: apiGet('${base}/authentication/retract/${id}'),
- },
- {
- visibleOn: arrayInCheck([checkState.draft], 'state'),
- type: 'action',
- label: '提交',
- level: 'link',
- confirmTitle: '确认提交',
- confirmText: '确认提交名称为「${name}」的授权申请吗?',
- actionType: 'ajax',
- api: apiGet('${base}/authentication/submit/${id}'),
- },
- {
- type: 'dropdown-button',
- level: 'link',
- icon: 'fa fa-ellipsis-h',
- hideCaret: true,
- trigger: 'hover',
- buttons: [
- {
- disabledOn: arrayOutCheck([checkState.draft], 'state'),
- type: 'action',
- label: '编辑',
- level: 'link',
- ...authenticationEditeDialog(),
- },
- {
- disabledOn: arrayInCheck([checkState.ownerChecking, checkState.checking], 'state'),
- type: 'action',
- label: "删除",
- confirmTitle: '确认删除',
- confirmText: '确认删除名称为「${name}」的确权申请吗?删除后对应的数据资源处于未确权状态。',
- actionType: 'ajax',
- api: apiGet('${base}/authentication/remove/${id}'),
- },
- ]
- },
- ]),
- ]
- }
+ visibleOn: "${state === 'CHECKING'}",
+ type: 'action',
+ label: '撤销',
+ level: 'link',
+ confirmTitle: '确认撤销',
+ confirmText: '确认撤销名称为「${name}」的确权申请吗?',
+ actionType: 'ajax',
+ api: apiGet('${base}/confirmation/retract/${id}'),
},
+ {
+ visibleOn: "${state === 'DRAFT' || state === 'REJECT'}",
+ type: 'action',
+ label: '提交',
+ level: 'link',
+ confirmTitle: '确认提交',
+ confirmText: '确认提交名称为「${name}」的确权申请吗?',
+ actionType: 'ajax',
+ api: apiGet('${base}/confirmation/submit/${id}'),
+ },
+ {
+ type: 'dropdown-button',
+ level: 'link',
+ icon: 'fa fa-ellipsis-h',
+ hideCaret: true,
+ trigger: 'hover',
+ buttons: [
+ {
+ disabledOn: "${state !== 'DRAFT'}",
+ type: 'action',
+ label: '编辑',
+ level: 'link',
+ ...confirmationEditeDialog(),
+ },
+ {
+ disabledOn: "${state === 'CHECKING'}",
+ type: 'action',
+ label: "删除",
+ confirmTitle: '确认删除',
+ confirmText: '确认删除名称为「${name}」的确权申请吗?删除后对应的数据资源处于未确权状态。',
+ actionType: 'ajax',
+ api: apiGet('${base}/confirmation/remove/${id}'),
+ },
+ ]
+ },
+ ]),
]
- }
+ }
+ },
+ {
+ visibleOn: customerOnly,
+ title: '授权管理',
+ body: {
+ type: 'crud',
+ api: {
+ ...apiGet('${base}/authentication/list')
+ },
+ ...crudCommonOptions(),
+ headerToolbar: [
+ 'reload',
+ {
+ type: 'action',
+ label: '',
+ icon: 'fa fa-plus',
+ ...authenticationAddDialog()
+ },
+ ],
+ columns: [
+ stringField('name', '名称', 200),
+ stringWrapField('description', '描述'),
+ mappingField('state', '状态', permissionStateMapping),
+ timeField('createdTime', '创建时间'),
+ operationField('操作', undefined, [
+ {
+ type: 'action',
+ label: '查看',
+ level: 'link',
+ ...authenticationDetailDialog(),
+ },
+ {
+ visibleOn: arrayInCheck([checkState.ownerChecking, checkState.checking], 'state'),
+ type: 'action',
+ label: '撤销',
+ level: 'link',
+ confirmTitle: '确认撤销',
+ confirmText: '确认撤销名称为「${name}」的授权申请吗?',
+ actionType: 'ajax',
+ api: apiGet('${base}/authentication/retract/${id}'),
+ },
+ {
+ visibleOn: arrayInCheck([checkState.draft], 'state'),
+ type: 'action',
+ label: '提交',
+ level: 'link',
+ confirmTitle: '确认提交',
+ confirmText: '确认提交名称为「${name}」的授权申请吗?',
+ actionType: 'ajax',
+ api: apiGet('${base}/authentication/submit/${id}'),
+ },
+ {
+ type: 'dropdown-button',
+ level: 'link',
+ icon: 'fa fa-ellipsis-h',
+ hideCaret: true,
+ trigger: 'hover',
+ buttons: [
+ {
+ disabledOn: arrayOutCheck([checkState.draft], 'state'),
+ type: 'action',
+ label: '编辑',
+ level: 'link',
+ ...authenticationEditeDialog(),
+ },
+ {
+ disabledOn: arrayInCheck([checkState.ownerChecking, checkState.checking], 'state'),
+ type: 'action',
+ label: "删除",
+ confirmTitle: '确认删除',
+ confirmText: '确认删除名称为「${name}」的确权申请吗?删除后对应的数据资源处于未确权状态。',
+ actionType: 'ajax',
+ api: apiGet('${base}/authentication/remove/${id}'),
+ },
+ ]
+ },
+ ]),
+ ]
+ }
+ },
+ ]
}
+ }
}
\ No newline at end of file
diff --git a/gringotts-frontend/pages/index/tab-settings.js b/gringotts-frontend/pages/index/tab-settings.js
index 360dd93..9ac8a28 100644
--- a/gringotts-frontend/pages/index/tab-settings.js
+++ b/gringotts-frontend/pages/index/tab-settings.js
@@ -1,12 +1,12 @@
import {administratorOnly} from "../../components/constants.js";
export function tabSettings() {
- return {
- visibleOn: administratorOnly,
- title: '系统管理',
- icon: 'fa fa-gear',
- body: [
- 'hello world'
- ]
- }
+ return {
+ visibleOn: administratorOnly,
+ title: '系统管理',
+ icon: 'fa fa-gear',
+ body: [
+ 'hello world'
+ ]
+ }
}
\ No newline at end of file
diff --git a/gringotts-frontend/pages/index/tab-user.js b/gringotts-frontend/pages/index/tab-user.js
index 4671103..7ec06ff 100644
--- a/gringotts-frontend/pages/index/tab-user.js
+++ b/gringotts-frontend/pages/index/tab-user.js
@@ -1,83 +1,83 @@
import {
- administratorOnly,
- apiGet,
- copyField,
- crudCommonOptions,
- mappingField,
- operationField,
- timeField,
- userRoleMapping,
- userStateMapping
+ administratorOnly,
+ apiGet,
+ copyField,
+ crudCommonOptions,
+ mappingField,
+ operationField,
+ timeField,
+ userRoleMapping,
+ userStateMapping
} from '../../components/constants.js'
import {userCheckDialog, userDetailDialog} from "../../components/user/dialog-user-check.js";
import {userAdministratorRegisterDialog} from "../../components/user/dialog-user-register.js";
export function tabUser() {
- return {
- visibleOn: administratorOnly,
- title: '用户管理',
- icon: 'fa fa-user',
- reload: true,
- body: [
+ return {
+ visibleOn: administratorOnly,
+ title: '用户管理',
+ icon: 'fa fa-user',
+ reload: true,
+ body: [
+ {
+ type: 'crud',
+ api: apiGet('${base}/user_management/list'),
+ ...crudCommonOptions(),
+ headerToolbar: [
+ 'reload',
+ {
+ type: 'action',
+ icon: 'fa fa-plus',
+ tooltip: '新增账号',
+ ...userAdministratorRegisterDialog(),
+ },
+ ],
+ columns: [
+ copyField(
+ 'username',
+ '邮箱',
+ undefined,
+ undefined,
+ userDetailDialog(),
+ ),
+ mappingField('role', '角色', userRoleMapping, 120),
+ mappingField('state', '账号状态', userStateMapping),
+ timeField('createdTime', '创建时间'),
+ timeField('lastLoginTime', '上次登陆时间'),
+ operationField('操作', undefined, [
{
- type: 'crud',
- api: apiGet('${base}/user_management/list'),
- ...crudCommonOptions(),
- headerToolbar: [
- 'reload',
- {
- type: 'action',
- icon: 'fa fa-plus',
- tooltip: '新增账号',
- ...userAdministratorRegisterDialog(),
- },
- ],
- columns: [
- copyField(
- 'username',
- '邮箱',
- undefined,
- undefined,
- userDetailDialog(),
- ),
- mappingField('role', '角色', userRoleMapping, 120),
- mappingField('state', '账号状态', userStateMapping),
- timeField('createdTime', '创建时间'),
- timeField('lastLoginTime', '上次登陆时间'),
- operationField('操作', undefined, [
- {
- visibleOn: "${state === 'CHECKING'}",
- label: '审核',
- icon: 'fa fa-fingerprint',
- level: 'primary',
- size: 'xs',
- ...userCheckDialog(),
- },
- {
- visibleOn: "${state === 'NORMAL' && role !== 'ADMINISTRATOR'}",
- label: '禁用',
- icon: 'fa fa-ban',
- level: 'danger',
- size: 'xs',
- confirmText: '确认禁用账号${username}?',
- confirmTitle: '禁用账号',
- actionType: 'ajax',
- api: apiGet('${base}/user_management/disable/${username}'),
- },
- {
- visibleOn: "${state === 'DISABLED' && role !== 'ADMINISTRATOR'}",
- label: '启用',
- icon: 'fa fa-check',
- level: 'success',
- size: 'xs',
- confirmText: '确认启用账号${username}?',
- confirmTitle: '启用账号',
- actionType: 'ajax',
- api: apiGet('${base}/user_management/enable/${username}'),
- }
- ]),
- ]
+ visibleOn: "${state === 'CHECKING'}",
+ label: '审核',
+ icon: 'fa fa-fingerprint',
+ level: 'primary',
+ size: 'xs',
+ ...userCheckDialog(),
+ },
+ {
+ visibleOn: "${state === 'NORMAL' && role !== 'ADMINISTRATOR'}",
+ label: '禁用',
+ icon: 'fa fa-ban',
+ level: 'danger',
+ size: 'xs',
+ confirmText: '确认禁用账号${username}?',
+ confirmTitle: '禁用账号',
+ actionType: 'ajax',
+ api: apiGet('${base}/user_management/disable/${username}'),
+ },
+ {
+ visibleOn: "${state === 'DISABLED' && role !== 'ADMINISTRATOR'}",
+ label: '启用',
+ icon: 'fa fa-check',
+ level: 'success',
+ size: 'xs',
+ confirmText: '确认启用账号${username}?',
+ confirmTitle: '启用账号',
+ actionType: 'ajax',
+ api: apiGet('${base}/user_management/enable/${username}'),
}
+ ]),
]
- }
+ }
+ ]
+ }
}
\ No newline at end of file
diff --git a/gringotts-web/src/main/java/com/eshore/gringotts/web/WebApplication.java b/gringotts-web/src/main/java/com/eshore/gringotts/web/WebApplication.java
index 1b54fc0..c6063f1 100644
--- a/gringotts-web/src/main/java/com/eshore/gringotts/web/WebApplication.java
+++ b/gringotts-web/src/main/java/com/eshore/gringotts/web/WebApplication.java
@@ -29,24 +29,24 @@ import org.springframework.scheduling.annotation.EnableAsync;
@EnableConfigurationProperties
@EnableEncryptableProperties
public class WebApplication implements ApplicationRunner {
- private final UserService userService;
+ private final UserService userService;
- public WebApplication(UserService userService) {
- this.userService = userService;
- }
+ public WebApplication(UserService userService) {
+ this.userService = userService;
+ }
- public static void main(String[] args) {
- SpringApplication.run(WebApplication.class, args);
- }
+ public static void main(String[] args) {
+ SpringApplication.run(WebApplication.class, args);
+ }
- @Override
- public void run(ApplicationArguments args) throws Exception {
- // 初始化系统管理员
- userService.initial();
- }
+ @Override
+ public void run(ApplicationArguments args) throws Exception {
+ // 初始化系统管理员
+ userService.initial();
+ }
- @Bean
- public AuditorAware auditorAware(UserService userService) {
- return userService::currentLoginUserOptional;
- }
+ @Bean
+ public AuditorAware auditorAware(UserService userService) {
+ return userService::currentLoginUserOptional;
+ }
}
diff --git a/gringotts-web/src/main/java/com/eshore/gringotts/web/configuration/ErrorController.java b/gringotts-web/src/main/java/com/eshore/gringotts/web/configuration/ErrorController.java
index 71f1934..973919b 100644
--- a/gringotts-web/src/main/java/com/eshore/gringotts/web/configuration/ErrorController.java
+++ b/gringotts-web/src/main/java/com/eshore/gringotts/web/configuration/ErrorController.java
@@ -16,12 +16,12 @@ import org.springframework.web.bind.annotation.RestControllerAdvice;
*/
@RestControllerAdvice
public class ErrorController {
- private static final Logger logger = LoggerFactory.getLogger(ErrorController.class);
+ private static final Logger logger = LoggerFactory.getLogger(ErrorController.class);
- @ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR)
- @ExceptionHandler(Throwable.class)
- public AmisResponse