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
ecd202a5
Commit
ecd202a5
authored
Dec 10, 2024
by
罗林杰
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
b80f5dc4
ffab9d2f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
55 deletions
+19
-55
index.vue
src/views/dataWarehousePlanning/logicalModel/index.vue
+10
-1
model.data.ts
src/views/dataWarehousePlanning/logicalModel/model.data.ts
+4
-3
modelModal.vue
src/views/dataWarehousePlanning/logicalModel/modelModal.vue
+5
-51
No files found.
src/views/dataWarehousePlanning/logicalModel/index.vue
View file @
ecd202a5
...
@@ -16,7 +16,12 @@
...
@@ -16,7 +16,12 @@
@
click=
"handleWaitUpload"
@
click=
"handleWaitUpload"
>
设为待发布
</a-button
>
设为待发布
</a-button
>
>
<a-button
type=
"primary"
:disabled=
"getRowSelection().selectedRowKeys
<
=
0
"
@
click=
"handleUpload"
>
发布
</a-button>
<a-button
type=
"primary"
:disabled=
"getRowSelection().selectedRowKeys
<
=
0
"
@
click=
"handleUpload"
>
发布
</a-button
>
<a-button
type=
"primary"
@
click=
"handleImport"
>
导入
</a-button>
<a-button
type=
"primary"
@
click=
"handleImport"
>
导入
</a-button>
<a-button
<a-button
type=
"primary"
type=
"primary"
...
@@ -222,6 +227,10 @@
...
@@ -222,6 +227,10 @@
});
});
}
}
// 导出
function
handleExport
()
{
createMessage
.
success
(
'导出成功!'
);
}
/** 删除按钮*/
/** 删除按钮*/
function
handleDelete
()
{
function
handleDelete
()
{
createConfirm
({
createConfirm
({
...
...
src/views/dataWarehousePlanning/logicalModel/model.data.ts
View file @
ecd202a5
...
@@ -4,6 +4,7 @@ import { h } from 'vue';
...
@@ -4,6 +4,7 @@ import { h } from 'vue';
import
{
Tag
,
Switch
}
from
'ant-design-vue'
;
import
{
Tag
,
Switch
}
from
'ant-design-vue'
;
import
{
useMessage
}
from
'@/hooks/web/useMessage'
;
import
{
useMessage
}
from
'@/hooks/web/useMessage'
;
import
{
changeFlagApi
}
from
'@/api/system/user/user'
;
import
{
changeFlagApi
}
from
'@/api/system/user/user'
;
import
{
TreeData
}
from
"@/views/dataWarehousePlanning/logicalModel/modelData"
;
// 引入开关组件
// 引入开关组件
type
CheckedType
=
boolean
|
string
|
number
;
type
CheckedType
=
boolean
|
string
|
number
;
...
@@ -78,10 +79,10 @@ export const modelFormSchema: any[] = [
...
@@ -78,10 +79,10 @@ export const modelFormSchema: any[] = [
colProps
:
{
lg
:
24
,
md
:
24
},
colProps
:
{
lg
:
24
,
md
:
24
},
componentProps
:
{
componentProps
:
{
fieldNames
:
{
fieldNames
:
{
label
:
'
modelNam
e'
,
label
:
'
titl
e'
,
value
:
'
businessId
'
,
value
:
'
key
'
,
},
},
getPopupContainer
:
()
=>
document
.
body
,
treeData
:
TreeData
,
},
},
},
},
{
{
...
...
src/views/dataWarehousePlanning/logicalModel/modelModal.vue
View file @
ecd202a5
...
@@ -14,20 +14,14 @@
...
@@ -14,20 +14,14 @@
import
{
BasicModal
,
useModalInner
}
from
'@/components/Modal'
;
import
{
BasicModal
,
useModalInner
}
from
'@/components/Modal'
;
import
{
BasicForm
,
useForm
}
from
'@/components/Form'
;
import
{
BasicForm
,
useForm
}
from
'@/components/Form'
;
import
{
modelFormSchema
}
from
'./model.data'
;
import
{
modelFormSchema
}
from
'./model.data'
;
import
{
useMessage
}
from
'@/hooks/web/useMessage'
;
import
{
TreeData
}
from
'@/views/dataWarehousePlanning/logicalModel/modelData'
;
import
{
router
}
from
'@/router'
;
import
{
router
}
from
'@/router'
;
defineOptions
({
name
:
'ModelModal'
});
const
emit
=
defineEmits
([
'success'
,
'register'
]);
const
{
createMessage
}
=
useMessage
();
const
isUpdate
=
ref
(
true
);
const
isUpdate
=
ref
(
true
);
const
isMove
=
ref
(
false
);
const
isMove
=
ref
(
false
);
const
rowId
=
ref
(
''
);
const
rowId
=
ref
(
''
);
//获取接口数据并放在下拉框里(这里是打开了一个弹框)
//获取接口数据并放在下拉框里(这里是打开了一个弹框)
//初始化表单
//初始化表单
const
[
registerForm
,
{
setFieldsValue
,
updateSchema
,
resetFields
,
validate
}]
=
useForm
({
const
[
registerForm
,
{
setFieldsValue
,
resetFields
,
validate
}]
=
useForm
({
labelWidth
:
100
,
labelWidth
:
100
,
baseColProps
:
{
lg
:
12
,
md
:
24
},
baseColProps
:
{
lg
:
12
,
md
:
24
},
schemas
:
modelFormSchema
,
schemas
:
modelFormSchema
,
...
@@ -38,7 +32,7 @@
...
@@ -38,7 +32,7 @@
});
});
//初始化弹框
//初始化弹框
const
[
registerModal
,
{
setModalProps
,
closeModal
}]
=
useModalInner
(
async
(
data
)
=>
{
const
[
registerModal
,
{
setModalProps
,
closeModal
}]
=
useModalInner
(
async
(
data
)
=>
{
resetFields
();
await
resetFields
();
setModalProps
({
confirmLoading
:
false
});
setModalProps
({
confirmLoading
:
false
});
isUpdate
.
value
=
!!
data
?.
isUpdate
;
isUpdate
.
value
=
!!
data
?.
isUpdate
;
isMove
.
value
=
!!
data
?.
isMove
;
isMove
.
value
=
!!
data
?.
isMove
;
...
@@ -46,61 +40,21 @@
...
@@ -46,61 +40,21 @@
// 获取行数据的id
// 获取行数据的id
rowId
.
value
=
data
.
record
.
businessId
;
rowId
.
value
=
data
.
record
.
businessId
;
// 塞值
// 塞值
setFieldsValue
({
await
setFieldsValue
({
...
data
.
record
,
...
data
.
record
,
});
});
}
}
const
treeList
=
handleTree
(
TreeData
,
'businessId'
,
undefined
,
undefined
,
undefined
);
console
.
log
(
'treeList'
,
treeList
);
updateSchema
([
{
field
:
'modelId'
,
componentProps
:
{
treeData
:
treeList
,
},
},
]);
});
});
const
getTitle
=
computed
(()
=>
'新建文件'
);
const
getTitle
=
computed
(()
=>
'新建文件'
);
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
()
{
async
function
handleSubmit
()
{
const
values
=
await
validate
();
await
validate
();
router
.
push
({
await
router
.
push
({
path
:
'/metaModel/knowledgeModel/EditRowTable'
,
path
:
'/metaModel/knowledgeModel/EditRowTable'
,
query
:
{},
query
:
{},
});
});
closeModal
();
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