feat:分配权限
This commit is contained in:
1 parent
573d25adcc
commit
ea781de349
7 files changed
+285
-216
No files matched your search
@@ -1,7 +1,9 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="system-user-dialog-container">
|
<div class="system-user-dialog-container">
|
||||||
<el-dialog :close-on-click-modal="false" title="人脸管理" draggable v-model="dialogVisible">
|
<el-dialog :close-on-click-modal="false" title="人脸管理" draggable v-model="dialogVisible">
|
||||||
<el-button icon="folder-add" type="primary" @click="addFace"> 新增 </el-button>
|
<el-button v-auth="'userFace_sysUserFace_add'" icon="folder-add" type="primary" @click="addFace">
|
||||||
|
新增
|
||||||
|
</el-button>
|
||||||
<div class="h-4" />
|
<div class="h-4" />
|
||||||
<el-table
|
<el-table
|
||||||
v-loading="state.loading"
|
v-loading="state.loading"
|
||||||
@@ -17,10 +19,17 @@
|
|||||||
<preview-image :src="row.faceImg" />
|
<preview-image :src="row.faceImg" />
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="address" align="center" label="操作">
|
<el-table-column
|
||||||
|
v-auths="['userFace_sysUserFace_edit', 'userFace_sysUserFace_del']"
|
||||||
|
prop="address"
|
||||||
|
align="center"
|
||||||
|
label="操作"
|
||||||
|
>
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<el-button link type="primary" @click="editFace(row)"> <Icon icon="ep:edit" />修改 </el-button>
|
<el-button v-auth="'userFace_sysUserFace_edit'" link type="primary" @click="editFace(row)">
|
||||||
<el-button link type="danger" @click="delFace(row)"> 删除 </el-button>
|
<Icon icon="ep:edit" />修改
|
||||||
|
</el-button>
|
||||||
|
<el-button v-auth="'userFace_sysUserFace_del'" link type="danger" @click="delFace(row)"> 删除 </el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|||||||
@@ -131,6 +131,7 @@
|
|||||||
<el-table-column :label="$t('sysuser.lockFlag')" show-overflow-tooltip>
|
<el-table-column :label="$t('sysuser.lockFlag')" show-overflow-tooltip>
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-switch
|
<el-switch
|
||||||
|
:disabled="!auth('sys_user_edit')"
|
||||||
v-model="scope.row.lockFlag"
|
v-model="scope.row.lockFlag"
|
||||||
@change="changeSwitch(scope.row)"
|
@change="changeSwitch(scope.row)"
|
||||||
active-value="0"
|
active-value="0"
|
||||||
@@ -146,6 +147,7 @@
|
|||||||
<el-table-column label="全局人脸" show-overflow-tooltip>
|
<el-table-column label="全局人脸" show-overflow-tooltip>
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<el-switch
|
<el-switch
|
||||||
|
:disabled="!auth('userFace_sysUserFace_global_face')"
|
||||||
v-if="row.isGlobalFace"
|
v-if="row.isGlobalFace"
|
||||||
v-model="row.isGlobalFace"
|
v-model="row.isGlobalFace"
|
||||||
@change="changeGlobalFaceSwitch(row)"
|
@change="changeGlobalFaceSwitch(row)"
|
||||||
@@ -154,7 +156,12 @@
|
|||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column :label="$t('common.action')" width="300" fixed="right">
|
<el-table-column
|
||||||
|
v-auths="['sys_user_edit', 'userFace_sysUserFace_view', 'sys_user_del']"
|
||||||
|
:label="$t('common.action')"
|
||||||
|
width="300"
|
||||||
|
fixed="right"
|
||||||
|
>
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<div style="display: flex">
|
<div style="display: flex">
|
||||||
<!-- 重置密码 -->
|
<!-- 重置密码 -->
|
||||||
@@ -176,7 +183,13 @@
|
|||||||
{{ $t("common.editBtn") }}
|
{{ $t("common.editBtn") }}
|
||||||
</el-button>
|
</el-button>
|
||||||
<!-- 人脸管理 -->
|
<!-- 人脸管理 -->
|
||||||
<el-button icon="User" text type="primary" @click="faceManageRef.openDialog(scope.row.userId)">
|
<el-button
|
||||||
|
v-auth="'userFace_sysUserFace_view'"
|
||||||
|
icon="User"
|
||||||
|
text
|
||||||
|
type="primary"
|
||||||
|
@click="faceManageRef.openDialog(scope.row.userId)"
|
||||||
|
>
|
||||||
人脸管理
|
人脸管理
|
||||||
</el-button>
|
</el-button>
|
||||||
<!-- 删除用户 -->
|
<!-- 删除用户 -->
|
||||||
@@ -225,6 +238,7 @@ import { deptTree } from "/@/api/admin/dept"
|
|||||||
import { BasicTableProps, useTable } from "/@/hooks/table"
|
import { BasicTableProps, useTable } from "/@/hooks/table"
|
||||||
import { useMessage, useMessageBox } from "/@/hooks/message"
|
import { useMessage, useMessageBox } from "/@/hooks/message"
|
||||||
import { useI18n } from "vue-i18n"
|
import { useI18n } from "vue-i18n"
|
||||||
|
import { auth } from "/@/utils/authFunction"
|
||||||
|
|
||||||
// 动态引入组件
|
// 动态引入组件
|
||||||
const UserForm = defineAsyncComponent(() => import("./form.vue"))
|
const UserForm = defineAsyncComponent(() => import("./form.vue"))
|
||||||
|
|||||||
@@ -1,95 +1,113 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="layout-padding">
|
<div class="layout-padding">
|
||||||
<div class="layout-padding-auto layout-padding-view">
|
<div class="layout-padding-auto layout-padding-view">
|
||||||
<el-form ref="queryRef" :inline="true" :model="state.queryForm" @keyup.enter="getDataList">
|
<el-form ref="queryRef" :inline="true" :model="state.queryForm" @keyup.enter="getDataList">
|
||||||
<el-row :gutter="24">
|
<el-row :gutter="24">
|
||||||
<el-col :span="4">
|
<el-col :span="4">
|
||||||
<el-form-item class="w100" label="用户" prop="userIds">
|
<el-form-item class="w100" label="用户" prop="userIds">
|
||||||
<select-user v-model="state.queryForm.userIds" />
|
<select-user v-model="state.queryForm.userIds" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="4">
|
<el-col :span="4">
|
||||||
<el-form-item class="w100" label="退款状态" prop="status">
|
<el-form-item class="w100" label="退款状态" prop="status">
|
||||||
<dict-select v-model="state.queryForm.status" dict-code="hard_sale_status" />
|
<dict-select v-model="state.queryForm.status" dict-code="hard_sale_status" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<el-form-item class="w100" label="申请时间" prop="createTimeList">
|
<el-form-item class="w100" label="申请时间" prop="createTimeList">
|
||||||
<el-date-picker v-model="state.queryForm.createTimeList" value-format="YYYY-MM-DD" type="daterange" />
|
<el-date-picker v-model="state.queryForm.createTimeList" value-format="YYYY-MM-DD" type="daterange" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button icon="Search" type="primary" @click="getDataList">{{ $t('common.queryBtn')
|
<el-button icon="Search" type="primary" @click="getDataList">{{ $t("common.queryBtn") }}</el-button>
|
||||||
}}</el-button>
|
<el-button icon="Refresh" @click="resetQuery">{{ $t("common.resetBtn") }}</el-button>
|
||||||
<el-button icon="Refresh" @click="resetQuery">{{ $t('common.resetBtn') }}</el-button>
|
</el-form-item>
|
||||||
</el-form-item>
|
</el-row>
|
||||||
</el-row>
|
</el-form>
|
||||||
</el-form>
|
<el-table
|
||||||
<el-table :data="state.dataList" v-loading="state.loading" border :cell-style="tableStyle.cellStyle"
|
:data="state.dataList"
|
||||||
:header-cell-style="tableStyle.headerCellStyle" @selection-change="selectionChangHandle"
|
v-loading="state.loading"
|
||||||
@sort-change="sortChangeHandle">
|
border
|
||||||
<el-table-column type="selection" width="40" align="center" />
|
:cell-style="tableStyle.cellStyle"
|
||||||
<el-table-column type="index" label="#" width="40" />
|
:header-cell-style="tableStyle.headerCellStyle"
|
||||||
<el-table-column prop="username" label="用户" />
|
@selection-change="selectionChangHandle"
|
||||||
<el-table-column prop="userAvatar" label="头像">
|
@sort-change="sortChangeHandle"
|
||||||
<template #default="{ row }">
|
>
|
||||||
<preview-image :src="row.userAvatar" />
|
<el-table-column type="selection" width="40" align="center" />
|
||||||
</template>
|
<el-table-column type="index" label="#" width="40" />
|
||||||
</el-table-column>
|
<el-table-column prop="username" label="用户" />
|
||||||
<el-table-column prop="userMobile" width="120" label="手机号" />
|
<el-table-column prop="userAvatar" label="头像">
|
||||||
<el-table-column label="支付金额" align="center" prop="practicalTotalPrice">
|
<template #default="{ row }">
|
||||||
<template #default="{ row }">
|
<preview-image :src="row.userAvatar" />
|
||||||
<span class="color-primary">
|
</template>
|
||||||
{{ displayPrice(row.orderPayPrice) }}
|
</el-table-column>
|
||||||
</span>
|
<el-table-column prop="userMobile" width="120" label="手机号" />
|
||||||
</template>
|
<el-table-column label="支付金额" align="center" prop="practicalTotalPrice">
|
||||||
</el-table-column>
|
<template #default="{ row }">
|
||||||
<el-table-column label="退款金额" align="center">
|
<span class="color-primary">
|
||||||
<template #default="{ row }">
|
{{ displayPrice(row.orderPayPrice) }}
|
||||||
<span class="color-success">
|
</span>
|
||||||
{{ displayPrice(row.refundPrice) }}
|
</template>
|
||||||
</span>
|
</el-table-column>
|
||||||
</template>
|
<el-table-column label="退款金额" align="center">
|
||||||
</el-table-column>
|
<template #default="{ row }">
|
||||||
<el-table-column label="退款状态" align="center">
|
<span class="color-success">
|
||||||
<template #default="{ row }">
|
{{ displayPrice(row.refundPrice) }}
|
||||||
<dict-tag :options="hard_sale_status" :value="row.status" />
|
</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="申请时间" align="center" width="180px" prop="createTime" />
|
<el-table-column label="退款状态" align="center">
|
||||||
<el-table-column label="操作" width="200">
|
<template #default="{ row }">
|
||||||
<template #default="{ row }">
|
<dict-tag :options="hard_sale_status" :value="row.status" />
|
||||||
<el-button icon="ShoppingCartFull" text type="primary"
|
</template>
|
||||||
@click="shopCarDialogRef.openDialog(row.orderId)">购物车</el-button>
|
</el-table-column>
|
||||||
<el-button icon="WalletFilled" link type="primary" @click="doRefund(row)">
|
<el-table-column label="申请时间" align="center" width="180px" prop="createTime" />
|
||||||
退款
|
<el-table-column label="操作" width="200">
|
||||||
</el-button>
|
<template #default="{ row }">
|
||||||
<el-button v-if="false" icon="edit-pen" text type="primary" v-auth="'hard_hardAfterSale_edit'"
|
<el-button icon="ShoppingCartFull" text type="primary" @click="shopCarDialogRef.openDialog(row.orderId)"
|
||||||
@click="formDialogRef.openDialog(row.id)">编辑</el-button>
|
>购物车</el-button
|
||||||
<el-button v-if="false" icon="delete" text type="primary" v-auth="'hard_hardAfterSale_del'"
|
>
|
||||||
@click="handleDelete([row.id])">删除</el-button>
|
<el-button icon="WalletFilled" link type="primary" @click="doRefund(row)"> 退款 </el-button>
|
||||||
</template>
|
<el-button
|
||||||
</el-table-column>
|
v-if="false"
|
||||||
</el-table>
|
icon="edit-pen"
|
||||||
<pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle" v-bind="state.pagination" />
|
text
|
||||||
</div>
|
type="primary"
|
||||||
|
v-auth="'hard_hardAfterSale_edit'"
|
||||||
|
@click="formDialogRef.openDialog(row.id)"
|
||||||
|
>编辑</el-button
|
||||||
|
>
|
||||||
|
<el-button
|
||||||
|
v-if="false"
|
||||||
|
icon="delete"
|
||||||
|
text
|
||||||
|
type="primary"
|
||||||
|
v-auth="'hard_hardAfterSale_del'"
|
||||||
|
@click="handleDelete([row.id])"
|
||||||
|
>删除</el-button
|
||||||
|
>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle" v-bind="state.pagination" />
|
||||||
|
</div>
|
||||||
|
|
||||||
<!-- 编辑、新增 -->
|
<!-- 编辑、新增 -->
|
||||||
<form-dialog ref="formDialogRef" @refresh="getDataList(false)" />
|
<form-dialog ref="formDialogRef" @refresh="getDataList(false)" />
|
||||||
<shop-car ref="shopCarDialogRef" />
|
<shop-car ref="shopCarDialogRef" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts" name="systemHardAfterSale">
|
<script setup lang="ts" name="systemHardAfterSale">
|
||||||
import { BasicTableProps, useTable } from "/@/hooks/table";
|
import { BasicTableProps, useTable } from "/@/hooks/table"
|
||||||
import { pageJoin, delObjs } from '/@/api/hard/hard-after-sale'
|
import { pageJoin, delObjs } from "/@/api/hard/hard-after-sale"
|
||||||
import { useMessage, useMessageBox } from "/@/hooks/message";
|
import { useMessage, useMessageBox } from "/@/hooks/message"
|
||||||
import { useDict } from '/@/hooks/dict';
|
import { useDict } from "/@/hooks/dict"
|
||||||
import { displayPrice } from "/@/utils/formatMoney"
|
import { displayPrice } from "/@/utils/formatMoney"
|
||||||
|
|
||||||
// 引入组件
|
// 引入组件
|
||||||
const FormDialog = defineAsyncComponent(() => import('./form.vue'));
|
const FormDialog = defineAsyncComponent(() => import("./form.vue"))
|
||||||
const ShopCar = defineAsyncComponent(() => import('../components/shop-car.vue'));
|
const ShopCar = defineAsyncComponent(() => import("../components/shop-car.vue"))
|
||||||
// 定义查询字典
|
// 定义查询字典
|
||||||
const { hard_sale_status } = useDict("hard_sale_status")
|
const { hard_sale_status } = useDict("hard_sale_status")
|
||||||
// 定义变量内容
|
// 定义变量内容
|
||||||
@@ -105,59 +123,52 @@ const multiple = ref(true)
|
|||||||
const { push } = useRouter()
|
const { push } = useRouter()
|
||||||
|
|
||||||
const state: BasicTableProps = reactive<BasicTableProps>({
|
const state: BasicTableProps = reactive<BasicTableProps>({
|
||||||
queryForm: {},
|
queryForm: {},
|
||||||
pageList: pageJoin
|
pageList: pageJoin,
|
||||||
})
|
})
|
||||||
|
|
||||||
// table hook
|
// table hook
|
||||||
const {
|
const { getDataList, currentChangeHandle, sizeChangeHandle, sortChangeHandle, downBlobFile, tableStyle } =
|
||||||
getDataList,
|
useTable(state)
|
||||||
currentChangeHandle,
|
|
||||||
sizeChangeHandle,
|
|
||||||
sortChangeHandle,
|
|
||||||
downBlobFile,
|
|
||||||
tableStyle
|
|
||||||
} = useTable(state)
|
|
||||||
|
|
||||||
// 清空搜索条件
|
// 清空搜索条件
|
||||||
const resetQuery = () => {
|
const resetQuery = () => {
|
||||||
// 清空搜索条件
|
// 清空搜索条件
|
||||||
queryRef.value?.resetFields()
|
queryRef.value?.resetFields()
|
||||||
// 清空多选
|
// 清空多选
|
||||||
selectObjs.value = []
|
selectObjs.value = []
|
||||||
getDataList()
|
getDataList()
|
||||||
}
|
}
|
||||||
|
|
||||||
// 导出excel
|
// 导出excel
|
||||||
const exportExcel = () => {
|
const exportExcel = () => {
|
||||||
downBlobFile('/hard/hardAfterSale/export', Object.assign(state.queryForm, { ids: selectObjs }), 'hardAfterSale.xlsx')
|
downBlobFile("/hard/hardAfterSale/export", Object.assign(state.queryForm, { ids: selectObjs }), "hardAfterSale.xlsx")
|
||||||
}
|
}
|
||||||
|
|
||||||
// 多选事件
|
// 多选事件
|
||||||
const selectionChangHandle = (objs: { id: string }[]) => {
|
const selectionChangHandle = (objs: { id: string }[]) => {
|
||||||
selectObjs.value = objs.map(({ id }) => id);
|
selectObjs.value = objs.map(({ id }) => id)
|
||||||
multiple.value = !objs.length;
|
multiple.value = !objs.length
|
||||||
};
|
|
||||||
|
|
||||||
const doRefund = (row: any) => {
|
|
||||||
push({ path: '/hard/hard-after-sale/order-refund', query: { id: row.orderId, type: "apply" } })
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const doRefund = (row: any) => {
|
||||||
|
push({ path: "/hard/hard-after-sale/order-refund", query: { id: row.orderId, type: "apply" } })
|
||||||
|
}
|
||||||
|
|
||||||
// 删除操作
|
// 删除操作
|
||||||
const handleDelete = async (ids: string[]) => {
|
const handleDelete = async (ids: string[]) => {
|
||||||
try {
|
try {
|
||||||
await useMessageBox().confirm('此操作将永久删除');
|
await useMessageBox().confirm("此操作将永久删除")
|
||||||
} catch {
|
} catch {
|
||||||
return;
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await delObjs(ids);
|
await delObjs(ids)
|
||||||
getDataList();
|
getDataList()
|
||||||
useMessage().success('删除成功');
|
useMessage().success("删除成功")
|
||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
useMessage().error(err.msg);
|
useMessage().error(err.msg)
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
</script>
|
</script>
|
||||||
@@ -21,7 +21,7 @@
|
|||||||
<span> {{ globalData.detail.hardName }}</span>
|
<span> {{ globalData.detail.hardName }}</span>
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
<el-descriptions-item label="设备类型: ">
|
<el-descriptions-item label="设备类型: ">
|
||||||
<span> {{ globalData.detail.hardType }}</span>
|
<dict-tag :options="hard_type" :value="globalData.detail.hardType" />
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
<el-descriptions-item label="商品总价: ">
|
<el-descriptions-item label="商品总价: ">
|
||||||
<span class="color-success">
|
<span class="color-success">
|
||||||
@@ -148,6 +148,7 @@ const {
|
|||||||
hard_after_sale_way,
|
hard_after_sale_way,
|
||||||
hard_after_sale_type,
|
hard_after_sale_type,
|
||||||
hard_sale_status,
|
hard_sale_status,
|
||||||
|
hard_type,
|
||||||
} = useDict(
|
} = useDict(
|
||||||
"hard_pay_type",
|
"hard_pay_type",
|
||||||
"hard_order_type",
|
"hard_order_type",
|
||||||
@@ -155,6 +156,7 @@ const {
|
|||||||
"hard_after_sale_way",
|
"hard_after_sale_way",
|
||||||
"hard_after_sale_type",
|
"hard_after_sale_type",
|
||||||
"hard_sale_status",
|
"hard_sale_status",
|
||||||
|
"hard_type",
|
||||||
)
|
)
|
||||||
|
|
||||||
const { query } = useRoute()
|
const { query } = useRoute()
|
||||||
|
|||||||
@@ -58,7 +58,7 @@
|
|||||||
<el-table-column prop="id" label="编号" />
|
<el-table-column prop="id" label="编号" />
|
||||||
<el-table-column prop="name" label="分组名" />
|
<el-table-column prop="name" label="分组名" />
|
||||||
<el-table-column prop="deptName" label="部门" />
|
<el-table-column prop="deptName" label="部门" />
|
||||||
<el-table-column label="操作" width="150">
|
<el-table-column v-auths="['hard_hardGroup_edit', 'hard_hardGroup_del']" label="操作" width="150">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-button
|
<el-button
|
||||||
icon="edit-pen"
|
icon="edit-pen"
|
||||||
|
|||||||
@@ -93,7 +93,12 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="createTime" width="200" label="创建时间" />
|
<el-table-column prop="createTime" width="200" label="创建时间" />
|
||||||
<el-table-column label="操作" fixed="right" width="400">
|
<el-table-column
|
||||||
|
v-auths="['hard_hardManager_edit', 'hard_hardManager_del']"
|
||||||
|
label="操作"
|
||||||
|
fixed="right"
|
||||||
|
width="400"
|
||||||
|
>
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<el-button
|
<el-button
|
||||||
icon="edit-pen"
|
icon="edit-pen"
|
||||||
|
|||||||
@@ -1,65 +1,99 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="layout-padding">
|
<div class="layout-padding">
|
||||||
<div class="layout-padding-auto layout-padding-view">
|
<div class="layout-padding-auto layout-padding-view">
|
||||||
<el-row>
|
<el-row>
|
||||||
<div class="mb8" style="width: 100%">
|
<div class="mb8" style="width: 100%">
|
||||||
<el-button icon="folder-add" type="primary" class="ml10" @click="formDialogRef.openDialog()"
|
<el-button
|
||||||
v-auth="'wallet_walletType_add'">
|
icon="folder-add"
|
||||||
新 增
|
type="primary"
|
||||||
</el-button>
|
class="ml10"
|
||||||
<el-button plain :disabled="multiple" icon="Delete" type="primary" v-auth="'wallet_walletType_del'"
|
@click="formDialogRef.openDialog()"
|
||||||
@click="handleDelete(selectObjs)">
|
v-auth="'wallet_walletType_add'"
|
||||||
删除
|
>
|
||||||
</el-button>
|
新 增
|
||||||
<right-toolbar :search="false" v-model:showSearch="showSearch" :export="'wallet_walletType_export'"
|
</el-button>
|
||||||
@exportExcel="exportExcel" class="ml10 mr20" style="float: right;"
|
<el-button
|
||||||
@queryTable="getDataList"></right-toolbar>
|
plain
|
||||||
</div>
|
:disabled="multiple"
|
||||||
</el-row>
|
icon="Delete"
|
||||||
<el-table :data="state.dataList" v-loading="state.loading" border :cell-style="tableStyle.cellStyle"
|
type="primary"
|
||||||
:header-cell-style="tableStyle.headerCellStyle" @selection-change="selectionChangHandle"
|
v-auth="'wallet_walletType_del'"
|
||||||
@sort-change="sortChangeHandle">
|
@click="handleDelete(selectObjs)"
|
||||||
<el-table-column type="selection" width="40" align="center" />
|
>
|
||||||
<el-table-column type="index" label="#" width="40" />
|
删除
|
||||||
<el-table-column prop="icon" label="钱包图标" show-overflow-tooltip>
|
</el-button>
|
||||||
<template #default="{ row }">
|
<right-toolbar
|
||||||
<preview-image :src="row.icon" />
|
:search="false"
|
||||||
</template>
|
v-model:showSearch="showSearch"
|
||||||
</el-table-column>
|
:export="'wallet_walletType_export'"
|
||||||
<el-table-column prop="name" label="钱包名" show-overflow-tooltip />
|
@exportExcel="exportExcel"
|
||||||
<el-table-column prop="uniqueCode" label="饭卡类型" show-overflow-tooltip>
|
class="ml10 mr20"
|
||||||
<template #default="{ row }">
|
style="float: right"
|
||||||
<dict-tag :options="wallet_type" :value="row.uniqueCode" />
|
@queryTable="getDataList"
|
||||||
</template>
|
></right-toolbar>
|
||||||
</el-table-column>
|
</div>
|
||||||
<el-table-column label="操作" width="150">
|
</el-row>
|
||||||
<template #default="scope">
|
<el-table
|
||||||
<el-button icon="edit-pen" text type="primary" v-auth="'wallet_walletType_edit'"
|
:data="state.dataList"
|
||||||
@click="formDialogRef.openDialog(scope.row.id)">编辑</el-button>
|
v-loading="state.loading"
|
||||||
<el-button icon="delete" text type="primary" v-auth="'wallet_walletType_del'"
|
border
|
||||||
@click="handleDelete([scope.row.id])">删除</el-button>
|
:cell-style="tableStyle.cellStyle"
|
||||||
</template>
|
:header-cell-style="tableStyle.headerCellStyle"
|
||||||
</el-table-column>
|
@selection-change="selectionChangHandle"
|
||||||
</el-table>
|
@sort-change="sortChangeHandle"
|
||||||
<pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle" v-bind="state.pagination" />
|
>
|
||||||
</div>
|
<el-table-column type="selection" width="40" align="center" />
|
||||||
|
<el-table-column type="index" label="#" width="40" />
|
||||||
|
<el-table-column prop="icon" label="钱包图标" show-overflow-tooltip>
|
||||||
|
<template #default="{ row }">
|
||||||
|
<preview-image :src="row.icon" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="name" label="钱包名" show-overflow-tooltip />
|
||||||
|
<el-table-column prop="uniqueCode" label="饭卡类型" show-overflow-tooltip>
|
||||||
|
<template #default="{ row }">
|
||||||
|
<dict-tag :options="wallet_type" :value="row.uniqueCode" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column v-auths="['wallet_walletType_edit', 'wallet_walletType_del']" label="操作" width="150">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-button
|
||||||
|
icon="edit-pen"
|
||||||
|
text
|
||||||
|
type="primary"
|
||||||
|
v-auth="'wallet_walletType_edit'"
|
||||||
|
@click="formDialogRef.openDialog(scope.row.id)"
|
||||||
|
>编辑</el-button
|
||||||
|
>
|
||||||
|
<el-button
|
||||||
|
icon="delete"
|
||||||
|
text
|
||||||
|
type="primary"
|
||||||
|
v-auth="'wallet_walletType_del'"
|
||||||
|
@click="handleDelete([scope.row.id])"
|
||||||
|
>删除</el-button
|
||||||
|
>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle" v-bind="state.pagination" />
|
||||||
|
</div>
|
||||||
|
|
||||||
<!-- 编辑、新增 -->
|
<!-- 编辑、新增 -->
|
||||||
<form-dialog ref="formDialogRef" @refresh="getDataList(false)" />
|
<form-dialog ref="formDialogRef" @refresh="getDataList(false)" />
|
||||||
|
</div>
|
||||||
</div>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts" name="systemWalletType">
|
<script setup lang="ts" name="systemWalletType">
|
||||||
import { BasicTableProps, useTable } from "/@/hooks/table";
|
import { BasicTableProps, useTable } from "/@/hooks/table"
|
||||||
import { fetchList, delObjs } from '/@/api/wallet/wallet-type'
|
import { fetchList, delObjs } from "/@/api/wallet/wallet-type"
|
||||||
import { useMessage, useMessageBox } from "/@/hooks/message";
|
import { useMessage, useMessageBox } from "/@/hooks/message"
|
||||||
import { useDict } from '/@/hooks/dict';
|
import { useDict } from "/@/hooks/dict"
|
||||||
|
|
||||||
// 引入组件
|
// 引入组件
|
||||||
const FormDialog = defineAsyncComponent(() => import('./form.vue'));
|
const FormDialog = defineAsyncComponent(() => import("./form.vue"))
|
||||||
// 定义查询字典
|
// 定义查询字典
|
||||||
const { wallet_type } = useDict('wallet_type');
|
const { wallet_type } = useDict("wallet_type")
|
||||||
// 定义变量内容
|
// 定义变量内容
|
||||||
const formDialogRef = ref()
|
const formDialogRef = ref()
|
||||||
// 搜索变量
|
// 搜索变量
|
||||||
@@ -70,54 +104,48 @@ const selectObjs = ref([]) as any
|
|||||||
const multiple = ref(true)
|
const multiple = ref(true)
|
||||||
|
|
||||||
const state: BasicTableProps = reactive<BasicTableProps>({
|
const state: BasicTableProps = reactive<BasicTableProps>({
|
||||||
queryForm: {},
|
queryForm: {},
|
||||||
pageList: fetchList
|
pageList: fetchList,
|
||||||
})
|
})
|
||||||
|
|
||||||
// table hook
|
// table hook
|
||||||
const {
|
const { getDataList, currentChangeHandle, sizeChangeHandle, sortChangeHandle, downBlobFile, tableStyle } =
|
||||||
getDataList,
|
useTable(state)
|
||||||
currentChangeHandle,
|
|
||||||
sizeChangeHandle,
|
|
||||||
sortChangeHandle,
|
|
||||||
downBlobFile,
|
|
||||||
tableStyle
|
|
||||||
} = useTable(state)
|
|
||||||
|
|
||||||
// 清空搜索条件
|
// 清空搜索条件
|
||||||
const resetQuery = () => {
|
const resetQuery = () => {
|
||||||
// 清空搜索条件
|
// 清空搜索条件
|
||||||
queryRef.value?.resetFields()
|
queryRef.value?.resetFields()
|
||||||
// 清空多选
|
// 清空多选
|
||||||
selectObjs.value = []
|
selectObjs.value = []
|
||||||
getDataList()
|
getDataList()
|
||||||
}
|
}
|
||||||
|
|
||||||
// 导出excel
|
// 导出excel
|
||||||
const exportExcel = () => {
|
const exportExcel = () => {
|
||||||
downBlobFile('/wallet/walletType/export', Object.assign(state.queryForm, { ids: selectObjs }), 'walletType.xlsx')
|
downBlobFile("/wallet/walletType/export", Object.assign(state.queryForm, { ids: selectObjs }), "walletType.xlsx")
|
||||||
}
|
}
|
||||||
|
|
||||||
// 多选事件
|
// 多选事件
|
||||||
const selectionChangHandle = (objs: { id: string }[]) => {
|
const selectionChangHandle = (objs: { id: string }[]) => {
|
||||||
selectObjs.value = objs.map(({ id }) => id);
|
selectObjs.value = objs.map(({ id }) => id)
|
||||||
multiple.value = !objs.length;
|
multiple.value = !objs.length
|
||||||
};
|
}
|
||||||
|
|
||||||
// 删除操作
|
// 删除操作
|
||||||
const handleDelete = async (ids: string[]) => {
|
const handleDelete = async (ids: string[]) => {
|
||||||
try {
|
try {
|
||||||
await useMessageBox().confirm('此操作将永久删除');
|
await useMessageBox().confirm("此操作将永久删除")
|
||||||
} catch {
|
} catch {
|
||||||
return;
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await delObjs(ids);
|
await delObjs(ids)
|
||||||
getDataList();
|
getDataList()
|
||||||
useMessage().success('删除成功');
|
useMessage().success("删除成功")
|
||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
useMessage().error(err.msg);
|
useMessage().error(err.msg)
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
</script>
|
</script>
|
||||||
Reference in new issue
Block a user