This commit is contained in:
王创世 2024-06-15 11:05:34 +08:00
parent 59070e946f
commit 7d90bc570f
4 changed files with 42 additions and 51 deletions

View File

@ -29,7 +29,6 @@
"tdesign-icons-vue": "^0.1.11", "tdesign-icons-vue": "^0.1.11",
"tdesign-vue": "^1.9.0", "tdesign-vue": "^1.9.0",
"tvision-color": "~1.6.0", "tvision-color": "~1.6.0",
"typescript": "^5.1.6",
"vue": "~2.6.14", "vue": "~2.6.14",
"vue-clipboard2": "^0.3.1", "vue-clipboard2": "^0.3.1",
"vue-cropper": "^0.6.5", "vue-cropper": "^0.6.5",
@ -59,6 +58,7 @@
"stylelint-config-prettier": "~9.0.3", "stylelint-config-prettier": "~9.0.3",
"stylelint-less": "1.0.5", "stylelint-less": "1.0.5",
"stylelint-order": "~4.1.0", "stylelint-order": "~4.1.0",
"typescript": "^5.4.5",
"vite": "^4.1.4", "vite": "^4.1.4",
"vite-plugin-mock": "^3.0.0", "vite-plugin-mock": "^3.0.0",
"vite-plugin-theme": "^0.8.1", "vite-plugin-theme": "^0.8.1",

View File

