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
d4558328
Commit
d4558328
authored
Dec 09, 2024
by
罗林杰
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
5e844183
138ba3bb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
169 additions
and
154 deletions
+169
-154
classificationAndGrading.data.ts
...classificationAndGrading/classificationAndGrading.data.ts
+3
-3
index.vue
...ervice/APIDataSecurity/classificationAndGrading/index.vue
+166
-151
No files found.
src/views/dataService/APIDataSecurity/classificationAndGrading/classificationAndGrading.data.ts
View file @
d4558328
...
@@ -31,7 +31,7 @@ export const searchFormSchema: FormSchema[] = [
...
@@ -31,7 +31,7 @@ export const searchFormSchema: FormSchema[] = [
field
:
'APIModel'
,
field
:
'APIModel'
,
label
:
' '
,
label
:
' '
,
component
:
'Select'
,
component
:
'Select'
,
colProps
:
{
span
:
2
},
colProps
:
{
span
:
3
},
componentProps
:
{
componentProps
:
{
placeholder
:
'API模式'
,
placeholder
:
'API模式'
,
options
:
[
options
:
[
...
@@ -45,7 +45,7 @@ export const searchFormSchema: FormSchema[] = [
...
@@ -45,7 +45,7 @@ export const searchFormSchema: FormSchema[] = [
field
:
'sensitiveState'
,
field
:
'sensitiveState'
,
label
:
' '
,
label
:
' '
,
component
:
'Select'
,
component
:
'Select'
,
colProps
:
{
span
:
2
},
colProps
:
{
span
:
3
},
componentProps
:
{
componentProps
:
{
placeholder
:
'敏感状态'
,
placeholder
:
'敏感状态'
,
options
:
[
options
:
[
...
@@ -58,7 +58,7 @@ export const searchFormSchema: FormSchema[] = [
...
@@ -58,7 +58,7 @@ export const searchFormSchema: FormSchema[] = [
field
:
'level'
,
field
:
'level'
,
label
:
' '
,
label
:
' '
,
component
:
'Select'
,
component
:
'Select'
,
colProps
:
{
span
:
2
},
colProps
:
{
span
:
3
},
componentProps
:
{
componentProps
:
{
placeholder
:
'安全分级'
,
placeholder
:
'安全分级'
,
options
:
[
options
:
[
...
...
src/views/dataService/APIDataSecurity/classificationAndGrading/index.vue
View file @
d4558328
<
template
>
<
template
>
<PageWrapper
dense
contentFullHeight
fixedHeight
contentClass=
"flex"
>
<PageWrapper
dense
contentFullHeight
fixedHeight
contentClass=
"flex"
>
<template
#
title
>
<div
style=
"display: flex;align-items: center"
>
<Icon
icon=
"ant-design:switcher-outlined"
:size=
"24"
style=
"color:#0960BD;"
/>
<span
style=
"margin-left: 10px"
>
分类分级
</span>
</div>
</
template
>
<BasicTable
@
register=
"registerTable"
:searchInfo=
"searchInfo"
>
<BasicTable
@
register=
"registerTable"
:searchInfo=
"searchInfo"
>
<
template
#
toolbar
>
<
template
#
toolbar
>
<a-button
type=
"primary"
@
click=
"handleImport"
>
批量导入
</a-button>
<a-button
type=
"primary"
@
click=
"handleImport"
>
批量导入
</a-button>
...
@@ -23,168 +29,177 @@
...
@@ -23,168 +29,177 @@
</
template
>
</
template
>
</template>
</template>
</BasicTable>
</BasicTable>
<ClassificationAndGradingModal
@
register=
"registerModal"
@
success=
"handleSuccess"
/>
<ClassificationAndGradingModal
@
register=
"registerModal"
@
success=
"handleSuccess"
/>
</PageWrapper>
</PageWrapper>
</template>
</template>
<
script
lang=
"ts"
setup
>
<
script
lang=
"ts"
setup
>
import
{
ref
,
reactive
,
onMounted
}
from
'vue'
;
import
{
ref
,
reactive
,
onMounted
}
from
'vue'
;
import
{
BasicTable
,
useTable
,
TableAction
}
from
'@/components/Table'
;
import
{
BasicTable
,
useTable
,
TableAction
}
from
'@/components/Table'
;
import
{
PageWrapper
}
from
'@/components/Page'
;
import
{
PageWrapper
}
from
'@/components/Page'
;
import
{
useMessage
}
from
'@/hooks/web/useMessage'
;
import
{
useMessage
}
from
'@/hooks/web/useMessage'
;
import
{
useModal
}
from
'@/components/Modal'
;
import
{
useModal
}
from
'@/components/Modal'
;
import
Icon
from
"@/components/Icon/Icon.vue"
;
import
{
columns
,
searchFormSchema
}
from
'./classificationAndGrading.data'
;
import
{
tableList
}
from
'./mock'
;
import
{
columns
,
searchFormSchema
}
from
'./classificationAndGrading.data'
;
import
{
useRoute
,
onBeforeRouteLeave
}
from
'vue-router'
;
import
{
tableList
}
from
'./mock'
;
import
{
router
}
from
'@/router'
;
import
ClassificationAndGradingModal
from
'@/views/dataService/APIDataSecurity/classificationAndGrading/ClassificationAndGradingModal.vue'
;
import
{
metadataData
}
from
'@/views/metadata/metadataData'
;
import
{
useRoute
,
onBeforeRouteLeave
}
from
'vue-router'
;
const
{
createMessage
}
=
useMessage
();
import
{
router
}
from
'@/router'
;
const
route
=
useRoute
();
import
ClassificationAndGradingModal
from
'@/views/dataService/APIDataSecurity/classificationAndGrading/ClassificationAndGradingModal.vue'
;
let
tableData
=
ref
(
tableList
);
import
{
metadataData
}
from
'@/views/metadata/metadataData'
;
const
[
registerModal
,
{
openModal
}]
=
useModal
();
const
[
registerImport
,
{
openModal
:
openImportModal
}]
=
useModal
();
const
{
createMessage
}
=
useMessage
();
const
searchInfo
=
reactive
<
Recordable
>
({});
const
route
=
useRoute
();
const
[
registerTable
,
{
reload
,
updateTableDataRecord
,
getSearchInfo
,
getForm
}]
=
useTable
({
let
tableData
=
ref
(
tableList
);
title
:
'分类分级结果'
,
const
[
registerModal
,
{
openModal
}]
=
useModal
();
api
:
async
(
params
)
=>
{
const
[
registerImport
,
{
openModal
:
openImportModal
}]
=
useModal
();
// console.log(params);
const
searchInfo
=
reactive
<
Recordable
>
({});
const
response
=
{
const
[
registerTable
,
{
reload
,
updateTableDataRecord
,
getSearchInfo
,
getForm
}]
=
useTable
({
pageNu
:
'1'
,
title
:
'分类分级结果'
,
pageSize
:
'10'
,
api
:
async
(
params
)
=>
{
pages
:
'1'
,
// console.log(params);
total
:
tableData
.
value
.
length
,
const
response
=
{
code
:
''
,
pageNu
:
'1'
,
message
:
''
,
pageSize
:
'10'
,
data
:
tableData
.
value
,
pages
:
'1'
,
};
total
:
tableData
.
value
.
length
,
code
:
''
,
message
:
''
,
data
:
tableData
.
value
,
};
return
{
...
response
};
return
{...
response
};
},
},
rowKey
:
'id'
,
rowKey
:
'id'
,
columns
,
columns
,
formConfig
:
{
formConfig
:
{
// labelWidth: 10,
// labelWidth: 10,
schemas
:
searchFormSchema
,
actionColOptions
:
{
autoSubmitOnEnter
:
true
,
span
:
3
,
},
customRow
:
customRow
,
useSearchForm
:
true
,
showTableSetting
:
false
,
showIndexColumn
:
false
,
bordered
:
true
,
handleSearchInfoFn
(
info
)
{
// console.log('handleSearchInfoFn', info);
tableData
.
value
=
tableList
.
filter
(
(
item
)
=>
(
info
.
fieldCode
===
undefined
||
item
.
fieldCode
.
includes
(
info
.
fieldCode
))
&&
(
info
.
APIName
===
undefined
||
item
.
APIName
.
includes
(
info
.
APIName
))
&&
(
info
.
APIModel
===
undefined
||
item
.
APIModel
===
info
.
APIModel
)
&&
(
info
.
sensitiveState
===
undefined
||
item
.
sensitiveState
===
info
.
sensitiveState
)
&&
(
info
.
sensitiveType
===
undefined
||
item
.
sensitiveType
===
info
.
sensitiveType
)
&&
(
info
.
level
===
undefined
||
item
.
level
===
info
.
level
),
);
// console.log('tableData', tableData.value);
return
info
;
},
actionColumn
:
{
width
:
160
,
title
:
'操作'
,
dataIndex
:
'action'
,
// slots: { customRender: 'action' },
},
},
schemas
:
searchFormSchema
,
autoSubmitOnEnter
:
true
,
},
customRow
:
customRow
,
useSearchForm
:
true
,
showTableSetting
:
false
,
showIndexColumn
:
false
,
bordered
:
true
,
handleSearchInfoFn
(
info
)
{
// console.log('handleSearchInfoFn', info);
tableData
.
value
=
tableList
.
filter
(
(
item
)
=>
(
info
.
fieldCode
===
undefined
||
item
.
fieldCode
.
includes
(
info
.
fieldCode
))
&&
(
info
.
APIName
===
undefined
||
item
.
APIName
.
includes
(
info
.
APIName
))
&&
(
info
.
APIModel
===
undefined
||
item
.
APIModel
===
info
.
APIModel
)
&&
(
info
.
sensitiveState
===
undefined
||
item
.
sensitiveState
===
info
.
sensitiveState
)
&&
(
info
.
sensitiveType
===
undefined
||
item
.
sensitiveType
===
info
.
sensitiveType
)
&&
(
info
.
level
===
undefined
||
item
.
level
===
info
.
level
),
);
// console.log('tableData', tableData.value);
return
info
;
},
actionColumn
:
{
width
:
160
,
title
:
'操作'
,
dataIndex
:
'action'
,
// slots: { customRender: 'action' },
},
});
/** 新增按钮*/
function
handleCreate
()
{
openModal
(
true
,
{
isUpdate
:
false
,
});
});
/** 新增按钮*/
}
function
handleCreate
()
{
openModal
(
true
,
{
/** 编辑按钮*/
isUpdate
:
false
,
function
handleEdit
(
record
:
Recordable
,
isUpdate
)
{
});
console
.
log
(
isUpdate
);
}
openModal
(
true
,
{
/** 编辑按钮*/
record
,
function
handleEdit
(
record
:
Recordable
,
isUpdate
)
{
isUpdate
:
isUpdate
,
console
.
log
(
isUpdate
);
});
openModal
(
true
,
{
}
record
,
isUpdate
:
isUpdate
,
/** 重置密码弹窗确定按钮*/
});
/** 删除按钮*/
}
function
handleDelete
(
record
:
Recordable
)
{
console
.
log
(
record
);
createMessage
.
success
(
'删除成功!'
);
reload
();
}
/** 重置密码弹窗确定按钮*/
/** 新增/编辑成功*/
/** 删除按钮*/
function
handleSuccess
({
isUpdate
,
values
})
{
function
handleDelete
(
record
:
Recordable
)
{
if
(
isUpdate
)
{
console
.
log
(
record
);
// 演示不刷新表格直接更新内部数据。
createMessage
.
success
(
'删除成功!'
);
// 注意:updateTableDataRecord要求表格的rowKey属性为string并且存在于每一行的record的keys中
const
result
=
updateTableDataRecord
(
values
.
id
,
values
);
console
.
log
(
result
);
reload
();
}
else
{
reload
();
reload
();
}
}
}
/** 新增/编辑成功*/
let
source
=
0
;
// 源目标数据序号
function
handleSuccess
({
isUpdate
,
values
})
{
let
target
=
0
;
// 目标数据序号
if
(
isUpdate
)
{
// Table拖拽
// 演示不刷新表格直接更新内部数据。
function
customRow
(
record
,
index
)
{
// 注意:updateTableDataRecord要求表格的rowKey属性为string并且存在于每一行的record的keys中
console
.
log
(
record
,
index
);
// 这里输出是表格全部的数据
const
result
=
updateTableDataRecord
(
values
.
id
,
values
);
return
{
console
.
log
(
result
);
props
:
{
reload
();
// draggable: 'true'
}
else
{
},
reload
();
style
:
{
}
cursor
:
'pointer'
,
}
},
// 鼠标移入
onMouseenter
:
(
event
)
=>
{
// 兼容IE
let
ev
=
event
||
window
.
event
;
ev
.
target
.
draggable
=
true
;
// 让你要拖动的行可以拖动,默认不可以
},
// 开始拖拽
onDragstart
:
(
event
)
=>
{
// 兼容IE
let
ev
=
event
||
window
.
event
;
// 阻止冒泡
ev
.
stopPropagation
();
// 得到源目标数据序号
source
=
index
;
console
.
log
(
record
,
index
,
'source'
);
},
// 拖动元素经过的元素
onDragover
:
(
event
)
=>
{
// 兼容 IE
let
ev
=
event
||
window
.
event
;
// 阻止默认行为
ev
.
preventDefault
();
},
// 鼠标松开
onDrop
:
(
event
)
=>
{
// 兼容IE
let
ev
=
event
||
window
.
event
;
// 阻止冒泡
ev
.
stopPropagation
();
// 得到目标数据序号
target
=
index
;
// 这里就是让数据位置互换,让视图更新 你们可以看record,index的输出,看是什么
console
.
log
(
tableData
);
// [tableData.value[source], tableData.value[target]] = [tableData.value[target], tableData.value[source]];
const
temp
=
ref
();
temp
.
value
=
tableData
.
value
[
source
];
tableData
.
value
[
source
]
=
tableData
.
value
[
target
];
tableData
.
value
[
target
]
=
temp
.
value
;
console
.
log
(
record
,
index
,
'target'
,
source
,
target
);
},
};
}
let
source
=
0
;
// 源目标数据序号
onMounted
(()
=>
{
let
target
=
0
;
// 目标数据序号
});
// Table拖拽
function
customRow
(
record
,
index
)
{
console
.
log
(
record
,
index
);
// 这里输出是表格全部的数据
return
{
props
:
{
// draggable: 'true'
},
style
:
{
cursor
:
'pointer'
,
},
// 鼠标移入
onMouseenter
:
(
event
)
=>
{
// 兼容IE
let
ev
=
event
||
window
.
event
;
ev
.
target
.
draggable
=
true
;
// 让你要拖动的行可以拖动,默认不可以
},
// 开始拖拽
onDragstart
:
(
event
)
=>
{
// 兼容IE
let
ev
=
event
||
window
.
event
;
// 阻止冒泡
ev
.
stopPropagation
();
// 得到源目标数据序号
source
=
index
;
console
.
log
(
record
,
index
,
'source'
);
},
// 拖动元素经过的元素
onDragover
:
(
event
)
=>
{
// 兼容 IE
let
ev
=
event
||
window
.
event
;
// 阻止默认行为
ev
.
preventDefault
();
},
// 鼠标松开
onDrop
:
(
event
)
=>
{
// 兼容IE
let
ev
=
event
||
window
.
event
;
// 阻止冒泡
ev
.
stopPropagation
();
// 得到目标数据序号
target
=
index
;
// 这里就是让数据位置互换,让视图更新 你们可以看record,index的输出,看是什么
console
.
log
(
tableData
);
// [tableData.value[source], tableData.value[target]] = [tableData.value[target], tableData.value[source]];
const
temp
=
ref
();
temp
.
value
=
tableData
.
value
[
source
];
tableData
.
value
[
source
]
=
tableData
.
value
[
target
];
tableData
.
value
[
target
]
=
temp
.
value
;
console
.
log
(
record
,
index
,
'target'
,
source
,
target
);
},
};
}
onMounted
(()
=>
{});
</
script
>
</
script
>
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