更新
This commit is contained in:
@@ -1,8 +1,9 @@
|
|||||||
import { ref, h } from "vue";
|
import { ref, h } from "vue";
|
||||||
import editForm from "./form.vue";
|
import editForm from "./form.vue";
|
||||||
import { message } from "@/utils/message";
|
import { message } from "@/utils/message";
|
||||||
|
import { verifyPassword } from "@/utils/passwordVerify";
|
||||||
import recordList from "./record.vue";
|
import recordList from "./record.vue";
|
||||||
import giftPackView from '../giftPack/index.vue';
|
import giftPackView from "../giftPack/index.vue";
|
||||||
import {
|
import {
|
||||||
queryFirstCharge,
|
queryFirstCharge,
|
||||||
addChargeTypeData,
|
addChargeTypeData,
|
||||||
@@ -80,6 +81,8 @@ export function useData() {
|
|||||||
onSearch();
|
onSearch();
|
||||||
};
|
};
|
||||||
const handleDelete = async rowData => {
|
const handleDelete = async rowData => {
|
||||||
|
// 删除需要二级密码验证
|
||||||
|
verifyPassword(async () => {
|
||||||
const { code } = await deteleChargeTypeData({ id: rowData.id });
|
const { code } = await deteleChargeTypeData({ id: rowData.id });
|
||||||
if (code) {
|
if (code) {
|
||||||
message(`您删除了名称为${rowData.name}的这条数据`, {
|
message(`您删除了名称为${rowData.name}的这条数据`, {
|
||||||
@@ -87,6 +90,7 @@ export function useData() {
|
|||||||
});
|
});
|
||||||
onSearch();
|
onSearch();
|
||||||
}
|
}
|
||||||
|
});
|
||||||
};
|
};
|
||||||
const DistributionRecord = () => {
|
const DistributionRecord = () => {
|
||||||
addDialog({
|
addDialog({
|
||||||
@@ -94,10 +98,10 @@ export function useData() {
|
|||||||
width: "60%",
|
width: "60%",
|
||||||
closeOnClickModal: false,
|
closeOnClickModal: false,
|
||||||
hideFooter: true,
|
hideFooter: true,
|
||||||
contentRenderer: () => h(recordList, { ref: formRef, formInline: null }),
|
contentRenderer: () => h(recordList, { ref: formRef, formInline: null })
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
// 新增
|
// 新增/编辑首充分类
|
||||||
const openDialog = (title = "新增", rowData: any) => {
|
const openDialog = (title = "新增", rowData: any) => {
|
||||||
addDialog({
|
addDialog({
|
||||||
title: `${title}首充分类`,
|
title: `${title}首充分类`,
|
||||||
@@ -117,8 +121,14 @@ export function useData() {
|
|||||||
beforeSure: (done, { options }) => {
|
beforeSure: (done, { options }) => {
|
||||||
const FormRef = formRef.value.getRef();
|
const FormRef = formRef.value.getRef();
|
||||||
const curData = options.props.formInline;
|
const curData = options.props.formInline;
|
||||||
const saveData = async form => {
|
|
||||||
const { code } = await addChargeTypeData(form);
|
FormRef.validate(async valid => {
|
||||||
|
if (!valid) return;
|
||||||
|
|
||||||
|
if (title === "新增") {
|
||||||
|
// 增加首充类型 - 需要二级密码验证
|
||||||
|
verifyPassword(async () => {
|
||||||
|
const { code } = await addChargeTypeData(curData);
|
||||||
if (code) {
|
if (code) {
|
||||||
message("新增成功", { type: "success" });
|
message("新增成功", { type: "success" });
|
||||||
onSearch();
|
onSearch();
|
||||||
@@ -126,10 +136,12 @@ export function useData() {
|
|||||||
} else {
|
} else {
|
||||||
message("新增失败", { type: "error" });
|
message("新增失败", { type: "error" });
|
||||||
}
|
}
|
||||||
};
|
});
|
||||||
const updateData = async form => {
|
} else {
|
||||||
|
// 编辑操作 - 需要二级密码验证
|
||||||
|
verifyPassword(async () => {
|
||||||
const { code } = await editChargeTypeData({
|
const { code } = await editChargeTypeData({
|
||||||
...form,
|
...curData,
|
||||||
id: rowData.id
|
id: rowData.id
|
||||||
});
|
});
|
||||||
if (code) {
|
if (code) {
|
||||||
@@ -139,18 +151,7 @@ export function useData() {
|
|||||||
} else {
|
} else {
|
||||||
message("修改失败", { type: "error" });
|
message("修改失败", { type: "error" });
|
||||||
}
|
}
|
||||||
};
|
});
|
||||||
FormRef.validate(valid => {
|
|
||||||
if (valid) {
|
|
||||||
console.log("curData", curData);
|
|
||||||
// 表单规则校验通过
|
|
||||||
if (title === "新增") {
|
|
||||||
// 实际开发先调用新增接口,再进行下面操作
|
|
||||||
saveData(curData);
|
|
||||||
} else {
|
|
||||||
// 实际开发先调用修改接口,再进行下面操作
|
|
||||||
updateData(curData);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -166,9 +167,9 @@ export function useData() {
|
|||||||
props: {
|
props: {
|
||||||
rowData
|
rowData
|
||||||
},
|
},
|
||||||
contentRenderer: () => h(giftPackView, { ref: formRef, formInline: null }),
|
contentRenderer: () => h(giftPackView, { ref: formRef, formInline: null })
|
||||||
});
|
});
|
||||||
}
|
};
|
||||||
return {
|
return {
|
||||||
onSearch,
|
onSearch,
|
||||||
isShow,
|
isShow,
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import { ref, h, nextTick } from "vue";
|
import { ref, h, nextTick } from "vue";
|
||||||
import editForm from "./form.vue";
|
import editForm from "./form.vue";
|
||||||
import { message } from "@/utils/message";
|
import { message } from "@/utils/message";
|
||||||
|
import { verifyPassword } from "@/utils/passwordVerify";
|
||||||
import {
|
import {
|
||||||
queryGiftPack,
|
queryGiftPack,
|
||||||
addGiftPackData,
|
addGiftPackData,
|
||||||
@@ -10,7 +11,7 @@ import {
|
|||||||
import { addDialog } from "@/components/ReDialog";
|
import { addDialog } from "@/components/ReDialog";
|
||||||
export function useData() {
|
export function useData() {
|
||||||
const formRef = ref();
|
const formRef = ref();
|
||||||
const propRowData = ref(null)
|
const propRowData = ref(null);
|
||||||
const loading = ref(true);
|
const loading = ref(true);
|
||||||
const tableList = ref([]);
|
const tableList = ref([]);
|
||||||
const isShow = ref(false);
|
const isShow = ref(false);
|
||||||
@@ -66,8 +67,8 @@ export function useData() {
|
|||||||
slot: "operation"
|
slot: "operation"
|
||||||
}
|
}
|
||||||
]);
|
]);
|
||||||
const onSearch = async (rowData) => {
|
const onSearch = async rowData => {
|
||||||
propRowData.value = { ...rowData }
|
propRowData.value = { ...rowData };
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
const { data, code } = await queryGiftPack({
|
const { data, code } = await queryGiftPack({
|
||||||
gift_bag_id: propRowData.value.id,
|
gift_bag_id: propRowData.value.id,
|
||||||
@@ -78,7 +79,7 @@ export function useData() {
|
|||||||
tableList.value = data.lists.map(ele => {
|
tableList.value = data.lists.map(ele => {
|
||||||
return {
|
return {
|
||||||
...ele
|
...ele
|
||||||
}
|
};
|
||||||
});
|
});
|
||||||
pagination.value.total = data.count;
|
pagination.value.total = data.count;
|
||||||
pagination.value.currentPage = data.page;
|
pagination.value.currentPage = data.page;
|
||||||
@@ -93,7 +94,7 @@ export function useData() {
|
|||||||
pagination.value.currentPage = val;
|
pagination.value.currentPage = val;
|
||||||
onSearch(propRowData.value);
|
onSearch(propRowData.value);
|
||||||
};
|
};
|
||||||
// 新增
|
// 新增/编辑礼物
|
||||||
const openDialog = (title = "新增", rowData: any) => {
|
const openDialog = (title = "新增", rowData: any) => {
|
||||||
addDialog({
|
addDialog({
|
||||||
title: `${title}礼物`,
|
title: `${title}礼物`,
|
||||||
@@ -102,8 +103,7 @@ export function useData() {
|
|||||||
type: rowData?.type ?? "",
|
type: rowData?.type ?? "",
|
||||||
num: rowData?.num ?? "",
|
num: rowData?.num ?? "",
|
||||||
gift_id: rowData?.gift_id ?? "",
|
gift_id: rowData?.gift_id ?? "",
|
||||||
gift_bag_id: propRowData.value.id ?? "",
|
gift_bag_id: propRowData.value.id ?? ""
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
width: "40%",
|
width: "40%",
|
||||||
@@ -112,8 +112,13 @@ export function useData() {
|
|||||||
beforeSure: (done, { options }) => {
|
beforeSure: (done, { options }) => {
|
||||||
const FormRef = formRef.value.getRef();
|
const FormRef = formRef.value.getRef();
|
||||||
const curData = options.props.formInline;
|
const curData = options.props.formInline;
|
||||||
const saveData = async form => {
|
|
||||||
const { code } = await addGiftPackData(form);
|
FormRef.validate(async valid => {
|
||||||
|
if (!valid) return;
|
||||||
|
|
||||||
|
if (title === "新增") {
|
||||||
|
// 新增操作
|
||||||
|
const { code } = await addGiftPackData(curData);
|
||||||
if (code) {
|
if (code) {
|
||||||
message("新增成功", { type: "success" });
|
message("新增成功", { type: "success" });
|
||||||
onSearch(propRowData.value);
|
onSearch(propRowData.value);
|
||||||
@@ -121,10 +126,11 @@ export function useData() {
|
|||||||
} else {
|
} else {
|
||||||
message("新增失败", { type: "error" });
|
message("新增失败", { type: "error" });
|
||||||
}
|
}
|
||||||
};
|
} else {
|
||||||
const updateData = async form => {
|
// 编辑操作 - 需要二级密码验证
|
||||||
|
verifyPassword(async () => {
|
||||||
const { code } = await editGiftPackData({
|
const { code } = await editGiftPackData({
|
||||||
...form,
|
...curData,
|
||||||
id: rowData.id
|
id: rowData.id
|
||||||
});
|
});
|
||||||
if (code) {
|
if (code) {
|
||||||
@@ -134,24 +140,15 @@ export function useData() {
|
|||||||
} else {
|
} else {
|
||||||
message("修改失败", { type: "error" });
|
message("修改失败", { type: "error" });
|
||||||
}
|
}
|
||||||
};
|
});
|
||||||
FormRef.validate(valid => {
|
|
||||||
if (valid) {
|
|
||||||
console.log("curData", curData);
|
|
||||||
// 表单规则校验通过
|
|
||||||
if (title === "新增") {
|
|
||||||
// 实际开发先调用新增接口,再进行下面操作
|
|
||||||
saveData(curData);
|
|
||||||
} else {
|
|
||||||
// 实际开发先调用修改接口,再进行下面操作
|
|
||||||
updateData(curData);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
const handleDelete = async rowData => {
|
const handleDelete = async rowData => {
|
||||||
|
// 删除需要二级密码验证
|
||||||
|
verifyPassword(async () => {
|
||||||
const { code } = await deteleGiftPackData({ id: rowData.id });
|
const { code } = await deteleGiftPackData({ id: rowData.id });
|
||||||
if (code) {
|
if (code) {
|
||||||
message(`您删除了名称为${rowData.name}的这条数据`, {
|
message(`您删除了名称为${rowData.name}的这条数据`, {
|
||||||
@@ -159,6 +156,7 @@ export function useData() {
|
|||||||
});
|
});
|
||||||
onSearch(propRowData.value);
|
onSearch(propRowData.value);
|
||||||
}
|
}
|
||||||
|
});
|
||||||
};
|
};
|
||||||
return {
|
return {
|
||||||
onSearch,
|
onSearch,
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import { ref, h, nextTick } from "vue";
|
import { ref, h } from "vue";
|
||||||
import editForm from "./form.vue";
|
import editForm from "./form.vue";
|
||||||
import { message } from "@/utils/message";
|
import { message } from "@/utils/message";
|
||||||
|
import { verifyPassword } from "@/utils/passwordVerify";
|
||||||
import {
|
import {
|
||||||
queryGiftPack,
|
queryGiftPack,
|
||||||
addGiftPackData,
|
addGiftPackData,
|
||||||
@@ -10,7 +11,7 @@ import {
|
|||||||
import { addDialog } from "@/components/ReDialog";
|
import { addDialog } from "@/components/ReDialog";
|
||||||
export function useData() {
|
export function useData() {
|
||||||
const formRef = ref();
|
const formRef = ref();
|
||||||
const propRowData = ref(null)
|
const propRowData = ref(null);
|
||||||
const loading = ref(true);
|
const loading = ref(true);
|
||||||
const tableList = ref([]);
|
const tableList = ref([]);
|
||||||
const isShow = ref(false);
|
const isShow = ref(false);
|
||||||
@@ -66,8 +67,8 @@ export function useData() {
|
|||||||
slot: "operation"
|
slot: "operation"
|
||||||
}
|
}
|
||||||
]);
|
]);
|
||||||
const onSearch = async (rowData) => {
|
const onSearch = async rowData => {
|
||||||
propRowData.value = { ...rowData }
|
propRowData.value = { ...rowData };
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
const { data, code } = await queryGiftPack({
|
const { data, code } = await queryGiftPack({
|
||||||
gift_bag_id: propRowData.value.id,
|
gift_bag_id: propRowData.value.id,
|
||||||
@@ -78,7 +79,7 @@ export function useData() {
|
|||||||
tableList.value = data.lists.map(ele => {
|
tableList.value = data.lists.map(ele => {
|
||||||
return {
|
return {
|
||||||
...ele
|
...ele
|
||||||
}
|
};
|
||||||
});
|
});
|
||||||
pagination.value.total = data.count;
|
pagination.value.total = data.count;
|
||||||
pagination.value.currentPage = data.page;
|
pagination.value.currentPage = data.page;
|
||||||
@@ -93,7 +94,7 @@ export function useData() {
|
|||||||
pagination.value.currentPage = val;
|
pagination.value.currentPage = val;
|
||||||
onSearch(propRowData.value);
|
onSearch(propRowData.value);
|
||||||
};
|
};
|
||||||
// 新增
|
// 新增/编辑礼物
|
||||||
const openDialog = (title = "新增", rowData: any) => {
|
const openDialog = (title = "新增", rowData: any) => {
|
||||||
addDialog({
|
addDialog({
|
||||||
title: `${title}礼物`,
|
title: `${title}礼物`,
|
||||||
@@ -102,8 +103,7 @@ export function useData() {
|
|||||||
type: rowData?.type ?? "",
|
type: rowData?.type ?? "",
|
||||||
num: rowData?.num ?? "",
|
num: rowData?.num ?? "",
|
||||||
gift_id: rowData?.gift_id ?? "",
|
gift_id: rowData?.gift_id ?? "",
|
||||||
gift_bag_id: propRowData.value.id,
|
gift_bag_id: propRowData.value.id
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
width: "40%",
|
width: "40%",
|
||||||
@@ -112,8 +112,13 @@ export function useData() {
|
|||||||
beforeSure: (done, { options }) => {
|
beforeSure: (done, { options }) => {
|
||||||
const FormRef = formRef.value.getRef();
|
const FormRef = formRef.value.getRef();
|
||||||
const curData = options.props.formInline;
|
const curData = options.props.formInline;
|
||||||
const saveData = async form => {
|
|
||||||
const { code } = await addGiftPackData(form);
|
FormRef.validate(async valid => {
|
||||||
|
if (!valid) return;
|
||||||
|
|
||||||
|
if (title === "新增") {
|
||||||
|
// 新增操作
|
||||||
|
const { code } = await addGiftPackData(curData);
|
||||||
if (code) {
|
if (code) {
|
||||||
message("新增成功", { type: "success" });
|
message("新增成功", { type: "success" });
|
||||||
onSearch(propRowData.value);
|
onSearch(propRowData.value);
|
||||||
@@ -121,10 +126,11 @@ export function useData() {
|
|||||||
} else {
|
} else {
|
||||||
message("新增失败", { type: "error" });
|
message("新增失败", { type: "error" });
|
||||||
}
|
}
|
||||||
};
|
} else {
|
||||||
const updateData = async form => {
|
// 编辑操作 - 需要二级密码验证
|
||||||
|
verifyPassword(async () => {
|
||||||
const { code } = await editGiftPackData({
|
const { code } = await editGiftPackData({
|
||||||
...form,
|
...curData,
|
||||||
id: rowData.id
|
id: rowData.id
|
||||||
});
|
});
|
||||||
if (code) {
|
if (code) {
|
||||||
@@ -134,24 +140,15 @@ export function useData() {
|
|||||||
} else {
|
} else {
|
||||||
message("修改失败", { type: "error" });
|
message("修改失败", { type: "error" });
|
||||||
}
|
}
|
||||||
};
|
});
|
||||||
FormRef.validate(valid => {
|
|
||||||
if (valid) {
|
|
||||||
console.log("curData", curData);
|
|
||||||
// 表单规则校验通过
|
|
||||||
if (title === "新增") {
|
|
||||||
// 实际开发先调用新增接口,再进行下面操作
|
|
||||||
saveData(curData);
|
|
||||||
} else {
|
|
||||||
// 实际开发先调用修改接口,再进行下面操作
|
|
||||||
updateData(curData);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
const handleDelete = async rowData => {
|
const handleDelete = async rowData => {
|
||||||
|
// 删除需要二级密码验证
|
||||||
|
verifyPassword(async () => {
|
||||||
const { code } = await deteleGiftPackData({ id: rowData.id });
|
const { code } = await deteleGiftPackData({ id: rowData.id });
|
||||||
if (code) {
|
if (code) {
|
||||||
message(`您删除了名称为${rowData.name}的这条数据`, {
|
message(`您删除了名称为${rowData.name}的这条数据`, {
|
||||||
@@ -159,6 +156,7 @@ export function useData() {
|
|||||||
});
|
});
|
||||||
onSearch(propRowData.value);
|
onSearch(propRowData.value);
|
||||||
}
|
}
|
||||||
|
});
|
||||||
};
|
};
|
||||||
return {
|
return {
|
||||||
onSearch,
|
onSearch,
|
||||||
|
|||||||
@@ -1,12 +1,10 @@
|
|||||||
import { ref, h, nextTick } from "vue";
|
import { ref, h, nextTick } from "vue";
|
||||||
import editForm from "./form.vue";
|
import editForm from "./form.vue";
|
||||||
import { message } from "@/utils/message";
|
import { message } from "@/utils/message";
|
||||||
import recordList from "./record.vue"
|
import { verifyPassword } from "@/utils/passwordVerify";
|
||||||
import giftPackView from './giftPack/index.vue';
|
import recordList from "./record.vue";
|
||||||
import {
|
import giftPackView from "./giftPack/index.vue";
|
||||||
getGoodGiftInfo,
|
import { getGoodGiftInfo, setGoodGiftConfig } from "@/api/modules/activities";
|
||||||
setGoodGiftConfig
|
|
||||||
} from "@/api/modules/activities";
|
|
||||||
import { addDialog } from "@/components/ReDialog";
|
import { addDialog } from "@/components/ReDialog";
|
||||||
export function useData() {
|
export function useData() {
|
||||||
const formRef = ref();
|
const formRef = ref();
|
||||||
@@ -37,8 +35,10 @@ export function useData() {
|
|||||||
label: "状态",
|
label: "状态",
|
||||||
prop: "status",
|
prop: "status",
|
||||||
cellRenderer: ({ row }) => (
|
cellRenderer: ({ row }) => (
|
||||||
<el-tag type={row.status === 1 ? 'success' : 'info'}>{row.status === 1 ? '正常' : '隐藏'}</el-tag>
|
<el-tag type={row.status === 1 ? "success" : "info"}>
|
||||||
),
|
{row.status === 1 ? "正常" : "隐藏"}
|
||||||
|
</el-tag>
|
||||||
|
)
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "介绍内容",
|
label: "介绍内容",
|
||||||
@@ -58,6 +58,7 @@ export function useData() {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "操作",
|
label: "操作",
|
||||||
|
width: 220,
|
||||||
fixed: "right",
|
fixed: "right",
|
||||||
slot: "operation"
|
slot: "operation"
|
||||||
}
|
}
|
||||||
@@ -84,9 +85,9 @@ export function useData() {
|
|||||||
onSearch();
|
onSearch();
|
||||||
};
|
};
|
||||||
const setConfig = async () => {
|
const setConfig = async () => {
|
||||||
let rowData = {}
|
let rowData = {};
|
||||||
const { data, code } = await getGoodGiftInfo({})
|
const { data, code } = await getGoodGiftInfo({});
|
||||||
rowData = code ? data : null
|
rowData = code ? data : null;
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
addDialog({
|
addDialog({
|
||||||
title: `设置配置`,
|
title: `设置配置`,
|
||||||
@@ -99,7 +100,7 @@ export function useData() {
|
|||||||
money: rowData?.money ?? "",
|
money: rowData?.money ?? "",
|
||||||
money_str: rowData?.money_str ?? "",
|
money_str: rowData?.money_str ?? "",
|
||||||
diamond: rowData?.diamond ?? "",
|
diamond: rowData?.diamond ?? "",
|
||||||
activity_end_time: rowData?.activity_end_time ?? "",
|
activity_end_time: rowData?.activity_end_time ?? ""
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
width: "40%",
|
width: "40%",
|
||||||
@@ -108,26 +109,25 @@ export function useData() {
|
|||||||
beforeSure: (done, { options }) => {
|
beforeSure: (done, { options }) => {
|
||||||
const FormRef = formRef.value.getRef();
|
const FormRef = formRef.value.getRef();
|
||||||
const curData = options.props.formInline;
|
const curData = options.props.formInline;
|
||||||
const saveData = async form => {
|
|
||||||
const { code } = await setGoodGiftConfig(form);
|
FormRef.validate(async valid => {
|
||||||
|
if (!valid) return;
|
||||||
|
|
||||||
|
// 设置配置需要二级密码验证
|
||||||
|
verifyPassword(async () => {
|
||||||
|
const { code } = await setGoodGiftConfig(curData);
|
||||||
if (code) {
|
if (code) {
|
||||||
message("新增成功", { type: "success" });
|
message("设置成功", { type: "success" });
|
||||||
onSearch();
|
onSearch();
|
||||||
done();
|
done();
|
||||||
} else {
|
} else {
|
||||||
message("新增失败", { type: "error" });
|
message("设置失败", { type: "error" });
|
||||||
}
|
|
||||||
};
|
|
||||||
FormRef.validate(valid => {
|
|
||||||
if (valid) {
|
|
||||||
// console.log("curData", curData);
|
|
||||||
saveData(curData);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
})
|
});
|
||||||
|
|
||||||
};
|
};
|
||||||
const DistributionRecord = () => {
|
const DistributionRecord = () => {
|
||||||
addDialog({
|
addDialog({
|
||||||
@@ -135,10 +135,10 @@ export function useData() {
|
|||||||
width: "60%",
|
width: "60%",
|
||||||
closeOnClickModal: false,
|
closeOnClickModal: false,
|
||||||
hideFooter: true,
|
hideFooter: true,
|
||||||
contentRenderer: () => h(recordList, { ref: formRef, formInline: null }),
|
contentRenderer: () => h(recordList, { ref: formRef, formInline: null })
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
const openGiftPark = (rowData) => {
|
const openGiftPark = rowData => {
|
||||||
addDialog({
|
addDialog({
|
||||||
title: `礼包列表`,
|
title: `礼包列表`,
|
||||||
width: "60%",
|
width: "60%",
|
||||||
@@ -147,9 +147,9 @@ export function useData() {
|
|||||||
props: {
|
props: {
|
||||||
rowData
|
rowData
|
||||||
},
|
},
|
||||||
contentRenderer: () => h(giftPackView, { ref: formRef, formInline: null }),
|
contentRenderer: () => h(giftPackView, { ref: formRef, formInline: null })
|
||||||
});
|
});
|
||||||
}
|
};
|
||||||
return {
|
return {
|
||||||
onSearch,
|
onSearch,
|
||||||
isShow,
|
isShow,
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
import { ref, h } from "vue";
|
import { ref, h } from "vue";
|
||||||
import editForm from "./form.vue";
|
import editForm from "./form.vue";
|
||||||
import { message } from "@/utils/message";
|
import { message } from "@/utils/message";
|
||||||
|
import { verifyPassword } from "@/utils/passwordVerify";
|
||||||
import recordList from "./record.vue";
|
import recordList from "./record.vue";
|
||||||
import giftPackView from '../giftPack/index.vue';
|
import giftPackView from "../giftPack/index.vue";
|
||||||
import {
|
import {
|
||||||
queryFirstCharge,
|
queryFirstCharge,
|
||||||
addChargeTypeData,
|
addChargeTypeData,
|
||||||
@@ -95,10 +96,10 @@ export function useData() {
|
|||||||
width: "60%",
|
width: "60%",
|
||||||
closeOnClickModal: false,
|
closeOnClickModal: false,
|
||||||
hideFooter: true,
|
hideFooter: true,
|
||||||
contentRenderer: () => h(recordList, { ref: formRef, formInline: null }),
|
contentRenderer: () => h(recordList, { ref: formRef, formInline: null })
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
// 新增
|
// 新增/编辑新人礼包
|
||||||
const openDialog = (title = "新增", rowData: any) => {
|
const openDialog = (title = "新增", rowData: any) => {
|
||||||
addDialog({
|
addDialog({
|
||||||
title: `${title}首充分类`,
|
title: `${title}首充分类`,
|
||||||
@@ -118,8 +119,16 @@ export function useData() {
|
|||||||
beforeSure: (done, { options }) => {
|
beforeSure: (done, { options }) => {
|
||||||
const FormRef = formRef.value.getRef();
|
const FormRef = formRef.value.getRef();
|
||||||
const curData = options.props.formInline;
|
const curData = options.props.formInline;
|
||||||
const saveData = async form => {
|
|
||||||
const { code } = await addChargeTypeData({ ...form, activities_id: 7 });
|
FormRef.validate(async valid => {
|
||||||
|
if (!valid) return;
|
||||||
|
|
||||||
|
if (title === "新增") {
|
||||||
|
// 新增操作
|
||||||
|
const { code } = await addChargeTypeData({
|
||||||
|
...curData,
|
||||||
|
activities_id: 7
|
||||||
|
});
|
||||||
if (code) {
|
if (code) {
|
||||||
message("新增成功", { type: "success" });
|
message("新增成功", { type: "success" });
|
||||||
onSearch();
|
onSearch();
|
||||||
@@ -127,10 +136,11 @@ export function useData() {
|
|||||||
} else {
|
} else {
|
||||||
message("新增失败", { type: "error" });
|
message("新增失败", { type: "error" });
|
||||||
}
|
}
|
||||||
};
|
} else {
|
||||||
const updateData = async form => {
|
// 编辑操作 - 需要二级密码验证
|
||||||
|
verifyPassword(async () => {
|
||||||
const { code } = await editChargeTypeData({
|
const { code } = await editChargeTypeData({
|
||||||
...form,
|
...curData,
|
||||||
id: rowData.id,
|
id: rowData.id,
|
||||||
activities_id: 7
|
activities_id: 7
|
||||||
});
|
});
|
||||||
@@ -141,18 +151,7 @@ export function useData() {
|
|||||||
} else {
|
} else {
|
||||||
message("修改失败", { type: "error" });
|
message("修改失败", { type: "error" });
|
||||||
}
|
}
|
||||||
};
|
});
|
||||||
FormRef.validate(valid => {
|
|
||||||
if (valid) {
|
|
||||||
console.log("curData", curData);
|
|
||||||
// 表单规则校验通过
|
|
||||||
if (title === "新增") {
|
|
||||||
// 实际开发先调用新增接口,再进行下面操作
|
|
||||||
saveData(curData);
|
|
||||||
} else {
|
|
||||||
// 实际开发先调用修改接口,再进行下面操作
|
|
||||||
updateData(curData);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -168,9 +167,9 @@ export function useData() {
|
|||||||
props: {
|
props: {
|
||||||
rowData
|
rowData
|
||||||
},
|
},
|
||||||
contentRenderer: () => h(giftPackView, { ref: formRef, formInline: null }),
|
contentRenderer: () => h(giftPackView, { ref: formRef, formInline: null })
|
||||||
});
|
});
|
||||||
}
|
};
|
||||||
return {
|
return {
|
||||||
onSearch,
|
onSearch,
|
||||||
isShow,
|
isShow,
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import { ref, h } from "vue";
|
import { ref, h } from "vue";
|
||||||
import editForm from "./form.vue";
|
import editForm from "./form.vue";
|
||||||
import { message } from "@/utils/message";
|
import { message } from "@/utils/message";
|
||||||
|
import { verifyPassword } from "@/utils/passwordVerify";
|
||||||
import {
|
import {
|
||||||
queryDecList,
|
queryDecList,
|
||||||
deleteDecData,
|
deleteDecData,
|
||||||
@@ -44,7 +45,7 @@ export function useData() {
|
|||||||
preview-src-list={Array.of(row.decorate_image)}
|
preview-src-list={Array.of(row.decorate_image)}
|
||||||
class="w-[24px] h-[24px] rounded-full align-middle"
|
class="w-[24px] h-[24px] rounded-full align-middle"
|
||||||
/>
|
/>
|
||||||
),
|
)
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "时长(天数)",
|
label: "时长(天数)",
|
||||||
@@ -59,8 +60,7 @@ export function useData() {
|
|||||||
]);
|
]);
|
||||||
const onSearch = async () => {
|
const onSearch = async () => {
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
const { data, code } = await queryDecList
|
const { data, code } = await queryDecList({
|
||||||
({
|
|
||||||
lid: detailData.value.lid,
|
lid: detailData.value.lid,
|
||||||
page: pagination.value.currentPage,
|
page: pagination.value.currentPage,
|
||||||
page_limit: pagination.value.pageSize
|
page_limit: pagination.value.pageSize
|
||||||
@@ -81,6 +81,7 @@ export function useData() {
|
|||||||
onSearch();
|
onSearch();
|
||||||
};
|
};
|
||||||
const handleDelete = async rowData => {
|
const handleDelete = async rowData => {
|
||||||
|
verifyPassword(async () => {
|
||||||
const { code } = await deleteDecData({ id: rowData.id });
|
const { code } = await deleteDecData({ id: rowData.id });
|
||||||
if (code) {
|
if (code) {
|
||||||
message(`您删除了名称为${rowData.decorate_name}的这条数据`, {
|
message(`您删除了名称为${rowData.decorate_name}的这条数据`, {
|
||||||
@@ -88,6 +89,7 @@ export function useData() {
|
|||||||
});
|
});
|
||||||
onSearch();
|
onSearch();
|
||||||
}
|
}
|
||||||
|
});
|
||||||
};
|
};
|
||||||
// 新增
|
// 新增
|
||||||
const openDialog = (title = "新增", rowData: any) => {
|
const openDialog = (title = "新增", rowData: any) => {
|
||||||
@@ -105,23 +107,20 @@ export function useData() {
|
|||||||
beforeSure: (done, { options }) => {
|
beforeSure: (done, { options }) => {
|
||||||
const FormRef = formRef.value.getRef();
|
const FormRef = formRef.value.getRef();
|
||||||
const curData = options.props.formInline;
|
const curData = options.props.formInline;
|
||||||
const saveData = async form => {
|
|
||||||
const { code, msg } = await addDecData({
|
FormRef.validate(async valid => {
|
||||||
|
if (valid) {
|
||||||
|
verifyPassword(async () => {
|
||||||
|
const { code } = await addDecData({
|
||||||
lid: detailData.value.lid,
|
lid: detailData.value.lid,
|
||||||
dpid: form.dpid
|
dpid: curData.dpid
|
||||||
});
|
});
|
||||||
if (code) {
|
if (code) {
|
||||||
message("新增成功", { type: "success" });
|
message("新增成功", { type: "success" });
|
||||||
onSearch();
|
onSearch();
|
||||||
done();
|
done();
|
||||||
} else {
|
|
||||||
message(msg, { type: "error" });
|
|
||||||
}
|
}
|
||||||
};
|
});
|
||||||
FormRef.validate(valid => {
|
|
||||||
if (valid) {
|
|
||||||
console.log("curData", curData);
|
|
||||||
saveData(curData);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
import { ref, h } from "vue";
|
import { ref, h } from "vue";
|
||||||
import editForm from "./form.vue";
|
import editForm from "./form.vue";
|
||||||
import attireList from './List/index.vue'
|
import attireList from "./List/index.vue";
|
||||||
import { message } from "@/utils/message";
|
import { message } from "@/utils/message";
|
||||||
|
import { verifyPassword } from "@/utils/passwordVerify";
|
||||||
import {
|
import {
|
||||||
queryList,
|
queryList,
|
||||||
addNobilityData,
|
addNobilityData,
|
||||||
@@ -41,7 +42,7 @@ export function useData() {
|
|||||||
preview-src-list={Array.of(row.image)}
|
preview-src-list={Array.of(row.image)}
|
||||||
class="w-[24px] h-[24px] rounded-full align-middle"
|
class="w-[24px] h-[24px] rounded-full align-middle"
|
||||||
/>
|
/>
|
||||||
),
|
)
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "购买价格",
|
label: "购买价格",
|
||||||
@@ -92,6 +93,7 @@ export function useData() {
|
|||||||
onSearch();
|
onSearch();
|
||||||
};
|
};
|
||||||
const handleDelete = async rowData => {
|
const handleDelete = async rowData => {
|
||||||
|
verifyPassword(async () => {
|
||||||
const { code } = await deleteRobotData({ lid: rowData.lid });
|
const { code } = await deleteRobotData({ lid: rowData.lid });
|
||||||
if (code) {
|
if (code) {
|
||||||
message(`您删除了名称为${rowData.name}的这条数据`, {
|
message(`您删除了名称为${rowData.name}的这条数据`, {
|
||||||
@@ -99,6 +101,7 @@ export function useData() {
|
|||||||
});
|
});
|
||||||
onSearch();
|
onSearch();
|
||||||
}
|
}
|
||||||
|
});
|
||||||
};
|
};
|
||||||
const openList = (title = "爵位装扮", rowData: any) => {
|
const openList = (title = "爵位装扮", rowData: any) => {
|
||||||
addDialog({
|
addDialog({
|
||||||
@@ -111,7 +114,7 @@ export function useData() {
|
|||||||
closeOnClickModal: false,
|
closeOnClickModal: false,
|
||||||
contentRenderer: () => h(attireList)
|
contentRenderer: () => h(attireList)
|
||||||
});
|
});
|
||||||
}
|
};
|
||||||
// 新增
|
// 新增
|
||||||
const openDialog = (title = "新增", rowData: any) => {
|
const openDialog = (title = "新增", rowData: any) => {
|
||||||
addDialog({
|
addDialog({
|
||||||
@@ -127,10 +130,10 @@ export function useData() {
|
|||||||
renew_coin: rowData?.renew_coin ?? "",
|
renew_coin: rowData?.renew_coin ?? "",
|
||||||
day: rowData?.day ?? "",
|
day: rowData?.day ?? "",
|
||||||
nick_name_color: rowData?.nick_name_color ?? "",
|
nick_name_color: rowData?.nick_name_color ?? "",
|
||||||
power_ids: rowData?.power_ids ?? '',
|
power_ids: rowData?.power_ids ?? "",
|
||||||
nick_name_color_name: rowData?.nick_name_color_name ?? '',
|
nick_name_color_name: rowData?.nick_name_color_name ?? "",
|
||||||
play_image: rowData?.play_image ?? '',
|
play_image: rowData?.play_image ?? "",
|
||||||
enter_image: rowData?.enter_image ?? '',
|
enter_image: rowData?.enter_image ?? ""
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
width: "40%",
|
width: "40%",
|
||||||
@@ -139,39 +142,30 @@ export function useData() {
|
|||||||
beforeSure: (done, { options }) => {
|
beforeSure: (done, { options }) => {
|
||||||
const FormRef = formRef.value.getRef();
|
const FormRef = formRef.value.getRef();
|
||||||
const curData = options.props.formInline;
|
const curData = options.props.formInline;
|
||||||
const saveData = async form => {
|
|
||||||
const { code, msg } = await addNobilityData(form);
|
FormRef.validate(async valid => {
|
||||||
|
if (valid) {
|
||||||
|
if (title === "新增") {
|
||||||
|
// 新增操作,不需要二级密码
|
||||||
|
const { code } = await addNobilityData(curData);
|
||||||
if (code) {
|
if (code) {
|
||||||
message("新增成功", { type: "success" });
|
message("新增成功", { type: "success" });
|
||||||
onSearch();
|
onSearch();
|
||||||
done();
|
done();
|
||||||
} else {
|
|
||||||
message(msg, { type: "error" });
|
|
||||||
}
|
}
|
||||||
};
|
} else {
|
||||||
const updateData = async form => {
|
// 编辑操作,需要二级密码验证
|
||||||
const { code, msg } = await editNobilityData({
|
verifyPassword(async () => {
|
||||||
...form,
|
const { code } = await editNobilityData({
|
||||||
|
...curData,
|
||||||
lid: rowData.lid
|
lid: rowData.lid
|
||||||
});
|
});
|
||||||
if (code) {
|
if (code) {
|
||||||
message("修改成功", { type: "success" });
|
message("修改成功", { type: "success" });
|
||||||
onSearch();
|
onSearch();
|
||||||
done();
|
done();
|
||||||
} else {
|
|
||||||
message(msg, { type: "error" });
|
|
||||||
}
|
}
|
||||||
};
|
});
|
||||||
FormRef.validate(valid => {
|
|
||||||
if (valid) {
|
|
||||||
console.log("curData", curData);
|
|
||||||
// 表单规则校验通过
|
|
||||||
if (title === "新增") {
|
|
||||||
// 实际开发先调用新增接口,再进行下面操作
|
|
||||||
saveData(curData);
|
|
||||||
} else {
|
|
||||||
// 实际开发先调用修改接口,再进行下面操作
|
|
||||||
updateData(curData);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
import { ref, h } from "vue";
|
import { ref, h } from "vue";
|
||||||
import {
|
import { queryBoxTypeList } from "@/api/modules/blindBox";
|
||||||
queryBoxTypeList
|
|
||||||
} from "@/api/modules/blindBox";
|
|
||||||
import {
|
import {
|
||||||
queryList,
|
queryList,
|
||||||
addActivitiesBox,
|
addActivitiesBox,
|
||||||
@@ -11,9 +9,10 @@ import {
|
|||||||
setConfig
|
setConfig
|
||||||
} from "@/api/modules/activities";
|
} from "@/api/modules/activities";
|
||||||
import editForm from "./form.vue";
|
import editForm from "./form.vue";
|
||||||
import settingRuleView from './settingRule.vue'
|
import settingRuleView from "./settingRule.vue";
|
||||||
import { addDialog } from "@/components/ReDialog";
|
import { addDialog } from "@/components/ReDialog";
|
||||||
import { message } from "@/utils/message";
|
import { message } from "@/utils/message";
|
||||||
|
import { verifyPassword } from "@/utils/passwordVerify";
|
||||||
export function useData() {
|
export function useData() {
|
||||||
const formRef = ref();
|
const formRef = ref();
|
||||||
const loading = ref(true);
|
const loading = ref(true);
|
||||||
@@ -29,8 +28,8 @@ export function useData() {
|
|||||||
const searchForm = ref({
|
const searchForm = ref({
|
||||||
user_id: ""
|
user_id: ""
|
||||||
});
|
});
|
||||||
const activeName = ref(0)
|
const activeName = ref(0);
|
||||||
const typeList = ref([])
|
const typeList = ref([]);
|
||||||
const statisticsList = ref([
|
const statisticsList = ref([
|
||||||
{ label: "抽奖人数总计", prop: "total_count" },
|
{ label: "抽奖人数总计", prop: "total_count" },
|
||||||
{ label: "抽奖价格总计", prop: "total_price" },
|
{ label: "抽奖价格总计", prop: "total_price" },
|
||||||
@@ -40,8 +39,8 @@ export function useData() {
|
|||||||
// { label: "高级礼盒收入总计", prop: "" },
|
// { label: "高级礼盒收入总计", prop: "" },
|
||||||
{ label: "今日抽奖价格", prop: "today_total_price" },
|
{ label: "今日抽奖价格", prop: "today_total_price" },
|
||||||
{ label: "今日抽奖次数", prop: "today_total_count" }
|
{ label: "今日抽奖次数", prop: "today_total_count" }
|
||||||
])
|
]);
|
||||||
const statisticsData = ref({})
|
const statisticsData = ref({});
|
||||||
const searchLabel = ref([
|
const searchLabel = ref([
|
||||||
{ label: "用户ID", prop: "user_id", type: "input" }
|
{ label: "用户ID", prop: "user_id", type: "input" }
|
||||||
]);
|
]);
|
||||||
@@ -98,23 +97,23 @@ export function useData() {
|
|||||||
slot: "operation"
|
slot: "operation"
|
||||||
}
|
}
|
||||||
]);
|
]);
|
||||||
const onSearch = async (formData) => {
|
const onSearch = async formData => {
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
searchForm.value = { ...formData }
|
searchForm.value = { ...formData };
|
||||||
const { data, code } = await queryList({
|
const { data, code } = await queryList({
|
||||||
...formData,
|
...formData,
|
||||||
gift_bag_id: activeName.value,
|
gift_bag_id: activeName.value,
|
||||||
page: pagination.value.currentPage,
|
page: pagination.value.currentPage,
|
||||||
page_limit: pagination.value.pageSize,
|
page_limit: pagination.value.pageSize
|
||||||
|
|
||||||
});
|
});
|
||||||
if (code) {
|
if (code) {
|
||||||
tableList.value = data.lists.map(ele => {
|
tableList.value = data.lists.map(ele => {
|
||||||
return {
|
return {
|
||||||
...ele, ...data.total
|
...ele,
|
||||||
}
|
...data.total
|
||||||
|
};
|
||||||
});
|
});
|
||||||
statisticsData.value = data.total_data
|
statisticsData.value = data.total_data;
|
||||||
pagination.value.total = data.count;
|
pagination.value.total = data.count;
|
||||||
pagination.value.currentPage = data.page;
|
pagination.value.currentPage = data.page;
|
||||||
}
|
}
|
||||||
@@ -129,19 +128,21 @@ export function useData() {
|
|||||||
onSearch(searchForm.value);
|
onSearch(searchForm.value);
|
||||||
};
|
};
|
||||||
const getType = async () => {
|
const getType = async () => {
|
||||||
const { code, data } = await queryBoxTypeList({ activities_id: 2 })
|
const { code, data } = await queryBoxTypeList({ activities_id: 2 });
|
||||||
typeList.value = code ? data.map(ele => {
|
typeList.value = code
|
||||||
|
? data.map(ele => {
|
||||||
return {
|
return {
|
||||||
label: ele.name,
|
label: ele.name,
|
||||||
value: ele.id
|
value: ele.id
|
||||||
}
|
};
|
||||||
}) : []
|
})
|
||||||
if (code) handleClick(data[0].id)
|
: [];
|
||||||
}
|
if (code) handleClick(data[0].id);
|
||||||
const handleClick = (id) => {
|
};
|
||||||
activeName.value = id
|
const handleClick = id => {
|
||||||
|
activeName.value = id;
|
||||||
onSearch(searchForm.value);
|
onSearch(searchForm.value);
|
||||||
}
|
};
|
||||||
//
|
//
|
||||||
const resetSetting = async () => {
|
const resetSetting = async () => {
|
||||||
// const { data, code } = await deletectivitiesBox({
|
// const { data, code } = await deletectivitiesBox({
|
||||||
@@ -153,9 +154,10 @@ export function useData() {
|
|||||||
// });
|
// });
|
||||||
// handleClick(activeName.value);
|
// handleClick(activeName.value);
|
||||||
// }
|
// }
|
||||||
|
};
|
||||||
}
|
|
||||||
const handleDelete = async rowData => {
|
const handleDelete = async rowData => {
|
||||||
|
// 删除需要二级密码验证
|
||||||
|
verifyPassword(async () => {
|
||||||
const { code } = await deletectivitiesBox({ id: rowData.id });
|
const { code } = await deletectivitiesBox({ id: rowData.id });
|
||||||
if (code) {
|
if (code) {
|
||||||
message(`您删除了这条数据`, {
|
message(`您删除了这条数据`, {
|
||||||
@@ -163,6 +165,7 @@ export function useData() {
|
|||||||
});
|
});
|
||||||
onSearch(searchForm.value);
|
onSearch(searchForm.value);
|
||||||
}
|
}
|
||||||
|
});
|
||||||
};
|
};
|
||||||
const openDialog = async (title = "新增", rowData: any) => {
|
const openDialog = async (title = "新增", rowData: any) => {
|
||||||
addDialog({
|
addDialog({
|
||||||
@@ -172,7 +175,7 @@ export function useData() {
|
|||||||
type: rowData?.gift_type ?? "",
|
type: rowData?.gift_type ?? "",
|
||||||
num: rowData?.quantity ?? "",
|
num: rowData?.quantity ?? "",
|
||||||
gift_id: rowData?.gift_id ?? "",
|
gift_id: rowData?.gift_id ?? "",
|
||||||
gift_bag_id: rowData?.gift_bag_id ?? "",
|
gift_bag_id: rowData?.gift_bag_id ?? ""
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
width: "40%",
|
width: "40%",
|
||||||
@@ -181,10 +184,15 @@ export function useData() {
|
|||||||
beforeSure: (done, { options }) => {
|
beforeSure: (done, { options }) => {
|
||||||
const FormRef = formRef.value.getRef();
|
const FormRef = formRef.value.getRef();
|
||||||
const curData = options.props.formInline;
|
const curData = options.props.formInline;
|
||||||
const saveData = async form => {
|
|
||||||
|
FormRef.validate(async valid => {
|
||||||
|
if (!valid) return;
|
||||||
|
|
||||||
|
if (title === "新增") {
|
||||||
|
// 新增操作
|
||||||
const { code } = await addActivitiesBox({
|
const { code } = await addActivitiesBox({
|
||||||
...form,
|
...curData,
|
||||||
gift_bag_id: activeName.value,
|
gift_bag_id: activeName.value
|
||||||
});
|
});
|
||||||
if (code) {
|
if (code) {
|
||||||
message("新增成功", { type: "success" });
|
message("新增成功", { type: "success" });
|
||||||
@@ -193,10 +201,11 @@ export function useData() {
|
|||||||
} else {
|
} else {
|
||||||
message("新增失败", { type: "error" });
|
message("新增失败", { type: "error" });
|
||||||
}
|
}
|
||||||
};
|
} else {
|
||||||
const updateData = async form => {
|
// 编辑操作 - 需要二级密码验证
|
||||||
|
verifyPassword(async () => {
|
||||||
const { code, msg } = await editActivitiesBox({
|
const { code, msg } = await editActivitiesBox({
|
||||||
...form,
|
...curData,
|
||||||
gift_bag_id: activeName.value,
|
gift_bag_id: activeName.value,
|
||||||
id: rowData.id
|
id: rowData.id
|
||||||
});
|
});
|
||||||
@@ -207,25 +216,16 @@ export function useData() {
|
|||||||
} else {
|
} else {
|
||||||
message(msg, { type: "error" });
|
message(msg, { type: "error" });
|
||||||
}
|
}
|
||||||
};
|
});
|
||||||
FormRef.validate(valid => {
|
|
||||||
if (valid) {
|
|
||||||
console.log("curData", curData);
|
|
||||||
// 表单规则校验通过
|
|
||||||
if (title === "新增") {
|
|
||||||
// 实际开发先调用新增接口,再进行下面操作
|
|
||||||
saveData(curData);
|
|
||||||
} else {
|
|
||||||
// 实际开发先调用修改接口,再进行下面操作
|
|
||||||
updateData(curData);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
const setting = async () => {
|
const setting = async () => {
|
||||||
const { data, code } = await getActivitiesBoxInfo({ gift_bag_id: activeName.value })
|
const { data, code } = await getActivitiesBoxInfo({
|
||||||
|
gift_bag_id: activeName.value
|
||||||
|
});
|
||||||
addDialog({
|
addDialog({
|
||||||
title: `设置礼盒规则`,
|
title: `设置礼盒规则`,
|
||||||
props: {
|
props: {
|
||||||
@@ -235,12 +235,19 @@ export function useData() {
|
|||||||
},
|
},
|
||||||
width: "40%",
|
width: "40%",
|
||||||
closeOnClickModal: false,
|
closeOnClickModal: false,
|
||||||
contentRenderer: () => h(settingRuleView, { ref: formRef, formInline: null }),
|
contentRenderer: () =>
|
||||||
|
h(settingRuleView, { ref: formRef, formInline: null }),
|
||||||
beforeSure: (done, { options }) => {
|
beforeSure: (done, { options }) => {
|
||||||
const FormRef = formRef.value.getRef();
|
const FormRef = formRef.value.getRef();
|
||||||
const curData = options.props.formInline;
|
const curData = options.props.formInline;
|
||||||
const saveData = async form => {
|
|
||||||
const { code } = await setConfig({ ...form });
|
FormRef.validate(async valid => {
|
||||||
|
if (!valid) return;
|
||||||
|
|
||||||
|
// 设置规则需要二级密码验证
|
||||||
|
verifyPassword(async () => {
|
||||||
|
curData.gift_bag_id = activeName.value;
|
||||||
|
const { code } = await setConfig({ ...curData });
|
||||||
if (code) {
|
if (code) {
|
||||||
message("设置成功", { type: "success" });
|
message("设置成功", { type: "success" });
|
||||||
onSearch(searchForm.value);
|
onSearch(searchForm.value);
|
||||||
@@ -248,17 +255,11 @@ export function useData() {
|
|||||||
} else {
|
} else {
|
||||||
message("设置失败", { type: "error" });
|
message("设置失败", { type: "error" });
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
};
|
};
|
||||||
FormRef.validate(valid => {
|
|
||||||
if (valid) {
|
|
||||||
// console.log(curData)
|
|
||||||
curData.gift_bag_id = activeName.value
|
|
||||||
saveData(curData)
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
return {
|
return {
|
||||||
searchForm,
|
searchForm,
|
||||||
searchLabel,
|
searchLabel,
|
||||||
|
|||||||
@@ -9,9 +9,10 @@ import {
|
|||||||
settingXunLeRule
|
settingXunLeRule
|
||||||
} from "@/api/modules/blindBox";
|
} from "@/api/modules/blindBox";
|
||||||
import editForm from "./form.vue";
|
import editForm from "./form.vue";
|
||||||
import settingRuleView from './settingRule.vue'
|
import settingRuleView from "./settingRule.vue";
|
||||||
import { addDialog } from "@/components/ReDialog";
|
import { addDialog } from "@/components/ReDialog";
|
||||||
import { message } from "@/utils/message";
|
import { message } from "@/utils/message";
|
||||||
|
import { verifyPassword } from "@/utils/passwordVerify";
|
||||||
export function useData() {
|
export function useData() {
|
||||||
const formRef = ref();
|
const formRef = ref();
|
||||||
const loading = ref(true);
|
const loading = ref(true);
|
||||||
@@ -26,19 +27,20 @@ export function useData() {
|
|||||||
});
|
});
|
||||||
const searchForm = ref({
|
const searchForm = ref({
|
||||||
gift_id: "",
|
gift_id: "",
|
||||||
gift_name: "",
|
gift_name: ""
|
||||||
});
|
});
|
||||||
const activeName = ref(13)
|
const activeName = ref(13);
|
||||||
const typeList = ref([])
|
const typeList = ref([]);
|
||||||
const statisticsList = ref([
|
const statisticsList = ref([
|
||||||
{ label: "每期总次数", prop: "total_count" },
|
{ label: "每期总次数", prop: "total_count" },
|
||||||
{ label: "每期总礼物价值(收入)", prop: "total_price" },
|
{ label: "每期总礼物价值(收入)", prop: "total_price" },
|
||||||
{
|
{
|
||||||
label: "每期总抽奖花费(支出)", prop: "total_cost"
|
label: "每期总抽奖花费(支出)",
|
||||||
|
prop: "total_cost"
|
||||||
},
|
},
|
||||||
{ label: "每期统计(收入/支出)", prop: "profit_loss_ratio", tip: "%" }
|
{ label: "每期统计(收入/支出)", prop: "profit_loss_ratio", tip: "%" }
|
||||||
])
|
]);
|
||||||
const statisticsData = ref({})
|
const statisticsData = ref({});
|
||||||
const searchLabel = ref([
|
const searchLabel = ref([
|
||||||
{ label: "礼物ID", prop: "gift_id", type: "input" },
|
{ label: "礼物ID", prop: "gift_id", type: "input" },
|
||||||
{ label: "礼物名称", prop: "gift_name", type: "input" }
|
{ label: "礼物名称", prop: "gift_name", type: "input" }
|
||||||
@@ -85,21 +87,27 @@ export function useData() {
|
|||||||
label: "公屏",
|
label: "公屏",
|
||||||
prop: "is_public_screen",
|
prop: "is_public_screen",
|
||||||
cellRenderer: ({ row }) => (
|
cellRenderer: ({ row }) => (
|
||||||
<el-tag type={row.is_public_screen === 1 ? 'success' : 'error'}>{row.is_public_screen === 1 ? '显示' : '隐藏'}</el-tag>
|
<el-tag type={row.is_public_screen === 1 ? "success" : "error"}>
|
||||||
|
{row.is_public_screen === 1 ? "显示" : "隐藏"}
|
||||||
|
</el-tag>
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "全服显示",
|
label: "全服显示",
|
||||||
prop: "is_public_server",
|
prop: "is_public_server",
|
||||||
cellRenderer: ({ row }) => (
|
cellRenderer: ({ row }) => (
|
||||||
<el-tag type={row.is_public_server === 1 ? 'success' : 'error'}>{row.is_public_server === 1 ? '显示' : '隐藏'}</el-tag>
|
<el-tag type={row.is_public_server === 1 ? "success" : "error"}>
|
||||||
|
{row.is_public_server === 1 ? "显示" : "隐藏"}
|
||||||
|
</el-tag>
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "榜单显示",
|
label: "榜单显示",
|
||||||
prop: "is_world_show",
|
prop: "is_world_show",
|
||||||
cellRenderer: ({ row }) => (
|
cellRenderer: ({ row }) => (
|
||||||
<el-tag type={row.is_world_show === 1 ? 'success' : 'error'}>{row.is_world_show === 1 ? '显示' : '隐藏'}</el-tag>
|
<el-tag type={row.is_world_show === 1 ? "success" : "error"}>
|
||||||
|
{row.is_world_show === 1 ? "显示" : "隐藏"}
|
||||||
|
</el-tag>
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -113,23 +121,23 @@ export function useData() {
|
|||||||
slot: "operation"
|
slot: "operation"
|
||||||
}
|
}
|
||||||
]);
|
]);
|
||||||
const onSearch = async (formData) => {
|
const onSearch = async formData => {
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
searchForm.value = { ...formData }
|
searchForm.value = { ...formData };
|
||||||
const { data, code } = await queryBlindBoxList({
|
const { data, code } = await queryBlindBoxList({
|
||||||
...formData,
|
...formData,
|
||||||
gift_bag_id: activeName.value,
|
gift_bag_id: activeName.value,
|
||||||
page: pagination.value.currentPage,
|
page: pagination.value.currentPage,
|
||||||
page_limit: pagination.value.pageSize,
|
page_limit: pagination.value.pageSize
|
||||||
|
|
||||||
});
|
});
|
||||||
if (code) {
|
if (code) {
|
||||||
tableList.value = data.lists.map(ele => {
|
tableList.value = data.lists.map(ele => {
|
||||||
return {
|
return {
|
||||||
...ele, ...data.total
|
...ele,
|
||||||
}
|
...data.total
|
||||||
|
};
|
||||||
});
|
});
|
||||||
statisticsData.value = data.total_data
|
statisticsData.value = data.total_data;
|
||||||
pagination.value.total = data.count;
|
pagination.value.total = data.count;
|
||||||
pagination.value.currentPage = data.page;
|
pagination.value.currentPage = data.page;
|
||||||
}
|
}
|
||||||
@@ -144,18 +152,22 @@ export function useData() {
|
|||||||
onSearch(searchForm.value);
|
onSearch(searchForm.value);
|
||||||
};
|
};
|
||||||
const resetSetting = async () => {
|
const resetSetting = async () => {
|
||||||
const { data, code } = await resetBlindBoxRule({
|
// 重置数量需要二级密码验证
|
||||||
|
verifyPassword(async () => {
|
||||||
|
const { code } = await resetBlindBoxRule({
|
||||||
gift_bag_id: activeName.value
|
gift_bag_id: activeName.value
|
||||||
})
|
});
|
||||||
if (code) {
|
if (code) {
|
||||||
message(`重置成功`, {
|
message(`重置成功`, {
|
||||||
type: "success"
|
type: "success"
|
||||||
});
|
});
|
||||||
onSearch(searchForm.value);
|
onSearch(searchForm.value);
|
||||||
}
|
}
|
||||||
|
});
|
||||||
}
|
};
|
||||||
const handleDelete = async rowData => {
|
const handleDelete = async rowData => {
|
||||||
|
// 删除需要二级密码验证
|
||||||
|
verifyPassword(async () => {
|
||||||
const { code } = await removeBlindBoxData({ id: rowData.id });
|
const { code } = await removeBlindBoxData({ id: rowData.id });
|
||||||
if (code) {
|
if (code) {
|
||||||
message(`您删除了这条数据`, {
|
message(`您删除了这条数据`, {
|
||||||
@@ -163,6 +175,7 @@ export function useData() {
|
|||||||
});
|
});
|
||||||
onSearch(searchForm.value);
|
onSearch(searchForm.value);
|
||||||
}
|
}
|
||||||
|
});
|
||||||
};
|
};
|
||||||
const openDialog = async (title = "新增", rowData: any) => {
|
const openDialog = async (title = "新增", rowData: any) => {
|
||||||
addDialog({
|
addDialog({
|
||||||
@@ -172,7 +185,7 @@ export function useData() {
|
|||||||
gift_id: rowData?.gift_id ?? "",
|
gift_id: rowData?.gift_id ?? "",
|
||||||
quantity: rowData?.quantity ?? 1,
|
quantity: rowData?.quantity ?? 1,
|
||||||
weight: rowData?.weight ?? 1,
|
weight: rowData?.weight ?? 1,
|
||||||
is_world_show: rowData?.is_world_show ?? 1,
|
is_world_show: rowData?.is_world_show ?? 1
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
width: "40%",
|
width: "40%",
|
||||||
@@ -181,10 +194,16 @@ export function useData() {
|
|||||||
beforeSure: (done, { options }) => {
|
beforeSure: (done, { options }) => {
|
||||||
const FormRef = formRef.value.getRef();
|
const FormRef = formRef.value.getRef();
|
||||||
const curData = options.props.formInline;
|
const curData = options.props.formInline;
|
||||||
const saveData = async form => {
|
|
||||||
|
FormRef.validate(async valid => {
|
||||||
|
if (!valid) return;
|
||||||
|
|
||||||
|
if (title === "新增") {
|
||||||
|
// 添加操作 - 需要二级密码验证
|
||||||
|
verifyPassword(async () => {
|
||||||
const { code } = await addBlindBoxData({
|
const { code } = await addBlindBoxData({
|
||||||
...form,
|
...curData,
|
||||||
gift_bag_id: activeName.value,
|
gift_bag_id: activeName.value
|
||||||
});
|
});
|
||||||
if (code) {
|
if (code) {
|
||||||
message("新增成功", { type: "success" });
|
message("新增成功", { type: "success" });
|
||||||
@@ -193,10 +212,12 @@ export function useData() {
|
|||||||
} else {
|
} else {
|
||||||
message("新增失败", { type: "error" });
|
message("新增失败", { type: "error" });
|
||||||
}
|
}
|
||||||
};
|
});
|
||||||
const updateData = async form => {
|
} else {
|
||||||
|
// 编辑操作 - 需要二级密码验证
|
||||||
|
verifyPassword(async () => {
|
||||||
const { code, msg } = await editBlindBoxData({
|
const { code, msg } = await editBlindBoxData({
|
||||||
...form,
|
...curData,
|
||||||
gift_bag_id: activeName.value,
|
gift_bag_id: activeName.value,
|
||||||
id: rowData.id
|
id: rowData.id
|
||||||
});
|
});
|
||||||
@@ -207,28 +228,17 @@ export function useData() {
|
|||||||
} else {
|
} else {
|
||||||
message(msg, { type: "error" });
|
message(msg, { type: "error" });
|
||||||
}
|
}
|
||||||
};
|
});
|
||||||
FormRef.validate(valid => {
|
|
||||||
if (valid) {
|
|
||||||
console.log("curData", curData);
|
|
||||||
// 表单规则校验通过
|
|
||||||
if (title === "新增") {
|
|
||||||
// 实际开发先调用新增接口,再进行下面操作
|
|
||||||
saveData(curData);
|
|
||||||
} else {
|
|
||||||
// 实际开发先调用修改接口,再进行下面操作
|
|
||||||
updateData(curData);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
const addGiftData = async () => {
|
const addGiftData = async () => {};
|
||||||
|
|
||||||
}
|
|
||||||
const setting = async () => {
|
const setting = async () => {
|
||||||
const { data, code } = await getXunLeRule({ gift_bag_id: activeName.value })
|
const { data, code } = await getXunLeRule({
|
||||||
|
gift_bag_id: activeName.value
|
||||||
|
});
|
||||||
addDialog({
|
addDialog({
|
||||||
title: `设置巡乐会规则`,
|
title: `设置巡乐会规则`,
|
||||||
props: {
|
props: {
|
||||||
@@ -239,7 +249,8 @@ export function useData() {
|
|||||||
start_num: data.open_condition.start_num,
|
start_num: data.open_condition.start_num,
|
||||||
selected_gift_id: +data.locking_condition.selected_gift_id,
|
selected_gift_id: +data.locking_condition.selected_gift_id,
|
||||||
locking_gift_id: +data.locking_condition.locking_gift_id,
|
locking_gift_id: +data.locking_condition.locking_gift_id,
|
||||||
give_homeowner_gift_id: +data.locking_condition.give_homeowner_gift_id,
|
give_homeowner_gift_id:
|
||||||
|
+data.locking_condition.give_homeowner_gift_id,
|
||||||
end_time: data.locking_time.end_time,
|
end_time: data.locking_time.end_time,
|
||||||
tow_no_locking_time: data.locking_time.tow_no_locking_time,
|
tow_no_locking_time: data.locking_time.tow_no_locking_time,
|
||||||
next_time: data.locking_time.next_time,
|
next_time: data.locking_time.next_time,
|
||||||
@@ -248,12 +259,18 @@ export function useData() {
|
|||||||
},
|
},
|
||||||
width: "60%",
|
width: "60%",
|
||||||
closeOnClickModal: false,
|
closeOnClickModal: false,
|
||||||
contentRenderer: () => h(settingRuleView, { ref: formRef, formInline: null }),
|
contentRenderer: () =>
|
||||||
|
h(settingRuleView, { ref: formRef, formInline: null }),
|
||||||
beforeSure: (done, { options }) => {
|
beforeSure: (done, { options }) => {
|
||||||
const FormRef = formRef.value.getRef();
|
const FormRef = formRef.value.getRef();
|
||||||
const curData = options.props.formInline;
|
const curData = options.props.formInline;
|
||||||
const saveData = async form => {
|
|
||||||
const { code } = await settingXunLeRule({ ...form });
|
FormRef.validate(async valid => {
|
||||||
|
if (!valid) return;
|
||||||
|
|
||||||
|
// 设置规则需要二级密码验证
|
||||||
|
verifyPassword(async () => {
|
||||||
|
const { code } = await settingXunLeRule({ ...curData });
|
||||||
if (code) {
|
if (code) {
|
||||||
message("设置成功", { type: "success" });
|
message("设置成功", { type: "success" });
|
||||||
onSearch(searchForm.value);
|
onSearch(searchForm.value);
|
||||||
@@ -261,16 +278,11 @@ export function useData() {
|
|||||||
} else {
|
} else {
|
||||||
message("设置失败", { type: "error" });
|
message("设置失败", { type: "error" });
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
};
|
};
|
||||||
FormRef.validate(valid => {
|
|
||||||
if (valid) {
|
|
||||||
// console.log("curData", curData);
|
|
||||||
saveData(curData)
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
return {
|
return {
|
||||||
searchForm,
|
searchForm,
|
||||||
searchLabel,
|
searchLabel,
|
||||||
|
|||||||
@@ -3,8 +3,9 @@ import editForm from "./form.vue";
|
|||||||
import { ElMessageBox } from "element-plus";
|
import { ElMessageBox } from "element-plus";
|
||||||
import memberListView from "./memberList.vue";
|
import memberListView from "./memberList.vue";
|
||||||
import roomListView from "./roomList.vue";
|
import roomListView from "./roomList.vue";
|
||||||
import mergeFormView from './mergeForm.vue'
|
import mergeFormView from "./mergeForm.vue";
|
||||||
import { message } from "@/utils/message";
|
import { message } from "@/utils/message";
|
||||||
|
import { verifyPassword } from "@/utils/passwordVerify";
|
||||||
import {
|
import {
|
||||||
queryUnionList,
|
queryUnionList,
|
||||||
addUnionData,
|
addUnionData,
|
||||||
@@ -71,7 +72,7 @@ export function useData() {
|
|||||||
preview-src-list={Array.of(row.guild_logo)}
|
preview-src-list={Array.of(row.guild_logo)}
|
||||||
class="w-[24px] h-[24px] align-middle"
|
class="w-[24px] h-[24px] align-middle"
|
||||||
/>
|
/>
|
||||||
),
|
)
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "今日流水",
|
label: "今日流水",
|
||||||
@@ -85,15 +86,17 @@ export function useData() {
|
|||||||
label: "公会状态",
|
label: "公会状态",
|
||||||
prop: "status_str",
|
prop: "status_str",
|
||||||
cellRenderer: ({ row }) => (
|
cellRenderer: ({ row }) => (
|
||||||
<el-tag type={row.status_str === '正常' ? 'success' : 'error'}>{row.status_str}</el-tag>
|
<el-tag type={row.status_str === "正常" ? "success" : "error"}>
|
||||||
),
|
{row.status_str}
|
||||||
|
</el-tag>
|
||||||
|
)
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "显示状态",
|
label: "显示状态",
|
||||||
prop: "is_show",
|
prop: "is_show",
|
||||||
cellRenderer: ({ row }) => (
|
cellRenderer: ({ row }) => (
|
||||||
<div>{row.status_str === '正常' ? row.is_show_str : '-'}</div>
|
<div>{row.status_str === "正常" ? row.is_show_str : "-"}</div>
|
||||||
),
|
)
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "创建时间",
|
label: "创建时间",
|
||||||
@@ -106,9 +109,9 @@ export function useData() {
|
|||||||
slot: "operation"
|
slot: "operation"
|
||||||
}
|
}
|
||||||
]);
|
]);
|
||||||
const onSearch = async (formData) => {
|
const onSearch = async formData => {
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
searchForm.value = { ...formData }
|
searchForm.value = { ...formData };
|
||||||
const { data, code } = await queryUnionList({
|
const { data, code } = await queryUnionList({
|
||||||
...formData,
|
...formData,
|
||||||
page: pagination.value.currentPage,
|
page: pagination.value.currentPage,
|
||||||
@@ -130,7 +133,10 @@ export function useData() {
|
|||||||
pagination.value.currentPage = val;
|
pagination.value.currentPage = val;
|
||||||
onSearch(searchForm.value);
|
onSearch(searchForm.value);
|
||||||
};
|
};
|
||||||
|
// 解散工会
|
||||||
const handleDelete = async rowData => {
|
const handleDelete = async rowData => {
|
||||||
|
// 解散需要二级密码验证
|
||||||
|
verifyPassword(async () => {
|
||||||
const { code } = await dissolveUnionData({ id: rowData.id });
|
const { code } = await dissolveUnionData({ id: rowData.id });
|
||||||
if (code === "0") {
|
if (code === "0") {
|
||||||
message(`您删除了公会名称为【${rowData.guild_name}】的这条数据`, {
|
message(`您删除了公会名称为【${rowData.guild_name}】的这条数据`, {
|
||||||
@@ -138,8 +144,9 @@ export function useData() {
|
|||||||
});
|
});
|
||||||
onSearch(searchForm.value);
|
onSearch(searchForm.value);
|
||||||
}
|
}
|
||||||
|
});
|
||||||
};
|
};
|
||||||
// 新增
|
// 新增/编辑工会
|
||||||
const openDialog = (title = "新增", rowData: any) => {
|
const openDialog = (title = "新增", rowData: any) => {
|
||||||
addDialog({
|
addDialog({
|
||||||
title: `${title}工会`,
|
title: `${title}工会`,
|
||||||
@@ -161,8 +168,13 @@ export function useData() {
|
|||||||
beforeSure: (done, { options }) => {
|
beforeSure: (done, { options }) => {
|
||||||
const FormRef = formRef.value.getRef();
|
const FormRef = formRef.value.getRef();
|
||||||
const curData = options.props.formInline;
|
const curData = options.props.formInline;
|
||||||
const saveData = async form => {
|
|
||||||
const { code, msg } = await addUnionData(form);
|
FormRef.validate(async valid => {
|
||||||
|
if (!valid) return;
|
||||||
|
|
||||||
|
if (title === "新增") {
|
||||||
|
// 新增操作
|
||||||
|
const { code, msg } = await addUnionData(curData);
|
||||||
if (code) {
|
if (code) {
|
||||||
message("新增成功", { type: "success" });
|
message("新增成功", { type: "success" });
|
||||||
onSearch(searchForm.value);
|
onSearch(searchForm.value);
|
||||||
@@ -170,10 +182,11 @@ export function useData() {
|
|||||||
} else {
|
} else {
|
||||||
message(msg, { type: "error" });
|
message(msg, { type: "error" });
|
||||||
}
|
}
|
||||||
};
|
} else {
|
||||||
const updateData = async form => {
|
// 编辑操作 - 需要二级密码验证
|
||||||
|
verifyPassword(async () => {
|
||||||
const { code } = await editUnionData({
|
const { code } = await editUnionData({
|
||||||
...form,
|
...curData,
|
||||||
id: rowData.id
|
id: rowData.id
|
||||||
});
|
});
|
||||||
if (code) {
|
if (code) {
|
||||||
@@ -183,24 +196,14 @@ export function useData() {
|
|||||||
} else {
|
} else {
|
||||||
message("修改失败", { type: "error" });
|
message("修改失败", { type: "error" });
|
||||||
}
|
}
|
||||||
};
|
});
|
||||||
FormRef.validate(valid => {
|
|
||||||
if (valid) {
|
|
||||||
// 表单规则校验通过
|
|
||||||
if (title === "新增") {
|
|
||||||
// 实际开发先调用新增接口,再进行下面操作
|
|
||||||
saveData(curData);
|
|
||||||
} else {
|
|
||||||
// 实际开发先调用修改接口,再进行下面操作
|
|
||||||
updateData(curData);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
// 查看成员 roomListView memberListView
|
// 查看成员 roomListView memberListView
|
||||||
const viewMember = (rowData) => {
|
const viewMember = rowData => {
|
||||||
addDialog({
|
addDialog({
|
||||||
title: `查看成员列表`,
|
title: `查看成员列表`,
|
||||||
props: {
|
props: {
|
||||||
@@ -209,13 +212,13 @@ export function useData() {
|
|||||||
width: "60%",
|
width: "60%",
|
||||||
closeOnClickModal: false,
|
closeOnClickModal: false,
|
||||||
contentRenderer: () => h(memberListView),
|
contentRenderer: () => h(memberListView),
|
||||||
beforeSure: (done) => {
|
beforeSure: done => {
|
||||||
done()
|
done();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
};
|
||||||
// 查看房间列表
|
// 查看房间列表
|
||||||
const viewRoomList = (rowData) => {
|
const viewRoomList = rowData => {
|
||||||
addDialog({
|
addDialog({
|
||||||
title: `查看房间列表`,
|
title: `查看房间列表`,
|
||||||
props: {
|
props: {
|
||||||
@@ -224,11 +227,11 @@ export function useData() {
|
|||||||
width: "60%",
|
width: "60%",
|
||||||
closeOnClickModal: false,
|
closeOnClickModal: false,
|
||||||
contentRenderer: () => h(roomListView),
|
contentRenderer: () => h(roomListView),
|
||||||
beforeSure: (done) => {
|
beforeSure: done => {
|
||||||
done()
|
done();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
};
|
||||||
// 合并公会
|
// 合并公会
|
||||||
const mergeData = async () => {
|
const mergeData = async () => {
|
||||||
addDialog({
|
addDialog({
|
||||||
@@ -236,50 +239,54 @@ export function useData() {
|
|||||||
props: {
|
props: {
|
||||||
formInline: {
|
formInline: {
|
||||||
guild_id: "",
|
guild_id: "",
|
||||||
merge_guild_id: "",
|
merge_guild_id: ""
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
width: "40%",
|
width: "40%",
|
||||||
closeOnClickModal: false,
|
closeOnClickModal: false,
|
||||||
contentRenderer: () => h(mergeFormView, { ref: formRef, formInline: null }),
|
contentRenderer: () =>
|
||||||
|
h(mergeFormView, { ref: formRef, formInline: null }),
|
||||||
beforeSure: (done, { options }) => {
|
beforeSure: (done, { options }) => {
|
||||||
const FormRef = formRef.value.getRef();
|
const FormRef = formRef.value.getRef();
|
||||||
const curData = options.props.formInline;
|
const curData = options.props.formInline;
|
||||||
FormRef.validate(valid => {
|
|
||||||
if (valid) {
|
FormRef.validate(async valid => {
|
||||||
ElMessageBox.confirm(
|
if (!valid) return;
|
||||||
`此操作不可更改,是否继续?`,
|
|
||||||
"提示",
|
// 合并公会需要二级密码验证
|
||||||
{
|
verifyPassword(async () => {
|
||||||
|
ElMessageBox.confirm(`此操作不可更改,是否继续?`, "提示", {
|
||||||
type: "warning"
|
type: "warning"
|
||||||
}
|
})
|
||||||
)
|
|
||||||
.then(async () => {
|
.then(async () => {
|
||||||
const { code, msg } = await guildUnionData(curData)
|
const { code, msg } = await guildUnionData(curData);
|
||||||
if (code) {
|
if (code) {
|
||||||
message("操作成功", { type: "success" });
|
message("操作成功", { type: "success" });
|
||||||
onSearch(searchForm.value);
|
onSearch(searchForm.value);
|
||||||
done()
|
done();
|
||||||
} else {
|
} else {
|
||||||
message(msg, { type: "error" });
|
message(msg, { type: "error" });
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch(() => { });
|
.catch(() => {});
|
||||||
}
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
};
|
||||||
// 更改工会状态 隐藏 显示
|
// 更改工会状态 隐藏/显示
|
||||||
const changeShowStatus = async (rowData) => {
|
const changeShowStatus = async rowData => {
|
||||||
const { data, code, msg } = await changeStatus({ id: rowData.id })
|
// 更改状态需要二级密码验证
|
||||||
|
verifyPassword(async () => {
|
||||||
|
const { code, msg } = await changeStatus({ id: rowData.id });
|
||||||
if (code) {
|
if (code) {
|
||||||
message("操作成功", { type: "success" });
|
message("操作成功", { type: "success" });
|
||||||
onSearch(searchForm.value);
|
onSearch(searchForm.value);
|
||||||
} else {
|
} else {
|
||||||
message(msg, { type: "error" });
|
message(msg, { type: "error" });
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
|
};
|
||||||
return {
|
return {
|
||||||
searchForm,
|
searchForm,
|
||||||
searchLabel,
|
searchLabel,
|
||||||
|
|||||||
@@ -2,13 +2,11 @@
|
|||||||
import SearchForm from "@/components/SearchForm/index.vue";
|
import SearchForm from "@/components/SearchForm/index.vue";
|
||||||
import { ref, onMounted } from "vue";
|
import { ref, onMounted } from "vue";
|
||||||
import { message } from "@/utils/message";
|
import { message } from "@/utils/message";
|
||||||
import {
|
import { verifyPassword } from "@/utils/passwordVerify";
|
||||||
queryUnionMemberList,
|
import { queryUnionMemberList, kickUnionMember } from "@/api/modules/union";
|
||||||
kickUnionMember
|
|
||||||
} from "@/api/modules/union";
|
|
||||||
const props = defineProps(["rowData"]);
|
const props = defineProps(["rowData"]);
|
||||||
const loading = ref(false)
|
const loading = ref(false);
|
||||||
const tableList = ref([])
|
const tableList = ref([]);
|
||||||
const searchForm = ref({
|
const searchForm = ref({
|
||||||
user_id: "",
|
user_id: "",
|
||||||
search_stime: "",
|
search_stime: "",
|
||||||
@@ -56,9 +54,14 @@ const dynamicColumns = ref([
|
|||||||
width: 300,
|
width: 300,
|
||||||
slot: "operation"
|
slot: "operation"
|
||||||
}
|
}
|
||||||
])
|
]);
|
||||||
const kickMember = async (rowData) => {
|
const kickMember = async rowData => {
|
||||||
const { code, msg } = await kickUnionMember({ user_id: rowData.user_id, guild_id: props.rowData.id });
|
// 踢出成员需要二级密码验证
|
||||||
|
verifyPassword(async () => {
|
||||||
|
const { code, msg } = await kickUnionMember({
|
||||||
|
user_id: rowData.user_id,
|
||||||
|
guild_id: props.rowData.id
|
||||||
|
});
|
||||||
if (code) {
|
if (code) {
|
||||||
message(`您已踢出昵称为【${rowData.nickname}】的用户`, {
|
message(`您已踢出昵称为【${rowData.nickname}】的用户`, {
|
||||||
type: "success"
|
type: "success"
|
||||||
@@ -69,7 +72,8 @@ const kickMember = async (rowData) => {
|
|||||||
type: "error"
|
type: "error"
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
|
};
|
||||||
const handleSizeChange = (val: number) => {
|
const handleSizeChange = (val: number) => {
|
||||||
pagination.value.pageSize = val;
|
pagination.value.pageSize = val;
|
||||||
onSearch(searchForm.value);
|
onSearch(searchForm.value);
|
||||||
@@ -78,9 +82,9 @@ const handleCurrentChange = (val: number) => {
|
|||||||
pagination.value.currentPage = val;
|
pagination.value.currentPage = val;
|
||||||
onSearch(searchForm.value);
|
onSearch(searchForm.value);
|
||||||
};
|
};
|
||||||
const onSearch = async (formData) => {
|
const onSearch = async formData => {
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
searchForm.value = { ...formData }
|
searchForm.value = { ...formData };
|
||||||
const { data, code } = await queryUnionMemberList({
|
const { data, code } = await queryUnionMemberList({
|
||||||
...formData,
|
...formData,
|
||||||
guild_id: props.rowData.id,
|
guild_id: props.rowData.id,
|
||||||
@@ -93,10 +97,10 @@ const onSearch = async (formData) => {
|
|||||||
pagination.value.currentPage = data.page;
|
pagination.value.currentPage = data.page;
|
||||||
}
|
}
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
}
|
};
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
onSearch(searchForm.value)
|
onSearch(searchForm.value);
|
||||||
})
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@@ -112,12 +116,9 @@ onMounted(() => {
|
|||||||
<!-- v-if="row.status_str === '正常'" -->
|
<!-- v-if="row.status_str === '正常'" -->
|
||||||
<el-popconfirm :title="`是否确认踢出名称为【${row.nickname}】的用户`" @confirm="kickMember(row)">
|
<el-popconfirm :title="`是否确认踢出名称为【${row.nickname}】的用户`" @confirm="kickMember(row)">
|
||||||
<template #reference>
|
<template #reference>
|
||||||
<el-button link type="primary">
|
<el-button link type="primary"> 踢出成员 </el-button>
|
||||||
踢出成员
|
|
||||||
</el-button>
|
|
||||||
</template>
|
</template>
|
||||||
</el-popconfirm>
|
</el-popconfirm>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
</pure-table>
|
</pure-table>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user