This commit is contained in:
hzz 2024-03-08 14:28:41 +08:00
parent 4520d7d612
commit 7ce173dc2f
7 changed files with 205 additions and 9 deletions

View File

@ -1,5 +1,5 @@
# 页面标题 # 页面标题
VITE_APP_TITLE = 若依管理系统 VITE_APP_TITLE = 物联管理系统
# 开发环境配置 # 开发环境配置
VITE_APP_ENV = 'development' VITE_APP_ENV = 'development'

View File

@ -1,5 +1,5 @@
# 页面标题 # 页面标题
VITE_APP_TITLE = 若依管理系统 VITE_APP_TITLE = 物联管理系统
# 生产环境配置 # 生产环境配置
VITE_APP_ENV = 'production' VITE_APP_ENV = 'production'

View File

@ -7,7 +7,7 @@
<meta name="renderer" content="webkit"> <meta name="renderer" content="webkit">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<link rel="icon" href="/favicon.ico"> <link rel="icon" href="/favicon.ico">
<title>若依管理系统</title> <title>物联管理系统</title>
<!--[if lt IE 11]><script>window.location.href='/html/ie.html';</script><![endif]--> <!--[if lt IE 11]><script>window.location.href='/html/ie.html';</script><![endif]-->
<style> <style>
html, html,

View File

@ -25,7 +25,7 @@ defineProps({
} }
}) })
const title = ref('若依管理系统'); const title = ref('物联管理系统');
const settingsStore = useSettingsStore(); const settingsStore = useSettingsStore();
const sideTheme = computed(() => settingsStore.sideTheme); const sideTheme = computed(() => settingsStore.sideTheme);
</script> </script>

View File

