-
+
-
-
+ :title="ele.label" />
+
@@ -60,16 +59,11 @@ defineOptions({
开奖记录
-
-
- 重置数量
-
+ 重置数量
-
- 设置规则
-
+
设置规则
\ No newline at end of file
+
diff --git a/src/views/Decorate/decorateList/hook.tsx b/src/views/Decorate/decorateList/hook.tsx
index 07a5ce1..95d5e60 100644
--- a/src/views/Decorate/decorateList/hook.tsx
+++ b/src/views/Decorate/decorateList/hook.tsx
@@ -1,6 +1,7 @@
import { ref, h } from "vue";
import editForm from "./form.vue";
import { message } from "@/utils/message";
+import { verifyPassword } from "@/utils/passwordVerify";
import {
queryList,
addDataProp,
@@ -10,8 +11,8 @@ import {
queryClassifyList
} from "@/api/modules/decorate";
import { addDialog } from "@/components/ReDialog";
-import priceList from './priceList.vue'
-import donateForm from './donateForm.vue'
+import priceList from "./priceList.vue";
+import donateForm from "./donateForm.vue";
export function useData() {
const formRef = ref();
const loading = ref(true);
@@ -79,16 +80,19 @@ export function useData() {
label: "是否显示",
prop: "show_status",
cellRenderer: ({ row }) => (
- {row.show_status === 1 ? '正常' : '隐藏'}
- ),
+
+ {row.show_status === 1 ? "正常" : "隐藏"}
+
+ )
},
{
label: "是否可购买",
prop: "status_str",
cellRenderer: ({ row }) => (
- {row.is_buy
- === 1 ? '是' : '否'}
- ),
+
+ {row.is_buy === 1 ? "是" : "否"}
+
+ )
},
{
label: "创建时间",
@@ -101,9 +105,9 @@ export function useData() {
slot: "operation"
}
]);
- const onSearch = async (formData) => {
+ const onSearch = async formData => {
loading.value = true;
- searchForm.value = { ...formData }
+ searchForm.value = { ...formData };
const { data, code } = await queryList({
...formData,
page: pagination.value.currentPage,
@@ -125,15 +129,18 @@ export function useData() {
onSearch(searchForm.value);
};
const handleDelete = async rowData => {
- const { code } = await deleteDataProp({ id: rowData.id });
- if (code) {
- message(`删除成功`, {
- type: "success"
- });
- onSearch(searchForm.value);
- }
+ // 删除需要二级密码验证
+ verifyPassword(async () => {
+ const { code } = await deleteDataProp({ id: rowData.id });
+ if (code) {
+ message(`删除成功`, {
+ type: "success"
+ });
+ onSearch(searchForm.value);
+ }
+ });
};
- // 新增
+ // 新增/编辑
const openDialog = (title = "新增", rowData: any) => {
addDialog({
title: `${title}`,
@@ -157,37 +164,35 @@ export function useData() {
beforeSure: (done, { options }) => {
const FormRef = formRef.value.getRef();
const curData = options.props.formInline;
- const saveData = async form => {
- const { code } = await addDataProp(form);
- if (code) {
- message("新增成功", { type: "success" });
- onSearch(searchForm.value);
- done();
- } else {
- message("新增失败", { type: "error" });
- }
- };
- const editData = async form => {
- const { code } = await editDataProp({
- ...form,
- id: rowData.id
- });
- if (code) {
- message("修改成功", { type: "success" });
- onSearch(searchForm.value);
- done();
- } else {
- message("修改失败", { type: "error" });
- }
- };
- FormRef.validate(valid => {
- if (valid) {
- // 表单规则校验通过
- if (title === "新增") {
- saveData(curData);
+
+ FormRef.validate(async valid => {
+ if (!valid) return;
+
+ if (title === "新增") {
+ // 新增操作
+ const { code } = await addDataProp(curData);
+ if (code) {
+ message("新增成功", { type: "success" });
+ onSearch(searchForm.value);
+ done();
} else {
- editData(curData)
+ message("新增失败", { type: "error" });
}
+ } else {
+ // 编辑操作 - 需要二级密码验证
+ verifyPassword(async () => {
+ const { code } = await editDataProp({
+ ...curData,
+ id: rowData.id
+ });
+ if (code) {
+ message("修改成功", { type: "success" });
+ onSearch(searchForm.value);
+ done();
+ } else {
+ message("修改失败", { type: "error" });
+ }
+ });
}
});
}
@@ -202,10 +207,10 @@ export function useData() {
width: "60%",
closeOnClickModal: false,
hideFooter: true,
- contentRenderer: () => h(priceList, { ref: formRef, formInline: null }),
+ contentRenderer: () => h(priceList, { ref: formRef, formInline: null })
});
- }
- const sendGift = (rowData) => {
+ };
+ const sendGift = rowData => {
addDialog({
title: `赠送道具`,
props: {
@@ -221,36 +226,39 @@ export function useData() {
beforeSure: (done, { options }) => {
const FormRef = formRef.value.getRef();
const curData = options.props.formInline;
- const saveData = async form => {
- form.decorate_id = rowData.id
- const { code, msg } = await giveDecorate(form);
- if (code) {
- message("新增成功", { type: "success" });
- onSearch(searchForm.value);
- done();
- } else {
- message(msg, { type: "error" });
- }
- };
- FormRef.validate(valid => {
- if (valid) {
- saveData(curData);
- }
+
+ FormRef.validate(async valid => {
+ if (!valid) return;
+
+ // 赠送操作 - 需要二级密码验证
+ verifyPassword(async () => {
+ curData.decorate_id = rowData.id;
+ const { code, msg } = await giveDecorate(curData);
+ if (code) {
+ message("赠送成功", { type: "success" });
+ onSearch(searchForm.value);
+ done();
+ } else {
+ message(msg, { type: "error" });
+ }
+ });
});
}
});
- }
+ };
const getType = async () => {
const { data, code } = await queryClassifyList();
if (code) {
- searchLabel.value[searchLabel.value.length - 1].optionList = data.map(ele => {
- return {
- value: ele.id,
- label: ele.name
+ searchLabel.value[searchLabel.value.length - 1].optionList = data.map(
+ ele => {
+ return {
+ value: ele.id,
+ label: ele.name
+ };
}
- })
+ );
}
- }
+ };
return {
searchForm,
searchLabel,
@@ -267,6 +275,5 @@ export function useData() {
settingPrice,
sendGift,
getType
-
};
}
diff --git a/src/views/Decorate/decorateList/priceList.vue b/src/views/Decorate/decorateList/priceList.vue
index 2eddb9a..6c31c9d 100644
--- a/src/views/Decorate/decorateList/priceList.vue
+++ b/src/views/Decorate/decorateList/priceList.vue
@@ -1,16 +1,22 @@
@@ -143,7 +151,7 @@ const handleDelete = async rowData => {
@refresh="getPriceList">
-
+
新增价格
@@ -154,7 +162,6 @@ const handleDelete = async rowData => {
background: 'var(--el-fill-color-light)',
color: 'var(--el-text-color-primary)'
}" @page-current-change="handleCurrentChange" @page-size-change="handleSizeChange">
-
@@ -163,9 +170,7 @@ const handleDelete = async rowData => {
-
- 删除
-
+ 删除
diff --git a/src/views/Statistical/giftRecord/hook.tsx b/src/views/Statistical/giftRecord/hook.tsx
index b52ee86..1282eaf 100644
--- a/src/views/Statistical/giftRecord/hook.tsx
+++ b/src/views/Statistical/giftRecord/hook.tsx
@@ -98,6 +98,10 @@ export function useData() {
)
},
+ {
+ label: "备注",
+ prop: "remarks"
+ },
{
label: "生成时间",
prop: "createtime"
diff --git a/src/views/gift/giftClassif/hook.tsx b/src/views/gift/giftClassif/hook.tsx
index 18fdc91..dcb1226 100644
--- a/src/views/gift/giftClassif/hook.tsx
+++ b/src/views/gift/giftClassif/hook.tsx
@@ -1,6 +1,7 @@
import { ref, h } from "vue";
import editForm from "./form.vue";
import { message } from "@/utils/message";
+import { verifyPassword } from "@/utils/passwordVerify";
import {
queryClassifyList,
addClassifyData,
@@ -16,9 +17,7 @@ export function useData() {
const searchForm = ref({
name: ""
});
- const searchLabel = ref([
- { label: "标签名称", prop: "name", type: "input" }
- ]);
+ const searchLabel = ref([{ label: "标签名称", prop: "name", type: "input" }]);
const pagination = ref({
total: 0,
pageSize: 10,
@@ -55,9 +54,9 @@ export function useData() {
slot: "operation"
}
]);
- const onSearch = async (formData) => {
+ const onSearch = async formData => {
loading.value = true;
- searchForm.value = { ...formData }
+ searchForm.value = { ...formData };
const { data, code } = await queryClassifyList({
...formData,
page: pagination.value.currentPage,
@@ -78,16 +77,20 @@ export function useData() {
pagination.value.currentPage = val;
onSearch(searchForm.value);
};
+
const handleDelete = async rowData => {
- const { code } = await removeClassifyData({ id: rowData.id });
- if (code) {
- message(`您删除了标签名称为${rowData.name}的这条数据`, {
- type: "success"
- });
- onSearch(searchForm.value);
- }
+ // 输入二级密码
+ verifyPassword(async () => {
+ const { code } = await removeClassifyData({ id: rowData.id });
+ if (code) {
+ message(`您删除了标签名称为${rowData.name}的这条数据`, {
+ type: "success"
+ });
+ onSearch(searchForm.value);
+ }
+ });
};
- // 新增
+ // 新增/编辑
const openDialog = (title = "新增", rowData: any) => {
addDialog({
title: `${title}礼物标签`,
@@ -104,40 +107,35 @@ export function useData() {
beforeSure: (done, { options }) => {
const FormRef = formRef.value.getRef();
const curData = options.props.formInline;
- const saveData = async form => {
- const { code } = await addClassifyData(form);
- if (code) {
- message("新增成功", { type: "success" });
- onSearch(searchForm.value);
- done();
- } else {
- message("新增失败", { type: "error" });
- }
- };
- const updateData = async form => {
- const { code } = await editClassifyData({
- ...form,
- id: rowData.id
- });
- if (code) {
- message("修改成功", { type: "success" });
- onSearch(searchForm.value);
- done();
- } else {
- message("修改失败", { type: "error" });
- }
- };
- FormRef.validate(valid => {
- if (valid) {
- console.log("curData", curData);
- // 表单规则校验通过
- if (title === "新增") {
- // 实际开发先调用新增接口,再进行下面操作
- saveData(curData);
+
+ FormRef.validate(async valid => {
+ if (!valid) return;
+
+ if (title === "新增") {
+ // 新增操作
+ const { code } = await addClassifyData(curData);
+ if (code) {
+ message("新增成功", { type: "success" });
+ onSearch(searchForm.value);
+ done();
} else {
- // 实际开发先调用修改接口,再进行下面操作
- updateData(curData);
+ message("新增失败", { type: "error" });
}
+ } else {
+ // 修改操作 - 需要二级密码验证
+ verifyPassword(async () => {
+ const { code } = await editClassifyData({
+ ...curData,
+ id: rowData.id
+ });
+ if (code) {
+ message("修改成功", { type: "success" });
+ onSearch(searchForm.value);
+ done(); // 关闭编辑对话框
+ } else {
+ message("修改失败", { type: "error" });
+ }
+ });
}
});
}
diff --git a/src/views/gift/giftList/hook.tsx b/src/views/gift/giftList/hook.tsx
index 4645e8e..10ec138 100644
--- a/src/views/gift/giftList/hook.tsx
+++ b/src/views/gift/giftList/hook.tsx
@@ -1,6 +1,7 @@
import { ref, h } from "vue";
import editForm from "./form.vue";
import { message } from "@/utils/message";
+import { verifyPassword } from "@/utils/passwordVerify";
import { getGiftTypeOrLabel } from "@/api/modules/gift";
import {
queryGiftList,
@@ -184,13 +185,16 @@ export function useData() {
onSearch(searchForm.value);
};
const handleDelete = async rowData => {
- const { code } = await removeGiftData({ gid: rowData.gid });
- if (code) {
- message(`您删除了礼物名称为【${rowData.gift_name}】的这条数据`, {
- type: "success"
- });
- onSearch(searchForm.value);
- }
+ // 输入二级密码
+ verifyPassword(async () => {
+ const { code } = await removeGiftData({ gid: rowData.gid });
+ if (code) {
+ message(`您删除了礼物名称为【${rowData.gift_name}】的这条数据`, {
+ type: "success"
+ });
+ onSearch(searchForm.value);
+ }
+ });
};
// 新增
const openDialog = async (title = "新增", rowData: any) => {
@@ -231,18 +235,21 @@ export function useData() {
message(msg, { type: "error" });
}
};
- const updateData = async form => {
- const { code, msg } = await editGiftData({
- ...form,
- gid: rowData.gid
+ const updateData = async (form, editDialogDone) => {
+ // 修改时需要二级密码验证
+ verifyPassword(async () => {
+ const { code, msg } = await editGiftData({
+ ...form,
+ gid: rowData.gid
+ });
+ if (code) {
+ message("修改成功", { type: "success" });
+ onSearch(searchForm.value);
+ editDialogDone(); // 关闭编辑对话框
+ } else {
+ message(msg, { type: "error" });
+ }
});
- if (code) {
- message("修改成功", { type: "success" });
- onSearch(searchForm.value);
- done();
- } else {
- message(msg, { type: "error" });
- }
};
FormRef.validate(valid => {
if (valid) {
@@ -253,7 +260,7 @@ export function useData() {
saveData(curData);
} else {
// 实际开发先调用修改接口,再进行下面操作
- updateData(curData);
+ updateData(curData, done);
}
}
});
diff --git a/src/views/room/roomList/detail.vue b/src/views/room/roomList/detail.vue
index 1106831..5c1e255 100644
--- a/src/views/room/roomList/detail.vue
+++ b/src/views/room/roomList/detail.vue
@@ -310,10 +310,10 @@ const exportExcal = async () => {
导出当前数据
幸运值流水总计:
{{
- PriceTotal.total_lucky_coin
+ PriceTotal.total_lucky_coin || 0
}}
;流水总计:
{{
- PriceTotal.total_price
+ PriceTotal.total_price || 0
}}
金币