Browse Source

Merge branch 'refs/heads/lihui/feature-20251104165712-现金二期' into milestone-20251104-现金二期

zhangrenyuan/feature-20251104133449-现金管理二期
lihui 3 weeks ago
parent
commit
6252d3333a
  1. 22
      src/views/consume/gold/addCoinConsume.vue
  2. 13
      src/views/consume/gold/coinConsumeDetail.vue

22
src/views/consume/gold/addCoinConsume.vue

@ -1,14 +1,13 @@
<script setup> <script setup>
import { onMounted, reactive, ref, watch } from "vue";
import { ElIcon, ElMessage, ElMessageBox } from "element-plus";
import {onMounted, reactive, ref, watch} from "vue";
import {ElIcon, ElMessage} from "element-plus";
import moment from "moment"; import moment from "moment";
import request from "@/util/http.js" import request from "@/util/http.js"
import Cookies from 'js-cookie'; import Cookies from 'js-cookie';
import { useAdminStore } from "@/store/index.js";
import { storeToRefs } from "pinia";
import { WarnTriangleFilled } from "@element-plus/icons-vue";
import {useAdminStore} from "@/store/index.js";
import {storeToRefs} from "pinia";
import {WarnTriangleFilled} from "@element-plus/icons-vue";
import dayjs from "dayjs"; import dayjs from "dayjs";
import {hasMenuPermission, permissionMapping} from "@/utils/menuTreePermission.js";
const adminStore = useAdminStore(); const adminStore = useAdminStore();
const { adminData, menuTree } = storeToRefs(adminStore); const { adminData, menuTree } = storeToRefs(adminStore);
@ -215,19 +214,10 @@ const ReadCookies = ref(null)
// cookie value // cookie value
const ReadCookiesTime = ref(null) const ReadCookiesTime = ref(null)
const addCoinConsumePermission = ref(false) //
//
const initPermissions = async() => {
if (!menuTree.value || !menuTree.value.length) return;
addCoinConsumePermission.value = hasMenuPermission(menuTree.value, permissionMapping.add_gold_coin_consumption);
};
// //
const add = async function () { const add = async function () {
if (!addCoinConsumePermission) {
ElMessage.error('暂无权限')
return
}
try { try {
// //
if (!validateInput()) { if (!validateInput()) {

13
src/views/consume/gold/coinConsumeDetail.vue

@ -5,7 +5,6 @@ import request from '@/util/http.js'
import API from '@/util/http.js' import API from '@/util/http.js'
import moment from 'moment' import moment from 'moment'
import { reverseMarketMapping } from "@/utils/marketMap.js"; import { reverseMarketMapping } from "@/utils/marketMap.js";
import {hasMenuPermission, permissionMapping} from "@/utils/menuTreePermission.js";
import { storeToRefs } from 'pinia' import { storeToRefs } from 'pinia'
import { useAdminStore } from '@/store/index.js' import { useAdminStore } from '@/store/index.js'
const adminStore = useAdminStore() const adminStore = useAdminStore()
@ -153,15 +152,8 @@ const totalGoldSearch = ref({
goodsName: "" goodsName: ""
}) })
const selectPermission = ref(false)
//
const initPermissions = async() => {
if (!menuTree.value || !menuTree.value.length) return;
selectPermission.value = hasMenuPermission(menuTree.value, permissionMapping.gold_coin_consumption_details);
};
/* /*
====================方法================================= ====================方法=================================
*/ */
@ -183,10 +175,6 @@ const getAdminData = async function () {
const ConsumeSelectBy = async function (val) { const ConsumeSelectBy = async function (val) {
if (!selectPermission) {
ElMessage.error('暂无权限')
return
}
try { try {
@ -437,7 +425,6 @@ const handleCurrentChange = function (val) {
// //
const sumGold = computed(() => permanentGolds.value + freeGolds.value + taskGolds.value) const sumGold = computed(() => permanentGolds.value + freeGolds.value + taskGolds.value)
onMounted(async function () { onMounted(async function () {
await initPermissions()
await getAdminData() await getAdminData()
await ConsumeSelectBy() await ConsumeSelectBy()
// getActivity(); // getActivity();

Loading…
Cancel
Save