@ -27,7 +27,7 @@
</template> </template>
</t-table> </t-table>
</div> </div>
<t-dialog :header="isEdit?'编辑管理员':'新增管理员'" :visible="addMode" :onClose="onCloseMy" @confirm="onSubmit"> <t-dialog :header="isEdit?'编辑管理员':'新增管理员'" :closeOnOverlayClick="false" :visible="addMode" :onClose="onCloseMy" :cancelBtn="null" :confirmBtn="null">
<t-form> <t-form>
<t-form-item label="管理员帐号" name="name"> <t-form-item label="管理员帐号" name="name">
<t-input placeholder="请输入管理员帐号" v-model="modData.zhanghu"/> <t-input placeholder="请输入管理员帐号" v-model="modData.zhanghu"/>
@ -51,6 +51,10 @@
</t-select> </t-select>
</t-form-item> </t-form-item>
</t-form> </t-form>
<div style="text-align: center;margin-top: 20px">
<t-button size="large" @click="onCloseMy" theme="default" variant="base">取消</t-button>
<t-button size="large" @click="onSubmit" style="margin-left: 30px">确定</t-button>
</div>
</t-dialog> </t-dialog>
</t-card> </t-card>
@ -171,7 +175,7 @@ export default {
} }
const regex = /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&#_-])[A-Za-z\d@$!%*?&#_-]{8,}$/; const regex = /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&#_-])[A-Za-z\d@$!%*?&#_-]{8,}$/;
var pwd_check=regex.test(this.modData.password); var pwd_check=regex.test(this.modData.password);
if(!pwd_check){ if(!pwd_check && !this.isEdit){
this.$message.error('密码不符合要求!'); this.$message.error('密码不符合要求!');
return; return;
} }
@ -186,10 +190,8 @@ export default {
.then((res) => { .then((res) => {
if(res.code==1){ if(res.code==1){
this.$message.success(res.msg); this.$message.success(res.msg);
this.addMode=false;
}else {
this.$message.error(res.msg);
} }
this.addMode=false;
this.getList(); this.getList();
}) })
.catch((e) => { .catch((e) => {

View File

@ -2,12 +2,14 @@
<div> <div>
<t-row :gutter="[16, 16]"> <t-row :gutter="[16, 16]">
<t-col :xs="12" :xl="6"> <t-col :xs="12" :xl="6">
<t-card title="空间使用情况" subtitle="(GB)" class="dashboard-chart-card" :bordered="false"> <t-card title="空间使用情况" subtitle="(MB)" class="dashboard-chart-card" :bordered="false">
<div <div
id="countContainer" id="countContainer"
ref="countContainer" ref="countContainer"
:style="{ width: `${resizeTime * 326}px`, height: `${resizeTime * 326}px`, margin: '0 auto' }" style="width: 326px;height: 326px;margin: 0 auto"
></div> ></div>
<div>空间总量{{info.totalSpaceInMB}} MB</div>
<div>已使用{{info.usedSpaceInMB}} MB</div>
</t-card> </t-card>
</t-col> </t-col>
<t-col :xs="12" :xl="6"> <t-col :xs="12" :xl="6">
@ -15,8 +17,10 @@
<div <div
id="LLContainer" id="LLContainer"
ref="LLContainer" ref="LLContainer"
:style="{ width: `${resizeTime * 326}px`, height: `${resizeTime * 326}px`, margin: '0 auto' }" style="width: 326px;height: 326px;margin: 0 auto"
></div> ></div>
<div>流量总量{{info.totalSpaceInMB}} MB</div>
<div>已使用{{info.usedSpaceInMB}} MB</div>
</t-card> </t-card>
</t-col> </t-col>
</t-row> </t-row>
@ -48,18 +52,16 @@
</div> </div>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import store from "@/store"; import store from '@/store';
import * as echarts from "echarts/core"; import * as echarts from "echarts/core";
import {GridComponent} from "echarts/components";
import {LineChart, PieChart} from "echarts/charts"; import {LineChart, PieChart} from "echarts/charts";
import {CanvasRenderer} from "echarts/renderers"; import {CanvasRenderer} from "echarts/renderers";
import { TooltipComponent, LegendComponent, GridComponent } from 'echarts/components'; import { TooltipComponent, LegendComponent } from 'echarts/components';
echarts.use([TooltipComponent, LegendComponent, PieChart, GridComponent, LineChart, CanvasRenderer]); echarts.use([TooltipComponent, LegendComponent, PieChart, LineChart, CanvasRenderer]);
export default { export default {
data() { data() {
return { return {
resizeTime: 1,
subject: '', subject: '',
association: '', association: '',
pay: { pay: {
@ -67,44 +69,28 @@ export default {
appkey: '', appkey: '',
serial: '', serial: '',
}, },
info:{},
One_data: { One_data: {
tooltip: { tooltip: {
show: true, show: true,
trigger: 'axis', trigger: 'axis',
position: null, position: null,
}, },
grid: {
top: '0',
right: '0',
},
legend: {
selectedMode: false,
itemWidth: 25,
itemHeight: 15,
textStyle: {
fontSize: 20,
color: "#0052D9",
},
left: 'center',
bottom: '0',
orient: 'horizontal', // legend
},
series: [ series: [
{ {
name: '空间使用情况', name: '空间使用情况',
type: 'pie', type: 'pie',
radius: ['48%', '60%'], radius: ['35%', '60%'],
avoidLabelOverlap: true, avoidLabelOverlap: false,
selectedMode: true, selectedMode: false,
hoverAnimation: true, hoverAnimation: true,
silent: true, silent: false,
itemStyle: { itemStyle: {
borderColor: "#666666", borderColor: "#666666",
borderWidth: 1, borderWidth: 1,
}, },
label: { label: {
show: true, show: true,
position: 'center',
formatter: '{value|{d}%} \n {name|{b}剩余}', formatter: '{value|{d}%} \n {name|{b}剩余}',
rich: { rich: {
value: { value: {
@ -120,16 +106,7 @@ export default {
}, },
}, },
}, },
labelLine: { data: [],
show: true,
},
data: [
{
value: 10,
name: '空间总量',
},
{value: 4.3, name: '已使用'},
],
}, },
], ],
} }
@ -141,20 +118,32 @@ export default {
} else { } else {
this.association = JSON.parse(store.state.user.association); this.association = JSON.parse(store.state.user.association);
} }
this.renderCharts(); this.getInfo();
}, },
methods: { methods: {
renderCharts() { getInfo(){
this.$request
.post('/index/fileSize')
.then((res) => {
console.log(res);
this.info=res.data;
this.renderCharts(res.data);
})
.catch((e) => {
console.log(e);
});
},
renderCharts(data) {
// //
if (!this.countContainer) { if (!this.countContainer) {
this.countContainer = document.getElementById('countContainer'); this.countContainer = document.getElementById('countContainer');
} }
this.countChart = echarts.init(this.countContainer); this.countChart = echarts.init(this.countContainer);
this.One_data.series[0].data=[{value: data.totalSpaceInMB,name: '空间总量'}, {value: data.usedSpaceInMB, name: '已使用'}];
const option = this.One_data; const option = this.One_data;
this.countChart.setOption(option); this.countChart.setOption(option);
if (!this.LLContainer) { if (!this.LLContainer) {
this.LLContainer = document.getElementById('LLContainer'); this.LLContainer = document.getElementById('LLContainer');
} }

View File

@ -147,7 +147,7 @@
</t-descriptions> </t-descriptions>
<div style="text-align: center" v-if="info.if_xianshi==0"> <div style="text-align: center" v-if="info.if_xianshi==0">
<t-popconfirm content="确认通过审核吗?" @confirm="tgSelect(2)"> <t-popconfirm content="确认拒绝申请吗?" @confirm="tgSelect(2)">
<t-button theme="danger">拒绝</t-button> <t-button theme="danger">拒绝</t-button>
</t-popconfirm> </t-popconfirm>
<t-popconfirm content="确认通过审核吗?" @confirm="tgSelect(1)"> <t-popconfirm content="确认通过审核吗?" @confirm="tgSelect(1)">
@ -155,7 +155,7 @@
</t-popconfirm> </t-popconfirm>
</div> </div>
</t-card> </t-card>
</div> </div>
</template> </template>
<script lang="ts"> <script lang="ts">
export default { export default {