This commit is contained in:
许gitee 2025-01-07 12:24:42 +08:00
parent 6c83e24432
commit d109e36539
19 changed files with 2013 additions and 307 deletions

View File

@ -20,24 +20,37 @@ const routes = [
{
path: '/home',
name: '首页',
component: () => import('../views/home/index')
},
{
path: '/welcome',
name: 'welcome',
component: () => import('../views/welcome/index')
component: () => import('../views/home/index'),
children:[
{
path: '/welcome',
name: 'welcome',
component: () => import('../views/welcome/index')
},
]
},
{
path: '/busines',
name: '商家',
component: () => import('../views/bigType/index'),
component: () => import('../views/business/index'),
},
{
path: '/businesVerify',
name: '审核商家',
component: () => import('../views/business/verify/index.vue'),
},
{
path: '/product',
name: '商品管理',
component: () => import('../views/product/index')
},
{
path: '/productCategory',
name: '商品分类',
component: () => import('../views/category/index')
},
{
path: '/user',
name: '用户',
@ -48,6 +61,11 @@ const routes = [
name: '美甲师',
component: () => import('../views/employee/index')
},
{
path: '/employeeVerify',
name: '审核美甲师',
component: () => import('../views/employee/verify/index.vue'),
},
{
path: '/modifyPassword',
name: '修改密码',
@ -58,6 +76,11 @@ const routes = [
name: '订单',
component: () => import('../views/order/index')
},
{
path: '/orderReservation',
name: '上门预约',
component: () => import('../views/order/reservation/index.vue')
},
{
path: '/personal',
name: '个人中心',
@ -68,6 +91,11 @@ const routes = [
name: '商家',
component: () => import('../views/business/index')
},
{
path: '/rating',
name: '评价列表',
component: () => import('../views/rating/index')
},
{
path: '/profile',
name: '详情',

View File

@ -4,8 +4,8 @@ import {request} from "axios";
//let baseUrl='http://localhost:8081/api/';
let baseUrl='http://154.8.193.216:1107/api/';
let baseUrl='http://localhost:8081/api/';
//let baseUrl='http://154.8.193.216:1107/api/';
// 创建axios实例
const httpService = axios.create({
// url前缀-'http:xxx.xxx'

View File

@ -7,10 +7,10 @@
<el-button type="button" :icon="Search" @click="initBusinessList">搜索</el-button>
<el-button type="primary" :icon="DocumentAdd" @click="handleAddDialogValue()" >添加商家</el-button>
<el-radio-group v-model="isCollapse" style="margin-bottom: 20px;margin-left: 20px">
<el-radio-button :value="true" @click="handleCollapse(true)">审核</el-radio-button>
<el-radio-button :value="false" @click="handleCollapse(false)">未审核</el-radio-button>
</el-radio-group>
<!-- <el-radio-group v-model="isCollapse" style="margin-bottom: 20px;margin-left: 20px">-->
<!-- <el-radio-button :value="true" @click="handleCollapse(true)">审核</el-radio-button>-->
<!-- <el-radio-button :value="false" @click="handleCollapse(false)">未审核</el-radio-button>-->
<!-- </el-radio-group>-->
</el-row>
<el-table :data="tableData" stripe style="width: 100%;" showOverflowTooltip>
<el-table-column prop="id" label="#ID" width="80" fixed="fixed" />
@ -97,17 +97,15 @@
import {Search,DocumentAdd,Edit} from '@element-plus/icons-vue'
import {ref, watch} from 'vue'
import axios from "@/util/axios";
import { ElNotification } from 'element-plus'
import Dialog from '@/views/business/dialog/index.vue'
import AddDialog from '@/views/business/addDialog/index.vue'
import UpdateDialog from '@/views/business/updateDialog/index.vue'
import axiosUtil from "@/util/axios";
import {ElMessage} from "element-plus";
import {useRouter} from "vue-router"
import {request} from "axios";
const isCollapse=ref();
import {useRouter} from "vue-router"
const isCollapse=ref(true);
const RCollapse=ref([]);
const LCollapse=ref([]);
const router=useRouter();

View File

@ -0,0 +1,227 @@
<template>
<el-card>
<el-row :gutter="20" class="header">
<el-col :span="7">
<el-input placeholder="请输入用户昵称..." clearable v-model="formPage.businessName"></el-input>
</el-col>
<el-button type="button" :icon="Search" @click="initBusinessList">搜索</el-button>
<!-- <el-radio-group v-model="isCollapse" style="margin-bottom: 20px;margin-left: 20px">-->
<!-- <el-radio-button :value="true" @click="handleCollapse(true)">审核</el-radio-button>-->
<!-- <el-radio-button :value="false" @click="handleCollapse(false)">未审核</el-radio-button>-->
<!-- </el-radio-group>-->
</el-row>
<el-table :data="tableData" stripe style="width: 100%;" showOverflowTooltip>
<el-table-column prop="id" label="#ID" width="80" fixed="fixed" />
<el-table-column prop="businessName" label="商家昵称" width="200" />
<el-table-column prop="businessAvatar" label="头像" width="150" >
<template v-slot="scope">
<el-popover
placement="right-start"
:width="200"
trigger="hover"
:content="scope.row.businessAvatar"
>
<template #reference>
<img :src="scope.row.businessAvatar" width="50" height="50"/>
</template>
</el-popover>
</template>
</el-table-column>
<el-table-column prop="businessPhone" label="电话号码" width="120" />
<el-table-column prop="state" label="状态" width="80">
<template v-slot="scope">
<div v-if="scope.row.state===0" style="color: red">
禁用
</div>
<div style="color: lawngreen" v-else>
启用
</div>
</template>
</el-table-column>
<el-table-column prop="storeStatus" label="店铺状态" width="80">
<template v-slot="scope">
<div v-if="scope.row.storeStatus===0" style="color: red">
休业
</div>
<div style="color: lawngreen" v-else>
营业
</div>
</template>
</el-table-column>
<el-table-column prop="createTime" label="注册日期" width="200"/>
<el-table-column prop="updateTime" label="最后登录日期" width="200"/>
<el-table-column prop="action" fixed="right" label="操作" min-width="120" >
<template v-slot="scope" >
<el-button type="primary" size="small" @click="handleClick(scope.row.id)">审核</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
v-model:currentPage="formPage.current"
v-model:page-size="formPage.pageSize"
:page-sizes="[10, 20, 30, 40,50]"
layout="total, sizes, prev, pager, next, jumper"
:total="total"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
/>
</el-card>
<Dialog v-model="BdialogVisible" :bussinessId="bussinessId" :dialogTitle="dialogTitle"
@initBusinessList="initBusinessList"></Dialog>
<AddDialog v-model="BdialogaddVisible" :dialogTitle="dialogTitle"
@initBusinessList="initBusinessList"></AddDialog>
<UpdateDialog v-model="BdialogUpdateVisible" :bussinessId="bussinessId" :dialogTitle="dialogTitle"
@initBusinessList="initBusinessList"></UpdateDialog>
</template>
<script setup>
import {Search,DocumentAdd,Edit} from '@element-plus/icons-vue'
import {ref, watch} from 'vue'
import axios from "@/util/axios";
import { ElNotification } from 'element-plus'
import Dialog from '@/views/business/dialog/index.vue'
import AddDialog from '@/views/business/addDialog/index.vue'
import UpdateDialog from '@/views/business/updateDialog/index.vue'
import axiosUtil from "@/util/axios";
import {ElMessage} from "element-plus";
import {useRouter} from "vue-router"
import {request} from "axios";
const isCollapse=ref(false);
const RCollapse=ref([]);
const LCollapse=ref([]);
const router=useRouter();
const bussinessId=ref('')
const dialogTitle=ref('');
const BdialogaddVisible=ref(false)
const BdialogVisible=ref(false)
const BdialogUpdateVisible=ref(false)
const handleClick=(id)=>{
bussinessId.value=id;
// console.log(bussinessId.value)
dialogTitle.value="审核商家"
BdialogVisible.value=true
}
const handleRouter=(temp)=>{
console.log(temp.id)
router.push({path:'/product',query:{product: JSON.stringify(temp)}})
}
const formPage=ref({
businessName:'',
current:1,
pageSize:10
})
// watch(formPage.value.businessName,()=>{
// // console.log(id.value)
// initBusinessList();
// })
const total=ref(0)
const tableData =ref([])
const handleCollapse=async (temp)=>{
console.log(temp)
const res=await axios.post("business/list");
RCollapse.value.splice(0,RCollapse.value.length);
LCollapse.value.splice(0,LCollapse.value.length);
// console.log(res.data.data.records)
tableData.value=res.data.data;
tableData.value.forEach(item => {
if(item.state){
RCollapse.value.push(item)
}
else{
LCollapse.value.push(item)
}
//console.log(item.state);
});
console.log("RCollapse"+RCollapse.value);
console.log("LCollapse"+LCollapse.value);
if (temp){
tableData.value=RCollapse.value
total.value=Number(RCollapse.value.length);
}else {
tableData.value=LCollapse.value
total.value=Number(LCollapse.value.length);
}
}
const initBusinessList=async()=>{
// console.log(formPage.value)
const res=await axios.post("business/list/page",formPage.value);
// console.log(res.data.data.records)
isCollapse.value=undefined;
tableData.value=res.data.data.records;
total.value=Number(res.data.data.total);
}
// const initBusinessList=async()=>{
//
// if(!id.value)
// {
// const res=await axios.post("business/list/page",formPage.value);
// // console.log(res.data.data.records)
// tableData.value=res.data.data.records;
// // console.log(res.data.data.total)
// total.value=res.data.data.records.length;
// }
// else{
// const res=await axios.post("business/list/page", {businessName:id.value});
// // console.log(res.data.data)
// //const temp=[];
// // temp.push(res.data.data)
// tableData.value=res.data.data.records;
// total.value=res.data.data.records.length;
// }
//
// }
handleCollapse();
const handleSizeChange = (pageSize) => {
formPage.value.current=1;
formPage.value.pageSize=pageSize;
initBusinessList();
}
const handleCurrentChange = (pageNum) => {
formPage.value.current=pageNum;
initBusinessList();
}
</script>
<style lang="scss" scoped>
.header{
padding-bottom: 16px;
box-sizing: border-box;
}
.el-pagination{
padding-top: 15px;
box-sizing: border-box;
}
</style>

View File

@ -0,0 +1,110 @@
<template>
<el-dialog
model-value="dialogaddVisible"
:title="dialogTitle"
width="30%"
@close="handleClose"
>
<el-form
ref="formRef"
:model="form"
label-width="100px"
>
<el-form-item label="门店头像" prop="avatarUrl">
<el-upload list-type="picture-card" limit="1" :auto-upload="false" drag action="#">
<el-icon><Plus /></el-icon>
<template #tip>
<div class="el-upload__tip">
最多传一张
</div>
</template>
</el-upload>
</el-form-item>
<el-form-item label="用户昵称" prop="username">
<el-input v-model="form.username" />
</el-form-item>
<el-form-item label="用户账号" prop="userAccount">
<el-input v-model="form.userAccount" />
</el-form-item>
<el-form-item label="用户密码" prop="userPassword">
<el-input v-model="form.userPassword" show-password />
</el-form-item>
</el-form>
<template #footer>
<span class="dialog-footer">
<el-button @click="handleClose">取消</el-button>
<el-button type="primary" @click="handleConfirm">确认</el-button>
</span>
</template>
</el-dialog>
</template>
<script setup>
import {defineEmits, defineProps, ref, watch} from "vue";
import axios from "@/util/axios";
import { ElMessage } from "element-plus";
import { Delete, Download, Plus, ZoomIn } from '@element-plus/icons-vue'
const props=defineProps({
dialogTitle:{
type:String,
default:'',
required:true
}
})
const form=ref({
avatarUrl:'',
userAccount:'',
userPassword:'',
username:null
})
// const rules=ref({
// name: [
// {
// required: true,
// message: ''
// }
// ],
// remark: [
// {
// required: true,
// message: ''
// }
// ]
// })
const formRef=ref(null);
//
const emits=defineEmits(['update:modelValue','initUserList'])
const handleClose=()=>{
console.log("用户添加关闭xxx")
//
emits('update:modelValue',false)
}
const handleConfirm=()=>{
formRef.value.validate(async(valid)=>{
if(valid){
let result=await axios.post("user/add",form.value)
console.log(result.data)
let data=result.data;
if(data.code==0){
ElMessage.success("执行添加成功!");
formRef.value.resetFields();
emits("initUserList");
handleClose();
}else{
ElMessage.error(data.description);
}
}else{
console.log("fail")
return false
}
})
}
</script>
<style scoped>
</style>

View File

@ -0,0 +1,148 @@
<template>
<el-dialog
model-value="dialogVisible"
:title="dialogTitle"
width="30%"
@close="handleClose"
>
<el-form
ref="formRef"
:model="form"
:rules="rules"
label-width="100px"
>
<el-form-item label="用户头像" prop="avatarUrl">
<img :src="form.avatarUrl" alt="空" width="50" height="50"/>
</el-form-item>
<el-form-item label="用户昵称" prop="username">
{{form.username}}
</el-form-item>
<el-form-item label="用户账号" prop="userAccount">
{{form.userAccount}}
</el-form-item>
<el-form-item label="性别" prop="gender">
<template v-if="form.gender==0"></template>
<template v-else></template>
</el-form-item>
<el-form-item label="电话" prop="phone">
{{form.phone}}
</el-form-item>
<el-form-item label="邮箱" prop="email">
{{form.email}}
</el-form-item>
<el-form-item label="用户状态" prop="userStatus">
<template v-if="form.userStatus==0">禁用</template>
<template v-else>启用</template>
</el-form-item>
<el-form-item label="用户角色" prop="userRole">
<template v-if="form.userRole===0">普通用户</template>
<template v-else-if="form.userRole===1">管理员</template>
<template v-else-if="form.userRole===2">商家</template>
<template v-else>美甲师</template>
</el-form-item>
</el-form>
<!-- <template #footer>-->
<!--<span class="dialog-footer">-->
<!--<el-button @click="handleClose">取消</el-button>-->
<!--<el-button type="primary" @click="handleConfirm">确认</el-button>-->
<!--</span>-->
<!-- </template>-->
</el-dialog>
</template>
<script setup>
import {defineEmits, defineProps, ref, watch} from "vue";
import axios from "@/util/axios";
import { ElMessage } from "element-plus";
const props=defineProps({
id:{
type:String,
default:-1,
required:true
},
dialogTitle:{
type:String,
default:'',
required:true
}
})
const form=ref({
id: "",
businessId: "",
userId: "",
manicuristId: "",
orderId: "",
rating: null,
manicuristRating: null,
review: "",
businessReview: null,
createTime: ""
})
// const rules=ref({
// name: [
// {
// required: true,
// message: ''
// }
// ],
// remark: [
// {
// required: true,
// message: ''
// }
// ]
// })
const formRef=ref(null);
const initFormData=async(ids)=>{
// console.log(ids)
const res=await axios.get("user/getById",{id: ids})
// console.log(res.data.data)
form.value=res.data.data;
}
watch(
()=>props.id,
()=>{
//console.log("id="+props.id);
let ids=props.id;
initFormData(ids)
// }else{
// formRef.value.resetFields();
// form.value={
// id:-1,
// name:"",
// remark:""
// }
// }
}
)
//
const emits=defineEmits(['update:modelValue','initUserList'])
const handleClose=()=>{
console.log("xxx")
//
emits('update:modelValue',false)
}
// const handleConfirm=()=>{
// formRef.value.validate(async(valid)=>{
// if(valid){
// let result=await axios.post("admin/bigType/save",form.value)
// let data=result.data;
// if(data.code==0){
// ElMessage.success("");
// formRef.value.resetFields();
// emits("initUserList");
// handleClose();
// }else{
// ElMessage.error(data.msg);
// }
// }else{
// console.log("fail")
// return false
// }
// })
// }
</script>
<style scoped>
</style>

View File

@ -0,0 +1,170 @@
<template>
<el-card>
<el-row :gutter="20" class="header">
<el-col :span="7">
<el-input placeholder="请输入用户昵称..." clearable v-model="queryForm.username"></el-input>
</el-col>
<el-button type="button" :icon="Search" @click="initRatingList" >搜索</el-button>
<el-button type="primary" :icon="DocumentAdd" @click="handleAddDialogValue()" >添加评论</el-button>
</el-row>
<el-table :data="tableData" stripe style="width: 100%;" showOverflowTooltip>
<el-table-column fixed prop="id" label="#ID" width="80" />
<el-table-column prop="businessId" label="商家id" width="80" />
<el-table-column prop="userId" label="用户id" width="80" />
<el-table-column prop="manicuristId" label="美甲师id" width="80" />
<el-table-column prop="orderId" label="订单id" width="80" />
<el-table-column prop="rating" label="评分" width="80" />
<el-table-column prop="review" label="评论" width="200" />
<el-table-column prop="businessReview" label="商家评论" width="200" />
<el-table-column prop="createTime" label="注册日期" width="200"/>
<el-table-column prop="action" fixed="right" label="操作" min-width="170">
<template v-slot="scope" >
<el-button type="success" size="small" @click="handleDialogValue(scope.row.id)">
详情
</el-button>
<el-button type="primary" size="small" :icon="Edit" @click="handleUpdateDialogValue(scope.row.id)"></el-button>
<el-button type="danger" size="small" :icon="Delete" @click="handleDelete(scope.row.id)"></el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
v-model:currentPage="queryForm.current"
v-model:page-size="queryForm.pageSize"
:page-sizes="[10, 20, 30, 40,50]"
layout="total, sizes, prev, pager, next, jumper"
:total="total"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
/>
<!-- {{total}}-->
</el-card>
<Dialog v-model="UdialogVisible" :id="id" :dialogTitle="dialogTitle"
@initUserList="initUserList"></Dialog>
<AddDialog v-model="UdialogaddVisible" :dialogTitle="dialogTitle"
@initUserList="initUserList"></AddDialog>
<UpdateDialog v-model="UdialogUpdateVisible" :id="id" :dialogTitle="dialogTitle"
@initUserList="initUserList"></UpdateDialog>
</template>
<script setup>
import {Search,Delete,Edit,DocumentAdd,Close,Check} from '@element-plus/icons-vue'
import {ref, watch} from 'vue'
import axios from "@/util/axios";
import Dialog from '@/views/user/dialog/index.vue'
import AddDialog from '@/views/user/addDialog/index.vue'
import UpdateDialog from '@/views/user/updateDialog/index.vue'
import { ElMessage,ElMessageBox } from "element-plus";
import {parseTime} from "element-plus/es/components/time-select/src/utils";
const queryForm=ref({
username: '',
current:1,
pageSize:10
})
// const id=ref('')
// const dialogTitle=ref('');
// const UdialogaddVisible=ref(false)
// const UdialogVisible=ref(false)
// const UdialogUpdateVisible=ref(false)
// const handleDialogValue=(ids)=>{
// id.value=ids;
// dialogTitle.value=""
// UdialogVisible.value=true
// }
//
// const handleUpdateDialogValue=(ids)=>{
// id.value=ids;
// dialogTitle.value=""
// UdialogUpdateVisible.value=true
// }
//
// const handleAddDialogValue=()=>{
// dialogTitle.value=""
// UdialogaddVisible.value=true
// }
//
const handleDelete=(ids)=>{
// console.log(id)
ElMessageBox.confirm(
'您确定要删除这条记录吗?',
'系统提示',
{
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}
)
.then(async() => {
let res=await axios.post('level/delete',{id:ids})
if(res.data.code==0){
ElMessage({
type: 'success',
message: '删除成功',
})
initSmallTypeList();
}else{
ElMessage({
type: 'error',
message: res.data.description,
})
}
})
.catch(() => {
})
// initUserList();
}
const total=ref(0)
const tableData =ref([])
const initRatingList=async()=>{
const res = await axios.post("level/list");
console.log(res.data.data)
if (res.data.data) {
tableData.value = res.data.data;
//console.log(res.data.data)
total.value = Number(res.data.data.length);
}
else{
ElMessage.error(res.data.description);
}
}
initRatingList();
const handleSizeChange = (pageSize) => {
queryForm.value.current=1;
queryForm.value.pageSize=pageSize;
initRatingList();
}
const handleCurrentChange = (current1) => {
queryForm.value.current=current1;
initRatingList();
}
</script>
<style lang="scss" scoped>
.header{
padding-bottom: 16px;
box-sizing: border-box;
}
.el-pagination{
padding-top: 15px;
box-sizing: border-box;
}
</style>

View File

@ -0,0 +1,171 @@
<template>
<el-dialog
model-value="dialogUpdateVisible"
:title="dialogTitle"
width="30%"
@close="handleClose"
>
<el-form
ref="formRef"
:model="form"
label-width="100px"
>
<el-form-item label="用户头像" prop="avatarUrl">
<!-- {{ form.avatarUrl }}-->
<el-input v-model="form.avatarUrl"/>
</el-form-item>
<el-form-item label="用户昵称" prop="username">
<el-input v-model="form.username"/>
</el-form-item>
<el-form-item label="用户ID" prop="id">
<el-input v-model="form.id"/>
</el-form-item>
<el-form-item label="性别" prop="gender">
<template v-if="form.gender==0"></template>
<template v-else></template>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<el-radio-group v-model="form.gender">
<el-radio :value="0" size="default"></el-radio>
<el-radio :value="1" size="default"></el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="电话" prop="phone">
<el-input v-model="form.phone"/>
</el-form-item>
<el-form-item label="邮箱" prop="email">
<el-input v-model="form.email"/>
</el-form-item>
<el-form-item label="用户状态" prop="userStatus">
<el-input v-model="form.userStatus"/>
</el-form-item>
<el-form-item label="用户角色" prop="userRole">
<!-- {{form.userRole}}-->
<!-- {{labelt}}-->
<!-- 展示由于v-model绑定出现v-model的form.userRole的值-->
<el-select
v-model="form.userRole"
size="default"
placeholder="用户角色"
style="width: 100%"
>
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
</el-form>
<template #footer>
<span class="dialog-footer">
<el-button @click="handleClose">取消</el-button>
<el-button type="primary" @click="handleConfirm">确认</el-button>
</span>
</template>
</el-dialog>
</template>
<script setup>
import {defineEmits, defineProps, ref, watch} from "vue";
import axios from "@/util/axios";
import {ElMessage} from "element-plus";
const props = defineProps({
id: {
type: String,
default: -1,
required: true
},
dialogTitle: {
type: String,
default: '',
required: true
}
})
const labelt=ref('')
const form = ref({
id:null,
avatarUrl: "",
email: "",
gender: null,
phone: null,
userRole: null,
userStatus: null,
username: ""
})
const options = [
{
value: '',
label: '用户身份',
},
{
value: '0',
label: '普通用户',
},
{
value: '1',
label: '管理员',
},
{
value: '2',
label: '商家',
},
{
value: '3',
label: '美甲师',
},
]
const formRef = ref(null);
const initFormData = async (ids) => {
const res = await axios.get("user/getById", {id: ids})
form.value = res.data.data;
labelt.value=options[form.value.userRole].label
// console.log(options[form.value.userRole].label)
}
watch(
() => props.id,
() => {
// console.log("id=" + props.useraccount);
let ids = props.id;
initFormData(ids)
}
)
//
const emits = defineEmits(['update:modelValue', 'initUserList'])
const handleClose = () => {
console.log("xxx")
//
emits('update:modelValue', false)
}
const handleConfirm = () => {
formRef.value.validate(async (valid) => {
if (valid) {
let result = await axios.post("user/update", form.value)
let data = result.data;
if (data.code == 0) {
ElMessage.success("执行成功!");
formRef.value.resetFields();
emits("initUserList");
handleClose();
} else {
ElMessage.error(data.description);
}
} else {
console.log("fail")
return false
}
})
}
</script>
<style scoped>
</style>

View File

@ -8,7 +8,6 @@
<el-form
ref="formRef"
:model="form"
:rules="rules"
label-width="100px"
>
<el-form-item label="头像" prop="manicuristAvatar">
@ -41,7 +40,12 @@
{{form.salary}}
</el-form-item>
</el-form>
<template #footer v-if="title">
<span class="dialog-footer">
<el-button @click="handleClose">取消</el-button>
<el-button type="primary" @click="handleConfirm">审核成功</el-button>
</span>
</template>
</el-dialog>
</template>
<script setup>
@ -65,20 +69,17 @@ const form=ref({
email: "",
gender: null,
phone: "",
userId:"",
businessId: "",
manicuristName: "",
employment_date: "",
specialties: "",
rating: null,
salary: null,
isDelete: null,
createTime: "",
updateTime: "",
manicuristAvatar: "",
manStatus: null
auditStatus:null,
manicuristAvatar: ""
})
const title=ref(false);
const formRef=ref(null);
const initFormData=async(id)=>{
@ -90,6 +91,9 @@ watch(
()=>props.id,
()=>{
//console.log("id="+props.id);
if (props.dialogTitle=='审核美甲师'){
title.value=true;
}
let id=props.id;
initFormData(id)
@ -97,13 +101,36 @@ watch(
}
)
//
const emits=defineEmits(['update:modelValue','initEmployeeList'])
const emits=defineEmits(['update:modelValue','handleCollapse'])
const handleClose=()=>{
console.log("xxx")
//
emits('update:modelValue',false)
}
const handleConfirm = () => {
form.value.auditStatus=1
formRef.value.validate(async (valid) => {
if (valid) {
let result = await axios.post("manicurist/update", form.value)
console.log(result.data.data)
let data = result.data;
if (data.code == 0) {
ElMessage.success("执行成功!");
formRef.value.resetFields();
emits("handleCollapse");
handleClose();
} else {
ElMessage.error(data.description);
}
} else {
console.log("fail")
return false
}
})
}
</script>
<style scoped>
</style>

View File

@ -0,0 +1,174 @@
<template>
<el-card>
<el-row :gutter="20" class="header">
<el-col :span="7">
<el-input placeholder="请输入用户昵称..." clearable v-model="formPage.businessName"></el-input>
</el-col>
<el-button type="button" :icon="Search" @click="initEmployeeList">搜索</el-button>
<!-- <el-radio-group v-model="isCollapse" style="margin-bottom: 20px;margin-left: 20px">-->
<!-- <el-radio-button :value="true" @click="handleCollapse(true)">审核</el-radio-button>-->
<!-- <el-radio-button :value="false" @click="handleCollapse(false)">未审核</el-radio-button>-->
<!-- </el-radio-group>-->
</el-row>
<el-table :data="tableData" stripe style="width: 100%;" showOverflowTooltip>
<el-table-column prop="id" label="#ID" width="80" />
<el-table-column prop="manicuristName" label="用户昵称" width="200" />
<el-table-column prop="manicuristAvatar" label="头像" width="200">
<template v-slot="scope">
<img :src="scope.row.manicuristAvatar" width="50" height="50"/>
</template>
</el-table-column>
<el-table-column prop="rating" label="评分" width="200px">
<template v-slot="scope" style="height: 100px">
<div class="demo-rate-block">
<el-rate v-model="scope.row.rating" :colors="colors"/>
{{scope.row.rating}}
</div>
</template>
</el-table-column>
<el-table-column prop="salary" label="余额" />
<el-table-column prop="createTime" label="注册日期" width="200"/>
<el-table-column prop="updateTime" label="最后登录日期" width="200"/>
<el-table-column prop="action" fixed="right" label="操作" min-width="120" >
<template v-slot="scope" >
<el-button type="primary" size="small" @click="handleDialogValue(scope.row.id)">审核认证</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
v-model:currentPage="formPage.current"
v-model:page-size="formPage.pageSize"
:page-sizes="[10, 20, 30, 40,50]"
layout="total, sizes, prev, pager, next, jumper"
:total="total"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
/>
</el-card>
<Dialog v-model="edialogVisible" :id="id" :dialogTitle="dialogTitle"
@handleCollapse="handleCollapse"></Dialog>
</template>
<script setup>
import {Search,DocumentAdd,Edit} from '@element-plus/icons-vue'
import {ref, watch} from 'vue'
import axios from "@/util/axios";
import { ElNotification } from 'element-plus'
import Dialog from '@/views/employee/dialog/index.vue'
import axiosUtil from "@/util/axios";
import {ElMessage} from "element-plus";
import {useRouter} from "vue-router"
import {request} from "axios";
const RCollapse=ref([]);
const LCollapse=ref([]);
const router=useRouter();
const id=ref('')
const dialogTitle=ref('');
const edialogVisible=ref(false)
const query=ref();
const handleDialogValue=(ids)=>{
id.value=ids;
dialogTitle.value="审核美甲师"
edialogVisible.value=true
}
const formPage=ref({
businessName:'',
current:1,
pageSize:10
})
const total=ref(0)
const tableData =ref([])
const handleCollapse=async (temp)=>{
console.log(temp)
const res=await axios.post("manicurist/queryAll");
RCollapse.value.splice(0,RCollapse.value.length);
LCollapse.value.splice(0,LCollapse.value.length);
// console.log(res.data.data.records)
tableData.value=res.data.data;
tableData.value.forEach(item => {
if(item.auditStatus){
RCollapse.value.push(item)
}
else{
LCollapse.value.push(item)
}
//console.log(item.state);
});
console.log("RCollapse"+RCollapse.value);
console.log("LCollapse"+LCollapse.value);
if (temp){
tableData.value=RCollapse.value
total.value=Number(RCollapse.value.length);
}else {
tableData.value=LCollapse.value
total.value=Number(LCollapse.value.length);
}
}
const initEmployeeList=async()=>{
if (!query.value){
const res=await axios.post("manicurist/queryAll");
// console.log(res.data)
tableData.value=res.data.data;
total.value=res.data.data.length;
}else{
const res = await axios.get("manicurist/queryById", {manicuristId: query.value});
// console.log(res.data)
const temp = []
temp.push(res.data.data)
tableData.value = temp;
total.value = 1;
}
}
handleCollapse();
const handleSizeChange = (pageSize) => {
formPage.value.current=1;
formPage.value.pageSize=pageSize;
initBusinessList();
}
const handleCurrentChange = (pageNum) => {
formPage.value.current=pageNum;
initBusinessList();
}
</script>
<style lang="scss" scoped>
.header{
padding-bottom: 16px;
box-sizing: border-box;
}
.el-pagination{
padding-top: 15px;
box-sizing: border-box;
}
</style>

View File

@ -1,13 +1,14 @@
<template>
<el-breadcrumb separator="/">
<el-breadcrumb-item v-for="(item,index) in breadcrumbList" :key="index">
<span class="redirect" v-if="item.name=='详情'||item.name=='商品管理'" @click="handleRedirectBack(item.name)">返回上一级</span>
<span class="no-redirect" v-else-if="index==breadcrumbList.length-1" >{{ item.name }}</span>
<!-- <span class="redirect" v-if="item.name=='详情'||item.name=='商品管理'" @click="handleRedirectBack(item.name)">返回上一级</span>-->
<span class="no-redirect" v-if="index==breadcrumbList.length-1" >{{ item.name }}</span>
<span class="redirect" v-else @click="handleRedirect(item.path)">{{ item.name }}</span>
<!-- <span class="redirect" v-else @click="handleRedirectBack">返回上一级</span>-->
</el-breadcrumb-item>
</el-breadcrumb>
</template>
<script setup>
import {ref, watch} from 'vue'
@ -15,7 +16,7 @@ import {useRoute, useRouter} from 'vue-router'
const route = useRoute();
const router = useRouter();
// console.log(route.matched)
const breadcrumbList = ref([]);
const handleRedirectBack=(name)=>{
@ -37,6 +38,8 @@ const initBreadcrumbList = () => {
}
watch(route, () => {
initBreadcrumbList();
console.log(route.matched)
//console.log("breadcrumbList"+JSON.stringify(breadcrumbList))
}, {deep: true, immediate: true})
</script>
<style lang="scss" scoped>

View File

@ -21,7 +21,7 @@
<!-- </el-menu-item>-->
<el-menu-item index="user">
<el-icon><user /></el-icon>
<span>用户管理</span>
<span >用户管理</span>
</el-menu-item>
<el-sub-menu index="3">
<template #title >
@ -30,22 +30,83 @@
</template>
<el-menu-item index="business">
<el-icon><management /></el-icon>
<span>商家</span>
<span>商家列表</span>
</el-menu-item>
<el-menu-item index="businesVerify" >
<el-icon><management /></el-icon>
<span>审核商家入驻</span>
</el-menu-item>
</el-sub-menu>
<el-sub-menu index="6">
<template #title >
<el-icon><management /></el-icon>
<span>商品管理</span>
</template>
<el-menu-item >
<el-icon><management /></el-icon>
<span>商品分类</span>
</el-menu-item>
<el-menu-item index="product">
<el-icon><management /></el-icon>
<span>商品管理</span>
<span>商品列表</span>
</el-menu-item>
</el-sub-menu>
<el-sub-menu index="8">
<template #title >
<el-icon><tickets /></el-icon>
<span>美甲师管理</span>
</template>
<el-menu-item index="employeeVerify">
<el-icon><management /></el-icon>
<span>审核美甲师认证</span>
</el-menu-item>
<el-menu-item index="employee">
<el-icon><tickets /></el-icon>
<span>美甲师列表</span>
</el-menu-item>
</el-sub-menu>
<el-menu-item index="employee">
<el-icon><tickets /></el-icon>
<span>美甲师管理</span>
</el-menu-item>
<el-menu-item index="order">
<el-icon><tickets /></el-icon>
<span>订单管理</span>
</el-menu-item>
<el-sub-menu index="9">
<template #title >
<el-icon><management /></el-icon>
<span>订单管理</span>
</template>
<el-menu-item index="orderReservation">
<el-icon><tickets /></el-icon>
<span>上门预约</span>
</el-menu-item>
<el-menu-item >
<el-icon><tickets /></el-icon>
<span>到店服务</span>
</el-menu-item>
<el-menu-item index="order">
<el-icon><tickets /></el-icon>
<span>订单列表</span>
</el-menu-item>
</el-sub-menu>
<el-sub-menu index="10">
<template #title >
<el-icon><management /></el-icon>
<span>评价管理</span>
</template>
<el-menu-item >
<el-icon><tickets /></el-icon>
<span>权限操作</span>
</el-menu-item>
<el-menu-item >
<el-icon><tickets /></el-icon>
<span>星级评优</span>
</el-menu-item>
<el-menu-item index="rating">
<el-icon><tickets /></el-icon>
<span>评价列表</span>
</el-menu-item>
</el-sub-menu>
<el-sub-menu index="11">
<template #title >
<el-icon><management /></el-icon>

View File

@ -36,7 +36,7 @@ import {ElMessage} from "element-plus";
import router from "@/router";
const form = ref({
userAccount: 'root',
userAccount: 'root2',
userPassword: '12345678'
});

View File

@ -0,0 +1,190 @@
<template>
<el-card>
<el-row :gutter="20" class="header">
<el-col :span="7">
<el-input placeholder="请输入订单号..." clearable v-model="queryForm.orderNumber"></el-input>
</el-col>
<el-button type="button" :icon="Search" @click="initOrderList">搜索</el-button>
</el-row>
<el-table :data="tableData" stripe style="width: 100%" showOverflowTooltip>
<el-table-column prop="orderNumber" label="订单号" width="220" fixed/>
<el-table-column prop="userName" label="用户昵称" width="200"/>
<el-table-column prop="totalPrice" label="订单总价" width="100"/>
<el-table-column prop="paymentStatus" label="订单状态" width="100"/>
<el-table-column prop="createTime" label="订单创建日期" width="200"/>
<el-table-column prop="updateTime" label="订单支付日期" width="200"/>
<el-table-column prop="userName" label="收货人" width="80"/>
<el-table-column prop="phone" label="联系电话" width="150"/>
<el-table-column prop="notes" label="描述" width="400"/>
<!-- <el-table-column label="操作" width="300" fixed="right">-->
<!-- <template v-slot="scope">-->
<!-- <el-button type="success" @click="handleDialogValue(scope.row.id)">详情</el-button>-->
<!-- <el-button type="primary" @click="handleOrderStatus(scope.row.id,2)">发货</el-button>-->
<!-- <el-button type="primary" @click="handleOrderStatus(scope.row.id,3)">退货</el-button>-->
<!-- <el-button type="danger" :icon="Delete" @click="handleDelete(scope.row.id)"></el-button>-->
<!-- </template>-->
<!-- </el-table-column>-->
</el-table>
<el-pagination
v-model:currentPage="queryForm.current"
v-model:page-size="queryForm.pageSize"
:page-sizes="[10, 20, 30, 40,50]"
layout="total, sizes, prev, pager, next, jumper"
:total="total"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
/>
</el-card>
<Dialog v-model:="dialogVisible" :id="id"></Dialog>
</template>
<script setup>
import {Search,Delete} from '@element-plus/icons-vue'
import { ref} from 'vue'
import axios from "@/util/axios";
import Dialog from "@/views/order/dialog/index.vue";
import { ElMessage, ElMessageBox } from 'element-plus'
const claimStatusRef=ref([]);
const handleDelete=(id)=>{
ElMessageBox.confirm(
'您确认要删除这个订单记录吗吗?',
'系统提示',
{
confirmButtonText: '确认',
cancelButtonText: '取消',
type: 'warning',
}
)
.then(async () => {
let res=await axios.get("admin/delete/"+id)
if (res.data.code==0){
ElMessage({
type: 'success',
message: '删除成功',
})
initOrderList();
}else{
ElMessage({
type: 'error',
message: res.data.msg,
})
}
})
.catch(() => {
})
}
const handleOrderStatus=(id,status)=>{
ElMessageBox.confirm(
'您确认要更新这个订单状态吗?',
'系统提示',
{
confirmButtonText: '确认',
cancelButtonText: '取消',
type: 'warning',
}
)
.then(async () => {
let res=await axios.post("admin/updateStatus",{id:id,status:status})
if (res.data.code==0){
ElMessage({
type: 'success',
message: '执行成功',
})
initOrderList();
}else{
ElMessage({
type: 'error',
message: res.data.msg,
})
}
})
.catch(() => {
})
}
const dialogVisible=ref(false)
const handleDialogValue=(orderId)=>{
id.value=orderId;
dialogVisible.value=true;
}
const id=ref(-1);
const queryForm=ref({
orderNumber:'',
current:1,
pageSize:10
})
const total=ref(0)
const tableData =ref([])
const initOrderList=async()=>{
const res=await axios.post("orders/list/page",queryForm.value);
//console.log(res.data.data)
// const temp=[];
// temp.push(res.data.data)
// console.log(res.data.data)
claimStatusRef.value.splice(0,claimStatusRef.value.length);
if(res.data.data){
tableData.value=res.data.data.records;
tableData.value.forEach(item => {
if (item.claimStatus==0) {
claimStatusRef.value.push(item)
}
})
tableData.value=claimStatusRef.value
total.value=Number(claimStatusRef.value.length);
}
else{
ElMessage.error(res.data.description);
}
}
initOrderList();
const handleSizeChange = (pageSize) => {
queryForm.value.current=1;
queryForm.value.pageSize=pageSize;
initOrderList();
}
const handleCurrentChange = (current) => {
queryForm.value.current=current;
initOrderList();
}
const statusFormatter=(row)=>{
switch (row.status){
case 1:
return "待支付";
case 2:
return "待发货";
case 3:
return "退款/退货";
}
}
</script>
<style lang="scss" scoped>
.header{
padding-bottom: 16px;
box-sizing: border-box;
}
.el-pagination{
padding-top: 15px;
box-sizing: border-box;
}
</style>

View File

@ -0,0 +1,110 @@
<template>
<el-dialog
model-value="dialogaddVisible"
:title="dialogTitle"
width="30%"
@close="handleClose"
>
<el-form
ref="formRef"
:model="form"
label-width="100px"
>
<el-form-item label="门店头像" prop="avatarUrl">
<el-upload list-type="picture-card" limit="1" :auto-upload="false" drag action="#">
<el-icon><Plus /></el-icon>
<template #tip>
<div class="el-upload__tip">
最多传一张
</div>
</template>
</el-upload>
</el-form-item>
<el-form-item label="用户昵称" prop="username">
<el-input v-model="form.username" />
</el-form-item>
<el-form-item label="用户账号" prop="userAccount">
<el-input v-model="form.userAccount" />
</el-form-item>
<el-form-item label="用户密码" prop="userPassword">
<el-input v-model="form.userPassword" show-password />
</el-form-item>
</el-form>
<template #footer>
<span class="dialog-footer">
<el-button @click="handleClose">取消</el-button>
<el-button type="primary" @click="handleConfirm">确认</el-button>
</span>
</template>
</el-dialog>
</template>
<script setup>
import {defineEmits, defineProps, ref, watch} from "vue";
import axios from "@/util/axios";
import { ElMessage } from "element-plus";
import { Delete, Download, Plus, ZoomIn } from '@element-plus/icons-vue'
const props=defineProps({
dialogTitle:{
type:String,
default:'',
required:true
}
})
const form=ref({
avatarUrl:'',
userAccount:'',
userPassword:'',
username:null
})
// const rules=ref({
// name: [
// {
// required: true,
// message: ''
// }
// ],
// remark: [
// {
// required: true,
// message: ''
// }
// ]
// })
const formRef=ref(null);
//
const emits=defineEmits(['update:modelValue','initUserList'])
const handleClose=()=>{
console.log("用户添加关闭xxx")
//
emits('update:modelValue',false)
}
const handleConfirm=()=>{
formRef.value.validate(async(valid)=>{
if(valid){
let result=await axios.post("user/add",form.value)
console.log(result.data)
let data=result.data;
if(data.code==0){
ElMessage.success("执行添加成功!");
formRef.value.resetFields();
emits("initUserList");
handleClose();
}else{
ElMessage.error(data.description);
}
}else{
console.log("fail")
return false
}
})
}
</script>
<style scoped>
</style>

View File

@ -0,0 +1,148 @@
<template>
<el-dialog
model-value="dialogVisible"
:title="dialogTitle"
width="30%"
@close="handleClose"
>
<el-form
ref="formRef"
:model="form"
:rules="rules"
label-width="100px"
>
<el-form-item label="用户头像" prop="avatarUrl">
<img :src="form.avatarUrl" alt="空" width="50" height="50"/>
</el-form-item>
<el-form-item label="用户昵称" prop="username">
{{form.username}}
</el-form-item>
<el-form-item label="用户账号" prop="userAccount">
{{form.userAccount}}
</el-form-item>
<el-form-item label="性别" prop="gender">
<template v-if="form.gender==0"></template>
<template v-else></template>
</el-form-item>
<el-form-item label="电话" prop="phone">
{{form.phone}}
</el-form-item>
<el-form-item label="邮箱" prop="email">
{{form.email}}
</el-form-item>
<el-form-item label="用户状态" prop="userStatus">
<template v-if="form.userStatus==0">禁用</template>
<template v-else>启用</template>
</el-form-item>
<el-form-item label="用户角色" prop="userRole">
<template v-if="form.userRole===0">普通用户</template>
<template v-else-if="form.userRole===1">管理员</template>
<template v-else-if="form.userRole===2">商家</template>
<template v-else>美甲师</template>
</el-form-item>
</el-form>
<!-- <template #footer>-->
<!--<span class="dialog-footer">-->
<!--<el-button @click="handleClose">取消</el-button>-->
<!--<el-button type="primary" @click="handleConfirm">确认</el-button>-->
<!--</span>-->
<!-- </template>-->
</el-dialog>
</template>
<script setup>
import {defineEmits, defineProps, ref, watch} from "vue";
import axios from "@/util/axios";
import { ElMessage } from "element-plus";
const props=defineProps({
id:{
type:String,
default:-1,
required:true
},
dialogTitle:{
type:String,
default:'',
required:true
}
})
const form=ref({
id: "",
businessId: "",
userId: "",
manicuristId: "",
orderId: "",
rating: null,
manicuristRating: null,
review: "",
businessReview: null,
createTime: ""
})
// const rules=ref({
// name: [
// {
// required: true,
// message: ''
// }
// ],
// remark: [
// {
// required: true,
// message: ''
// }
// ]
// })
const formRef=ref(null);
const initFormData=async(ids)=>{
// console.log(ids)
const res=await axios.get("user/getById",{id: ids})
// console.log(res.data.data)
form.value=res.data.data;
}
watch(
()=>props.id,
()=>{
//console.log("id="+props.id);
let ids=props.id;
initFormData(ids)
// }else{
// formRef.value.resetFields();
// form.value={
// id:-1,
// name:"",
// remark:""
// }
// }
}
)
//
const emits=defineEmits(['update:modelValue','initUserList'])
const handleClose=()=>{
console.log("xxx")
//
emits('update:modelValue',false)
}
// const handleConfirm=()=>{
// formRef.value.validate(async(valid)=>{
// if(valid){
// let result=await axios.post("admin/bigType/save",form.value)
// let data=result.data;
// if(data.code==0){
// ElMessage.success("");
// formRef.value.resetFields();
// emits("initUserList");
// handleClose();
// }else{
// ElMessage.error(data.msg);
// }
// }else{
// console.log("fail")
// return false
// }
// })
// }
</script>
<style scoped>
</style>

170
src/views/rating/index.vue Normal file
View File

@ -0,0 +1,170 @@
<template>
<el-card>
<el-row :gutter="20" class="header">
<el-col :span="7">
<el-input placeholder="请输入用户昵称..." clearable v-model="queryForm.username"></el-input>
</el-col>
<el-button type="button" :icon="Search" @click="initRatingList" >搜索</el-button>
<el-button type="primary" :icon="DocumentAdd" @click="handleAddDialogValue()" >添加评论</el-button>
</el-row>
<el-table :data="tableData" stripe style="width: 100%;" showOverflowTooltip>
<el-table-column fixed prop="id" label="#ID" width="80" />
<el-table-column prop="businessId" label="商家id" width="80" />
<el-table-column prop="userId" label="用户id" width="80" />
<el-table-column prop="manicuristId" label="美甲师id" width="80" />
<el-table-column prop="orderId" label="订单id" width="80" />
<el-table-column prop="rating" label="评分" width="80" />
<el-table-column prop="review" label="评论" width="200" />
<el-table-column prop="businessReview" label="商家评论" width="200" />
<el-table-column prop="createTime" label="注册日期" width="200"/>
<el-table-column prop="action" fixed="right" label="操作" min-width="170">
<template v-slot="scope" >
<el-button type="success" size="small" @click="handleDialogValue(scope.row.id)">
详情
</el-button>
<el-button type="primary" size="small" :icon="Edit" @click="handleUpdateDialogValue(scope.row.id)"></el-button>
<el-button type="danger" size="small" :icon="Delete" @click="handleDelete(scope.row.id)"></el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
v-model:currentPage="queryForm.current"
v-model:page-size="queryForm.pageSize"
:page-sizes="[10, 20, 30, 40,50]"
layout="total, sizes, prev, pager, next, jumper"
:total="total"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
/>
<!-- {{total}}-->
</el-card>
<Dialog v-model="UdialogVisible" :id="id" :dialogTitle="dialogTitle"
@initUserList="initUserList"></Dialog>
<AddDialog v-model="UdialogaddVisible" :dialogTitle="dialogTitle"
@initUserList="initUserList"></AddDialog>
<UpdateDialog v-model="UdialogUpdateVisible" :id="id" :dialogTitle="dialogTitle"
@initUserList="initUserList"></UpdateDialog>
</template>
<script setup>
import {Search,Delete,Edit,DocumentAdd,Close,Check} from '@element-plus/icons-vue'
import {ref, watch} from 'vue'
import axios from "@/util/axios";
import Dialog from '@/views/user/dialog/index.vue'
import AddDialog from '@/views/user/addDialog/index.vue'
import UpdateDialog from '@/views/user/updateDialog/index.vue'
import { ElMessage,ElMessageBox } from "element-plus";
import {parseTime} from "element-plus/es/components/time-select/src/utils";
const queryForm=ref({
username: '',
current:1,
pageSize:10
})
// const id=ref('')
// const dialogTitle=ref('');
// const UdialogaddVisible=ref(false)
// const UdialogVisible=ref(false)
// const UdialogUpdateVisible=ref(false)
// const handleDialogValue=(ids)=>{
// id.value=ids;
// dialogTitle.value=""
// UdialogVisible.value=true
// }
//
// const handleUpdateDialogValue=(ids)=>{
// id.value=ids;
// dialogTitle.value=""
// UdialogUpdateVisible.value=true
// }
//
// const handleAddDialogValue=()=>{
// dialogTitle.value=""
// UdialogaddVisible.value=true
// }
//
const handleDelete=(ids)=>{
// console.log(id)
ElMessageBox.confirm(
'您确定要删除这条记录吗?',
'系统提示',
{
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}
)
.then(async() => {
let res=await axios.post('level/delete',{id:ids})
if(res.data.code==0){
ElMessage({
type: 'success',
message: '删除成功',
})
initSmallTypeList();
}else{
ElMessage({
type: 'error',
message: res.data.description,
})
}
})
.catch(() => {
})
// initUserList();
}
const total=ref(0)
const tableData =ref([])
const initRatingList=async()=>{
const res = await axios.post("level/list");
console.log(res.data.data)
if (res.data.data) {
tableData.value = res.data.data;
//console.log(res.data.data)
total.value = Number(res.data.data.length);
}
else{
ElMessage.error(res.data.description);
}
}
initRatingList();
const handleSizeChange = (pageSize) => {
queryForm.value.current=1;
queryForm.value.pageSize=pageSize;
initRatingList();
}
const handleCurrentChange = (current1) => {
queryForm.value.current=current1;
initRatingList();
}
</script>
<style lang="scss" scoped>
.header{
padding-bottom: 16px;
box-sizing: border-box;
}
.el-pagination{
padding-top: 15px;
box-sizing: border-box;
}
</style>

View File

@ -0,0 +1,171 @@
<template>
<el-dialog
model-value="dialogUpdateVisible"
:title="dialogTitle"
width="30%"
@close="handleClose"
>
<el-form
ref="formRef"
:model="form"
label-width="100px"
>
<el-form-item label="用户头像" prop="avatarUrl">
<!-- {{ form.avatarUrl }}-->
<el-input v-model="form.avatarUrl"/>
</el-form-item>
<el-form-item label="用户昵称" prop="username">
<el-input v-model="form.username"/>
</el-form-item>
<el-form-item label="用户ID" prop="id">
<el-input v-model="form.id"/>
</el-form-item>
<el-form-item label="性别" prop="gender">
<template v-if="form.gender==0"></template>
<template v-else></template>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<el-radio-group v-model="form.gender">
<el-radio :value="0" size="default"></el-radio>
<el-radio :value="1" size="default"></el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="电话" prop="phone">
<el-input v-model="form.phone"/>
</el-form-item>
<el-form-item label="邮箱" prop="email">
<el-input v-model="form.email"/>
</el-form-item>
<el-form-item label="用户状态" prop="userStatus">
<el-input v-model="form.userStatus"/>
</el-form-item>
<el-form-item label="用户角色" prop="userRole">
<!-- {{form.userRole}}-->
<!-- {{labelt}}-->
<!-- 展示由于v-model绑定出现v-model的form.userRole的值-->
<el-select
v-model="form.userRole"
size="default"
placeholder="用户角色"
style="width: 100%"
>
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
</el-form>
<template #footer>
<span class="dialog-footer">
<el-button @click="handleClose">取消</el-button>
<el-button type="primary" @click="handleConfirm">确认</el-button>
</span>
</template>
</el-dialog>
</template>
<script setup>
import {defineEmits, defineProps, ref, watch} from "vue";
import axios from "@/util/axios";
import {ElMessage} from "element-plus";
const props = defineProps({
id: {
type: String,
default: -1,
required: true
},
dialogTitle: {
type: String,
default: '',
required: true
}
})
const labelt=ref('')
const form = ref({
id:null,
avatarUrl: "",
email: "",
gender: null,
phone: null,
userRole: null,
userStatus: null,
username: ""
})
const options = [
{
value: '',
label: '用户身份',
},
{
value: '0',
label: '普通用户',
},
{
value: '1',
label: '管理员',
},
{
value: '2',
label: '商家',
},
{
value: '3',
label: '美甲师',
},
]
const formRef = ref(null);
const initFormData = async (ids) => {
const res = await axios.get("user/getById", {id: ids})
form.value = res.data.data;
labelt.value=options[form.value.userRole].label
// console.log(options[form.value.userRole].label)
}
watch(
() => props.id,
() => {
// console.log("id=" + props.useraccount);
let ids = props.id;
initFormData(ids)
}
)
//
const emits = defineEmits(['update:modelValue', 'initUserList'])
const handleClose = () => {
console.log("xxx")
//
emits('update:modelValue', false)
}
const handleConfirm = () => {
formRef.value.validate(async (valid) => {
if (valid) {
let result = await axios.post("user/update", form.value)
let data = result.data;
if (data.code == 0) {
ElMessage.success("执行成功!");
formRef.value.resetFields();
emits("initUserList");
handleClose();
} else {
ElMessage.error(data.description);
}
} else {
console.log("fail")
return false
}
})
}
</script>
<style scoped>
</style>

View File

@ -1,278 +1,78 @@
<template>
<div style="display: flex">
<div style="flex: 1">
<div id="echarRef" style="height: 300px;width: 400px;border: 1px solid #ebebeb;border-radius: 2px;"></div>
</div>
<div style="flex: 1">
<div id="main" style="height: 300px;width: 400px;border: 1px solid #ebebeb;border-radius: 2px;"></div>
</div>
</div>
<div style="display: flex">
<div style="flex: 1">
<div id="temp" style="height: 600px;width: 800px;border: 1px solid #ebebeb;border-radius: 2px;"></div>
</div>
<div style="flex: 1">
<div id="tanbai" style="height: 600px;width: 600px;border: 1px solid #ebebeb;border-radius: 2px;"></div>
</div>
<div style="margin-bottom: 20px">
<el-button size="small" @click="addTab(editableTabsValue)">
add tab
</el-button>
</div>
<el-tabs
v-model="editableTabsValue"
type="card"
class="demo-tabs"
closable
@tab-remove="removeTab"
>
<el-tab-pane
v-for="item in editableTabs"
:key="item.name"
:label="item.title"
:name="item.name"
>
{{ item.content }}
</el-tab-pane>
</el-tabs>
</template>
<script setup>
import { ref } from 'vue'
let tabIndex = 2
const editableTabsValue = ref('2')
const editableTabs = ref([
{
title: 'Tab 1',
name: '1',
content: 'Tab 1 content',
},
{
title: 'Tab 2',
name: '2',
content: 'Tab 2 content',
},
])
<script setup>
import * as echarts from "echarts";
import { onMounted } from 'vue'
onMounted(async () => {
setTimeout(() => {hei()}, 1000)
setTimeout(() => {shi();}, 1000)
setTimeout(() => {temp();tanbai();}, 1000)
})
const hei = () => {
let myChart = echarts.init(document.getElementById("echarRef"));
myChart.setOption({
title: { text: "CPU使用率" },
tooltip: {},
xAxis: {
data: ["12-3", "12-4", "12-5", "12-6", "12-7", "12-8"],
},
yAxis: {},
series: [
{
name: "用户量",
type: "line",
data: [5, 20, 36, 10, 10, 20],
},
],
});
window.onresize = function () {//
myChart.resize();
};
const addTab = (targetName) => {
const newTabName = `${++tabIndex}`
editableTabs.value.push({
title: 'New Tab',
name: newTabName,
content: 'New Tab content',
})
editableTabsValue.value = newTabName
}
const shi=()=>{
var chartDom = document.getElementById('main');
var myChart = echarts.init(chartDom);
var option;
option = {
title: { text: "订单柱状图" },
xAxis: {
type: 'category',
data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
},
yAxis: {
type: 'value'
},
series: [
{
data: [120, 200, 150, 80, 70, 110, 130],
type: 'bar'
const removeTab = (targetName) => {
const tabs = editableTabs.value
let activeName = editableTabsValue.value
if (activeName === targetName) {
tabs.forEach((tab, index) => {
if (tab.name === targetName) {
const nextTab = tabs[index + 1] || tabs[index - 1]
if (nextTab) {
activeName = nextTab.name
}
}
]
};
option && myChart.setOption(option);
}
const tanbai=()=>{
var chartDom = document.getElementById('tanbai');
var myChart = echarts.init(chartDom);
var option;
option = {
legend: {
top: 'bottom'
},
toolbox: {
show: true,
feature: {
mark: { show: true },
dataView: { show: true, readOnly: false },
restore: { show: true },
saveAsImage: { show: true }
}
},
series: [
{
name: 'Nightingale Chart',
type: 'pie',
radius: [50, 250],
center: ['50%', '50%'],
roseType: 'area',
itemStyle: {
borderRadius: 8
},
data: [
{ value: 40, name: 'rose 1' },
{ value: 38, name: 'rose 2' },
{ value: 32, name: 'rose 3' },
{ value: 30, name: 'rose 4' },
{ value: 28, name: 'rose 5' },
{ value: 26, name: 'rose 6' },
{ value: 22, name: 'rose 7' },
{ value: 18, name: 'rose 8' }
]
}
]
};
option && myChart.setOption(option);
}
const temp=()=>{
var app = {};
var chartDom = document.getElementById('temp');
var myChart = echarts.init(chartDom);
var option;
let xData = [];
let yData = [];
let data = [];
for (let y = 0; y < 10; y++) {
yData.push(y);
for (let x = 0; x < 10; x++) {
data.push([x, y, 10]);
}
})
}
for (let x = 0; x < 10; x++) {
xData.push(x);
}
const options = [
{
grid: {
left: 0,
right: 0,
top: 0,
bottom: 0
},
xAxis: {
show: false,
type: 'category',
data: xData
},
yAxis: {
show: false,
type: 'category',
data: yData
},
series: [
{
type: 'scatter',
data: data,
symbol: 'roundRect',
symbolKeepAspect: true,
universalTransition: true,
symbolSize: 50
}
]
},
{
series: [
{
type: 'scatter',
symbol: 'circle'
}
]
},
{
// heart
series: [
{
symbol:
'path://M23.6 2c-3.363 0-6.258 2.736-7.599 5.594-1.342-2.858-4.237-5.594-7.601-5.594-4.637 0-8.4 3.764-8.4 8.401 0 9.433 9.516 11.906 16.001 21.232 6.13-9.268 15.999-12.1 15.999-21.232 0-4.637-3.763-8.401-8.4-8.401z'
}
]
},
{
// happy
series: [
{
symbol:
'path://M16 0c-8.837 0-16 7.163-16 16s7.163 16 16 16 16-7.163 16-16-7.163-16-16-16zM22 8c1.105 0 2 1.343 2 3s-0.895 3-2 3-2-1.343-2-3 0.895-3 2-3zM10 8c1.105 0 2 1.343 2 3s-0.895 3-2 3-2-1.343-2-3 0.895-3 2-3zM16 28c-5.215 0-9.544-4.371-10-9.947 2.93 1.691 6.377 2.658 10 2.658s7.070-0.963 10-2.654c-0.455 5.576-4.785 9.942-10 9.942z'
}
]
},
{
// evil
series: [
{
symbol:
'path://M32 2c0-1.422-0.298-2.775-0.833-4-1.049 2.401-3.014 4.31-5.453 5.287-2.694-2.061-6.061-3.287-9.714-3.287s-7.021 1.226-9.714 3.287c-2.439-0.976-4.404-2.886-5.453-5.287-0.535 1.225-0.833 2.578-0.833 4 0 2.299 0.777 4.417 2.081 6.106-1.324 2.329-2.081 5.023-2.081 7.894 0 8.837 7.163 16 16 16s16-7.163 16-16c0-2.871-0.757-5.565-2.081-7.894 1.304-1.689 2.081-3.806 2.081-6.106zM18.003 11.891c0.064-1.483 1.413-2.467 2.55-3.036 1.086-0.543 2.16-0.814 2.205-0.826 0.536-0.134 1.079 0.192 1.213 0.728s-0.192 1.079-0.728 1.213c-0.551 0.139-1.204 0.379-1.779 0.667 0.333 0.357 0.537 0.836 0.537 1.363 0 1.105-0.895 2-2 2s-2-0.895-2-2c0-0.037 0.001-0.073 0.003-0.109zM8.030 8.758c0.134-0.536 0.677-0.862 1.213-0.728 0.045 0.011 1.119 0.283 2.205 0.826 1.137 0.569 2.486 1.553 2.55 3.036 0.002 0.036 0.003 0.072 0.003 0.109 0 1.105-0.895 2-2 2s-2-0.895-2-2c0-0.527 0.204-1.005 0.537-1.363-0.575-0.288-1.228-0.528-1.779-0.667-0.536-0.134-0.861-0.677-0.728-1.213zM16 26c-3.641 0-6.827-1.946-8.576-4.855l2.573-1.544c1.224 2.036 3.454 3.398 6.003 3.398s4.779-1.362 6.003-3.398l2.573 1.544c-1.749 2.908-4.935 4.855-8.576 4.855z'
}
]
},
{
// hipster
series: [
{
symbol:
'path://M16 0c-8.837 0-16 7.163-16 16s7.163 16 16 16 16-7.163 16-16-7.163-16-16-16zM22 8c1.105 0 2 0.895 2 2s-0.895 2-2 2-2-0.895-2-2 0.895-2 2-2zM10 8c1.105 0 2 0.895 2 2s-0.895 2-2 2-2-0.895-2-2 0.895-2 2-2zM16.994 21.23c-0.039-0.035-0.078-0.072-0.115-0.109-0.586-0.586-0.878-1.353-0.879-2.121-0 0.768-0.293 1.535-0.879 2.121-0.038 0.038-0.076 0.074-0.115 0.109-2.704 2.453-9.006-0.058-9.006-3.23 1.938 1.25 3.452 0.306 4.879-1.121 1.172-1.172 3.071-1.172 4.243 0 0.586 0.586 0.879 1.353 0.879 2.121 0-0.768 0.293-1.535 0.879-2.121 1.172-1.172 3.071-1.172 4.243 0 1.427 1.427 2.941 2.371 4.879 1.121 0 3.173-6.302 5.684-9.006 3.23z'
}
]
},
{
// shocked
series: [
{
symbol:
'path://M16 0c-8.837 0-16 7.163-16 16s7.163 16 16 16 16-7.163 16-16-7.163-16-16-16zM10 14c-1.105 0-2-1.343-2-3s0.895-3 2-3 2 1.343 2 3-0.895 3-2 3zM16 26c-2.209 0-4-1.791-4-4s1.791-4 4-4c2.209 0 4 1.791 4 4s-1.791 4-4 4zM22 14c-1.105 0-2-1.343-2-3s0.895-3 2-3 2 1.343 2 3-0.895 3-2 3z'
}
]
},
{
// pie chart
series: [
{
symbol:
'path://M14 18v-14c-7.732 0-14 6.268-14 14s6.268 14 14 14 14-6.268 14-14c0-2.251-0.532-4.378-1.476-6.262l-12.524 6.262zM28.524 7.738c-2.299-4.588-7.043-7.738-12.524-7.738v14l12.524-6.262z'
}
]
},
{
// users
series: [
{
symbol:
'path://M10.225 24.854c1.728-1.13 3.877-1.989 6.243-2.513-0.47-0.556-0.897-1.176-1.265-1.844-0.95-1.726-1.453-3.627-1.453-5.497 0-2.689 0-5.228 0.956-7.305 0.928-2.016 2.598-3.265 4.976-3.734-0.529-2.39-1.936-3.961-5.682-3.961-6 0-6 4.029-6 9 0 3.096 1.797 6.191 4 7.432v1.649c-6.784 0.555-12 3.888-12 7.918h8.719c0.454-0.403 0.956-0.787 1.506-1.146zM24 24.082v-1.649c2.203-1.241 4-4.337 4-7.432 0-4.971 0-9-6-9s-6 4.029-6 9c0 3.096 1.797 6.191 4 7.432v1.649c-6.784 0.555-12 3.888-12 7.918h28c0-4.030-5.216-7.364-12-7.918z'
}
]
},
{
// mug
series: [
{
symbol:
'path://M30 10h-6v-3c0-2.761-5.373-5-12-5s-12 2.239-12 5v20c0 2.761 5.373 5 12 5s12-2.239 12-5v-3h6c1.105 0 2-0.895 2-2v-10c0-1.105-0.895-2-2-2zM5.502 8.075c-1.156-0.381-1.857-0.789-2.232-1.075 0.375-0.286 1.075-0.694 2.232-1.075 1.811-0.597 4.118-0.925 6.498-0.925s4.688 0.329 6.498 0.925c1.156 0.381 1.857 0.789 2.232 1.075-0.375 0.286-1.076 0.694-2.232 1.075-1.811 0.597-4.118 0.925-6.498 0.925s-4.688-0.329-6.498-0.925zM28 20h-4v-6h4v6z'
}
]
},
{
// plane
series: [
{
symbol:
'path://M24 19.999l-5.713-5.713 13.713-10.286-4-4-17.141 6.858-5.397-5.397c-1.556-1.556-3.728-1.928-4.828-0.828s-0.727 3.273 0.828 4.828l5.396 5.396-6.858 17.143 4 4 10.287-13.715 5.713 5.713v7.999h4l2-6 6-2v-4l-7.999 0z'
}
]
}
];
let optionIndex = 0;
option = options[optionIndex];
setInterval(function () {
optionIndex = (optionIndex + 1) % options.length;
myChart.setOption(options[optionIndex]);
}, 700);
option && myChart.setOption(option);
editableTabsValue.value = activeName
editableTabs.value = tabs.filter((tab) => tab.name !== targetName)
}
</script>
<style scoped>
<style>
.demo-tabs > .el-tabs__content {
padding: 32px;
color: #6b778c;
font-size: 32px;
font-weight: 600;
}
</style>