Commit f33c4049 authored by Liu Peng's avatar Liu Peng

调整页面样式

parent 97a90acd
...@@ -37,14 +37,12 @@ ...@@ -37,14 +37,12 @@
<template slot="action" slot-scope="text, record"> <template slot="action" slot-scope="text, record">
<a-button <a-button
icon="edit" icon="edit"
type="primary" type="link"
class="btn_margin"
@click="showModal(record)" @click="showModal(record)"
>编辑</a-button> >编辑</a-button>
<a-button <a-button
icon="delete" icon="delete"
type="danger" type="link"
class="btn_margin"
@click="deleteRow({record})" @click="deleteRow({record})"
>删除</a-button> >删除</a-button>
</template> </template>
...@@ -118,7 +116,8 @@ let columns = [ ...@@ -118,7 +116,8 @@ let columns = [
title: "操作", title: "操作",
key: "action", key: "action",
scopedSlots: { customRender: "action" }, scopedSlots: { customRender: "action" },
align: "center" align: "center",
width: 180,
} }
]; ];
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
</a-button-group> </a-button-group>
</div> </div>
<div> <div>
<a-row> <a-row type="flex" justify="space-between">
<a-col :span="4" class="col-h"> <a-col :span="4" class="col-h">
<a-tree <a-tree
:treeData="menuTreeData" :treeData="menuTreeData"
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
showLine showLine
/> />
</a-col> </a-col>
<a-col :span="10"> <a-col :span="16">
<a-form :form="modalForm" @submit="modalHandleSubmit"> <a-form :form="modalForm" @submit="modalHandleSubmit">
<a-form-item <a-form-item
label="父级名称" label="父级名称"
...@@ -77,6 +77,8 @@ ...@@ -77,6 +77,8 @@
</a-form-item> </a-form-item>
</a-form> </a-form>
</a-col> </a-col>
<a-col :span="4"/>
</a-row> </a-row>
</div> </div>
</div> </div>
......
This diff is collapsed.
...@@ -47,14 +47,13 @@ ...@@ -47,14 +47,13 @@
<template slot="action" slot-scope="text, record"> <template slot="action" slot-scope="text, record">
<a-button <a-button
icon="edit" icon="edit"
type="primary" type="link"
class="btn_margin" size="small"
@click="showModal(record)" @click="showModal(record)"
>修改</a-button> >修改</a-button>
<a-button <a-button
icon="delete" icon="delete"
type="danger" type="link"
class="btn_margin"
@click="deleteRow({record})" @click="deleteRow({record})"
>删除</a-button> >删除</a-button>
</template> </template>
...@@ -135,6 +134,7 @@ let columns = [ ...@@ -135,6 +134,7 @@ let columns = [
title: "状态", title: "状态",
dataIndex: "status", dataIndex: "status",
align: "center", align: "center",
width: '100px',
scopedSlots: { customRender: "statusFlag" } scopedSlots: { customRender: "statusFlag" }
}, },
{ {
...@@ -148,6 +148,7 @@ let columns = [ ...@@ -148,6 +148,7 @@ let columns = [
title: "创建时间", title: "创建时间",
dataIndex: "createTime", dataIndex: "createTime",
align: "center", align: "center",
width: '180px',
customRender: (text,record) => { customRender: (text,record) => {
return timestampToTime(text); return timestampToTime(text);
} }
...@@ -156,7 +157,8 @@ let columns = [ ...@@ -156,7 +157,8 @@ let columns = [
title: "操作", title: "操作",
key: "action", key: "action",
scopedSlots: { customRender: "action" }, scopedSlots: { customRender: "action" },
align: "center" align: "center",
width: '180px'
} }
]; ];
......
...@@ -77,14 +77,12 @@ ...@@ -77,14 +77,12 @@
<template slot="action" slot-scope="text, record"> <template slot="action" slot-scope="text, record">
<a-button <a-button
icon="edit" icon="edit"
type="primary" type="link"
class="btn_margin"
@click="navigateDetailPage(record)" @click="navigateDetailPage(record)"
>编辑</a-button> >编辑</a-button>
<a-button <a-button
icon="edit" icon="edit"
type="primary" type="link"
class="btn_margin"
@click="changeStatus(record)" @click="changeStatus(record)"
>{{record.status == 'UP' ? '下架' : '上架'}}</a-button> >{{record.status == 'UP' ? '下架' : '上架'}}</a-button>
</template> </template>
...@@ -120,7 +118,8 @@ let columns = [ ...@@ -120,7 +118,8 @@ let columns = [
title: '收费模式', title: '收费模式',
dataIndex: 'chargeModel', dataIndex: 'chargeModel',
align: 'center', align: 'center',
scopedSlots: {customRender: 'chargeModel'} scopedSlots: {customRender: 'chargeModel'},
width: 120,
}, },
{ {
title: '标签', title: '标签',
...@@ -132,13 +131,15 @@ let columns = [ ...@@ -132,13 +131,15 @@ let columns = [
title: '状态', title: '状态',
dataIndex: 'status', dataIndex: 'status',
align: 'center', align: 'center',
scopedSlots: {customRender: 'status'} scopedSlots: {customRender: 'status'},
width: 100,
}, },
{ {
title: '操作', title: '操作',
key: "action", key: "action",
scopedSlots: { customRender: "action" }, scopedSlots: { customRender: "action" },
align: "center" align: "center",
width: 180,
} }
] ]
export default { export default {
......
...@@ -4,10 +4,18 @@ ...@@ -4,10 +4,18 @@
<div class="search_box"> <div class="search_box">
<a-form layout="inline"> <a-form layout="inline">
<a-form-item label="标签名:"> <a-form-item label="标签名:">
<a-input v-model="searchPage.name" placeholder="请输入标签名" allowClear></a-input> <a-input
v-model="searchPage.name"
placeholder="请输入标签名"
allowClear
></a-input>
</a-form-item> </a-form-item>
<a-form-item> <a-form-item>
<a-button icon="search" type="primary" @click="handleSubmit">查询</a-button> <a-button
icon="search"
type="primary"
@click="handleSubmit"
>查询</a-button>
</a-form-item> </a-form-item>
</a-form> </a-form>
</div> </div>
...@@ -35,17 +43,18 @@ ...@@ -35,17 +43,18 @@
> >
<!-- 操作 --> <!-- 操作 -->
<template slot="action" slot-scope="text, record"> <template
slot="action"
slot-scope="text, record"
>
<a-button <a-button
icon="edit" icon="edit"
type="primary" type="link"
class="btn_margin"
@click="showModal(record)" @click="showModal(record)"
>修改</a-button> >修改</a-button>
<a-button <a-button
icon="delete" icon="delete"
type="danger" type="link"
class="btn_margin"
@click="deleteRow(record)" @click="deleteRow(record)"
>删除</a-button> >删除</a-button>
</template> </template>
...@@ -72,7 +81,10 @@ ...@@ -72,7 +81,10 @@
ref="nameVal" ref="nameVal"
prop="name" prop="name"
> >
<a-input v-model="formModel.name" @blur="blurValidate('nameVal')"></a-input> <a-input
v-model="formModel.name"
@blur="blurValidate('nameVal')"
></a-input>
</a-form-model-item> </a-form-model-item>
</a-form-model> </a-form-model>
...@@ -82,83 +94,84 @@ ...@@ -82,83 +94,84 @@
</template> </template>
<script> <script>
import {fetchList,addObj,putObj,delObj} from '@/api/biz/courseTag' import { fetchList, addObj, putObj, delObj } from "@/api/biz/courseTag";
import {disposereq} from '@/utils/util' import { disposereq } from "@/utils/util";
let columns = [ let columns = [
{ {
title: "标签名", title: "标签名",
dataIndex: "name", dataIndex: "name",
align: "center" align: "center",
}, },
{ {
title: '操作', title: "操作",
key: "action", key: "action",
scopedSlots: { customRender: "action" }, scopedSlots: { customRender: "action" },
align: "center" align: "center",
} width: 180,
] },
];
export default { export default {
data(){ data() {
return { return {
loading: false, loading: false,
searchPage: { searchPage: {
pageIndex: 1, pageIndex: 1,
pageSize: 10, pageSize: 10,
name: "" name: "",
}, },
columns: columns, columns: columns,
data: [], data: [],
pagination: { pagination: {
showQuickJumper: true, showQuickJumper: true,
showSizeChanger: true showSizeChanger: true,
}, },
modalVisible: false, modalVisible: false,
modalTitle: '添加', modalTitle: "添加",
modalType: '', modalType: "",
rowData: '', rowData: "",
formModel: { formModel: {
name: '' name: "",
}, },
formRules: { formRules: {
name: [ name: [
{ {
required: true, required: true,
message: '不能为空', message: "不能为空",
trigger: 'blur' trigger: "blur",
}, },
] ],
}
}
}, },
created() { };
this.getList(this.searchPage)
}, },
beforeUpdate() { created() {
this.getList(this.searchPage);
}, },
beforeUpdate() {},
methods: { methods: {
getList(query){ getList(query) {
this.loading = true; this.loading = true;
fetchList(query).then(res => { fetchList(query)
if(res.code == 200){ .then((res) => {
this.loading = false if (res.code == 200) {
this.loading = false;
this.data = res.data; this.data = res.data;
const pager = { ...this.pagination }; const pager = { ...this.pagination };
pager.current = query.pageIndex; pager.current = query.pageIndex;
pager.total = res.count; pager.total = res.count;
this.pagination = pager; this.pagination = pager;
}else{ } else {
this.$message.info(res.resp_msg); this.$message.info(res.resp_msg);
} }
}).catch(err => {
this.loading = false
disposereq(this,err)
}) })
.catch((err) => {
this.loading = false;
disposereq(this, err);
});
}, },
blurValidate(prop){ blurValidate(prop) {
this.$refs[prop].onFieldBlur() this.$refs[prop].onFieldBlur();
}, },
// 表格数据变化触发事件 // 表格数据变化触发事件
handleTableChange(pagination, filters, sorter) { handleTableChange(pagination, filters, sorter) {
...@@ -178,25 +191,24 @@ export default { ...@@ -178,25 +191,24 @@ export default {
this.modalVisible = true; this.modalVisible = true;
// 判断添加或者编辑 // 判断添加或者编辑
if (row == "") { if (row == "") {
this.modalTitle = '添加'; this.modalTitle = "添加";
this.modalType = "add"; this.modalType = "add";
this.formModel.name = "" this.formModel.name = "";
this.rowData = '' this.rowData = "";
} else { } else {
this.modalTitle = '编辑'; this.modalTitle = "编辑";
this.modalType = "edit"; this.modalType = "edit";
this.formModel.name = row.name this.formModel.name = row.name;
this.rowData = row; this.rowData = row;
} }
}, },
// 删除行数据 // 删除行数据
deleteRow(row) { deleteRow(row) {
delObj([row.id]) delObj([row.id])
.then(res => { .then((res) => {
this.loading = false; this.loading = false;
if (res.resp_code == 200) { if (res.resp_code == 200) {
this.$message.success('删除成功'); this.$message.success("删除成功");
const searchPage = { ...this.searchPage }; const searchPage = { ...this.searchPage };
this.loading = true; this.loading = true;
this.getList(searchPage); this.getList(searchPage);
...@@ -204,61 +216,62 @@ export default { ...@@ -204,61 +216,62 @@ export default {
this.$message.info(res.resp_msg); this.$message.info(res.resp_msg);
} }
}) })
.catch(err => { .catch((err) => {
disposereq(this, err); disposereq(this, err);
}); });
}, },
//对话框确定 //对话框确定
onSave(){ onSave() {
this.$refs.formModelRef.validate(valid => { this.$refs.formModelRef.validate((valid) => {
if(valid){ if (valid) {
if(this.modalType == 'add'){ if (this.modalType == "add") {
let data = {} let data = {};
data.name = this.formModel.name data.name = this.formModel.name;
addObj(data).then(res => { addObj(data)
if(res.resp_code == 200){ .then((res) => {
this.modalVisible = false if (res.resp_code == 200) {
this.$message.success('保存成功'); this.modalVisible = false;
this.$message.success("保存成功");
const searchPage = { ...this.searchPage }; const searchPage = { ...this.searchPage };
this.loading = true; this.loading = true;
this.getList(searchPage); this.getList(searchPage);
}else{ } else {
this.$message.info(res.resp_msg); this.$message.info(res.resp_msg);
} }
}).catch(err => {
disposereq(this,err)
}) })
}else if(this.modalType == 'edit'){ .catch((err) => {
let data = {} disposereq(this, err);
data.id = this.rowData.id });
data.name = this.formModel.name } else if (this.modalType == "edit") {
putObj(data).then(res => { let data = {};
if(res.resp_code == 200){ data.id = this.rowData.id;
this.modalVisible = false data.name = this.formModel.name;
this.$message.success('保存成功'); putObj(data)
.then((res) => {
if (res.resp_code == 200) {
this.modalVisible = false;
this.$message.success("保存成功");
const searchPage = { ...this.searchPage }; const searchPage = { ...this.searchPage };
this.loading = true; this.loading = true;
this.getList(searchPage); this.getList(searchPage);
}else{ } else {
this.$message.info(res.resp_msg) this.$message.info(res.resp_msg);
} }
}).catch(err => {
disposereq(this,err)
}) })
.catch((err) => {
disposereq(this, err);
});
} }
} }
}) });
}, },
//对话框取消 //对话框取消
onCancel(){ onCancel() {
this.modalVisible = false this.modalVisible = false;
this.$refs.formModelRef.resetFields() this.$refs.formModelRef.resetFields();
},
},
} };
}
}
</script> </script>
<style> <style>
.template_content { .template_content {
......
This diff is collapsed.
...@@ -37,18 +37,16 @@ ...@@ -37,18 +37,16 @@
<!-- 表格操作 --> <!-- 表格操作 -->
<template slot="action" slot-scope="text,record"> <template slot="action" slot-scope="text,record">
<a-button <a-button
type="primary" type="link"
icon="edit" icon="edit"
@click="showModal(record)" @click="showModal(record)"
class="btn_margin"
> >
修改 修改
</a-button> </a-button>
<a-button <a-button
type="danger"
icon="delete" icon="delete"
@click="deleteRow(record)" @click="deleteRow(record)"
class="btn_margin" type="link"
> >
删除 删除
</a-button> </a-button>
...@@ -130,7 +128,8 @@ let columns = [ ...@@ -130,7 +128,8 @@ let columns = [
title: '操作', title: '操作',
key: "action", key: "action",
scopedSlots: { customRender: "action" }, scopedSlots: { customRender: "action" },
align: "center" align: "center",
width: 180,
} }
] ]
......
<template> <template>
<div> <div class="price-config-container">
<a-form-model <a-form-model
:model="formModel" :model="formModel"
:label-col="{span:4}" :label-col="{span:4}"
...@@ -168,5 +168,7 @@ export default { ...@@ -168,5 +168,7 @@ export default {
} }
</script> </script>
<style> <style>
.price-config-container{
margin: 10px;
}
</style> </style>
\ No newline at end of file
...@@ -40,18 +40,18 @@ ...@@ -40,18 +40,18 @@
<!-- 表格操作 --> <!-- 表格操作 -->
<template slot="action" slot-scope="text,record"> <template slot="action" slot-scope="text,record">
<a-button <a-button
type="primary"
icon="edit" icon="edit"
@click="showModal(record)" @click="showModal(record)"
class="btn_margin" type="link"
> >
修改 修改
</a-button> </a-button>
<a-button <a-button
type="danger"
icon="delete" icon="delete"
@click="deleteRow(record)" @click="deleteRow(record)"
class="btn_margin" type="link"
> >
删除 删除
</a-button> </a-button>
...@@ -139,7 +139,8 @@ let columns = [ ...@@ -139,7 +139,8 @@ let columns = [
{ {
title: "讲师编号", title: "讲师编号",
dataIndex: "code", dataIndex: "code",
align: "center" align: "center",
width: 120,
}, },
{ {
title: "讲师名称", title: "讲师名称",
...@@ -165,13 +166,15 @@ let columns = [ ...@@ -165,13 +166,15 @@ let columns = [
{ {
title: "课程数", title: "课程数",
dataIndex: "courseCount", dataIndex: "courseCount",
align: "center" align: "center",
width: 80,
}, },
{ {
title: '操作', title: '操作',
key: "action", key: "action",
scopedSlots: { customRender: "action" }, scopedSlots: { customRender: "action" },
align: "center" align: "center",
width: 180,
} }
] ]
......
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