|
|
@ -1,6 +1,6 @@ |
|
|
<script setup> |
|
|
<script setup> |
|
|
import {onMounted, reactive, ref, watch} from "vue"; |
|
|
import {onMounted, reactive, ref, watch} from "vue"; |
|
|
import { ElIcon, ElMessage, ElMessageBox } from "element-plus"; |
|
|
|
|
|
|
|
|
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'; |
|
|
@ -8,7 +8,6 @@ import { useAdminStore } from "@/store/index.js"; |
|
|
import {storeToRefs} from "pinia"; |
|
|
import {storeToRefs} from "pinia"; |
|
|
import {WarnTriangleFilled} from "@element-plus/icons-vue"; |
|
|
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()) { |
|
|
|