Browse Source

Merge branch 'refs/heads/lihui/feature-20250728114233-金币前端三期' into milestone-20250728-金币前端三期

zhangrenyuan/feature-20250728113353-金币前端三期
lihui 2 weeks ago
parent
commit
50c44e8fa7
  1. 79
      src/views/audit/gold/rechargeAudit.vue
  2. 75
      src/views/audit/gold/refundAudit.vue
  3. 20
      src/views/permissions/userPermission.vue
  4. 12
      src/views/workspace/index.vue

79
src/views/audit/gold/rechargeAudit.vue

@ -24,14 +24,11 @@
<el-text class="mx-1" size="large">所属地区</el-text>
<el-cascader
v-model="selectedMarketPath"
:options="markets"
:options="market"
placeholder="请选择所属地区"
clearable
collapse-tags
collapse-tags-tooltip
style="width:180px"
@change="handleMarketChange"
:props="props"
/>
</el-col>
</el-row>
@ -93,11 +90,7 @@
</el-table-column>
<el-table-column fixed="left" prop="name" label="姓名" width="150px"/>
<el-table-column fixed="left" prop="jwcode" label="精网号" width="110px"/>
<el-table-column prop="market" label="所属地区" width="100px">
<template #default="scope">
{{ scope.row.market || "----" }}
</template>
</el-table-column>
<el-table-column prop="market" label="所属地区" width="100px"/>
<el-table-column prop="activity" label="活动名称" width="100px" show-overflow-tooltip/>
<el-table-column prop="money" label="充值金额" sortable="custom" width="110px">
<template #default="scope">{{ scope.row.permanentGold / 100 }}</template>
@ -189,7 +182,6 @@
<script setup>
import {onMounted, reactive, ref} from 'vue'
import {reverseMarketMapping} from '@/utils/marketMap.js'
import {ElMessage} from 'element-plus'
import request from '@/util/http.js'
import API from '@/util/http.js'
@ -230,7 +222,7 @@ const rechargeAudit = ref({
payModel: "", //
startTime: "", //
endTime: "", //
markets: [], //
market: "", //
auditStatus: "0",
})
@ -245,7 +237,7 @@ const total = ref(50)
const getTime = ref([])
const activity = ref([])
//
const markets = ref([])
const market = ref("")
//
const rejectDialogVisible = ref(false)
//
@ -385,7 +377,7 @@ const resetSearch = function () {
payModel: "",
startTime: "",
endTime: "",
markets: [],
market: "",
auditStatus: rechargeAudit.value.auditStatus,
}
@ -621,61 +613,14 @@ const previewImage = (imageUrl) => {
};
//
const selectedMarketPath = ref([])
//
const selectedMarketPath = ref("")
const handleMarketChange = (value) => {
if (Array.isArray(value) && value.length > 0) {
const ids = new Set();
value.forEach(path => {
const lastName = path[path.length - 1];
const id = reverseMarketMapping[lastName];
if (id) ids.add(Number(id));
});
//
const getAllLeafNames = (nodes) => {
const leafNames = [];
const traverse = (node, parentName = null) => {
if (!node.children || node.children.length === 0) {
leafNames.push({name: node.label, parent: parentName});
} else {
node.children.forEach(child => traverse(child, node.label));
}
};
nodes.forEach(node => traverse(node));
return leafNames;
};
const leafNameMap = getAllLeafNames(markets.value); //
//
const parentToChildren = {};
leafNameMap.forEach(({name, parent}) => {
if (!parentToChildren[parent]) parentToChildren[parent] = [];
parentToChildren[parent].push(name);
});
//
const selectedLeafNames = value.map(path => path[path.length - 1]);
// parent parent
Object.entries(parentToChildren).forEach(([parent, children]) => {
const allChildrenSelected = children.every(child => selectedLeafNames.includes(child));
if (allChildrenSelected && reverseMarketMapping[parent]) {
ids.add(Number(reverseMarketMapping[parent]));
}
});
rechargeAudit.value.markets = Array.from(ids);
if (value && value.length > 0) {
rechargeAudit.value.market = value[value.length - 1]
} else {
rechargeAudit.value.markets = [];
rechargeAudit.value.market = ''
}
console.log('最终映射后的 market IDs:', rechargeAudit.value.markets);
};
}
const props = {multiple: true}
//
@ -707,8 +652,8 @@ const getMarket = async function () {
});
};
//
markets.value = transformTree(result.data)
console.log('转换后的地区树==============', markets.value)
market.value = transformTree(result.data)
console.log('转换后的地区树==============', market.value)
} catch (error) {
console.log('请求失败', error)
}

75
src/views/audit/gold/refundAudit.vue

