Commit f33c4049 authored by Liu Peng's avatar Liu Peng

调整页面样式

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