Browse Source

fix:去掉不必要的操作

zhangrenyuan/feature-20251104133449-现金管理二期
lihui 4 weeks ago
parent
commit
02d1418c69
  1. 22
      src/views/consume/gold/addCoinConsume.vue
  2. 15
      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()) {

15
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";
// //
/* /*
@ -142,14 +141,6 @@ 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);
};
/* /*
====================方法================================= ====================方法=================================
@ -172,11 +163,6 @@ const getAdminData = async function () {
const ConsumeSelectBy = async function (val) { const ConsumeSelectBy = async function (val) {
if (!selectPermission) {
ElMessage.error('暂无权限')
return
}
try { try {
// //
@ -426,7 +412,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