Commit 82921b8a authored by 赵啸非's avatar 赵啸非

添加服务和优势界面

parent f067a8ec
......@@ -56,6 +56,8 @@ const router = new Router({
...restBuilder("example", "example"), //案例
...restBuilder("slideshow", "slideshow"), //轮播
...restBuilder("type", "type"), //类型
...restBuilder("advantage", "advantage"), //优势
...restBuilder("service", "service"), //服务
//以下为基础路由配置
builder("", "Home"),
......
<template>
<!-- 弹出框表单 -->
<el-drawer
:title="title"
:visible.sync="open"
:direction="direction"
:destroy-on-close="true"
size="60%">
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-row>
<Field :span="20" label="标题" prop="title" v-model="form.title" type="textarea" placeholder="请输入标题"/>
<Field :span="20" label="内容"><editor v-model="form.content" :min-height="256"/></Field>
<Field :span="20" label="图片"><imageUpload v-model="form.imagePath" prePath="/file/preview"/></Field>
<Field :span="20" label="备注" prop="remark" v-model="form.remark" type="textarea" placeholder="请输入备注"/>
</el-row>
<form-buttons @submit='submitForm' v-if="pageInfo.type!='view'" noCancelBtn />
</el-form>
</el-drawer>
</template>
<script>
import form from "@/assets/mixins/formdialog";
export default {
name: "AdvantageDetail",
mixins: [form],
components: {
},
created() {
this.changePath("advantage")
},
data() {
return {
// 遮罩层
loading: true,
// 弹出层标题
title: "公司优势特点",
// 是否显示弹出层
open: false,
direction:"rtl",
toString:[
],
toDate:[
],
// 表单校验
rules: {
}
};
},
methods: {
/** 编辑 */
edit(row) {
this.reset()
this.query = { id: row.id };
this.urls.currUrl ="advantage/edit";
this.getData();
this.pageInfo.type="edit"
this.title = "修改公司优势特点";
},
/** 新增 */
add(row) {
this.reset()
this.urls.currUrl = "advantage/add";
this.getData();
this.pageInfo.type="add"
this.title = "新增公司优势特点";
},
/** 查看*/
view(row) {
this.reset()
this.query = { id: row.id };
this.urls.currUrl ="advantage/view";
this.getData();
this.pageInfo.type="view"
this.title = "公司优势特点详细";
},
/**取消按钮 */
cancel() {
this.open = false;
},
/**获取数据后弹框 */
afterRender(data) {
this.open = true;
},
afterSubmit(data) {
this.open = false;
this.$emit("ok");
},
// 表单重置
reset() {
this.form = {
title : null,
content : null,
imagePath : null,
remark : null,
};
this.resetForm("form");
},
resetForm(refName) {
if (this.$refs[refName]) {
this.$refs[refName].resetFields();
}
},
},
};
</script>
<template>
<div class="page">
<LayoutTable :data="tableData" :config="tableConfig">
</LayoutTable>
<drawer-show ref="drawerform" @ok="getData" />
</div>
</template>
<script>
/** 表单弹出框模式需引入 */
import drawerShow from "./drawershow";
import table from "@/assets/mixins/table";
export default {
name: "AdvantageList",
components: {
drawerShow
},
mixins: [table],
created() {
},
methods: {
/** 重写新增方法 */
toAdd(row) {
this.$refs.drawerform.add(row);
},
/** 重写编辑方法 */
toEdit(row) {
this.$refs.drawerform.edit(row);
},
/** 重写查看方法 */
toView(row) {
this.$refs.drawerform.view(row);
},
},
data() {
return {
config: {
search: [
],
columns: [
{type: "selection", width: 60},
{type: "index",label: "序号",width: 50},
{label: "标题", prop: "title"},
{label: "内容", prop: "content"},
{label: "图片", prop: "imagePath"},
{label: "备注", prop: "remark"},
{label: "创建用户", prop: "createUserId", formatter: this.formatter},
{label: "创建时间", prop: "createTime", formatter: this.formatterDate},
{label: "更新时间", prop: "updateTime", formatter: this.formatterDate},
{
label: "操作",
width: 240,
formatter: row => {
return (
<table-buttons noAdd row={row} onEdit={this.toEdit} onView={this.toView} onDel={this.toDel} />
);
}
}
]
}
};
}
};
</script>
\ No newline at end of file
<template>
<layout-view>
<el-descriptions :title="title" :column="column" :size="size" :colon="false" border>
<template slot="title">
<i class="el-icon-tickets"></i>
基本详细信息
</template>
<template slot="extra">
<el-button type="primary" @click="$router.go(-1)" size="small">返回</el-button>
</template>
<el-descriptions-item label="标题" label-class-name="labelClass" content-class-name="contentClass">
{{form.title}}
</el-descriptions-item>
<el-descriptions-item label="内容" label-class-name="labelClass" content-class-name="contentClass">
<editor v-model="form.content" :min-height="256"/>
</el-descriptions-item>
<el-descriptions-item label="图片" label-class-name="labelClass" content-class-name="contentClass">
<imageUpload v-model="form.imagePath" prePath="/file/preview"/>
</el-descriptions-item>
<el-descriptions-item label="备注" label-class-name="labelClass" content-class-name="contentClass">
{{form.remark}}
</el-descriptions-item>
</el-descriptions>
</layout-view>
</template>
<script>
import view from "@/assets/mixins/view";
import ImageUpload from '@/components/ImageUpload';
import Editor from '@/components/Editor';
export default {
mixins: [view],
components: {
ImageUpload,
Editor,
},
methods: {
},
data() {
return {
size:"small",
column:2,
toString:[
],
toArrays: [
],
toDate: [
]
}
}
}
</script>
<style lang="less">
.labelClass{
width: 200px;
}
.el-descriptions__body{
margin-left: 5px;
margin-right: 5px;
color: #606266;
background-color: #FFF;
}
.contentClass{
width: 600px;
}
</style>
\ No newline at end of file
<template>
<!-- 弹出框表单 -->
<el-drawer
:title="title"
:visible.sync="open"
:direction="direction"
:destroy-on-close="true"
size="60%">
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-row>
<Field :span="20" label="标题" prop="title" v-model="form.title" type="textarea" placeholder="请输入标题"/>
<Field :span="20" label="内容"><editor v-model="form.content" :min-height="256"/></Field>
<Field :span="20" label="图标" prop="icon" v-model="form.icon" placeholder="请输入图标"/>
<Field :span="20" label="备注" prop="remark" v-model="form.remark" type="textarea" placeholder="请输入备注"/>
</el-row>
<form-buttons @submit='submitForm' v-if="pageInfo.type!='view'" noCancelBtn />
</el-form>
</el-drawer>
</template>
<script>
import form from "@/assets/mixins/formdialog";
export default {
name: "ServiceDetail",
mixins: [form],
components: {
},
created() {
this.changePath("service")
},
data() {
return {
// 遮罩层
loading: true,
// 弹出层标题
title: "公司服务",
// 是否显示弹出层
open: false,
direction:"rtl",
toString:[
],
toDate:[
],
// 表单校验
rules: {
}
};
},
methods: {
/** 编辑 */
edit(row) {
this.reset()
this.query = { id: row.id };
this.urls.currUrl ="service/edit";
this.getData();
this.pageInfo.type="edit"
this.title = "修改公司服务";
},
/** 新增 */
add(row) {
this.reset()
this.urls.currUrl = "service/add";
this.getData();
this.pageInfo.type="add"
this.title = "新增公司服务";
},
/** 查看*/
view(row) {
this.reset()
this.query = { id: row.id };
this.urls.currUrl ="service/view";
this.getData();
this.pageInfo.type="view"
this.title = "公司服务详细";
},
/**取消按钮 */
cancel() {
this.open = false;
},
/**获取数据后弹框 */
afterRender(data) {
this.open = true;
},
afterSubmit(data) {
this.open = false;
this.$emit("ok");
},
// 表单重置
reset() {
this.form = {
title : null,
content : null,
icon : null,
remark : null,
};
this.resetForm("form");
},
resetForm(refName) {
if (this.$refs[refName]) {
this.$refs[refName].resetFields();
}
},
},
};
</script>
<template>
<div class="page">
<LayoutTable :data="tableData" :config="tableConfig">
</LayoutTable>
<drawer-show ref="drawerform" @ok="getData" />
</div>
</template>
<script>
/** 表单弹出框模式需引入 */
import drawerShow from "./drawershow";
import table from "@/assets/mixins/table";
export default {
name: "ServiceList",
components: {
drawerShow
},
mixins: [table],
created() {
},
methods: {
/** 重写新增方法 */
toAdd(row) {
this.$refs.drawerform.add(row);
},
/** 重写编辑方法 */
toEdit(row) {
this.$refs.drawerform.edit(row);
},
/** 重写查看方法 */
toView(row) {
this.$refs.drawerform.view(row);
},
},
data() {
return {
config: {
search: [
],
columns: [
{type: "selection", width: 60},
{type: "index",label: "序号",width: 50},
{label: "标题", prop: "title"},
{label: "内容", prop: "content"},
{label: "图标", prop: "icon"},
{label: "备注", prop: "remark"},
{label: "创建用户", prop: "createUserId", formatter: this.formatter},
{label: "创建时间", prop: "createTime", formatter: this.formatterDate},
{label: "更新时间", prop: "updateTime", formatter: this.formatterDate},
{
label: "操作",
width: 240,
formatter: row => {
return (
<table-buttons noAdd row={row} onEdit={this.toEdit} onView={this.toView} onDel={this.toDel} />
);
}
}
]
}
};
}
};
</script>
\ No newline at end of file
<template>
<layout-view>
<el-descriptions :title="title" :column="column" :size="size" :colon="false" border>
<template slot="title">
<i class="el-icon-tickets"></i>
基本详细信息
</template>
<template slot="extra">
<el-button type="primary" @click="$router.go(-1)" size="small">返回</el-button>
</template>
<el-descriptions-item label="标题" label-class-name="labelClass" content-class-name="contentClass">
{{form.title}}
</el-descriptions-item>
<el-descriptions-item label="内容" label-class-name="labelClass" content-class-name="contentClass">
<editor v-model="form.content" :min-height="256"/>
</el-descriptions-item>
<el-descriptions-item label="图标" label-class-name="labelClass" content-class-name="contentClass">
{{form.icon}}
</el-descriptions-item>
<el-descriptions-item label="备注" label-class-name="labelClass" content-class-name="contentClass">
{{form.remark}}
</el-descriptions-item>
</el-descriptions>
</layout-view>
</template>
<script>
import view from "@/assets/mixins/view";
import Editor from '@/components/Editor';
export default {
mixins: [view],
components: {
Editor,
},
methods: {
},
data() {
return {
size:"small",
column:2,
toString:[
],
toArrays: [
],
toDate: [
]
}
}
}
</script>
<style lang="less">
.labelClass{
width: 200px;
}
.el-descriptions__body{
margin-left: 5px;
margin-right: 5px;
color: #606266;
background-color: #FFF;
}
.contentClass{
width: 600px;
}
</style>
\ 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