Commit 6eaf574d authored by zhouzihao's avatar zhouzihao

dev-添加源数据管理页面

parent 4d50a186
<style lang="postcss" scoped>
.home-container {
}
.demo-drawer-footer {
width: 100%;
position: absolute;
bottom: 0;
left: 0;
border-top: 1px solid #e8e8e8;
padding: 10px 16px;
text-align: right;
background: #fff;
}
</style>
<template>
<section class="home-container">
<MasterPage title="源数据列表">
<div slot="title-icon">
<Icon type="ios-albums" />
</div>
<div slot="title-toolbar">
<!-- title工具栏 -->
</div>
<div slot="searchContent" class="search-content-slot">
<!-- 表单位置 -->
</div>
<div slot="search">
<Button type="info" icon="ios-search" @click="getList">查询</Button>
</div>
<div slot="btns">
<Button type="primary" icon="md-add" @click="addShow">添加</Button>
</div>
<div slot="paddingContent">
<Table :columns="columns1" :data="data1"></Table>
</div>
<div slot="pager"></div>
</MasterPage>
<Drawer title="源数据" :closable="false" v-model="isShow" width="720">
<div>
<Form :model="showData" label-position="left" :label-width="100">
<FormItem label="部署类型">
<Input v-model="showData.name" disabled ></Input>
</FormItem>
<FormItem label="Docke file">
<Input v-model="showData.docker_file" type="textarea" :rows="10"></Input>
</FormItem>
<FormItem label="gitlab-ci.yml">
<Input v-model="showData.gitlab_ci" type="textarea" :rows="10"></Input>
</FormItem>
<FormItem label="docker compose文件">
<Input v-model="showData.docker_compose" type="textarea" :rows="10"></Input>
</FormItem>
</Form>
</div>
<div class="demo-drawer-footer">
<Button style="margin-right: 8px" @click="isShow= false">取消</Button>
<Button type="primary" @click="save">保存</Button>
</div>
</Drawer>
</section>
</template>
<script>
import MasterPage from "@/components/Master";
import axios from "axios";
import config from "@/config/configs";
export default {
components: {
MasterPage
},
data() {
return {
columns1: [
{
title: "部署类型id",
key: "type_id",
width: 100,
fixed: "left"
},
{
title: "部署类型",
key: "name",
width: 300,
fixed: "left"
},
{
title: "DOCKER FILE",
key: "docker_file",
width: 300
},
{
title: "gitlab-ci.yml",
key: "gitlab_ci",
width: 200
},
{
title: "docker_compose文件",
key: "docker_compose",
width: 200
},
{
title: "操作",
key: "action",
fixed: "right",
width: 150,
render: (h, params) => {
return h("div", [
h(
"Button",
{
props: {
type: "primary",
size: "small"
},
style: {
marginRight: "5px"
},
on: {
click: () => {
this.show(params.index);
}
}
},
"显示/修改"
)
]);
}
}
],
data1: [],
isShow: false,
isAdd: false,
showData: {}
};
},
methods: {
getList: function() {
axios
.get(config.serve_url + "/meta/")
.then(rs => {
if (rs.status == 200) {
this.data1 = rs.data;
// this.total = rs.data.paged.total;
}
})
.catch(err => {
console.log(JSON.stringify(err));
});
},
addShow: function() {
this.isShow = true;
this.showData = {};
},
show: function(index) {
this.isShow = true;
this.showData = this.data1[index];
},
build: function() {
//
},
save: function() {
//保存或者新建
this.isShow = false;
axios
.post(config.serve_url + "/meta/", this.showData)
.then(res => {
this.$Message.success("操作成功");
this.getList();
})
.catch(err => {
this.$Message.error(err);
});
},
pageChange: function(i) {
this.page = i;
this.getList();
}
},
mounted: function() {
this.getList();
}
};
</script>
\ No newline at end of file
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