4 changed files with 515 additions and 4 deletions
@ -0,0 +1,234 @@ |
|||||
|
<template> |
||||
|
<div class="app-container"> |
||||
|
<el-row :gutter="20"> |
||||
|
<!--configService数据--> |
||||
|
<el-col :span="20" :xs="24"> |
||||
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="90px"> |
||||
|
<el-form-item label="配置名称" prop="configName"> |
||||
|
<el-input |
||||
|
v-model="queryParams.configName" |
||||
|
placeholder="请输入配置名称" |
||||
|
clearable |
||||
|
style="width: 200px" |
||||
|
@keyup.enter.native="handleQuery" |
||||
|
/> |
||||
|
</el-form-item> |
||||
|
<el-form-item> |
||||
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> |
||||
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
|
||||
|
<el-row :gutter="10" class="mb8"> |
||||
|
<!-- <el-col :span="1.5"> |
||||
|
<el-button |
||||
|
type="primary" |
||||
|
plain |
||||
|
icon="el-icon-plus" |
||||
|
size="mini" |
||||
|
@click="handleAdd" |
||||
|
v-hasPermi="['rights:link:add']" |
||||
|
>新增</el-button> |
||||
|
</el-col> --> |
||||
|
<!-- <el-col :span="1.5"> |
||||
|
<el-button |
||||
|
type="danger" |
||||
|
plain |
||||
|
icon="el-icon-delete" |
||||
|
size="mini" |
||||
|
:disabled="multiple" |
||||
|
@click="handleDelete" |
||||
|
v-hasPermi="['img:banner:delete']" |
||||
|
>删除</el-button> |
||||
|
</el-col> --> |
||||
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar> |
||||
|
</el-row> |
||||
|
|
||||
|
<el-table v-loading="loading" :data="configServiceList" @selection-change="handleSelectionChange"> |
||||
|
<el-table-column type="selection" width="50" align="center" /> |
||||
|
<el-table-column label="id" align="center" key="id" prop="id" v-if="columns[0].visible" width="150"/> |
||||
|
<el-table-column label="配置名称" align="center" key="configName" prop="configName" v-if="columns[1].visible" width="300"/> |
||||
|
<el-table-column label="配置数据" align="center" key="configValue" prop="configValue" v-if="columns[2].visible" width="300"/> |
||||
|
|
||||
|
<el-table-column |
||||
|
label="操作" |
||||
|
align="center" |
||||
|
width="160" |
||||
|
class-name="small-padding fixed-width" |
||||
|
> |
||||
|
<template slot-scope="scope"> |
||||
|
<el-button |
||||
|
size="mini" |
||||
|
type="text" |
||||
|
icon="el-icon-edit" |
||||
|
@click="handleUpdate(scope.row)" |
||||
|
v-hasPermi="['rights:commonConfig:edit']" |
||||
|
>修改</el-button> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
|
||||
|
<!-- <pagination |
||||
|
v-show="total>0" |
||||
|
:total="total" |
||||
|
:page.sync="queryParams.pageNum" |
||||
|
:limit.sync="queryParams.pageSize" |
||||
|
@pagination="getList" |
||||
|
/> --> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
|
||||
|
<!-- 添加或修改configService对话框 --> |
||||
|
<el-dialog :title="title" :visible.sync="open" width="600px" append-to-body> |
||||
|
<el-form ref="form" :model="form" :rules="rules" label-width="100px"> |
||||
|
<el-row> |
||||
|
<el-col :span="12"> |
||||
|
<el-form-item label="链接id" prop="linkId"> |
||||
|
<el-input v-model="form.linkId" placeholder="请输入链接id" maxlength="30" /> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="12"> |
||||
|
<el-form-item label="链接名字" prop="linkName"> |
||||
|
<el-input v-model="form.linkName" placeholder="请输入链接名字" maxlength="100" /> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="12"> |
||||
|
<el-form-item label="所属公司" prop="affiliationCompanyName"> |
||||
|
<el-input v-model="form.affiliationCompanyName" placeholder="请输入所属公司" maxlength="100" /> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
<!-- <el-row> --> |
||||
|
<!-- </el-row> --> |
||||
|
</el-form> |
||||
|
<div slot="footer" class="dialog-footer"> |
||||
|
<el-button type="primary" @click="submitForm">确 定</el-button> |
||||
|
<el-button @click="cancel">取 消</el-button> |
||||
|
</div> |
||||
|
</el-dialog> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import { listConfigService, editConfigService } from "@/api/rights/configService"; |
||||
|
|
||||
|
export default { |
||||
|
name: "configService", |
||||
|
data() { |
||||
|
return { |
||||
|
// 遮罩层 |
||||
|
loading: true, |
||||
|
// 选中数组 |
||||
|
ids: [], |
||||
|
// 非单个禁用 |
||||
|
single: true, |
||||
|
// 非多个禁用 |
||||
|
multiple: true, |
||||
|
// 显示搜索条件 |
||||
|
showSearch: true, |
||||
|
// 总条数 |
||||
|
//total: 0, |
||||
|
// configService列表数据 |
||||
|
configServiceList: null, |
||||
|
// 弹出层标题 |
||||
|
title: "", |
||||
|
// 是否显示弹出层 |
||||
|
open: false, |
||||
|
// 日期范围 |
||||
|
dateRange: [], |
||||
|
// 表单参数 |
||||
|
form: {}, |
||||
|
// 查询参数 |
||||
|
queryParams: { |
||||
|
pageNum: 1, |
||||
|
pageSize: 10, |
||||
|
configName: undefined |
||||
|
}, |
||||
|
// 列信息 |
||||
|
columns: [ |
||||
|
{ key: 0, label: `id`, visible: true }, |
||||
|
{ key: 1, label: `配置名称`, visible: true }, |
||||
|
{ key: 2, label: `配置数据`, visible: true } |
||||
|
], |
||||
|
// 表单校验 |
||||
|
rules: { |
||||
|
configName: [ |
||||
|
{ required: true, message: "配置名称不能为空", trigger: "blur" }, |
||||
|
], |
||||
|
configValue: [ |
||||
|
{ required: true, message: "配置数据不能为空", trigger: "blur" } |
||||
|
] |
||||
|
} |
||||
|
}; |
||||
|
}, |
||||
|
created() { |
||||
|
this.getList(); |
||||
|
}, |
||||
|
methods: { |
||||
|
/** 查询configService列表 */ |
||||
|
getList() { |
||||
|
this.loading = true; |
||||
|
listConfigService(this.queryParams).then(response => { |
||||
|
this.configServiceList = response.list; |
||||
|
//this.total = response.total; |
||||
|
this.loading = false; |
||||
|
} |
||||
|
); |
||||
|
}, |
||||
|
// 筛选节点 |
||||
|
filterNode(value, data) { |
||||
|
if (!value) return true; |
||||
|
return data.label.indexOf(value) !== -1; |
||||
|
}, |
||||
|
// 取消按钮 |
||||
|
cancel() { |
||||
|
this.open = false; |
||||
|
this.reset(); |
||||
|
}, |
||||
|
// 表单重置 |
||||
|
reset() { |
||||
|
this.form = { |
||||
|
linkId : undefined, |
||||
|
linkName: undefined, |
||||
|
affiliationCompanyName: undefined |
||||
|
}; |
||||
|
this.resetForm("form"); |
||||
|
}, |
||||
|
/** 搜索按钮操作 */ |
||||
|
handleQuery() { |
||||
|
this.queryParams.pageNum = 1; |
||||
|
this.getList(); |
||||
|
}, |
||||
|
/** 重置按钮操作 */ |
||||
|
resetQuery() { |
||||
|
//this.dateRange = []; |
||||
|
this.resetForm("queryForm"); |
||||
|
this.handleQuery(); |
||||
|
}, |
||||
|
// 多选框选中数据 |
||||
|
handleSelectionChange(selection) { |
||||
|
this.ids = selection.map(item => item.id); |
||||
|
this.single = selection.length != 1; |
||||
|
this.multiple = !selection.length; |
||||
|
}, |
||||
|
/** 新增按钮操作 */ |
||||
|
// handleAdd() { |
||||
|
// this.reset(); |
||||
|
// this.open = true; |
||||
|
// this.title = "添加链接"; |
||||
|
// }, |
||||
|
/** 提交按钮 */ |
||||
|
submitForm: function() { |
||||
|
this.$refs["form"].validate(valid => { |
||||
|
if (valid) { |
||||
|
editConfigService(this.form).then(response => { |
||||
|
this.$modal.msgSuccess("修改成功"); |
||||
|
this.open = false; |
||||
|
this.getList(); |
||||
|
}); |
||||
|
} |
||||
|
}); |
||||
|
}, |
||||
|
} |
||||
|
}; |
||||
|
</script> |
||||
@ -0,0 +1,278 @@ |
|||||
|
<template> |
||||
|
<div class="app-container"> |
||||
|
<el-row :gutter="20"> |
||||
|
<!--link数据--> |
||||
|
<el-col :span="20" :xs="24"> |
||||
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="90px"> |
||||
|
<!-- <el-form-item label="banner名称" prop="bannerName"> |
||||
|
<el-input |
||||
|
v-model="queryParams.bannerName" |
||||
|
placeholder="请输入banner名称" |
||||
|
clearable |
||||
|
style="width: 200px" |
||||
|
@keyup.enter.native="handleQuery" |
||||
|
/> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="来源平台" prop="source" label-width="80px"> |
||||
|
<el-select v-model="queryParams.source" placeholder="来源渠道" clearable> |
||||
|
<el-option |
||||
|
v-for="item in source" |
||||
|
:key="item.value" |
||||
|
:label="item.label" |
||||
|
:value="item.value" |
||||
|
/> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="是否显示" prop="isShow" label-width="80px"> |
||||
|
<el-select v-model="queryParams.isShow" placeholder="是否显示" clearable> |
||||
|
<el-option |
||||
|
v-for="item in isShow" |
||||
|
:key="item.value" |
||||
|
:label="item.label" |
||||
|
:value="item.value" |
||||
|
/> |
||||
|
</el-select> |
||||
|
</el-form-item> --> |
||||
|
<el-form-item> |
||||
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> |
||||
|
<!-- <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> --> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
|
||||
|
<el-row :gutter="10" class="mb8"> |
||||
|
<el-col :span="1.5"> |
||||
|
<el-button |
||||
|
type="primary" |
||||
|
plain |
||||
|
icon="el-icon-plus" |
||||
|
size="mini" |
||||
|
@click="handleAdd" |
||||
|
v-hasPermi="['rights:link:add']" |
||||
|
>新增</el-button> |
||||
|
</el-col> |
||||
|
<!-- <el-col :span="1.5"> |
||||
|
<el-button |
||||
|
type="danger" |
||||
|
plain |
||||
|
icon="el-icon-delete" |
||||
|
size="mini" |
||||
|
:disabled="multiple" |
||||
|
@click="handleDelete" |
||||
|
v-hasPermi="['img:banner:delete']" |
||||
|
>删除</el-button> |
||||
|
</el-col> --> |
||||
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar> |
||||
|
</el-row> |
||||
|
|
||||
|
<el-table v-loading="loading" :data="linkList" @selection-change="handleSelectionChange"> |
||||
|
<el-table-column type="selection" width="50" align="center" /> |
||||
|
<el-table-column label="id" align="center" key="id" prop="id" v-if="columns[0].visible" width="150"/> |
||||
|
<el-table-column label="链接id" align="center" key="linkId" prop="linkId" v-if="columns[1].visible" width="300"/> |
||||
|
<el-table-column label="链接名称" align="center" key="linkName" prop="linkName" v-if="columns[2].visible" width="300"/> |
||||
|
<el-table-column label="所属公司" align="center" key="affiliationCompanyName" prop="affiliationCompanyName" v-if="columns[3].visible" width="200"/> |
||||
|
|
||||
|
<!-- <el-table-column |
||||
|
label="操作" |
||||
|
align="center" |
||||
|
width="160" |
||||
|
class-name="small-padding fixed-width" |
||||
|
> |
||||
|
<template slot-scope="scope"> |
||||
|
<el-button |
||||
|
size="mini" |
||||
|
type="text" |
||||
|
icon="el-icon-edit" |
||||
|
@click="handleUpdate(scope.row)" |
||||
|
v-hasPermi="['img:banner:edit']" |
||||
|
>修改</el-button> |
||||
|
<el-button |
||||
|
size="mini" |
||||
|
type="text" |
||||
|
icon="el-icon-delete" |
||||
|
@click="handleDelete(scope.row)" |
||||
|
v-hasPermi="['img:banner:delete']" |
||||
|
>删除</el-button> |
||||
|
</template> |
||||
|
</el-table-column> --> |
||||
|
</el-table> |
||||
|
|
||||
|
<!-- <pagination |
||||
|
v-show="total>0" |
||||
|
:total="total" |
||||
|
:page.sync="queryParams.pageNum" |
||||
|
:limit.sync="queryParams.pageSize" |
||||
|
@pagination="getList" |
||||
|
/> --> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
|
||||
|
<!-- 添加或修改banner对话框 --> |
||||
|
<el-dialog :title="title" :visible.sync="open" width="600px" append-to-body> |
||||
|
<el-form ref="form" :model="form" :rules="rules" label-width="100px"> |
||||
|
<el-row> |
||||
|
<el-col :span="12"> |
||||
|
<el-form-item label="链接id" prop="linkId"> |
||||
|
<el-input v-model="form.linkId" placeholder="请输入链接id" maxlength="30" /> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="12"> |
||||
|
<el-form-item label="链接名字" prop="linkName"> |
||||
|
<el-input v-model="form.linkName" placeholder="请输入链接名字" maxlength="100" /> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="12"> |
||||
|
<el-form-item label="所属公司" prop="affiliationCompanyName"> |
||||
|
<el-input v-model="form.affiliationCompanyName" placeholder="请输入所属公司" maxlength="100" /> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
<!-- <el-row> --> |
||||
|
<!-- </el-row> --> |
||||
|
</el-form> |
||||
|
<div slot="footer" class="dialog-footer"> |
||||
|
<el-button type="primary" @click="submitForm">确 定</el-button> |
||||
|
<el-button @click="cancel">取 消</el-button> |
||||
|
</div> |
||||
|
</el-dialog> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import { listLink, addLink } from "@/api/rights/link"; |
||||
|
|
||||
|
export default { |
||||
|
name: "Link", |
||||
|
data() { |
||||
|
return { |
||||
|
// 遮罩层 |
||||
|
loading: true, |
||||
|
// 选中数组 |
||||
|
ids: [], |
||||
|
// 非单个禁用 |
||||
|
single: true, |
||||
|
// 非多个禁用 |
||||
|
multiple: true, |
||||
|
// 显示搜索条件 |
||||
|
showSearch: true, |
||||
|
// 总条数 |
||||
|
//total: 0, |
||||
|
// link列表数据 |
||||
|
linkList: null, |
||||
|
// 弹出层标题 |
||||
|
title: "", |
||||
|
// 是否显示弹出层 |
||||
|
open: false, |
||||
|
// 日期范围 |
||||
|
dateRange: [], |
||||
|
// 表单参数 |
||||
|
form: {}, |
||||
|
// 查询参数 |
||||
|
// queryParams: { |
||||
|
// pageNum: 1, |
||||
|
// pageSize: 10 |
||||
|
// }, |
||||
|
// 列信息 |
||||
|
columns: [ |
||||
|
{ key: 0, label: `id`, visible: true }, |
||||
|
{ key: 1, label: `链接id`, visible: true }, |
||||
|
{ key: 2, label: `链接名称`, visible: true }, |
||||
|
{ key: 3, label: `所属公司`, visible: true } |
||||
|
], |
||||
|
// 表单校验 |
||||
|
rules: { |
||||
|
linkId: [ |
||||
|
{ required: true, message: "链接id不能为空", trigger: "blur" }, |
||||
|
], |
||||
|
linkName: [ |
||||
|
{ required: true, message: "链接名称不能为空", trigger: "blur" }, |
||||
|
], |
||||
|
affiliationCompanyName: [ |
||||
|
{ required: true, message: "所属公司不能为空", trigger: "blur" }, |
||||
|
] |
||||
|
} |
||||
|
}; |
||||
|
}, |
||||
|
created() { |
||||
|
this.getList(); |
||||
|
}, |
||||
|
methods: { |
||||
|
/** 查询link列表 */ |
||||
|
getList() { |
||||
|
this.loading = true; |
||||
|
listLink().then(response => { |
||||
|
this.linkList = response.list; |
||||
|
//this.total = response.total; |
||||
|
this.loading = false; |
||||
|
} |
||||
|
); |
||||
|
}, |
||||
|
// 筛选节点 |
||||
|
filterNode(value, data) { |
||||
|
if (!value) return true; |
||||
|
return data.label.indexOf(value) !== -1; |
||||
|
}, |
||||
|
// 取消按钮 |
||||
|
cancel() { |
||||
|
this.open = false; |
||||
|
this.reset(); |
||||
|
}, |
||||
|
// 表单重置 |
||||
|
reset() { |
||||
|
this.form = { |
||||
|
linkId : undefined, |
||||
|
linkName: undefined, |
||||
|
affiliationCompanyName: undefined |
||||
|
}; |
||||
|
this.resetForm("form"); |
||||
|
}, |
||||
|
/** 搜索按钮操作 */ |
||||
|
handleQuery() { |
||||
|
this.queryParams.pageNum = 1; |
||||
|
this.getList(); |
||||
|
}, |
||||
|
/** 重置按钮操作 */ |
||||
|
resetQuery() { |
||||
|
//this.dateRange = []; |
||||
|
//this.resetForm("queryForm"); |
||||
|
this.handleQuery(); |
||||
|
}, |
||||
|
// 多选框选中数据 |
||||
|
handleSelectionChange(selection) { |
||||
|
this.ids = selection.map(item => item.id); |
||||
|
this.single = selection.length != 1; |
||||
|
this.multiple = !selection.length; |
||||
|
}, |
||||
|
/** 新增按钮操作 */ |
||||
|
handleAdd() { |
||||
|
this.reset(); |
||||
|
this.open = true; |
||||
|
this.title = "添加链接"; |
||||
|
}, |
||||
|
/** 提交按钮 */ |
||||
|
submitForm: function() { |
||||
|
this.$refs["form"].validate(valid => { |
||||
|
if (valid) { |
||||
|
addLink(this.form).then(response => { |
||||
|
this.$modal.msgSuccess("新增成功"); |
||||
|
this.open = false; |
||||
|
this.getList(); |
||||
|
}); |
||||
|
// if (this.form.id != undefined) { |
||||
|
// editBanner(this.form).then(response => { |
||||
|
// this.$modal.msgSuccess("修改成功"); |
||||
|
// this.open = false; |
||||
|
// this.getList(); |
||||
|
// }); |
||||
|
// } else { |
||||
|
// addLink(this.form).then(response => { |
||||
|
// this.$modal.msgSuccess("新增成功"); |
||||
|
// this.open = false; |
||||
|
// this.getList(); |
||||
|
// }); |
||||
|
// } |
||||
|
} |
||||
|
}); |
||||
|
}, |
||||
|
} |
||||
|
}; |
||||
|
</script> |
||||
Loading…
Reference in new issue