@ -25,14 +25,11 @@
<el-text class="mx-1" size="large">所属地区</el-text>
<el-cascader
v-model="selectedMarketPath"
:options="markets"
:options="market"
placeholder="请选择所属地区"
clearable
collapse-tags
collapse-tags-tooltip
style="width:180px"
@change="handleMarketChange"
:props="props"
/>
</el-col>
</el-row>
@ -172,7 +169,6 @@ import {onMounted, reactive, ref} from 'vue'
import {ElMessage} from 'element-plus'
import API from '@/util/http.js'
import moment from 'moment'
import {reverseMarketMapping} from "@/utils/marketMap.js";
import {useAdminStore} from "@/store/index.js";
import {storeToRefs} from "pinia";
import {findMenuById, permissionMapping} from "@/utils/menuTreePermission.js"
@ -203,7 +199,7 @@ const searchForm = ref({
jwcode: '',
refundModel: '',
goodsName: '',
markets: [],
market: "",
startTime: '',
endTime: '',
auditStatus: '0'
@ -294,7 +290,7 @@ const showRejectDialog = (row) => {
rejectDialogVisible.value = true
}
//
const markets = ref([])
const market = ref("")
//
const getRefundGoods = async () => {
@ -435,7 +431,7 @@ const resetSearch = function () {
jwcode: '',
refundType: '',
goodsName: '',
markets: [],
market: "",
startTime: '',
endTime: '',
sortField: '',
@ -549,63 +545,14 @@ const adminReject = async function () {
}
//
const selectedMarketPath = ref([])
//
const selectedMarketPath = ref("")
const handleMarketChange = (value) => {
if (Array.isArray(value) && value.length > 0) {
const ids = new Set();
value.forEach(path => {
const lastName = path[path.length - 1];
const id = reverseMarketMapping[lastName];
if (id) ids.add(Number(id));
});
//
const getAllLeafNames = (nodes) => {
const leafNames = [];
const traverse = (node, parentName = null) => {
if (!node.children || node.children.length === 0) {
leafNames.push({name: node.label, parent: parentName});
} else {
node.children.forEach(child => traverse(child, node.label));
}
};
nodes.forEach(node => traverse(node));
return leafNames;
};
const leafNameMap = getAllLeafNames(markets.value); //
//
const parentToChildren = {};
leafNameMap.forEach(({name, parent}) => {
if (!parentToChildren[parent]) parentToChildren[parent] = [];
parentToChildren[parent].push(name);
});
//
const selectedLeafNames = value.map(path => path[path.length - 1]);
// parent parent
Object.entries(parentToChildren).forEach(([parent, children]) => {
const allChildrenSelected = children.every(child => selectedLeafNames.includes(child));
if (allChildrenSelected && reverseMarketMapping[parent]) {
ids.add(Number(reverseMarketMapping[parent]));
}
});
searchForm.value.markets = Array.from(ids);
if (value && value.length > 0) {
searchForm.value.market = value[value.length - 1]
} else {
searchForm.value.markets = [];
searchForm.value.market = ''
}
console.log('最终映射后的 market IDs:', searchForm.value.markets);
};
const props = {multiple: true}
}
//
const getMarket = async function () {
try {
@ -635,8 +582,8 @@ const getMarket = async function () {
});
};
//
markets.value = transformTree(result.data)
console.log('转换后的地区树==============', markets.value)
market.value = transformTree(result.data)
console.log('转换后的地区树==============', market.value)
} catch (error) {
console.log('请求失败', error)
}

20
src/views/permissions/userPermission.vue

@ -697,11 +697,12 @@ const handleMarketChangeEditUser = (value) => {
}
};
//
const addUserProps ={
multiple: true,
}
/*// 计算属性控制级联选择器的选项禁用状态
const addUserProps = computed(() => {
// addAdmin.market
//
const hasHeadquarters = addAdmin.value.market.includes('总部');
return {
@ -712,11 +713,14 @@ const addUserProps = computed(() => {
}
};
});
});*/
//
const editUserProps = {
multiple: true,
}
/*// 计算属性控制级联选择器的选项禁用状态
const editUserProps = computed(() => {
// addAdmin.market
//
const hasHeadquarters = permissionEditObj.value.market.includes('总部');
return {
@ -727,7 +731,7 @@ const editUserProps = computed(() => {
}
};
});
});*/
const selectParentNodes = (treeData, nodeId, checkedKeys) => {
if (!Array.isArray(treeData)) return false;

12
src/views/workspace/index.vue

@ -48,7 +48,7 @@
<div>
<div class="margin-bottom">永久金币{{ currentPermanent / 100 }}</div>
<div class="margin-bottom">免费金币{{ currentFree / 100 }}</div>
<div class="margin-bottom">[六月到期|{{ currentFreeJune / 100 }}]&nbsp;&nbsp;&nbsp;&nbsp;[12月到期|{{
<div class="margin-bottom">[六月到期|{{ currentFreeJune / 100 }}]&nbsp;&nbsp;&nbsp;&nbsp;[十二月到期|{{
currentFreeDecember /
100
}}]
@ -148,16 +148,16 @@
</el-col>
<el-col :span="24">
<el-row>
<div style="margin-top:5px">合计&nbsp;&nbsp;&nbsp;&nbsp;
<div style="margin-top:5px">合计&nbsp;
永久金币 {{
activeTab === 'recharge' ? sumRechargePermanent / 100 : sumConsumePermanent / 100
}}&nbsp;&nbsp;&nbsp;&nbsp;
}}
免费金币 {{
activeTab === 'recharge' ? sumRechargeFree / 100 : sumConsumeFree / 100
}}&nbsp;&nbsp;&nbsp;&nbsp;
}}
任务金币 {{
activeTab === 'recharge' ? sumRechargeTask / 100 : sumConsumeTask / 100
}}&nbsp;&nbsp;&nbsp;&nbsp;
}}
</div>
<div @change="handleDatePickerChange">
<el-button @click="getToday()" label="day" style="margin-left:250px"
@ -705,7 +705,7 @@ const updateChart = (chartData) => {
},
xAxis: {
type: 'category',
data: markets.value.map(m => marketMapping[m] || m),
data: markets.value,
axisLabel: {
interval: 0,
rotate: 30

Loading…
Cancel
Save