Commit cc211273 by swl

feat: gx

parent becc8fc5
No preview for this file type
...@@ -15,6 +15,30 @@ export function applyReview(params) { ...@@ -15,6 +15,30 @@ export function applyReview(params) {
}) })
); );
} }
// 详情
export function applyDetail(params) {
return api(
Object.assign(formatParams("GET"), {
url: "/admin-api/living-circle/detail?shopId=" + params,
})
);
}
// 菜单
export function shopMenu() {
return api(
Object.assign(formatParams("GET"), {
url: "/admin-api/living-circle/menu",
})
);
}
// 启用|禁用
export function shopEnable(params) {
return api(
Object.assign(formatParams("POST", params), {
url: "/admin-api/living-circle/enable",
})
);
}
// 邻里互助--商家、居民申请列表 // 邻里互助--商家、居民申请列表
export function helpList(params) { export function helpList(params) {
return api( return api(
...@@ -31,6 +55,22 @@ export function helpReview(params) { ...@@ -31,6 +55,22 @@ export function helpReview(params) {
}) })
); );
} }
// 邻里互助--启用|禁用
export function helpEnable(params) {
return api(
Object.assign(formatParams("POST", params), {
url: "/admin-api/living-circle-mutual-aid/enable",
})
);
}
// 邻里互助--详情
export function helpDetail(params) {
return api(
Object.assign(formatParams("GET"), {
url: "/admin-api/living-circle-mutual-aid/comment?infoId=" + params,
})
);
}
// 类别 // 类别
export function categoryList() { export function categoryList() {
return api( return api(
...@@ -39,3 +79,81 @@ export function categoryList() { ...@@ -39,3 +79,81 @@ export function categoryList() {
}) })
); );
} }
// 类别列表
export function getCategory(params) {
return api(
Object.assign(formatParams("POST", params), {
url: "/admin-api/living-circle/categoryList",
})
);
}
// 类别新增
export function addCategory(params) {
return api(
Object.assign(formatParams("POST", params), {
url: "/admin-api/living-circle/addCategory",
})
);
}
// 类别编辑
export function editCategory(params) {
return api(
Object.assign(formatParams("POST", params), {
url: "/admin-api/living-circle/editCategory",
})
);
}
// 类别-启用|禁用
export function enableCategory(params) {
return api(
Object.assign(formatParams("POST", params), {
url: "/admin-api/living-circle/categoryEnable",
})
);
}
// 上传-图标
export function iconUpload(params) {
let header = {
"Content-Type": "multipart/form-data",
};
let formData = new FormData();
formData.append("file", params);
return api(
Object.assign(formatParams("POST", formData, header), {
url: `/admin-api/file/iconUpload`,
})
);
}
// 关键词列表
export function getKeyword(params) {
return api(
Object.assign(formatParams("POST", params), {
url: "/admin-api/living-circle/keywordList",
})
);
}
// 关键词新增
export function addKeyword(params) {
return api(
Object.assign(formatParams("POST", params), {
url: "/admin-api/living-circle/addKeyword",
})
);
}
// 关键词编辑
export function editKeyword(params) {
return api(
Object.assign(formatParams("POST", params), {
url: "/admin-api/living-circle/editKeyword",
})
);
}
// 关键词-启用|禁用
export function enableKeyword(params) {
return api(
Object.assign(formatParams("POST", params), {
url: "/admin-api/living-circle/keywordEnable",
})
);
}
const domain = { const domain = {
// dev: "http://192.168.3.87:8881", // 姚镇接口 // dev: "http://192.168.3.87:8881", // 姚镇接口
// dev: "http://81.69.231.72:8881", // 姚镇接口 dev: "http://81.69.231.72:8881", // 姚镇接口
// dev: "http://81.69.231.72:8881", // 测试接口 // dev: "http://81.69.231.72:8881", // 测试接口
dev: "https://exam.smart-zj.cn:9100/smartExam/", // 新正式接口 // dev: "https://exam.smart-zj.cn:9100/smartExam/", // 新正式接口
}; };
// 腾讯地图 key // 腾讯地图 key
const map = { const map = {
......
...@@ -296,10 +296,10 @@ const routes = [ ...@@ -296,10 +296,10 @@ const routes = [
}, },
// 便民生活圈 // 便民生活圈
{ {
path: "/livingCircle/serviceType", path: "/livingCircle/category",
name: "serviceType", name: "serviceType",
meta: ["服务类型管理"], meta: ["服务类型管理"],
component: () => import("@/views/livingCircle/serviceType.vue"), component: () => import("@/views/livingCircle/category.vue"),
}, },
{ {
path: "/livingCircle/searchTerms", path: "/livingCircle/searchTerms",
......
...@@ -5,9 +5,9 @@ import { TokenKey } from "@/utils/auth"; ...@@ -5,9 +5,9 @@ import { TokenKey } from "@/utils/auth";
const config = { const config = {
// proxy: "https://exam.smart-zj.cn:9100/exam/", // 新线上地址 // proxy: "https://exam.smart-zj.cn:9100/exam/", // 新线上地址
// proxy: "http://81.69.231.72:8881", // 测试地址 proxy: "http://81.69.231.72:8881", // 测试地址
// proxy: "http://192.168.3.87:8881", //本地 // proxy: "http://192.168.3.87:8881", //本地
proxy: "https://exam.smart-zj.cn:9100/smartExam", // 新正式接口zs // proxy: "https://exam.smart-zj.cn:9100/smartExam", // 新正式接口zs
// proxy: "http://81.69.231.72:9089/", // 测试地址 // proxy: "http://81.69.231.72:9089/", // 测试地址
// proxy1: "http://81.69.231.72:8881/admin-api", // 测试地址 // proxy1: "http://81.69.231.72:8881/admin-api", // 测试地址
// proxy1: "https://exam.smart-zj.cn:9100/smartExam/admin-api", // 新正式接口 // proxy1: "https://exam.smart-zj.cn:9100/smartExam/admin-api", // 新正式接口
......
<template>
<div>
<div class="search-wrapper">
<el-form
:inline="true"
:model="searchForm"
class="search_form"
style="text-align: left"
>
<el-form-item label="类型名称">
<el-input
clearable
v-model="searchForm.name"
placeholder="请输入类型名称"
></el-input>
</el-form-item>
<el-form-item label="类型">
<el-select
v-model="searchForm.menuId"
placeholder="请选择类型"
clearable
size="medium"
@change="init"
>
<el-option label="全部" value=""> </el-option>
<el-option
v-for="item in menuList"
:key="item.id"
:label="item.name"
:value="item.id"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="onSubmit">查询</el-button>
<el-button type="primary" @click="addHandle">新增</el-button>
</el-form-item>
</el-form>
</div>
<div class="table-wrapper">
<table-template
:tableData="tableData"
:tableColumns="tableColumns"
:loading="loading"
:pagination="pagination"
@Jump="jumpPage"
>
<el-table-column slot="iconUrl" label="图标" align="center">
<template slot-scope="scope">
<el-image
style="width: 30px; height: 30px"
:src="scope.row.iconUrl"
:preview-src-list="[scope.row.iconUrl]"
>
</el-image>
</template>
</el-table-column>
<el-table-column slot="delFlag" label="启用状态" align="center">
<template slot-scope="scope">
<el-tag
v-if="scope.row.delFlag == 0 || scope.row.delFlag == 1"
:type="
scope.row.delFlag == 1
? 'danger'
: scope.row.delFlag == 0
? 'success'
: ''
"
>{{ scope.row.delFlag == 1 ? "禁用" : "启用" }}</el-tag
>
</template>
</el-table-column>
<el-table-column fixed="right" label="操作" width="350" align="center">
<template slot-scope="scope">
<el-button
type="success"
size="mini"
class="btn"
round
@click="view(scope.row)"
>编辑</el-button
>
<el-button
@click="delFlagHandle(scope.row)"
:type="scope.row.delFlag == 0 ? 'danger' : 'success'"
size="mini"
round
slot="reference"
>{{ scope.row.delFlag == 0 ? "禁用" : "启用" }}
</el-button>
</template>
</el-table-column>
</table-template>
</div>
<el-dialog
:title="type == 'add' ? '新增' : '编辑'"
:visible.sync="dialogVisible"
width="30%"
>
<el-form
:model="dataForm"
:rules="rules"
ref="ruleForm"
label-width="100px"
class="demo-ruleForm"
>
<el-form-item label="名称" prop="name">
<el-input v-model="dataForm.name" clearable></el-input>
</el-form-item>
<el-form-item label="所属类型" prop="menuId">
<el-select
v-model="dataForm.menuId"
placeholder="请选择类型"
clearable
size="medium"
>
<el-option
v-for="item in menuList"
:key="item.id"
:label="item.name"
:value="item.id"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="排序" prop="sort">
<el-input-number v-model="dataForm.sort" :min="1"></el-input-number>
</el-form-item>
<el-form-item label="图标" prop="iconUrl">
<el-upload
class="avatar-uploader"
:show-file-list="false"
action="#"
:http-request="upload"
:before-upload="beforeUpload"
>
<img
v-if="dataForm.iconUrl"
:src="dataForm.iconUrl"
class="avatar"
/>
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
</el-upload>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false">取 消</el-button>
<el-button type="primary" @click="confirmHandle">确 定</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import {
getCategory,
shopMenu,
enableCategory,
iconUpload,
editCategory,
addCategory,
} from "@/api/livingCircle";
import TableTemplate from "@/components/Table";
export default {
components: { TableTemplate },
data() {
return {
type: "add",
searchForm: {},
menuList: [],
loading: false,
tableData: [],
tableColumns: [
{
key: "name",
label: "服务名称",
},
{
key: "menuName",
label: "所属菜单",
},
{
key: "createTime",
label: "创建时间",
},
{
key: "iconUrl",
label: "图标",
type: "slot",
},
{
key: "delFlag",
label: "启用状态",
type: "slot",
},
{
key: "sort",
label: "排序",
},
],
pagination: {
total: 0,
pageSize: 10,
currentPage: 1,
},
rules: {
name: [{ required: true, message: "请输入类型名称", trigger: "blur" }],
sort: [{ required: true, message: "请输入类型排序", trigger: "blur" }],
menuId: [
{ required: true, message: "请输入所属类型", trigger: "blur" },
],
iconUrl: [
{ required: true, message: "请输入类型图标", trigger: "blur" },
],
},
dataForm: {
name: "",
sort: 1,
iconUrl: "",
menuId: "",
id: "",
},
dialogVisible: false,
};
},
watch: {
dialogVisible(val) {
if (!val) {
this.dataForm = {
name: "",
sort: "",
iconUrl: "",
menuId: "",
id: "",
};
}
},
},
created() {
this.getMenu();
this.init();
},
methods: {
getMenu() {
shopMenu().then((res) => {
this.menuList = res.data;
});
},
beforeUpload() {},
upload(file) {
console.log("addCategory--->", 111);
iconUpload(file.file).then((res) => {
this.dataForm.iconUrl = res.data;
});
},
init() {
let params = {
menuId: this.searchForm.menuId,
name: this.searchForm.name,
pageNum: this.pagination.currentPage,
pageSize: this.pagination.pageSize,
};
getCategory(params).then((res) => {
this.tableData = res.data.list;
this.pagination.total = res.data.total;
});
},
delFlagHandle(row) {
enableCategory({
id: row.id,
}).then((res) => {
if (res.code == 200) {
this.$message.success("操作成功");
this.init();
}
});
},
onSubmit() {
this.init();
},
jumpPage() {
this.init();
},
view(row) {
this.type = "edit";
this.dialogVisible = true;
this.dataForm.sort = row.sort;
this.dataForm.name = row.name;
this.dataForm.iconUrl = row.iconUrl;
this.dataForm.menuId = row.menuId;
this.dataForm.id = row.id;
},
confirmHandle() {
this.$refs.ruleForm.validate((valid) => {
if (valid) {
if (this.dataForm.id) {
editCategory(this.dataForm).then((res) => {
if (res.code == 200) {
this.$message.success("编辑成功");
this.dialogVisible = false;
this.init();
}
});
} else {
addCategory(this.dataForm).then((res) => {
if (res.code == 200) {
this.$message.success("新增成功");
this.dialogVisible = false;
this.init();
}
});
}
} else {
return false;
}
});
},
addHandle() {
this.type = "add";
this.dialogVisible = true;
},
},
};
</script>
<style lang="stylus" scoped>
@import '~@/stylus/common';
.btn{
margin-right 10px
}
</style>
<style>
.avatar-uploader .el-upload {
border: 1px dashed #d9d9d9;
border-radius: 6px;
cursor: pointer;
position: relative;
overflow: hidden;
}
.avatar-uploader .el-upload:hover {
border-color: #409eff;
}
.avatar-uploader-icon {
font-size: 28px;
color: #8c939d;
width: 150px;
height: 150px;
line-height: 150px;
text-align: center;
}
.avatar {
width: 150px;
height: 150px;
display: block;
}
</style>
...@@ -9,12 +9,14 @@ ...@@ -9,12 +9,14 @@
> >
<el-form-item label="推荐搜索词"> <el-form-item label="推荐搜索词">
<el-input <el-input
v-model="searchForm.name" clearable
v-model="searchForm.keyword"
placeholder="请输入推荐搜索词" placeholder="请输入推荐搜索词"
></el-input> ></el-input>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" @click="onSubmit">查询</el-button> <el-button type="primary" @click="onSubmit">查询</el-button>
<el-button type="primary" @click="addHandle">新增</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
...@@ -36,6 +38,21 @@ ...@@ -36,6 +38,21 @@
</el-image> </el-image>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column slot="delFlag" label="启用状态" align="center">
<template slot-scope="scope">
<el-tag
v-if="scope.row.delFlag == 0 || scope.row.delFlag == 1"
:type="
scope.row.delFlag == 1
? 'danger'
: scope.row.delFlag == 0
? 'success'
: ''
"
>{{ scope.row.delFlag == 1 ? "禁用" : "启用" }}</el-tag
>
</template>
</el-table-column>
<el-table-column fixed="right" label="操作" width="350" align="center"> <el-table-column fixed="right" label="操作" width="350" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
...@@ -46,17 +63,24 @@ ...@@ -46,17 +63,24 @@
@click="view(scope.row)" @click="view(scope.row)"
>编辑</el-button >编辑</el-button
> >
<el-popconfirm title="确定删除此数据吗?" @confirm="del(scope.row)"> <el-button
<el-button type="warning" size="mini" round slot="reference" @click="delFlagHandle(scope.row)"
>删除</el-button :type="scope.row.delFlag == 0 ? 'danger' : 'success'"
> size="mini"
</el-popconfirm> round
slot="reference"
>{{ scope.row.delFlag == 0 ? "禁用" : "启用" }}
</el-button>
</template> </template>
</el-table-column> </el-table-column>
</table-template> </table-template>
</div> </div>
<el-dialog title="编辑" :visible.sync="dialogVisible" width="30%"> <el-dialog
:title="type == 'add' ? '新增' : '编辑'"
:visible.sync="dialogVisible"
width="30%"
>
<el-form <el-form
:model="dataForm" :model="dataForm"
:rules="rules" :rules="rules"
...@@ -64,16 +88,17 @@ ...@@ -64,16 +88,17 @@
label-width="100px" label-width="100px"
class="demo-ruleForm" class="demo-ruleForm"
> >
<el-form-item label="服务名称" prop="name"> <el-form-item label="推荐搜索词" prop="keyword">
<el-input v-model="dataForm.name"></el-input> <el-input v-model="dataForm.keyword" clearable></el-input>
</el-form-item>
<el-form-item label="排序" prop="sort">
<el-input-number v-model="dataForm.sort" :min="1"></el-input-number>
</el-form-item> </el-form-item>
</el-form> </el-form>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false">取 消</el-button> <el-button @click="dialogVisible = false">取 消</el-button>
<el-button type="primary" @click="dialogVisible = false" <el-button type="primary" @click="confirmHandle">确 定</el-button>
>确 定</el-button
>
</span> </span>
</el-dialog> </el-dialog>
</div> </div>
...@@ -81,27 +106,38 @@ ...@@ -81,27 +106,38 @@
<script> <script>
import TableTemplate from "@/components/Table"; import TableTemplate from "@/components/Table";
import {
getKeyword,
enableKeyword,
editKeyword,
addKeyword,
} from "@/api/livingCircle";
export default { export default {
components: { TableTemplate }, components: { TableTemplate },
data() { data() {
return { return {
searchForm: {}, type: "add", // 'add' or 'edit
dialogVisible: false,
searchForm: {
keyword: "",
},
TypeList: [], TypeList: [],
loading: false, loading: false,
tableData: [ tableData: [],
{
name: "便利店",
sort: "1",
},
],
tableColumns: [ tableColumns: [
{ {
key: "name", key: "keyword",
label: "推荐搜索词", label: "推荐搜索词",
}, },
{
key: "createTime",
label: "创建时间",
},
{
key: "delFlag",
label: "启用状态",
type: "slot",
},
{ {
key: "sort", key: "sort",
label: "排序", label: "排序",
...@@ -113,16 +149,24 @@ export default { ...@@ -113,16 +149,24 @@ export default {
currentPage: 1, currentPage: 1,
}, },
rules: { rules: {
name: [{ required: true, message: "请输入活动名称", trigger: "blur" }], keyword: [
{ required: true, message: "请输入推荐搜索词", trigger: "blur" },
],
sort: [{ required: true, message: "请输入排序", trigger: "blur" }],
},
dataForm: {
keyword: "",
sort: "",
}, },
dataForm: {},
dialogVisible: false,
}; };
}, },
watch: { watch: {
dialogVisible(val) { dialogVisible(val) {
if (!val) { if (!val) {
this.$refs.ruleForm.resetFields(); this.dataForm = {
keyword: "",
sort: "",
};
} }
}, },
}, },
...@@ -130,15 +174,67 @@ export default { ...@@ -130,15 +174,67 @@ export default {
this.init(); this.init();
}, },
methods: { methods: {
init() {}, init() {
onSubmit() {}, let params = {
keyword: this.searchForm.keyword,
pageSize: this.pagination.pageSize,
pageNum: this.pagination.currentPage,
};
getKeyword(params).then((res) => {
this.tableData = res.data.list;
});
},
onSubmit() {
this.init();
},
jumpPage() { jumpPage() {
this.init(); this.init();
}, },
view() { view(row) {
this.type = "edit";
this.dataForm.sort = row.sort;
this.dataForm.keyword = row.keyword;
this.dialogVisible = true; this.dialogVisible = true;
}, },
del() {}, delFlagHandle(row) {
enableKeyword({
id: row.id,
}).then((res) => {
if (res.code == 200) {
this.$message.success("操作成功");
this.init();
}
});
},
addHandle() {
this.type = "add";
this.dialogVisible = true;
},
confirmHandle() {
this.$refs.ruleForm.validate((valid) => {
if (valid) {
if (this.dataForm.id) {
editKeyword(this.dataForm).then((res) => {
if (res.code == 200) {
this.$message.success("编辑成功");
this.dialogVisible = false;
this.init();
}
});
} else {
addKeyword(this.dataForm).then((res) => {
if (res.code == 200) {
this.$message.success("新增成功");
this.dialogVisible = false;
this.init();
}
});
}
} else {
return false;
}
});
},
}, },
}; };
</script> </script>
......
<template>
<div>
<div class="search-wrapper">
<el-form
:inline="true"
:model="searchForm"
class="search_form"
style="text-align: left"
>
<el-form-item label="服务名称">
<el-input
v-model="searchForm.name"
placeholder="请输入服务名称"
></el-input>
</el-form-item>
<el-form-item label="服务类型">
<el-select
v-model="searchForm.typeId"
placeholder="请选择服务类型"
size="medium"
>
<el-option
v-for="item in TypeList"
:key="item.id"
:label="item.name"
:value="item.id"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="onSubmit">查询</el-button>
</el-form-item>
</el-form>
</div>
<div class="table-wrapper">
<table-template
:tableData="tableData"
:tableColumns="tableColumns"
:loading="loading"
:pagination="pagination"
@Jump="jumpPage"
>
<el-table-column slot="icon" label="服务图标" align="center">
<template slot-scope="scope">
<el-image
style="width: 30px; height: 30px"
:src="scope.row.icon"
:preview-src-list="[scope.row.icon]"
>
</el-image>
</template>
</el-table-column>
<el-table-column fixed="right" label="操作" width="350" align="center">
<template slot-scope="scope">
<el-button
type="success"
size="mini"
class="btn"
round
@click="view(scope.row)"
>编辑</el-button
>
<el-popconfirm title="确定删除此数据吗?" @confirm="del(scope.row)">
<el-button type="warning" size="mini" round slot="reference"
>删除</el-button
>
</el-popconfirm>
</template>
</el-table-column>
</table-template>
</div>
<el-dialog title="编辑" :visible.sync="dialogVisible" width="30%">
<el-form
:model="dataForm"
:rules="rules"
ref="ruleForm"
label-width="100px"
class="demo-ruleForm"
>
<el-form-item label="服务名称" prop="name">
<el-input v-model="dataForm.name"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false">取 消</el-button>
<el-button type="primary" @click="dialogVisible = false"
>确 定</el-button
>
</span>
</el-dialog>
</div>
</template>
<script>
import TableTemplate from "@/components/Table";
export default {
components: { TableTemplate },
data() {
return {
searchForm: {},
TypeList: [],
loading: false,
tableData: [
{
name: "服务名称",
type: "所属类型",
icon: require("@/assets/1.png"),
sort: "1",
},
],
tableColumns: [
{
key: "name",
label: "服务名称",
},
{
key: "type",
label: "所属类型",
},
{
key: "icon",
label: "服务图标",
type: "slot",
},
{
key: "sort",
label: "排序",
},
],
pagination: {
total: 0,
pageSize: 10,
currentPage: 1,
},
rules: {
name: [{ required: true, message: "请输入活动名称", trigger: "blur" }],
},
dataForm: {},
dialogVisible: false,
};
},
watch: {
dialogVisible(val) {
if (!val) {
this.$refs.ruleForm.resetFields();
}
},
},
created() {
this.init();
},
methods: {
init() {},
onSubmit() {},
jumpPage() {
this.init();
},
view() {
this.dialogVisible = true;
},
del() {},
},
};
</script>
<style lang="stylus" scoped>
@import '~@/stylus/common';
.btn{
margin-right 10px
}
</style>
const env = process.env.NODE_ENV === "production"; const env = process.env.NODE_ENV === "production";
const publicPath = env ? "/manage-h5/" : "/"; //正式 // const publicPath = env ? "/manage-h5/" : "/"; //正式
// const publicPath = env ? "/smartExam-h5/" : "/"; //测试 const publicPath = env ? "/smartExam-h5/" : "/"; //测试
module.exports = { module.exports = {
publicPath, publicPath,
......
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