Commit b9973495 authored by 晓彤's avatar 晓彤

添加造数据功能

parent 1560697e
import request from '@/utils/holmesRequest'
// 获取造数据导航页接口
export function getDataIndex(queryInfo) {
return request({
url: '/build/data/index',
method: 'get',
params: queryInfo
})
}
// 获取造数据列表页面
export function getDataList(queryInfo) {
return request({
url: '/build/data/list',
method: 'get',
params: queryInfo
})
}
// 获取造数据所有模块
export function getDataModules(queryInfo) {
return request({
url: '/build/data/modules',
method: 'get',
params: queryInfo
})
}
// 添加数据
export function addData(data) {
return request({
url: '/build/data/add',
method: 'post',
data
})
}
// 编辑数据
export function editData(data) {
return request({
url: '/build/data/update',
method: 'post',
data
})
}
// 编辑数据
export function delData(data) {
return request({
url: '/build/data/delete',
method: 'post',
data
})
}
......@@ -13,6 +13,14 @@
-moz-osx-font-smoothing: grayscale;
}
.icon-menu:before {
content: "\e64e";
}
.icon-confluence1:before {
content: "\eb6c";
}
.icon-addenvironment:before {
content: "\e607";
}
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -5,6 +5,20 @@
"css_prefix_text": "icon-",
"description": "",
"glyphs": [
{
"icon_id": "10485796",
"name": "menu",
"font_class": "menu",
"unicode": "e64e",
"unicode_decimal": 58958
},
{
"icon_id": "15378251",
"name": "confluence",
"font_class": "confluence1",
"unicode": "eb6c",
"unicode_decimal": 60268
},
{
"icon_id": "997336",
"name": "add environment",
......
......@@ -52,6 +52,9 @@ import DbSync from '../views/effect/DbSync'
// 添加环境模版/创建环境(2021-09-18)
import EnvTemplate from '../views/docker/EnvTemplate'
import CreateEnv from '../views/docker/CreateEnv'
// 新添加Confluence数据列表页(2021-09-29)
import DataIndex from '../views/confluence/DataIndex'
import DataList from '../views/confluence/DataList'
const originalPush = Router.prototype.push
Router.prototype.push = function push(location) {
......@@ -280,6 +283,18 @@ const router = new Router({
path: '/docker/createEnv',
name: '环境模版',
component: CreateEnv
},
// 数据主页(2021-09-29)
{
path: '/confluence/dataIndex',
name: '数据列表',
component: DataIndex
},
// 数据列表页(2021-09-29)
{
path: '/confluence/dataList',
name: '数据列表',
component: DataList
}
]
}
......
<template>
<div class="mixin-components-container">
<el-row v-for="item in indexList" :value="item.moduleName" :key="item.moduleName" style="margin-bottom:5px;">
<el-card class="box-card">
<div slot="header" class="clearfix">
<span style="font-size: 20px;">{{ item.moduleName }}</span>
</div>
<el-button v-for="data in item.list" :key="data.id" :type="item.type" style="padding:10px;margin:5px"
@click="openNewWindow(data.url)">{{ data.name }}</el-button>
</el-card>
</el-row>
</div>
</template>
<script>
import { getDataIndex } from '@/api/getConfluence'
export default {
data() {
return {
indexList: []
}
},
created() {
this.getDataIndex()
},
methods: {
getDataIndex() {
getDataIndex().then((resp) => {
this.indexList = resp.data.data
})
},
openNewWindow(url) {
window.open(url)
}
}
}
</script>
<style lang="less" scoped>
.mixin-components-container {
background-color: #f0f2f5;
padding: 10px;
min-height: calc(100vh - 84px);
}
.component-item {
min-height: 100px;
}
// 自定义el-button样式
// goon
.el-button--goon.is-active,
.el-button--goon:active {
background: #20b2aa;
border-color: #20b2aa;
color: #fff;
}
.el-button--goon:focus,
.el-button--goon:hover {
background: #48d1cc;
border-color: #48d1cc;
color: #fff;
}
.el-button--goon {
color: #fff;
background-color: #20b2aa;
border-color: #20b2aa;
}
// blue
.el-button--blue.is-active,
.el-button--blue:active {
background: #324157;
border-color: #324157;
color: #fff;
}
.el-button--blue:focus,
.el-button--blue:hover {
background: #324157;
border-color: #324157;
color: #fff;
}
.el-button--blue {
color: #fff;
background-color: #324157;
border-color: #324157;
}
// light-blue
.el-button--light-blue.is-active,
.el-button--light-blue:active {
background: #3a71a8;
border-color: #3a71a8;
color: #fff;
}
.el-button--light-blue:focus,
.el-button--light-blue:hover {
background: #3a71a8;
border-color: #3a71a8;
color: #fff;
}
.el-button--light-blue {
color: #fff;
background-color: #3a71a8;
border-color: #3a71a8;
}
// red
.el-button--red.is-active,
.el-button--red:active {
background: #c03639;
border-color: #c03639;
color: #fff;
}
.el-button--red:focus,
.el-button--red:hover {
background: #c03639;
border-color: #c03639;
color: #fff;
}
.el-button--red {
color: #fff;
background-color: #c03639;
border-color: #c03639;
}
// pink
.el-button--pink.is-active,
.el-button--pink:active {
background: #e65d6e;
border-color: #e65d6e;
color: #fff;
}
.el-button--pink:focus,
.el-button--pink:hover {
background: #e65d6e;
border-color: #e65d6e;
color: #fff;
}
.el-button--pink {
color: #fff;
background-color: #e65d6e;
border-color: #e65d6e;
}
// green
.el-button--green.is-active,
.el-button--green:active {
background: #30b08f;
border-color: #30b08f;
color: #fff;
}
.el-button--green:focus,
.el-button--green:hover {
background: #30b08f;
border-color: #30b08f;
color: #fff;
}
.el-button--green {
color: #fff;
background-color: #30b08f;
border-color: #30b08f;
}
// yellow
.el-button--yellow.is-active,
.el-button--yellow:active {
background: #fec171;
border-color: #fec171;
color: #fff;
}
.el-button--yellow:focus,
.el-button--yellow:hover {
background: #fec171;
border-color: #fec171;
color: #fff;
}
.el-button--yellow {
color: #fff;
background-color: #fec171;
border-color: #fec171;
}
</style>
<template>
<div>
<div >
<el-input v-model="queryModel.name" placeholder="名称" clearable style="width: 200px;" class="filter-item" />
<el-select v-model="queryModel.module" placeholder="模块" clearable style="width: 200px" class="filter-item">
<el-option v-for="item in moduleList" :key="item.id" :label="item.name" :value="item.id" />
</el-select>
<el-button class="filter-item" type="primary" icon="el-icon-search" @click="searchIndex">搜索</el-button>
<el-button class="filter-item" style="margin-left: 10px;" type="primary" icon="el-icon-circle-plus"
v-permission="('build:data:add')" @click="addData">新增
</el-button>
</div>
<el-table :data="dataList" border style="width: 100%;margin-top:20px">
<el-table-column label="#" prop="id" align="center" width="50px">
<template slot-scope="scope">
<span>{{ scope.$index + 1 }}</span>
</template>
</el-table-column>
<el-table-column prop="name" label="名称" align="center" />
<el-table-column prop="url" label="地址" align="center" width="350px" />
<el-table-column prop="moduleName" label="模块" align="center" />
<el-table-column prop="updateTime" label="创建时间" align="center" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button type="primary" size="mini" v-permission="('build:data:update')" @click="editData(scope.row)">编辑
</el-button>
<el-button size="mini" type="danger" v-permission="('build:data:delete')" @click="delData(scope.row)">删除
</el-button>
</template>
</el-table-column>
</el-table>
<!-- 新增数据 -->
<el-dialog :title="dialogName" :visible.sync="dialogFormVisible" @closed="handleClose" width="50%">
<el-form ref="dataFormRef" :rules="rules" :model="dataForm" label-width="90px">
<el-form-item label="名称" prop="name" style="width:500px">
<el-input v-model="dataForm.name" placeholder="请输入名称" />
</el-form-item>
<el-form-item label="地址" prop="url" style="width:500px">
<el-input :autosize="{ minRows: 2, maxRows: 4}" v-model="dataForm.url" type="textarea" placeholder="请输入地址" />
</el-form-item>
<el-form-item label="模块" prop="module">
<el-select v-model="dataForm.module" placeholder="选择模块" style="width:410px" clearable class="filter-item">
<el-option v-for="item in moduleList" :key="item.id" :label="item.name" :value="item.id" />
</el-select>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible = false">取消</el-button>
<el-button type="primary" @click="saveData()">确认</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {
getDataList,
getDataModules,
addData,
editData,
delData
} from '@/api/getConfluence'
export default {
data() {
return {
queryModel: {
name: '',
module: ''
},
dataList: [],
moduleList: [],
dialogName: '',
dialogFormVisible: false,
dataForm: {},
rules: {
name: [
{
required: true,
message: '名称不能为空!',
trigger: 'blur'
}
],
url: [
{
required: true,
message: '地址不能为空!',
trigger: 'blur'
}
],
module: [
{
required: true,
message: '模块不能为空!',
trigger: 'blur'
}
]
}
}
},
created() {
this.getDataList()
this.getDataModules()
},
methods: {
getDataList() {
getDataList(this.queryModel).then((resp) => {
this.dataList = resp.data.data
})
},
getDataModules() {
getDataModules().then((resp) => {
this.moduleList = resp.data.data
})
},
searchIndex() {
this.getDataList()
},
// 添加按钮
addData() {
this.dialogName = '新增数据'
this.dataForm = {}
this.dialogFormVisible = true
},
// 编辑数据
editData(row) {
console.log(row)
this.dialogName = '更新数据'
this.dataForm = Object.assign({}, row)
this.dialogFormVisible = true
},
// 对话框方法
openMessage(message, confirmText, doit) {
this.$messageBox
.confirm(message, '确定', {
cancelButtonText: '取消',
confirmButtonText: confirmText,
type: 'warning'
})
.then(() => {
doit()
})
.catch(() => {})
},
// 删除数据
delData(row) {
this.openMessage('您确定要删除吗?', '删除', () => {
delData(row).then((resp) => {
if (resp.data.code === '0000') {
this.getDataList()
this.$message.success('数据删除成功!')
} else {
this.$message.error('数据删除失败!')
}
})
})
},
saveData() {
this.$refs.dataFormRef.validate((valid) => {
if (!valid) {
return false
} else {
if (this.dataForm.id) {
editData(this.dataForm).then((resp) => {
if (resp.data.code === '0000') {
this.dialogFormVisible = false
this.getDataList()
this.$message.success('更新数据成功!')
} else {
this.$message.error('更新数据失败!')
}
})
} else {
addData(this.dataForm).then((resp) => {
console.log('ll', resp)
if (resp.data.code === '0000') {
this.dialogFormVisible = false
this.getDataList()
this.$message.success('新增数据成功!')
} else {
return this.$message.error('新增数据失败!')
}
})
}
}
})
},
handleClose() {}
}
}
</script>
<style lang="less" scoped>
.filter {
margin-bottom: 20px;
}
</style>
......@@ -54,7 +54,7 @@
v-permission="('qa:process:schedule')">发送进度</el-button>
<el-button :disabled="scope.row.dingRobot.status===1?false:true" type="success" size="small"
@click="finishDialog(scope.row)" v-permission="('qa:process:schedule')">完成</el-button>
@click="finishDialog(scope.row)" v-permission="('qa:process:finish')">完成</el-button>
<el-button type="danger" size="small" @click="delProjectRobot(scope.row.dingRobot.id)"
v-permission="('qa:process:del')">删除</el-button>
......
......@@ -108,6 +108,18 @@
"title": "VCC还款回调",
"icon": "iconfont icon-secure-payment-fill",
"path": "/vcc/repaycallback"
},
{
"id": 8,
"title": "造数据文档",
"icon": "iconfont icon-confluence1",
"path": "/confluence/dataIndex"
},
{
"id": 9,
"title": "造数据文档配置",
"icon": "iconfont icon-menu",
"path": "/confluence/dataList"
}
]
},
......
......@@ -6,7 +6,7 @@
<el-option v-for="item in moduleList" :key="item.id" :label="item.name" :value="item.id" />
</el-select>
<el-button class="filter-item" type="primary" icon="el-icon-search" @click="searchIndex">搜索</el-button>
<el-button class="filter-item" style="margin-left: 10px;" type="primary" icon="el-icon-edit"
<el-button class="filter-item" style="margin-left: 10px;" type="primary" icon="el-icon-circle-plus"
@click="handleCreate">添加</el-button>
</div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment