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
ccfe5aa1
Commit
ccfe5aa1
authored
Nov 12, 2024
by
baiyinhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改文件
parent
276d4f20
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
136 additions
and
216 deletions
+136
-216
index.vue
src/views/ArchitecturePlan/theme/index.vue
+1
-1
audiModal.vue
src/views/auditLog/audiModal.vue
+55
-191
index.vue
src/views/notifications/noticeManage/index.vue
+3
-0
notiModalNew.vue
src/views/notifications/noticeManage/notiModalNew.vue
+77
-24
No files found.
src/views/ArchitecturePlan/theme/index.vue
View file @
ccfe5aa1
...
@@ -100,7 +100,7 @@
...
@@ -100,7 +100,7 @@
data
:
[],
data
:
[],
};
};
var
data
=
[];
var
data
=
[];
var
data
=
[];
data
=
tableData
.
value
.
filter
((
item
)
=>
item
.
businessId
!==
100
);
data
=
tableData
.
value
.
filter
((
item
)
=>
item
.
businessId
!==
100
);
return
{
...
response
,
data
:
data
};
return
{
...
response
,
data
:
data
};
},
},
...
...
src/views/auditLog/audiModal.vue
View file @
ccfe5aa1
<
template
>
<
template
>
<BasicModal
<BasicModal
width=
"40%"
v-bind=
"$attrs"
v-bind=
"$attrs"
width=
"45%"
height=
"500"
@
register=
"registerModal"
@
register=
"registerModal"
:title=
"getTitle"
:title=
"getTitle"
@
ok=
"handleSubmit"
@
ok=
"handleSubmit"
>
>
<div
class=
"modal-content"
>
<BasicForm
@
register=
"registerForm"
/>
<!--
<div
class=
"table-container"
>
<BasicTable
@
register=
"registerTable"
>
<template
#
bodyCell=
"
{ column, record }">
<template
v-if=
"column.key === 'action'"
>
<TableAction
:actions=
"[
{
label: '编辑',
onClick: handleEdit.bind(null, record),
},
]"
/>
</
template
>
</template>
</BasicTable>
</div>
-->
<div
class=
"form-container"
>
<BasicForm
@
register=
"registerForm"
>
<
template
#
menu=
"{ model, field }"
>
<BasicTree
v-model:value=
"model[field]"
:treeData=
"treeDataList"
:fieldNames=
"
{ title: 'label', key: 'id' }"
checkable
toolbar
/>
</
template
>
</BasicForm>
</div>
</div>
</BasicModal>
</BasicModal>
</
template
>
</
template
>
<
script
setup
lang=
"ts"
>
<
script
lang=
"ts"
setup
>
import
{
BasicTable
,
useTable
,
TableAction
}
from
'@/components/Table'
;
import
{
ref
,
computed
,
unref
,
reactive
}
from
'vue'
;
import
{
useModalInner
}
from
'@/components/Modal'
;
import
{
BasicModal
,
useModalInner
}
from
'@/components/Modal'
;
import
BasicModal
from
'@/components/Modal/src/BasicModal.vue'
;
import
{
ref
,
unref
}
from
'vue'
;
import
{
Table
}
from
'ant-design-vue'
;
import
{
ModelFormSchema
,
columns
}
from
'@/views/auditLog/audiModal.data'
;
import
{
addDataScopeApi
,
getRoleDeptTreeSelect
,
roleDetailApi
}
from
'@/api/system/role/role'
;
import
{
BasicForm
,
useForm
}
from
'@/components/Form'
;
import
{
BasicForm
,
useForm
}
from
'@/components/Form'
;
import
{
getMenuListByPage
,
getMenuSelect
,
getRoleMenuSelectedMC
}
from
'@/api/system/menu/menu'
;
import
{
ModelFormSchema
}
from
'./audiModal.data'
;
import
{
getDeptList
}
from
'@/api/system/dept/dept'
;
import
{
addUserApi
,
UserDetailApi
,
UserUpdataApi
}
from
'@/api/system/user/user'
;
import
{
encryptTwo
}
from
'../../../../src/utils/jsencrypt.js'
;
import
{
useMessage
}
from
'@/hooks/web/useMessage'
;
import
{
useMessage
}
from
'@/hooks/web/useMessage'
;
import
{
BasicTree
,
TreeItem
}
from
'@/components/Tree'
;
import
{
tableListtab1
}
from
'./mock'
;
import
{
router
}
from
'@/router'
;
defineOptions
({
name
:
'ModelModal'
});
defineOptions
({
name
:
'RoleModal'
});
const
loadingRef
=
ref
(
false
);
// 列表
const
dataSource
=
ref
([]);
const
treeData
=
ref
();
const
roleId
=
ref
();
const
isPermiss
=
ref
(
true
);
const
getTitle
=
ref
(
'查看日志'
);
const
{
createMessage
}
=
useMessage
();
const
emit
=
defineEmits
([
'success'
,
'register'
]);
const
emit
=
defineEmits
([
'success'
,
'register'
]);
const
formData
=
ref
({});
const
{
createMessage
}
=
useMessage
();
const
treeDataList
=
ref
<
TreeItem
[]
>
([]);
const
isUpdate
=
ref
(
true
);
const
isMove
=
ref
(
false
);
const
rowId
=
ref
(
''
);
//获取接口数据并放在下拉框里(这里是打开了一个弹框)
//初始化表单
const
[
registerForm
,
{
setFieldsValue
,
updateSchema
,
resetFields
,
validate
}]
=
useForm
({
labelWidth
:
100
,
const
[
registerTable
,
{
reload
,
getForm
}]
=
useTable
({
schemas
:
ModelFormSchema
,
// api: async (params) => {
showActionButtonGroup
:
false
,
// const param = {
actionColOptions
:
{
// businessId: roleId.value,
span
:
23
,
// };
// const response = await getRoleMenuSelectedMC(param);
// //进行处理数据
// const transformedData = transformData(response.data); // 定义一个函数transformData来做你需要的数据转换
// return { ...response, data: transformedData };
// },
columns
,
useSearchForm
:
false
,
showTableSetting
:
false
,
bordered
:
true
,
isTreeTable
:
true
,
pagination
:
false
,
showIndexColumn
:
false
,
actionColumn
:
{
width
:
50
,
title
:
'操作'
,
dataIndex
:
'action'
,
fixed
:
undefined
,
},
},
});
});
//初始化弹框
const
[
registerModal
,
{
closeModal
,
setModalProps
}]
=
useModalInner
(
async
(
data
)
=>
{
const
[
registerModal
,
{
setModalProps
,
closeModal
}]
=
useModalInner
(
async
(
data
)
=>
{
isPermiss
.
value
=
data
.
record
.
isPermiss
;
resetFields
();
roleId
.
value
=
data
.
record
.
businessId
;
setModalProps
({
confirmLoading
:
false
});
roleDetailApi
(
roleId
.
value
).
then
((
res
)
=>
{
isUpdate
.
value
=
!!
data
?.
isUpdate
;
formData
.
value
=
res
.
data
;
isMove
.
value
=
!!
data
?.
isMove
;
const
form
=
{
if
(
unref
(
isUpdate
))
{
roleName
:
res
.
data
.
roleName
,
// 获取行数据的id
};
rowId
.
value
=
data
.
record
.
businessId
;
// 塞值
setFieldsValue
({
setFieldsValue
({
...
form
,
...
data
.
record
,
});
});
});
if
(
unref
(
treeDataList
).
length
===
0
)
{
const
treeRes
=
await
getMenuSelect
();
treeDataList
.
value
=
treeRes
.
data
as
any
as
TreeItem
[];
}
}
//控制
// const treeList = handleTree(TableData, 'businessId', undefined, undefined, undefined);
updateSchema
({
// console.log('treeList', treeList);
field
:
'dataScope'
,
// updateSchema([
componentProps
:
{
// {
onChange
:
(
value
:
any
,
option
:
any
,
form
:
any
)
=>
{
// field: 'modelId',
//调用接口 返回的参数赋值给dictValue
// componentProps: {
if
(
value
===
'2'
)
{
// tableData: treeList,
updateSchema
({
// },
field
:
'menuIds'
,
// },
ifShow
:
true
,
// ]);
rules
:
[
{
required
:
true
,
message
:
'请选择数据权限'
,
},
],
});
}
else
{
updateSchema
({
field
:
'menuIds'
,
ifShow
:
false
,
rules
:
[
{
required
:
false
,
},
],
});
}
},
},
});
reload
();
});
});
//初始化表单
const
getTitle
=
computed
(()
=>
(
!
unref
(
isUpdate
)
?
'查看日志'
:
'查看日志'
));
const
[
registerForm
,
{
setFieldsValue
,
updateSchema
,
resetFields
,
validate
,
getFieldsValue
}]
=
useForm
({
labelWidth
:
100
,
schemas
:
ModelFormSchema
,
showActionButtonGroup
:
false
,
});
/**编辑按钮*/
function
handleEdit
(
record
:
Recordable
)
{
formData
.
value
.
menuId
=
record
.
businessId
;
formData
.
value
.
menuName
=
record
.
menuName
;
const
form
=
{
menuName
:
record
.
menuName
,
};
setFieldsValue
({
...
form
,
});
const
params
=
{
menuId
:
formData
.
value
.
menuId
,
roleId
:
formData
.
value
.
businessId
,
};
getRoleDeptTreeSelect
(
params
).
then
((
res
)
=>
{
formData
.
value
.
deptCheckStrictly
=
res
.
data
.
deptCheckStrictly
;
});
}
/**改变列表结构 列表->树*/
function
transformData
(
data
)
{
treeData
.
value
=
handleTree
(
data
,
'businessId'
,
undefined
,
undefined
,
undefined
);
return
treeData
.
value
;
}
/**结构转换方法*/
function
handleTree
(
data
,
id
,
parentId
,
children
,
rootId
)
{
function
handleTree
(
data
,
id
,
parentId
,
children
,
rootId
)
{
id
=
id
||
'id'
;
id
=
id
||
'id'
;
parentId
=
parentId
||
'parentId'
;
parentId
=
parentId
||
'parentId'
;
...
@@ -204,42 +96,14 @@
...
@@ -204,42 +96,14 @@
return
treeData
!==
''
?
treeData
:
data
;
return
treeData
!==
''
?
treeData
:
data
;
}
}
/**确
认
按钮*/
/**确
定
按钮*/
async
function
handleSubmit
()
{
async
function
handleSubmit
()
{
try
{
const
values
=
await
validate
();
const
values
=
await
validate
();
// router.push({
console
.
log
(
'values:'
,
values
);
// path: '/metaModel/physicsModel/EditRowTable',
setModalProps
({
confirmLoading
:
true
});
// query: {},
formData
.
value
.
code
=
values
.
dataScope
;
// });
formData
.
value
.
menuIds
=
values
.
menuIds
;
formData
.
value
.
deptIdList
=
''
;
formData
.
value
.
roleId
=
''
;
addDataScopeApi
(
formData
.
value
).
then
((
res
)
=>
{
if
(
res
.
code
===
200
)
{
createMessage
.
success
(
'新增成功'
);
closeModal
();
emit
(
'success'
,
{
isUpdate
:
unref
(
isPermiss
),
values
:
{
...
values
}
});
}
});
reload
();
}
finally
{
setModalProps
({
confirmLoading
:
false
});
}
}
</
script
>
<
style
scoped
lang=
"less"
>
.modal-content {
display: flex;
height: 100%; // 可以根据需要调整高度
.table-container,
.form-container {
flex: 1; // 每个容器占据一半的空间
overflow: auto; // 如果内容超出容器高度,则显示滚动条
}
.table-container {
closeModal
();
border-right: 1px solid #e9ecef; // 可选:在表格和表单之间添加分隔线
}
}
}
</
s
tyle
>
</
s
cript
>
src/views/notifications/noticeManage/index.vue
View file @
ccfe5aa1
...
@@ -196,6 +196,7 @@
...
@@ -196,6 +196,7 @@
/***新增规则按钮*/
/***新增规则按钮*/
function
handleCreate
()
{
function
handleCreate
()
{
openModalNew
(
true
,
{
openModalNew
(
true
,
{
isView
:
false
,
isUpdate
:
false
,
isUpdate
:
false
,
});
});
console
.
log
(
isUpdate
,
'11'
);
console
.
log
(
isUpdate
,
'11'
);
...
@@ -211,6 +212,7 @@
...
@@ -211,6 +212,7 @@
const
handleViewDetail
=
(
record
:
Recordable
)
=>
{
const
handleViewDetail
=
(
record
:
Recordable
)
=>
{
openModalNew
(
true
,
{
openModalNew
(
true
,
{
record
,
record
,
isView
:
true
,
isUpdate
:
true
,
isUpdate
:
true
,
});
});
};
};
...
@@ -233,6 +235,7 @@
...
@@ -233,6 +235,7 @@
function
handleEdit
(
record
:
Recordable
)
{
function
handleEdit
(
record
:
Recordable
)
{
openModalNew
(
true
,
{
openModalNew
(
true
,
{
record
,
record
,
isView
:
false
,
isUpdate
:
true
,
isUpdate
:
true
,
});
});
}
}
...
...
src/views/notifications/noticeManage/notiModalNew.vue
View file @
ccfe5aa1
...
@@ -11,50 +11,42 @@
...
@@ -11,50 +11,42 @@
</
template
>
</
template
>
<
script
lang=
"ts"
setup
>
<
script
lang=
"ts"
setup
>
import
{
ref
,
computed
,
unref
,
reactive
}
from
'vue'
;
import
{
ref
,
computed
,
unref
,
reactive
}
from
'vue'
;
import
{
BasicModal
,
useModalInner
}
from
'@/components/Modal'
;
import
{
BasicForm
,
useForm
}
from
'@/components/Form'
;
import
{
BasicForm
,
useForm
}
from
'@/components/Form'
;
import
{
formSchema
}
from
'./noti.data'
;
import
{
formSchema
}
from
'./noti.data'
;
import
{
BasicDrawer
,
useDrawerInner
}
from
'@/components/Drawer'
;
import
{
BasicTree
,
TreeItem
}
from
'@/components/Tree'
;
import
{
roleDetailApi
,
roleUpdataApi
,
addRoleApi
}
from
'@/api/system/role/role'
;
import
{
getMenuSelect
,
getRoleMenuSelected
}
from
'@/api/system/menu/menu'
;
import
{
encryptTwo
}
from
'@/utils/jsencrypt'
;
import
{
useMessage
}
from
'@/hooks/web/useMessage'
;
import
{
BasicModal
,
useModalInner
}
from
'@/components/Modal'
;
import
{
getDeptList
}
from
'@/api/system/dept/dept'
;
import
{
getDeptList
}
from
'@/api/system/dept/dept'
;
import
{
addUserApi
,
UserDetailApi
,
UserUpdataApi
}
from
'@/api/system/user/user'
;
import
{
addUserApi
,
UserDetailApi
,
UserUpdataApi
}
from
'@/api/system/user/user'
;
import
{
tableListtab1
}
from
'@/views/notifications/noticeManage/mock'
;
import
{
encryptTwo
}
from
'../../../../src/utils/jsencrypt.js'
;
import
{
useMessage
}
from
'@/hooks/web/useMessage'
;
import
{
TableData
}
from
'./mock'
;
import
{
router
}
from
'@/router'
;
import
{
router
}
from
'@/router'
;
const
getTitle
=
computed
(()
=>
(
!
unref
(
isUpdate
)
?
'新建通知规则'
:
'编辑通知规则'
)
);
defineOptions
({
name
:
'ModelModal'
}
);
const
emit
=
defineEmits
([
'success'
,
'register'
]);
const
emit
=
defineEmits
([
'success'
,
'register'
]);
const
{
createMessage
}
=
useMessage
();
const
{
createMessage
}
=
useMessage
();
const
isUpdate
=
ref
(
false
);
const
isUpdate
=
ref
(
true
);
const
isView
=
ref
(
false
);
const
isMove
=
ref
(
false
);
const
isMove
=
ref
(
false
);
const
rowId
=
ref
(
''
);
const
rowId
=
ref
(
''
);
const
roleId
=
ref
(
''
);
//获取接口数据并放在下拉框里(这里是打开了一个弹框)
const
treeData
=
ref
<
TreeItem
[]
>
([]);
//初始化表单
async
function
handleSubmit
()
{
const
[
registerForm
,
{
setFieldsValue
,
updateSchema
,
resetFields
,
validate
}]
=
useForm
({
const
values
=
await
validate
();
labelWidth
:
100
,
router
.
push
({
path
:
'/notifications/noticeManage'
,
query
:
{},
});
closeModal
();
}
const
[
registerForm
,
{
resetFields
,
setFieldsValue
,
validate
}]
=
useForm
({
labelWidth
:
90
,
baseColProps
:
{
span
:
24
},
schemas
:
formSchema
,
schemas
:
formSchema
,
showActionButtonGroup
:
false
,
showActionButtonGroup
:
false
,
actionColOptions
:
{
span
:
23
,
},
});
});
//初始化弹框
const
[
registerModal
,
{
setModalProps
,
closeModal
}]
=
useModalInner
(
async
(
data
)
=>
{
const
[
registerModal
,
{
setModalProps
,
closeModal
}]
=
useModalInner
(
async
(
data
)
=>
{
resetFields
();
resetFields
();
setModalProps
({
confirmLoading
:
false
});
setModalProps
({
confirmLoading
:
false
});
isUpdate
.
value
=
!!
data
?.
isUpdate
;
isUpdate
.
value
=
!!
data
?.
isUpdate
;
isMove
.
value
=
!!
data
?.
isMove
;
isMove
.
value
=
!!
data
?.
isMove
;
if
(
unref
(
isUpdate
)
&&
data
.
record
)
{
if
(
unref
(
isUpdate
))
{
// 获取行数据的id
// 获取行数据的id
rowId
.
value
=
data
.
record
.
businessId
;
rowId
.
value
=
data
.
record
.
businessId
;
// 塞值
// 塞值
...
@@ -62,5 +54,66 @@
...
@@ -62,5 +54,66 @@
...
data
.
record
,
...
data
.
record
,
});
});
}
}
// const treeList = handleTree(TableData, 'businessId', undefined, undefined, undefined);
// console.log('treeList', treeList);
// updateSchema([
// {
// field: 'modelId',
// componentProps: {
// tableData: treeList,
// },
// },
// ]);
});
});
// eslint-disable-next-line vue/return-in-computed-property
const
getTitle
=
computed
(()
=>
{
if
(
unref
(
isView
)
&&
unref
(
isUpdate
))
{
return
'查看通知详情'
;
}
else
if
(
unref
(
isUpdate
))
{
return
'编辑通知详情'
;
}
else
if
(
!
unref
(
isView
)
&&
!
unref
(
isUpdate
))
{
return
'新增通知详情'
;
}
});
function
handleTree
(
data
,
id
,
parentId
,
children
,
rootId
)
{
id
=
id
||
'id'
;
parentId
=
parentId
||
'parentId'
;
children
=
children
||
'children'
;
rootId
=
rootId
||
Math
.
min
.
apply
(
Math
,
data
.
map
((
item
)
=>
{
return
item
[
parentId
];
}),
)
||
0
;
// 对源数据深度克隆
const
cloneData
=
JSON
.
parse
(
JSON
.
stringify
(
data
));
// 循环所有项
const
treeData
=
cloneData
.
filter
((
father
)
=>
{
const
branchArr
=
cloneData
.
filter
((
child
)
=>
{
// 返回每一项的子级数组
return
father
[
id
]
===
child
[
parentId
];
});
branchArr
.
length
>
0
?
(
father
.
children
=
branchArr
)
:
''
;
// 返回第一层
return
father
[
parentId
]
===
rootId
;
});
return
treeData
!==
''
?
treeData
:
data
;
}
/**确定按钮*/
async
function
handleSubmit
()
{
const
values
=
await
validate
();
// router.push({
// path: '/metaModel/physicsModel/EditRowTable',
// query: {},
// });
closeModal
();
}
</
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