1
0
forked from dyf/dyf-vue-ui

670控制中心小调整

This commit is contained in:
liub
2025-10-09 11:50:07 +08:00
parent 75a7da4a19
commit 6d6d395bff
14 changed files with 125 additions and 23 deletions

View File

@ -0,0 +1,83 @@
<template>
<el-form :model="user" label-width="80px">
<div v-for="item in user">
<el-form-item :label="item.dictLabel" prop="dictLabel">
<el-input v-model="item.dictLabel" disabled />
</el-form-item>
<el-form-item label="版本号" prop="dictValue">
<el-input v-model="item.dictValue" placeholder="请输入版本号" clearable />
</el-form-item>
<el-form-item label="下载地址" prop="remark">
<el-input v-model="item.remark" placeholder="请输入wgt下载地址" clearable />
</el-form-item>
</div>
<el-form-item>
<el-button type="primary" @click="submit">保存</el-button>
</el-form-item>
</el-form>
</template>
<script setup lang="ts">
import request from '@/utils/request';
const user = ref([
{
'dictValue': '',
'dictLabel': 'ios',
'remark': ''
},
{
'dictValue': '',
'dictLabel': 'android',
'remark': ''
}
]);
function getCfg() {
request({
url: '/app/auth/version',
method: 'get'
}).then((res) => {
if (res && res.code === 200) {
user.value.forEach((v) => {
let f = res.data.find((item) => {
return item.dictLabel === v.dictLabel;
});
if (f) {
v.dictValue = f.dictValue;
v.remark = f.remark;
}
});
}
});
}
function submit() {
let flag = [];
user.value.forEach((v) => {
let keys = Object.keys(v);
keys.forEach((k) => {
if (!v[k]) {
flag.push(false);
}
});
});
if (flag.length > 0) {
ElMessageBox.alert('所有项都是必填');
return;
}
request({
url: '/api/xinghan/device/UpVersion',
method: 'post',
data: user.value
}).then((res) => {
if (res && res.code === 200) {
ElMessageBox.alert('操作成功');
}
});
}
onMounted(() => {
getCfg();
});
</script>

View File

@ -61,6 +61,9 @@
<el-tab-pane label="在线设备" name="onlineDevice">
<onlineDevice :devices="state.devices" />
</el-tab-pane>
<el-tab-pane label="App版本" name="appVer">
<appVer />
</el-tab-pane>
</el-tabs>
</el-card>
</el-col>
@ -78,7 +81,7 @@ import { getAuthList } from '@/api/system/social/auth';
import { getUserProfile } from '@/api/system/user';
import { getOnline } from '@/api/monitor/online';
import { UserVO } from '@/api/system/user/types';
import appVer from './appVer.vue';
const activeTab = ref('userinfo');
interface State {
user: Partial<UserVO>;
@ -86,13 +89,15 @@ interface State {
postGroup: string;
auths: any;
devices: any;
vers: any;
}
const state = ref<State>({
user: {},
roleGroup: '',
postGroup: '',
auths: [],
devices: []
devices: [],
vers: ''
});
const userForm = ref({});