diff --git a/vue/gold-system/src/views/workspace/index.vue b/vue/gold-system/src/views/workspace/index.vue index a104009..608fb39 100644 --- a/vue/gold-system/src/views/workspace/index.vue +++ b/vue/gold-system/src/views/workspace/index.vue @@ -21,7 +21,7 @@ const searchTime = ref([]); // 月份柱状图 const getMiddleBarObj = ref({ - updateType: "充值" + updateType: "充值", }); const getMiddleBarData = ref({}); const middleTotalRecharge = ref(0); @@ -32,7 +32,6 @@ const middleRecharge = ref([]); const middleFree = ref([]); const middleTask = ref([]); - // 地区排名 const getAreaRankObj = ref({ updateType: "充值", @@ -138,7 +137,6 @@ const get = async function () { console.log("getDayConsumeCoin", getDayConsumeCoin.value); console.log("platformData", platformData.value); - option3Data.value = [ { value: Math.abs(statistics.value.rechargeSumCoin), @@ -212,13 +210,13 @@ const get = async function () { ERPData.value.forEach((item, index) => item == "" ? (ERPData.value[index] = { - value: 0, - name: "第" + (index + 1) + "学科" + 0, - }) + value: 0, + name: "第" + (index + 1) + "学科" + 0, + }) : (ERPData.value[index] = { - value: item[0], - name: "第" + (index + 1) + "学科" + item[0], - }) + value: item[0], + name: "第" + (index + 1) + "学科" + item[0], + }) ); console.log("ERPData", ERPData.value); HCData.value = [ @@ -238,13 +236,13 @@ const get = async function () { HCData.value.forEach((item, index) => item == "" ? (HCData.value[index] = { - value: 0, - name: "第" + (index + 1) + "学科" + 0, - }) + value: 0, + name: "第" + (index + 1) + "学科" + 0, + }) : (HCData.value[index] = { - value: item[0], - name: "第" + (index + 1) + "学科" + item[0], - }) + value: item[0], + name: "第" + (index + 1) + "学科" + item[0], + }) ); console.log("HCData", HCData.value); LinkData.value = [ @@ -264,13 +262,13 @@ const get = async function () { LinkData.value.forEach((item, index) => item == "" ? (LinkData.value[index] = { - value: 0, - name: "第" + (index + 1) + "学科" + 0, - }) + value: 0, + name: "第" + (index + 1) + "学科" + 0, + }) : (LinkData.value[index] = { - value: item[0], - name: "第" + (index + 1) + "学科" + item[0], - }) + value: item[0], + name: "第" + (index + 1) + "学科" + item[0], + }) ); console.log("LinkData", LinkData.value); goldData.value = [ @@ -290,13 +288,13 @@ const get = async function () { goldData.value.forEach((item, index) => item == "" ? (goldData.value[index] = { - value: 0, - name: "第" + (index + 1) + "学科" + 0, - }) + value: 0, + name: "第" + (index + 1) + "学科" + 0, + }) : (goldData.value[index] = { - value: item[0], - name: "第" + (index + 1) + "学科" + item[0], - }) + value: item[0], + name: "第" + (index + 1) + "学科" + item[0], + }) ); console.log("goldData", goldData.value); allData.value = [ @@ -374,14 +372,18 @@ const getMiddleBar = async function () { console.log("getMiddleBarData", getMiddleBarData.value); // 柱状图数据处理 - middleCategory.value = getMiddleBarData.value - .map((item) => item.day == null ? item.month : item.day.substring(0, 10)); - middleRecharge.value = getMiddleBarData.value - .map((item) => Math.abs(item.rechargeSumCoin)); - middleFree.value = getMiddleBarData.value - .map((item) => Math.abs(item.freeSumCoin)); - middleFree.value = getMiddleBarData.value - .map((item) => Math.abs(item.taskSumCoin)); + middleCategory.value = getMiddleBarData.value.map((item) => + item.day == null ? item.month : item.day.substring(0, 10) + ); + middleRecharge.value = getMiddleBarData.value.map((item) => + Math.abs(item.rechargeSumCoin) + ); + middleFree.value = getMiddleBarData.value.map((item) => + Math.abs(item.freeSumCoin) + ); + middleTask.value = getMiddleBarData.value.map((item) => + Math.abs(item.taskSumCoin) + ); middleTotalRecharge.value = 0; middleTotalFree.value = 0; @@ -473,7 +475,7 @@ const getMiddleBar = async function () { }, ], }; - + // 使用刚指定的配置项和数据显示图表。 recharge.setOption(option); } else { @@ -548,7 +550,7 @@ const getMiddleBar = async function () { // 使用刚指定的配置项和数据显示图表。 consume.setOption(option); } -} +}; // 获取门店排名 const getAreaRank = async function () { @@ -628,13 +630,21 @@ const handleChange = function () { // 时间范围控制 const disabledDate = function (date) { const currentDate = new Date(); - const startDate = new Date(currentDate.getFullYear(), currentDate.getMonth() - 1, 1); - const endDate = new Date(currentDate.getFullYear(), currentDate.getMonth() + 1, 0); + const startDate = new Date( + currentDate.getFullYear(), + currentDate.getMonth() - 1, + 1 + ); + const endDate = new Date( + currentDate.getFullYear(), + currentDate.getMonth() + 1, + 0 + ); if (date >= startDate && date <= endDate) { return false; } return true; -} +}; // 本日 const today = function () { const current = new Date(); @@ -651,7 +661,6 @@ const today = function () { searchTime.value = [startDate, endDate]; search(); // console.log("searchTime", moment(searchTime.value[0]).format("YYYY-MM-DD") + "至" + moment(searchTime.value[1]).format("YYYY-MM-DD")) - }; // 本周 const thisWeek = function () { @@ -667,16 +676,8 @@ const thisWeek = function () { // 本月 const thisMonth = function () { const current = new Date(); - const startDate = new Date( - current.getFullYear(), - current.getMonth(), - 1 - ); - const endDate = new Date( - current.getFullYear(), - current.getMonth() + 1, - 0 - ); + const startDate = new Date(current.getFullYear(), current.getMonth(), 1); + const endDate = new Date(current.getFullYear(), current.getMonth() + 1, 0); searchTime.value = [startDate, endDate]; search(); // console.log("searchTime", moment(searchTime.value[0]).format("YYYY-MM-DD") + "至" + moment(searchTime.value[1]).format("YYYY-MM-DD")) @@ -684,16 +685,8 @@ const thisMonth = function () { // 本年 const thisYear = function () { const current = new Date(); - const startDate = new Date( - current.getFullYear(), - 0, - 1 - ); - const endDate = new Date( - current.getFullYear() + 1, - 0, - 0 - ); + const startDate = new Date(current.getFullYear(), 0, 1); + const endDate = new Date(current.getFullYear() + 1, 0, 0); searchTime.value = [startDate, endDate]; search(); // console.log("searchTime", moment(searchTime.value[0]).format("YYYY-MM-DD") + "至" + moment(searchTime.value[1]).format("YYYY-MM-DD")) @@ -701,13 +694,22 @@ const thisYear = function () { const allTime = function () { searchTime.value = ["", ""]; search(); -} +}; // 根据时间搜索 const search = function () { - console.log("searchTime", moment(searchTime.value[0]).format("YYYY-MM-DD") + "至" + moment(searchTime.value[1]).format("YYYY-MM-DD")); + console.log( + "searchTime", + moment(searchTime.value[0]).format("YYYY-MM-DD") + + "至" + + moment(searchTime.value[1]).format("YYYY-MM-DD") + ); - getMiddleBarObj.value.searchStartTime = moment(searchTime.value[0]).format("YYYY-MM-DD"); - getMiddleBarObj.value.searchEndTime = moment(searchTime.value[1]).format("YYYY-MM-DD"); + getMiddleBarObj.value.searchStartTime = moment(searchTime.value[0]).format( + "YYYY-MM-DD" + ); + getMiddleBarObj.value.searchEndTime = moment(searchTime.value[1]).format( + "YYYY-MM-DD" + ); if (getMiddleBarObj.value.searchStartTime == "Invalid date") { delete getMiddleBarObj.value.searchStartTime; } @@ -716,8 +718,12 @@ const search = function () { } console.log("getMiddleBarObj", getMiddleBarObj.value); - getAreaRankObj.value.searchStartTime = moment(searchTime.value[0]).format("YYYY-MM-DD"); - getAreaRankObj.value.searchEndTime = moment(searchTime.value[1]).format("YYYY-MM-DD"); + getAreaRankObj.value.searchStartTime = moment(searchTime.value[0]).format( + "YYYY-MM-DD" + ); + getAreaRankObj.value.searchEndTime = moment(searchTime.value[1]).format( + "YYYY-MM-DD" + ); if (getAreaRankObj.value.searchStartTime == "Invalid date") { delete getAreaRankObj.value.searchStartTime; } @@ -728,8 +734,7 @@ const search = function () { getMiddleBar(); getAreaRank(); -} - +}; // 切换平台 const changePlatform = function () { @@ -1066,26 +1071,37 @@ onMounted(async function () {
较前一天 {{ formatNum(getSumCoin.coinDifference) }} - +
较前一天 {{ formatNum(getSumCoin.coinDifference) }} - +
较前一天 {{ formatNum(getSumCoin.coinDifference) }} - +

- + @@ -1097,7 +1113,8 @@ onMounted(async function () {

折合新币累计金额 {{ formatNum(Math.abs(statistics.totalSumCoin)) }}

-