Commit b66a9a53 by ‘july-fu’

feat: 企业中台服务清单

1 parent df448725
......@@ -8,3 +8,11 @@ import {
export function getServiceList(data) {
return post(EADC_ARRCHITECTURE + "/arc-aby-iy/qryListPage", data);
}
export function addService(data) {
return post(EADC_ARRCHITECTURE + "/arc-aby-iy/add", data);
}
export function getDataList(data) {
return post(EADC_ARRCHITECTURE + "/arc-aby-ast/qryDataListPage", data);
}
......@@ -215,6 +215,15 @@ export const routes = [
title: "系统架构资产管理",
},
},
{
path: "/main/comCenterServeListOld/", //企业中台服务清单
name: "comCenterServeList",
component: () => import("@/views/comCenterServeList/index.vue"),
meta: {
title: "企业中台服务清单",
},
},
{
path: "/main/comCenterServeList/", //企业中台服务清单
name: "comCenterServeList",
......
<template>
<div class="dataEntityWrapper">
<ETable ref="ETableRef" title="数据实体信息列表" :tableRef.sync="tableRef" :height="430" tableKey="dataEntity" :data="data"
:columns="columns" :indexMethod="true" v-loading="loading" :operateList="operateList" :tableBtnList="tableBtnList"
:columns="columns" :indexMethod="true" v-loading="loading" :operateList="operateList"
@sizeChange="handlerSizeChange" @currentChange="handlerCurrentChange" :pager="pager">
<SearchForm slot="header" :formOptions="formOptions" @onSearch="getList" @onReset="reset"></SearchForm>
<el-form class="search" :model="form" slot="header">
<el-row>
<el-col :span="4">
<el-form-item label="服务名称">
<el-input class="w180" size="mini" type="text" placeholder="服务名称" v-model="form.abilityName"
maxlength="50"></el-input>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="中台类型">
<el-select class="w180" size="mini" v-model="form.midGroundType" placeholder="中台类型">
<el-option v-for="item in midGroundTypeOptions" :key="item.value" :label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="中台名称">
<el-select class="w180" size="mini" v-model="form.midGroundName" placeholder="中台名称">
<el-option v-for="item in midGroundNameOptions" :key="item.value" :label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="发布时间">
<el-date-picker class="w180" size="mini" v-model="form.statTime" value-format="yyyy-MM-dd" type="date"
placeholder="发布时间">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="8">
<div class="btn-box">
<el-button size="mini" type="primary" class="btn-search" icon="el-icon-search" @click="search"
v-preventReClick>查询</el-button>
<el-button size="mini" type="default" class="btn-reset" icon="el-icon-refresh"
@click="reset">重置</el-button>
</div>
</el-col>
</el-row>
</el-form>
</ETable>
</div>
</template>
<script>
import { stateOptions, serverTypeOptions, abilitySourceOptions, midGroundNameOptions, midGroundTypeOptions } from '../options.js'
import { getDataList } from '@/api/comCenterServeListNew'
import SearchForm from "@/components/SearchForm.vue";
import ETable from "@/newComponents/ETable/index.vue";
import tableMixin from "@/mixins/tableMixin";
......@@ -18,47 +62,17 @@ export default {
mixins: [tableMixin()],
data() {
return {
midGroundNameOptions,
midGroundTypeOptions,
loading: false,
tableRef: null,
form: {
name: '',
date: '',
typeName: '',
type: ''
abilityName: "",
midGroundName: "",
midGroundType: "",
statTime: ""
},
selectionList: [],
formOptions: [
{
label: "服务名称",
prop: "name",
element: "el-input",
placeholder: "服务名称",
},
{
label: "统计日期",
prop: "buildType",
element: "el-date-picker",
type: 'date',
valueFormat: 'yyyy-MM-dd',
element: 'el-date-picker',
initValue: new Date().format('yyyy-MM-dd'),
placeholder: '统计日期',
},
{
label: "中台类型",
prop: "buildType",
element: "el-select",
dictType: "build_type",
placeholder: "中台类型",
},
{
label: "中台名称",
prop: "buildType",
element: "el-select",
dictType: "build_type",
placeholder: "中台名称",
},
],
operateList: [
{
label: "新增",
......@@ -92,7 +106,7 @@ export default {
},
],
pager: {
current: 2,
current: 1,
size: 10,
total: 100,
sizes: [10, 20, 50, 100],
......@@ -100,7 +114,7 @@ export default {
columns: [
{
label: "中台服务编码",
prop: "buildType",
prop: "abilityCode",
showOverflowTooltip: true,
align: "center",
fixed: "left",
......@@ -108,70 +122,96 @@ export default {
},
{
label: "中台服务名称",
prop: "buildType2",
prop: "abilityName",
minWidth: 140,
showOverflowTooltip: true,
align: "center",
},
{
label: "物理实体名称",
prop: "buildType2",
prop: "assetName",
minWidth: 120,
showOverflowTooltip: true,
align: "center",
},
{
label: "物理实体英文名称",
prop: "buildType2",
prop: "fieldsValue",
minWidth: 120,
showOverflowTooltip: true,
align: "center",
render: (h, params) => {
let arr = params.fieldsValue ? JSON.parse(params.fieldsValue) : []
let obj = arr.find(i => i.cnName == '物理实体英文名称')
let enName = obj ? obj.value_ : '--'
return h("span", {}, enName);
},
},
{
label: "物理实体编码",
prop: "buildType2",
prop: "fieldsValue",
minWidth: 120,
showOverflowTooltip: true,
align: "center",
render: (h, params) => {
let arr = params.fieldsValue ? JSON.parse(params.fieldsValue) : []
let obj = arr.find(i => i.cnName == '物理实体编码')
let enName = obj ? obj.value_ : '--'
return h("span", {}, enName);
},
},
{
label: "逻辑实体",
prop: "buildType2",
prop: "parentAssetName",
minWidth: 120,
showOverflowTooltip: true,
align: "center",
},
{
label: "概念实体",
prop: "buildType2",
prop: "parOfParAssetName",
minWidth: 120,
showOverflowTooltip: true,
align: "center",
},
],
tableBtnList: [
{
label: "编辑",
type: "primary",
size: "mini",
icon: "el-icon-circle-plus-outline",
click: (row, index) => {
console.log("编辑", row);
},
},
],
data: [{ buildType2: 11 }],
data: [],
};
},
mounted() { },
methods: {
doLayout() {
this.tableRef.doLayout()
},
getList() {
console.log("getList");
async getList() {
let params = { ...this.form, pageSize: this.pager.size, current: this.pager.current }
this.loading = true
const res = await getDataList(params).catch(() => {
this.pager.total = 0
this.loading = false
})
this.loading = false
console.log('getList', res)
if (res.code == 200) {
this.data = res.data.records
this.pager.total = res.data.total
}
},
search() {
this.pager.current = 1
this.pager.total = 0
this.getList()
},
reset() {
this.pager.current = 1
this.pager.total = 0
this.form = {
abilityName: "",
midGroundName: "",
midGroundType: "",
statTime: ""
}
this.getList()
},
reset() { },
handleSelectionChange(val) {
this.selectionList = val;
},
......
<template>
<el-dialog :title="title" custom-class="comDialog" :visible.sync="show" :center="false" :close-on-click-modal="false"
width="80%" @close="close">
width="60%" @close="close">
<el-form :model="form" :rules="rules" ref="formRef" label-width="120px">
<el-row>
<el-col :span="12">
......@@ -16,9 +16,10 @@
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="服务类型" prop="serveType">
<el-select class="w180" v-model="form.serveType" placeholder="请选择">
<el-option v-for="item in serverTypeOptions" :key="item.value" :label="item.label" :value="item.value">
<el-form-item label="资源类型" prop="abilityType">
<el-select class="w180" v-model="form.abilityType" placeholder="请选择"
@change="(val) => { comChange(val, 'abilityType') }">
<el-option v-for="item in abilitySourceOptions" :key="item.value" :label="item.label" :value="item.value">
</el-option>
</el-select>
</el-form-item>
......@@ -29,17 +30,21 @@
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="中台类型" prop="content">
<el-select class="w180" v-model="value" placeholder="请选择">
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
<el-form-item label="中台类型" prop="midGroundType">
<el-select class="w180" v-model="form.midGroundType" placeholder="中台类型"
@change="(val) => { comChange(val, 'midGroundType') }">
<el-option v-for="item in midGroundTypeOptions" :key="item.value" :label="item.label" :value="item.value">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="中台名称" prop="content">
<el-input class="w180" type="textarea" :rows="3" maxlength="200" show-word-limit placeholder="请输入内容"
v-model="form.content"></el-input>
<el-form-item label="中台名称" prop="midPlatformId">
<el-select class="w180" v-model="form.midPlatformId" placeholder="中台名称"
@change="(val) => { comChange(val, 'midPlatformId') }">
<el-option v-for="item in midGroundNameOptions" :key="item.value" :label="item.label" :value="item.value">
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
......@@ -47,32 +52,98 @@
<span slot="footer">
<el-button @click="close">取 消</el-button>
<el-button type="primary" @click="submit">保 存</el-button>
<el-button type="primary" @click="submit">发 布</el-button>
<el-button type="primary" @click="release">发 布</el-button>
</span>
</el-dialog>
</template>
<script>
import { serverTypeOptions, abilitySourceOptions, midGroundNameOptions, midGroundTypeOptions } from '../options.js'
import {
serverTypeOptions,
abilitySourceOptions,
midGroundNameOptions,
midGroundTypeOptions,
} from "../options.js";
import { addService } from '@/api/comCenterServeListNew'
export default {
data() {
return {
loading: false,
serverTypeOptions,
abilitySourceOptions,
midGroundNameOptions,
midGroundTypeOptions,
show: false,
title: "新增",
title: "新增中台服务",
form: {
abilityCode: undefined, // 中台服务编码 false
abilityName: undefined, // 中台服务名称 false
abilityCode: undefined,
abilityName: undefined,
inventoryName: undefined,
abilityType: undefined,
// abilitySource: "1",
midGroundId: undefined,
midPlatformName: undefined,
midGroundName: undefined,
midPlatformId: undefined,
module: undefined,
state: 2,
},
rules: {
abilityName: {
required: true,
message: '中台服务名称不能为空',
trigger: 'blur'
},
abilityCode: {
required: true,
message: '中台服务编码不能为空',
trigger: 'blur'
},
abilityType: {
required: true,
message: '资源类型不能为空',
trigger: 'blur'
},
module: {
required: true,
message: '模块不能为空',
trigger: 'blur'
},
midGroundType: {
required: true,
message: '中台类型不能为空',
trigger: 'blur'
},
midPlatformId: {
required: true,
message: '中台名称不能为空',
trigger: 'blur'
}
},
rules: {},
};
},
methods: {
close() {
comChange(val, str) {
let obj
switch (str) {
case 'abilityType':
obj = val ? this.abilitySourceOptions.find(i => i.value == val) : ''
this.form.inventoryName = obj ? obj.label : '';
break;
case 'midGroundType':
obj = val ? this.midGroundTypeOptions.find(i => i.value == val) : ''
this.form.midGroundName = obj ? obj.label : '';
break;
case 'midPlatformId':
obj = val ? this.midGroundNameOptions.find(i => i.value == val) : ''
this.form.midPlatformName = obj ? obj.label : '';
break;
default:
return
}
},
async close() {
await this.$refs.formRef.resetFields()
this.show = false;
},
open(row) {
......@@ -80,15 +151,25 @@ export default {
this.show = true;
},
submit() {
this.$refs.formRef.validate((valid) => {
this.$refs.formRef.validate(async (valid) => {
if (valid) {
this.loading = true
const res = await addService(this.form).catch(() => {
this.loading = false
})
this.loading = false
console.log(res)
if (res.code == 200) {
this.$message.success('新增成功')
this.$emit("submit");
this.close();
}
} else {
return false;
}
});
},
release() { },
},
};
</script>
......@@ -96,4 +177,10 @@ export default {
.w180 {
width: 180px;
}
/deep/.el-form-item__content {
display: flex;
justify-content: flex-start;
align-items: center;
}
</style>
......@@ -88,7 +88,7 @@
</el-dialog>
<!-- edit -->
<!-- <EditService ref="EditServiceRef" @submit="getList" /> -->
<EditService ref="EditServiceRef" @submit="search" />
</div>
</template>
<script>
......@@ -449,7 +449,6 @@ export default {
this.data = res.data.records
this.pager.total = res.data.total
}
},
search() {
this.pager.current = 1
......
......@@ -66,19 +66,19 @@ export const abilitySourceOptions = [
export const midGroundNameOptions = [
{
label: "项目管理业务中台",
value: "项目管理业务中台",
value: "1",
},
{
label: "电网资源业务中台",
value: "电网资源业务中台",
value: "2",
},
{
label: "客户服务业务中台",
value: "客户服务业务中台",
value: "3",
},
{
label: "财务管理业务中台",
value: "财务管理业务中台",
value: "4",
},
];
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!