Browse Source

智能门锁

znms
lzp 4 months ago
parent
commit
88cc77ad15
  1. 4
      .env.development
  2. 2
      .env.production
  3. 2
      .env.staging
  4. 2
      package.json
  5. 229
      src/views/index.vue
  6. 2
      src/views/login.vue
  7. 2
      src/views/register.vue
  8. 2
      vue.config.js

4
.env.development

@ -1,10 +1,10 @@
# 页面标题 # 页面标题
VUE_APP_TITLE = 智能化衣柜 VUE_APP_TITLE = 智能门锁
# 开发环境配置 # 开发环境配置
ENV = 'development' ENV = 'development'
# 智能化衣柜/开发环境 # 智能门锁/开发环境
VUE_APP_BASE_API = '/dev-api' VUE_APP_BASE_API = '/dev-api'
VUE_APP_IMG_URL = 'https://test.tall.wiki/commen/' VUE_APP_IMG_URL = 'https://test.tall.wiki/commen/'
VUE_APP_API_QZURL = 'https://test.tall.wiki/commen/' VUE_APP_API_QZURL = 'https://test.tall.wiki/commen/'

2
.env.production

@ -1,5 +1,5 @@
# 页面标题 # 页面标题
VUE_APP_TITLE = 智能化衣柜 VUE_APP_TITLE = 智能门锁
# 生产环境配置 # 生产环境配置
NODE_ENV = 'production' NODE_ENV = 'production'

2
.env.staging

@ -1,5 +1,5 @@
# 页面标题 # 页面标题
VUE_APP_TITLE = 智能化衣柜 VUE_APP_TITLE = 智能门锁
# 生产环境配置 # 生产环境配置
NODE_ENV = 'production' NODE_ENV = 'production'

2
package.json

@ -1,7 +1,7 @@
{ {
"name": "ruoyi", "name": "ruoyi",
"version": "3.8.9", "version": "3.8.9",
"description": "智能化衣柜", "description": "智能门锁",
"author": "若依", "author": "若依",
"license": "MIT", "license": "MIT",
"scripts": { "scripts": {

229
src/views/index.vue

@ -1,82 +1,181 @@
<template> <template>
<div style="padding: 16px;min-height: calc(100vh - 84px);display: flex; justify-content: center;align-items: center;"> <div class="app-container">
<div class="div-box"> <el-row :gutter="10" class="mb8">
<div class="div-box-title"> 智能化衣柜 </div> <el-col :span="1.5">
<div class="div-ul"> <el-button
<div class="div-li"> type="primary"
<div> plain
<span>温度</span> size="mini"
22.2 @click="handleAdd"
</div> >远程开锁</el-button>
<div> <span>湿度</span> </el-col>
50%</div> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</div> </el-row>
<!-- ON开启 OFF关闭 -->
<div class="div-li"> <el-table v-loading="loading" :data="noticeList" max-height="600">
<div> <el-table-column label="序号" align="center" prop="noticeId" width="100" />
<span>除湿</span> <el-table-column
<el-switch v-model="value2" active-color="#13ce66" inactive-color="#ff4949"> label="时间"
</el-switch> align="center"
</div> prop="noticeTitle"
<div> :show-overflow-tooltip="true"
<span>杀菌</span> min-width="100"
<el-switch v-model="value2" active-color="#13ce66" inactive-color="#ff4949"> />
</el-switch> <el-table-column label="类型" align="center" prop="noticeType" min-width="100">
</div> <template slot-scope="scope">
</div> <dict-tag :options="dict.type.sys_notice_type" :value="scope.row.noticeType"/>
</div> </template>
<div> 标签序列号AE0B01 </div> </el-table-column>
</div>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</div> </div>
</template> </template>
<script> <script>
import { listNotice, getNotice, delNotice, addNotice, updateNotice } from "@/api/system/notice";
export default { export default {
name: "Index", name: "Notice",
dicts: ['sys_notice_status', 'sys_notice_type'],
data() { data() {
return { return {
value2: false, //
// loading: true,
version: "3.8.9", //
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
noticeList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
noticeTitle: undefined,
createBy: undefined,
status: undefined
},
//
form: {},
//
rules: {
noticeTitle: [
{ required: true, message: "公告标题不能为空", trigger: "blur" }
],
noticeType: [
{ required: true, message: "公告类型不能为空", trigger: "change" }
]
}
}; };
}, },
created() {
this.getList();
},
methods: { methods: {
goTarget(href) { /** 查询公告列表 */
window.open(href, "_blank"); getList() {
this.loading = true;
listNotice(this.queryParams).then(response => {
this.noticeList = response.rows;
this.total = response.total;
this.loading = false;
});
}, },
//
cancel() {
this.open = false;
this.reset();
}, },
}; //
</script> reset() {
this.form = {
<style scoped lang="scss"> noticeId: undefined,
.div-box { noticeTitle: undefined,
width: 500px; noticeType: undefined,
box-sizing: border-box; noticeContent: undefined,
padding: 16px; status: "0"
border: 1px solid #ccc; };
border-radius: 10px; this.resetForm("form");
},
.div-box-title { /** 搜索按钮操作 */
font-size: 20px; handleQuery() {
font-weight: bold; this.queryParams.pageNum = 1;
margin-bottom: 20px; this.getList();
text-align: center; },
border-bottom: 1px solid #ccc; /** 重置按钮操作 */
padding-bottom: 16px; resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.noticeId)
this.single = selection.length!=1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加公告";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const noticeId = row.noticeId || this.ids
getNotice(noticeId).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改公告";
});
},
/** 提交按钮 */
submitForm: function() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.noticeId != undefined) {
updateNotice(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addNotice(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
} }
}
.div-ul {
.div-li {
font-size: 18px;
display: flex;
justify-content: space-between;
margin-bottom: 12px;
span {
color: #333;
} }
});
},
/** 删除按钮操作 */
handleDelete(row) {
const noticeIds = row.noticeId || this.ids
this.$modal.confirm('是否确认删除公告编号为"' + noticeIds + '"的数据项?').then(function() {
return delNotice(noticeIds);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
} }
} }
</style> };
</script>

2
src/views/login.vue

@ -8,7 +8,7 @@
> >
<h3 class="title" style="margin-bottom: 0"> <h3 class="title" style="margin-bottom: 0">
</h3> </h3>
<h3 class="title">智能化衣柜</h3> <h3 class="title">智能门锁</h3>
<el-form-item prop="username"> <el-form-item prop="username">
<el-input <el-input
v-model="loginForm.username" v-model="loginForm.username"

2
src/views/register.vue

@ -6,7 +6,7 @@
:rules="registerRules" :rules="registerRules"
class="register-form" 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"

2
vue.config.js

@ -8,7 +8,7 @@ function resolve(dir) {
const CompressionPlugin = require("compression-webpack-plugin"); const CompressionPlugin = require("compression-webpack-plugin");
const name = const name =
process.env.VUE_APP_TITLE || "智能化衣柜"; // 网页标题 process.env.VUE_APP_TITLE || "智能门锁"; // 网页标题
const port = process.env.port || process.env.npm_config_port || 80; // 端口 const port = process.env.port || process.env.npm_config_port || 80; // 端口

Loading…
Cancel
Save