更新秘地
This commit is contained in:
@@ -46,4 +46,9 @@ export const getLogInfo = params => {
|
||||
"/adminapi/Adminlog/detail",
|
||||
{ params }
|
||||
);
|
||||
};
|
||||
};
|
||||
export const apiPassWord = data => {
|
||||
return http.request<Result>("post", "/adminapi/User/changePwd", {
|
||||
data
|
||||
});
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
export const URL = "https://md.xscmmidi.site";
|
||||
export const URL = "https://tmd.xscmmidi.site";
|
||||
// https://md.xscmmidi.site 正式
|
||||
// https://tmd.xscmmidi.site 测试
|
||||
// 声网appId 在这里换
|
||||
|
||||
@@ -102,7 +102,7 @@ export function useData() {
|
||||
type: rowData?.type ?? "",
|
||||
num: rowData?.num ?? "",
|
||||
gift_id: rowData?.gift_id ?? "",
|
||||
gift_bag_id: rowData?.gift_bag_id ?? "",
|
||||
gift_bag_id: propRowData.value.id ?? "",
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
@@ -26,6 +26,7 @@ onMounted(() => {
|
||||
|
||||
|
||||
<template>
|
||||
<!-- 首充好礼的礼物列表 -->
|
||||
<div class="main">
|
||||
<div ref="contentRef" :class="['flex', deviceDetection() ? 'flex-wrap' : '']">
|
||||
<PureTableBar title="" :class="[isShow && !deviceDetection() ? '!w-[60vw]' : 'w-full']" :columns="tableLabel"
|
||||
|
||||
@@ -57,5 +57,9 @@ defineExpose({ getRef });
|
||||
<el-form-item label="所得金币文字" prop="diamond">
|
||||
<el-input v-model="newFormInline.diamond" clearable placeholder="请输入所得金币文字" />
|
||||
</el-form-item>
|
||||
<el-form-item label="活动结束时间" prop="activity_end_time">
|
||||
<el-date-picker style="width: 100%;" clearable v-model="newFormInline.activity_end_time" type="datetime"
|
||||
:placeholder="`请选择活动结束时间`" format="YYYY-MM-DD HH:mm:ss" value-format="YYYY-MM-DD HH:mm:ss" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</template>
|
||||
|
||||
74
src/views/Activities/goodGift/giftPack/form.vue
Normal file
74
src/views/Activities/goodGift/giftPack/form.vue
Normal file
@@ -0,0 +1,74 @@
|
||||
<script setup lang="ts">
|
||||
import {
|
||||
ref,
|
||||
onMounted
|
||||
} from "vue";
|
||||
import { queryGiftList, queryAdornmentList } from '@/api/modules/activities'
|
||||
const ruleFormRef = ref();
|
||||
const formRules = ref({
|
||||
num: [{ required: true, message: "数量为必填项", trigger: "blur" }],
|
||||
type: [{ required: true, message: "请选择类型", trigger: "change" }],
|
||||
gift_id: [{ required: true, message: "请选择", trigger: "change" }],
|
||||
});
|
||||
const props = defineProps(["formInline"]);
|
||||
const typeList = ref([]);
|
||||
const adornmentList = ref([]);
|
||||
const newFormInline = ref(
|
||||
props.formInline
|
||||
? props.formInline
|
||||
: {
|
||||
type: "",
|
||||
num: "",
|
||||
gift_id: "",
|
||||
gift_bag_id: "",
|
||||
}
|
||||
);
|
||||
function getRef() {
|
||||
return ruleFormRef.value;
|
||||
}
|
||||
const getList = async () => {
|
||||
const { data, code } = await queryGiftList({ type: 3 })
|
||||
typeList.value = code ? data : []
|
||||
}
|
||||
const getAdornmentList = async () => {
|
||||
const { data, code } = await queryAdornmentList()
|
||||
adornmentList.value = code ? data : []
|
||||
}
|
||||
const changeType = () => {
|
||||
newFormInline.value.gift_id = ''
|
||||
}
|
||||
onMounted(() => {
|
||||
getList()
|
||||
getAdornmentList()
|
||||
})
|
||||
defineExpose({ getRef });
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<el-form ref="ruleFormRef" :model="newFormInline" :rules="formRules" label-width="120px">
|
||||
<el-form-item label="类型" prop="type">
|
||||
<el-radio-group v-model="newFormInline.type" @change="changeType">
|
||||
<el-radio label="金币" :value="1" />
|
||||
<el-radio label="礼物" :value="2" />
|
||||
<el-radio label="装扮" :value="3" />
|
||||
<el-radio label="钻石" :value="4" />
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="[1, 2, 4].includes(newFormInline.type)"
|
||||
:label="newFormInline.type === 1 ? '金币数量' : newFormInline.type === 2 ? '礼物数量' : newFormInline.type === 3 ? '装扮天数' : '钻石数量'"
|
||||
prop="num">
|
||||
<el-input-number v-model="newFormInline.num" :min="1" :max="10000" label="请输入"></el-input-number>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="[2, 3].includes(newFormInline.type)" :label="`选择${newFormInline.type === 2 ? '礼物' : '装扮'}`"
|
||||
prop="gift_id">
|
||||
<el-select v-if="newFormInline.type === 2" v-model="newFormInline.gift_id" placeholder="请选择礼物">
|
||||
<el-option v-for="item in typeList" :key="item.gid" :label="item.gift_name" :value="item.gid">
|
||||
</el-option>
|
||||
</el-select>
|
||||
<el-select v-else v-model="newFormInline.gift_id" placeholder="请选择装扮">
|
||||
<el-option v-for="item in adornmentList" :key="item.id" :label="item.name" :value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</template>
|
||||
175
src/views/Activities/goodGift/giftPack/hook.tsx
Normal file
175
src/views/Activities/goodGift/giftPack/hook.tsx
Normal file
@@ -0,0 +1,175 @@
|
||||
import { ref, h, nextTick } from "vue";
|
||||
import editForm from "./form.vue";
|
||||
import { message } from "@/utils/message";
|
||||
import {
|
||||
queryGiftPack,
|
||||
addGiftPackData,
|
||||
editGiftPackData,
|
||||
deteleGiftPackData
|
||||
} from "@/api/modules/activities";
|
||||
import { addDialog } from "@/components/ReDialog";
|
||||
export function useData() {
|
||||
const formRef = ref();
|
||||
const propRowData = ref(null)
|
||||
const loading = ref(true);
|
||||
const tableList = ref([]);
|
||||
const isShow = ref(false);
|
||||
const pagination = ref({
|
||||
total: 0,
|
||||
pageSize: 10,
|
||||
currentPage: 1,
|
||||
pageSizes: [10, 20, 50, 100],
|
||||
background: true
|
||||
});
|
||||
const tableLabel = ref([
|
||||
{
|
||||
label: "ID",
|
||||
prop: "id"
|
||||
},
|
||||
{
|
||||
label: "礼物名称",
|
||||
prop: "name"
|
||||
},
|
||||
{
|
||||
label: "封面图",
|
||||
prop: "icon",
|
||||
cellRenderer: ({ row }) => (
|
||||
<el-image
|
||||
fit="cover"
|
||||
preview-teleported={true}
|
||||
src={row.icon}
|
||||
preview-src-list={Array.of(row.icon)}
|
||||
class="w-[50px] h-[50px] align-middle"
|
||||
/>
|
||||
)
|
||||
},
|
||||
{
|
||||
label: "数量",
|
||||
prop: "num"
|
||||
},
|
||||
{
|
||||
label: "价格",
|
||||
prop: "gold"
|
||||
},
|
||||
{
|
||||
label: "类型",
|
||||
prop: "type_str"
|
||||
},
|
||||
{
|
||||
label: "添加时间",
|
||||
prop: "createtime"
|
||||
},
|
||||
{
|
||||
label: "操作",
|
||||
fixed: "right",
|
||||
width: 210,
|
||||
slot: "operation"
|
||||
}
|
||||
]);
|
||||
const onSearch = async (rowData) => {
|
||||
propRowData.value = { ...rowData }
|
||||
loading.value = true;
|
||||
const { data, code } = await queryGiftPack({
|
||||
gift_bag_id: propRowData.value.id,
|
||||
page: pagination.value.currentPage,
|
||||
page_limit: pagination.value.pageSize
|
||||
});
|
||||
if (code) {
|
||||
tableList.value = data.lists.map(ele => {
|
||||
return {
|
||||
...ele
|
||||
}
|
||||
});
|
||||
pagination.value.total = data.count;
|
||||
pagination.value.currentPage = data.page;
|
||||
}
|
||||
loading.value = false;
|
||||
};
|
||||
const handleSizeChange = (val: number) => {
|
||||
pagination.value.pageSize = val;
|
||||
onSearch(propRowData.value);
|
||||
};
|
||||
const handleCurrentChange = (val: number) => {
|
||||
pagination.value.currentPage = val;
|
||||
onSearch(propRowData.value);
|
||||
};
|
||||
// 新增
|
||||
const openDialog = (title = "新增", rowData: any) => {
|
||||
addDialog({
|
||||
title: `${title}礼物`,
|
||||
props: {
|
||||
formInline: {
|
||||
type: rowData?.type ?? "",
|
||||
num: rowData?.num ?? "",
|
||||
gift_id: rowData?.gift_id ?? "",
|
||||
gift_bag_id: propRowData.value.id,
|
||||
|
||||
}
|
||||
},
|
||||
width: "40%",
|
||||
closeOnClickModal: false,
|
||||
contentRenderer: () => h(editForm, { ref: formRef, formInline: null }),
|
||||
beforeSure: (done, { options }) => {
|
||||
const FormRef = formRef.value.getRef();
|
||||
const curData = options.props.formInline;
|
||||
const saveData = async form => {
|
||||
const { code } = await addGiftPackData(form);
|
||||
if (code) {
|
||||
message("新增成功", { type: "success" });
|
||||
onSearch(propRowData.value);
|
||||
done();
|
||||
} else {
|
||||
message("新增失败", { type: "error" });
|
||||
}
|
||||
};
|
||||
const updateData = async form => {
|
||||
const { code } = await editGiftPackData({
|
||||
...form,
|
||||
id: rowData.id
|
||||
});
|
||||
if (code) {
|
||||
message("修改成功", { type: "success" });
|
||||
onSearch(propRowData.value);
|
||||
done();
|
||||
} else {
|
||||
message("修改失败", { type: "error" });
|
||||
}
|
||||
};
|
||||
FormRef.validate(valid => {
|
||||
if (valid) {
|
||||
console.log("curData", curData);
|
||||
// 表单规则校验通过
|
||||
if (title === "新增") {
|
||||
// 实际开发先调用新增接口,再进行下面操作
|
||||
saveData(curData);
|
||||
} else {
|
||||
// 实际开发先调用修改接口,再进行下面操作
|
||||
updateData(curData);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
const handleDelete = async rowData => {
|
||||
const { code } = await deteleGiftPackData({ id: rowData.id });
|
||||
if (code) {
|
||||
message(`您删除了名称为${rowData.name}的这条数据`, {
|
||||
type: "success"
|
||||
});
|
||||
onSearch(propRowData.value);
|
||||
}
|
||||
};
|
||||
return {
|
||||
onSearch,
|
||||
isShow,
|
||||
tableList,
|
||||
tableLabel,
|
||||
pagination,
|
||||
handleSizeChange,
|
||||
handleCurrentChange,
|
||||
handleDelete,
|
||||
loading,
|
||||
openDialog
|
||||
};
|
||||
}
|
||||
64
src/views/Activities/goodGift/giftPack/index.vue
Normal file
64
src/views/Activities/goodGift/giftPack/index.vue
Normal file
@@ -0,0 +1,64 @@
|
||||
<script setup lang="ts">
|
||||
import { onMounted } from "vue";
|
||||
import { useData } from "./hook";
|
||||
import { PureTableBar } from "@/components/RePureTableBar";
|
||||
import { deviceDetection } from "@pureadmin/utils";
|
||||
const props = defineProps(["rowData"]);
|
||||
const {
|
||||
onSearch,
|
||||
isShow,
|
||||
tableList,
|
||||
pagination,
|
||||
tableLabel,
|
||||
handleSizeChange,
|
||||
handleCurrentChange,
|
||||
openDialog,
|
||||
handleDelete,
|
||||
loading,
|
||||
} = useData();
|
||||
defineOptions({
|
||||
name: "RechargeList"
|
||||
});
|
||||
onMounted(() => {
|
||||
onSearch(props.rowData);
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
<template>
|
||||
<!-- 天降好礼的礼物列表 -->
|
||||
<div class="main">
|
||||
<div ref="contentRef" :class="['flex', deviceDetection() ? 'flex-wrap' : '']">
|
||||
<PureTableBar title="" :class="[isShow && !deviceDetection() ? '!w-[60vw]' : 'w-full']" :columns="tableLabel"
|
||||
@refresh="onSearch">
|
||||
<template #buttons>
|
||||
<el-button type="primary" @click="openDialog('新增', {})">
|
||||
添加礼物
|
||||
</el-button>
|
||||
</template>
|
||||
<template v-slot="{ size, dynamicColumns }">
|
||||
<pure-table ref="tableRef" align-whole="center" showOverflowTooltip table-layout="auto" default-expand-all
|
||||
:loading="loading" :size="size" row-key="id" adaptive :adaptiveConfig="{ offsetBottom: 108 }"
|
||||
:data="tableList" :columns="dynamicColumns" :pagination="{ ...pagination, size }" :header-cell-style="{
|
||||
background: 'var(--el-fill-color-light)',
|
||||
color: 'var(--el-text-color-primary)'
|
||||
}" @page-current-change="handleCurrentChange" @page-size-change="handleSizeChange">
|
||||
<template #operation="{ row }">
|
||||
|
||||
<el-button link type="primary" :size="size" @click="openDialog('编辑', row)">
|
||||
编辑
|
||||
</el-button>
|
||||
<el-popconfirm :title="`是否确认删除这条数据`" @confirm="handleDelete(row)">
|
||||
<template #reference>
|
||||
<el-button link type="primary" :size="size"> 删除 </el-button>
|
||||
</template>
|
||||
</el-popconfirm>
|
||||
</template>
|
||||
|
||||
</pure-table>
|
||||
</template>
|
||||
</PureTableBar>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<style scoped lang="scss"></style>
|
||||
@@ -2,6 +2,7 @@ import { ref, h, nextTick } from "vue";
|
||||
import editForm from "./form.vue";
|
||||
import { message } from "@/utils/message";
|
||||
import recordList from "./record.vue"
|
||||
import giftPackView from './giftPack/index.vue';
|
||||
import {
|
||||
getGoodGiftInfo,
|
||||
setGoodGiftConfig
|
||||
@@ -55,6 +56,11 @@ export function useData() {
|
||||
label: "所得金币文字",
|
||||
prop: "diamond"
|
||||
},
|
||||
{
|
||||
label: "操作",
|
||||
fixed: "right",
|
||||
slot: "operation"
|
||||
}
|
||||
]);
|
||||
const onSearch = async () => {
|
||||
loading.value = true;
|
||||
@@ -92,7 +98,8 @@ export function useData() {
|
||||
counter: rowData?.counter ?? "",
|
||||
money: rowData?.money ?? "",
|
||||
money_str: rowData?.money_str ?? "",
|
||||
diamond: rowData?.diamond ?? ""
|
||||
diamond: rowData?.diamond ?? "",
|
||||
activity_end_time: rowData?.activity_end_time ?? "",
|
||||
}
|
||||
},
|
||||
width: "40%",
|
||||
@@ -131,6 +138,18 @@ export function useData() {
|
||||
contentRenderer: () => h(recordList, { ref: formRef, formInline: null }),
|
||||
});
|
||||
};
|
||||
const openGiftPark = (rowData) => {
|
||||
addDialog({
|
||||
title: `礼包列表`,
|
||||
width: "60%",
|
||||
closeOnClickModal: false,
|
||||
hideFooter: true,
|
||||
props: {
|
||||
rowData
|
||||
},
|
||||
contentRenderer: () => h(giftPackView, { ref: formRef, formInline: null }),
|
||||
});
|
||||
}
|
||||
return {
|
||||
onSearch,
|
||||
isShow,
|
||||
@@ -141,6 +160,7 @@ export function useData() {
|
||||
handleCurrentChange,
|
||||
loading,
|
||||
setConfig,
|
||||
DistributionRecord
|
||||
DistributionRecord,
|
||||
openGiftPark
|
||||
};
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ const {
|
||||
handleSizeChange,
|
||||
handleCurrentChange,
|
||||
DistributionRecord,
|
||||
openGiftPark,
|
||||
loading,
|
||||
} = useData();
|
||||
defineOptions({
|
||||
@@ -44,6 +45,11 @@ onMounted(() => {
|
||||
background: 'var(--el-fill-color-light)',
|
||||
color: 'var(--el-text-color-primary)'
|
||||
}" @page-current-change="handleCurrentChange" @page-size-change="handleSizeChange">
|
||||
<template #operation="{ row }">
|
||||
<el-button link type="primary" :size="size" @click="openGiftPark(row)">
|
||||
查看礼包列表
|
||||
</el-button>
|
||||
</template>
|
||||
</pure-table>
|
||||
</template>
|
||||
</PureTableBar>
|
||||
|
||||
54
src/views/Activities/newcomer/form.vue
Normal file
54
src/views/Activities/newcomer/form.vue
Normal file
@@ -0,0 +1,54 @@
|
||||
<script setup lang="ts">
|
||||
import { ref } from "vue";
|
||||
const ruleFormRef = ref();
|
||||
const formRules = ref({
|
||||
title: [{ required: true, message: "请输入新人礼包标题", trigger: "blur" }],
|
||||
money: [{ required: true, message: "请输入价值", trigger: "blur" }],
|
||||
status: [{ required: true, message: "请选择状态", trigger: "change" }],
|
||||
name: [{ required: true, message: "请输入新人礼包名称", trigger: "blur" }, { min: 1, max: 10, message: '长度在 1 到 10 个字符', trigger: 'blur' }]
|
||||
});
|
||||
const props = defineProps(["formInline"]);
|
||||
const newFormInline = ref(
|
||||
props.formInline
|
||||
? props.formInline
|
||||
: {
|
||||
name: "",
|
||||
title: "",
|
||||
status: "",
|
||||
title1: "",
|
||||
title2: "",
|
||||
money: ""
|
||||
|
||||
}
|
||||
);
|
||||
function getRef() {
|
||||
return ruleFormRef.value;
|
||||
}
|
||||
defineExpose({ getRef });
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<el-form ref="ruleFormRef" :model="newFormInline" :rules="formRules" label-width="120px">
|
||||
<el-form-item label="新人礼包名称" prop="name">
|
||||
<el-input v-model="newFormInline.name" clearable placeholder="请输入新人礼包名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="新人礼包标题" prop="title">
|
||||
<el-input v-model="newFormInline.title" clearable placeholder="请输入新人礼包标题" />
|
||||
</el-form-item>
|
||||
<el-form-item label="副标题1" prop="title1">
|
||||
<el-input v-model="newFormInline.title1" clearable placeholder="请输入副标题1" />
|
||||
</el-form-item>
|
||||
<el-form-item label="副标题2" prop="title2">
|
||||
<el-input v-model="newFormInline.title2" clearable placeholder="请输入副标题2" />
|
||||
</el-form-item>
|
||||
<el-form-item label="价值(元)" prop="money">
|
||||
<el-input v-model="newFormInline.money" clearable placeholder="请输入价值(元)" />
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-radio-group v-model="newFormInline.status">
|
||||
<el-radio label="开启" :value="1" />
|
||||
<el-radio label="关闭" :value="0" />
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</template>
|
||||
188
src/views/Activities/newcomer/hook.tsx
Normal file
188
src/views/Activities/newcomer/hook.tsx
Normal file
@@ -0,0 +1,188 @@
|
||||
import { ref, h } from "vue";
|
||||
import editForm from "./form.vue";
|
||||
import { message } from "@/utils/message";
|
||||
import recordList from "./record.vue";
|
||||
import giftPackView from '../giftPack/index.vue';
|
||||
import {
|
||||
queryFirstCharge,
|
||||
addChargeTypeData,
|
||||
editChargeTypeData,
|
||||
deteleChargeTypeData
|
||||
} from "@/api/modules/activities";
|
||||
import { addDialog } from "@/components/ReDialog";
|
||||
export function useData() {
|
||||
const formRef = ref();
|
||||
const loading = ref(true);
|
||||
const tableList = ref([]);
|
||||
const isShow = ref(false);
|
||||
const pagination = ref({
|
||||
total: 0,
|
||||
pageSize: 10,
|
||||
pageSizes: [10, 20, 50, 100],
|
||||
currentPage: 1,
|
||||
background: true
|
||||
});
|
||||
const tableLabel = ref([
|
||||
{
|
||||
label: "ID",
|
||||
prop: "id"
|
||||
},
|
||||
{
|
||||
label: "新人礼包名称",
|
||||
prop: "name"
|
||||
},
|
||||
{
|
||||
label: "新人礼包标题",
|
||||
prop: "title"
|
||||
},
|
||||
{
|
||||
label: "副标题1",
|
||||
prop: "title1"
|
||||
},
|
||||
{
|
||||
label: "副标题2",
|
||||
prop: "title2"
|
||||
},
|
||||
{
|
||||
label: "价值(元)",
|
||||
prop: "money"
|
||||
},
|
||||
{
|
||||
label: "状态",
|
||||
prop: "status_str"
|
||||
},
|
||||
{
|
||||
label: "操作",
|
||||
fixed: "right",
|
||||
width: 210,
|
||||
slot: "operation"
|
||||
}
|
||||
]);
|
||||
const onSearch = async () => {
|
||||
loading.value = true;
|
||||
const { data, code } = await queryFirstCharge({
|
||||
page: pagination.value.currentPage,
|
||||
page_limit: pagination.value.pageSize,
|
||||
activities_id: 7
|
||||
});
|
||||
if (code) {
|
||||
tableList.value = data.lists;
|
||||
pagination.value.total = data.count;
|
||||
pagination.value.currentPage = data.page;
|
||||
}
|
||||
loading.value = false;
|
||||
};
|
||||
const handleSizeChange = (val: number) => {
|
||||
pagination.value.pageSize = val;
|
||||
onSearch();
|
||||
};
|
||||
const handleCurrentChange = (val: number) => {
|
||||
pagination.value.currentPage = val;
|
||||
onSearch();
|
||||
};
|
||||
const handleDelete = async rowData => {
|
||||
const { code } = await deteleChargeTypeData({ id: rowData.id });
|
||||
if (code) {
|
||||
message(`您删除了名称为${rowData.name}的这条数据`, {
|
||||
type: "success"
|
||||
});
|
||||
onSearch();
|
||||
}
|
||||
};
|
||||
const DistributionRecord = () => {
|
||||
addDialog({
|
||||
title: `发放记录`,
|
||||
width: "60%",
|
||||
closeOnClickModal: false,
|
||||
hideFooter: true,
|
||||
contentRenderer: () => h(recordList, { ref: formRef, formInline: null }),
|
||||
});
|
||||
};
|
||||
// 新增
|
||||
const openDialog = (title = "新增", rowData: any) => {
|
||||
addDialog({
|
||||
title: `${title}首充分类`,
|
||||
props: {
|
||||
formInline: {
|
||||
title: rowData?.title ?? "",
|
||||
name: rowData?.name ?? "",
|
||||
status: rowData?.status ?? "",
|
||||
title1: rowData?.title1 ?? "",
|
||||
title2: rowData?.title2 ?? "",
|
||||
money: rowData?.money ?? ""
|
||||
}
|
||||
},
|
||||
width: "40%",
|
||||
closeOnClickModal: false,
|
||||
contentRenderer: () => h(editForm, { ref: formRef, formInline: null }),
|
||||
beforeSure: (done, { options }) => {
|
||||
const FormRef = formRef.value.getRef();
|
||||
const curData = options.props.formInline;
|
||||
const saveData = async form => {
|
||||
const { code } = await addChargeTypeData({ ...form, activities_id: 7 });
|
||||
if (code) {
|
||||
message("新增成功", { type: "success" });
|
||||
onSearch();
|
||||
done();
|
||||
} else {
|
||||
message("新增失败", { type: "error" });
|
||||
}
|
||||
};
|
||||
const updateData = async form => {
|
||||
const { code } = await editChargeTypeData({
|
||||
...form,
|
||||
id: rowData.id,
|
||||
activities_id: 7
|
||||
});
|
||||
if (code) {
|
||||
message("修改成功", { type: "success" });
|
||||
onSearch();
|
||||
done();
|
||||
} else {
|
||||
message("修改失败", { type: "error" });
|
||||
}
|
||||
};
|
||||
FormRef.validate(valid => {
|
||||
if (valid) {
|
||||
console.log("curData", curData);
|
||||
// 表单规则校验通过
|
||||
if (title === "新增") {
|
||||
// 实际开发先调用新增接口,再进行下面操作
|
||||
saveData(curData);
|
||||
} else {
|
||||
// 实际开发先调用修改接口,再进行下面操作
|
||||
updateData(curData);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
// 打开礼物列表
|
||||
const openGiftPark = (rowData: any) => {
|
||||
addDialog({
|
||||
title: `礼包列表`,
|
||||
width: "60%",
|
||||
closeOnClickModal: false,
|
||||
hideFooter: true,
|
||||
props: {
|
||||
rowData
|
||||
},
|
||||
contentRenderer: () => h(giftPackView, { ref: formRef, formInline: null }),
|
||||
});
|
||||
}
|
||||
return {
|
||||
onSearch,
|
||||
isShow,
|
||||
tableList,
|
||||
tableLabel,
|
||||
pagination,
|
||||
handleSizeChange,
|
||||
handleCurrentChange,
|
||||
loading,
|
||||
handleDelete,
|
||||
openDialog,
|
||||
openGiftPark,
|
||||
DistributionRecord
|
||||
};
|
||||
}
|
||||
72
src/views/Activities/newcomer/index.vue
Normal file
72
src/views/Activities/newcomer/index.vue
Normal file
@@ -0,0 +1,72 @@
|
||||
<script setup lang="ts">
|
||||
import { onMounted } from "vue";
|
||||
import { useData } from "./hook";
|
||||
import SearchForm from "@/components/SearchForm/index.vue";
|
||||
import { PureTableBar } from "@/components/RePureTableBar";
|
||||
import { deviceDetection } from "@pureadmin/utils";
|
||||
import { useRenderIcon } from "@/components/ReIcon/src/hooks";
|
||||
import AddFill from "@iconify-icons/ri/add-circle-line";
|
||||
const {
|
||||
DistributionRecord,
|
||||
onSearch,
|
||||
isShow,
|
||||
tableList,
|
||||
pagination,
|
||||
tableLabel,
|
||||
handleSizeChange,
|
||||
handleCurrentChange,
|
||||
handleDelete,
|
||||
loading,
|
||||
openGiftPark,
|
||||
openDialog
|
||||
} = useData();
|
||||
defineOptions({
|
||||
name: "RechargeList"
|
||||
});
|
||||
onMounted(() => {
|
||||
onSearch();
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
<template>
|
||||
<div class="main">
|
||||
<div ref="contentRef" :class="['flex', deviceDetection() ? 'flex-wrap' : '']">
|
||||
<PureTableBar title="新人礼包" :class="[isShow && !deviceDetection() ? '!w-[60vw]' : 'w-full']" :columns="tableLabel"
|
||||
@refresh="onSearch">
|
||||
<template #buttons>
|
||||
<el-button link type="primary" @click="DistributionRecord">
|
||||
发放记录
|
||||
</el-button>
|
||||
<el-button type="primary" :icon="useRenderIcon(AddFill)" @click="openDialog('新增', {})">
|
||||
新增礼包类型
|
||||
</el-button>
|
||||
</template>
|
||||
<template v-slot="{ size, dynamicColumns }">
|
||||
<pure-table ref="tableRef" align-whole="center" showOverflowTooltip table-layout="auto" default-expand-all
|
||||
:loading="loading" :size="size" row-key="id" adaptive :adaptiveConfig="{ offsetBottom: 108 }"
|
||||
:data="tableList" :columns="dynamicColumns" :pagination="{ ...pagination, size }" :header-cell-style="{
|
||||
background: 'var(--el-fill-color-light)',
|
||||
color: 'var(--el-text-color-primary)'
|
||||
}" @page-current-change="handleCurrentChange" @page-size-change="handleSizeChange">
|
||||
<template #operation="{ row }">
|
||||
<el-button link type="primary" :size="size" @click="openGiftPark(row)">
|
||||
查看礼包列表
|
||||
</el-button>
|
||||
<el-button link type="primary" :size="size" @click="openDialog('编辑', row)">
|
||||
编辑
|
||||
</el-button>
|
||||
<el-popconfirm :title="`是否确认删除这条数据`" @confirm="handleDelete(row)">
|
||||
<template #reference>
|
||||
<el-button link type="primary" :size="size"> 删除 </el-button>
|
||||
</template>
|
||||
</el-popconfirm>
|
||||
|
||||
</template>
|
||||
</pure-table>
|
||||
</template>
|
||||
</PureTableBar>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<style scoped lang="scss"></style>
|
||||
79
src/views/Activities/newcomer/record.vue
Normal file
79
src/views/Activities/newcomer/record.vue
Normal file
@@ -0,0 +1,79 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted } from "vue";
|
||||
import { queryChargeRecord } from '@/api/modules/activities';
|
||||
import { PureTableBar } from "@/components/RePureTableBar";
|
||||
import { deviceDetection } from "@pureadmin/utils";
|
||||
const props = defineProps(["rowData"]);
|
||||
const isShow = ref(false)
|
||||
const loading = ref(true);
|
||||
const tableList = ref([]);
|
||||
const pagination = ref({
|
||||
total: 0,
|
||||
pageSize: 10,
|
||||
currentPage: 1,
|
||||
background: true
|
||||
});
|
||||
const tableLabel = ref([
|
||||
{
|
||||
label: "ID",
|
||||
prop: "id"
|
||||
},
|
||||
{
|
||||
label: "首充类型",
|
||||
prop: "gift_bag_type"
|
||||
},
|
||||
{
|
||||
label: "首充价格",
|
||||
prop: "money"
|
||||
},
|
||||
{
|
||||
label: "操作人员",
|
||||
prop: "user_name"
|
||||
},
|
||||
{
|
||||
label: "时间",
|
||||
prop: "createtime"
|
||||
}
|
||||
])
|
||||
const getRecordList = async () => {
|
||||
const { code, data } = await queryChargeRecord({
|
||||
page: pagination.value.currentPage,
|
||||
page_limit: pagination.value.pageSize,
|
||||
activities_id: 7
|
||||
})
|
||||
if (code) {
|
||||
tableList.value = data.lists;
|
||||
pagination.value.total = data.count;
|
||||
pagination.value.currentPage = data.page;
|
||||
}
|
||||
loading.value = false;
|
||||
}
|
||||
const handleSizeChange = (val: number) => {
|
||||
pagination.value.pageSize = val;
|
||||
getRecordList();
|
||||
};
|
||||
const handleCurrentChange = (val: number) => {
|
||||
pagination.value.currentPage = val;
|
||||
getRecordList();
|
||||
};
|
||||
onMounted(() => {
|
||||
getRecordList()
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div ref="contentRef" :class="['flex', deviceDetection() ? 'flex-wrap' : '']">
|
||||
<PureTableBar title="新人礼包发放记录" :class="[isShow && !deviceDetection() ? '!w-[60vw]' : 'w-full']"
|
||||
:columns="tableLabel" @refresh="getRecordList">
|
||||
<template v-slot="{ size, dynamicColumns }">
|
||||
<pure-table ref="tableRef" align-whole="center" showOverflowTooltip table-layout="auto" default-expand-all
|
||||
:loading="loading" :size="size" row-key="id" adaptive :adaptiveConfig="{ offsetBottom: 108 }"
|
||||
:data="tableList" :columns="dynamicColumns" :pagination="{ ...pagination }" :header-cell-style="{
|
||||
background: 'var(--el-fill-color-light)',
|
||||
color: 'var(--el-text-color-primary)'
|
||||
}" @page-current-change="handleCurrentChange" @page-size-change="handleSizeChange">
|
||||
</pure-table>
|
||||
</template>
|
||||
</PureTableBar>
|
||||
</div>
|
||||
</template>
|
||||
@@ -6,8 +6,10 @@ import {
|
||||
addData,
|
||||
editData,
|
||||
deleteData,
|
||||
getDataInfo
|
||||
getDataInfo,
|
||||
apiPassWord
|
||||
} from "@/api/modules/admin";
|
||||
import passwordForm from './password.vue';
|
||||
import { addDialog } from "@/components/ReDialog";
|
||||
export function useData() {
|
||||
const formRef = ref();
|
||||
@@ -143,6 +145,40 @@ export function useData() {
|
||||
onSearch();
|
||||
}
|
||||
};
|
||||
const settingPassWord = (title, rowData) => {
|
||||
addDialog({
|
||||
title: title,
|
||||
width: "40%",
|
||||
props: {
|
||||
formInline: {
|
||||
new_pwd: ""
|
||||
}
|
||||
},
|
||||
closeOnClickModal: false,
|
||||
contentRenderer: () => h(passwordForm, { ref: formRef, formInline: null }),
|
||||
beforeSure: (done, { options }) => {
|
||||
const FormRef = formRef.value.getRef();
|
||||
const curData = options.props.formInline;
|
||||
const updatePassWord = async form => {
|
||||
console.log(form)
|
||||
const { code } = await apiPassWord(form);
|
||||
if (code) {
|
||||
message("设置成功", { type: "success" });
|
||||
onSearch();
|
||||
done();
|
||||
} else {
|
||||
message("设置失败", { type: "error" });
|
||||
}
|
||||
};
|
||||
FormRef.validate(valid => {
|
||||
if (valid) {
|
||||
console.log("curData", curData.new_pwd);
|
||||
updatePassWord({ new_pwd: curData.new_pwd, user_id: rowData.id })
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
return {
|
||||
onSearch,
|
||||
isShow,
|
||||
@@ -153,6 +189,7 @@ export function useData() {
|
||||
handleCurrentChange,
|
||||
loading,
|
||||
openDialog,
|
||||
handleDelete
|
||||
handleDelete,
|
||||
settingPassWord
|
||||
};
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@ const {
|
||||
handleCurrentChange,
|
||||
openDialog,
|
||||
loading,
|
||||
settingPassWord,
|
||||
handleDelete
|
||||
} = useData();
|
||||
defineOptions({
|
||||
@@ -44,6 +45,9 @@ onMounted(() => {
|
||||
color: 'var(--el-text-color-primary)'
|
||||
}" @page-size-change="handleSizeChange" @page-current-change="handleCurrentChange">
|
||||
<template #operation="{ row }">
|
||||
<el-button link type="primary" :size="size" @click="settingPassWord('设置密码', row)">
|
||||
设置密码
|
||||
</el-button>
|
||||
<el-button link type="primary" :size="size" @click="openDialog('编辑', row)">
|
||||
编辑
|
||||
</el-button>
|
||||
|
||||
30
src/views/Admin/userList/password.vue
Normal file
30
src/views/Admin/userList/password.vue
Normal file
@@ -0,0 +1,30 @@
|
||||
<script setup lang="ts">
|
||||
import { ref } from "vue";
|
||||
const ruleFormRef = ref();
|
||||
const formRules = ref({
|
||||
new_pwd: [
|
||||
{ required: true, message: "密码为必填项", trigger: "blur" }
|
||||
]
|
||||
});
|
||||
const props = defineProps(["formInline"]);
|
||||
const newFormInline = ref(
|
||||
props.formInline
|
||||
? props.formInline
|
||||
: {
|
||||
user_id: "",
|
||||
new_pwd: ""
|
||||
}
|
||||
);
|
||||
function getRef() {
|
||||
return ruleFormRef.value;
|
||||
}
|
||||
defineExpose({ getRef });
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<el-form ref="ruleFormRef" :model="newFormInline" :rules="formRules" label-width="120px">
|
||||
<el-form-item label="设置新的密码" prop="new_pwd">
|
||||
<el-input placeholder="请输入密码" v-model="newFormInline.new_pwd" show-password></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</template>
|
||||
@@ -28,9 +28,11 @@ onMounted(() => {
|
||||
<el-tabs @tab-click="tabClick" type="border-card" v-model="activeId" style="width: 100%;">
|
||||
<el-tab-pane v-for="item in tableList" :label="item.name" :name="item.id">
|
||||
<el-form ref="form" :model="formData" label-width="200px">
|
||||
|
||||
<el-form-item :label="ele.key_name" v-for="ele in formLabel">
|
||||
<div style="width: 100%;display: inline-flex;">
|
||||
<div style="width: 20%;"><el-input v-model="formData[ele.key_title]"></el-input></div>
|
||||
<div style="width: 20%;"><el-input v-model="formData[ele.key_title]"
|
||||
:show-password="item.id === 11"></el-input></div>
|
||||
<div style="width: 70%; margin-left: 20px;color: #666;">{{ ele.key_desc }}</div>
|
||||
</div>
|
||||
</el-form-item>
|
||||
|
||||
@@ -37,7 +37,7 @@ export default ({ mode }: ConfigEnv): UserConfigExport => {
|
||||
proxyReq.method = 'OPTIONS';
|
||||
// 设置CORS头 https://admin.xscmmidi.site
|
||||
// 测试 https://tmd.xscmmidi.site
|
||||
res.setHeader('Access-Control-Allow-Origin', 'https://admin.xscmmidi.site');
|
||||
res.setHeader('Access-Control-Allow-Origin', 'https://tmd.xscmmidi.site');
|
||||
res.setHeader('Access-Control-Allow-Methods', 'GET, POST, PUT, DELETE, OPTIONS');
|
||||
res.setHeader('Access-Control-Allow-Headers', 'Content-Type, Authorization');
|
||||
res.end();
|
||||
|
||||
Reference in New Issue
Block a user