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 d533039a
authored
Dec 11, 2023
by
liuyong
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://47.97.176.204:19000/wangwansu/iact_jiagou_drowio
2 parents
379ee7f3
aefd62aa
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
561 additions
and
196 deletions
package-lock.json
package.json
public/drawio/extention/js/exMenus.js
public/drawio/extention/js/loadDiagram.js
public/drawio/js/diagramly/App.js
src/views/archiEleRela/index.vue
src/views/archiViewConfig/index.vue
src/views/metaModelDic/pages/page1.vue
src/views/metaModelDic/pages/page2.vue
src/views/metaModelDic/pages/page3.vue
package-lock.json
View file @
d533039
This diff could not be displayed because it is too large.
package.json
View file @
d533039
...
...
@@ -24,8 +24,8 @@
"@vue/cli-plugin-router"
:
"~5.0.0"
,
"@vue/cli-plugin-vuex"
:
"~5.0.0"
,
"@vue/cli-service"
:
"~5.0.0"
,
"node-sass"
:
"^
4.14
.1"
,
"sass-loader"
:
"^
7.3
.1"
,
"node-sass"
:
"^
6.0
.1"
,
"sass-loader"
:
"^
10.0
.1"
,
"vue-template-compiler"
:
"^2.6.14"
},
"browserslist"
:
[
...
...
public/drawio/extention/js/exMenus.js
View file @
d533039
...
...
@@ -29,17 +29,18 @@ var exToolbar = function (toolbarContainer) {
// Toggles compact mode
mxEvent
.
addListener
(
this
.
toggleElement
,
'click'
,
mxUtils
.
bind
(
this
,
function
(
evt
)
{
swal
({
title
:
""
,
text
:
'该操作将发布架构设计新版本,请确认是否继续?'
,
confirmButtonColor
:
'rgb(13,134,127)'
,
icon
:
"warning"
,
buttons
:
[
"取消"
,
"发布"
]
}).
then
(
res
=>
{
swal
({
title
:
"
版本发布确认
"
,
text
:
'该操作将发布架构设计新版本,请确认是否继续?'
,
confirmButtonColor
:
'rgb(13,134,127)'
,
icon
:
"warning"
,
buttons
:
[
"取消"
,
"发布"
]
}).
then
(
res
=>
{
if
(
res
)
{
var
jsonData
=
{
"metaModelId"
:
urlParams
[
'id'
],
"version"
:
urlParams
[
'version'
],
"state"
:
1
}
$
.
ajax
({
method
:
"post"
,
url
:
"http://43.143.211.42:7003/ynMol/updateYnMol"
,
data
:
{
metaModelId
:
urlParams
[
'id'
],
version
:
urlParams
[
'version'
],
state
:
urlParams
[
'state'
],
},
// contentType: 'application/json',
contentType
:
'application/json'
,
data
:
JSON
.
stringify
(
jsonData
),
success
:
function
(
result
)
{
swal
(
"版本发布"
,
"发布成功!"
);
},
...
...
public/drawio/extention/js/loadDiagram.js
View file @
d533039
...
...
@@ -2,6 +2,9 @@
var
loadDiagram
=
function
(
id
,
diagramTitle
)
{
var
requestUrl
=
id
==
1
?
'/drawio/extention/xml/meta-model.xml'
:
'/drawio/extention/xml/architecture-assets.xml'
;
if
(
id
==
3
)
{
requestUrl
=
'/drawio/extention/xml/meta-model-data.xml'
;
}
var
resultData
=
{};
$
.
ajax
({
type
:
"get"
,
...
...
public/drawio/js/diagramly/App.js
View file @
d533039
...
...
@@ -486,8 +486,8 @@ App.getStoredMode = function()
window
.
location
.
hash
==
''
)
||
(
window
.
location
.
hash
!=
null
&&
window
.
location
.
hash
.
substring
(
0
,
2
)
==
'#G'
))
{
//
mxscript('https://apis.google.com/js/api.js'); //二次开发 删除apis.google.com的加载过程,改为加载本地文件
mxscript
(
'js/api.js'
);
mxscript
(
'https://apis.google.com/js/api.js'
);
//二次开发 删除apis.google.com的加载过程,改为加载本地文件
//
mxscript('js/api.js');
}
// Keeps lazy loading for fallback to authenticated Google file if not public in loadFile
else
if
(
urlParams
[
'chrome'
]
==
'0'
&&
(
window
.
location
.
hash
==
null
||
...
...
@@ -884,8 +884,8 @@ App.main = function(callback, createUi)
(
urlParams
[
'embed'
]
==
'1'
&&
urlParams
[
'gapi'
]
==
'1'
))
&&
isSvgBrowser
&&
isLocalStorage
&&
(
document
.
documentMode
==
null
||
document
.
documentMode
>=
10
))))
{
//
mxscript('https://apis.google.com/js/api.js?onload=DrawGapiClientCallback', null, null, null, mxClient.IS_SVG);
mxscript
(
'js/api.js'
,
null
,
null
,
null
,
mxClient
.
IS_SVG
);
//二次开发,下载翻墙插件到本地
mxscript
(
'https://apis.google.com/js/api.js?onload=DrawGapiClientCallback'
,
null
,
null
,
null
,
mxClient
.
IS_SVG
);
//
mxscript('js/api.js', null, null, null, mxClient.IS_SVG);//二次开发,下载翻墙插件到本地
}
// Disables client
else
if
(
typeof
window
.
gapi
===
'undefined'
)
...
...
src/views/archiEleRela/index.vue
View file @
d533039
...
...
@@ -69,7 +69,7 @@
<div
style=
"display: flex;align-items: center;justify-content: center;"
>
<el-button
icon=
"el-icon-edit"
size=
"mini"
@
click=
"operate('edit',scope.row)"
:disabled=
"scope.row.state == 1"
>
编辑
</el-button>
<el-button
icon=
"el-icon-remove-outline"
size=
"mini"
@
click=
"operate('stop',scope.row)"
:disabled=
"scope.row.state != 1"
>
停用
</el-button>
<el-button
icon=
"el-icon-upload2"
size=
"mini"
@
click=
"operate('push',scope.row)"
:disabled=
"scope.row.state == 1"
>
发布
</el-button>
<el-button
icon=
"el-icon-upload2"
size=
"mini"
@
click=
"operate('push
Edit
',scope.row)"
:disabled=
"scope.row.state == 1"
>
发布
</el-button>
<el-button
icon=
"el-icon-delete"
size=
"mini"
@
click=
"operate('del',scope.row)"
:disabled=
"scope.row.state != 2"
>
删除
</el-button>
<!--
<div
class=
"add_btn"
@
click=
"operate('edit',scope.row)"
style=
"border: 0;margin-right: 8px;"
>
<img
class=
"btn_icon"
src=
"@/assets/编辑_icon_default.png"
alt=
""
/>
...
...
@@ -119,7 +119,7 @@
</div>
</div>
<span
slot=
"footer"
class=
"dialog-footer"
>
<el-button
class=
"greenButton"
@
click=
"operate('push')"
>
发布
</el-button>
<el-button
class=
"greenButton"
@
click=
"operate('push
Add
')"
>
发布
</el-button>
<el-button
class=
"greenButton"
@
click=
"operate('create')"
>
保存
</el-button>
<el-button
@
click=
"add_dialog = false"
>
取消
</el-button>
</span>
...
...
@@ -171,7 +171,7 @@ export default {
current
:
1
,
sizes
:
[
10
,
20
,
50
,
100
,
200
],
size
:
10
,
total
:
20
//总条数
total
:
0
,
//总条数
},
dicObj
:
{
state
:
{
...
...
@@ -212,9 +212,8 @@ export default {
}
getJGYSGLlist
(
this
.
params
).
then
(
res
=>
{
if
(
res
.
code
==
200
)
{
// this.page.total = res.data.total;
// this.tableData = res.data.records;
this
.
tableData
=
res
.
data
;
this
.
page
.
total
=
res
.
data
.
total
;
this
.
tableData
=
res
.
data
.
records
;
}
});
},
...
...
@@ -271,7 +270,7 @@ export default {
}
});
}
}
else
if
(
type
==
"push"
)
{
}
else
if
(
type
==
"push
Add
"
)
{
this
.
formData
.
state
=
1
;
if
(
this
.
formData
.
eleRelaId
)
{
// 编辑发布
...
...
@@ -292,6 +291,17 @@ export default {
}
});
}
}
else
if
(
type
==
"pushEdit"
)
{
// 编辑发布
this
.
formData
=
item
this
.
formData
.
state
=
1
;
getJGYSGLUpdate
(
this
.
formData
).
then
(
res
=>
{
if
(
res
.
code
==
200
)
{
this
.
$message
.
success
(
"发布成功"
);
this
.
add_dialog
=
false
;
this
.
getList
();
}
});
}
else
if
(
type
==
"stop"
)
{
// 停用
this
.
formData
=
item
;
...
...
@@ -312,6 +322,7 @@ export default {
}).
then
(()
=>
{
getJGYSGLDel
(
this
.
formData
).
then
(
res
=>
{
if
(
res
.
code
==
200
)
{
this
.
$message
.
success
(
"删除成功"
);
this
.
getList
();
}
});
...
...
src/views/archiViewConfig/index.vue
View file @
d533039
...
...
@@ -71,7 +71,7 @@
<div
style=
"display: flex;align-items: center;justify-content: center;"
>
<el-button
icon=
"el-icon-edit"
size=
"mini"
@
click=
"operate('edit',scope.row)"
:disabled=
"scope.row.state == 1"
>
编辑
</el-button>
<el-button
icon=
"el-icon-remove-outline"
size=
"mini"
@
click=
"operate('stop',scope.row)"
:disabled=
"scope.row.state != 1"
>
停用
</el-button>
<el-button
icon=
"el-icon-upload2"
size=
"mini"
@
click=
"operate('push',scope.row)"
:disabled=
"scope.row.state == 1"
>
发布
</el-button>
<el-button
icon=
"el-icon-upload2"
size=
"mini"
@
click=
"operate('push
Edit
',scope.row)"
:disabled=
"scope.row.state == 1"
>
发布
</el-button>
<el-button
icon=
"el-icon-delete"
size=
"mini"
@
click=
"operate('del',scope.row)"
:disabled=
"scope.row.state != 2"
>
删除
</el-button>
</div>
</
template
>
...
...
@@ -109,8 +109,7 @@
</el-select>
</div>
<div
class=
"dialog_form_item"
>
<div
class=
"dialog_form_item_title"
><span
class=
"reqIcon"
>
*
</span>
架构视图名称:
</div>
<!-- <el-input placeholder="" class="dialog_form_item_content" v-model="formData.viewName"></el-input> -->
<div
class=
"dialog_form_item_title"
><span
class=
"reqIcon"
>
*
</span>
架构视图名称
</div>
<el-select
v-model=
"formData.viewName"
placeholder=
"请选择"
clearable
class=
"search_item"
>
<el-option
v-for=
"(item,idnex) in viewNameList"
:key=
"idnex"
:label=
"item"
:value=
"item"
></el-option>
</el-select>
...
...
@@ -120,7 +119,7 @@
<div
class=
"dialog_form_item_title"
><span
class=
"reqIcon"
>
*
</span>
视图描述
</div>
<el-input
type=
"textarea"
:rows=
"2"
placeholder=
"请输入内容"
class=
"dialog_form_item_content"
v-model=
"formData.content"
></el-input>
</div>
<
!-- <
div class="dialog_form_item">
<div
class=
"dialog_form_item"
>
<div
class=
"dialog_form_item_title"
>
*元素范围
</div>
<el-table
:data=
"tableData2"
border
>
<el-table-column
type=
"selection"
width=
"55"
></el-table-column>
...
...
@@ -135,10 +134,10 @@
<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>
</div>
-->
</div>
</div>
<span
slot=
"footer"
class=
"dialog-footer"
>
<el-button
class=
"greenButton"
@
click=
"operate('push')"
>
发布
</el-button>
<el-button
class=
"greenButton"
@
click=
"operate('push
Add
')"
>
发布
</el-button>
<el-button
class=
"greenButton"
@
click=
"operate('create')"
>
保存
</el-button>
<el-button
@
click=
"add_dialog = false"
>
取消
</el-button>
</span>
...
...
@@ -203,7 +202,7 @@ export default {
current
:
1
,
sizes
:
[
10
,
20
,
50
,
100
,
200
],
size
:
10
,
total
:
20
//总条数
total
:
0
,
//总条数
},
dicObj
:
{
state
:
{
...
...
@@ -295,14 +294,10 @@ export default {
methods
:
{
// 查询列表
getList
()
{
// if (this.params.state != '') {
// this.params.state = Number(this.params.state)
// }
getJGSTPZlist
(
this
.
params
).
then
(
res
=>
{
if
(
res
.
code
==
200
)
{
// this.page.total = res.data.total;
// this.tableData = res.data.records;
this
.
tableData
=
res
.
data
;
this
.
page
.
total
=
res
.
data
.
total
;
this
.
tableData
=
res
.
data
.
records
;
}
});
},
...
...
@@ -310,7 +305,6 @@ export default {
getViewNameList
()
{
getViewNameList
().
then
(
res
=>
{
if
(
res
.
code
==
200
)
{
console
.
log
(
res
);
let
arr
=
JSON
.
parse
(
res
.
msg
);
let
viewStr
=
arr
[
0
].
viewName
;
this
.
viewNameList
=
viewStr
.
split
(
","
);
...
...
@@ -371,7 +365,7 @@ export default {
}
});
}
}
else
if
(
type
==
"push"
)
{
}
else
if
(
type
==
"push
Add
"
)
{
this
.
formData
.
state
=
1
;
if
(
this
.
formData
.
viewId
)
{
// 编辑发布
...
...
@@ -392,6 +386,17 @@ export default {
}
});
}
}
else
if
(
type
==
"pushEdit"
)
{
// 编辑发布
this
.
formData
=
item
this
.
formData
.
state
=
1
;
getJGSTPZUpdate
(
this
.
formData
).
then
(
res
=>
{
if
(
res
.
code
==
200
)
{
this
.
$message
.
success
(
"发布成功"
);
this
.
add_dialog
=
false
;
this
.
getList
();
}
});
}
else
if
(
type
==
"stop"
)
{
// 停用
this
.
formData
=
item
;
...
...
@@ -412,6 +417,7 @@ export default {
}).
then
(()
=>
{
getJGSTPZDel
(
this
.
formData
).
then
(
res
=>
{
if
(
res
.
code
==
200
)
{
this
.
$message
.
success
(
"删除成功"
);
this
.
getList
();
}
});
...
...
src/views/metaModelDic/pages/page1.vue
View file @
d533039
...
...
@@ -56,7 +56,7 @@
<el-button
icon=
"el-icon-edit"
size=
"mini"
@
click=
"operate('edit',scope.row)"
:disabled=
"scope.row.state == 1"
>
编辑
</el-button>
<el-button
icon=
"el-icon-remove-outline"
size=
"mini"
@
click=
"operate('stop',scope.row)"
:disabled=
"scope.row.state != 1"
>
停用
</el-button>
<el-button
icon=
"el-icon-upload2"
size=
"mini"
@
click=
"operate('push',scope.row)"
:disabled=
"scope.row.state == 1"
>
发布
</el-button>
<
el-button
icon=
"el-icon-delete"
size=
"mini"
@
click=
"operate('del',scope.row)"
:disabled=
"scope.row.state != 2"
>
删除
</el-button
>
<
!--
<el-button
icon=
"el-icon-delete"
size=
"mini"
@
click=
"operate('del',scope.row)"
:disabled=
"scope.row.state != 2"
>
删除
</el-button>
--
>
</div>
</
template
>
</el-table-column>
...
...
@@ -77,16 +77,78 @@
:title=
"title"
:visible
.
sync=
"add_dialog"
:center=
"false"
width=
"
4
0%"
>
width=
"
6
0%"
>
<div
class=
"add_dialog_content"
>
<div
class=
"dialog_content_1"
>
<div
class=
"dialog_form_item"
>
<div
class=
"dialog_form_item_title"
><span
class=
"reqIcon"
>
*
</span>
字典
名称
</div>
<el-input
placeholder=
"请输入内容"
class=
"dialog_form_item_content"
v-model=
"formData.rsNam
e"
></el-input>
<div
class=
"dialog_form_item_title"
>
元素
名称
</div>
<el-input
placeholder=
""
class=
"dialog_form_item_content"
v-model=
"formData.elementName"
:disabled=
"tru
e"
></el-input>
</div>
<div
class=
"dialog_form_item"
>
<div
class=
"dialog_form_item_title"
><span
class=
"reqIcon"
>
*
</span>
字典描述
</div>
<el-input
type=
"textarea"
:rows=
"2"
placeholder=
"请输入内容"
class=
"dialog_form_item_content"
v-model=
"formData.content"
></el-input>
<div
class=
"dialog_form_item_title"
>
架构归属
</div>
<el-select
v-model=
"formData.archIBelongId"
placeholder=
""
:disabled=
"true"
class=
"search_item"
>
<el-option
v-for=
"(item,idnex) in search_select1"
:key=
"idnex"
:label=
"item.name"
:value=
"item.belongId"
></el-option>
</el-select>
</div>
<div
class=
"dialog_form_item"
>
<div
class=
"dialog_form_item_title"
>
状态
</div>
<el-select
v-model=
"formData.state"
placeholder=
""
:disabled=
"true"
class=
"search_item"
>
<el-option
v-for=
"(item,idnex) in stateList"
:key=
"idnex"
:label=
"item.label"
:value=
"item.value"
></el-option>
</el-select>
</div>
</div>
<el-table
:data=
"tableData2"
stripe
border
height=
"350"
@
cell-dblclick=
"tableDbclick"
>
<el-table-column
type=
"index"
label=
"序号"
width=
"80"
align=
"center"
></el-table-column>
<el-table-column
prop=
"fieldName"
label=
"字段名"
align=
"center"
>
<
template
slot-scope=
"scope"
>
<div
v-show=
" !columnIsShow|| (editIndex!= scope.row.index)"
>
{{
scope
.
row
.
fieldName
}}
</div>
<el-input
v-show=
"columnIsShow&& (editIndex== scope.row.index)"
@
blur=
"columnIsShow = false"
v-model=
"scope.row.fieldName"
></el-input>
</
template
>
</el-table-column>
<el-table-column
prop=
"chineseName"
label=
"中文名"
align=
"center"
>
<
template
slot-scope=
"scope"
>
<div
v-show=
" !columnIsShow|| (editIndex!= scope.row.index)"
>
{{
scope
.
row
.
chineseName
}}
</div>
<el-input
v-show=
"columnIsShow&& (editIndex== scope.row.index)"
@
blur=
"columnIsShow = false"
v-model=
"scope.row.chineseName"
></el-input>
</
template
>
</el-table-column>
<el-table-column
prop=
"displayOrder"
label=
"排序"
align=
"center"
>
<
template
slot-scope=
"scope"
>
<div
v-show=
" !columnIsShow|| (editIndex!= scope.row.index)"
>
{{
scope
.
row
.
displayOrder
}}
</div>
<el-input
v-show=
"columnIsShow&& (editIndex== scope.row.index)"
@
blur=
"columnIsShow = false"
v-model=
"scope.row.displayOrder"
></el-input>
</
template
>
</el-table-column>
<el-table-column
prop=
"contentLength"
label=
"长度"
align=
"center"
>
<
template
slot-scope=
"scope"
>
<div
v-show=
" !columnIsShow|| (editIndex!= scope.row.index)"
>
{{
scope
.
row
.
contentLength
}}
</div>
<el-input
v-show=
"columnIsShow&& (editIndex== scope.row.index)"
@
blur=
"columnIsShow = false"
v-model=
"scope.row.contentLength"
></el-input>
</
template
>
</el-table-column>
<el-table-column
prop=
"controlType"
label=
"控件"
align=
"center"
>
<
template
slot-scope=
"scope"
>
<div
v-show=
" !columnIsShow|| (editIndex!= scope.row.index)"
>
{{
dicObj
.
controlType
[
scope
.
row
.
controlType
]
}}
</div>
<el-select
v-show=
"columnIsShow&& (editIndex== scope.row.index)"
v-model=
"scope.row.controlType"
>
<el-option
v-for=
"(item, stateListIndex) in stateList"
:key=
"stateListIndex"
:label=
"item.label"
:value=
"item.value"
></el-option>
</el-select>
</
template
>
</el-table-column>
<el-table-column
label=
"操作"
width=
"200"
align=
"center"
>
<
template
slot-scope=
"scope"
>
<div
style=
"display: flex;align-items: center;justify-content: center;"
>
<!--
<el-button
icon=
"el-icon-edit"
size=
"mini"
@
click=
"operateDia('edit',scope.row)"
>
编辑
</el-button>
-->
<el-button
icon=
"el-icon-circle-plus-outline"
size=
"mini"
@
click=
"operateDia('add',scope.row,scope.$index)"
>
添加
</el-button>
<el-button
icon=
"el-icon-delete"
size=
"mini"
@
click=
"operateDia('del',scope.row,scope.$index)"
>
删除
</el-button>
</div>
</
template
>
</el-table-column>
</el-table>
<!-- <div class="newBtn">
<el-button class="addItem" icon="el-icon-plus" circle></el-button>
</div> -->
</div>
<span
slot=
"footer"
class=
"dialog-footer"
>
<el-button
class=
"greenButton"
@
click=
"operate('push')"
>
发布
</el-button>
...
...
@@ -115,6 +177,15 @@ export default {
data
()
{
return
{
tableData
:
[],
tableData2
:
[
{
fieldName
:
""
,
chineseName
:
""
,
displayOrder
:
""
,
controlType
:
""
,
contentLength
:
""
,
}
],
selectList
:
[],
add_dialog
:
false
,
title
:
""
,
...
...
@@ -143,7 +214,7 @@ export default {
current
:
1
,
sizes
:
[
10
,
20
,
50
,
100
,
200
],
size
:
10
,
total
:
20
//总条数
total
:
0
,
//总条数
},
dicObj
:
{
state
:
{
...
...
@@ -151,6 +222,11 @@ export default {
1
:
"已发布"
,
2
:
"暂存"
,
},
controlType
:
{
0
:
"单行文本框"
,
1
:
"多行文本框"
,
2
:
"下拉框"
,
}
},
stateList
:
[
{
...
...
@@ -167,6 +243,22 @@ export default {
},
],
search_select1
:
[],
selectTypeList
:
[
{
label
:
"单行文本框"
,
value
:
0
,
},
{
label
:
"多行文本框"
,
value
:
1
,
},
{
label
:
"下拉框"
,
value
:
2
,
},
],
columnIsShow
:
false
,
editIndex
:
-
1
,
// 当前编辑行
};
},
mounted
()
{
...
...
@@ -184,9 +276,8 @@ export default {
getList
()
{
getYMXZDGLlist
(
this
.
params
).
then
(
res
=>
{
if
(
res
.
code
==
200
)
{
// this.page.total = res.data.total;
// this.tableData = res.data.records;
this
.
tableData
=
res
.
data
;
this
.
page
.
total
=
res
.
data
.
total
;
this
.
tableData
=
res
.
data
.
records
;
}
});
},
...
...
@@ -215,14 +306,21 @@ export default {
// 所有操作
operate
(
type
,
item
){
this
.
openType
=
type
;
if
(
type
==
"add"
)
{
this
.
add_dialog
=
true
;
this
.
title
=
"新建字典"
;
this
.
resetForm
();
}
else
if
(
type
==
"edit"
)
{
if
(
type
==
"edit"
)
{
this
.
add_dialog
=
true
;
this
.
title
=
"编辑字典"
;
this
.
formData
=
item
;
if
(
this
.
tableData2
.
length
==
0
)
{
this
.
tableData2
=
[
{
fieldName
:
""
,
chineseName
:
""
,
displayOrder
:
""
,
controlType
:
""
,
contentLength
:
""
,
}
];
}
}
else
if
(
type
==
"create"
)
{
this
.
formData
.
state
=
2
;
if
(
this
.
formData
.
dicyId
)
{
...
...
@@ -234,20 +332,11 @@ export default {
this
.
getList
();
}
});
}
else
{
// 新建保存
getYMXZDGLAdd
(
this
.
formData
).
then
(
res
=>
{
if
(
res
.
code
==
200
)
{
this
.
$message
.
success
(
"保存成功"
);
this
.
add_dialog
=
false
;
this
.
getList
();
}
});
}
}
else
if
(
type
==
"push"
)
{
this
.
formData
.
state
=
1
;
if
(
this
.
formData
.
dicyId
)
{
// 编辑发布
this
.
formData
.
state
=
1
;
getYMXZDGLUpdate
(
this
.
formData
).
then
(
res
=>
{
if
(
res
.
code
==
200
)
{
this
.
$message
.
success
(
"发布成功"
);
...
...
@@ -256,8 +345,9 @@ export default {
}
});
}
else
{
// 新建发布
getYMXZDGLAdd
(
this
.
formData
).
then
(
res
=>
{
this
.
formData
=
item
;
this
.
formData
.
state
=
1
;
getYMXZDGLUpdate
(
this
.
formData
).
then
(
res
=>
{
if
(
res
.
code
==
200
)
{
this
.
$message
.
success
(
"发布成功"
);
this
.
add_dialog
=
false
;
...
...
@@ -277,38 +367,19 @@ export default {
});
}
else
if
(
type
==
"del"
)
{
// 删除
this
.
formData
=
item
;
this
.
$confirm
(
"确认删除吗"
,
"提示"
,
{
confirmButtonText
:
"确定"
,
cancelButtonText
:
"取消"
,
type
:
"warning"
}).
then
(()
=>
{
getYMXZDGLDel
(
this
.
formData
).
then
(
res
=>
{
if
(
res
.
code
==
200
)
{
this
.
getList
();
}
});
});
}
else
if
(
type
==
"pushAll"
)
{
if
(
this
.
selectList
.
length
<=
0
)
{
this
.
$message
.
error
(
"请选择一项进行发布"
);
return
;
}
let
params
=
{
dicyId
:
[],
state
:
2
};
this
.
selectList
.
map
(
item
=>
{
params
.
dicyId
.
push
(
item
.
dicyId
)
})
console
.
log
(
params
);
getJGYSGLUpdateBatch
(
params
).
then
(
res
=>
{
if
(
res
.
code
==
200
)
{
this
.
$message
.
success
(
"批量发布成功"
);
this
.
getList
();
}
});
// this.formData = item;
// this.$confirm("确认删除吗", "提示", {
// confirmButtonText: "确定",
// cancelButtonText: "取消",
// type: "warning"
// }).then(() => {
// getYMXZDGLDel(this.formData).then(res => {
// if (res.code == 200) {
// this.$message.success("删除成功");
// this.getList();
// }
// });
// });
}
},
// 新建清空表单
...
...
@@ -341,6 +412,36 @@ export default {
});
})
},
// 对话表格操作
operateDia
(
type
,
scopeRow
,
index
){
console
.
log
(
type
,
scopeRow
,
index
);
let
arr
=
this
.
tableData2
.
concat
();
let
addData
=
JSON
.
parse
(
JSON
.
stringify
(
arr
[
index
]));
// JSON.parse(JSON.stringify(arr[index]))
switch
(
type
)
{
// 添加
case
'add'
:
addData
.
fieldName
=
''
;
addData
.
chineseName
=
''
;
addData
.
displayOrder
=
''
;
addData
.
contentLength
=
''
;
addData
.
controlType
=
''
;
arr
.
splice
(
index
+
1
,
0
,
addData
);
break
;
// 删除
case
'del'
:
arr
.
splice
(
index
,
1
)
break
;
}
this
.
tableData2
=
arr
;
},
tableDbclick
(
row
,
column
,
cell
,
e
){
if
(
this
.
readOnly
)
{
return
;
}
this
.
editIndex
=
row
.
index
;
this
.
columnIsShow
=
true
;
},
},
}
</
script
>
...
...
@@ -353,6 +454,17 @@ export default {
justify-content
:
flex-start
;
align-items
:
center
;
}
.newBtn
{
margin-top
:
5px
;
.addItem{
background-color
:
#0D867F
;
color
:
#fff
;
}
}
.dialog_content_1
{
display
:
flex
;
justify-content
:
space-between
;
}
.search_menu
{
display
:
flex
;
justify-content
:
space-between
;
...
...
src/views/metaModelDic/pages/page2.vue
View file @
d533039
...
...
@@ -61,7 +61,7 @@
<el-button
icon=
"el-icon-edit"
size=
"mini"
@
click=
"operate('edit',scope.row)"
:disabled=
"scope.row.state == 1"
>
编辑
</el-button>
<el-button
icon=
"el-icon-remove-outline"
size=
"mini"
@
click=
"operate('stop',scope.row)"
:disabled=
"scope.row.state != 1"
>
停用
</el-button>
<el-button
icon=
"el-icon-upload2"
size=
"mini"
@
click=
"operate('push',scope.row)"
:disabled=
"scope.row.state == 1"
>
发布
</el-button>
<
el-button
icon=
"el-icon-delete"
size=
"mini"
@
click=
"operate('del',scope.row)"
:disabled=
"scope.row.state != 2"
>
删除
</el-button
>
<
!--
<el-button
icon=
"el-icon-delete"
size=
"mini"
@
click=
"operate('del',scope.row)"
:disabled=
"scope.row.state != 2"
>
删除
</el-button>
--
>
</div>
</
template
>
</el-table-column>
...
...
@@ -82,16 +82,82 @@
:title=
"title"
:visible
.
sync=
"add_dialog"
:center=
"false"
width=
"
4
0%"
>
width=
"
6
0%"
>
<div
class=
"add_dialog_content"
>
<div
class=
"dialog_content_1"
>
<div
class=
"dialog_form_item"
>
<div
class=
"dialog_form_item_title"
><span
class=
"reqIcon"
>
*
</span>
字典
名称
</div>
<el-input
placeholder=
"请输入内容"
class=
"dialog_form_item_content"
v-model=
"formData.rsNam
e"
></el-input>
<div
class=
"dialog_form_item_title"
>
元素关系
名称
</div>
<el-input
placeholder=
""
class=
"dialog_form_item_content"
v-model=
"formData.rsName"
:disabled=
"tru
e"
></el-input>
</div>
<div
class=
"dialog_form_item"
>
<div
class=
"dialog_form_item_title"
><span
class=
"reqIcon"
>
*
</span>
字典描述
</div>
<el-input
type=
"textarea"
:rows=
"2"
placeholder=
"请输入内容"
class=
"dialog_form_item_content"
v-model=
"formData.content"
></el-input>
<div
class=
"dialog_form_item_title"
>
适用范围
</div>
<el-select
v-model=
"formData.scope"
placeholder=
""
:disabled=
"true"
class=
"search_item"
>
<el-option
label=
"业务架构"
value=
"业务架构"
></el-option>
<el-option
label=
"应用架构"
value=
"应用架构"
></el-option>
<el-option
label=
"内容架构"
value=
"内容架构"
></el-option>
<el-option
label=
"技术架构"
value=
"技术架构"
></el-option>
<el-option
label=
"安全架构"
value=
"安全架构"
></el-option>
</el-select>
</div>
<div
class=
"dialog_form_item"
>
<div
class=
"dialog_form_item_title"
>
状态
</div>
<el-select
v-model=
"formData.state"
placeholder=
""
:disabled=
"true"
class=
"search_item"
>
<el-option
v-for=
"(item,idnex) in stateList"
:key=
"idnex"
:label=
"item.label"
:value=
"item.value"
></el-option>
</el-select>
</div>
</div>
<el-table
:data=
"tableData2"
stripe
border
height=
"350"
@
cell-dblclick=
"tableDbclick"
>
<el-table-column
type=
"index"
label=
"序号"
width=
"80"
align=
"center"
></el-table-column>
<el-table-column
prop=
"fieldName"
label=
"字段名"
align=
"center"
>
<
template
slot-scope=
"scope"
>
<div
v-show=
" !columnIsShow|| (editIndex!= scope.row.index)"
>
{{
scope
.
row
.
fieldName
}}
</div>
<el-input
v-show=
"columnIsShow&& (editIndex== scope.row.index)"
@
blur=
"columnIsShow = false"
v-model=
"scope.row.fieldName"
></el-input>
</
template
>
</el-table-column>
<el-table-column
prop=
"chineseName"
label=
"中文名"
align=
"center"
>
<
template
slot-scope=
"scope"
>
<div
v-show=
" !columnIsShow|| (editIndex!= scope.row.index)"
>
{{
scope
.
row
.
chineseName
}}
</div>
<el-input
v-show=
"columnIsShow&& (editIndex== scope.row.index)"
@
blur=
"columnIsShow = false"
v-model=
"scope.row.chineseName"
></el-input>
</
template
>
</el-table-column>
<el-table-column
prop=
"displayOrder"
label=
"排序"
align=
"center"
>
<
template
slot-scope=
"scope"
>
<div
v-show=
" !columnIsShow|| (editIndex!= scope.row.index)"
>
{{
scope
.
row
.
displayOrder
}}
</div>
<el-input
v-show=
"columnIsShow&& (editIndex== scope.row.index)"
@
blur=
"columnIsShow = false"
v-model=
"scope.row.displayOrder"
></el-input>
</
template
>
</el-table-column>
<el-table-column
prop=
"contentLength"
label=
"长度"
align=
"center"
>
<
template
slot-scope=
"scope"
>
<div
v-show=
" !columnIsShow|| (editIndex!= scope.row.index)"
>
{{
scope
.
row
.
contentLength
}}
</div>
<el-input
v-show=
"columnIsShow&& (editIndex== scope.row.index)"
@
blur=
"columnIsShow = false"
v-model=
"scope.row.contentLength"
></el-input>
</
template
>
</el-table-column>
<el-table-column
prop=
"controlType"
label=
"控件"
align=
"center"
>
<
template
slot-scope=
"scope"
>
<div
v-show=
" !columnIsShow|| (editIndex!= scope.row.index)"
>
{{
dicObj
.
controlType
[
scope
.
row
.
controlType
]
}}
</div>
<el-select
v-show=
"columnIsShow&& (editIndex== scope.row.index)"
v-model=
"scope.row.controlType"
>
<el-option
v-for=
"(item, stateListIndex) in stateList"
:key=
"stateListIndex"
:label=
"item.label"
:value=
"item.value"
></el-option>
</el-select>
</
template
>
</el-table-column>
<el-table-column
label=
"操作"
width=
"200"
align=
"center"
>
<
template
slot-scope=
"scope"
>
<div
style=
"display: flex;align-items: center;justify-content: center;"
>
<!--
<el-button
icon=
"el-icon-edit"
size=
"mini"
@
click=
"operateDia('edit',scope.row)"
>
编辑
</el-button>
-->
<el-button
icon=
"el-icon-circle-plus-outline"
size=
"mini"
@
click=
"operateDia('add',scope.row,scope.$index)"
>
添加
</el-button>
<el-button
icon=
"el-icon-delete"
size=
"mini"
@
click=
"operateDia('del',scope.row,scope.$index)"
>
删除
</el-button>
</div>
</
template
>
</el-table-column>
</el-table>
<!-- <div class="newBtn">
<el-button class="addItem" icon="el-icon-plus" circle></el-button>
</div> -->
</div>
<span
slot=
"footer"
class=
"dialog-footer"
>
<el-button
class=
"greenButton"
@
click=
"operate('push')"
>
发布
</el-button>
...
...
@@ -119,6 +185,15 @@ export default {
data
()
{
return
{
tableData
:
[],
tableData2
:
[
{
fieldName
:
""
,
chineseName
:
""
,
displayOrder
:
""
,
controlType
:
""
,
contentLength
:
""
,
}
],
selectList
:
[],
add_dialog
:
false
,
title
:
""
,
...
...
@@ -147,7 +222,7 @@ export default {
current
:
1
,
sizes
:
[
10
,
20
,
50
,
100
,
200
],
size
:
10
,
total
:
20
//总条数
total
:
0
,
//总条数
},
dicObj
:
{
state
:
{
...
...
@@ -155,6 +230,11 @@ export default {
1
:
"已发布"
,
2
:
"暂存"
,
},
controlType
:
{
0
:
"单行文本框"
,
1
:
"多行文本框"
,
2
:
"下拉框"
,
}
},
stateList
:
[
{
...
...
@@ -170,6 +250,22 @@ export default {
value
:
2
,
},
],
selectTypeList
:
[
{
label
:
"单行文本框"
,
value
:
0
,
},
{
label
:
"多行文本框"
,
value
:
1
,
},
{
label
:
"下拉框"
,
value
:
2
,
},
],
columnIsShow
:
false
,
editIndex
:
-
1
,
// 当前编辑行
};
},
mounted
()
{
...
...
@@ -182,11 +278,9 @@ export default {
// 查询列表
getList
()
{
getYMXZDGLlist
(
this
.
params
).
then
(
res
=>
{
console
.
log
(
res
);
if
(
res
.
code
==
200
)
{
// this.page.total = res.data.total;
// this.tableData = res.data.records;
this
.
tableData
=
res
.
data
;
this
.
page
.
total
=
res
.
data
.
total
;
this
.
tableData
=
res
.
data
.
records
;
}
});
},
...
...
@@ -215,14 +309,21 @@ export default {
// 所有操作
operate
(
type
,
item
){
this
.
openType
=
type
;
if
(
type
==
"add"
)
{
this
.
add_dialog
=
true
;
this
.
title
=
"新建字典"
;
this
.
resetForm
();
}
else
if
(
type
==
"edit"
)
{
if
(
type
==
"edit"
)
{
this
.
add_dialog
=
true
;
this
.
title
=
"编辑字典"
;
this
.
formData
=
item
;
if
(
this
.
tableData2
.
length
==
0
)
{
this
.
tableData2
=
[
{
fieldName
:
""
,
chineseName
:
""
,
displayOrder
:
""
,
controlType
:
""
,
contentLength
:
""
,
}
];
}
}
else
if
(
type
==
"create"
)
{
this
.
formData
.
state
=
2
;
if
(
this
.
formData
.
dicyId
)
{
...
...
@@ -245,9 +346,9 @@ export default {
});
}
}
else
if
(
type
==
"push"
)
{
this
.
formData
.
state
=
1
;
if
(
this
.
formData
.
dicyId
)
{
// 编辑发布
this
.
formData
.
state
=
1
;
getYMXZDGLUpdate
(
this
.
formData
).
then
(
res
=>
{
if
(
res
.
code
==
200
)
{
this
.
$message
.
success
(
"发布成功"
);
...
...
@@ -256,8 +357,9 @@ export default {
}
});
}
else
{
// 新建发布
getYMXZDGLAdd
(
this
.
formData
).
then
(
res
=>
{
this
.
formData
=
item
;
this
.
formData
.
state
=
1
;
getYMXZDGLUpdate
(
this
.
formData
).
then
(
res
=>
{
if
(
res
.
code
==
200
)
{
this
.
$message
.
success
(
"发布成功"
);
this
.
add_dialog
=
false
;
...
...
@@ -277,38 +379,19 @@ export default {
});
}
else
if
(
type
==
"del"
)
{
// 删除
this
.
formData
=
item
;
this
.
$confirm
(
"确认删除吗"
,
"提示"
,
{
confirmButtonText
:
"确定"
,
cancelButtonText
:
"取消"
,
type
:
"warning"
}).
then
(()
=>
{
getYMXZDGLDel
(
this
.
formData
).
then
(
res
=>
{
if
(
res
.
code
==
200
)
{
this
.
getList
();
}
});
});
}
else
if
(
type
==
"pushAll"
)
{
if
(
this
.
selectList
.
length
<=
0
)
{
this
.
$message
.
error
(
"请选择一项进行发布"
);
return
;
}
let
params
=
{
dicyId
:
[],
state
:
2
};
this
.
selectList
.
map
(
item
=>
{
params
.
dicyId
.
push
(
item
.
dicyId
)
})
console
.
log
(
params
);
getJGYSGLUpdateBatch
(
params
).
then
(
res
=>
{
if
(
res
.
code
==
200
)
{
this
.
$message
.
success
(
"批量发布成功"
);
this
.
getList
();
}
});
// this.formData = item;
// this.$confirm("确认删除吗", "提示", {
// confirmButtonText: "确定",
// cancelButtonText: "取消",
// type: "warning"
// }).then(() => {
// getYMXZDGLDel(this.formData).then(res => {
// if (res.code == 200) {
// this.$message.success("删除成功");
// this.getList();
// }
// });
// });
}
},
// 新建清空表单
...
...
@@ -330,6 +413,36 @@ export default {
return
false
//不可勾选
}
},
// 对话表格操作
operateDia
(
type
,
scopeRow
,
index
){
console
.
log
(
type
,
scopeRow
,
index
);
let
arr
=
this
.
tableData2
.
concat
();
let
addData
=
JSON
.
parse
(
JSON
.
stringify
(
arr
[
index
]));
// JSON.parse(JSON.stringify(arr[index]))
switch
(
type
)
{
// 添加
case
'add'
:
addData
.
fieldName
=
''
;
addData
.
chineseName
=
''
;
addData
.
displayOrder
=
''
;
addData
.
contentLength
=
''
;
addData
.
controlType
=
''
;
arr
.
splice
(
index
+
1
,
0
,
addData
);
break
;
// 删除
case
'del'
:
arr
.
splice
(
index
,
1
)
break
;
}
this
.
tableData2
=
arr
;
},
tableDbclick
(
row
,
column
,
cell
,
e
){
if
(
this
.
readOnly
)
{
return
;
}
this
.
editIndex
=
row
.
index
;
this
.
columnIsShow
=
true
;
},
},
}
</
script
>
...
...
@@ -342,6 +455,10 @@ export default {
justify-content
:
flex-start
;
align-items
:
center
;
}
.dialog_content_1
{
display
:
flex
;
justify-content
:
space-between
;
}
.search_menu
{
display
:
flex
;
justify-content
:
space-between
;
...
...
src/views/metaModelDic/pages/page3.vue
View file @
d533039
...
...
@@ -63,7 +63,7 @@
<el-button
icon=
"el-icon-edit"
size=
"mini"
@
click=
"operate('edit',scope.row)"
:disabled=
"scope.row.state == 1"
>
编辑
</el-button>
<el-button
icon=
"el-icon-remove-outline"
size=
"mini"
@
click=
"operate('stop',scope.row)"
:disabled=
"scope.row.state != 1"
>
停用
</el-button>
<el-button
icon=
"el-icon-upload2"
size=
"mini"
@
click=
"operate('push',scope.row)"
:disabled=
"scope.row.state == 1"
>
发布
</el-button>
<
el-button
icon=
"el-icon-delete"
size=
"mini"
@
click=
"operate('del',scope.row)"
:disabled=
"scope.row.state != 2"
>
删除
</el-button
>
<
!--
<el-button
icon=
"el-icon-delete"
size=
"mini"
@
click=
"operate('del',scope.row)"
:disabled=
"scope.row.state != 2"
>
删除
</el-button>
--
>
</div>
</
template
>
</el-table-column>
...
...
@@ -84,16 +84,80 @@
:title=
"title"
:visible
.
sync=
"add_dialog"
:center=
"false"
width=
"
4
0%"
>
width=
"
6
0%"
>
<div
class=
"add_dialog_content"
>
<div
class=
"dialog_content_1"
>
<div
class=
"dialog_form_item"
>
<div
class=
"dialog_form_item_title"
><span
class=
"reqIcon"
>
*
</span>
字典名称
</div>
<el-input
placeholder=
"请输入内容"
class=
"dialog_form_item_content"
v-model=
"formData.rsName"
></el-input>
<div
class=
"dialog_form_item_title"
>
架构视图名称
</div>
<el-select
v-model=
"params.viewName"
placeholder=
""
:disabled=
"true"
class=
"search_item"
>
<el-option
v-for=
"(item,idnex) in viewNameList"
:key=
"idnex"
:label=
"item"
:value=
"item"
></el-option>
</el-select>
</div>
<div
class=
"dialog_form_item"
>
<div
class=
"dialog_form_item_title"
>
架构层次
</div>
<el-select
v-model=
"formData.schemaLevel"
placeholder=
""
:disabled=
"true"
class=
"search_item"
>
<el-option
v-for=
"(item,idnex) in levelList"
:key=
"idnex"
:label=
"item.label"
:value=
"item.value"
></el-option>
</el-select>
</div>
<div
class=
"dialog_form_item"
>
<div
class=
"dialog_form_item_title"
><span
class=
"reqIcon"
>
*
</span>
字典描述
</div>
<el-input
type=
"textarea"
:rows=
"2"
placeholder=
"请输入内容"
class=
"dialog_form_item_content"
v-model=
"formData.content"
></el-input>
<div
class=
"dialog_form_item_title"
>
架构归属
</div>
<el-select
v-model=
"formData.schemaBelong"
placeholder=
""
:disabled=
"true"
class=
"search_item"
>
<el-option
v-for=
"(item,idnex) in belongList"
:key=
"idnex"
:label=
"item.label"
:value=
"item.value"
></el-option>
</el-select>
</div>
</div>
<el-table
:data=
"tableData2"
stripe
border
height=
"350"
@
cell-dblclick=
"tableDbclick"
>
<el-table-column
type=
"index"
label=
"序号"
width=
"80"
align=
"center"
></el-table-column>
<el-table-column
prop=
"fieldName"
label=
"字段名"
align=
"center"
>
<
template
slot-scope=
"scope"
>
<div
v-show=
" !columnIsShow|| (editIndex!= scope.row.index)"
>
{{
scope
.
row
.
fieldName
}}
</div>
<el-input
v-show=
"columnIsShow&& (editIndex== scope.row.index)"
@
blur=
"columnIsShow = false"
v-model=
"scope.row.fieldName"
></el-input>
</
template
>
</el-table-column>
<el-table-column
prop=
"chineseName"
label=
"中文名"
align=
"center"
>
<
template
slot-scope=
"scope"
>
<div
v-show=
" !columnIsShow|| (editIndex!= scope.row.index)"
>
{{
scope
.
row
.
chineseName
}}
</div>
<el-input
v-show=
"columnIsShow&& (editIndex== scope.row.index)"
@
blur=
"columnIsShow = false"
v-model=
"scope.row.chineseName"
></el-input>
</
template
>
</el-table-column>
<el-table-column
prop=
"displayOrder"
label=
"排序"
align=
"center"
>
<
template
slot-scope=
"scope"
>
<div
v-show=
" !columnIsShow|| (editIndex!= scope.row.index)"
>
{{
scope
.
row
.
displayOrder
}}
</div>
<el-input
v-show=
"columnIsShow&& (editIndex== scope.row.index)"
@
blur=
"columnIsShow = false"
v-model=
"scope.row.displayOrder"
></el-input>
</
template
>
</el-table-column>
<el-table-column
prop=
"contentLength"
label=
"长度"
align=
"center"
>
<
template
slot-scope=
"scope"
>
<div
v-show=
" !columnIsShow|| (editIndex!= scope.row.index)"
>
{{
scope
.
row
.
contentLength
}}
</div>
<el-input
v-show=
"columnIsShow&& (editIndex== scope.row.index)"
@
blur=
"columnIsShow = false"
v-model=
"scope.row.contentLength"
></el-input>
</
template
>
</el-table-column>
<el-table-column
prop=
"controlType"
label=
"控件"
align=
"center"
>
<
template
slot-scope=
"scope"
>
<div
v-show=
" !columnIsShow|| (editIndex!= scope.row.index)"
>
{{
dicObj
.
controlType
[
scope
.
row
.
controlType
]
}}
</div>
<el-select
v-show=
"columnIsShow&& (editIndex== scope.row.index)"
v-model=
"scope.row.controlType"
>
<el-option
v-for=
"(item, stateListIndex) in stateList"
:key=
"stateListIndex"
:label=
"item.label"
:value=
"item.value"
></el-option>
</el-select>
</
template
>
</el-table-column>
<el-table-column
label=
"操作"
width=
"200"
align=
"center"
>
<
template
slot-scope=
"scope"
>
<div
style=
"display: flex;align-items: center;justify-content: center;"
>
<!--
<el-button
icon=
"el-icon-edit"
size=
"mini"
@
click=
"operateDia('edit',scope.row)"
>
编辑
</el-button>
-->
<el-button
icon=
"el-icon-circle-plus-outline"
size=
"mini"
@
click=
"operateDia('add',scope.row,scope.$index)"
>
添加
</el-button>
<el-button
icon=
"el-icon-delete"
size=
"mini"
@
click=
"operateDia('del',scope.row,scope.$index)"
>
删除
</el-button>
</div>
</
template
>
</el-table-column>
</el-table>
<!-- <div class="newBtn">
<el-button class="addItem" icon="el-icon-plus" circle></el-button>
</div> -->
</div>
<span
slot=
"footer"
class=
"dialog-footer"
>
<el-button
class=
"greenButton"
@
click=
"operate('push')"
>
发布
</el-button>
...
...
@@ -122,6 +186,15 @@ export default {
data
()
{
return
{
tableData
:
[],
tableData2
:
[
{
fieldName
:
""
,
chineseName
:
""
,
displayOrder
:
""
,
controlType
:
""
,
contentLength
:
""
,
}
],
selectList
:
[],
add_dialog
:
false
,
title
:
""
,
...
...
@@ -152,7 +225,7 @@ export default {
current
:
1
,
sizes
:
[
10
,
20
,
50
,
100
,
200
],
size
:
10
,
total
:
20
//总条数
total
:
0
,
//总条数
},
dicObj
:
{
state
:
{
...
...
@@ -173,6 +246,11 @@ export default {
3
:
"技术架构"
,
4
:
"安全架构"
,
},
controlType
:
{
0
:
"单行文本框"
,
1
:
"多行文本框"
,
2
:
"下拉框"
,
}
},
stateList
:
[
{
...
...
@@ -229,6 +307,22 @@ export default {
},
],
viewNameList
:
[],
selectTypeList
:
[
{
label
:
"单行文本框"
,
value
:
0
,
},
{
label
:
"多行文本框"
,
value
:
1
,
},
{
label
:
"下拉框"
,
value
:
2
,
},
],
columnIsShow
:
false
,
editIndex
:
-
1
,
// 当前编辑行
};
},
...
...
@@ -247,9 +341,8 @@ export default {
getList
()
{
getYMXZDGLlist
(
this
.
params
).
then
(
res
=>
{
if
(
res
.
code
==
200
)
{
// this.page.total = res.data.total;
// this.tableData = res.data.records;
this
.
tableData
=
res
.
data
;
this
.
page
.
total
=
res
.
data
.
total
;
this
.
tableData
=
res
.
data
.
records
;
}
});
},
...
...
@@ -257,7 +350,6 @@ export default {
getViewNameList
()
{
getViewNameList
().
then
(
res
=>
{
if
(
res
.
code
==
200
)
{
console
.
log
(
res
);
let
arr
=
JSON
.
parse
(
res
.
msg
);
let
viewStr
=
arr
[
0
].
viewName
;
this
.
viewNameList
=
viewStr
.
split
(
","
);
...
...
@@ -289,14 +381,21 @@ export default {
// 所有操作
operate
(
type
,
item
){
this
.
openType
=
type
;
if
(
type
==
"add"
)
{
this
.
add_dialog
=
true
;
this
.
title
=
"新建字典"
;
this
.
resetForm
();
}
else
if
(
type
==
"edit"
)
{
if
(
type
==
"edit"
)
{
this
.
add_dialog
=
true
;
this
.
title
=
"编辑字典"
;
this
.
formData
=
item
;
if
(
this
.
tableData2
.
length
==
0
)
{
this
.
tableData2
=
[
{
fieldName
:
""
,
chineseName
:
""
,
displayOrder
:
""
,
controlType
:
""
,
contentLength
:
""
,
}
];
}
}
else
if
(
type
==
"create"
)
{
this
.
formData
.
state
=
2
;
if
(
this
.
formData
.
dicyId
)
{
...
...
@@ -319,9 +418,9 @@ export default {
});
}
}
else
if
(
type
==
"push"
)
{
this
.
formData
.
state
=
1
;
if
(
this
.
formData
.
dicyId
)
{
// 编辑发布
this
.
formData
.
state
=
1
;
getYMXZDGLUpdate
(
this
.
formData
).
then
(
res
=>
{
if
(
res
.
code
==
200
)
{
this
.
$message
.
success
(
"发布成功"
);
...
...
@@ -330,8 +429,9 @@ export default {
}
});
}
else
{
// 新建发布
getYMXZDGLAdd
(
this
.
formData
).
then
(
res
=>
{
this
.
formData
=
item
;
this
.
formData
.
state
=
1
;
getYMXZDGLUpdate
(
this
.
formData
).
then
(
res
=>
{
if
(
res
.
code
==
200
)
{
this
.
$message
.
success
(
"发布成功"
);
this
.
add_dialog
=
false
;
...
...
@@ -351,38 +451,19 @@ export default {
});
}
else
if
(
type
==
"del"
)
{
// 删除
this
.
formData
=
item
;
this
.
$confirm
(
"确认删除吗"
,
"提示"
,
{
confirmButtonText
:
"确定"
,
cancelButtonText
:
"取消"
,
type
:
"warning"
}).
then
(()
=>
{
getYMXZDGLDel
(
this
.
formData
).
then
(
res
=>
{
if
(
res
.
code
==
200
)
{
this
.
getList
();
}
});
});
}
else
if
(
type
==
"pushAll"
)
{
if
(
this
.
selectList
.
length
<=
0
)
{
this
.
$message
.
error
(
"请选择一项进行发布"
);
return
;
}
let
params
=
{
dicyId
:
[],
state
:
2
};
this
.
selectList
.
map
(
item
=>
{
params
.
dicyId
.
push
(
item
.
dicyId
)
})
console
.
log
(
params
);
getJGYSGLUpdateBatch
(
params
).
then
(
res
=>
{
if
(
res
.
code
==
200
)
{
this
.
$message
.
success
(
"批量发布成功"
);
this
.
getList
();
}
});
// this.formData = item;
// this.$confirm("确认删除吗", "提示", {
// confirmButtonText: "确定",
// cancelButtonText: "取消",
// type: "warning"
// }).then(() => {
// getYMXZDGLDel(this.formData).then(res => {
// if (res.code == 200) {
// this.$message.success("删除成功");
// this.getList();
// }
// });
// });
}
},
// 新建清空表单
...
...
@@ -406,6 +487,36 @@ export default {
return
false
//不可勾选
}
},
// 对话表格操作
operateDia
(
type
,
scopeRow
,
index
){
console
.
log
(
type
,
scopeRow
,
index
);
let
arr
=
this
.
tableData2
.
concat
();
let
addData
=
JSON
.
parse
(
JSON
.
stringify
(
arr
[
index
]));
// JSON.parse(JSON.stringify(arr[index]))
switch
(
type
)
{
// 添加
case
'add'
:
addData
.
fieldName
=
''
;
addData
.
chineseName
=
''
;
addData
.
displayOrder
=
''
;
addData
.
contentLength
=
''
;
addData
.
controlType
=
''
;
arr
.
splice
(
index
+
1
,
0
,
addData
);
break
;
// 删除
case
'del'
:
arr
.
splice
(
index
,
1
)
break
;
}
this
.
tableData2
=
arr
;
},
tableDbclick
(
row
,
column
,
cell
,
e
){
if
(
this
.
readOnly
)
{
return
;
}
this
.
editIndex
=
row
.
index
;
this
.
columnIsShow
=
true
;
},
},
}
</
script
>
...
...
@@ -418,6 +529,10 @@ export default {
justify-content
:
flex-start
;
align-items
:
center
;
}
.dialog_content_1
{
display
:
flex
;
justify-content
:
space-between
;
}
.search_menu
{
display
:
flex
;
justify-content
:
space-between
;
...
...
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