Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
liangzhen
/
framework-tools-web
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 80bd9658
authored
Feb 23, 2024
by
liuyong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改bug
1 parent
fe426ac4
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
722 additions
and
175 deletions
public/drawio/extention/js/exApp.js
public/drawio/extention/js/exGraph.js
src/api/index.js
src/views/archi-evolute-line/通用页面.vue
src/views/archi-view-manage/index.vue
src/views/meta-model-list/index.vue
src/views/metaModelDic/index(旧).vue
src/views/metaModelDic/index.vue
public/drawio/extention/js/exApp.js
View file @
80bd965
...
...
@@ -185,12 +185,11 @@ const leftCustomGraph = function(that) {//左侧自定义图形
// }
// })
const
standardGraph_
=
JSON
.
parse
(
localStorage
.
getItem
(
'standardGraph'
));
const
standardGraph
=
standardGraph_
.
graph
;
if
(
standardGraph_
.
show
)
{
standardGraph
.
pop
();
standardGraph
.
forEach
(
function
(
item
)
{
const
joinGraph_
=
JSON
.
parse
(
localStorage
.
getItem
(
'joinGraph'
));
const
joinGraph
=
joinGraph_
.
graph
;
if
(
joinGraph_
.
state
==
1
)
{
joinGraph
.
pop
();
joinGraph
.
forEach
(
function
(
item
)
{
if
(
item
.
eleDtos
)
{
if
(
item
.
eleDtos
.
length
>
0
)
{
const
libraryName
=
item
.
arciBelongName
;
...
...
@@ -213,6 +212,14 @@ const leftCustomGraph = function(that) {//左侧自定义图形
}
}
})
}
else
{
joinGraph
.
forEach
(
item
=>
{
item
.
subList
.
forEach
(
item2
=>
{
if
(
item2
.
eleType
==
'1'
)
{
console
.
log
(
item2
)
}
})
})
}
}
...
...
public/drawio/extention/js/exGraph.js
View file @
80bd965
...
...
@@ -41,88 +41,34 @@
{
const
commonGraph_
=
JSON
.
parse
(
localStorage
.
getItem
(
'commo
nGraph'
));
const
joinGraph_
=
JSON
.
parse
(
localStorage
.
getItem
(
'joi
nGraph'
));
if
(
commonGraph_
.
show
)
{
const
graphGroup
=
window
.
location
.
href
.
split
(
"id="
)[
1
].
split
(
"&"
)[
1
].
split
(
"="
)[
1
];
if
(
joinGraph_
.
state
==
2
)
{
const
joinGraph
=
joinGraph_
.
graph
;
// this.sidebarTitles = true;//勾选标签
const
commonGraph
=
commonGraph_
.
graph
.
filter
(
item
=>
item
.
arciBelongId
==
graphGroup
);
this
.
sidebarTitles
=
true
;
//勾选标签
commonGraph
.
forEach
(
item
=>
{
joinGraph
.
forEach
(
item
=>
{
let
fns
=
[];
item
.
eleDtos
.
forEach
(
item2
=>
{
if
(
item2
.
icon
)
{
if
(
item2
.
icon
.
includes
(
'data'
))
{
let
attr_
=
[];
if
(
item2
.
dicys
&&
item2
.
dicys
.
length
>
0
)
{
item2
.
dicys
.
forEach
(
res
=>
{
if
(
res
.
fieldName
)
{
attr_
.
push
(
{
name
:
res
.
fieldName
,
value
:
res
.
propertyValue
,
id
:
res
.
propertyId
,
controlType
:
res
.
controlType
,
}
)
}
})
}
fns
.
push
(
item2
.
color
?
this
.
createVertexTemplateEntry
(
item2
.
iconName
+
';fillColor='
+
item2
.
color
+
';'
+
'attr='
+
JSON
.
stringify
(
attr_
)
+
';eleId='
+
item2
.
eleBelongId
+
';eaLevel='
+
item2
.
eaLevel
+
';'
,
item2
.
shapeWidth
?
item2
.
shapeWidth
:
150
,
item2
.
shapeHeight
?
item2
.
shapeHeight
:
75
,
null
,
item2
.
eleName
,
null
,
null
,
'封闭图形2'
)
:
this
.
createEdgeTemplateEntry
(
item2
.
iconName
+
'attr='
+
JSON
.
stringify
(
attr_
),
item2
.
shapeWidth
?
item2
.
shapeWidth
:
150
,
item2
.
shapeHeight
?
item2
.
shapeHeight
:
75
,
''
,
item2
.
elementName
,
null
,
'非封闭图形2'
)
item
.
subList
.
forEach
(
item2
=>
{
if
(
item2
.
eleType
==
'2'
&&
item2
.
iconName
&&
item2
.
color
)
{
fns
.
push
(
this
.
createVertexTemplateEntry
(
item2
.
iconName
+
';fillColor='
+
item2
.
color
+
';'
+
'attr=[];'
,
150
,
75
,
null
,
item2
.
assetName
,
null
,
null
,
'封闭图形2'
)
}
)
}
})
this
.
addPaletteFunctions
(
item
.
arciBelongId
,
item
.
arciBelongName
,
true
,
fns
);
this
.
addPaletteFunctions
(
item
.
assetId
,
item
.
assetName
,
false
,
fns
);
});
// $.ajax({
// url: '/drawio/eachart.json', // 代表请求的服务器地址
// method: 'get', // 使用的请求方法
// contentType: 'application/x-www-form-urlencoded', // 请求的 enctype
// dataType: 'json', // 默认根据 response 头部的信息自动推测
// async: true, // 是否使用异步请求的方式
// }).done(data => {
// var ea = data.eadata;
// if(ea) {
// ea.forEach(ele => {
// var ii = ele.elements;
// var items = [];
// ii.forEach(element => {
// // items.push(this.createVertexTemplateEntry(element.styles, element.w, element.h, null, element.name, null, null, element.name));
// items.push(
// this.createEdgeTemplateEntry('endArrow=none;html=1;姓名=测试;', 50, 50, '', 'Line', null, 'simple undirected plain blank no')
// );
// });
// this.addPaletteFunctions(ea.id, ele.title, false, items);
// });
// }
// });
}
};
})();
\ No newline at end of file
src/api/index.js
View file @
80bd965
...
...
@@ -453,5 +453,21 @@ export function evoluteFunAndLineAdd(params) {
}
// 架构视图左侧图元
export
function
queryArchiGraph
(
params
)
{
return
post
(
'/network/arc-ast-cn/assetTree'
,
params
);
return
post
(
'/network/arc-ast-cn/fiveAssetTree'
,
params
);
}
// 元模型字典管理表格
export
function
queryCircleModelDicyTable
(
params
)
{
return
post
(
'/network/archi-model-dict/'
,
params
);
}
// 元模型字典管理,新增
export
function
addCircleModelDicyTable
(
params
)
{
return
post
(
'/network/archi-model-dict/cModelDict'
,
params
);
}
// 元模型字典管理,编辑
export
function
editCircleModelDicyTable
(
params
)
{
return
post
(
'/network/archi-model-dict/uModelDict'
,
params
);
}
// 元模型字典管理,发布,停用
export
function
releaseAndStopCircleModelDicyTable
(
params
)
{
return
post
(
'/network/archi-model-dict/pModelDict'
,
params
);
}
\ No newline at end of file
src/views/archi-evolute-line/通用页面.vue
View file @
80bd965
<
temp
late
>
<
temp
late
>
...
...
@@ -65,6 +65,28 @@
:total=
"pager.total"
>
</el-pagination>
</div>
<el-dialog
:title=
"is_add_edit == 'add' ? '新建字典' : '编辑字典'"
:visible
.
sync=
"add_dialog"
:center=
"false"
:close-on-click-modal=
"false"
width=
"60%"
>
<el-form
:model=
"ruleForm"
ref=
"form"
:rules=
"rules"
style=
"display: flex;flex-wrap: wrap;"
>
<el-form-item
label=
"字典名称:"
prop=
"let1"
>
<el-input
v-no-backslash
v-model=
"ruleForm.let1"
maxlength=
"100"
></el-input>
</el-form-item>
<el-form-item
label=
"字典标识:"
prop=
"let1"
>
<el-input
v-no-backslash
v-model=
"ruleForm.let1"
maxlength=
"100"
></el-input>
</el-form-item>
<el-form-item
class=
"cross1"
label=
"描述:"
prop=
"let3"
>
<el-input
v-no-backslash
type=
"textarea"
:rows=
"3"
maxlength=
"200"
show-word-limit
placeholder=
"请输入内容"
v-model=
"ruleForm.let3"
></el-input>
</el-form-item>
</el-form>
<span
slot=
"footer"
class=
"dialog-footer"
>
<el-button
class=
"greenButton"
@
click=
"save_dicy"
>
保存
</el-button>
<el-button
@
click=
"add_dialog = false"
>
取消
</el-button>
</span>
</el-dialog>
</div>
</template>
...
...
@@ -83,9 +105,9 @@ export default {
},
data
()
{
return
{
add_dialog
:
false
,
is_add_edit
:
'add'
,
tableData
:
[],
query_item3
:
null
,
query_item4
:
null
,
loading
:
false
,
search_select1
:
[],
pager
:
{
...
...
@@ -99,7 +121,8 @@ export default {
policyName
:
null
,
conformCount
:
null
,
},
fuHeDu
:
[]
fuHeDu
:
[],
};
},
mounted
(){
...
...
@@ -113,6 +136,15 @@ export default {
})
},
methods
:
{
save_dicy
()
{
//保存字典
this
.
$refs
.
form
.
validate
(
valid
=>
{
if
(
valid
)
{
}
else
{
return
false
;
}
});
},
get_fu_he_du_select
()
{
//符合度下拉
const
params
=
{
key
:
"tech_compliance"
...
...
@@ -323,4 +355,23 @@ export default {
/
deep
/
.el-pagination.is-background
.el-pager
li
:not
(
.disabled
)
.active
{
background-color
:
#0D867F
;
}
/
deep
/
.el-dialog__header
{
background-color
:
#0D867F
;
text-align
:
left
;
}
/
deep
/
.el-dialog__title
{
color
:
#fff
;
}
/
deep
/
.el-dialog__close
{
color
:
#fff
;
}
.greenButton
{
background-color
:
#0D867F
;
color
:
#fff
;
}
.el-form-item
{
display
:
flex
;
align-items
:
center
;
width
:
33%
;
}
</
style
>
\ No newline at end of file
src/views/archi-view-manage/index.vue
View file @
80bd965
...
...
@@ -436,18 +436,28 @@ export default {
localStorage
.
setItem
(
'xmlData'
,
xmlData
);
localStorage
.
setItem
(
'xmlTitle'
,
xmlTitle
);
Promise
.
all
([
this
.
queryDrawioGraph
(
id
),
this
.
queryDrawioGraph2
(
id
)
]).
then
(
res2
=>
{
Promise
.
all
([
this
.
queryDrawioGraph
(
id
),
this
.
queryDrawioGraph2
(
id
)
,
this
.
getArchiGraph
()
]).
then
(
res2
=>
{
localStorage
.
setItem
(
'commonGraph'
,
JSON
.
stringify
({
show
:
true
,
graph
:
res2
[
0
].
dataEle
}));
localStorage
.
setItem
(
'standardGraph'
,
JSON
.
stringify
({
show
:
true
,
graph
:
res2
[
1
].
dataEle
}));
localStorage
.
setItem
(
'joinGraph'
,
JSON
.
stringify
({
state
:
2
,
graph
:
res2
[
2
]
}));
this
.
$router
.
push
(
`/main/archiViewManageDetails?id=
${
id
}
&info=
${
this
.
graphGroup
}
`
,
()
=>
{},
()
=>
{}
);
});
}
});
},
queryArchiGraph
()
{
//查询综合图
queryArchiGraph
({}).
then
(
res
=>
{
console
.
log
(
res
)
localStorage
.
setItem
(
'joinGraph'
,
JSON
.
stringify
({
graph1
:
res2
[
1
].
dataEle
,
graph2
:
[]
}));
getArchiGraph
()
{
//查询综合图
return
new
Promise
((
resolve
,
reject
)
=>
{
queryArchiGraph
({}).
then
(
res
=>
{
if
(
res
.
code
==
200
)
{
resolve
(
res
.
data
);
}
else
{
Message
({
type
:
'error'
,
message
:
res
.
msg
});
reject
(
res
.
msg
);
}
})
})
},
treeClick
(
data
,
node
,
e
)
{
//树点击的时候
...
...
src/views/meta-model-list/index.vue
View file @
80bd965
...
...
@@ -309,6 +309,7 @@ export default {
Promise
.
all
([
this
.
queryDrawioGraph
(
item
.
metaModelId
),
this
.
queryDrawioGraph2
(
item
.
metaModelId
)
]).
then
(
res2
=>
{
localStorage
.
setItem
(
'commonGraph'
,
JSON
.
stringify
({
show
:
false
,
graph
:
res2
[
0
].
dataEle
}));
localStorage
.
setItem
(
'standardGraph'
,
JSON
.
stringify
({
show
:
true
,
graph
:
res2
[
1
].
dataEle
}));
localStorage
.
setItem
(
'joinGraph'
,
JSON
.
stringify
({
state
:
1
,
graph
:
res2
[
1
].
dataEle
}));
this
.
$router
.
push
(
`/main/metaModelListDetails?id=
${
item
.
metaModelId
}
&info=
${
item
.
version
}
`
,
()
=>
{},
()
=>
{}
);
});
}
...
...
src/views/metaModelDic/index(旧).vue
0 → 100644
View file @
80bd965
<
template
>
<
template
>
<div
class=
"JiaGouYuanShuGuanLi"
>
<div
class=
"table_container"
>
<el-tabs
v-model=
"activeName"
@
tab-click=
"handleClick"
>
<el-tab-pane
label=
"架构元素"
name=
"page1"
>
<page1></page1>
</el-tab-pane>
<el-tab-pane
label=
"元素关系"
name=
"page2"
>
<page2></page2>
</el-tab-pane>
<el-tab-pane
label=
"架构视图"
name=
"page3"
>
<page3></page3>
</el-tab-pane>
</el-tabs>
</div>
</div>
</
template
>
<
script
>
import
page1
from
"./pages/page1"
;
import
page2
from
"./pages/page2"
;
import
page3
from
"./pages/page3"
;
export
default
{
name
:
'metaModelDic'
,
components
:
{
page1
,
page2
,
page3
,
},
data
()
{
return
{
activeName
:
"page1"
,
};
},
mounted
()
{
},
created
()
{
},
methods
:
{
handleClick
(
tab
)
{
// console.log(tab);
},
},
}
</
script
>
<
style
lang=
"scss"
scoped
>
.JiaGouYuanShuGuanLi
{
width
:
100%
;
height
:
100%
;
display
:
flex
;
flex-direction
:
column
;
justify-content
:
flex-start
;
align-items
:
center
;
}
.search_menu
{
display
:
flex
;
justify-content
:
space-between
;
}
.search_menu_item_container
{
display
:
flex
;
align-items
:
center
;
}
.search_menu_btn_container
{
display
:
flex
;
align-items
:
center
;
}
.search_menu_item
{
display
:
flex
;
align-items
:
center
;
width
:
344px
;
}
.search_title
{
/* width: 20%; */
flex-shrink
:
0
;
margin-right
:
15px
;
}
.search_item
{
width
:
60%
;
}
.search_btn
{
width
:
100%
;
display
:
flex
;
margin-top
:
50px
;
margin-bottom
:
20px
;
}
.add_btn
{
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
width
:
76px
;
height
:
32px
;
background
:
rgba
(
13
,
134
,
127
,
0.1
);
border-radius
:
6px
6px
6px
6px
;
border
:
1px
solid
#0D867F
;
font-size
:
14px
;
color
:
#0D867F
;
cursor
:
pointer
;
}
.version_btn
{
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
width
:
104px
;
height
:
32px
;
background
:
rgba
(
13
,
134
,
127
,
0.1
);
border-radius
:
6px
6px
6px
6px
;
border
:
1px
solid
#0D867F
;
font-size
:
14px
;
color
:
#0D867F
;
cursor
:
pointer
;
margin-left
:
15px
;
}
.query_btn
{
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
width
:
76px
;
height
:
32px
;
background
:
rgba
(
13
,
134
,
127
,
1
);
border-radius
:
6px
6px
6px
6px
;
border
:
1px
solid
#0D867F
;
font-size
:
14px
;
color
:
#fff
;
margin-right
:
10px
;
cursor
:
pointer
;
}
.reset_btn
{
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
width
:
76px
;
height
:
32px
;
background
:
rgba
(
244
,
244
,
244
,
1
);
border-radius
:
6px
6px
6px
6px
;
border
:
1px
solid
#ccc
;
font-size
:
14px
;
color
:
#666
;
cursor
:
pointer
;
}
.btn_icon
{
margin-right
:
10px
;
}
.table_container
{
width
:
97%
;
margin-top
:
20px
;
}
.el-pagination
{
margin-top
:
50px
;
}
.dialog_form_item
{
display
:
flex
;
align-items
:
center
;
margin-bottom
:
10px
;
}
.dialog_form_item_title
{
flex-shrink
:
0
;
margin-right
:
15px
;
width
:
100px
;
text-align
:
right
;
.reqIcon{
color
:
red
;
}
}
/
deep
/
.el-dialog__header
{
text-align
:
left
;
}
/
deep
/
.el-pagination.is-background
.el-pager
li
:not
(
.disabled
)
.active
{
background-color
:
#0D867F
;
}
.greenButton
{
background-color
:
#0D867F
;
color
:
#fff
;
}
</
style
>
\ No newline at end of file
src/views/metaModelDic/index.vue
View file @
80bd965
<
template
>
<div
class=
"
JiaGouYuanShuGuanLi
"
>
<div
class=
"
metaModelDic
"
>
<div
class=
"table_container"
>
<el-tabs
v-model=
"activeName"
@
tab-click=
"handleClick"
>
<el-tab-pane
label=
"架构元素"
name=
"page1"
>
<page1></page1>
</el-tab-pane>
<el-tab-pane
label=
"元素关系"
name=
"page2"
>
<page2></page2>
</el-tab-pane>
<el-tab-pane
label=
"架构视图"
name=
"page3"
>
<page3></page3>
</el-tab-pane>
</el-tabs>
<div
class=
"search_menu"
>
<div
class=
"search_menu_item_container"
>
<div
class=
"search_menu_item"
>
<span
class=
"search_title"
>
字典名称
</span>
<el-input
v-model=
"searchParams.name"
placeholder=
"请输入内容"
class=
"search_item"
></el-input>
</div>
<div
class=
"search_menu_item"
>
<span
class=
"search_title"
>
字典状态
</span>
<el-select
v-model=
"searchParams.state"
placeholder=
"请选择"
class=
"search_item"
>
<el-option
label=
"已发布"
:value=
"1"
></el-option>
<el-option
label=
"已停用"
:value=
"0"
></el-option>
<el-option
label=
"暂存"
:value=
"2"
></el-option>
</el-select>
</div>
</div>
<div
class=
"search_menu_btn_container"
>
<div
class=
"query_btn"
@
click=
"search_table"
>
<img
class=
"btn_icon"
src=
"@/assets/archi-ele-list/search.png"
alt=
""
/>
<p>
查询
</p>
</div>
<div
class=
"reset_btn"
@
click=
"reset"
>
<img
class=
"btn_icon"
src=
"@/assets/archi-ele-list/reset.png"
alt=
""
/>
<p>
重置
</p>
</div>
</div>
</div>
<div
class=
"search_btn"
>
<el-button
type=
"primary"
size=
"medium"
icon=
"el-icon-document-add"
@
click=
"operation('add', null)"
>
新建
</el-button>
</div>
<el-table
:height=
"tableHeight"
v-loading=
"loading"
:data=
"tableData"
stripe
border
>
<el-table-column
type=
"index"
label=
"序号"
width=
"80"
align=
"center"
></el-table-column>
<el-table-column
prop=
"name"
label=
"字典名称"
align=
"center"
></el-table-column>
<el-table-column
prop=
"typeValue"
label=
"字典标识"
align=
"center"
></el-table-column>
<el-table-column
prop=
"version"
label=
"字典版本号"
align=
"center"
></el-table-column>
<el-table-column
label=
"字典状态"
align=
"center"
>
<template
slot-scope=
"scope"
>
<span
v-if=
"scope.row.state == 0"
>
已停用
</span>
<span
v-if=
"scope.row.state == 1"
>
已发布
</span>
<span
v-if=
"scope.row.state == 2"
>
暂存
</span>
</
template
>
</el-table-column>
<el-table-column
prop=
"remark"
label=
"描述"
align=
"center"
:show-overflow-tooltip=
"true"
></el-table-column>
<el-table-column
label=
"操作"
width=
"360"
align=
"center"
>
<
template
slot-scope=
"scope"
>
<div
style=
"display: flex;align-items: center;justify-content: center;"
>
<el-button
icon=
"el-icon-edit"
type=
"primary"
size=
"mini"
@
click=
"editItem(scope.row)"
:disabled=
"scope.row.state == 1"
>
维护
</el-button>
<el-button
icon=
"el-icon-edit"
type=
"primary"
size=
"mini"
@
click=
"operation('edit', scope.row)"
:disabled=
"scope.row.state == 1"
>
编辑
</el-button>
<el-button
icon=
"el-icon-upload2"
type=
"primary"
size=
"mini"
@
click=
"operation('release', scope.row)"
:disabled=
"scope.row.state == 1 "
>
发布
</el-button>
<el-button
class=
"tingYong_btn"
icon=
"el-icon-remove-outline"
size=
"mini"
@
click=
"operation('stop', scope.row)"
:disabled=
"scope.row.state != 1"
>
停用
</el-button>
</div>
</
template
>
</el-table-column>
</el-table>
<!-- <el-pagination
background
layout="prev, pager, next"
:total="50">
</el-pagination> -->
<el-pagination
background
@
size-change=
"handleSizeChange"
@
current-change=
"handleCurrentChange"
:current-page=
"pager.current"
:page-sizes=
"pager.sizes"
:page-size=
"pager.size"
layout=
"total, sizes, prev, pager, next, jumper"
:total=
"pager.total"
>
</el-pagination>
</div>
<el-dialog
:title=
"is_add_edit == 'add' ? '新建字典' : '编辑字典'"
:visible
.
sync=
"add_dialog"
:center=
"false"
:close-on-click-modal=
"false"
width=
"60%"
>
<el-form
:model=
"ruleForm"
ref=
"form"
:rules=
"rules"
style=
"display: flex;flex-wrap: wrap;"
>
<el-form-item
label=
"字典名称:"
prop=
"let1"
>
<el-input
v-no-backslash
v-model=
"ruleForm.let1"
maxlength=
"100"
></el-input>
</el-form-item>
<el-form-item
label=
"字典标识:"
prop=
"let2"
>
<el-input
v-no-backslash
v-model=
"ruleForm.let2"
maxlength=
"100"
></el-input>
</el-form-item>
<el-form-item
class=
"cross1"
label=
"描述:"
prop=
"let3"
>
<el-input
v-no-backslash
type=
"textarea"
:rows=
"3"
maxlength=
"200"
show-word-limit
placeholder=
"请输入内容"
v-model=
"ruleForm.let3"
></el-input>
</el-form-item>
</el-form>
<span
slot=
"footer"
class=
"dialog-footer"
>
<el-button
class=
"greenButton"
@
click=
"operation('save_dicy', null)"
>
保存
</el-button>
<el-button
@
click=
"add_dialog = false"
>
取消
</el-button>
</span>
</el-dialog>
</div>
</template>
<
script
>
import
page1
from
"./pages/page1"
;
import
page2
from
"./pages/page2"
;
import
page3
from
"./pages/page3"
;
import
{
queryCircleModelDicyTable
,
addCircleModelDicyTable
,
editCircleModelDicyTable
,
releaseAndStopCircleModelDicyTable
}
from
'@/api/index.js'
;
import
{
MessageBox
,
Message
}
from
'element-ui'
;
import
$
from
'jquery'
;
export
default
{
name
:
'
m
etaModelDic'
,
name
:
'
M
etaModelDic'
,
components
:
{
page1
,
page2
,
page3
,
},
data
()
{
return
{
activeName
:
"page1"
,
ruleForm
:
{
let1
:
null
,
let2
:
null
,
let3
:
null
,
},
rules
:
{
let1
:
[
{
required
:
true
,
message
:
'请输入字典名称'
,
trigger
:
'blur'
},
],
let2
:
[
{
required
:
true
,
message
:
'请输入字典标识'
,
trigger
:
'blur'
},
],
},
add_dialog
:
false
,
tableData
:
[],
loading
:
false
,
pager
:
{
current
:
1
,
sizes
:
[
10
,
20
,
50
,
100
,
200
],
size
:
10
,
total
:
20
//总条数
},
tableHeight
:
null
,
searchParams
:
{
name
:
null
,
state
:
null
,
},
is_add_edit
:
'add'
,
id
:
null
,
};
},
mounted
()
{
},
created
()
{
mounted
(){
window
.
addEventListener
(
'resize'
,
()
=>
{
this
.
set_table_height
();
})
this
.
set_table_height
();
this
.
get_table
();
},
methods
:
{
handleClick
(
tab
)
{
// console.log(tab);
operation
(
state
,
data
)
{
switch
(
state
){
case
'add'
:
this
.
addItem
();
break
;
case
'save_dicy'
:
this
.
save_dicy
();
break
;
case
'edit'
:
this
.
editItem
(
data
);
break
;
case
'release'
:
this
.
releaseItem
(
data
);
break
;
case
'stop'
:
this
.
stopItem
(
data
);
break
;
}
},
},
stopItem
(
row
){
MessageBox
.
confirm
(
'确定停用?'
,
'提示'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
customClass
:
'messageClass'
,
confirmButtonClass
:
'confirmClass'
,
type
:
'warning'
}).
then
(()
=>
{
const
params
=
{
id
:
row
.
id
,
state
:
0
,
}
releaseAndStopCircleModelDicyTable
(
params
).
then
(
res
=>
{
if
(
res
.
code
==
200
)
{
this
.
get_table
();
Message
({
type
:
'success'
,
message
:
'停用成功!'
});
}
else
{
Message
({
type
:
'error'
,
message
:
'停用失败!'
});
}
});
}).
catch
(()
=>
{
Message
({
type
:
'info'
,
message
:
'已取消'
});
});
},
releaseItem
(
row
){
MessageBox
.
confirm
(
'确定发布?'
,
'提示'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
customClass
:
'messageClass'
,
confirmButtonClass
:
'confirmClass'
,
type
:
'warning'
}).
then
(()
=>
{
const
params
=
{
id
:
row
.
id
,
state
:
1
,
}
releaseAndStopCircleModelDicyTable
(
params
).
then
(
res
=>
{
if
(
res
.
code
==
200
)
{
this
.
get_table
();
Message
({
type
:
'success'
,
message
:
'发布成功!'
});
}
else
{
Message
({
type
:
'error'
,
message
:
'发布失败!'
});
}
});
}).
catch
(()
=>
{
Message
({
type
:
'info'
,
message
:
'已取消'
});
});
},
addItem
()
{
//新增
this
.
add_dialog
=
true
;
this
.
is_add_edit
=
'add'
;
this
.
$nextTick
(()
=>
{
this
.
$refs
.
form
.
resetFields
();
this
.
ruleForm
.
let1
=
null
;
this
.
ruleForm
.
let2
=
null
;
this
.
ruleForm
.
let3
=
null
;
});
},
editItem
(
row
)
{
//编辑
this
.
is_add_edit
=
'edit'
;
this
.
add_dialog
=
true
;
this
.
id
=
row
.
id
;
this
.
ruleForm
.
let1
=
row
.
name
;
this
.
ruleForm
.
let2
=
row
.
typeValue
;
this
.
ruleForm
.
let3
=
row
.
remark
;
this
.
$nextTick
(()
=>
{
this
.
$refs
.
form
.
clearValidate
();
});
},
save_dicy
()
{
//保存字典
this
.
$refs
.
form
.
validate
(
valid
=>
{
if
(
valid
)
{
const
params
=
{
"name"
:
this
.
ruleForm
.
let1
,
"typeValue"
:
this
.
ruleForm
.
let2
,
"remark"
:
this
.
ruleForm
.
let3
,
};
const
requestParams
=
this
.
is_add_edit
==
'add'
?
params
:
{
...
params
,
id
:
this
.
id
};
if
(
this
.
is_add_edit
==
'add'
)
{
addCircleModelDicyTable
(
requestParams
).
then
(
res
=>
{
if
(
res
.
code
==
200
)
{
this
.
add_dialog
=
false
;
this
.
get_table
();
Message
({
type
:
'success'
,
message
:
'保存成功!'
});
}
else
{
Message
({
type
:
'error'
,
message
:
res
.
msg
});
}
});
}
else
{
editCircleModelDicyTable
(
requestParams
).
then
(
res
=>
{
if
(
res
.
code
==
200
)
{
this
.
add_dialog
=
false
;
this
.
get_table
();
Message
({
type
:
'success'
,
message
:
'保存成功!'
});
}
else
{
Message
({
type
:
'error'
,
message
:
res
.
msg
});
}
});
}
}
else
{
return
false
;
}
});
},
set_table_height
()
{
//动态设置表格高度
const
table_container_height
=
$
(
".table_container"
).
height
();
const
search_menu_height
=
$
(
".search_menu"
).
height
();
const
search_btn_height
=
$
(
".search_btn"
).
outerHeight
(
true
);
this
.
tableHeight
=
table_container_height
-
search_menu_height
-
search_btn_height
-
90
+
'px'
;
},
search_table
()
{
//搜索
this
.
pager
.
current
=
1
;
this
.
get_table
();
},
reset
()
{
//重置
this
.
searchParams
.
name
=
null
;
this
.
searchParams
.
state
=
null
;
},
// 每页条数改变
handleSizeChange
(
val
)
{
this
.
pager
.
current
=
1
;
this
.
pager
.
size
=
val
;
this
.
get_table
();
},
//当前页码改变
handleCurrentChange
(
val
)
{
this
.
pager
.
current
=
val
;
this
.
get_table
();
},
get_table
()
{
//查询表格数据
this
.
loading
=
true
;
const
params
=
{
"name"
:
this
.
searchParams
.
name
,
"state"
:
this
.
searchParams
.
state
,
"current"
:
this
.
pager
.
current
,
"pageSize"
:
this
.
pager
.
size
,
};
queryCircleModelDicyTable
(
params
).
then
(
res
=>
{
if
(
res
.
code
==
200
)
{
this
.
loading
=
false
;
this
.
tableData
=
res
.
data
.
records
;
this
.
pager
.
current
=
res
.
data
.
current
;
this
.
pager
.
total
=
res
.
data
.
total
;
this
.
pager
.
size
=
res
.
data
.
size
;
}
});
},
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
.JiaGouYuanShuGuanLi
{
<
style
>
.confirmClass
{
background-color
:
#0D867F
!important
;
}
.el-message-box__content
{
padding
:
60px
15px
60px
15px
;
}
</
style
>
<
style
scoped
>
/
deep
/
.el-dialog__header
{
background-color
:
#0D867F
;
text-align
:
left
;
}
/
deep
/
.el-dialog__title
{
color
:
#fff
;
}
/
deep
/
.el-dialog__close
{
color
:
#fff
;
}
.greenButton
{
background-color
:
#0D867F
;
color
:
#fff
;
}
.version_btn
{
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
width
:
84px
;
height
:
32px
;
background
:
rgba
(
13
,
134
,
127
,
0.1
);
border-radius
:
6px
6px
6px
6px
;
/* border: 1px solid #0D867F; */
font-size
:
14px
;
color
:
#0D867F
;
cursor
:
pointer
;
margin-left
:
15px
;
}
.cancel_version_btn
{
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
width
:
104px
;
height
:
32px
;
background
:
rgba
(
13
,
134
,
127
,
0.1
);
border-radius
:
6px
6px
6px
6px
;
/* border: 1px solid #0D867F; */
font-size
:
14px
;
color
:
#0D867F
;
cursor
:
pointer
;
margin-left
:
15px
;
}
.metaModelDic
{
width
:
100%
;
height
:
100%
;
display
:
flex
;
...
...
@@ -55,9 +410,31 @@ export default {
justify-content
:
flex-start
;
align-items
:
center
;
}
.el-button--primary
{
background
:
rgba
(
13
,
134
,
127
,
0.1
);
color
:
#0D867F
;
border
:
0
;
}
/
deep
/
.el-input-group__append
{
background-color
:
#0D867F
;
color
:
#fff
;
cursor
:
pointer
;
}
.el-form-item
{
display
:
flex
;
align-items
:
center
;
width
:
33%
;
}
.search_btn
{
width
:
100%
;
display
:
flex
;
margin-top
:
50px
;
margin-bottom
:
20px
;
}
.search_menu
{
display
:
flex
;
justify-content
:
space-between
;
margin-bottom
:
50px
;
}
.search_menu_item_container
{
display
:
flex
;
...
...
@@ -80,38 +457,12 @@ export default {
.search_item
{
width
:
60%
;
}
.search_btn
{
width
:
100%
;
display
:
flex
;
margin-top
:
50px
;
margin-bottom
:
20px
;
.cross1
{
width
:
100%
!important
;
margin-left
:
27px
;
}
.add_btn
{
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
width
:
76px
;
height
:
32px
;
background
:
rgba
(
13
,
134
,
127
,
0.1
);
border-radius
:
6px
6px
6px
6px
;
border
:
1px
solid
#0D867F
;
font-size
:
14px
;
color
:
#0D867F
;
cursor
:
pointer
;
}
.version_btn
{
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
width
:
104px
;
height
:
32px
;
background
:
rgba
(
13
,
134
,
127
,
0.1
);
border-radius
:
6px
6px
6px
6px
;
border
:
1px
solid
#0D867F
;
font-size
:
14px
;
color
:
#0D867F
;
cursor
:
pointer
;
margin-left
:
15px
;
/
deep
/
.cross1
>
.el-form-item__content
{
width
:
89.5%
!important
;
}
.query_btn
{
display
:
flex
;
...
...
@@ -128,6 +479,10 @@ export default {
cursor
:
pointer
;
}
.tingYong_btn
{
color
:
#DEA82A
;
background-color
:
#FDF6E6
;
}
.reset_btn
{
display
:
flex
;
align-items
:
center
;
...
...
@@ -147,33 +502,13 @@ export default {
}
.table_container
{
width
:
97%
;
height
:
calc
(
100%
-
40px
);
margin-top
:
20px
;
}
.el-pagination
{
margin-top
:
50px
;
}
.dialog_form_item
{
display
:
flex
;
align-items
:
center
;
margin-bottom
:
10px
;
}
.dialog_form_item_title
{
flex-shrink
:
0
;
margin-right
:
15px
;
width
:
100px
;
text-align
:
right
;
.reqIcon{
color
:
red
;
}
}
/
deep
/
.el-dialog__header
{
text-align
:
left
;
margin-top
:
30px
;
}
/
deep
/
.el-pagination.is-background
.el-pager
li
:not
(
.disabled
)
.active
{
background-color
:
#0D867F
;
}
.greenButton
{
background-color
:
#0D867F
;
color
:
#fff
;
}
</
style
>
\ No newline at end of file
Write
Preview
Markdown
is supported
Attach a file
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 post a comment