This commit is contained in:
qingchao 2026-03-07 10:57:13 +08:00
parent 698546abb8
commit f199f17a18
4 changed files with 233 additions and 0 deletions

View File

@ -6,6 +6,7 @@ import 'nprogress/nprogress.css'// nprogress样式文件
import UI_1 from "../src/components/Aside/UI_1.vue"; import UI_1 from "../src/components/Aside/UI_1.vue";
import UI_2 from "../src/components/Aside/UI_2.vue"; import UI_2 from "../src/components/Aside/UI_2.vue";
import UI_3 from "../src/components/Aside/UI_3.vue"; import UI_3 from "../src/components/Aside/UI_3.vue";
import UI_4 from "../src/components/Aside/UI_4.vue";
const routes = [ const routes = [
{ {
@ -20,6 +21,10 @@ const routes = [
path: '/UI_3', path: '/UI_3',
component: UI_3 component: UI_3
}, },
{
path: '/UI_4',
component: UI_4
},
]; ];
const router = createRouter({ const router = createRouter({

View File

@ -8,10 +8,12 @@
import Home from "./components/Main/Home.vue"; import Home from "./components/Main/Home.vue";
import {onMounted} from "vue"; import {onMounted} from "vue";
import {useRouter} from "vue-router"; import {useRouter} from "vue-router";
onMounted(()=>{ onMounted(()=>{
const router = useRouter(); const router = useRouter();
router.push('/UI_1'); router.push('/UI_1');
}); });
</script> </script>
<style scoped> <style scoped>

View File

@ -0,0 +1,223 @@
<template>
<el-scrollbar>
<el-scrollbar>
<el-row style="margin-left: 1%;margin-top: 1%;">
<el-button type="primary" @click.stop="UpData">
刷新
</el-button>
<el-button type="primary" @click.stop="UpLoad">
添加电台
</el-button>
</el-row>
</el-scrollbar>
<div style="margin-left: 1%;margin-top: 1%;">
<el-table
:data="DataDB.tableData"
style="width: 98%;"
>
<el-table-column prop="Name" label="名称" align="center"/>
<el-table-column prop="URL" label="电台链接" align="center"/>
<el-table-column prop="Image" label="电台封面" align="center"/>
<el-table-column label="操作" align="center" width="200">
<template #default="scope">
<el-link type="primary" @click.stop="ReviseBtn(scope.row)" style="margin-left: 10px;">
编辑
</el-link>
<el-link type="danger" @click.stop="Delete(scope.row.ID)" style="margin-left: 10px;">
删除
</el-link>
</template>
</el-table-column>
</el-table>
</div>
</el-scrollbar>
<el-dialog v-model="dialogTableVisible1" title="添加电台" width="800">
<el-form label-width="100px" label-position="left">
<el-form-item label="名称">
<el-input v-model="formData.Name" style="width: 300px;"/>
</el-form-item>
<el-form-item label="电台链接">
<el-input v-model="formData.URL" style="width: 300px;"/>
</el-form-item>
<el-form-item label="电台封面">
<el-input v-model="formData.Image" style="width: 300px;"/>
</el-form-item>
<el-form-item label="封面预览">
<el-image
:src="formData.Image"
style="width: 50px; height: 50px;margin-left: 10px;"
/>
</el-form-item>
</el-form>
<template #footer>
<el-button type="primary" @click.stop="AddQR">
确认
</el-button>
</template>
</el-dialog>
<el-dialog v-model="dialogTableVisible2" title="修改电台" width="800">
<el-form label-width="100px" label-position="left">
<el-form-item label="名称">
<el-input v-model="formData.Name" style="width: 300px;"/>
</el-form-item>
<el-form-item label="电台链接">
<el-input v-model="formData.URL" style="width: 300px;"/>
</el-form-item>
<el-form-item label="电台封面">
<el-input v-model="formData.Image" style="width: 300px;"/>
</el-form-item>
<el-form-item label="封面预览">
<el-image
:src="formData.Image"
style="width: 50px; height: 50px;margin-left: 10px;"
/>
</el-form-item>
</el-form>
<template #footer>
<el-button type="primary" @click.stop="ReviseQR">
确认
</el-button>
</template>
</el-dialog>
</template>
<script setup>
import {onMounted, reactive, ref} from "vue";
import {Api, RequestPost, User} from "../JS/RequestAPI.js";
import {ElMessage, ElMessageBox} from "element-plus";
import {UploadFilled} from "@element-plus/icons-vue";
onMounted(()=>{
GetData();
});
const dialogTableVisible1 = ref(false);
const dialogTableVisible2 = ref(false);
const UpLoadDemo = ref();
const UpLoadBin = ref();
const DataDB = reactive({
tableData:[],
fileList:[],
});
const formData = reactive({
ID:0,
Name:'',
URL:'',
Image:''
});
const StaterDB = reactive({
Ver:'',
URL:'',
});
function UpData(){
GetData();
}
function GetData(){
RequestPost(Api.RadioGetData,JSON.stringify({
type:0
}),(res)=>{
const data = res.data;
if(data.Code === 1){
DataDB.tableData = data.list;
}
});
}
function Convert(size){
const data = size / 1024 / 1024;
return data.toFixed(2);
}
function Download(ID){
const url = Api.GetBSVDownload + "?ID=" + ID;
window.open(url);
}
function Delete(ID){
ElMessageBox.confirm(
'系统将永久删除该文件,继续吗?',
'警告', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}
).then(() => {
RequestPost(Api.RadioDeleteData,JSON.stringify({
ID:ID,
User:User.User,
Pwd:User.Pwd,
}),(res)=>{
const data = res.data;
if(data.Code === 1){
ElMessage.success('删除成功!');
GetData();
}
else {
if(data.Code === 2){
ElMessage.error('权限认证失败!');
}
else {
ElMessage.error('删除失败!');
}
}
})
}).catch(() => {});
}
function UpLoad(){
dialogTableVisible1.value = true;
}
function AddQR(){
RequestPost(Api.RadioCreateData,JSON.stringify({
Name:formData.Name,
URL:formData.URL,
Image:formData.Image,
}),(res)=>{
const data = res.data;
if(data.Code === 1){
UpData();
dialogTableVisible1.value = false;
}
});
}
function ReviseBtn(Row){
formData.URL = Row.URL;
formData.Name = Row.Name;
formData.Image = Row.Image;
formData.ID = Row.ID;
dialogTableVisible2.value = true;
}
function ReviseQX(){
dialogTableVisible2.value = false;
}
function ReviseQR(){
RequestPost(Api.RadioReviseData,JSON.stringify({
ID:Number(formData.ID),
Name:formData.Name,
URL:formData.URL,
Image:formData.Image,
}),(res)=>{
const data = res.data;
if(data.Code === 1){
UpData();
dialogTableVisible2.value = false;
}
});
}
function ReviseStarter(){
RequestPost(Api.ReviseStarter,JSON.stringify({
Ver:StaterDB.Ver,
}),(res)=>{
const data = res.data;
if(data.Code === 1){
dialogTableVisible2.value = false;
UpLoadBin.value.clearFiles();
ElMessage.success('修改启动器更新参数成功');
}
else {
ElMessage.error('修改启动器更新参数失败');
}
});
}
function On_error(){
ElMessage.error('启动器更新程序上传失败');
}
</script>
<style scoped>
</style>

View File

@ -16,6 +16,9 @@
<el-menu-item index="/UI_3"> <el-menu-item index="/UI_3">
<span>程序更新服务</span> <span>程序更新服务</span>
</el-menu-item> </el-menu-item>
<el-menu-item index="/UI_4">
<span>网络电台上传</span>
</el-menu-item>
</el-menu> </el-menu>
<div style="height: calc(100vh - 80px)"> <div style="height: calc(100vh - 80px)">
<el-scrollbar> <el-scrollbar>