Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
B
bigDataSystem
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张伯涛
bigDataSystem
Commits
299375a8
Commit
299375a8
authored
Nov 05, 2024
by
张伯涛
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
数据安全--脱敏算法
parent
b142d4c1
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
416 additions
and
8 deletions
+416
-8
desensitizationAlgorithm.data.ts
...desensitizationAlgorithm/desensitizationAlgorithm.data.ts
+146
-0
desensitizationAlgorithmModal.vue
...esensitizationAlgorithm/desensitizationAlgorithmModal.vue
+62
-0
index.vue
src/views/dataSecurity/desensitizationAlgorithm/index.vue
+130
-6
mock.ts
src/views/dataSecurity/desensitizationAlgorithm/mock.ts
+76
-0
sensitiveRulesModal.vue
...views/dataSecurity/sensitiveRules/sensitiveRulesModal.vue
+1
-1
sensitiveTypeModal.vue
src/views/dataSecurity/sensitiveType/sensitiveTypeModal.vue
+1
-1
No files found.
src/views/dataSecurity/desensitizationAlgorithm/desensitizationAlgorithm.data.ts
0 → 100644
View file @
299375a8
import
{
getAllRoleList
}
from
'@/api/system/role/role'
;
import
{
BasicColumn
,
FormSchema
}
from
'@/components/Table'
;
import
{
h
}
from
'vue'
;
import
{
Switch
}
from
'ant-design-vue'
;
import
{
useMessage
}
from
'@/hooks/web/useMessage'
;
import
{
changeFlagApi
}
from
'@/api/system/user/user'
;
// 引入开关组件
type
CheckedType
=
boolean
|
string
|
number
;
/** 列表筛选项*/
export
const
searchFormSchema
:
FormSchema
[]
=
[
{
field
:
'name'
,
label
:
''
,
component
:
'Input'
,
colProps
:
{
span
:
4
},
componentProps
:
{
placeholder
:
'搜索算法'
,
},
},
{
field
:
'flag'
,
label
:
' '
,
component
:
'Select'
,
colProps
:
{
span
:
4
},
componentProps
:
{
placeholder
:
'来源'
,
options
:
[
{
label
:
'预置'
,
value
:
'预置'
},
{
label
:
'自定义'
,
value
:
'自定义'
},
],
},
},
];
/** 列表展示字段*/
export
const
columns
:
BasicColumn
[]
=
[
{
title
:
'名称'
,
dataIndex
:
'name'
,
width
:
120
,
},
{
title
:
'函数名'
,
dataIndex
:
'functionName'
,
width
:
120
,
},
{
title
:
'算法描述'
,
dataIndex
:
'algorithmDes'
,
width
:
120
,
},
{
title
:
'来源'
,
dataIndex
:
'source'
,
width
:
140
,
},
{
title
:
'拥有者'
,
dataIndex
:
'owner'
,
width
:
140
,
},
{
title
:
'创建时间'
,
dataIndex
:
'createDate'
,
width
:
180
,
},
{
title
:
'更新时间'
,
dataIndex
:
'updateDate'
,
width
:
180
,
},
];
/** 新增编辑表单字段*/
export
const
formSchema
:
any
[]
=
[
{
field
:
'name'
,
label
:
'名称'
,
component
:
'Input'
,
rules
:
[
{
required
:
true
,
message
:
'请输入名称'
,
},
],
},
{
field
:
'functionName'
,
label
:
'函数名'
,
component
:
'Input'
,
rules
:
[
{
required
:
true
,
message
:
'请输入函数名'
,
},
],
},
{
field
:
'algorithmDes'
,
label
:
'算法描述'
,
component
:
'Input'
,
rules
:
[
{
required
:
true
,
message
:
'请输入算法描述'
,
},
],
},
{
field
:
'params'
,
label
:
'参数'
,
component
:
'Select'
,
componentProps
:
{
options
:
[
{
label
:
'STRING'
,
value
:
'STRING'
},
{
label
:
'INT'
,
value
:
'INT'
},
],
},
rules
:
[
{
required
:
true
,
message
:
'请选择敏感类型'
,
},
],
},
{
field
:
'describe'
,
component
:
'InputTextArea'
,
label
:
'参数描述'
,
componentProps
:
{
placeholder
:
'请输入参数描述'
,
rows
:
1
,
},
},
{
field
:
'achieveMethod'
,
component
:
'Checkbox'
,
label
:
'实现方式'
,
colProps
:
{
span
:
8
,
},
renderComponentContent
:
'API'
,
},
]
src/views/dataSecurity/desensitizationAlgorithm/desensitizationAlgorithmModal.vue
0 → 100644
View file @
299375a8
<
template
>
<BasicModal
width=
"40%"
v-bind=
"$attrs"
@
register=
"registerModal"
:title=
"getTitle"
@
ok=
"handleSubmit"
>
<BasicForm
@
register=
"registerForm"
/>
</BasicModal>
</
template
>
<
script
lang=
"ts"
setup
>
import
{
ref
,
computed
,
unref
,
reactive
}
from
'vue'
;
import
{
BasicModal
,
useModalInner
}
from
'@/components/Modal'
;
import
{
BasicForm
,
useForm
}
from
'@/components/Form'
;
import
{
formSchema
}
from
'./desensitizationAlgorithm.data'
;
import
{
useMessage
}
from
'@/hooks/web/useMessage'
;
defineOptions
({
name
:
'AccountModal'
});
const
emit
=
defineEmits
([
'success'
,
'register'
]);
const
{
createMessage
}
=
useMessage
();
const
isUpdate
=
ref
(
true
);
const
rowId
=
ref
(
''
);
//获取接口数据并放在下拉框里(这里是打开了一个弹框)
//初始化表单
const
[
registerForm
,
{
setFieldsValue
,
updateSchema
,
resetFields
,
validate
}]
=
useForm
({
labelWidth
:
100
,
baseColProps
:
{
lg
:
24
,
md
:
24
},
schemas
:
formSchema
,
showActionButtonGroup
:
false
,
actionColOptions
:
{
span
:
23
,
},
});
//初始化弹框
const
[
registerModal
,
{
setModalProps
,
closeModal
}]
=
useModalInner
(
async
(
data
)
=>
{
resetFields
();
setModalProps
({
confirmLoading
:
false
});
isUpdate
.
value
=
!!
data
?.
isUpdate
;
if
(
unref
(
isUpdate
))
{
// 通过id获取行详情信息
// 塞值
setFieldsValue
({
...
data
.
record
,
});
}
});
const
getTitle
=
computed
(()
=>
(
!
unref
(
isUpdate
)
?
'新建脱敏算法'
:
'编辑脱敏算法'
));
async
function
handleSubmit
()
{
try
{
const
values
=
await
validate
();
setModalProps
({
confirmLoading
:
true
});
// TODO custom api
closeModal
();
emit
(
'success'
,
{
isUpdate
:
unref
(
isUpdate
),
values
:
{
...
values
,
id
:
rowId
.
value
}
});
}
finally
{
setModalProps
({
confirmLoading
:
false
});
}
}
</
script
>
src/views/dataSecurity/desensitizationAlgorithm/index.vue
View file @
299375a8
<
template
>
<
template
>
<div>
脱敏算法
<PageWrapper
dense
contentFullHeight
fixedHeight
contentClass=
"flex"
>
</div>
<BasicTable
@
register=
"registerTable"
:searchInfo=
"searchInfo"
>
</
template
>
<template
#
toolbar
>
<a-button
type=
"primary"
@
click=
"handleCreate"
>
新增
</a-button>
</
template
>
<
template
#
bodyCell=
"{ column, record }"
>
<template
v-if=
"column.key === 'action'"
>
<TableAction
:actions=
"[
{
icon: 'clarity:note-edit-line',
label: '编辑',
onClick: handleEdit.bind(null, record),
},
{
icon: 'ant-design:delete-outlined',
color: 'error',
label: '删除',
popConfirm: {
title: '是否确认删除',
placement: 'left',
confirm: handleDelete.bind(null, record),
},
},
]"
/>
</
template
>
</template>
</BasicTable>
<sensitiveRulesModal
@
register=
"registerModal"
@
success=
"handleSuccess"
/>
</PageWrapper>
</template>
<
script
lang=
"ts"
setup
>
<
script
lang=
"ts"
setup
>
import
{
reactive
,
onMounted
}
from
'vue'
;
import
{
BasicTable
,
useTable
,
TableAction
}
from
'@/components/Table'
;
import
{
PageWrapper
}
from
'@/components/Page'
;
import
{
useMessage
}
from
'@/hooks/web/useMessage'
;
import
{
useModal
}
from
'@/components/Modal'
;
import
sensitiveRulesModal
from
'./desensitizationAlgorithmModal.vue'
;
</
script
>
import
{
columns
,
searchFormSchema
}
from
'./desensitizationAlgorithm.data'
;
import
{
tableList
}
from
"@/views/dataSecurity/desensitizationAlgorithm/mock"
;
import
{
useRoute
,
onBeforeRouteLeave
}
from
'vue-router'
;
import
{
router
}
from
'@/router'
;
defineOptions
({
name
:
'sensitiveRules'
});
const
{
createMessage
}
=
useMessage
();
const
route
=
useRoute
();
const
[
registerModal
,
{
openModal
}]
=
useModal
();
const
[
registerResetPassword
,
{
openModal
:
openResetPasswordModal
}]
=
useModal
();
const
[
registerImport
,
{
openModal
:
openImportModal
}]
=
useModal
();
const
searchInfo
=
reactive
<
Recordable
>
({});
const
[
registerTable
,
{
reload
,
updateTableDataRecord
,
getSearchInfo
,
getForm
}]
=
useTable
({
title
:
'脱敏算法'
,
api
:
async
(
params
)
=>
{
console
.
log
(
params
)
const
response
=
{
pageNu
:
"1"
,
pageSize
:
"10"
,
pages
:
"1"
,
total
:
tableList
.
length
,
code
:
''
,
message
:
''
,
data
:
tableList
,
};
return
{
...
response
};
},
rowKey
:
'id'
,
columns
,
formConfig
:
{
labelWidth
:
10
,
schemas
:
searchFormSchema
,
autoSubmitOnEnter
:
true
,
<
style
scoped
>
},
useSearchForm
:
true
,
showTableSetting
:
false
,
bordered
:
true
,
handleSearchInfoFn
(
info
)
{
console
.
log
(
'handleSearchInfoFn'
,
info
);
return
info
;
},
actionColumn
:
{
width
:
120
,
title
:
'操作'
,
dataIndex
:
'action'
,
// slots: { customRender: 'action' },
},
});
/** 新增按钮*/
function
handleCreate
()
{
openModal
(
true
,
{
isUpdate
:
false
,
});
}
/** 编辑按钮*/
function
handleEdit
(
record
:
Recordable
)
{
openModal
(
true
,
{
record
,
isUpdate
:
true
,
});
}
</
style
>
/** 重置密码弹窗确定按钮*/
/** 删除按钮*/
function
handleDelete
(
record
:
Recordable
)
{
console
.
log
(
record
);
createMessage
.
success
(
'删除成功!'
);
reload
();
}
/** 新增/编辑成功*/
function
handleSuccess
({
isUpdate
,
values
})
{
if
(
isUpdate
)
{
// 演示不刷新表格直接更新内部数据。
// 注意:updateTableDataRecord要求表格的rowKey属性为string并且存在于每一行的record的keys中
const
result
=
updateTableDataRecord
(
values
.
id
,
values
);
console
.
log
(
result
);
reload
();
}
else
{
reload
();
}
}
onMounted
(()
=>
{
});
</
script
>
src/views/dataSecurity/desensitizationAlgorithm/mock.ts
0 → 100644
View file @
299375a8
export
const
tableList
:
any
[]
=
[
{
"name"
:
"Blur"
,
"functionName"
:
"blur"
,
"algorithmDes"
:
"将整数或小数混淆..."
,
"source"
:
"自定义"
,
"owner"
:
"admin"
,
"createDate"
:
"2024-10-24 10:04:04"
,
"updateDate"
:
"2024-10-24 10:04:04"
,
},
{
"name"
:
"random"
,
"functionName"
:
"random"
,
"algorithmDes"
:
"返回一个介于x和y..."
,
"source"
:
"自定义"
,
"owner"
:
"admin"
,
"createDate"
:
"2024-10-24 10:04:04"
,
"updateDate"
:
"2024-10-24 10:04:04"
,
},
{
"name"
:
"Blur"
,
"functionName"
:
"blur"
,
"algorithmDes"
:
"将整数或小数混淆..."
,
"source"
:
"自定义"
,
"owner"
:
"admin"
,
"createDate"
:
"2024-10-24 10:04:04"
,
"updateDate"
:
"2024-10-24 10:04:04"
,
},
{
"name"
:
"random"
,
"functionName"
:
"random"
,
"algorithmDes"
:
"返回一个介于x和y..."
,
"source"
:
"自定义"
,
"owner"
:
"admin"
,
"createDate"
:
"2024-10-24 10:04:04"
,
"updateDate"
:
"2024-10-24 10:04:04"
,
},
{
"name"
:
"Blur"
,
"functionName"
:
"blur"
,
"algorithmDes"
:
"将整数或小数混淆..."
,
"source"
:
"自定义"
,
"owner"
:
"admin"
,
"createDate"
:
"2024-10-24 10:04:04"
,
"updateDate"
:
"2024-10-24 10:04:04"
,
},
{
"name"
:
"random"
,
"functionName"
:
"random"
,
"algorithmDes"
:
"返回一个介于x和y..."
,
"source"
:
"自定义"
,
"owner"
:
"admin"
,
"createDate"
:
"2024-10-24 10:04:04"
,
"updateDate"
:
"2024-10-24 10:04:04"
,
},
{
"name"
:
"Blur"
,
"functionName"
:
"blur"
,
"algorithmDes"
:
"将整数或小数混淆..."
,
"source"
:
"自定义"
,
"owner"
:
"admin"
,
"createDate"
:
"2024-10-24 10:04:04"
,
"updateDate"
:
"2024-10-24 10:04:04"
,
},
{
"name"
:
"random"
,
"functionName"
:
"random"
,
"algorithmDes"
:
"返回一个介于x和y..."
,
"source"
:
"自定义"
,
"owner"
:
"admin"
,
"createDate"
:
"2024-10-24 10:04:04"
,
"updateDate"
:
"2024-10-24 10:04:04"
,
},
]
src/views/dataSecurity/sensitiveRules/sensitiveRulesModal.vue
View file @
299375a8
...
@@ -44,7 +44,7 @@ const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data
...
@@ -44,7 +44,7 @@ const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data
});
});
const
getTitle
=
computed
(()
=>
(
!
unref
(
isUpdate
)
?
'新建
安全分级'
:
'编辑安全分级
'
));
const
getTitle
=
computed
(()
=>
(
!
unref
(
isUpdate
)
?
'新建
敏感规则'
:
'编辑敏感规则
'
));
...
...
src/views/dataSecurity/sensitiveType/sensitiveTypeModal.vue
View file @
299375a8
...
@@ -44,7 +44,7 @@ const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data
...
@@ -44,7 +44,7 @@ const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data
});
});
const
getTitle
=
computed
(()
=>
(
!
unref
(
isUpdate
)
?
'新建
安全分级'
:
'编辑安全分级
'
));
const
getTitle
=
computed
(()
=>
(
!
unref
(
isUpdate
)
?
'新建
敏感类型'
:
'编辑敏感类型
'
));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment