Commit a880a6fa by liuyong

修改菜单

2 parents fa585326 8aac3bbe
This diff could not be displayed because it is too large.
......@@ -12,6 +12,7 @@
"core-js": "^3.8.3",
"element-ui": "^2.15.14",
"jquery": "^3.7.1",
"scss": "^0.2.4",
"vue": "^2.6.14",
"vue-cli": "^2.9.6",
"vue-router": "^3.5.1",
......@@ -23,6 +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",
"vue-template-compiler": "^2.6.14"
},
"browserslist": [
......
......@@ -50,6 +50,10 @@ export function getJGYSGLAdd(params) {
export function getJGYSGLUpdate(params) {
return post('/eleRel/updateEleRel', params);
}
// 批量发布
export function getJGYSGLUpdateBatch(params) {
return post('/eleRel/updateEleRelBatch', params);
}
// 删除元素
export function getJGYSGLDel(params) {
return post('/eleRel/deleteEleRel', params);
......@@ -66,3 +70,51 @@ export function get_yuan_mo_xing_list(params) {
export function delete_yuan_mo_xing_list(params) {
return post('/ynMol/deleteYnMol', params);
}
// 架构视图配置
// 列表查询
export function getJGSTPZlist(params) {
return post('/vwDis/', params);
}
// 新建视图(state暂存2发布1)
export function getJGSTPZAdd(params) {
return post('/vwDis/addVwDis', params);
}
// 编辑视图(state暂存2发布1)
export function getJGSTPZUpdate(params) {
return post('/vwDis/updateVwDis', params);
}
// 批量发布
export function getJGSTPZUpdateBatch(params) {
return post('/vwDis/updateVwDisBatch', params);
}
// 删除视图
export function getJGSTPZDel(params) {
return post('/vwDis/deleteVwDis', params);
}
// 获取视图名称列表
export function getViewNameList(params) {
return post('/vwDis/getviewName', params);
}
// 元模型字典管理
// 列表查询
export function getYMXZDGLlist(params) {
return post('/ynMolDicy/', params);
}
// 新建字典
export function getYMXZDGLAdd(params) {
return post('/ynMolDicy/addYnMolDicy', params);
}
// 编辑字典(state暂存2发布1)
export function getYMXZDGLUpdate(params) {
return post('/ynMolDicy/updateYnMolDicy', params);
}
// 批量发布
// export function getYMXZDGLUpdateBatch(params) {
// return post('/ynMolDicy/updateVwDisBatch', params);
// }
// 删除字典
export function getYMXZDGLDel(params) {
return post('/ynMolDicy/deleteYnMolProy', params);
}
\ No newline at end of file
......@@ -31,19 +31,19 @@ const routes = [
component: () => import('@/views/archi-ele-list/index.vue'),
},
{
path: '/main/JiaGouYuanSuGuanXiGuanLi',//架构元素关系管理
name: 'JiaGouYuanSuGuanXiGuanLi',
component: () => import('@/views/JiaGouYuanShuGuanXiGuanLi/index.vue'),
path: '/main/archi-ele-rela',//架构元素关系管理
name: 'archi-ele-rela',
component: () => import('@/views/archiEleRela/index.vue'),
},
{
path: '/main/JiaGouSTPZ',//架构视图配置
name: 'JiaGouSTPZ',
component: () => import('@/views/JiaGouSTPZ/index.vue'),
path: '/main/archi-view-config',//架构视图配置
name: 'archi-view-config',
component: () => import('@/views/archiViewConfig/index.vue'),
},
{
path: '/main/JiaGouYMXZD',//元模型字典管理
name: 'JiaGouYMXZD',
component: () => import('@/views/JiaGouYMXZD/index.vue'),
path: '/main/meta-model-dic',//元模型字典管理
name: 'meta-model-dic',
component: () => import('@/views/metaModelDic/index.vue'),
},
{
path: '/main/busiAssetslist',//业务架构资产管理
......@@ -56,9 +56,9 @@ const routes = [
// component: () => import('@/views/YuanMoXingGuanLi/YuanMoXingGuanLiCanvas/index.vue'),
// },
{
path: '/main/wenDangDemo',//在线文档编制
name: 'wenDangDemo',
component: () => import('@/views/wenDangDemo/index.vue'),
path: '/main/doc-demo',//在线文档编制
name: 'doc-demo',
component: () => import('@/views/docDemo/index.vue'),
},
{
path: '/main/metaModelList',//元模型管理
......
<template>
<div class="JiaGouYuanShuGuanLi">
<div class="table_container">
<div class="search_menu">
<div class="search_menu_item_container">
<div class="search_menu_item">
<span class="search_title">架构视图名称</span>
<el-input v-model="query_item3" placeholder="请输入内容" class="search_item"></el-input>
</div>
<div class="search_menu_item">
<span class="search_title">架构层次</span>
<el-select v-model="query_item4" placeholder="请选择" 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-select>
</div>
<div class="search_menu_item">
<span class="search_title">架构归属</span>
<el-select v-model="query_item1" placeholder="请选择" 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>
<div class="search_menu_btn_container">
<div class="query_btn">
<img class="btn_icon" src="@/assets/查询icon.png" alt="" />
<p>查询</p>
</div>
<div class="reset_btn">
<img class="btn_icon" src="@/assets/重置icon.png" alt="" />
<p>重置</p>
</div>
</div>
</div>
<div class="search_btn">
<div class="add_btn" @click="add_dialog = true">
<img class="btn_icon" src="@/assets/新建icon.png" alt="" />
<p>新建</p>
</div>
<div class="version_btn">
<img class="btn_icon" src="@/assets/版本发布icon.png" alt="" />
<p>版本发布</p>
</div>
</div>
<el-table :data="tableData" stripe border>
<el-table-column type="selection" width="55"></el-table-column>
<el-table-column type="index" label="序号" width="80" align="center"></el-table-column>
<el-table-column prop="let1" label="架构视图名称" width="150" align="center"></el-table-column>
<el-table-column prop="let2" label="架构层次" width="150" align="center"></el-table-column>
<el-table-column prop="let3" label="架构归属" width="150" align="center"></el-table-column>
<el-table-column prop="let4" label="适用范围" width="150" align="center"></el-table-column>
<el-table-column prop="let5" label="描述" width="150" align="center"></el-table-column>
<el-table-column prop="let6" label="元素范围" width="150" align="center"></el-table-column>
<el-table-column prop="let7" label="包含元素" width="150" align="center"></el-table-column>
<el-table-column prop="let8" label="版本" width="150" align="center"></el-table-column>
<el-table-column prop="let9" label="状态" align="center"></el-table-column>
<el-table-column label="操作" width="360" align="center">
<template>
<div style="display: flex;align-items: center;justify-content: center;">
<div class="add_btn" @click="add_dialog = true" style="border: 0;margin-right: 8px;">
<img class="btn_icon" src="@/assets/编辑_icon_default.png" alt="" />
<p>编辑</p>
</div>
<!-- <el-button type="text" icon="el-icon-edit" @click="add_dialog = true">编辑</el-button> -->
<div class="reset_btn" style="border: 0;margin-right: 8px;">
<img class="btn_icon" src="@/assets/停用_icon_default.png" alt="" />
<p>停用</p>
</div>
<div class="add_btn" style="border: 0;margin-right: 8px;">
<img class="btn_icon" src="@/assets/发布_icon_default.png" alt="" />
<p>发布</p>
</div>
<div class="reset_btn" style="border: 0;">
<img class="btn_icon" src="@/assets/删除_icon_default.png" alt="" />
<p>删除</p>
</div>
</div>
</template>
</el-table-column>
</el-table>
<el-pagination
background
layout="prev, pager, next"
:total="50">
</el-pagination>
</div>
<el-dialog
title="新建架构视图配置"
:visible.sync="add_dialog"
:center="false"
width="50%">
<div class="add_dialog_content">
<div class="dialog_content_1">
<div class="dialog_form_item">
<div class="dialog_form_item_title">*架构层次</div>
<el-select v-model="query_item4" placeholder="请选择" 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-select>
</div>
<div class="dialog_form_item">
<div class="dialog_form_item_title">*架构归属</div>
<el-select placeholder="请选择" class="search_item" v-model="let3">
<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-input placeholder="请输入内容" class="dialog_form_item_content" v-model="let1" :disabled="true"></el-input>
</div>
</div>
<div class="dialog_form_item">
<div class="dialog_form_item_title">*描述</div>
<el-input type="textarea" :rows="2" placeholder="请输入内容" class="dialog_form_item_content" v-model="let4"></el-input>
</div>
<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>
<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 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>
<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>
<span slot="footer" class="dialog-footer">
<el-button class="greenButton" @click="add_dialog = false">发布</el-button>
<el-button class="greenButton" @click="add_dialog = false">暂存</el-button>
<el-button @click="add_dialog = false">取消</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
export default {
name: 'JiaGouYuanShuGuanLi',
components: {
},
data() {
return {
tableData: [
{ let1: '分解', let2: '业务域', let7: '业务职能', let3: '业务架构', let4: '业务域的基本描述', let5: '2023.10.31', let6: '已发布' },
{ let1: '支撑', let2: '业务域', let7: '业务职能', let3: '业务架构', let4: '业务职能的描述', let5: '2023.10.31', let6: '已发布' },
{ let1: '聚合', let2: '应用域', let7: '应用职能', let3: '应用架构', let4: '应用交互的基本描述', let5: '2023.10.31', let6: '已发布' },
],
tableData1: [
{ name: '业务域'},
{ name: '业务职能'},
{ name: '业务流程'},
],
tableData2: [
{ name: '业务域'},
{ name: '业务职能'},
{ name: '业务流程'},
],
add_dialog: false,
query_item1: null,
query_item3: null,
query_item4: null,
let1: '带出',
let2: '',
let3: '',
let4: '',
};
},
}
</script>
<style scoped>
.JiaGouYuanShuGuanLi{
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
justify-content: flex-start;
align-items: center;
}
.dialog_content_1{
display: flex;
justify-content: space-between;
}
.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 #0D867F;
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;
}
/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
<template>
<div class="JiaGouYuanShuGuanLi">
<div class="table_container">
<div class="search_menu">
<div class="search_menu_item_container">
<div class="search_menu_item">
<span class="search_title">字典名称</span>
<el-input v-model="query_item3" placeholder="请输入内容" class="search_item"></el-input>
</div>
<div class="search_menu_item">
<span class="search_title">架构归属</span>
<el-select v-model="query_item1" placeholder="请选择" 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="search_menu_item">
<span class="search_title">状态</span>
<el-select v-model="query_item4" placeholder="请选择" class="search_item">
<el-option label="已发布" value="已发布"></el-option>
<el-option label="已停用" value="已停用"></el-option>
<el-option label="暂存" value="暂存"></el-option>
</el-select>
</div>
</div>
<div class="search_menu_btn_container">
<div class="query_btn">
<img class="btn_icon" src="@/assets/查询icon.png" alt="" />
<p>查询</p>
</div>
<div class="reset_btn">
<img class="btn_icon" src="@/assets/重置icon.png" alt="" />
<p>重置</p>
</div>
</div>
</div>
<div class="search_btn">
<div class="add_btn" @click="add_dialog = true">
<img class="btn_icon" src="@/assets/新建icon.png" alt="" />
<p>新建</p>
</div>
<div class="version_btn">
<img class="btn_icon" src="@/assets/版本发布icon.png" alt="" />
<p>版本发布</p>
</div>
</div>
<el-table :data="tableData" stripe border>
<el-table-column type="selection" width="55"></el-table-column>
<el-table-column type="index" label="序号" width="80" align="center"></el-table-column>
<el-table-column prop="let1" label="字典名称" width="180" align="center"></el-table-column>
<el-table-column prop="let2" label="架构层次" width="180" align="center"></el-table-column>
<el-table-column prop="let3" label="架构归属" width="180" align="center"></el-table-column>
<el-table-column prop="let4" label="描述" width="180" align="center"></el-table-column>
<!-- <el-table-column label="图标" align="center">
<template>
<el-button type="text" style="color: #0D867F;">预览</el-button>
</template>
</el-table-column> -->
<el-table-column prop="let5" label="字典版本号" align="center"></el-table-column>
<el-table-column prop="let6" label="字典版本状态" align="center"></el-table-column>
<el-table-column label="操作" width="360" align="center">
<template>
<div style="display: flex;align-items: center;justify-content: center;">
<div class="add_btn" @click="add_dialog = true" style="border: 0;margin-right: 8px;">
<img class="btn_icon" src="@/assets/编辑_icon_default.png" alt="" />
<p>编辑</p>
</div>
<!-- <el-button type="text" icon="el-icon-edit" @click="add_dialog = true">编辑</el-button> -->
<div class="reset_btn" style="border: 0;margin-right: 8px;">
<img class="btn_icon" src="@/assets/停用_icon_default.png" alt="" />
<p>停用</p>
</div>
<div class="add_btn" style="border: 0;margin-right: 8px;">
<img class="btn_icon" src="@/assets/发布_icon_default.png" alt="" />
<p>发布</p>
</div>
<div class="reset_btn" style="border: 0;">
<img class="btn_icon" src="@/assets/删除_icon_default.png" alt="" />
<p>删除</p>
</div>
</div>
</template>
</el-table-column>
</el-table>
<el-pagination
background
layout="prev, pager, next"
:total="50">
</el-pagination>
</div>
<el-dialog
title="新建字典"
:visible.sync="add_dialog"
:center="false"
width="40%">
<div class="add_dialog_content">
<div class="dialog_form_item">
<div class="dialog_form_item_title">*字典名称</div>
<el-input placeholder="请输入内容" class="dialog_form_item_content" v-model="let1"></el-input>
</div>
<!-- <div class="dialog_form_item">
<div class="dialog_form_item_title">元素关系描述</div>
<el-input placeholder="请输入内容" class="dialog_form_item_content" v-model="let2"></el-input>
</div> -->
<!-- <div class="dialog_form_item">
<div class="dialog_form_item_title">架构归属</div>
<el-select placeholder="请选择" class="search_item" v-model="let3">
<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-input type="textarea" :rows="2" placeholder="请输入内容" class="dialog_form_item_content" v-model="let4"></el-input>
</div>
</div>
<span slot="footer" class="dialog-footer">
<el-button class="greenButton" @click="add_dialog = false">发布</el-button>
<el-button class="greenButton" @click="add_dialog = false">暂存</el-button>
<el-button @click="add_dialog = false">取消</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
export default {
name: 'JiaGouYMXZD',
components: {
},
data() {
return {
tableData: [
{ let1: '分解', let2: '业务域', let7: '业务职能', let3: '业务架构', let4: '业务域的基本描述', let5: '2023.10.31', let6: '已发布' },
{ let1: '支撑', let2: '业务域', let7: '业务职能', let3: '业务架构', let4: '业务职能的描述', let5: '2023.10.31', let6: '已发布' },
{ let1: '聚合', let2: '应用域', let7: '应用职能', let3: '应用架构', let4: '应用交互的基本描述', let5: '2023.10.31', let6: '已发布' },
],
add_dialog: false,
query_item1: null,
query_item3: null,
query_item4: null,
let1: '',
let2: '',
let3: '',
let4: '',
};
},
}
</script>
<style 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 #0D867F;
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;
}
/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
......@@ -539,15 +539,15 @@
this.visible1 = false;
break;
case '架构元素关系管理':
this.$router.push( '/main/JiaGouYuanSuGuanXiGuanLi', () => {}, () => {} );
this.$router.push( '/main/archi-ele-rela', () => {}, () => {} );
this.visible1 = false;
break;
case '架构视图配置':
this.$router.push( '/main/JiaGouSTPZ', () => {}, () => {} );
this.$router.push( '/main/archi-view-config', () => {}, () => {} );
this.visible1 = false;
break;
case '元模型字典管理':
this.$router.push( '/main/JiaGouYMXZD', () => {}, () => {} );
this.$router.push( '/main/meta-model-dic', () => {}, () => {} );
this.visible1 = false;
break;
case '元模型管理':
......@@ -559,7 +559,7 @@
this.visible1 = false;
break;
case '在线文档编制':
this.$router.push( '/main/wenDangDemo', () => {}, () => {} );
this.$router.push( '/main/doc-demo', () => {}, () => {} );
break;
}
}
......
......@@ -9,7 +9,7 @@
</div>
<div class="search_menu_item">
<span class="search_title">适用范围</span>
<el-select v-model="params.scope" placeholder="请选择" class="search_item">
<el-select v-model="params.scope" placeholder="请选择" clearable class="search_item">
<el-option label="业务架构" value="业务架构"></el-option>
<el-option label="应用架构" value="应用架构"></el-option>
<el-option label="内容架构" value="内容架构"></el-option>
......@@ -19,10 +19,8 @@
</div>
<div class="search_menu_item">
<span class="search_title">状态</span>
<el-select v-model="params.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 v-model="params.state" placeholder="请选择" clearable 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>
......@@ -42,13 +40,13 @@
<img class="btn_icon" src="@/assets/新建icon.png" alt="" />
<p>新建</p>
</div>
<div class="version_btn">
<div class="version_btn" @click="operate('pushAll')">
<img class="btn_icon" src="@/assets/版本发布icon.png" alt="" />
<p>版本发布</p>
</div>
</div>
<el-table :data="tableData" stripe border>
<el-table-column type="selection" width="55"></el-table-column>
<el-table :data="tableData" stripe border @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" :selectable="selectInit"></el-table-column>
<el-table-column type="index" label="序号" width="80" align="center"></el-table-column>
<el-table-column prop="rsName" label="元素关系名称" width="180" align="center"></el-table-column>
<el-table-column prop="object1" label="对象1" width="180" align="center"></el-table-column>
......@@ -112,11 +110,11 @@
width="40%">
<div class="add_dialog_content">
<div class="dialog_form_item">
<div class="dialog_form_item_title">*元素关系名称</div>
<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>
<div class="dialog_form_item">
<div class="dialog_form_item_title">*元素关系描述</div>
<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>
......@@ -136,17 +134,18 @@ import {
getJGYSGLAdd,
getJGYSGLDel,
getJGYSGLUpdate,
getJGYSGLUpdateBatch,
} from "@/api/index.js";
export default {
name: 'JiaGouYuanShuGuanXiGuanLi',
name: 'archiEleRela',
components: {
},
data() {
return {
tableData: [
],
tableData: [],
selectList: [],
add_dialog: false,
title: "",
openType: "",
......@@ -181,6 +180,20 @@ export default {
2: "暂存",
},
},
stateList: [
{
label: "已发布",
value: 1,
},
{
label: "已停用",
value: 0,
},
{
label: "暂存",
value: 2,
},
],
};
},
......@@ -194,6 +207,9 @@ export default {
methods: {
// 查询列表
getList() {
if (this.params.state != '') {
this.params.state = Number(this.params.state)
}
getJGYSGLlist(this.params).then(res => {
if (res.code == 200) {
// this.page.total = res.data.total;
......@@ -300,6 +316,26 @@ export default {
}
});
});
}else if (type == "pushAll") {
if (this.selectList.length <= 0) {
this.$message.error("请选择一项进行发布");
return;
}
let params = {
eleRelaId: [],
state: 2
};
this.selectList.map(item => {
params.eleRelaId.push(item.eleRelaId)
})
console.log(params);
getJGYSGLUpdateBatch(params).then(res => {
if (res.code == 200) {
this.$message.success("批量发布成功");
this.getList();
}
});
}
},
// 新建清空表单
......@@ -310,11 +346,22 @@ export default {
}
},
// 表格多选
handleSelectionChange(e) {
this.selectList = e;
},
selectInit(row,index){
if(row.state != "1"){
return true //可勾选
}else{
return false //不可勾选
}
},
},
}
</script>
<style scoped>
<style lang="scss" scoped>
.JiaGouYuanShuGuanXiGuanLi{
width: 100%;
height: 100%;
......@@ -428,6 +475,11 @@ export default {
.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;
......
<template>
<div class="JiaGouYuanShuGuanLi">
<div class="table_container">
<div class="search_menu">
<div class="search_menu_item_container">
<div class="search_menu_item">
<span class="search_title">架构视图名称</span>
<el-select v-model="params.viewName" placeholder="请选择" clearable class="search_item">
<el-option v-for="(item,idnex) in viewNameList" :key="idnex" :label="item" :value="item" ></el-option>
</el-select>
</div>
<div class="search_menu_item">
<span class="search_title">架构层次</span>
<el-select v-model="params.schemaLevel" placeholder="请选择" clearable 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="search_menu_item">
<span class="search_title">架构归属</span>
<el-select v-model="params.schemaBelong" placeholder="请选择" clearable 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>
<div class="search_menu_btn_container">
<div class="query_btn" @click="getList">
<img class="btn_icon" src="@/assets/查询icon.png" alt="" />
<p>查询</p>
</div>
<div class="reset_btn" @click="reset">
<img class="btn_icon" src="@/assets/重置icon.png" alt="" />
<p>重置</p>
</div>
</div>
</div>
<div class="search_btn">
<div class="add_btn" @click="operate('add')">
<img class="btn_icon" src="@/assets/新建icon.png" alt="" />
<p>新建</p>
</div>
<div class="version_btn" @click="operate('pushAll')">
<img class="btn_icon" src="@/assets/版本发布icon.png" alt="" />
<p>版本发布</p>
</div>
</div>
<el-table :data="tableData" stripe border @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" :selectable="selectInit"></el-table-column>
<el-table-column type="index" label="序号" width="80" align="center"></el-table-column>
<el-table-column prop="viewName" label="架构视图名称" width="150" align="center"></el-table-column>
<el-table-column prop="schemaLevel" label="架构层次" width="150" align="center">
<template slot-scope="scope">
<span >{{dicObj.schemaLevel[scope.row.schemaLevel]}}</span>
</template>
</el-table-column>
<el-table-column prop="schemaBelong" label="架构归属" width="150" align="center">
<template slot-scope="scope">
<span >{{dicObj.schemaBelong[scope.row.schemaBelong]}}</span>
</template>
</el-table-column>
<el-table-column prop="content" label="视图描述" width="150" align="center"></el-table-column>
<el-table-column prop="let6" label="元素范围" width="150" align="center"></el-table-column>
<el-table-column prop="let7" label="包含元素" width="150" align="center"></el-table-column>
<el-table-column prop="version" label="版本" width="150" align="center"></el-table-column>
<el-table-column prop="state" label="状态" align="center">
<template slot-scope="scope">
<span >{{dicObj.state[scope.row.state]}}</span>
</template>
</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" 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>
</div>
</template>
</el-table-column>
</el-table>
<el-pagination
background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="page.current"
:page-sizes="page.sizes"
:page-size="page.size"
layout="total, sizes, prev, pager, next, jumper"
:total="page.total">
</el-pagination>
</div>
<el-dialog
:title="title"
:visible.sync="add_dialog"
:center="false"
width="50%">
<div class="add_dialog_content">
<!-- <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> -->
<div class="dialog_content_1">
<div class="dialog_form_item">
<div class="dialog_form_item_title"><span class="reqIcon">*</span>架构层次</div>
<el-select v-model="formData.schemaLevel" placeholder="请选择" clearable 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-select v-model="formData.schemaBelong" placeholder="请选择" clearable 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 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> -->
<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>
</div>
</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>
<!-- <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>
<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 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>
<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>
<span slot="footer" class="dialog-footer">
<el-button class="greenButton" @click="operate('push')">发布</el-button>
<el-button class="greenButton" @click="operate('create')">保存</el-button>
<el-button @click="add_dialog = false">取消</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import {
getJGSTPZlist,
getJGSTPZAdd,
getJGSTPZDel,
getJGSTPZUpdate,
getJGSTPZUpdateBatch,
getViewNameList,
} from "@/api/index.js";
export default {
name: 'archiViewConfig',
components: {
},
data() {
return {
tableData: [],
selectList: [],
add_dialog: false,
title: "",
tableData1: [
{ name: '业务域'},
{ name: '业务职能'},
{ name: '业务流程'},
],
tableData2: [
{ name: '业务域'},
{ name: '业务职能'},
{ name: '业务流程'},
],
add_dialog: false,
query_item1: null,
query_item3: null,
query_item4: null,
let1: '带出',
let2: '',
let3: '',
let4: '',
formData: {
rsName: "",
content: "",
},
params: {
current: 1,
pageSize: 10,
viewName: "",
schemaLevel: "",
schemaBelong: "",
},
page: {
current: 1,
sizes: [10, 20, 50, 100, 200],
size: 10,
total: 20 //总条数
},
dicObj: {
state: {
0: "已停用",
1: "已发布",
2: "暂存",
},
schemaLevel: {
0: "策略层",
1: "管理层",
2: "设计层",
3: "实施层",
},
schemaBelong: {
0: "业务架构",
1: "应用架构",
2: "数据架构",
3: "技术架构",
4: "安全架构",
},
},
stateList: [
{
label: "已发布",
value: 1,
},
{
label: "已停用",
value: 0,
},
{
label: "暂存",
value: 2,
},
],
levelList: [
{
label: "策略层",
value: 0,
},
{
label: "管理层",
value: 1,
},
{
label: "设计层",
value: 2,
},
{
label: "实施层",
value: 3,
},
],
belongList: [
{
label: "业务架构",
value: 0,
},
{
label: "应用架构",
value: 1,
},
{
label: "数据架构",
value: 2,
},
{
label: "技术架构",
value: 3,
},
{
label: "安全架构",
value: 4,
},
],
viewNameList: [],
};
},
mounted() {
// 初始化查询列表
this.getList();
// 查询视图下拉
this.getViewNameList();
},
created() {
},
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;
}
});
},
// 获取下拉
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(",");
}
});
},
// 重置查询
reset(){
this.params = {
current: 1,
pageSize: 10,
rsName: "",
scope: "",
state: "",
}
},
// 分页事件
handleSizeChange(val) {
this.page.size = val;
this.params.pageSize = val;
this.getList();
},
handleCurrentChange(val) {
this.page.current = val;
this.paramsp.current = val;
this.getList();
},
// 所有操作
operate(type,item){
console.log(type,item);
this.openType = type;
if (type == "add") {
this.add_dialog = true;
this.title = "新建架构视图";
this.resetForm();
}else if (type == "edit") {
this.add_dialog = true;
this.title = "编辑架构视图";
this.formData = item;
}else if (type == "create") {
this.formData.state = 2;
if (this.formData.viewId) {
// 编辑保存
getJGSTPZUpdate(this.formData).then(res => {
if (res.code == 200) {
this.$message.success("保存成功");
this.add_dialog = false;
this.getList();
}
});
}else{
// 新建保存
getJGSTPZAdd(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.viewId) {
// 编辑发布
getJGSTPZUpdate(this.formData).then(res => {
if (res.code == 200) {
this.$message.success("发布成功");
this.add_dialog = false;
this.getList();
}
});
}else{
// 新建发布
getJGSTPZAdd(this.formData).then(res => {
if (res.code == 200) {
this.$message.success("发布成功");
this.add_dialog = false;
this.getList();
}
});
}
}else if (type == "stop") {
// 停用
this.formData = item;
this.formData.state = 0;
getJGSTPZUpdate(this.formData).then(res => {
if (res.code == 200) {
this.$message.success("停用成功");
this.getList();
}
});
}else if (type == "del") {
// 删除
this.formData = item;
this.$confirm("确认删除吗", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
getJGSTPZDel(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 = {
viewId: [],
state: 2
};
this.selectList.map(item => {
params.viewId.push(item.viewId)
})
getJGSTPZUpdateBatch(params).then(res => {
if (res.code == 200) {
this.$message.success("批量发布成功");
this.getList();
}
});
}
},
// 新建清空表单
resetForm(){
this.formData = {
schemaLevel: "",
schemaBelong: "",
viewName: "",
content: "",
}
},
// 表格多选
handleSelectionChange(e) {
this.selectList = e;
},
selectInit(row,index){
if(row.state != "1"){
return true //可勾选
}else{
return false //不可勾选
}
},
},
}
</script>
<style lang="scss" scoped>
.JiaGouYuanShuGuanLi{
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
justify-content: flex-start;
align-items: center;
}
.dialog_content_1{
display: flex;
justify-content: space-between;
}
.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 #0D867F;
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
<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 #0D867F;
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
<template>
<div class="JiaGouYuanShuGuanLi">
<div class="table_container">
<div class="search_menu">
<div class="search_menu_item_container">
<div class="search_menu_item">
<span class="search_title">字典名称</span>
<el-input v-model="params.rsName" placeholder="请输入内容" class="search_item"></el-input>
</div>
<div class="search_menu_item">
<span class="search_title">适用范围</span>
<el-select v-model="params.scope" placeholder="请选择" clearable 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="search_menu_item">
<span class="search_title">状态</span>
<el-select v-model="params.state" placeholder="请选择" clearable 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>
<div class="search_menu_btn_container">
<div class="query_btn" @click="getList">
<img class="btn_icon" src="@/assets/查询icon.png" alt="" />
<p>查询</p>
</div>
<div class="reset_btn" @click="reset">
<img class="btn_icon" src="@/assets/重置icon.png" alt="" />
<p>重置</p>
</div>
</div>
</div>
<div class="search_btn">
<div class="add_btn" @click="operate('add')">
<img class="btn_icon" src="@/assets/新建icon.png" alt="" />
<p>新建</p>
</div>
<div class="version_btn" @click="operate('pushAll')">
<img class="btn_icon" src="@/assets/版本发布icon.png" alt="" />
<p>版本发布</p>
</div>
</div>
<el-table :data="tableData" stripe border>
<el-table-column type="selection" width="55"></el-table-column>
<el-table-column type="index" label="序号" width="80" align="center"></el-table-column>
<el-table-column prop="let1" label="字典名称" width="180" align="center"></el-table-column>
<el-table-column prop="let2" label="架构层次" width="180" align="center"></el-table-column>
<el-table-column prop="let3" label="架构归属" width="180" align="center"></el-table-column>
<el-table-column prop="let4" label="描述" width="180" align="center"></el-table-column>
<el-table-column prop="let5" label="字典版本号" align="center"></el-table-column>
<el-table-column prop="state" label="状态" align="center">
<template slot-scope="scope">
<span >{{dicObj.state[scope.row.state]}}</span>
</template>
</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" 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>
</div>
</template>
</el-table-column>
</el-table>
<el-pagination
background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="page.current"
:page-sizes="page.sizes"
:page-size="page.size"
layout="total, sizes, prev, pager, next, jumper"
:total="page.total">
</el-pagination>
</div>
<el-dialog
:title="title"
:visible.sync="add_dialog"
:center="false"
width="40%">
<div class="add_dialog_content">
<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>
<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>
</div>
<span slot="footer" class="dialog-footer">
<el-button class="greenButton" @click="operate('push')">发布</el-button>
<el-button class="greenButton" @click="operate('create')">保存</el-button>
<el-button @click="add_dialog = false">取消</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import {
getYMXZDGLlist,
getYMXZDGLAdd,
getYMXZDGLDel,
getYMXZDGLUpdate,
// getYMXZDGLUpdateBatch,
} from "@/api/index.js";
export default {
name: 'metaModelDic',
components: {
},
data() {
return {
tableData: [],
selectList: [],
add_dialog: false,
title: "",
openType: "",
add_dialog: false,
query_item1: null,
query_item3: null,
query_item4: null,
let1: '',
let2: '',
let3: '',
let4: '',
formData: {
rsName: "",
content: "",
},
params: {
current: 1,
pageSize: 10,
rsName: "",
scope: "",
state: "",
},
page: {
current: 1,
sizes: [10, 20, 50, 100, 200],
size: 10,
total: 20 //总条数
},
dicObj: {
state: {
0: "已停用",
1: "已发布",
2: "暂存",
},
},
stateList: [
{
label: "已发布",
value: 1,
},
{
label: "已停用",
value: 0,
},
{
label: "暂存",
value: 2,
},
],
};
},
mounted() {
// 初始化查询列表
this.getList();
},
created() {
},
methods: {
// 查询列表
getList() {
if (this.params.state != '') {
this.params.state = Number(this.params.state)
}
getYMXZDGLlist(this.params).then(res => {
if (res.code == 200) {
// this.page.total = res.data.total;
// this.tableData = res.data.records;
this.tableData = res.data;
}
});
},
// 重置
reset(){
this.params = {
current: 1,
pageSize: 10,
rsName: "",
scope: "",
state: "",
}
},
// 分页事件
handleSizeChange(val) {
this.page.size = val;
this.params.pageSize = val;
this.getList();
},
handleCurrentChange(val) {
this.page.current = val;
this.paramsp.current = val;
this.getList();
},
// 所有操作
operate(type,item){
this.openType = type;
if (type == "add") {
this.add_dialog = true;
this.title = "新建字典";
this.resetForm();
}else if (type == "edit") {
this.add_dialog = true;
this.title = "编辑字典";
this.formData = item;
}else if (type == "create") {
this.formData.state = 2;
if (this.formData.dicyId) {
// 编辑保存
getYMXZDGLUpdate(this.formData).then(res => {
if (res.code == 200) {
this.$message.success("保存成功");
this.add_dialog = false;
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) {
// 编辑发布
getYMXZDGLUpdate(this.formData).then(res => {
if (res.code == 200) {
this.$message.success("发布成功");
this.add_dialog = false;
this.getList();
}
});
}else{
// 新建发布
getYMXZDGLAdd(this.formData).then(res => {
if (res.code == 200) {
this.$message.success("发布成功");
this.add_dialog = false;
this.getList();
}
});
}
}else if (type == "stop") {
// 停用
this.formData = item;
this.formData.state = 0;
getYMXZDGLUpdate(this.formData).then(res => {
if (res.code == 200) {
this.$message.success("停用成功");
this.getList();
}
});
}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();
}
});
}
},
// 新建清空表单
resetForm(){
this.formData = {
rsName: "",
content: "",
}
},
// 表格多选
handleSelectionChange(e) {
this.selectList = e;
},
selectInit(row,index){
if(row.state != "1"){
return true //可勾选
}else{
return false //不可勾选
}
},
},
}
</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 #0D867F;
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
<template>
<div class="JiaGouYuanShuGuanLi">
<div class="table_container">
<div class="search_menu">
<div class="search_menu_item_container">
<div class="search_menu_item">
<span class="search_title">字典名称</span>
<el-input v-model="params.rsName" placeholder="请输入内容" class="search_item"></el-input>
</div>
<div class="search_menu_item">
<span class="search_title">适用范围</span>
<el-select v-model="params.scope" placeholder="请选择" clearable 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="search_menu_item">
<span class="search_title">状态</span>
<el-select v-model="params.state" placeholder="请选择" clearable 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>
<div class="search_menu_btn_container">
<div class="query_btn" @click="getList">
<img class="btn_icon" src="@/assets/查询icon.png" alt="" />
<p>查询</p>
</div>
<div class="reset_btn" @click="reset">
<img class="btn_icon" src="@/assets/重置icon.png" alt="" />
<p>重置</p>
</div>
</div>
</div>
<div class="search_btn">
<div class="add_btn" @click="operate('add')">
<img class="btn_icon" src="@/assets/新建icon.png" alt="" />
<p>新建</p>
</div>
<div class="version_btn" @click="operate('pushAll')">
<img class="btn_icon" src="@/assets/版本发布icon.png" alt="" />
<p>版本发布</p>
</div>
</div>
<el-table :data="tableData" stripe border>
<el-table-column type="selection" width="55"></el-table-column>
<el-table-column type="index" label="序号" width="80" align="center"></el-table-column>
<el-table-column prop="let1" label="字典名称" width="180" align="center"></el-table-column>
<el-table-column prop="let2" label="架构层次" width="180" align="center"></el-table-column>
<el-table-column prop="let3" label="架构归属" width="180" align="center"></el-table-column>
<el-table-column prop="let4" label="描述" width="180" align="center"></el-table-column>
<el-table-column prop="let5" label="字典版本号" align="center"></el-table-column>
<el-table-column prop="state" label="状态" align="center">
<template slot-scope="scope">
<span >{{dicObj.state[scope.row.state]}}</span>
</template>
</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" 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>
</div>
</template>
</el-table-column>
</el-table>
<el-pagination
background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="page.current"
:page-sizes="page.sizes"
:page-size="page.size"
layout="total, sizes, prev, pager, next, jumper"
:total="page.total">
</el-pagination>
</div>
<el-dialog
:title="title"
:visible.sync="add_dialog"
:center="false"
width="40%">
<div class="add_dialog_content">
<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>
<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>
</div>
<span slot="footer" class="dialog-footer">
<el-button class="greenButton" @click="operate('push')">发布</el-button>
<el-button class="greenButton" @click="operate('create')">保存</el-button>
<el-button @click="add_dialog = false">取消</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import {
getYMXZDGLlist,
getYMXZDGLAdd,
getYMXZDGLDel,
getYMXZDGLUpdate,
// getYMXZDGLUpdateBatch,
} from "@/api/index.js";
export default {
name: 'metaModelDic',
components: {
},
data() {
return {
tableData: [],
selectList: [],
add_dialog: false,
title: "",
openType: "",
add_dialog: false,
query_item1: null,
query_item3: null,
query_item4: null,
let1: '',
let2: '',
let3: '',
let4: '',
formData: {
rsName: "",
content: "",
},
params: {
current: 1,
pageSize: 10,
rsName: "",
scope: "",
state: "",
},
page: {
current: 1,
sizes: [10, 20, 50, 100, 200],
size: 10,
total: 20 //总条数
},
dicObj: {
state: {
0: "已停用",
1: "已发布",
2: "暂存",
},
},
stateList: [
{
label: "已发布",
value: 1,
},
{
label: "已停用",
value: 0,
},
{
label: "暂存",
value: 2,
},
],
};
},
mounted() {
// 初始化查询列表
this.getList();
},
created() {
},
methods: {
// 查询列表
getList() {
if (this.params.state != '') {
this.params.state = Number(this.params.state)
}
getYMXZDGLlist(this.params).then(res => {
if (res.code == 200) {
// this.page.total = res.data.total;
// this.tableData = res.data.records;
this.tableData = res.data;
}
});
},
// 重置
reset(){
this.params = {
current: 1,
pageSize: 10,
rsName: "",
scope: "",
state: "",
}
},
// 分页事件
handleSizeChange(val) {
this.page.size = val;
this.params.pageSize = val;
this.getList();
},
handleCurrentChange(val) {
this.page.current = val;
this.paramsp.current = val;
this.getList();
},
// 所有操作
operate(type,item){
this.openType = type;
if (type == "add") {
this.add_dialog = true;
this.title = "新建字典";
this.resetForm();
}else if (type == "edit") {
this.add_dialog = true;
this.title = "编辑字典";
this.formData = item;
}else if (type == "create") {
this.formData.state = 2;
if (this.formData.dicyId) {
// 编辑保存
getYMXZDGLUpdate(this.formData).then(res => {
if (res.code == 200) {
this.$message.success("保存成功");
this.add_dialog = false;
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) {
// 编辑发布
getYMXZDGLUpdate(this.formData).then(res => {
if (res.code == 200) {
this.$message.success("发布成功");
this.add_dialog = false;
this.getList();
}
});
}else{
// 新建发布
getYMXZDGLAdd(this.formData).then(res => {
if (res.code == 200) {
this.$message.success("发布成功");
this.add_dialog = false;
this.getList();
}
});
}
}else if (type == "stop") {
// 停用
this.formData = item;
this.formData.state = 0;
getYMXZDGLUpdate(this.formData).then(res => {
if (res.code == 200) {
this.$message.success("停用成功");
this.getList();
}
});
}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();
}
});
}
},
// 新建清空表单
resetForm(){
this.formData = {
rsName: "",
content: "",
}
},
// 表格多选
handleSelectionChange(e) {
this.selectList = e;
},
selectInit(row,index){
if(row.state != "1"){
return true //可勾选
}else{
return false //不可勾选
}
},
},
}
</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 #0D867F;
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
<template>
<div class="JiaGouYuanShuGuanLi">
<div class="table_container">
<div class="search_menu">
<div class="search_menu_item_container">
<div class="search_menu_item">
<span class="search_title">字典名称</span>
<el-input v-model="params.rsName" placeholder="请输入内容" class="search_item"></el-input>
</div>
<div class="search_menu_item">
<span class="search_title">适用范围</span>
<el-select v-model="params.scope" placeholder="请选择" clearable 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="search_menu_item">
<span class="search_title">状态</span>
<el-select v-model="params.state" placeholder="请选择" clearable 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>
<div class="search_menu_btn_container">
<div class="query_btn" @click="getList">
<img class="btn_icon" src="@/assets/查询icon.png" alt="" />
<p>查询</p>
</div>
<div class="reset_btn" @click="reset">
<img class="btn_icon" src="@/assets/重置icon.png" alt="" />
<p>重置</p>
</div>
</div>
</div>
<div class="search_btn">
<div class="add_btn" @click="operate('add')">
<img class="btn_icon" src="@/assets/新建icon.png" alt="" />
<p>新建</p>
</div>
<div class="version_btn" @click="operate('pushAll')">
<img class="btn_icon" src="@/assets/版本发布icon.png" alt="" />
<p>版本发布</p>
</div>
</div>
<el-table :data="tableData" stripe border>
<el-table-column type="selection" width="55"></el-table-column>
<el-table-column type="index" label="序号" width="80" align="center"></el-table-column>
<el-table-column prop="let1" label="字典名称" width="180" align="center"></el-table-column>
<el-table-column prop="let2" label="架构层次" width="180" align="center"></el-table-column>
<el-table-column prop="let3" label="架构归属" width="180" align="center"></el-table-column>
<el-table-column prop="let4" label="描述" width="180" align="center"></el-table-column>
<el-table-column prop="let5" label="字典版本号" align="center"></el-table-column>
<el-table-column prop="state" label="状态" align="center">
<template slot-scope="scope">
<span >{{dicObj.state[scope.row.state]}}</span>
</template>
</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" 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>
</div>
</template>
</el-table-column>
</el-table>
<el-pagination
background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="page.current"
:page-sizes="page.sizes"
:page-size="page.size"
layout="total, sizes, prev, pager, next, jumper"
:total="page.total">
</el-pagination>
</div>
<el-dialog
:title="title"
:visible.sync="add_dialog"
:center="false"
width="40%">
<div class="add_dialog_content">
<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>
<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>
</div>
<span slot="footer" class="dialog-footer">
<el-button class="greenButton" @click="operate('push')">发布</el-button>
<el-button class="greenButton" @click="operate('create')">保存</el-button>
<el-button @click="add_dialog = false">取消</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import {
getYMXZDGLlist,
getYMXZDGLAdd,
getYMXZDGLDel,
getYMXZDGLUpdate,
// getYMXZDGLUpdateBatch,
} from "@/api/index.js";
export default {
name: 'metaModelDic',
components: {
},
data() {
return {
tableData: [],
selectList: [],
add_dialog: false,
title: "",
openType: "",
add_dialog: false,
query_item1: null,
query_item3: null,
query_item4: null,
let1: '',
let2: '',
let3: '',
let4: '',
formData: {
rsName: "",
content: "",
},
params: {
current: 1,
pageSize: 10,
rsName: "",
scope: "",
state: "",
},
page: {
current: 1,
sizes: [10, 20, 50, 100, 200],
size: 10,
total: 20 //总条数
},
dicObj: {
state: {
0: "已停用",
1: "已发布",
2: "暂存",
},
},
stateList: [
{
label: "已发布",
value: 1,
},
{
label: "已停用",
value: 0,
},
{
label: "暂存",
value: 2,
},
],
};
},
mounted() {
// 初始化查询列表
this.getList();
},
created() {
},
methods: {
// 查询列表
getList() {
if (this.params.state != '') {
this.params.state = Number(this.params.state)
}
getYMXZDGLlist(this.params).then(res => {
if (res.code == 200) {
// this.page.total = res.data.total;
// this.tableData = res.data.records;
this.tableData = res.data;
}
});
},
// 重置
reset(){
this.params = {
current: 1,
pageSize: 10,
rsName: "",
scope: "",
state: "",
}
},
// 分页事件
handleSizeChange(val) {
this.page.size = val;
this.params.pageSize = val;
this.getList();
},
handleCurrentChange(val) {
this.page.current = val;
this.paramsp.current = val;
this.getList();
},
// 所有操作
operate(type,item){
this.openType = type;
if (type == "add") {
this.add_dialog = true;
this.title = "新建字典";
this.resetForm();
}else if (type == "edit") {
this.add_dialog = true;
this.title = "编辑字典";
this.formData = item;
}else if (type == "create") {
this.formData.state = 2;
if (this.formData.dicyId) {
// 编辑保存
getYMXZDGLUpdate(this.formData).then(res => {
if (res.code == 200) {
this.$message.success("保存成功");
this.add_dialog = false;
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) {
// 编辑发布
getYMXZDGLUpdate(this.formData).then(res => {
if (res.code == 200) {
this.$message.success("发布成功");
this.add_dialog = false;
this.getList();
}
});
}else{
// 新建发布
getYMXZDGLAdd(this.formData).then(res => {
if (res.code == 200) {
this.$message.success("发布成功");
this.add_dialog = false;
this.getList();
}
});
}
}else if (type == "stop") {
// 停用
this.formData = item;
this.formData.state = 0;
getYMXZDGLUpdate(this.formData).then(res => {
if (res.code == 200) {
this.$message.success("停用成功");
this.getList();
}
});
}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();
}
});
}
},
// 新建清空表单
resetForm(){
this.formData = {
rsName: "",
content: "",
}
},
// 表格多选
handleSelectionChange(e) {
this.selectList = e;
},
selectInit(row,index){
if(row.state != "1"){
return true //可勾选
}else{
return false //不可勾选
}
},
},
}
</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 #0D867F;
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
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!