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

View File

@ -27,7 +27,7 @@
</template>
</t-table>
</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-item label="管理员帐号" name="name">
<t-input placeholder="请输入管理员帐号" v-model="modData.zhanghu"/>
@ -51,6 +51,10 @@
</t-select>
</t-form-item>
</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-card>
@ -171,7 +175,7 @@ export default {
}
const regex = /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&#_-])[A-Za-z\d@$!%*?&#_-]{8,}$/;
var pwd_check=regex.test(this.modData.password);
if(!pwd_check){
if(!pwd_check && !this.isEdit){
this.$message.error('密码不符合要求!');
return;
}
@ -186,10 +190,8 @@ export default {
.then((res) => {
if(res.code==1){
this.$message.success(res.msg);
this.addMode=false;
}else {
this.$message.error(res.msg);
}
this.addMode=false;
this.getList();
})
.catch((e) => {

View File

@ -2,12 +2,14 @@
<div>
<t-row :gutter="[16, 16]">
<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
id="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>空间总量{{info.totalSpaceInMB}} MB</div>
<div>已使用{{info.usedSpaceInMB}} MB</div>
</t-card>
</t-col>
<t-col :xs="12" :xl="6">
@ -15,8 +17,10 @@
<div
id="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>流量总量{{info.totalSpaceInMB}} MB</div>
<div>已使用{{info.usedSpaceInMB}} MB</div>
</t-card>
</t-col>
</t-row>
@ -48,18 +52,16 @@
</div>
</template>
<script setup lang="ts">
import store from "@/store";
import store from '@/store';
import * as echarts from "echarts/core";
import {GridComponent} from "echarts/components";
import {LineChart, PieChart} from "echarts/charts";
import {CanvasRenderer} from "echarts/renderers";
import { TooltipComponent, LegendComponent, GridComponent } from 'echarts/components';
echarts.use([TooltipComponent, LegendComponent, PieChart, GridComponent, LineChart, CanvasRenderer]);
import { TooltipComponent, LegendComponent } from 'echarts/components';
echarts.use([TooltipComponent, LegendComponent, PieChart, LineChart, CanvasRenderer]);
export default {
data() {
return {
resizeTime: 1,
subject: '',
association: '',
pay: {
@ -67,44 +69,28 @@ export default {
appkey: '',
serial: '',
},
info:{},
One_data: {
tooltip: {
show: true,
trigger: 'axis',
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: [
{
name: '空间使用情况',
type: 'pie',
radius: ['48%', '60%'],
avoidLabelOverlap: true,
selectedMode: true,
radius: ['35%', '60%'],
avoidLabelOverlap: false,
selectedMode: false,
hoverAnimation: true,
silent: true,
silent: false,
itemStyle: {
borderColor: "#666666",
borderWidth: 1,
},
label: {
show: true,
position: 'center',
formatter: '{value|{d}%} \n {name|{b}剩余}',
rich: {
value: {
@ -120,16 +106,7 @@ export default {
},
},
},
labelLine: {
show: true,
},
data: [
{
value: 10,
name: '空间总量',
},
{value: 4.3, name: '已使用'},
],
data: [],
},
],
}
@ -141,20 +118,32 @@ export default {
} else {
this.association = JSON.parse(store.state.user.association);
}
this.renderCharts();
this.getInfo();
},
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) {
this.countContainer = document.getElementById('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;
this.countChart.setOption(option);
if (!this.LLContainer) {
this.LLContainer = document.getElementById('LLContainer');
}

View File

@ -147,7 +147,7 @@
</t-descriptions>
<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-popconfirm>
<t-popconfirm content="确认通过审核吗?" @confirm="tgSelect(1)">
@ -155,7 +155,7 @@
</t-popconfirm>
</div>
</t-card>
</div>
</div>
</template>
<script lang="ts">
export default {