Merge branch 'master' of ssh://10.153.19.150:29418/CanadaMes
New file |
| | |
| | | @echo off
|
| | | echo Starting frontend development server...
|
| | | cd /d %~dp0 // 切换到当前批处理脚本所在的目录
|
| | | cd ..\CanadaMes-ui // 假设CanadaMes-ui在与批处理脚本相同的目录下
|
| | | npm run serve |
| | |
| | | "paginationPrev": "Previous",
|
| | | "paginationPager": "{currentPage}/{pageCount}",
|
| | | "paginationNext": "Next",
|
| | | "paginationJumper": "Jump to"
|
| | | "paginationJumper": "Jump to",
|
| | | "breadcrumb": {
|
| | | "home": "Home",
|
| | | "permissionManagement": "Permission Management",
|
| | | "permissionList": "Permission List"
|
| | | },
|
| | | "search": {
|
| | | "placeholder": "Enter keywords"
|
| | | },
|
| | | "button": {
|
| | | "addPermission": "Add Permission",
|
| | | "cancel": "Cancel",
|
| | | "confirm": "Confirm"
|
| | | },
|
| | | "table": {
|
| | | "role": "Role",
|
| | | "permissionDescription": "Permission Description",
|
| | | "permissionValue": "Permission Value",
|
| | | "createTime": "Create Time",
|
| | | "isActive": "Is Active",
|
| | | "operation": "Operation"
|
| | | },
|
| | | "tooltip": {
|
| | | "edit": "Edit",
|
| | | "delete": "Delete"
|
| | | },
|
| | | "dialog": {
|
| | | "addPermission": "Add Permission",
|
| | | "editPermission": "Edit Permission"
|
| | | },
|
| | | "form": {
|
| | | "role": "Role",
|
| | | "select": "Please Select",
|
| | | "permission": "Permission",
|
| | | "isActive": "Is Active"
|
| | | },
|
| | | "操作": "Operation",
|
| | | "有效": "Valid",
|
| | | "无效": "Invalid",
|
| | | "请输入名称": "Please enter a name",
|
| | | "长度在 2 到 15 个字符": "Length between 2 and 15 characters",
|
| | | "请输入状态": "Please enter the status",
|
| | | "添加角色": "Add Role",
|
| | | "修改角色": "Edit Role",
|
| | | "删除角色": "Delete Role",
|
| | | "此操作将永久删除该角色, 是否继续?": "This operation will permanently delete the role. Continue?",
|
| | | "提示": "Reminder",
|
| | | "确定": "Confirm",
|
| | | "取消": "Cancel",
|
| | | "添加角色成功": "Successfully added role",
|
| | | "更新状态成功": "Successfully updated status",
|
| | | "修改角色成功": "Successfully modified role",
|
| | | "删除角色成功": "Successfully deleted role"
|
| | | } |
| | |
| | | "paginationPrev": "上一页",
|
| | | "paginationPager": "{currentPage}/{pageCount}",
|
| | | "paginationNext": "下一页",
|
| | | "paginationJumper": "跳至"
|
| | | "paginationJumper": "跳至",
|
| | | "breadcrumb": {
|
| | | "home": "首页",
|
| | | "permissionManagement": "权限管理",
|
| | | "permissionList": "权限列表"
|
| | | },
|
| | | "search": {
|
| | | "placeholder": "请输入关键字"
|
| | | },
|
| | | "button": {
|
| | | "addPermission": "添加权限",
|
| | | "cancel": "取消",
|
| | | "confirm": "确认"
|
| | | },
|
| | | "table": {
|
| | | "role": "角色",
|
| | | "permissionDescription": "权限描述",
|
| | | "permissionValue": "权限值",
|
| | | "createTime": "创建时间",
|
| | | "isActive": "是否激活",
|
| | | "operation": "操作"
|
| | | },
|
| | | "tooltip": {
|
| | | "edit": "修改",
|
| | | "delete": "删除"
|
| | | },
|
| | | "dialog": {
|
| | | "addPermission": "添加权限",
|
| | | "editPermission": "编辑权限"
|
| | | },
|
| | | "form": {
|
| | | "role": "角色",
|
| | | "select": "请选择",
|
| | | "permission": "权限",
|
| | | "isActive": "是否激活"
|
| | | },
|
| | | "操作": "操作",
|
| | | "有效": "有效",
|
| | | "无效": "无效",
|
| | | "请输入名称": "请输入名称",
|
| | | "长度在 2 到 15 个字符": "长度在 2 到 15 个字符",
|
| | | "请输入状态": "请输入状态",
|
| | | "添加角色": "添加角色",
|
| | | "修改角色": "修改角色",
|
| | | "删除角色": "删除角色",
|
| | | "此操作将永久删除该角色, 是否继续?": "此操作将永久删除该角色, 是否继续?",
|
| | | "提示": "提示",
|
| | | "确定": "确定",
|
| | | "取消": "取消",
|
| | | "添加角色成功": "添加角色成功",
|
| | | "更新状态成功": "更新状态成功",
|
| | | "修改角色成功": "修改角色成功",
|
| | | "删除角色成功": "删除角色成功"
|
| | | }
|
| | | |
| | |
| | | <template> |
| | | <el-container style="flex: 1;"> |
| | | |
| | | <div style="width: 200px;background-color: #222f3e" :style="{width: isCollapse?'70px':'250px'}"> |
| | | <el-aside :width="isCollapse?'70px':'250px'"> |
| | | <el-col :gutter="20"> |
| | | <el-row :span="4"> |
| | | <div class="logo" @click="goToHome"> |
| | | <div class="sys-name" v-show="!isCollapse">{{ $t('northglassMESsystem') }}</div> |
| | | </div> |
| | | <div class="sys-name" v-show="!isCollapse">{{ $t('northglassMESsystem') }}</div> |
| | | </div> |
| | | </el-row> |
| | | <el-row :span="20"> |
| | | <el-menu :default-active="activePath" class="el-menu-vertical-demo" |
| | | background-color="#222f3e" text-color="#fff" active-text-color="#ffd04b" |
| | | :collapse="isCollapse" :unique-opened="true" |
| | | :collapse-transition="false" :router="true"> |
| | | <el-menu-item index="/" @click="goToHome"> |
| | | <template slot="title"> |
| | | <!--图标--> |
| | | <i class="el-icon-menu"></i> |
| | | <!--文本--> |
| | | <span>{{ $t('home') }}</span> |
| | | </template> |
| | | </el-menu-item> |
| | | |
| | | <!--一级菜单--> |
| | | background-color="#222f3e" text-color="#fff" active-text-color="#ffd04b" |
| | | :collapse="isCollapse" :unique-opened="true" |
| | | :collapse-transition="false" :router="true"> |
| | | <el-menu-item index="/" @click="goToHome"> |
| | | <template slot="title"> |
| | | <!--图标--> |
| | | <i class="el-icon-menu"></i> |
| | | <!--文本--> |
| | | <span>{{ $t('home') }}</span> |
| | | </template> |
| | | </el-menu-item> |
| | | <!--一级菜单--> |
| | | <el-submenu :index="item.id.toString()" v-for="item in menuList" :key="item.id"> |
| | | <!--一级菜单模板区域--> |
| | | <template slot="title"> |
| | |
| | | <!--二级菜单--> |
| | | <el-menu-item :index="'/'+menu.router" |
| | | v-for="menu in item.menuLists" :key="menu.id" |
| | | @click="saveNavState('/'+menu.router)" @select="saveNavState" :default-active="$route.path"> |
| | | @click="addTag(menu.router)"> |
| | | <template slot="title"> |
| | | <!--图标--> |
| | | <i :class="menu.icon"></i> |
| | |
| | | <span>{{ menu.name }}</span> |
| | | </template> |
| | | </el-menu-item> |
| | | |
| | | </el-submenu> |
| | | |
| | | </el-menu> |
| | | </el-row> |
| | | </el-col> |
| | | </el-aside> |
| | | </div> |
| | | <el-container > |
| | | |
| | | <el-header class="header-container" > |
| | | |
| | | <el-container> |
| | | <el-header class="header-container"> |
| | | |
| | | <div class="tagContainer" > |
| | | <tag v-for="(tag, index) in tags" :key="index" :tag="tag" @removeTag="removeTag"></tag> |
| | | </div> |
| | | <el-menu :default-active="activePath1" class="el-menu-demo" mode="horizontal" |
| | | background-color="#576574" text-color="#fff" active-text-color="#ffd04b"> |
| | | <div class="header-left" > |
| | | <el-button :icon="isCollapse ? 'el-icon-s-unfold' : 'el-icon-s-fold'" @click="toggleCollapse" style="height:30px"></el-button> |
| | | </div> |
| | | <template > |
| | | <el-submenu index="1" class="custom-submenu" > |
| | | |
| | | <template slot="title"> |
| | | <el-avatar src="../assets/emi.png" style="width:30px;height:30px;margin-top:2px;"> |
| | | </el-avatar> |
| | | </template> |
| | | <el-menu-item index="1-1" @click="logout" >{{ $t('exit') }}</el-menu-item> |
| | | <el-menu-item index="1-2" @click="showChangePasswordDialog" >{{ $t('changePassword') }}</el-menu-item> |
| | | </el-submenu> |
| | | </template> |
| | | <div class="header-left"> |
| | | <el-button :icon="isCollapse ? 'el-icon-s-unfold' : 'el-icon-s-fold'" @click="toggleCollapse" style="height:30px"></el-button> |
| | | </div> |
| | | <div class="tagContainer"> |
| | | <tag v-for="(tag, index) in tags" :key="index" :tag="tag" @removeTag="removeTag(index)" @switchTag="switchTag(index)"></tag> |
| | | <!-- <el-button icon="el-icon-circle-close" class="close-all-btn" @click="removeAllTags"></el-button> --> |
| | | </div> |
| | | <template> |
| | | <el-dialog title="修改密码" :visible.sync="dialogVisible" width="30%" s> |
| | | <el-form ref="form" :model="formData" label-width="100px" > |
| | | <el-form-item label="旧密码"> |
| | | <el-input v-model="formData.oldPassword" type="password" show-password></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="新密码"> |
| | | <el-input v-model="formData.newPassword" type="password" show-password></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="确认新密码"> |
| | | <el-input v-model="formData.confirmPassword" type="password" show-password></el-input> |
| | | </el-form-item> |
| | | </el-form> |
| | | <div slot="footer" class="dialog-footer"> |
| | | <el-button @click="dialogVisible = false">取消</el-button> |
| | | <el-button type="primary" @click="savePassword">保存</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | </template> |
| | | <el-submenu index="1" class="custom-submenu"> |
| | | <template slot="title"> |
| | | <el-avatar src="../assets/emi.png" style="width:30px;height:30px;margin-top:2px;"></el-avatar> |
| | | </template> |
| | | <el-menu-item index="1-1" @click="logout">{{ $t('exit') }}</el-menu-item> |
| | | <el-menu-item index="1-2" @click="showChangePasswordDialog">{{ $t('changePassword') }}</el-menu-item> |
| | | </el-submenu> |
| | | </template> |
| | | <template> |
| | | <el-dialog title="修改密码" :visible.sync="dialogVisible" width="30%"> |
| | | <el-form ref="form" :model="formData" label-width="100px"> |
| | | <el-form-item label="旧密码"> |
| | | <el-input v-model="formData.oldPassword" type="password" show-password></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="新密码"> |
| | | <el-input v-model="formData.newPassword" type="password" show-password></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="确认新密码"> |
| | | <el-input v-model="formData.confirmPassword" type="password" show-password></el-input> |
| | | </el-form-item> |
| | | </el-form> |
| | | <div slot="footer" class="dialog-footer"> |
| | | <el-button @click="dialogVisible = false">取消</el-button> |
| | | <el-button type="primary" @click="savePassword">保存</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | </template> |
| | | </el-menu> |
| | | </el-header> |
| | | <el-main> |
| | | <router-view/> |
| | | <keep-alive> |
| | | <router-view/> |
| | | </keep-alive> |
| | | </el-main> |
| | | </el-container> |
| | | </el-container> |
| | | </template> |
| | | |
| | | |
| | | |
| | | <script> |
| | | import {selectList} from '../api/menuList' |
| | | import {changePassword} from '../api/user' |
| | | import {removeToken} from "../utils/auth"; |
| | | import { selectList } from '../api/menuList' |
| | | import { changePassword } from '../api/user' |
| | | import { removeToken } from "../utils/auth"; |
| | | import LanguageMixin from '../lang/LanguageMixin' |
| | | import { mapState, mapMutations } from 'vuex'; |
| | | import Tag from '../layout/tag.vue'; |
| | | import store from '../store'; |
| | | import Tag from '../layout/tag.vue'; |
| | | import store from '../store'; |
| | | |
| | | export default { |
| | | name: "Layout", |
| | |
| | | mixins: [LanguageMixin], |
| | | data() { |
| | | return { |
| | | |
| | | activeTag: '', // 当前激活的标签 |
| | | dialogVisible: false, |
| | | formData: { |
| | |
| | | newPassword: '', |
| | | confirmPassword: '' |
| | | }, |
| | | |
| | | menuList: [], |
| | | isCollapse: false, |
| | | activePath: '', |
| | |
| | | } |
| | | } |
| | | }, |
| | | components: { |
| | | Tag |
| | | }, |
| | | components: { |
| | | Tag |
| | | }, |
| | | created() { |
| | | selectList(this.menuListForm).then(res => { |
| | | this.menuList = res.data |
| | | |
| | | |
| | | const language = this.$i18n.locale; |
| | | if (language === 'en-US') { |
| | | this.replaceChineseWithEnglish(this.menuList); |
| | |
| | | this.$router.push('/login') |
| | | }, |
| | | goToHome() { |
| | | this.$router.push('/home'); |
| | | }, |
| | | // 使用 mapMutations 辅助函数调用 Store 中的 mutations |
| | | ...mapMutations('tags', ['addTag', 'removeTag']), |
| | | // 切换标签时触发的方法 |
| | | saveNavState(activePath) { |
| | | window.sessionStorage.setItem('activePath', activePath); |
| | | |
| | | const menuItem = this.menuList.find(item => item.menuLists.some(menu => menu.router === activePath)); |
| | | if (menuItem) { |
| | | const submenuItem = menuItem.menuLists.find(menu => menu.router === activePath); |
| | | if (submenuItem) { |
| | | const tag = submenuItem.name; |
| | | this.$store.commit('tags/addTag', tag); // 调用 Vuex Store 中的 addTag mutation |
| | | } |
| | | } |
| | | this.$router.push('/home'); |
| | | }, |
| | | // 关闭标签时触发的方法 |
| | | removeTag(tag) { |
| | | this.removeTag(tag); // 从 Vuex Store 中移除标签 |
| | | }, |
| | | |
| | | ...mapMutations('tags', ['addTag', 'removeTag', 'switchTag']), |
| | | addTag(router) { |
| | | let submenuItem; |
| | | const menuItem = this.menuList.find(item => item.menuLists.some(menu => menu.router === router)); |
| | | if (menuItem) { |
| | | submenuItem = menuItem.menuLists.find(menu => menu.router === router); |
| | | } |
| | | if (submenuItem) { |
| | | const tag = submenuItem.router; |
| | | this.$store.commit('tags/addTag', tag); |
| | | } |
| | | }, |
| | | |
| | | removeTag(index) { |
| | | this.$store.commit('tags/removeTag', index); // 从 Vuex Store 中移除标签 |
| | | }, |
| | | showChangePasswordDialog() { |
| | | this.dialogVisible = true; |
| | | }, |
| | |
| | | console.log(res.data); |
| | | this.$message.success('密码修改成功'); |
| | | removeToken() |
| | | this.$router.push('/login') |
| | | |
| | | this.$router.push('/login') |
| | | }).catch(() => { |
| | | |
| | | }); |
| | | |
| | | this.dialogVisible = false; |
| | | }, |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | toggleCollapse: function () { |
| | | this.isCollapse = !this.isCollapse; |
| | | }, |
| | | // saveNavState: function (activePath) { |
| | | // window.sessionStorage.setItem('activePath', activePath) |
| | | // }, |
| | | replaceChineseWithEnglish(menuData) { |
| | | // 定义中英文对照关系对象 |
| | | const translation = { |
| | |
| | | '权限管理': 'PermissionManagement', |
| | | '权限列表': 'PermissionList', |
| | | '角色管理': 'RoleManagement', |
| | | '角色列表': 'RoleList' |
| | | '角色列表': 'RoleList', |
| | | '电气管理': 'Electrical management' |
| | | // 根据实际需求继续添加对照关系 |
| | | }; |
| | | |
| | |
| | | subMenu.name = translation[subMenu.name] || subMenu.name; |
| | | }); |
| | | }); |
| | | |
| | | |
| | | } |
| | | }, |
| | | watch: { |
| | | '$route'(to) { |
| | | // 切换路由时更新激活的标签 |
| | | const tag = this.menuList.some(item => item.menuLists.some(menu => '/' + menu.router === to.path)); |
| | | if (tag) { |
| | | this.activeTag = tag; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | </script> |
| | | |
| | | <style scoped lang="less"> |
| | | // .header-container { |
| | | // display: flex; |
| | | // justify-content: flex-start; |
| | | // height: 10px; /* 设置较小的高度 */ |
| | | // } |
| | | |
| | | .custom-submenu { |
| | | |
| | | |
| | | height: 90px !important; |
| | | height: 90px !important; |
| | | } |
| | | |
| | | .header-container { |
| | | |
| | | height: 30px !important; /* 设置较小的高度 */ |
| | | } |
| | | |
| | | height: 30px !important; /* 设置较小的高度 */ |
| | | } |
| | | |
| | | |
| | | |
| | | .header-left { |
| | | margin-right: auto; |
| | | |
| | | margin-right: auto; |
| | | |
| | | } |
| | | .el-aside { |
| | | height: 100vh; |
| | | background-color: #222f3e; |
| | | line-height: 200px; |
| | | height: 100vh; |
| | | background-color: #222f3e; |
| | | line-height: 200px; |
| | | } |
| | | |
| | | .el-menu-vertical-demo:not(.el-menu--collapse) { |
| | | width: 200px; |
| | | min-height: 400px; |
| | | width: 200px; |
| | | min-height: 400px; |
| | | } |
| | | |
| | | .el-menu-demo { |
| | | display: flex; |
| | | width: 100%; |
| | | height: 100%; |
| | | justify-content: flex-end; |
| | | align-items: center; |
| | | display: flex; |
| | | width: 100%; |
| | | height: 100%; |
| | | justify-content: flex-end; |
| | | align-items: center; |
| | | |
| | | } |
| | | |
| | | .el-menu-vertical-demo { |
| | | border: 0; |
| | | border: 0; |
| | | } |
| | | |
| | | .logo { |
| | | background-color: #222f3e; |
| | | display: flex; |
| | | justify-content: center; |
| | | align-items: center; |
| | | height: 60px; |
| | | background-color: #222f3e; |
| | | display: flex; |
| | | justify-content: center; |
| | | align-items: center; |
| | | height: 60px; |
| | | |
| | | .sys-name { |
| | | font-size: 20px; |
| | | color: #ffffff; |
| | | margin-left: 10px; |
| | | } |
| | | .sys-name { |
| | | font-size: 20px; |
| | | color: #ffffff; |
| | | margin-left: 10px; |
| | | } |
| | | } |
| | | |
| | | .el-header { |
| | | |
| | | background-color: #576574; |
| | | background-color: #576574; |
| | | } |
| | | </style> |
| | | </style> |
| | |
| | | <template>
|
| | | <div class="tagContainer">
|
| | | <div v-for="(tag, index) in tags" :key="index" class="tagItem">
|
| | | {{ tag }}
|
| | | <span class="closeBtn" @click="removeTag(index)">x</span>
|
| | | <keep-alive>
|
| | | <div |
| | | class="tag" |
| | | :class="{ active: isActive }" |
| | | @click="switchTag(tag)">
|
| | | <span>{{ tag }}</span>
|
| | | <i class="el-icon-close" @click.stop="removeTag(tag)"></i>
|
| | | </div>
|
| | | </div>
|
| | | </keep-alive>
|
| | | </template>
|
| | |
|
| | | <script>
|
| | | import { mapState, mapMutations } from 'vuex';
|
| | |
|
| | | export default {
|
| | | props: {
|
| | | tag: {
|
| | | type: String,
|
| | | required: true
|
| | | },
|
| | | activeTag: {
|
| | | type: String,
|
| | | required: true
|
| | | }
|
| | | },
|
| | | computed: {
|
| | | ...mapState('tags', { // 这里添加了 'tags' 模块的命名空间前缀
|
| | | tags: state => state.tags.tags
|
| | | })
|
| | | isActive() {
|
| | | return this.tag === this.activeTag;
|
| | | },
|
| | | tagData() {
|
| | | return this.$store.getters.getTagData(this.tag);
|
| | | }
|
| | | },
|
| | | methods: {
|
| | | ...mapMutations('tag', ['removeTag']),
|
| | | saveNavState(activePath) {
|
| | | window.sessionStorage.setItem('activePath', activePath);
|
| | | removeTag(tag) {
|
| | | this.$emit('removeTag', tag);
|
| | | },
|
| | | switchTag(tag) {
|
| | | this.$emit('switchTag', tag);
|
| | | this.$router.push('/' + tag); // 切换到指定路由
|
| | | }
|
| | |
|
| | | const menuItem = this.menuList.find(item => item.menuLists.some(menu => menu.router === activePath));
|
| | | if (menuItem) {
|
| | | const submenuItem = menuItem.menuLists.find(menu => menu.router === activePath);
|
| | | if (submenuItem) {
|
| | | const tag = submenuItem.name;
|
| | | this.addTag(tag); // 添加标签到 Vuex Store
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | </script>
|
| | |
|
| | | <style scoped>
|
| | | .tagContainer {
|
| | | display: flex;
|
| | | flex-wrap: wrap;
|
| | | margin-bottom: 10px;
|
| | | }
|
| | |
|
| | | .tagItem {
|
| | | background-color: #eee;
|
| | | .tag {
|
| | | display: inline-block;
|
| | | margin-right: 10px;
|
| | | padding: 4px 10px;
|
| | | border-radius: 4px;
|
| | | padding: 4px 8px;
|
| | | margin-right: 8px;
|
| | | margin-bottom: 8px;
|
| | | display: flex;
|
| | | align-items: center;
|
| | | }
|
| | |
|
| | | .closeBtn {
|
| | | margin-left: 4px;
|
| | | color: red;
|
| | | background-color: #f0f0f0;
|
| | | cursor: pointer;
|
| | | }
|
| | | </style>
|
| | |
|
| | | .tag.active {
|
| | | background-color: #409eff;
|
| | | color: #fff;
|
| | | }
|
| | |
|
| | | .tag span {
|
| | | margin-right: 5px;
|
| | | }
|
| | |
|
| | | .tag i {
|
| | | margin-left: 5px;
|
| | | font-size: 12px;
|
| | | cursor: pointer;
|
| | | }
|
| | | </style> |
| | |
| | | component: () => import('../views/device/iostate') |
| | | }, |
| | | { |
| | | path: '/device/talkvue', |
| | | component: () => import('../views/device/talkvue') |
| | | }, |
| | | { |
| | | path: '/device/control', |
| | | component: () => import('../views/device/control') |
| | | }, |
| | |
| | | path: '/Electrical/State', |
| | | component: () => import('../views/Electrical/State') |
| | | }, |
| | | { |
| | | path: '/Electrical/alarm', |
| | | component: () => import('../views/Electrical/alarm') |
| | | }, |
| | | |
| | | |
| | | |
| | |
| | | modules: {
|
| | | tags,
|
| | | },
|
| | | state: {
|
| | | tagData: {} // 存储标签数据的对象
|
| | | },
|
| | | mutations: {
|
| | | // 更新标签数据
|
| | | updateTagData(state, payload) {
|
| | | state.tagData[payload.tag] = payload.data;
|
| | | }
|
| | | },
|
| | | actions: {
|
| | | // 异步操作更新标签数据
|
| | | updateTagDataAsync({ commit }, payload) {
|
| | | // 执行异步操作,比如发送请求获取数据
|
| | | // 然后通过commit触发mutation来更新数据
|
| | | setTimeout(() => {
|
| | | commit('updateTagData', payload);
|
| | | }, 1000);
|
| | | }
|
| | | },
|
| | | getters: {
|
| | | getTagData: (state) => (tag) => {
|
| | | return state.tagData[tag] || null; // 获取指定标签的数据
|
| | | }
|
| | | }
|
| | | // 其他配置
|
| | | });
|
| | |
| | | const state = {
|
| | | tags: []
|
| | | };
|
| | | }
|
| | |
|
| | | const mutations = {
|
| | | addTag(state, tag) {
|
| | |
| | | state.tags.push(tag);
|
| | | }
|
| | | },
|
| | | removeTag(state, tag) {
|
| | | const index = state.tags.indexOf(tag);
|
| | | if (index !== -1) {
|
| | | state.tags.splice(index, 1);
|
| | | }
|
| | | removeTag(state, index) {
|
| | | state.tags.splice(index, 1);
|
| | | },
|
| | | removeAllTags(state) {
|
| | | state.tags = [];
|
| | | },
|
| | | switchTag(tag) {
|
| | | this.$emit('switchTag', tag);
|
| | | this.$router.push('/' + tag); // 添加这行代码以切换路由
|
| | | }
|
| | | };
|
| | | }
|
| | |
|
| | | export default {
|
| | | namespaced: true,
|
| | | state,
|
| | | mutations
|
| | | }; |
| | | }
|
| | |
| | | </el-breadcrumb>
|
| | | <div>Action</div>
|
| | | <el-form label-width="100px" style="display: flex;flex-wrap: wrap;" :model="{ messagepack }">
|
| | | <div class="kuai_div" v-for="item in this.record.xyData" :key="item.name">
|
| | | <!-- <div class="kuai_div" v-for="item in record.xyData" :key="item.value">
|
| | | <el-input v-model="item.name" style="width: 240px;" class="in_mc"></el-input>
|
| | | <!-- <el-input v-model="item[0]" style="width: 80px;"></el-input> -->
|
| | | <el-switch v-model="item.value" active-value="0" inactive-value="1"></el-switch>
|
| | | </div>
|
| | | </div> -->
|
| | |
|
| | | <div class="kuai_div" v-for="(item, index) in record.xyData" :key="index">
|
| | | <el-input v-model="item.name" style="width: 240px;" class="in_mc" readonly></el-input>
|
| | | <el-switch v-model="item.value" active-value="1" inactive-value="0" @change="send()"></el-switch>
|
| | | </div>
|
| | | </el-form>
|
| | |
|
| | |
|
| | |
| | | data () {
|
| | | return {
|
| | | record: {
|
| | | params: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
|
| | | params: [0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
|
| | | canshu: [
|
| | | 'D01 VFD conveyor',
|
| | | 'D02 VFD conveyor',
|
| | |
| | | 'B02 YV UP DOWN',
|
| | | ],
|
| | | xyData: [
|
| | | { name: 'D01 VFD conveyor', value: 0 },
|
| | | { name: "D02 VFD conveyor", value: 0 },
|
| | | { name: "D03 VFD conveyor", value: 0 },
|
| | | { name: "D04 VFD conveyor", value: 0 },
|
| | | { name: "B01 B02 TRAVEL JOG Velocity", value: 0 },
|
| | | { name: "conveyor Velocity(Manual)", value: 0 },
|
| | | ],
|
| | | { name: 'D01 VFD conveyor', value: "0" },
|
| | | { name: 'D02 VFD conveyor', value: "0" },
|
| | | { name: 'D03 VFD conveyor', value: "1" },
|
| | | { name: 'D04 VFD conveyor', value: "0" },
|
| | | { name: 'D05 VFD conveyor', value: "0" },
|
| | | { name: 'D06 VFD conveyor', value: "0" },
|
| | | { name: 'A01 VFD conveyor', value: "0" },
|
| | | { name: 'A02 VFD conveyor', value: "0" },
|
| | | { name: 'B01 VFD conveyor', value: "0" },
|
| | | { name: 'B02 VFD conveyor', value: "0" },
|
| | | { name: 'A01 SERVE TURN JOG+', value: "0" },
|
| | | { name: 'A02 SERVE TURN JOG-', value: "0" },
|
| | | { name: 'A01 SERVE TRAVEL JOG+', value: "0" },
|
| | | { name: 'A02 SERVE TRAVEL JOG-', value: "0" },
|
| | | { name: 'B01 SERVE TRAVEL JOG+', value: "0" },
|
| | | { name: 'B02 SERVE TRAVEL JOG-', value: "0" },
|
| | | { name: 'A01 SERVE TURN POS', value: "0" },
|
| | | { name: 'A02 SERVE TURN POS', value: "0" },
|
| | | { name: 'A01 SERVE TRAVEL POS', value: "0" },
|
| | | { name: 'A02 SERVE TRAVEL POS', value: "0" },
|
| | | { name: 'B01 SERVE TRAVEL POS', value: "0" },
|
| | | { name: 'B02 SERVE TRAVEL POS', value: "0" },
|
| | | { name: 'B01 YV TURN', value: "0" },
|
| | | { name: 'B01 YV UP DOWN', value: "0" },
|
| | | { name: 'B02 YV TURN', value: "0" },
|
| | | { name: 'B02 YV UP DOWN', value: "0" },
|
| | | ]
|
| | | ,
|
| | | },
|
| | |
|
| | |
|
| | |
| | | },
|
| | | methods: {
|
| | | init () {
|
| | | let viewname = "Action";
|
| | | let viewname = "action";
|
| | |
|
| | | if (typeof (WebSocket) == "undefined") {
|
| | | console.log("您的浏览器不支持WebSocket");
|
| | |
| | | console.log("websocket已打开");
|
| | | };
|
| | | // 浏览器端收消息,获得从服务端发送过来的文本消息
|
| | | socket.onmessage = function (msg) {
|
| | | socket.onmessage = (msg) => {
|
| | | if (!msg.data) {
|
| | | return; // 如果收到空数据,则直接返回,不执行后续逻辑
|
| | | }
|
| | |
|
| | | //console.log("收到数据====" + msg.data);
|
| | | let obj = JSON.parse(msg.data);
|
| | | let obj = JSON.parse(msg.data);
|
| | | this.record.params[0] = obj.params[0];
|
| | |
|
| | | this.record.params[0] = obj.acion[0].join(",");
|
| | | this.record.params[0] = this.record.params[0].split(",");
|
| | | for (let a = 0; a <= this.record.params[0].length - 1; a++) {
|
| | | if (!this.record.xyData[a]) {
|
| | | this.record.xyData[a] = { name: this.record.canshu[a], value: this.record.params[0][a].toString() };
|
| | | } else {
|
| | | this.record.xyData[a].value = this.record.params[0][a].toString();
|
| | | }
|
| | | }
|
| | |
|
| | | for (let a = 0; a <= this.record.params.length - 1; a++) {
|
| | | // if (!this.record.xyData[a]) {
|
| | | // this.record.xyData[a] = { name: this.record.canshu[a], value: this.record.params[0][a] };
|
| | | // } else {
|
| | | // this.record.xyData[a].value = this.record.params[0][a];
|
| | | // }
|
| | | this.record.xyData[a] = { name: this.record.canshu[a], value: this.record.params[0][a] };
|
| | | }
|
| | | console.log(this.record.xyData)
|
| | | this.$forceUpdate();
|
| | | }.bind(this);
|
| | | console.log(this.record.xyData);
|
| | | this.$forceUpdate();
|
| | | };
|
| | |
|
| | | //关闭事件
|
| | | socket.onclose = function () {
|
| | | console.log("websocket已关闭");
|
| | |
| | | }
|
| | |
|
| | | },
|
| | | send () {
|
| | | this.messagepack.data = { taskname: "前端到后台" };
|
| | | socket?.send(JSON.stringify(this.messagepack)); // 将组装好的json发送给服务端,由服务端进行转发
|
| | | }
|
| | | send() {
|
| | | this.messagepack.data = this.record.xyData.map(item => parseInt(item.value)); // 转换为整数数组
|
| | | console.log(this.messagepack);
|
| | | socket?.send(JSON.stringify(this.messagepack));
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | |
| | | border: none;
|
| | |
|
| | |
|
| | | .el-input__inner {
|
| | | |
| | |
|
| | |
|
| | | }
|
| | | .el-input__inner {
|
| | | border: 1 solid black;
|
| | | }
|
| | |
|
| | |
|
| | | }
|
| | |
|
| | | .in_mc {
|
| | | .el-input__inner {
|
| | | |
| | | }
|
| | | .el-input__inner {
|
| | | border: none;
|
| | | }
|
| | | }
|
| | | </style> |
| | |
| | | <template>
|
| | | <div class="app">
|
| | | <!--面包屑导航区域-->
|
| | | <el-breadcrumb separator-class="el-icon-arrow-right" class="el-breadcrumb">
|
| | | <router-link to="/home" tag="el-button" type="text">{{ $t('langHome') }}</router-link>
|
| | | <el-button type="text">设备管理</el-button>
|
| | | <router-link to="/Electrical/Parameter" tag="el-button" type="text">Parameter</router-link>
|
| | | <router-link to="/Electrical/Action" tag="el-button" type="text">Action</router-link>
|
| | | <router-link to="/Electrical/Sign" tag="el-button" type="text">Sign</router-link>
|
| | | <router-link to="/Electrical/State" tag="el-button" type="text">State</router-link>
|
| | | <router-link to="/Electrical/alarm" tag="el-button" type="text">Alarm</router-link>
|
| | | </el-breadcrumb>
|
| | | <div>Parameter</div>
|
| | |
|
| | |
|
| | | <el-form label-width="100px" style="display: flex;flex-wrap: wrap;" :model="messagepack.data">
|
| | | <div id="btn_div">
|
| | | <el-button type="primary" @click="send()">Distribute</el-button>
|
| | | <!-- <button @click="send()">测试发送</button> -->
|
| | | </div>
|
| | | <div class="kuai_div" v-for="item in this.record.xyData" :key="item.name">
|
| | | <el-input style="width: 280px;" class="in_mc" v-model="item.name"></el-input>
|
| | | <el-input v-model="item.value" style="width: 80px;"></el-input>
|
| | | </div>
|
| | |
|
| | |
|
| | |
|
| | | </el-form>
|
| | |
|
| | |
|
| | |
|
| | |
|
| | | <!--面包屑导航区域-->
|
| | | <el-breadcrumb separator-class="el-icon-arrow-right" class="el-breadcrumb">
|
| | | <router-link to="/home" tag="el-button" type="text">{{ $t('langHome') }}</router-link>
|
| | | <el-button type="text">设备管理</el-button>
|
| | | <router-link to="/Electrical/Parameter" tag="el-button" type="text">Parameter</router-link>
|
| | | <router-link to="/Electrical/Action" tag="el-button" type="text">Action</router-link>
|
| | | <router-link to="/Electrical/Sign" tag="el-button" type="text">Sign</router-link>
|
| | | <router-link to="/Electrical/State" tag="el-button" type="text">State</router-link>
|
| | | <router-link to="/Electrical/alarm" tag="el-button" type="text">Alarm</router-link>
|
| | | </el-breadcrumb>
|
| | | <div>Parameter</div>
|
| | | |
| | | <el-form label-width="100px" style="display: flex;flex-wrap: wrap;" :model="messagepack.data">
|
| | | <div id="btn_div">
|
| | | <el-button type="primary" @click="send()">下发参数</el-button>
|
| | | </div>
|
| | | <div class="kuai_div" v-for="(item, index) in record.xyData" :key="index">
|
| | | <el-input style="width: 280px;" class="in_mc" v-model="item.name" readonly></el-input>
|
| | | <el-input v-model.number="item.value" style="width: 80px;" @input="handleChange(index, $event.target.value)"></el-input>
|
| | | </div>
|
| | | </el-form>
|
| | | </div>
|
| | | </template>
|
| | |
|
| | | <script >
|
| | |
|
| | | let socket;
|
| | | export default {
|
| | | </template>
|
| | | |
| | | <script>
|
| | | let socket;
|
| | | |
| | | export default {
|
| | | name: "Parameter",
|
| | | data () {
|
| | | return {
|
| | | record: {
|
| | | params: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
|
| | | xyData: [
|
| | | { name: 'conveyor Velocity(Auto FAST)', value: 0 },
|
| | | { name: 'conveyor Velocity(Manual)', value: 0 },
|
| | | { name: 'A01 A02 TURN JOG Velocity', value: 0 },
|
| | | { name: 'A01 A02 TRAVEL JOG Velocity', value: 0 },
|
| | | { name: 'A01 A02 TURN POS Velocity AUTO', value: 0 },
|
| | | { name: 'A01 A02 TURN POS Velocity manual', value: 0 },
|
| | | { name: '01 A02 TRAVEL POS Velocity AUTO', value: 0 },
|
| | | { name: 'A01 A02 TRAVEL POS Velocity manual', value: 0 },
|
| | | { name: 'B01 B02 TRAVEL POS Velocity AUTO', value: 0 },
|
| | | { name: 'B01 B02 TRAVEL POS Velocity manual', value: 0 },
|
| | |
|
| | | ],
|
| | | canshu: [
|
| | | 'conveyor Velocity(Auto FAST)',
|
| | | 'B01 B02 TRAVEL JOG Velocity',
|
| | | 'A01 A02 TURN POS Velocity AUTO',
|
| | | 'A01 A02 TURN POS Velocity manual',
|
| | | 'A01 A02 TRAVEL POS Velocity AUTO',
|
| | | 'A01 A02 TRAVEL POS Velocity manual',
|
| | | 'B01 B02 TRAVEL POS Velocity AUTO',
|
| | | 'B01 B02 TRAVEL POS Velocity manual',
|
| | | ],
|
| | |
|
| | | },
|
| | |
|
| | |
|
| | | messagepack: {
|
| | | data: { taskname: "" }
|
| | | },
|
| | | queryInfo: {
|
| | | data: "1",
|
| | | pageSize: 10
|
| | | },
|
| | |
|
| | | }
|
| | | data() {
|
| | | return {
|
| | | record: {
|
| | | params: [100, 200, 10, 10, 10, 10],
|
| | | xyData: [
|
| | | { name: "conveyor Velocity(Auto FAST)", value: 0 },
|
| | | { name: "conveyor Velocity(Auto SLOW)", value: 0 },
|
| | | { name: "conveyor Velocity(Manual)", value: 0 },
|
| | | { name: "A01 A02 TURN JOG Velocity", value: 0 },
|
| | | { name: "A01 A02 TRAVEL JOG Velocity", value: 0 },
|
| | | { name: "B01 B02 TRAVEL JOG Velocity", value: 0 },
|
| | | { name: "A01 A02 TURN POS Velocity AUTO", value: 0 },
|
| | | { name: "A01 A02 TURN POS Velocity manual", value: 0 },
|
| | | { name: "A01 A02 TRAVEL POS Velocity AUTO", value: 0 },
|
| | | { name: "A01 A02 TRAVEL POS Velocity manual", value: 0 },
|
| | | { name: "B01 B02 TRAVEL POS Velocity AUTO", value: 0 },
|
| | | { name: "B01 B02 TRAVEL POS Velocity manual", value: 0 }
|
| | | ],
|
| | | canshu: []
|
| | | },
|
| | | created () {
|
| | | this.init();
|
| | | messagepack: {
|
| | | data: { taskname: "" }
|
| | | },
|
| | | queryInfo: {
|
| | | data: "1",
|
| | | pageSize: 10
|
| | | }
|
| | | };
|
| | | },
|
| | | created() {
|
| | | this.initWebSocket();
|
| | | },
|
| | | methods: {
|
| | | init () {
|
| | | let viewname = "Parameter";
|
| | |
|
| | | if (typeof (WebSocket) == "undefined") {
|
| | | console.log("您的浏览器不支持WebSocket");
|
| | | } else {
|
| | | //console.log("您的浏览器支持WebSocket");
|
| | |
|
| | | let socketUrl = "ws://" + "localhost:8888" + "/springboot-vue3/api/talk/" + viewname;
|
| | | if (socket != null) {
|
| | | socket.close();
|
| | | socket = null;
|
| | | initWebSocket() {
|
| | | let viewname = "Parameter";
|
| | | |
| | | if (typeof WebSocket === "undefined") {
|
| | | console.log("您的浏览器不支持WebSocket");
|
| | | } else {
|
| | | let socketUrl = "ws://" + "localhost:8888" + "/springboot-vue3/api/talk/" + viewname;
|
| | | |
| | | if (socket != null) {
|
| | | socket.close();
|
| | | socket = null;
|
| | | }
|
| | | |
| | | // 开启一个websocket服务
|
| | | socket = new WebSocket(socketUrl);
|
| | | |
| | | // 打开事件
|
| | | socket.onopen = function () {
|
| | | console.log("websocket已打开");
|
| | | };
|
| | | |
| | | // 收到消息
|
| | | socket.onmessage = (msg) => {
|
| | | if (!msg.data) {
|
| | | return; // 如果收到空数据,则直接返回,不执行后续逻辑
|
| | | }
|
| | | // 开启一个websocket服务
|
| | | socket = new WebSocket(socketUrl);
|
| | | //打开事件
|
| | | socket.onopen = function () {
|
| | | console.log("websocket已打开");
|
| | | };
|
| | | // 浏览器端收消息,获得从服务端发送过来的文本消息
|
| | | socket.onmessage = function (msg) {
|
| | |
|
| | | //console.log("收到数据====" + msg.data);
|
| | | let obj = JSON.parse(msg.data);
|
| | | //this.$set(this.record.params, 0, obj.params[0]);
|
| | | this.record.params[0] = obj.params[0];
|
| | | for (let a = 0; a <= this.record.params.length - 1; a++) {
|
| | | // this.record.xyData[a] = [this.record.canshu[a], this.record.params[0][a]];
|
| | | // this.record.xyData[a] = { name: this.record.canshu[a], value: this.record.params[0][a] };
|
| | | |
| | | let obj = JSON.parse(msg.data);
|
| | | this.record.params[0] = obj.params[0];
|
| | | |
| | | for (let a = 0; a <= this.record.params[0].length - 1; a++) {
|
| | | if (!this.record.xyData[a]) {
|
| | | this.record.xyData[a] = { name: this.record.canshu[a], value: this.record.params[0][a] };
|
| | | } else {
|
| | | this.record.xyData[a].value = this.record.params[0][a];
|
| | | }
|
| | | this.$forceUpdate();
|
| | |
|
| | | }.bind(this);
|
| | | //关闭事件
|
| | | socket.onclose = function () {
|
| | | console.log("websocket已关闭");
|
| | | };
|
| | | //发生了错误事件
|
| | | socket.onerror = function () {
|
| | | console.log("websocket发生了错误");
|
| | | }
|
| | | }
|
| | | },
|
| | | send () {
|
| | | this.messagepack.data = { taskname: "前端到后台" };
|
| | | socket?.send(JSON.stringify(this.messagepack)); // 将组装好的json发送给服务端,由服务端进行转发
|
| | | |
| | | console.log(this.record.xyData);
|
| | | this.$forceUpdate();
|
| | | };
|
| | | |
| | | // 关闭事件
|
| | | socket.onclose = function () {
|
| | | console.log("websocket已关闭");
|
| | | };
|
| | | |
| | | // 发生错误事件
|
| | | socket.onerror = function () {
|
| | | console.log("websocket发生了错误");
|
| | | };
|
| | | }
|
| | |
|
| | | },
|
| | | send() {
|
| | | this.messagepack.data = this.record.xyData.map((item) => parseInt(item.value)); // 转换为整数数组
|
| | | console.log(this.messagepack);
|
| | | socket?.send(JSON.stringify(this.messagepack));
|
| | | },
|
| | | handleChange(index, value) {
|
| | | this.record.xyData[index].value = value;
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | | </script>
|
| | |
|
| | | <style>
|
| | | .kuai_div {
|
| | | }
|
| | | };
|
| | | </script>
|
| | | |
| | | <style>
|
| | | .kuai_div {
|
| | | width: 30%;
|
| | | margin-bottom: 15px;
|
| | | }
|
| | |
|
| | | .el-input {
|
| | | }
|
| | | |
| | | .el-input {
|
| | | border: none;
|
| | |
|
| | |
|
| | | .el-input__inner {
|
| | | border: 1 solid black;
|
| | | }
|
| | |
|
| | |
|
| | | }
|
| | |
|
| | | .in_mc {
|
| | | |
| | | .el-input__inner {
|
| | | border: none;
|
| | | border: 1px solid black;
|
| | | }
|
| | | }
|
| | |
|
| | | #btn_div {
|
| | |
|
| | | |
| | | .in_mc .el-input__inner {
|
| | | border: none;
|
| | | }
|
| | | |
| | | #btn_div {
|
| | | width: 100%;
|
| | |
|
| | | }
|
| | |
|
| | | #btn_div .el-button {
|
| | | }
|
| | | |
| | | #btn_div .el-button {
|
| | | float: right;
|
| | | }
|
| | | </style>
|
| | | }
|
| | | </style> |
| | |
| | | <div class="app"> |
| | | <!--面包屑导航区域--> |
| | | <el-breadcrumb separator-class="el-icon-arrow-right"> |
| | | <el-breadcrumb-item :to="{ path: '/home' }">首页</el-breadcrumb-item> |
| | | <el-breadcrumb-item>权限管理</el-breadcrumb-item> |
| | | <el-breadcrumb-item>权限列表</el-breadcrumb-item> |
| | | <el-breadcrumb-item :to="{ path: '/home' }">{{$t('breadcrumb.home')}}</el-breadcrumb-item> |
| | | <el-breadcrumb-item>{{$t('breadcrumb.permissionManagement')}}</el-breadcrumb-item> |
| | | <el-breadcrumb-item>{{$t('breadcrumb.permissionList')}}</el-breadcrumb-item> |
| | | </el-breadcrumb> |
| | | <!--卡片视图区域--> |
| | | <el-card class="el-card"> |
| | | <el-row :gutter="20"> |
| | | <!--搜索与添加区域--> |
| | | <el-col :span="6"> |
| | | <el-input placeholder="请输入权限名称" v-model="queryInfo.name" clearable @clear="getPowerList()"> |
| | | <el-input :placeholder="$t('search.placeholder')" v-model="queryInfo.name" clearable @clear="getPowerList()"> |
| | | <el-button slot="append" icon="el-icon-search" @click="getPowerList()"></el-button> |
| | | </el-input> |
| | | </el-col> |
| | | <!--添加区域--> |
| | | <el-col :span="4"> |
| | | <el-button type="primary" @click="showAddDialog">添加权限</el-button> |
| | | <el-button type="primary" @click="showAddDialog">{{$t('button.addPermission')}}</el-button> |
| | | </el-col> |
| | | </el-row> |
| | | <!--权限列表区域--> |
| | | <el-table :data="powerList.records" border stripe> |
| | | <el-table-column label="#" type="index"></el-table-column> |
| | | <el-table-column label="角色" prop="role.name"></el-table-column> |
| | | <el-table-column label="权限描述" prop="permission.description"></el-table-column> |
| | | <el-table-column label="权限值" prop="permission.name"></el-table-column> |
| | | <el-table-column label="创建时间" prop="createTime"></el-table-column> |
| | | <el-table-column label="是否生效"> |
| | | <el-table-column :label="$t('table.role')" prop="role.name"></el-table-column> |
| | | <el-table-column :label="$t('table.permissionDescription')" prop="permission.description"></el-table-column> |
| | | <el-table-column :label="$t('table.permissionValue')" prop="permission.name"></el-table-column> |
| | | <el-table-column :label="$t('table.createTime')" prop="createTime"></el-table-column> |
| | | <el-table-column :label="$t('table.isActive')"> |
| | | <template slot-scope="scope"> |
| | | <el-switch :active-value=1 |
| | | :inactive-value=0 |
| | |
| | | </el-switch> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="操作"> |
| | | <el-table-column :label="$t('table.operation')"> |
| | | <template slot-scope="scope"> |
| | | <!--修改--> |
| | | <el-tooltip effect="dark" content="修改" placement="top" :enterable="false"> |
| | | <el-tooltip effect="dark" :content="$t('tooltip.edit')" placement="top" :enterable="false"> |
| | | <el-button type="primary" icon="el-icon-edit" size="mini" |
| | | @click="showEditDialog(scope.row)"></el-button> |
| | | </el-tooltip> |
| | | <!--删除--> |
| | | <el-tooltip effect="dark" content="删除" placement="top" :enterable="false"> |
| | | <el-tooltip effect="dark" :content="$t('tooltip.delete')" placement="top" :enterable="false"> |
| | | <el-button type="danger" icon="el-icon-delete" size="mini" |
| | | @click="removeById(scope.row)"></el-button> |
| | | </el-tooltip> |
| | |
| | | </el-card> |
| | | <!--添加权限的对话框--> |
| | | <el-dialog |
| | | title="添加权限" |
| | | :title="$t('dialog.addPermission')" |
| | | :visible.sync="addDialogVisible" |
| | | width="50%" |
| | | @close="addDialogClosed"> |
| | | <!--内容主体区域--> |
| | | <el-form :model="addPowerForm" :rules="powerRules" ref="powerRef" label-width="70px"> |
| | | <el-form-item label="角色" prop="roleId"> |
| | | <el-select filterable v-model="addPowerForm.roleId" placeholder="请选择"> |
| | | <el-form-item :label="$t('form.role')" prop="roleId"> |
| | | <el-select filterable v-model="addPowerForm.roleId" :placeholder="$t('form.select')"> |
| | | <el-option v-for="item in roleList" |
| | | :key="item.id" |
| | | :value="item.id" |
| | |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="权限" prop="permissionId"> |
| | | <el-select filterable v-model="addPowerForm.permissionId" placeholder="请选择"> |
| | | <el-form-item :label="$t('form.permission')" prop="permissionId"> |
| | | <el-select filterable v-model="addPowerForm.permissionId" :placeholder="$t('form.select')"> |
| | | <el-option v-for="item in permissionList" |
| | | :key="item.id" |
| | | :value="item.id" |
| | |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="是否生效" prop="state"> |
| | | <el-select v-model="addPowerForm.state" placeholder="请选择"> |
| | | <el-form-item :label="$t('form.isActive')" prop="state"> |
| | | <el-select v-model="addPowerForm.state" :placeholder="$t('form.select')"> |
| | | <el-option v-for="(item,index) in options" |
| | | :key="index" |
| | | :value="item.value" |
| | |
| | | </el-form-item> |
| | | </el-form> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button @click="addDialogVisible = false">取 消</el-button> |
| | | <el-button type="primary" @click="addPower">确 定</el-button> |
| | | <el-button @click="addDialogVisible = false">{{$t('button.cancel')}}</el-button> |
| | | <el-button type="primary" @click="addPower">{{$t('button.confirm')}}</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | <!--修改权限的对话框--> |
| | | <el-dialog |
| | | title="修改权限" |
| | | :title="$t('dialog.editPermission')" |
| | | :visible.sync="editDialogVisible" |
| | | width="50%"> |
| | | <!--内容主体区域--> |
| | | <el-form :model="editRoleForm" :rules="powerRules" ref="powerRef" label-width="70px"> |
| | | <el-form-item label="角色" prop="roleId"> |
| | | <el-select filterable v-model="editRoleForm.roleId" placeholder="请选择"> |
| | | <el-form-item :label="$t('form.role')" prop="roleId"> |
| | | <el-select filterable v-model="editRoleForm.roleId" :placeholder="$t('form.select')"> |
| | | <el-option v-for="item in roleList" |
| | | :key="item.id" |
| | | :value="item.id" |
| | |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item filterable label="权限" prop="permissionId"> |
| | | <el-select v-model="editRoleForm.permissionId" placeholder="请选择"> |
| | | <el-form-item filterable :label="$t('form.permission')" prop="permissionId"> |
| | | <el-select v-model="editRoleForm.permissionId" :placeholder="$t('form.select')"> |
| | | <el-option v-for="item in permissionList" |
| | | :key="item.id" |
| | | :value="item.id" |
| | |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="是否生效" prop="state"> |
| | | <el-select v-model="editRoleForm.state" placeholder="请选择"> |
| | | <el-form-item :label="$t('form.isActive')" prop="state"> |
| | | <el-select v-model="editRoleForm.state" :placeholder="$t('form.select')"> |
| | | <el-option v-for="(item,index) in options" |
| | | :key="index" |
| | | :value="item.value" |
| | |
| | | </el-form-item> |
| | | </el-form> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button @click="editDialogVisible = false">取 消</el-button> |
| | | <el-button type="primary" @click="editRoleInfo">确 定</el-button> |
| | | <el-button @click="editDialogVisible = false">{{$t('button.cancel')}}</el-button> |
| | | <el-button type="primary" @click="editRoleInfo">{{$t('button.confirm')}}</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | </div> |
| | |
| | | import {getById, removeById, saveOrUpdate, selectPage} from "../../api/rolePermission"; |
| | | import {select} from "../../api/role"; |
| | | import {selectPermission} from "../../api/permission"; |
| | | import LanguageMixin from '../../lang/LanguageMixin' |
| | | |
| | | export default { |
| | | name: "Power", |
| | | mixins: [LanguageMixin], |
| | | data() { |
| | | return { |
| | | queryInfo: { |
| | |
| | | addRoleForm: { |
| | | state: 1 |
| | | }, |
| | | |
| | | // 修改的角色对象 |
| | | editRoleForm: {}, |
| | | // 添加角色的验证规则 |
| | | addRoleRules: { |
| | | name: [ |
| | | {required: true, message: '请输入名称', trigger: 'blur'}, |
| | | {required: true, message: '请输入名称', trigger: 'blur'}, |
| | | {min: 2, max: 15, message: '长度在 2 到 15 个字符', trigger: 'blur'} |
| | | ], |
| | | state: [ |
| | |
| | | }, |
| | | stateChange(info) { |
| | | saveOrUpdate(info).then(() => { |
| | | this.$message.success("更新状态成功") |
| | | const 更新状态成功 = this.$t('更新状态成功'); |
| | | this.$message.success(更新状态成功) |
| | | |
| | | }); |
| | | }, |
| | |
| | | this.getRoleList(); |
| | | // 隐藏添加角色对话框 |
| | | this.addDialogVisible = false; |
| | | this.$message.success("添加角色成功"); |
| | | const 添加角色成功 = this.$t('添加角色成功'); |
| | | this.$message.success(添加角色成功); |
| | | }); |
| | | }) |
| | | }, |
| | |
| | | this.getRoleList(); |
| | | // 隐藏添加角色对话框 |
| | | this.editDialogVisible = false; |
| | | this.$message.success("修改角色成功"); |
| | | const 修改角色成功 = this.$t('修改角色成功'); |
| | | this.$message.success(修改角色成功); |
| | | }); |
| | | }) |
| | | }, |
| | | // 根据id删除角色信息 |
| | | removeById(role) { |
| | | // 弹框询问用户是否删除角色 |
| | | this.$confirm('此操作将永久删除该角色, 是否继续?', '提示', { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | | const 此操作将永久删除该角色是否继续 = this.$t('此操作将永久删除该角色, 是否继续?'); |
| | | const 提示 = this.$t('提示'); |
| | | const 确定 = this.$t('确定'); |
| | | const 取消 = this.$t('取消'); |
| | | this.$confirm(此操作将永久删除该角色是否继续, 提示, { |
| | | confirmButtonText: 确定, |
| | | cancelButtonText: 取消, |
| | | type: 'warning' |
| | | }).then(() => { |
| | | // 删除角色 |
| | | removeById({id: role.id}).then(() => { |
| | | // 重新获取角色列表 |
| | | this.getRoleList(); |
| | | this.$message.success("删除角色成功"); |
| | | const 删除角色成功 = this.$t('删除角色成功'); |
| | | this.$message.success(删除角色成功); |
| | | }); |
| | | }).catch(() => { |
| | | this.$message('已取消删除'); |
| | | const 已取消删除 = this.$t('已取消删除'); |
| | | this.$message(已取消删除); |
| | | }); |
| | | } |
| | | } |
| | |
| | | <el-row :gutter="20"> |
| | | <!--搜索与添加区域--> |
| | | <el-col :span="6"> |
| | | <el-input placeholder="请输入用户名称" v-model="queryInfo.username" clearable @clear="getUserList"> |
| | | <el-input :placeholder= "$t('langUsernamePlaceholder')" v-model="queryInfo.username" clearable @clear="getUserList"> |
| | | </el-input> |
| | | </el-col> |
| | | <el-col :span="6"> |
| | | <el-input placeholder="请输入邮箱" v-model="queryInfo.email" clearable @clear="getUserList"> |
| | | <el-input :placeholder="$t('langEmailPlaceholder')" v-model="queryInfo.email" clearable @clear="getUserList"> |
| | | </el-input> |
| | | </el-col> |
| | | <!--搜索按钮--> |
| | |
| | | :page-sizes="[6, 12, 18, 24]" |
| | | :page-size="queryInfo.pageSize" |
| | | :total="userList.total" |
| | | :prev-text="$t('pagination.prev')" |
| | | :next-text="$t('pagination.next')" |
| | | |
| | | :pager-count="7" |
| | | :layout="layout" |
| | | > |
| | |
| | | <artifactId>poi-tl</artifactId> |
| | | <version>1.12.1</version> |
| | | </dependency> |
| | | |
| | | |
| | | |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-websocket</artifactId> |
| | |
| | | |
| | | import org.springframework.boot.SpringApplication; |
| | | import org.springframework.boot.autoconfigure.SpringBootApplication; |
| | | import org.springframework.context.annotation.ComponentScan; |
| | | |
| | | @SpringBootApplication |
| | | |
| | | public class AuthorityApplication { |
| | | |
| | | public static void main(String[] args) { |
| | |
| | | |
| | | import java.util.List; |
| | | |
| | | import javax.websocket.Session; |
| | | |
| | | import cn.hutool.json.JSONArray; |
| | | import cn.hutool.json.JSONObject; |
| | | |
| | | public class PlcHold extends Thread { |
| | | @Override |
| | | public void run() { |
| | | while (this != null) { |
| | | try { |
| | | @Override |
| | | public void run() { |
| | | while (this != null) { |
| | | try { |
| | | |
| | | Thread.sleep(2000); |
| | | } catch (InterruptedException e) { |
| | | // TODO Auto-generated catch block |
| | | e.printStackTrace(); |
| | | } |
| | | List<Boolean> bitlist = S7control.getinstance().ReadBits("DB2.0.0", 100); |
| | | Thread.sleep(10000); |
| | | } catch (InterruptedException e) { |
| | | // TODO Auto-generated catch block |
| | | e.printStackTrace(); |
| | | } |
| | | List<Boolean> bitlist = S7control.getinstance().ReadBits("DB2.0.0", 100); |
| | | |
| | | List<Short> paramlist = S7control.getinstance().ReadWord("DB100.6", 1); |
| | | List<Short> paramlist = S7control.getinstance().ReadWord("DB100.6", 1); |
| | | |
| | | //查询数据库 |
| | | //推送到前端 |
| | | // 查询数据库 |
| | | // 推送到前端 |
| | | |
| | | JSONObject jsonObject = new JSONObject(); |
| | | jsonObject.append("params", new short[] { 0, 1, 2, 3, 4, 5 }); |
| | | WebSocketServer sendwServer = WebSocketServer.sessionMap.get("talkvue"); |
| | | if (sendwServer != null) { |
| | | sendwServer.sendMessage(jsonObject.toString()); |
| | | } |
| | | // Parameter |
| | | // JSONObject jsonObject = new JSONObject(); |
| | | // jsonObject.append("params", new short[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, }); |
| | | // WebSocketServer sendwServer = WebSocketServer.sessionMap.get("Parameter"); |
| | | // if (sendwServer != null) { |
| | | // sendwServer.sendMessage(jsonObject.toString()); |
| | | // } |
| | | |
| | | // Action |
| | | // JSONObject jsonObject2 = new JSONObject(); |
| | | // jsonObject2.append("acion", |
| | | // new short[] { 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
| | | // 1, 1, 1, 0, 0, }); |
| | | // WebSocketServer sendwServer2 = WebSocketServer.sessionMap.get("Action"); |
| | | // if (sendwServer2 != null) { |
| | | // sendwServer2.sendMessage(jsonObject2.toString()); |
| | | // } |
| | | |
| | | JSONObject jsonObject2 = new JSONObject(); |
| | | jsonObject2.append("params", new short[] { 0, 3, 2, 3, 4, 5 }); |
| | | WebSocketServer sendwServer2 = WebSocketServer.sessionMap.get("action"); |
| | | if (sendwServer2 != null) { |
| | | sendwServer2.sendMessage(jsonObject2.toString()); |
| | | } |
| | | } |
| | | // Sign |
| | | JSONObject jsonObject3 = new JSONObject(); |
| | | jsonObject3.append("sig", |
| | | new short[] { 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, |
| | | 1, }); |
| | | WebSocketServer sendwServer3 = WebSocketServer.sessionMap.get("Sign"); |
| | | if (sendwServer3 != null) { |
| | | sendwServer3.sendMessage(jsonObject3.toString()); |
| | | } |
| | | |
| | | // State |
| | | JSONObject jsonObject4 = new JSONObject(); |
| | | jsonObject4.append("sta", new short[] { 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, }); |
| | | WebSocketServer sendwServer4 = WebSocketServer.sessionMap.get("State"); |
| | | if (sendwServer4 != null) { |
| | | sendwServer4.sendMessage(jsonObject4.toString()); |
| | | } |
| | | |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.example.springboot.component;
|
| | |
|
| | | import cn.hutool.json.JSONObject;
|
| | |
|
| | | import java.util.ArrayList;
|
| | | import java.util.List;
|
| | |
|
| | | public class PlcParameter extends Thread {
|
| | | private static final int SEND_INTERVAL = 10000;
|
| | | private static final int WRITE_INTERVAL = 100;
|
| | |
|
| | | @Override
|
| | |
|
| | | public void run() {
|
| | | try {
|
| | | // 发送一次消息
|
| | | sendMessages();
|
| | |
|
| | | // 延迟一段时间
|
| | | Thread.sleep(SEND_INTERVAL);
|
| | |
|
| | | while (true) {
|
| | | // 写入PLC
|
| | | writeToPlc();
|
| | | Thread.sleep(WRITE_INTERVAL);
|
| | |
|
| | | // 发送消息
|
| | | sendMessages();
|
| | | Thread.sleep(SEND_INTERVAL);
|
| | | }
|
| | |
|
| | | } catch (InterruptedException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | private void sendMessages() {
|
| | | WebSocketServer sendwServer = WebSocketServer.sessionMap.get("Parameter");
|
| | | if (sendwServer != null) {
|
| | | List<Short> paramlist = S7control.getinstance().ReadWord("DB100.DBW", 12);
|
| | | JSONObject jsonObject = new JSONObject();
|
| | | // new short[]{1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0}
|
| | | jsonObject.append("params", new short[]{1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0});
|
| | | sendwServer.sendMessage(jsonObject.toString());
|
| | | }
|
| | | }
|
| | |
|
| | | private void writeToPlc() {
|
| | | WebSocketServer webSocketServer = WebSocketServer.sessionMap.get("Parameter");
|
| | | if (webSocketServer != null) {
|
| | | List<String> messages = webSocketServer.getMessages();
|
| | |
|
| | | String addressList = "DB100.DBW0";
|
| | |
|
| | | if (!messages.isEmpty()) {
|
| | | // 将最后一个消息转换为 short 类型的列表
|
| | | String lastMessage = messages.get(messages.size() - 1);
|
| | | System.out.println("messages:" + messages);
|
| | | String[] parts = lastMessage.split(",");
|
| | | List<Short> messageValues = new ArrayList<>();
|
| | | for (String part : parts) {
|
| | | try {
|
| | | // 使用正则表达式清除非数字字符
|
| | | String cleanedPart = part.replaceAll("[^0-9-]", "");
|
| | | short value = Short.parseShort(cleanedPart.trim());
|
| | | messageValues.add(value);
|
| | | } catch (NumberFormatException e) {
|
| | | // 如果无法解析为 short 类型,则忽略该部分
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | // 将消息值写入 PLC
|
| | | S7control.getinstance().WriteWord(addressList, messageValues);
|
| | | System.out.println("messageValues:" + messageValues);
|
| | | System.out.println("addressList:" + addressList);
|
| | | // 清空消息列表
|
| | | webSocketServer.clearMessages();
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | import java.util.List;
|
| | |
|
| | | public class Plcaction extends Thread {
|
| | | private static final long SEND_INTERVAL = 2000; // 发送消息的时间间隔
|
| | | private static final long WRITE_INTERVAL = 100; // 写入PLC的时间间隔
|
| | |
|
| | | @Override
|
| | | public void run() {
|
| | | while (this != null) {
|
| | | try {
|
| | | Thread.sleep(10000);
|
| | | } catch (InterruptedException e) {
|
| | | e.printStackTrace();
|
| | | try {
|
| | | // 发送一次消息
|
| | | sendMessages();
|
| | |
|
| | | // 延迟一段时间
|
| | | Thread.sleep(SEND_INTERVAL);
|
| | |
|
| | | while (true) {
|
| | | // 写入PLC
|
| | | writeToPlc();
|
| | | Thread.sleep(WRITE_INTERVAL);
|
| | |
|
| | | // 发送消息
|
| | | sendMessages();
|
| | | Thread.sleep(SEND_INTERVAL);
|
| | | }
|
| | |
|
| | | List<Short> paramlist = S7control.getinstance().ReadWord("DB100.DBW", 12);
|
| | | } catch (InterruptedException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| | | private void sendMessages() {
|
| | | WebSocketServer sendwServer = WebSocketServer.sessionMap.get("action");
|
| | | if (sendwServer != null) {
|
| | |
|
| | | List<Boolean> paramlist = S7control.getinstance().ReadBits("DB100.DBW", 12);
|
| | | // new short[]{1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0}
|
| | | JSONObject jsonObject = new JSONObject();
|
| | | jsonObject.append("params", paramlist);
|
| | | WebSocketServer sendwServer = WebSocketServer.sessionMap.get("action");
|
| | | if (sendwServer != null) {
|
| | | sendwServer.sendMessage(jsonObject.toString());
|
| | | }
|
| | | jsonObject.append("params", new short[]{1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0});
|
| | |
|
| | | WebSocketServer webSocketServer = WebSocketServer.sessionMap.get("action");
|
| | | if (webSocketServer != null) {
|
| | | List<String> messages = webSocketServer.getMessages();
|
| | | sendwServer.sendMessage(jsonObject.toString());
|
| | | }
|
| | |
|
| | | List<String> addressList = new ArrayList<>();
|
| | | addressList.add("DB100.DBW0");
|
| | | addressList.add("DB100.DBW2");
|
| | | addressList.add("DB100.DBW4");
|
| | | addressList.add("DB100.DBW6");
|
| | | addressList.add("DB100.DBW8");
|
| | | addressList.add("DB100.DBW10");
|
| | | addressList.add("DB100.DBW12");
|
| | | addressList.add("DB100.DBW14");
|
| | | addressList.add("DB100.DBW16");
|
| | | addressList.add("DB100.DBW18");
|
| | | addressList.add("DB100.DBW20");
|
| | | addressList.add("DB100.DBW22");
|
| | |
|
| | | if (!messages.isEmpty()) {
|
| | | // 将最后一个消息转换为 short 类型的列表
|
| | | String lastMessage = messages.get(messages.size() - 1);
|
| | | System.out.println("messages:" + messages);
|
| | | String[] parts = lastMessage.split(",");
|
| | | List<Short> messageValues = new ArrayList<>();
|
| | | for (String part : parts) {
|
| | | try {
|
| | | // 使用正则表达式清除非数字字符
|
| | | String cleanedPart = part.replaceAll("[^0-9-]", "");
|
| | | short value = Short.parseShort(cleanedPart.trim());
|
| | | messageValues.add(value);
|
| | | } catch (NumberFormatException e) {
|
| | | // 如果无法解析为 short 类型,则忽略该部分
|
| | |
|
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | private void writeToPlc() {
|
| | | WebSocketServer webSocketServer = WebSocketServer.sessionMap.get("action");
|
| | | if (webSocketServer != null) {
|
| | | List<String> messages = webSocketServer.getMessages();
|
| | |
|
| | | String addressList = "DB100.DBW0";
|
| | |
|
| | | if (!messages.isEmpty()) {
|
| | | // 将最后一个消息转换为整数类型的列表
|
| | | String lastMessage = messages.get(messages.size() - 1);
|
| | | System.out.println("messages:" + messages);
|
| | | String[] parts = lastMessage.split(",");
|
| | | List<Integer> messageValues = new ArrayList<>();
|
| | | for (String part : parts) {
|
| | | try {
|
| | | // 使用正则表达式清除非数字字符
|
| | | String cleanedPart = part.replaceAll("[^0-9-]", "");
|
| | | Integer value = Integer.parseInt(cleanedPart.trim());
|
| | | messageValues.add(value);
|
| | | } catch (NumberFormatException e) {
|
| | | // 如果无法解析为整数类型,则忽略该部分
|
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | // 将消息值写入 PLC
|
| | | // S7control.getinstance().WriteWord(addressList, messageValues);
|
| | | System.out.println("messageValues:" + messageValues);
|
| | | // 清空消息列表
|
| | | messages.clear();
|
| | | }
|
| | |
|
| | | // 将消息值转换为布尔列表
|
| | | List<Boolean> messageBooleans = new ArrayList<>();
|
| | | for (Integer value : messageValues) {
|
| | | messageBooleans.add(value == 0 ? true : false);
|
| | | }
|
| | |
|
| | | // 将布尔列表写入 PLC
|
| | | S7control.getinstance().WriteBit(addressList, messageBooleans);
|
| | | System.out.println("messageValues:" + messageBooleans);
|
| | | System.out.println("addressList:" + addressList);
|
| | |
|
| | | // 清空消息列表
|
| | | webSocketServer.clearMessages();
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | private List<Boolean> paramList() {
|
| | | // 获取参数列表的逻辑
|
| | |
|
| | | return new ArrayList<>(); // 假设返回空列表
|
| | | }
|
| | | } |
| | |
| | | package com.example.springboot.config; |
| | | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.boot.ApplicationArguments; |
| | | import org.springframework.boot.ApplicationRunner; |
| | | import org.springframework.core.annotation.Order; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | |
| | | import com.example.springboot.component.PlcHold; |
| | | import com.example.springboot.component.Plcaction; |
| | | import com.example.springboot.component.PlcParameter; |
| | | |
| | | @Component |
| | | @Order(1) |
| | | public class AppRunnerConfig implements ApplicationRunner{ |
| | | @Override |
| | | public void run(ApplicationArguments args) throws Exception { |
| | | // TODO Auto-generated method stub |
| | | // |
| | | System.out.println("启动完成"); |
| | | |
| | | public class AppRunnerConfig implements ApplicationRunner { |
| | | |
| | | |
| | | new Plcaction().start(); |
| | | @Override |
| | | public void run(ApplicationArguments args) throws Exception { |
| | | // TODO Auto-generated method stub |
| | | // |
| | | System.out.println("启动完成"); |
| | | |
| | | new PlcHold().start(); |
| | | new Plcaction().start(); |
| | | new PlcParameter().start(); |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | #\u6570\u636E\u5E93\u9A71\u52A8 |
| | | spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver |
| | | #\u6570\u636E\u5E93\u8FDE\u63A5\u5730\u5740 |
| | | spring.datasource.url=jdbc:mysql://localhost:3306/canadames?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai |
| | | spring.datasource.url=jdbc:mysql://10.153.19.150:3306/canadames?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai |
| | | #\u6570\u636E\u5E93\u7528\u6237\u540D |
| | | spring.datasource.username=root |
| | | #\u6570\u636E\u5E93\u7528\u6237\u5BC6\u7801 |
| | |
| | | Target Server Version : 80022
|
| | | File Encoding : 65001
|
| | |
|
| | | Date: 30/08/2023 16:14:36
|
| | | Date: 05/09/2023 16:20:45
|
| | | */
|
| | |
|
| | | SET NAMES utf8mb4;
|
| | |
| | | `create_time` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '创建时间',
|
| | | `update_time` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '更新时间',
|
| | | PRIMARY KEY (`id`) USING BTREE
|
| | | ) ENGINE = InnoDB AUTO_INCREMENT = 4 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '商品分类' ROW_FORMAT = Dynamic;
|
| | | ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '商品分类' ROW_FORMAT = Dynamic;
|
| | |
|
| | | -- ----------------------------
|
| | | -- Records of category
|
| | |
| | | `last_product_count_date` date NULL DEFAULT NULL,
|
| | | PRIMARY KEY (`id`) USING BTREE,
|
| | | UNIQUE INDEX `device_id_idx`(`device_id`) USING BTREE
|
| | | ) ENGINE = InnoDB AUTO_INCREMENT = 53 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = DYNAMIC;
|
| | | ) ENGINE = InnoDB AUTO_INCREMENT = 46 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = DYNAMIC;
|
| | |
|
| | | -- ----------------------------
|
| | | -- Records of device
|
| | |
| | | -- Records of menu_list
|
| | | -- ----------------------------
|
| | | INSERT INTO `menu_list` VALUES (1, NULL, '用户管理', 'el-icon-user-solid', 1, '', 1, '2021-11-28 14:30:27', '2021-11-28 15:06:04');
|
| | | INSERT INTO `menu_list` VALUES (2, NULL, '设备管理', 'el-icon-lollipop', 2, '', 1, '2023-08-23 20:11:38', '2023-08-28 08:16:00');
|
| | | INSERT INTO `menu_list` VALUES (2, NULL, '电气管理', 'el-icon-lollipop', 2, '', 1, '2023-08-23 20:11:38', '2023-09-01 16:34:36');
|
| | | INSERT INTO `menu_list` VALUES (5, NULL, '权限管理', 'el-icon-collection-tag', 5, '', 1, '2021-11-28 14:30:27', '2021-11-28 15:06:04');
|
| | | INSERT INTO `menu_list` VALUES (6, NULL, '角色管理', 'el-icon-s-flag', 6, '', 1, '2021-11-28 14:30:27', '2021-11-28 15:06:04');
|
| | | INSERT INTO `menu_list` VALUES (7, 1, '用户列表', '', 7, 'user', 1, '2021-11-28 14:30:27', '2021-11-28 15:06:04');
|
| | | INSERT INTO `menu_list` VALUES (11, 5, '权限列表', '', 11, 'power', 1, '2021-11-28 14:30:28', '2021-11-28 15:06:04');
|
| | | INSERT INTO `menu_list` VALUES (12, 6, '角色列表', '', 12, 'role', 1, '2021-11-28 14:30:28', '2021-11-28 15:06:04');
|
| | | INSERT INTO `menu_list` VALUES (49, 2, '报警信息', '', 49, 'device/alarm', 1, '2021-11-28 14:30:28', '2023-08-25 14:05:05');
|
| | | INSERT INTO `menu_list` VALUES (51, 2, 'I/O状态', NULL, 51, 'device/iostate', 1, '2023-08-25 13:29:13', '2023-08-25 14:07:04');
|
| | | INSERT INTO `menu_list` VALUES (52, 2, '开关控制', NULL, 52, 'device/control', 1, '2023-08-25 13:29:18', '2023-08-25 14:06:48');
|
| | | INSERT INTO `menu_list` VALUES (53, 2, '参数下发', NULL, 53, 'device/parameter', 1, '2023-08-25 13:29:22', '2023-08-25 14:06:33');
|
| | | INSERT INTO `menu_list` VALUES (49, 2, '报警信息', '', 49, 'Electrical/Action', 1, '2021-11-28 14:30:28', '2023-09-01 16:33:29');
|
| | | INSERT INTO `menu_list` VALUES (51, 2, 'I/O状态', NULL, 51, 'Electrical/State', 1, '2023-08-25 13:29:13', '2023-09-01 16:34:03');
|
| | | INSERT INTO `menu_list` VALUES (52, 2, '开关控制', NULL, 52, 'Electrical/Sign', 1, '2023-08-25 13:29:18', '2023-09-01 16:33:48');
|
| | | INSERT INTO `menu_list` VALUES (53, 2, '参数下发', NULL, 53, 'Electrical/Parameter', 1, '2023-08-25 13:29:22', '2023-09-01 16:32:29');
|
| | |
|
| | | -- ----------------------------
|
| | | -- Table structure for permission
|
| | |
| | | `create_time` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '创建时间',
|
| | | `update_time` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '更新时间',
|
| | | PRIMARY KEY (`id`) USING BTREE
|
| | | ) ENGINE = InnoDB AUTO_INCREMENT = 52 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '角色和菜单关联表' ROW_FORMAT = Dynamic;
|
| | | ) ENGINE = InnoDB AUTO_INCREMENT = 54 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '角色和菜单关联表' ROW_FORMAT = Dynamic;
|
| | |
|
| | | -- ----------------------------
|
| | | -- Records of role_menu_list
|
| | |
| | | INSERT INTO `role_menu_list` VALUES (47, 2, 60, 1, '2023-08-28 15:14:27', '2023-08-28 15:53:34');
|
| | | INSERT INTO `role_menu_list` VALUES (50, 2, 2, 1, '2023-08-28 15:14:27', '2023-08-28 15:53:34');
|
| | | INSERT INTO `role_menu_list` VALUES (51, 2, 49, 1, '2023-08-28 15:14:27', '2023-08-28 15:53:34');
|
| | | INSERT INTO `role_menu_list` VALUES (52, 2, 1, 1, '2023-08-30 16:28:57', '2023-08-30 16:28:57');
|
| | | INSERT INTO `role_menu_list` VALUES (53, 2, 7, 1, '2023-08-30 16:29:05', '2023-08-30 16:29:05');
|
| | |
|
| | | -- ----------------------------
|
| | | -- Table structure for role_permission
|
| | |
| | | `create_time` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '创建时间',
|
| | | `update_time` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '更新时间',
|
| | | PRIMARY KEY (`id`) USING BTREE
|
| | | ) ENGINE = InnoDB AUTO_INCREMENT = 74 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '角色权限' ROW_FORMAT = Dynamic;
|
| | | ) ENGINE = InnoDB AUTO_INCREMENT = 76 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '角色权限' ROW_FORMAT = Dynamic;
|
| | |
|
| | | -- ----------------------------
|
| | | -- Records of role_permission
|
| | |
| | | INSERT INTO `role_permission` VALUES (43, 1, 29, 1, '2023-08-24 08:56:15', '2023-08-24 08:56:15');
|
| | | INSERT INTO `role_permission` VALUES (44, 1, 31, 1, '2023-08-24 08:56:23', '2023-08-24 08:56:23');
|
| | | INSERT INTO `role_permission` VALUES (53, 2, 2, 1, '2021-11-28 15:07:54', '2021-11-28 15:07:54');
|
| | | INSERT INTO `role_permission` VALUES (54, 2, 3, 1, '2021-11-28 15:07:54', '2021-11-28 15:07:54');
|
| | | INSERT INTO `role_permission` VALUES (54, 2, 3, 0, '2021-11-28 15:07:54', '2021-11-28 15:07:54');
|
| | | INSERT INTO `role_permission` VALUES (56, 2, 8, 1, '2021-11-28 15:07:54', '2021-11-28 15:07:54');
|
| | | INSERT INTO `role_permission` VALUES (57, 2, 9, 1, '2021-11-28 15:07:54', '2021-11-28 15:07:54');
|
| | | INSERT INTO `role_permission` VALUES (58, 2, 10, 1, '2021-11-28 15:07:54', '2021-11-28 15:07:54');
|
| | |
| | | INSERT INTO `role_permission` VALUES (63, 2, 17, 1, '2021-11-28 15:07:54', '2021-11-28 15:07:54');
|
| | | INSERT INTO `role_permission` VALUES (64, 2, 18, 1, '2021-11-28 15:07:54', '2021-11-28 15:07:54');
|
| | | INSERT INTO `role_permission` VALUES (65, 2, 19, 1, '2021-11-28 15:07:54', '2021-11-28 15:07:54');
|
| | | INSERT INTO `role_permission` VALUES (66, 2, 20, 1, '2021-11-28 15:07:54', '2021-11-28 15:07:54');
|
| | | INSERT INTO `role_permission` VALUES (66, 2, 20, 0, '2021-11-28 15:07:54', '2021-11-28 15:07:54');
|
| | | INSERT INTO `role_permission` VALUES (67, 2, 22, 1, '2021-11-28 15:07:54', '2021-11-28 15:07:54');
|
| | | INSERT INTO `role_permission` VALUES (68, 2, 25, 1, '2021-11-28 15:07:54', '2021-11-28 15:07:54');
|
| | | INSERT INTO `role_permission` VALUES (69, 2, 26, 1, '2021-11-28 15:07:54', '2021-11-28 15:07:54');
|
| | |
| | | INSERT INTO `role_permission` VALUES (71, 2, 28, 1, '2021-11-28 15:07:54', '2021-11-28 15:07:54');
|
| | | INSERT INTO `role_permission` VALUES (72, 2, 30, 1, '2023-08-24 08:55:34', '2023-08-24 08:55:34');
|
| | | INSERT INTO `role_permission` VALUES (73, 2, 29, 1, '2023-08-24 08:56:15', '2023-08-28 15:33:14');
|
| | | INSERT INTO `role_permission` VALUES (74, 2, 1, 1, '2023-08-30 16:29:46', '2023-08-30 16:29:46');
|
| | |
|
| | | -- ----------------------------
|
| | | -- Table structure for storage_rack
|
| | |
| | | -- ----------------------------
|
| | | -- Records of user
|
| | | -- ----------------------------
|
| | | INSERT INTO `user` VALUES (1, 0, '', 0, 1, 'admin', 'b2f0c414a5ffb6944c424bc18ae3a8a0', NULL, NULL, NULL, 1, '2023-08-25 08:58:58', '2023-08-29 16:02:56');
|
| | | INSERT INTO `user` VALUES (1, 0, '', 0, 1, 'admin', 'b2f0c414a5ffb6944c424bc18ae3a8a0', NULL, NULL, NULL, 1, '2023-08-25 08:58:58', '2023-09-05 16:12:28');
|
| | | INSERT INTO `user` VALUES (2, 1, '1-', 1, 2, 'user1', '601b99523f82de29f87771d5f95accdc', 'user1@qq.com', NULL, NULL, 1, '2021-11-28 14:31:39', '2021-11-28 15:09:36');
|
| | | INSERT INTO `user` VALUES (3, 1, '1-', 1, 2, 'user2', 'f403c87893db29eb71b21905b57bbd0d', 'user2@qq.com', NULL, NULL, 1, '2021-11-28 14:31:39', '2021-11-28 15:09:36');
|
| | | INSERT INTO `user` VALUES (8, 1, '1-', 1, 5, 'yyyyy', 'fca7e8e6b2fca165de912bd617c8df3c', '2265557248@qq.com', NULL, NULL, 1, '2023-08-23 20:08:44', '2023-08-23 20:08:44');
|
| | | INSERT INTO `user` VALUES (9, 1, '1-', 1, 1, 'yttttttttttt', '16de30ab81d69e8cc479a05cad599657', '666@qq.com', NULL, NULL, 1, '2023-08-23 20:35:32', '2023-08-23 20:35:32');
|
| | | INSERT INTO `user` VALUES (9, 1, '1-', 1, 1, 'yttttttttttt', 'b2f0c414a5ffb6944c424bc18ae3a8a0', '666@qq.com', NULL, NULL, 1, '2023-08-23 20:35:32', '2023-08-23 20:35:32');
|
| | | INSERT INTO `user` VALUES (10, 1, '1-', 1, 2, '767655555', '500637c0d48b442a3be6d4fce12e0910', NULL, NULL, NULL, 1, '2023-08-23 20:42:58', '2023-08-23 20:42:58');
|
| | | INSERT INTO `user` VALUES (11, 1, '1-', 1, 5, 'uiuyiuy', 'e046c4175152aa3001d2c71c5bc1aee5', '767676767tt@qq.com', NULL, NULL, 1, '2023-08-23 20:43:42', '2023-08-23 20:43:42');
|
| | | INSERT INTO `user` VALUES (13, 1, '1-', 1, 2, 'user3', '500637c0d48b442a3be6d4fce12e0910', '2265557345@qq.com', NULL, NULL, 1, '2023-08-24 09:58:40', '2023-08-24 09:58:40');
|
| | | INSERT INTO `user` VALUES (15, 1, '1-', 1, 2, '99999', 'b2f0c414a5ffb6944c424bc18ae3a8a0', '2267666@qq.com', NULL, NULL, 1, '2023-08-25 09:37:05', '2023-08-28 14:37:27');
|
| | | INSERT INTO `user` VALUES (16, 1, '1-', 1, 1, '5656tttt', 'b2f0c414a5ffb6944c424bc18ae3a8a0', '5454@qq.com', NULL, NULL, 1, '2023-08-28 14:17:44', '2023-08-28 14:37:24');
|
| | | INSERT INTO `user` VALUES (16, 1, '1-', 1, 2, '5656tttt', 'b2f0c414a5ffb6944c424bc18ae3a8a0', '5454@qq.com', NULL, NULL, 1, '2023-08-28 14:17:44', '2023-08-28 14:37:24');
|
| | | INSERT INTO `user` VALUES (17, 1, '1-', 1, 2, '6767ttt', 'b2f0c414a5ffb6944c424bc18ae3a8a0', '225@qq.com', NULL, NULL, 1, '2023-08-28 14:20:05', '2023-08-28 14:23:53');
|
| | | INSERT INTO `user` VALUES (18, 1, '1-', 1, 2, '8989ttt', 'b2f0c414a5ffb6944c424bc18ae3a8a0', '224@qq.com', NULL, NULL, 1, '2023-08-28 14:26:17', '2023-08-28 14:37:22');
|
| | | INSERT INTO `user` VALUES (19, 1, '1-', 1, 2, '8080ttt', 'b2f0c414a5ffb6944c424bc18ae3a8a0', '87@qq.com', NULL, NULL, 1, '2023-08-28 14:34:39', '2023-08-29 16:03:38');
|
| | | INSERT INTO `user` VALUES (19, 1, '1-', 1, 5, '8080ttt', 'b2f0c414a5ffb6944c424bc18ae3a8a0', '87@qq.com', NULL, NULL, 1, '2023-08-28 14:34:39', '2023-08-29 16:03:38');
|
| | |
|
| | | -- ----------------------------
|
| | | -- Procedure structure for Your_Stored_Procedure
|