@ -1,12 +1,207 @@
<template> <template>
<div class=""> <div class="app-container">
sendlog <el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch">
<el-form-item label="设备名称" prop="name">
<el-input v-model="queryParams.name" placeholder="请输入设备名称" clearable style="width: 200px"
@keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="机架号" prop="label">
<el-input v-model="queryParams.label" placeholder="请输入机架号" clearable style="width: 200px"
@keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="设备类型" prop="type">
<!-- <el-input v-model="queryParams.type" placeholder="请输入设备类型" clearable style="width: 200px"
@keyup.enter="handleQuery" /> -->
<el-select v-model="queryParams.type" value-key="label" style="width: 200px" filterable placeholder="选择设备类型"
@keyup.enter="handleQuery">
<el-option value="" label="请选择"></el-option>
<el-option v-for="item in typeList" :key="item.value" :label="item.label" :value="item.label" />
</el-select>
</el-form-item>
<!-- <el-form-item label="部门名称" prop="dept">
<el-input v-model="queryParams.dept" placeholder="请输入部门名称" clearable style="width: 200px"
@keyup.enter="handleQuery" />
</el-form-item> -->
<el-form-item>
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<!-- <el-col :span="1.5">
<el-button type="primary" plain icon="Plus" @click="handleAdd"
v-hasPermi="['alarm:sendlog:add']">新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="success" plain icon="Edit" :disabled="single" v-hasPermi="['alarm:sendlog:update']"
@click="handleUpdate(ids[0])">修改</el-button>
</el-col> -->
<el-col :span="1.5">
<el-button type="danger" plain icon="Delete" :disabled="multiple" v-hasPermi="['alarm:sendlog:del']"
@click="handleDelete">删除</el-button>
</el-col>
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<!-- 表格数据 -->
<el-table v-loading="loading" :data="deviceList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="序号" type="index" width="120" />
<!-- <el-table-column label="部门id" prop="id" width="120" /> -->
<el-table-column label="设备名称" prop="name" :show-overflow-tooltip="true" />
<el-table-column label="邮箱" prop="email" :show-overflow-tooltip="true" />
<!-- <el-table-column label="类型" prop="type" :show-overflow-tooltip="true" />
<el-table-column label="型号" prop="model" align="center" :show-overflow-tooltip="true" /> -->
<el-table-column label="是否启用" align="center" :show-overflow-tooltip="true">
<template #default="scope">
<el-tag v-if="scope.row.enable == '启用'" type="success">启用</el-tag>
<el-tag v-else type="warning">未启用</el-tag>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="150">
<template #default="scope">
<!-- <el-tooltip content="修改" placement="top" v-if="scope.row.roleId !== 1">
<el-button link type="primary" v-hasPermi="['alarm:sendlog:update']" icon="Edit"
@click="handleUpdate(scope.row.deviceId)"></el-button>
</el-tooltip> -->
<el-tooltip content="删除" placement="top" v-if="scope.row.userId !== 1">
<el-button link type="primary" icon="Delete" v-hasPermi="['alarm:sendlog:del']"
@click="handleDelete(scope.row)"></el-button>
</el-tooltip>
</template>
</el-table-column>
</el-table>
<pagination v-show="total > queryParams.pageSize" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize"
@pagination="getList" />
</div> </div>
</template> </template>
<script setup> <script setup>
import { ref, reactive, toRefs, getCurrentInstance, onMounted } from 'vue'
import { Picture as IconPicture } from '@element-plus/icons-vue'
import { getDeviceList, delDevice } from '@/api/big/device'
import { getEmailList, getEmailInfo, AddEmailAlarm, EditEmailAlarm, DeleteEmailAlarm } from '@/api/alarm/index'
import useDeviceStore from '@/store/modules/device'
const store = useDeviceStore()
const { proxy } = getCurrentInstance();
const data = reactive({
form: {},
queryParams: {
pageNum: 1,
pageSize: 10,
name: '',
dept: '',
type: '',
label: '',
userId: 1,
},
});
const { queryParams, form } = toRefs(data);
// testScreen({}).then(res => {
// alert(JSON.stringify(res))
// })
let deviceList = ref([])
const open = ref(false);
const loading = ref(false);
const showSearch = ref(false);
const ids = ref([]);
const single = ref(true);
const multiple = ref(true);
const total = ref(0);
const title = ref("");
const file_list = ref([])
const type = ref("add");
const typeList = ref([])
/** 查询设备列表 */
function getList() {
loading.value = true;
// console.log(JSON.stringify(queryParams.value));
getEmailList(queryParams.value).then(res => {
loading.value = false;
deviceList.value = res.rows;
total.value = res.total;
});
}
/** 搜索按钮操作 */
function handleQuery() {
getList();
}
/** 重置按钮操作 */
function resetQuery() {
proxy.resetForm("queryRef");
handleQuery();
}
/** 添加 */
function handleAdd() {
title.value = "添加发送计划";
type.value = "add";
open.value = true;
}
/** 修改 */
function handleUpdate(id) {
title.value = "修改设备类型";
type.value = id;
open.value = true;
}
/** 删除按钮操作 */
function handleDelete(row) {
let rows = deviceList.value.filter(item => ids.value.includes(item.deviceId));
const names = row.name || rows.map(item => item.name).join(',');
const deviceTypeIds = row.deviceId || ids.value.join(',');
proxy.$modal.confirm('是否确认删除名称为"' + names + '"的数据项?').then(function () {
return DeleteEmailAlarm(deviceTypeIds);
}).then(() => {
getList();
proxy.$modal.msgSuccess("删除成功");
}).catch(() => { });
}
function handleSelectionChange(selection) {
ids.value = selection.map(item => item.deviceId);
single.value = selection.length != 1;
multiple.value = !selection.length;
}
onMounted(() => {
getList();
})
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
:deep(.el-table .el-table__cell) {
z-index: auto;
}
.img-preview {
max-width: 100%;
max-height: 100%;
display: block;
margin: 0 auto;
}
</style> </style>

View File

@ -1,7 +1,7 @@
<template> <template>
<div class="register"> <div class="register">
<el-form ref="registerRef" :model="registerForm" :rules="registerRules" class="register-form"> <el-form ref="registerRef" :model="registerForm" :rules="registerRules" class="register-form">
<h3 class="title">若依后台管理系统</h3> <h3 class="title">物联后台管理系统</h3>
<el-form-item prop="username"> <el-form-item prop="username">
<el-input <el-input
v-model="registerForm.username" v-model="registerForm.username"

View File

@ -31,11 +31,12 @@ export default defineConfig(({ mode, command }) => {
proxy: { proxy: {
// https://cn.vitejs.dev/config/#server-proxy // https://cn.vitejs.dev/config/#server-proxy
'/dev-api': { '/dev-api': {
target: 'http://192.168.110.238:8080', // target: 'http://192.168.110.23:9015',
target: 'http://8.130.165.100:9015',
// target: 'http://192.168.110.90:10393/mock/5ce74738-f63f-4d21-af85-b1d132c6f6fd', // target: 'http://192.168.110.90:10393/mock/5ce74738-f63f-4d21-af85-b1d132c6f6fd',
changeOrigin: true, changeOrigin: true,
rewrite: (p) => p.replace(/^\/dev-api/, '') rewrite: (p) => p.replace(/^\/dev-api/, '')
} },
} }
}, },
//fix:error:stdin>:7356:1: warning: "@charset" must be the first rule in the file //fix:error:stdin>:7356:1: warning: "@charset" must be the first rule in the file