From fd19536cbf9e5acec9bf7270f3f46037e822827d Mon Sep 17 00:00:00 2001
From: wuyouming666 <2265557248@qq.com>
Date: 星期二, 29 八月 2023 16:44:45 +0800
Subject: [PATCH] 添加菜单折叠自适应宽度 修改密码 修改用户角色 中英文切换全局配置
---
CanadaMes-ui/vue.config.js | 4
CanadaMes-ui/src/views/home/index.vue | 14
CanadaMes-ui/src/router/index.js | 12
CanadaMes-back/src/main/java/MyGenerator.java | 176 ++++++++
CanadaMes-back/src/main/java/com/canadames/service/impl/UserServiceImpl.java | 2
CanadaMes-ui/src/store/store,js | 77 +++
CanadaMes-ui/src/views/user/index.vue | 48 ++
CanadaMes-ui/public/2.ico | 0
CanadaMes-ui/src/layout/index.vue | 72 +++
CanadaMes-ui/package.json | 7
CanadaMes-ui/src/api/user.js | 33 +
CanadaMes-ui/src/views/device/alarm.vue | 291 +-------------
CanadaMes-back/src/main/java/com/canadames/dao/device/DeviceDao.java | 19
CanadaMes-ui/src/main.js | 6
CanadaMes-ui/package-lock.json | 4
CanadaMes-ui/src/App.vue | 5
CanadaMes-ui/src/api/role.js | 2
CanadaMes-ui/src/assets/2.ico | 0
CanadaMes-back/src/main/java/com/canadames/controller/device/DeviceController.java | 43 ++
CanadaMes-back/src/main/java/com/canadames/service/device/impl/DeviceServiceImpl.java | 45 ++
CanadaMes-ui/public/index.html | 2
CanadaMes-back/src/main/java/com/canadames/controller/UserController.java | 73 +++
CanadaMes-ui/src/layout/tag.vue | 91 ++++
CanadaMes-ui/src/lang/locales/zh-CN.json | 3
/dev/null | 0
CanadaMes-back/pom.xml | 19
CanadaMes-back/src/main/java/com/canadames/entity/device/DeviceEntity.java | 61 +++
CanadaMes-back/src/main/java/com/canadames/service/device/DeviceService.java | 15
CanadaMes-ui/src/lang/locales/en-US.json | 3
CanadaMes-back/src/main/resources/com/canadames/dao/DeviceDao.xml | 31 +
30 files changed, 860 insertions(+), 298 deletions(-)
diff --git a/CanadaMes-back/canadames.iml b/CanadaMes-back/canadames.iml
deleted file mode 100644
index 4755f93..0000000
--- a/CanadaMes-back/canadames.iml
+++ /dev/null
@@ -1,141 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
- <component name="FacetManager">
- <facet type="web" name="Web">
- <configuration>
- <webroots />
- <sourceRoots>
- <root url="file://$MODULE_DIR$/src/main/java" />
- <root url="file://$MODULE_DIR$/src/main/resources" />
- </sourceRoots>
- </configuration>
- </facet>
- <facet type="Spring" name="Spring">
- <configuration />
- </facet>
- </component>
- <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
- <output url="file://$MODULE_DIR$/target/classes" />
- <output-test url="file://$MODULE_DIR$/target/test-classes" />
- <content url="file://$MODULE_DIR$">
- <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
- <sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
- <sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
- <excludeFolder url="file://$MODULE_DIR$/target" />
- </content>
- <orderEntry type="inheritedJdk" />
- <orderEntry type="sourceFolder" forTests="false" />
- <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-web:2.3.2.RELEASE" level="project" />
- <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter:2.3.2.RELEASE" level="project" />
- <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot:2.3.2.RELEASE" level="project" />
- <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-logging:2.3.2.RELEASE" level="project" />
- <orderEntry type="library" name="Maven: ch.qos.logback:logback-classic:1.2.3" level="project" />
- <orderEntry type="library" name="Maven: ch.qos.logback:logback-core:1.2.3" level="project" />
- <orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-to-slf4j:2.13.3" level="project" />
- <orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-api:2.13.3" level="project" />
- <orderEntry type="library" name="Maven: org.slf4j:jul-to-slf4j:1.7.30" level="project" />
- <orderEntry type="library" name="Maven: jakarta.annotation:jakarta.annotation-api:1.3.5" level="project" />
- <orderEntry type="library" name="Maven: org.yaml:snakeyaml:1.26" level="project" />
- <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-json:2.3.2.RELEASE" level="project" />
- <orderEntry type="library" name="Maven: com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.11.1" level="project" />
- <orderEntry type="library" name="Maven: com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.11.1" level="project" />
- <orderEntry type="library" name="Maven: com.fasterxml.jackson.module:jackson-module-parameter-names:2.11.1" level="project" />
- <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-tomcat:2.3.2.RELEASE" level="project" />
- <orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-core:9.0.37" level="project" />
- <orderEntry type="library" name="Maven: org.glassfish:jakarta.el:3.0.3" level="project" />
- <orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-websocket:9.0.37" level="project" />
- <orderEntry type="library" name="Maven: org.springframework:spring-web:5.2.8.RELEASE" level="project" />
- <orderEntry type="library" name="Maven: org.springframework:spring-beans:5.2.8.RELEASE" level="project" />
- <orderEntry type="library" name="Maven: org.springframework:spring-webmvc:5.2.8.RELEASE" level="project" />
- <orderEntry type="library" name="Maven: org.springframework:spring-aop:5.2.8.RELEASE" level="project" />
- <orderEntry type="library" name="Maven: org.springframework:spring-context:5.2.8.RELEASE" level="project" />
- <orderEntry type="library" name="Maven: org.springframework:spring-expression:5.2.8.RELEASE" level="project" />
- <orderEntry type="library" scope="RUNTIME" name="Maven: mysql:mysql-connector-java:8.0.21" level="project" />
- <orderEntry type="library" name="Maven: org.projectlombok:lombok:1.18.12" level="project" />
- <orderEntry type="library" scope="TEST" name="Maven: org.springframework.boot:spring-boot-starter-test:2.3.2.RELEASE" level="project" />
- <orderEntry type="library" scope="TEST" name="Maven: org.springframework.boot:spring-boot-test:2.3.2.RELEASE" level="project" />
- <orderEntry type="library" scope="TEST" name="Maven: org.springframework.boot:spring-boot-test-autoconfigure:2.3.2.RELEASE" level="project" />
- <orderEntry type="library" scope="TEST" name="Maven: com.jayway.jsonpath:json-path:2.4.0" level="project" />
- <orderEntry type="library" scope="TEST" name="Maven: net.minidev:json-smart:2.3" level="project" />
- <orderEntry type="library" scope="TEST" name="Maven: net.minidev:accessors-smart:1.2" level="project" />
- <orderEntry type="library" scope="TEST" name="Maven: org.ow2.asm:asm:5.0.4" level="project" />
- <orderEntry type="library" scope="TEST" name="Maven: jakarta.xml.bind:jakarta.xml.bind-api:2.3.3" level="project" />
- <orderEntry type="library" scope="TEST" name="Maven: jakarta.activation:jakarta.activation-api:1.2.2" level="project" />
- <orderEntry type="library" scope="TEST" name="Maven: org.assertj:assertj-core:3.16.1" level="project" />
- <orderEntry type="library" scope="TEST" name="Maven: org.hamcrest:hamcrest:2.2" level="project" />
- <orderEntry type="library" scope="TEST" name="Maven: org.junit.jupiter:junit-jupiter:5.6.2" level="project" />
- <orderEntry type="library" scope="TEST" name="Maven: org.junit.jupiter:junit-jupiter-api:5.6.2" level="project" />
- <orderEntry type="library" scope="TEST" name="Maven: org.opentest4j:opentest4j:1.2.0" level="project" />
- <orderEntry type="library" scope="TEST" name="Maven: org.junit.platform:junit-platform-commons:1.6.2" level="project" />
- <orderEntry type="library" scope="TEST" name="Maven: org.junit.jupiter:junit-jupiter-params:5.6.2" level="project" />
- <orderEntry type="library" scope="TEST" name="Maven: org.junit.jupiter:junit-jupiter-engine:5.6.2" level="project" />
- <orderEntry type="library" scope="TEST" name="Maven: org.junit.vintage:junit-vintage-engine:5.6.2" level="project" />
- <orderEntry type="library" scope="TEST" name="Maven: org.apiguardian:apiguardian-api:1.1.0" level="project" />
- <orderEntry type="library" scope="TEST" name="Maven: org.junit.platform:junit-platform-engine:1.6.2" level="project" />
- <orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.13" level="project" />
- <orderEntry type="library" scope="TEST" name="Maven: org.mockito:mockito-core:3.3.3" level="project" />
- <orderEntry type="library" name="Maven: net.bytebuddy:byte-buddy:1.10.13" level="project" />
- <orderEntry type="library" scope="TEST" name="Maven: net.bytebuddy:byte-buddy-agent:1.10.13" level="project" />
- <orderEntry type="library" scope="TEST" name="Maven: org.objenesis:objenesis:2.6" level="project" />
- <orderEntry type="library" scope="TEST" name="Maven: org.mockito:mockito-junit-jupiter:3.3.3" level="project" />
- <orderEntry type="library" scope="TEST" name="Maven: org.skyscreamer:jsonassert:1.5.0" level="project" />
- <orderEntry type="library" scope="TEST" name="Maven: com.vaadin.external.google:android-json:0.0.20131108.vaadin1" level="project" />
- <orderEntry type="library" name="Maven: org.springframework:spring-core:5.2.8.RELEASE" level="project" />
- <orderEntry type="library" name="Maven: org.springframework:spring-jcl:5.2.8.RELEASE" level="project" />
- <orderEntry type="library" scope="TEST" name="Maven: org.springframework:spring-test:5.2.8.RELEASE" level="project" />
- <orderEntry type="library" scope="TEST" name="Maven: org.xmlunit:xmlunit-core:2.7.0" level="project" />
- <orderEntry type="library" name="Maven: cn.hutool:hutool-all:5.5.4" level="project" />
- <orderEntry type="library" name="Maven: org.hibernate.validator:hibernate-validator:6.1.5.Final" level="project" />
- <orderEntry type="library" name="Maven: jakarta.validation:jakarta.validation-api:2.0.2" level="project" />
- <orderEntry type="library" name="Maven: org.jboss.logging:jboss-logging:3.4.1.Final" level="project" />
- <orderEntry type="library" name="Maven: com.fasterxml:classmate:1.5.1" level="project" />
- <orderEntry type="library" name="Maven: io.jsonwebtoken:jjwt-api:0.10.7" level="project" />
- <orderEntry type="library" scope="RUNTIME" name="Maven: io.jsonwebtoken:jjwt-impl:0.10.7" level="project" />
- <orderEntry type="library" scope="RUNTIME" name="Maven: io.jsonwebtoken:jjwt-jackson:0.10.7" level="project" />
- <orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-databind:2.11.1" level="project" />
- <orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-annotations:2.11.1" level="project" />
- <orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-core:2.11.1" level="project" />
- <orderEntry type="library" name="Maven: org.apache.shiro:shiro-spring-boot-starter:1.5.3" level="project" />
- <orderEntry type="library" name="Maven: org.apache.shiro:shiro-spring:1.5.3" level="project" />
- <orderEntry type="library" name="Maven: org.apache.shiro:shiro-core:1.5.3" level="project" />
- <orderEntry type="library" name="Maven: org.apache.shiro:shiro-lang:1.5.3" level="project" />
- <orderEntry type="library" name="Maven: org.apache.shiro:shiro-cache:1.5.3" level="project" />
- <orderEntry type="library" name="Maven: org.apache.shiro:shiro-crypto-hash:1.5.3" level="project" />
- <orderEntry type="library" name="Maven: org.apache.shiro:shiro-crypto-core:1.5.3" level="project" />
- <orderEntry type="library" name="Maven: org.apache.shiro:shiro-crypto-cipher:1.5.3" level="project" />
- <orderEntry type="library" name="Maven: org.apache.shiro:shiro-config-core:1.5.3" level="project" />
- <orderEntry type="library" name="Maven: org.apache.shiro:shiro-config-ogdl:1.5.3" level="project" />
- <orderEntry type="library" name="Maven: commons-beanutils:commons-beanutils:1.9.4" level="project" />
- <orderEntry type="library" name="Maven: commons-collections:commons-collections:3.2.2" level="project" />
- <orderEntry type="library" name="Maven: org.apache.shiro:shiro-event:1.5.3" level="project" />
- <orderEntry type="library" name="Maven: org.apache.shiro:shiro-web:1.5.3" level="project" />
- <orderEntry type="library" name="Maven: org.owasp.encoder:encoder:1.2.2" level="project" />
- <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-autoconfigure:2.3.2.RELEASE" level="project" />
- <orderEntry type="library" name="Maven: com.baomidou:mybatis-plus-boot-starter:3.2.0" level="project" />
- <orderEntry type="library" name="Maven: com.baomidou:mybatis-plus:3.2.0" level="project" />
- <orderEntry type="library" name="Maven: com.baomidou:mybatis-plus-extension:3.2.0" level="project" />
- <orderEntry type="library" name="Maven: com.baomidou:mybatis-plus-core:3.2.0" level="project" />
- <orderEntry type="library" name="Maven: com.baomidou:mybatis-plus-annotation:3.2.0" level="project" />
- <orderEntry type="library" name="Maven: com.github.jsqlparser:jsqlparser:2.1" level="project" />
- <orderEntry type="library" name="Maven: org.mybatis:mybatis:3.5.2" level="project" />
- <orderEntry type="library" name="Maven: org.mybatis:mybatis-spring:2.0.2" level="project" />
- <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-jdbc:2.3.2.RELEASE" level="project" />
- <orderEntry type="library" name="Maven: com.zaxxer:HikariCP:3.4.5" level="project" />
- <orderEntry type="library" name="Maven: org.springframework:spring-jdbc:5.2.8.RELEASE" level="project" />
- <orderEntry type="library" name="Maven: org.springframework:spring-tx:5.2.8.RELEASE" level="project" />
- <orderEntry type="library" name="Maven: io.springfox:springfox-swagger2:2.9.2" level="project" />
- <orderEntry type="library" name="Maven: io.swagger:swagger-annotations:1.5.20" level="project" />
- <orderEntry type="library" name="Maven: io.swagger:swagger-models:1.5.20" level="project" />
- <orderEntry type="library" name="Maven: io.springfox:springfox-spi:2.9.2" level="project" />
- <orderEntry type="library" name="Maven: io.springfox:springfox-core:2.9.2" level="project" />
- <orderEntry type="library" name="Maven: io.springfox:springfox-schema:2.9.2" level="project" />
- <orderEntry type="library" name="Maven: io.springfox:springfox-swagger-common:2.9.2" level="project" />
- <orderEntry type="library" name="Maven: io.springfox:springfox-spring-web:2.9.2" level="project" />
- <orderEntry type="library" name="Maven: com.google.guava:guava:20.0" level="project" />
- <orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.30" level="project" />
- <orderEntry type="library" name="Maven: org.springframework.plugin:spring-plugin-core:1.2.0.RELEASE" level="project" />
- <orderEntry type="library" name="Maven: org.springframework.plugin:spring-plugin-metadata:1.2.0.RELEASE" level="project" />
- <orderEntry type="library" name="Maven: org.mapstruct:mapstruct:1.2.0.Final" level="project" />
- <orderEntry type="library" name="Maven: io.springfox:springfox-swagger-ui:2.9.2" level="project" />
- </component>
-</module>
\ No newline at end of file
diff --git a/CanadaMes-back/pom.xml b/CanadaMes-back/pom.xml
index 171cf40..037d719 100644
--- a/CanadaMes-back/pom.xml
+++ b/CanadaMes-back/pom.xml
@@ -36,6 +36,7 @@
<artifactId>mysql-connector-java</artifactId>
<scope>runtime</scope>
</dependency>
+
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
@@ -78,13 +79,27 @@
<dependency>
<groupId>org.apache.shiro</groupId>
<artifactId>shiro-spring-boot-starter</artifactId>
- <version>1.5.3</version>
+ <version>1.8.0</version>
</dependency>
<!--mybatis-plus-->
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-boot-starter</artifactId>
<version>3.2.0</version>
+ </dependency>
+ <dependency>
+ <groupId>com.baomidou</groupId>
+ <artifactId>mybatis-plus-core</artifactId>
+ <version>3.2.0</version>
+ </dependency>
+ <dependency>
+ <groupId>com.baomidou</groupId>
+ <artifactId>mybatis-plus-generator</artifactId>
+ <version>3.2.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-freemarker</artifactId>
</dependency>
<!-- swagger -->
<dependency>
@@ -98,6 +113,8 @@
<artifactId>springfox-swagger-ui</artifactId>
<version>2.9.2</version>
</dependency>
+
+
</dependencies>
<build>
diff --git a/CanadaMes-back/src/main/java/MyGenerator.java b/CanadaMes-back/src/main/java/MyGenerator.java
new file mode 100644
index 0000000..58db635
--- /dev/null
+++ b/CanadaMes-back/src/main/java/MyGenerator.java
@@ -0,0 +1,176 @@
+
+
+import com.baomidou.mybatisplus.core.toolkit.StringPool;
+import com.baomidou.mybatisplus.generator.AutoGenerator;
+import com.baomidou.mybatisplus.generator.InjectionConfig;
+import com.baomidou.mybatisplus.generator.config.*;
+import com.baomidou.mybatisplus.generator.config.po.TableInfo;
+import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy;
+import com.baomidou.mybatisplus.generator.engine.FreemarkerTemplateEngine;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * mybatis-plus-generator浠g爜鐢熸垚鍣�
+ * 淇敼閰嶇疆鍚庣洿鎺ヨ繍琛宮ain鏂规硶鍗冲彲
+ */
+public class MyGenerator {
+
+ /** 鏁版嵁婧愰厤缃�*/
+ private static final String jdbc = "jdbc:mysql://localhost:3306/canadames?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai";
+ private static final String driverName = "com.mysql.cj.jdbc.Driver";
+
+ private static final String username = "root";
+ private static final String password = "beibo.123/";
+ /** 鍖呭悕*/
+ private static final String moduleName = "device";
+ /** 琛ㄥ悕鍓嶇紑*/
+ private static final String beginName = "device";
+ /** 闇�瑕佺敓鎴愪唬鐮佺殑琛�*/
+ private static final String [] tables = new String[]{"device"};
+
+
+
+
+ public static void main(String[] args) {
+
+ // 瀹樻柟缃戠珯锛歨ttps://baomidou.com/pages/d357af/#%E8%87%AA%E5%AE%9A%E4%B9%89%E5%B1%9E%E6%80%A7%E6%B3%A8%E5%85%A5
+
+ // 鍙傝�冪綉绔欙細https://blog.csdn.net/kinghmj01/article/details/97748509
+
+ // 浠g爜鐢熸垚鍣�
+ AutoGenerator mpg = new AutoGenerator();
+
+ // 鍏ㄥ眬閰嶇疆
+ GlobalConfig gc = new GlobalConfig();
+ // 褰撳墠椤圭洰璺緞
+ String projectPath = System.getProperty("user.dir");
+ // 褰撳墠椤圭洰鐨勪笅鐨勮矾寰�
+ gc.setOutputDir(projectPath + "/src/main/java");
+ // 浣滆��
+ gc.setAuthor("yyq");
+ // 鏄惁鎵撳紑杈撳嚭鐩綍 榛樿涓簍rue
+ gc.setOpen(false);
+ // 瀹炰綋灞炴�� Swagger2 娉ㄨВ
+ gc.setSwagger2(true);
+
+ // 鑷畾涔夋枃浠跺懡鍚嶏紝娉ㄦ剰 %s 浼氳嚜鍔ㄥ~鍏呰〃瀹炰綋灞炴�э紒
+ gc.setControllerName("%sController");
+ gc.setServiceName("%sService");
+ gc.setServiceImplName("%sServiceImpl");
+ gc.setMapperName("%sDao");
+ gc.setEntityName("%sEntity");
+ mpg.setGlobalConfig(gc);
+
+ // 鏁版嵁婧愰厤缃�
+ DataSourceConfig dsc = new DataSourceConfig();
+ // dsc.setSchemaName("public");
+ dsc.setUrl(jdbc);
+ dsc.setDriverName(driverName);
+ dsc.setUsername(username);
+ dsc.setPassword(password);
+ mpg.setDataSource(dsc);
+
+ // 璁剧疆鍖呭悕
+ PackageConfig pc = new PackageConfig();
+ // 鐢ㄤ簬鍖呭悕銆佽〃鍚嶅墠缂�
+ //pc.setModuleName(moduleName);
+ // 鐢熸垚鍒伴偅浜涘寘涓� 濡� com.modules涓诲寘涓嬬殑 controller.sys.TestController
+ pc.setParent("com.canadames");
+ pc.setController("controller."+moduleName);
+ pc.setService("service."+moduleName);
+ pc.setServiceImpl("service."+moduleName+".impl");
+ pc.setMapper("dao."+moduleName);
+ pc.setEntity("entity."+moduleName);
+ mpg.setPackageInfo(pc);
+
+ // 鑷畾涔夐厤缃�
+ InjectionConfig cfg = new InjectionConfig() {
+ @Override
+ public void initMap() {
+ // to do nothing
+ }
+ };
+
+ // 濡傛灉妯℃澘寮曟搸鏄� freemarker
+ String templatePath = "/templates/mapper.xml.ftl";
+ // 濡傛灉妯℃澘寮曟搸鏄� velocity
+ // String templatePath = "/templates/mapper.xml.vm";
+
+ // 鑷畾涔夎緭鍑洪厤缃�
+ List<FileOutConfig> focList = new ArrayList<>();
+ // 鑷畾涔夐厤缃細琚紭鍏堣緭鍑�
+ focList.add(new FileOutConfig(templatePath) {
+ @Override
+ public String outputFile(TableInfo tableInfo) {
+ // 鑷畾涔夎緭鍑烘枃浠跺悕 锛� 濡傛灉浣� Entity 璁剧疆浜嗗墠鍚庣紑銆佹澶勬敞鎰� xml 鐨勫悕绉颁細璺熺潃鍙戠敓鍙樺寲锛侊紒
+ return projectPath + "/src/main/resources/mapper/" + moduleName + "/" + tableInfo.getEntityName() + "Mapper" + StringPool.DOT_XML;
+ }
+ });
+ /*
+ cfg.setFileCreate(new IFileCreate() {
+ @Override
+ public boolean isCreate(ConfigBuilder configBuilder, FileType fileType, String filePath) {
+ // 鍒ゆ柇鑷畾涔夋枃浠跺す鏄惁闇�瑕佸垱寤�
+ checkDir("璋冪敤榛樿鏂规硶鍒涘缓鐨勭洰褰曪紝鑷畾涔夌洰褰曠敤");
+ if (fileType == FileType.MAPPER) {
+ // 宸茬粡鐢熸垚 mapper 鏂囦欢鍒ゆ柇瀛樺湪锛屼笉鎯抽噸鏂扮敓鎴愯繑鍥� false
+ return !new File(filePath).exists();
+ }
+ // 鍏佽鐢熸垚妯℃澘鏂囦欢
+ return true;
+ }
+ });
+ */
+ cfg.setFileOutConfigList(focList);
+ mpg.setCfg(cfg);
+
+ // 閰嶇疆妯℃澘
+ TemplateConfig templateConfig = new TemplateConfig();
+
+ // 閰嶇疆鑷畾涔夎緭鍑烘ā鏉�
+ //鎸囧畾鑷畾涔夋ā鏉胯矾寰勶紝娉ㄦ剰涓嶈甯︿笂.ftl/.vm, 浼氭牴鎹娇鐢ㄧ殑妯℃澘寮曟搸鑷姩璇嗗埆
+ // templateConfig.setEntity("templates/entity2.java");
+ // templateConfig.setService();
+ // templateConfig.setController();
+
+ templateConfig.setXml(null);
+ mpg.setTemplate(templateConfig);
+
+ // 绛栫暐閰嶇疆
+ StrategyConfig strategy = new StrategyConfig();
+
+ //闇�瑕佺敓鎴愮殑琛�
+ strategy.setInclude(tables);
+ strategy.setControllerMappingHyphenStyle(true);
+ //绫诲悕鐢熸垚绛栫暐锛氶┘宄板懡鍚�
+ strategy.setNaming(NamingStrategy.underline_to_camel);
+ //瀛楁鍚嶇敓鎴愭柟寮忥細椹煎嘲鍛藉悕
+ strategy.setColumnNaming(NamingStrategy.underline_to_camel);
+ // 琛ㄥ墠缂�
+ strategy.setTablePrefix(beginName+"_");
+
+ // 鍐欎簬鐖剁被涓殑鍏叡瀛楁锛堝湪鐖剁被涓凡缁忔湁鐨勪笉闇�瑕佺敓鎴愮殑瀛楁锛�
+ strategy.setSuperEntityColumns("id", "updateTime", "createTime");
+ // 姣忓眰鐨勭户鎵匡紙涓嶉渶瑕佸彲涓嶈缃級
+// strategy.setSuperControllerClass("com.common.controller.MyController");
+ strategy.setSuperServiceClass("com.baomidou.mybatisplus.extension.service.IService");
+ strategy.setSuperServiceImplClass("com.baomidou.mybatisplus.extension.service.impl.ServiceImpl");
+ strategy.setSuperMapperClass("com.baomidou.mybatisplus.core.mapper.BaseMapper");
+ //缁ф壙鐨勫睘鎬х埗绫�
+// strategy.setSuperEntityClass("com.common.entity.MyEntity");
+ strategy.setEntityLombokModel(true);
+ strategy.setRestControllerStyle(true);
+
+ mpg.setStrategy(strategy);
+
+ mpg.setTemplateEngine(new FreemarkerTemplateEngine());
+
+ mpg.execute();
+ }
+
+
+
+}
+
diff --git a/CanadaMes-back/src/main/java/com/canadames/controller/UserController.java b/CanadaMes-back/src/main/java/com/canadames/controller/UserController.java
index e4f66c6..35caaa8 100644
--- a/CanadaMes-back/src/main/java/com/canadames/controller/UserController.java
+++ b/CanadaMes-back/src/main/java/com/canadames/controller/UserController.java
@@ -11,6 +11,7 @@
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.SecurityUtils;
+import org.apache.shiro.authz.annotation.RequiresAuthentication;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.apache.shiro.authz.annotation.RequiresRoles;
import org.apache.shiro.crypto.hash.SimpleHash;
@@ -22,6 +23,8 @@
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
+import java.util.Map;
+
@RestController
@Slf4j
@RequestMapping("/api/user")
@@ -29,6 +32,46 @@
public class UserController {
@Autowired
private UserService userService;
+
+
+ @ApiOperation(value = "淇敼瀵嗙爜")
+ @PostMapping("/changePassword")
+ @RequiresAuthentication
+ public Result changePassword(@RequestBody Map<String, String> request) {
+ User currentUser = SecurityUtil.getCurrentUser();
+ String oldPassword = request.get("oldPassword");
+ String newPassword = request.get("newPassword");
+
+ // 鏍¢獙鏃у瘑鐮佹槸鍚︽纭�
+ if (!verifyPassword(currentUser, oldPassword)) {
+ return Result.fail("鏃у瘑鐮佷笉姝g‘");
+ }
+
+ // 鏇存柊瀵嗙爜
+ updatePassword(currentUser, newPassword);
+
+ return Result.success("瀵嗙爜淇敼鎴愬姛");
+ }
+ /**
+ * 楠岃瘉瀵嗙爜鏄惁姝g‘
+ */
+ private boolean verifyPassword(User user, String password) {
+ Object salt = ByteSource.Util.bytes(SystemConstant.JWT_SECRET_KEY);
+ String md5 = new SimpleHash("MD5", password, salt, 1024).toHex();
+ return md5.equals(user.getPassword());
+ }
+
+ /**
+ * 鏇存柊瀵嗙爜
+ */
+ private void updatePassword(User user, String newPassword) {
+ Object salt = ByteSource.Util.bytes(SystemConstant.JWT_SECRET_KEY);
+ String md5 = new SimpleHash("MD5", newPassword, salt, 1024).toHex();
+ user.setPassword(md5);
+ userService.saveOrUpdate(user);
+ }
+
+
@ApiOperation(value = "鍒嗛〉鏌ヨ鐢ㄦ埛")
@GetMapping("/selectPage")
@@ -38,7 +81,7 @@
return Result.success(userService.selectPage(userVO));
}
- @ApiOperation(value = "娣诲姞鎴栨垨鑰呬慨鏀圭敤鎴�")
+ @ApiOperation(value = "娣诲姞鎴栦慨鏀圭敤鎴�")
@PostMapping("/saveOrUpdate")
@RequiresRoles({"admin"})
@RequiresPermissions({"user:update", "user:add"})
@@ -46,14 +89,27 @@
if ("admin".equals(user.getUsername())) {
return Result.fail("绠$悊鍛樹笉鍙互琚鐢�");
}
- Integer count = userService.lambdaQuery().eq(User::getUsername, user.getUsername())
+ Integer count = userService.lambdaQuery()
+ .eq(User::getUsername, user.getUsername())
.ne(user.getId() != null, User::getId, user.getId())
.count();
- if (count > 0) return Result.fail("鐢ㄦ埛鍚嶅凡瀛樺湪");
- // 閫氳繃shiro榛樿鐨勫姞瀵嗗伐鍏风被涓烘敞鍐岀敤鎴风殑瀵嗙爜杩涜鍔犲瘑
- Object salt = ByteSource.Util.bytes(SystemConstant.JWT_SECRET_KEY);
- String md5 = new SimpleHash("MD5", user.getPassword(), salt, 1024).toHex();
- user.setPassword(md5);
+ if (count > 0) {
+ return Result.fail("鐢ㄦ埛鍚嶅凡瀛樺湪");
+ }
+
+ // 濡傛灉瀵嗙爜鏈慨鏀癸紝鍒欎笉杩涜鍔犲瘑鎿嶄綔
+ if (user.getId() != null) {
+ User existingUser = userService.getById(user.getId());
+ if (existingUser != null && existingUser.getPassword().equals(user.getPassword())) {
+ user.setPassword(existingUser.getPassword());
+ } else {
+ // 瀵嗙爜鍙戠敓浜嗗彉鍖栵紝杩涜鍔犲瘑鎿嶄綔
+ Object salt = ByteSource.Util.bytes(SystemConstant.JWT_SECRET_KEY);
+ String md5 = new SimpleHash("MD5", user.getPassword(), salt, 1024).toHex();
+ user.setPassword(md5);
+ }
+ }
+
userService.saveOrUpdate(user);
return Result.success();
}
@@ -86,4 +142,7 @@
SecurityUtils.getSubject().logout();
return Result.success("娉ㄩ攢鎴愬姛");
}
+
+ private class UpdatePasswordRequest {
+ }
}
\ No newline at end of file
diff --git a/CanadaMes-back/src/main/java/com/canadames/controller/device/DeviceController.java b/CanadaMes-back/src/main/java/com/canadames/controller/device/DeviceController.java
new file mode 100644
index 0000000..7e57de9
--- /dev/null
+++ b/CanadaMes-back/src/main/java/com/canadames/controller/device/DeviceController.java
@@ -0,0 +1,43 @@
+package com.canadames.controller.device;
+
+
+
+import com.canadames.entity.device.DeviceEntity;
+import com.canadames.entity.vo.Result;
+import com.canadames.service.device.DeviceService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+@RestController
+@RequestMapping("/api/device") // 淇敼璇锋眰璺緞涓� "/api/device"
+public class DeviceController {
+
+ private final DeviceService deviceService;
+
+ @Autowired
+ public DeviceController(DeviceService deviceService) {
+ this.deviceService = deviceService;
+ }
+
+ @GetMapping("/getAllDevices") // 淇敼鎺ュ彛璺緞涓� "/getAllDevices"
+ public Result getAllDevices() {
+ List<DeviceEntity> devices = deviceService.getAllDevices();
+ return Result.success(devices);
+ }
+
+ @PostMapping("/updateDeviceName") // 淇敼鎺ュ彛璺緞涓� "/updateDeviceName"
+ public Result updateDeviceName(@RequestBody DeviceEntity device) {
+ deviceService.updateDeviceName(device);
+ return Result.success();
+ }
+ @PostMapping("/call-stored-proc")
+ public Result callStoredProc(@RequestBody DeviceEntity device) {
+ List<DeviceEntity> result = deviceService.callStoredProc(device); // 鑾峰彇澶氳鏌ヨ缁撴灉
+ return Result.success(result); // 杩斿洖鍖呭惈澶氳缁撴灉鐨� Result 瀵硅薄
+ }
+
+}
+
+
diff --git a/CanadaMes-back/src/main/java/com/canadames/dao/device/DeviceDao.java b/CanadaMes-back/src/main/java/com/canadames/dao/device/DeviceDao.java
new file mode 100644
index 0000000..54af84b
--- /dev/null
+++ b/CanadaMes-back/src/main/java/com/canadames/dao/device/DeviceDao.java
@@ -0,0 +1,19 @@
+package com.canadames.dao.device;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.canadames.entity.User;
+import com.canadames.entity.device.DeviceEntity;
+import org.apache.ibatis.annotations.Mapper;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+
+
+@Mapper
+@Repository
+public interface DeviceDao extends BaseMapper<User> {
+ List<DeviceEntity> selectAllDevices();
+
+ void updateDeviceName(DeviceEntity device);
+ List<DeviceEntity> callStoredProc(DeviceEntity device);
+}
\ No newline at end of file
diff --git a/CanadaMes-back/src/main/java/com/canadames/entity/device/DeviceEntity.java b/CanadaMes-back/src/main/java/com/canadames/entity/device/DeviceEntity.java
new file mode 100644
index 0000000..2137836
--- /dev/null
+++ b/CanadaMes-back/src/main/java/com/canadames/entity/device/DeviceEntity.java
@@ -0,0 +1,61 @@
+package com.canadames.entity.device;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+import java.io.Serializable;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * <p>
+ *
+ * </p>
+ *
+ * @author yyq
+ * @since 2023-08-28
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@TableName("device")
+@ApiModel(value="DeviceEntity瀵硅薄", description="")
+public class DeviceEntity implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ private String deviceId;
+
+ private String createUser;
+ private String msg;
+ private LocalDateTime createTime;
+ private long id;
+ private String deviceName;
+ private String name;
+ private String status;
+
+ private String info;
+
+ private String model;
+
+ private LocalDateTime countTimeFlag;
+
+ private String address;
+
+ private String gps;
+
+ private LocalDate debugTime;
+
+ private LocalDate endTime;
+
+ private String customerName;
+
+ private String customerDeviceName;
+
+ private LocalDate lastProductCountDate;
+
+
+}
diff --git a/CanadaMes-back/src/main/java/com/canadames/entity/vo/deviceVo.java b/CanadaMes-back/src/main/java/com/canadames/entity/vo/deviceVo.java
deleted file mode 100644
index e69de29..0000000
--- a/CanadaMes-back/src/main/java/com/canadames/entity/vo/deviceVo.java
+++ /dev/null
diff --git a/CanadaMes-back/src/main/java/com/canadames/service/device/DeviceService.java b/CanadaMes-back/src/main/java/com/canadames/service/device/DeviceService.java
new file mode 100644
index 0000000..4627796
--- /dev/null
+++ b/CanadaMes-back/src/main/java/com/canadames/service/device/DeviceService.java
@@ -0,0 +1,15 @@
+package com.canadames.service.device;
+
+import com.canadames.entity.device.DeviceEntity;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+@Service
+public interface DeviceService {
+ List<DeviceEntity> getAllDevices();
+
+
+ void updateDeviceName(DeviceEntity device);
+ List<DeviceEntity> callStoredProc(DeviceEntity device); // 淇敼杩斿洖绫诲瀷涓� List<DeviceEntity>
+}
+
diff --git a/CanadaMes-back/src/main/java/com/canadames/service/device/impl/DeviceServiceImpl.java b/CanadaMes-back/src/main/java/com/canadames/service/device/impl/DeviceServiceImpl.java
new file mode 100644
index 0000000..b115604
--- /dev/null
+++ b/CanadaMes-back/src/main/java/com/canadames/service/device/impl/DeviceServiceImpl.java
@@ -0,0 +1,45 @@
+package com.canadames.service.device.impl;
+
+import com.canadames.dao.device.DeviceDao;
+import com.canadames.entity.device.DeviceEntity;
+import com.canadames.service.device.DeviceService;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.ArrayList;
+import java.util.List;
+
+@Service
+
+public class DeviceServiceImpl implements DeviceService {
+
+ private final DeviceDao deviceDao;
+
+ @Autowired
+ public DeviceServiceImpl(DeviceDao deviceDao) {
+ this.deviceDao = deviceDao;
+ }
+
+ @Override
+ public List<DeviceEntity> getAllDevices() {
+ return deviceDao.selectAllDevices();
+ }
+
+ @Override
+ public void updateDeviceName(DeviceEntity device) {
+ deviceDao.updateDeviceName(device);
+ }
+
+ @Override
+ public List<DeviceEntity> callStoredProc(DeviceEntity device) {
+ return performStoredProcQuery(device);
+ }
+
+ private List<DeviceEntity> performStoredProcQuery(DeviceEntity device) {
+ // 鎵ц瀛樺偍杩囩▼鐨勬煡璇㈡搷浣滐紝骞惰繑鍥炵粨鏋滃垪琛�
+ List<DeviceEntity> resultList = new ArrayList<>();
+
+ return deviceDao.callStoredProc(device);
+ }
+}
diff --git a/CanadaMes-back/src/main/java/com/canadames/service/impl/UserServiceImpl.java b/CanadaMes-back/src/main/java/com/canadames/service/impl/UserServiceImpl.java
index 28a7db1..ffa4f99 100644
--- a/CanadaMes-back/src/main/java/com/canadames/service/impl/UserServiceImpl.java
+++ b/CanadaMes-back/src/main/java/com/canadames/service/impl/UserServiceImpl.java
@@ -50,7 +50,7 @@
public List<Long> selectChild(Long id, Boolean bool) {
User user = getById(id);
List<User> users = userDao.selectChild(user.getPath() + user.getId() + "-");
- System.out.println(users);
+
List<Long> ids = users.stream().map(User::getId).collect(Collectors.toList());
if (bool) ids.add(id);
diff --git a/CanadaMes-back/src/main/resources/com/canadames/dao/DeviceDao.xml b/CanadaMes-back/src/main/resources/com/canadames/dao/DeviceDao.xml
new file mode 100644
index 0000000..83a983f
--- /dev/null
+++ b/CanadaMes-back/src/main/resources/com/canadames/dao/DeviceDao.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.canadames.dao.device.DeviceDao">
+
+ <resultMap id="myResultMap" type="com.canadames.entity.device.DeviceEntity">
+ <!-- 鏍规嵁浣犵殑瀹為檯鎯呭喌瀹氫箟缁撴灉鏄犲皠 -->
+ <!-- 绀轰緥涓皢缁撴灉鏄犲皠鍒板疄浣撶被鐨勫睘鎬� -->
+ <id property="id" column="id"/>
+ <result property="name" column="device_name"/>
+ <!-- 鍏朵粬灞炴�ф槧灏� -->
+ </resultMap>
+
+ <select id="selectAllDevices" resultMap="myResultMap">
+ SELECT *
+ FROM device
+ </select>
+
+ <select id="callStoredProc" statementType="CALLABLE" resultMap="myResultMap">
+ { call Your_Stored_Procedure(
+ #{id, mode=IN, jdbcType=VARCHAR},
+ #{name, mode=IN, jdbcType=VARCHAR}
+
+ ) }
+ </select>
+
+ <update id="updateDeviceName" parameterType="com.canadames.entity.device.DeviceEntity">
+ UPDATE device
+ SET device_name = #{name}
+ WHERE id = #{id}
+ </update>
+</mapper>
diff --git a/CanadaMes-ui/README.md b/CanadaMes-ui/README.md
deleted file mode 100644
index 2d9365e..0000000
--- a/CanadaMes-ui/README.md
+++ /dev/null
@@ -1,15 +0,0 @@
-# Authority UI
-
-Spring Boot+Vue.js鏉冮檺绠$悊绯荤粺鍓嶇
-
-# 浣滆��
-
-[jonssonyan](https://jonssonyan.com)
-
-# 寮�鍙戝伐鍏�
-
-1. WebStorm 2019.3.5
-
-# 妗嗘灦/鎶�鏈�
-
-JavaScript / Vue.js / Element / axios
diff --git a/CanadaMes-ui/package-lock.json b/CanadaMes-ui/package-lock.json
index de20b99..5b2ebb5 100644
--- a/CanadaMes-ui/package-lock.json
+++ b/CanadaMes-ui/package-lock.json
@@ -1,11 +1,11 @@
{
- "name": "authority-ui",
+ "name": "canadames-ui",
"version": "0.1.0",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
- "name": "authority-ui",
+ "name": "canadames-ui",
"version": "0.1.0",
"dependencies": {
"axios": "^0.19.2",
diff --git a/CanadaMes-ui/package.json b/CanadaMes-ui/package.json
index a914bce..aba2f90 100644
--- a/CanadaMes-ui/package.json
+++ b/CanadaMes-ui/package.json
@@ -1,5 +1,5 @@
{
- "name": "authority-ui",
+ "name": "canadames-ui",
"version": "0.1.0",
"private": true,
"scripts": {
@@ -14,9 +14,12 @@
"js-cookie": "^3.0.1",
"less": "^3.12.2",
"less-loader": "^6.2.0",
+ "node-sass": "^9.0.0",
+
"vue": "^2.6.11",
"vue-i18n": "^8.26.5",
- "vue-router": "^3.3.4"
+ "vue-router": "^3.3.4",
+
},
"devDependencies": {
"@vue/cli-plugin-babel": "~4.5.0",
diff --git a/CanadaMes-ui/public/2.ico b/CanadaMes-ui/public/2.ico
new file mode 100644
index 0000000..470e6eb
--- /dev/null
+++ b/CanadaMes-ui/public/2.ico
Binary files differ
diff --git a/CanadaMes-ui/public/favicon.ico b/CanadaMes-ui/public/favicon.ico
deleted file mode 100644
index df36fcf..0000000
--- a/CanadaMes-ui/public/favicon.ico
+++ /dev/null
Binary files differ
diff --git a/CanadaMes-ui/public/index.html b/CanadaMes-ui/public/index.html
index 242e7c5..07e4763 100644
--- a/CanadaMes-ui/public/index.html
+++ b/CanadaMes-ui/public/index.html
@@ -4,7 +4,7 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
- <link rel="icon" href="<%= BASE_URL %>favicon.ico">
+ <link rel="icon" href="<%= BASE_URL %>2.ico">
<title>鍖楃幓mes绯荤粺</title>
</head>
<body>
diff --git a/CanadaMes-ui/src/App.vue b/CanadaMes-ui/src/App.vue
index d5a3f36..989ac2a 100644
--- a/CanadaMes-ui/src/App.vue
+++ b/CanadaMes-ui/src/App.vue
@@ -2,6 +2,9 @@
<div id="app">
<!--璺敱鍗犱綅绗�-->
<router-view/>
+ <div class="custom-icon">
+
+ </div>
</div>
</template>
<script>
@@ -10,4 +13,6 @@
}
</script>
<style>
+
+
</style>
diff --git a/CanadaMes-ui/src/api/role.js b/CanadaMes-ui/src/api/role.js
index cd6183e..55da730 100644
--- a/CanadaMes-ui/src/api/role.js
+++ b/CanadaMes-ui/src/api/role.js
@@ -13,6 +13,8 @@
})
}
+
+
/**
* 鏍规嵁id鍒犻櫎瑙掕壊
* @param data
diff --git a/CanadaMes-ui/src/api/user.js b/CanadaMes-ui/src/api/user.js
index 4bb99f2..80a93bf 100644
--- a/CanadaMes-ui/src/api/user.js
+++ b/CanadaMes-ui/src/api/user.js
@@ -25,7 +25,40 @@
data
})
}
+export function test(data) {
+ return request({
+ url: '/api/device/getAllDevices',
+ method: 'get',
+ data
+ })
+}
+export function testup(data) {
+ return request({
+ url: '/api/device/updateDeviceName',
+ method: 'post',
+ data
+ })
+}
+export function call(data) {
+ return request({
+ url: '/api/device/call-stored-proc',
+ method: 'post',
+ data
+ })
+}
+/**
+ * 娉ㄥ唽鏃舵牎楠岀敤鎴峰悕鏄惁瀛樺湪
+ * @param data
+ * @returns {AxiosPromise}
+ */
+export function changePassword(data) {
+ return request({
+ url: '/api/user/changePassword',
+ method: 'post',
+ data
+ })
+}
/**
* 娉ㄥ唽鏃舵牎楠岀敤鎴峰悕鏄惁瀛樺湪
* @param data
diff --git a/CanadaMes-ui/src/assets/2.ico b/CanadaMes-ui/src/assets/2.ico
new file mode 100644
index 0000000..470e6eb
--- /dev/null
+++ b/CanadaMes-ui/src/assets/2.ico
Binary files differ
diff --git a/CanadaMes-ui/src/lang/locales/en-US.json b/CanadaMes-ui/src/lang/locales/en-US.json
index 7491dd0..a8a70e2 100644
--- a/CanadaMes-ui/src/lang/locales/en-US.json
+++ b/CanadaMes-ui/src/lang/locales/en-US.json
@@ -34,5 +34,6 @@
"langConfirm": "Confirm",
"langEditUserTitle": "Edit User",
"northglassMESsystem":"NorthGlassMesSystem",
- "exit":"exit"
+ "exit":"exit",
+ "changePassword":"changePassword"
}
\ No newline at end of file
diff --git a/CanadaMes-ui/src/lang/locales/zh-CN.json b/CanadaMes-ui/src/lang/locales/zh-CN.json
index 15860c4..0f358a8 100644
--- a/CanadaMes-ui/src/lang/locales/zh-CN.json
+++ b/CanadaMes-ui/src/lang/locales/zh-CN.json
@@ -35,6 +35,7 @@
"langConfirm": "纭畾",
"langEditUserTitle": "淇敼鐢ㄦ埛",
"northglassMESsystem":"鍖楃幓MES绯荤粺",
- "exit":"閫�鍑�"
+ "exit":"閫�鍑�",
+ "changePassword":"淇敼瀵嗙爜"
}
\ No newline at end of file
diff --git a/CanadaMes-ui/src/layout/index.vue b/CanadaMes-ui/src/layout/index.vue
index 55e8fcc..0c35235 100644
--- a/CanadaMes-ui/src/layout/index.vue
+++ b/CanadaMes-ui/src/layout/index.vue
@@ -43,7 +43,10 @@
<el-container>
<el-header class="header-container">
-
+ <!-- <div class="tagContainer">
+ <tag></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">
@@ -56,8 +59,27 @@
</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>
+ <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>
@@ -67,16 +89,26 @@
</el-container>
</template>
+
+
<script>
import {selectList} from '../api/menuList'
+import {changePassword} from '../api/user'
import {removeToken} from "../utils/auth";
import LanguageMixin from '../lang/LanguageMixin'
+// import Tag from '../layout/tag.vue';
export default {
name: "Layout",
mixins: [LanguageMixin],
data() {
return {
+ dialogVisible: false,
+ formData: {
+ oldPassword: '',
+ newPassword: '',
+ confirmPassword: ''
+ },
menuList: [],
isCollapse: false,
@@ -88,6 +120,9 @@
}
}
},
+ // components: {
+ // Tag
+ // },
created() {
selectList(this.menuListForm).then(res => {
this.menuList = res.data
@@ -105,6 +140,35 @@
removeToken()
this.$router.push('/login')
},
+
+
+
+ showChangePasswordDialog() {
+ this.dialogVisible = true;
+ },
+ savePassword() {
+ const { oldPassword, newPassword, confirmPassword } = this.formData;
+
+ if (newPassword !== confirmPassword) {
+ this.$message.error('鏂板瘑鐮佷笌纭瀵嗙爜涓嶄竴鑷�');
+ return;
+ }
+ changePassword({oldPassword, newPassword}).then(res => {
+ console.log(res.data);
+ this.$message.success('瀵嗙爜淇敼鎴愬姛');
+ removeToken()
+ this.$router.push('/login')
+
+ }).catch(() => {
+
+ });
+
+ this.dialogVisible = false;
+ },
+
+
+
+
toggleCollapse: function () {
this.isCollapse = !this.isCollapse;
@@ -138,10 +202,10 @@
}
-
+ }
}
-}
+
</script>
<style scoped lang="less">
diff --git a/CanadaMes-ui/src/layout/tag.vue b/CanadaMes-ui/src/layout/tag.vue
new file mode 100644
index 0000000..246ce7c
--- /dev/null
+++ b/CanadaMes-ui/src/layout/tag.vue
@@ -0,0 +1,91 @@
+<template>
+ <div class="_tag">
+ <el-scrollbar style="margin-right: 6px;">
+ <div class="left">
+ <el-tag
+ v-for="tag in tagsList"
+ :key="tag.title"
+ :closable="!tag.hideclose"
+ :type="isActive(tag)"
+ @close="removeTag(tag)"
+ @click="handleTagClick(tag)"
+ >
+ <router-link :to="tag.path" class="tag-title">{{ tag.title }}</router-link>
+ </el-tag>
+ </div>
+ </el-scrollbar>
+
+ <el-dropdown @command="handleCloseBtn" class="_dropdown">
+ <el-button type="primary" size="small">
+ 鏍囩閫夐」
+ <i class="el-icon-arrow-down el-icon--right"></i>
+ </el-button>
+ <el-dropdown-menu slot="dropdown">
+ <el-dropdown-item command="closeOther">鍏抽棴鍏跺畠</el-dropdown-item>
+ <el-dropdown-item command="closeAll">鍏抽棴鎵�鏈�</el-dropdown-item>
+ </el-dropdown-menu>
+ </el-dropdown>
+ </div>
+ </template>
+
+ <script>
+ import { mapState, mapMutations } from "vuex";
+
+ export default {
+ computed: {
+ ...mapState("tags", ["tagsList"]),
+ activeTag() {
+ return this.tagsList.find(tag => tag.path === this.$route.fullPath);
+ }
+ },
+ methods: {
+ ...mapMutations("tags", ["removeTag"]),
+ handleCloseBtn(command) {
+ if (command === "closeOther") {
+ const activeTag = this.activeTag;
+ if (!activeTag || activeTag.hideclose) return;
+ this.$store.commit("tags/removeOtherTags", activeTag);
+ } else if (command === "closeAll") {
+ this.$store.commit("tags/removeAllTags");
+ this.$router.push({ name: "sadmasMain" });
+ }
+ },
+ isActive(tag) {
+ return tag.path === this.$route.fullPath ? "" : "info";
+ },
+ handleTagClick(tag) {
+ this.$router.push(tag.path);
+ }
+ },
+ watch: {
+ $route(newValue) {
+ const isExist = this.tagsList.some(item => item.path === newValue.fullPath);
+ if (!isExist) {
+ this.$store.commit("tags/addTag", {
+ title: newValue.meta.title || "",
+ path: newValue.fullPath,
+ hideclose: newValue.meta.hideclose || false
+ });
+ }
+ }
+ }
+ };
+ </script>
+
+ <style scoped>
+ ._tag {
+ display: flex;
+ align-items: center;
+ padding: 10px;
+ }
+
+ .left {
+ display: flex;
+ flex-wrap: wrap;
+ }
+
+ .tag-title {
+ cursor: pointer;
+ }
+ </style>
+
\ No newline at end of file
diff --git a/CanadaMes-ui/src/main.js b/CanadaMes-ui/src/main.js
index 8d19ac5..0bb44ef 100644
--- a/CanadaMes-ui/src/main.js
+++ b/CanadaMes-ui/src/main.js
@@ -9,6 +9,7 @@
import zhCN from './lang/locales/zh-CN.json' // 涓枃璇█鍖�
import enUS from './lang/locales/en-US.json' // 鑻辨枃璇█鍖�
+// import store from './store'
Vue.use(VueI18n)
const i18n = new VueI18n({
@@ -19,6 +20,8 @@
}
})
+const EventBus = new Vue();
+Vue.prototype.$bus = EventBus;
Vue.use(ElementUI);
Vue.config.productionTip = false;
@@ -27,9 +30,10 @@
Vue.prototype.$message = Message;
// confirm
Vue.prototype.$confirm = MessageBox.confirm;
-
+Vue.prototype.$tagList = [];
new Vue({
router,
i18n,
+
render: h => h(App)
}).$mount('#app');
diff --git a/CanadaMes-ui/src/router/index.js b/CanadaMes-ui/src/router/index.js
index 21a76f1..03377b2 100644
--- a/CanadaMes-ui/src/router/index.js
+++ b/CanadaMes-ui/src/router/index.js
@@ -96,6 +96,18 @@
// 鑾峰彇token
const hasToken = getToken();
+
+
+
+ const isExist = Vue.prototype.$tagList.some(tag => tag.path === to.fullPath);
+
+ if (!isExist) {
+ Vue.prototype.$tagList.push({
+ path: to.fullPath,
+ data: null
+ });
+ }
+
// 娌℃湁token鍒欒烦杞埌鐧诲綍椤甸潰
if (!hasToken) return next('/login');
diff --git a/CanadaMes-ui/src/store/store,js b/CanadaMes-ui/src/store/store,js
new file mode 100644
index 0000000..b2d2afd
--- /dev/null
+++ b/CanadaMes-ui/src/store/store,js
@@ -0,0 +1,77 @@
+
+
+import Vue from 'vue';
+import Vuex from 'vuex';
+
+Vue.use(Vuex);
+
+const store = new Vuex.Store({
+ state: {
+ // 鍏朵粬妯″潡鐨勭姸鎬�...
+ },
+ mutations: {
+ // 鍏朵粬妯″潡鐨刴utations...
+ },
+ actions: {
+ // 鍏朵粬妯″潡鐨刟ctions...
+ },
+ modules: {
+ tag: {
+ namespaced: true,
+ state: {
+ tags: [], // 鏍囩鍒楄〃
+ selectedTag: null // 閫変腑鐨勬爣绛�
+ },
+ mutations: {
+ SET_TAGS(state, tags) {
+ state.tags = tags;
+ },
+ ADD_TAG(state, tag) {
+ state.tags.push(tag);
+ },
+ REMOVE_TAG(state, tag) {
+ state.tags = state.tags.filter(t => t !== tag);
+ },
+ CLEAR_TAGS(state) {
+ state.tags = [];
+ },
+ SET_SELECTED_TAG(state, tag) {
+ state.selectedTag = tag;
+ },
+ CLEAR_SELECTED_TAG(state) {
+ state.selectedTag = null;
+ }
+ },
+ actions: {
+ setTags({ commit }, tags) {
+ commit('SET_TAGS', tags);
+ },
+ addTag({ commit }, tag) {
+ commit('ADD_TAG', tag);
+ },
+ removeTag({ commit }, tag) {
+ commit('REMOVE_TAG', tag);
+ },
+ clearTags({ commit }) {
+ commit('CLEAR_TAGS');
+ },
+ setSelectedTag({ commit }, tag) {
+ commit('SET_SELECTED_TAG', tag);
+ },
+ clearSelectedTag({ commit }) {
+ commit('CLEAR_SELECTED_TAG');
+ }
+ },
+ getters: {
+ getTags(state) {
+ return state.tags;
+ },
+ getSelectedTag(state) {
+ return state.selectedTag;
+ }
+ }
+ }
+ }
+});
+
+export default store;
diff --git a/CanadaMes-ui/src/views/device/alarm.vue b/CanadaMes-ui/src/views/device/alarm.vue
index 13cde4c..3967a9f 100644
--- a/CanadaMes-ui/src/views/device/alarm.vue
+++ b/CanadaMes-ui/src/views/device/alarm.vue
@@ -10,271 +10,32 @@
<router-link to="/device/parameter" tag="el-button" type="text">鍙傛暟涓嬪彂</router-link>
<router-link to="/device/control" tag="el-button" type="text">寮�鍏虫帶鍒�</router-link>
</el-breadcrumb>
+ <div>鎶ヨ淇℃伅</div>
+ </div>
+ </template>
+
+ <script>
-
-
- <!--鍗$墖瑙嗗浘鍖哄煙-->
- <el-card class="el-card">
- <el-row :gutter="20">
- <!--鎼滅储涓庢坊鍔犲尯鍩�-->
- <el-col :span="6">
- <el-input v-model="queryInfo.username" clearable @clear="getUserList">
- </el-input>
- </el-col>
- <el-col :span="6">
- <el-input v-model="queryInfo.email" clearable @clear="getUserList">
- </el-input>
- </el-col>
- <!--鎼滅储鎸夐挳-->
- <el-col :span="4">
- <el-button type="primary" @click="getUserList">{{ $t('langSearch') }}</el-button>
- </el-col>
-
- <!--娣诲姞鍖哄煙-->
- <el-col :span="4">
- <el-button type="primary" @click="showAddDialog">{{ $t('langAddUser') }}</el-button>
- </el-col>
- </el-row>
- <!--鐢ㄦ埛鍒楄〃鍖哄煙-->
- <el-table :data="userList.records" border stripe>
- <el-table-column label="#" type="index"></el-table-column>
- <el-table-column :label="$t('langUsername')" prop="username"></el-table-column>
- <el-table-column :label="$t('langEmail')" prop="email"></el-table-column>
- <el-table-column :label="$t('langCreateTime')" prop="createTime"></el-table-column>
- <el-table-column :label="$t('langDisabled')">
- <template slot-scope="scope">
- <el-switch :active-value="0" :inactive-value="1" v-model="scope.row.state" @change="stateChange(scope.row)">
- </el-switch>
- </template>
- </el-table-column>
- <el-table-column :label="$t('langAction')">
- <template slot-scope="scope">
- <!--淇敼-->
- <el-tooltip effect="dark" :content="$t('langEdit')" placement="top" :enterable="false">
- <el-button type="primary" icon="el-icon-edit" size="mini" @click="showEditDialog(scope.row.id)"></el-button>
- </el-tooltip>
- <!--鍒犻櫎-->
- <el-tooltip effect="dark" :content="$t('langDelete')" placement="top" :enterable="false">
- <el-button type="danger" icon="el-icon-delete" size="mini" @click="removeUserById(scope.row)"></el-button>
- </el-tooltip>
- </template>
- </el-table-column>
- </el-table>
- <!--鍒嗛〉鍖哄煙-->
- <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
- :current-page="queryInfo.pageNum" :page-sizes="[10, 20, 30, 40]" :page-size="queryInfo.pageSize"
- layout="total, sizes, prev, pager, next, jumper" :total="userList.total">
- </el-pagination>
- </el-card>
- <!--娣诲姞鐢ㄦ埛鐨勫璇濇-->
- <el-dialog :title="$t('langAddUserTitle')" :visible.sync="addDialogVisible" width="50%" @close="addDialogClosed">
- <!--鍐呭涓讳綋鍖哄煙-->
- <el-form :model="addUserForm" :rules="addUserRules" ref="addUserRef" label-width="70px">
- <el-form-item :label="$t('langUsername')" prop="username">
- <el-input v-model="addUserForm.username"></el-input>
- </el-form-item>
- <el-form-item :label="$t('langPassword')" prop="password">
- <el-input v-model="addUserForm.password" type="password"></el-input>
- </el-form-item>
- <el-form-item :label="$t('langEmail')" prop="email">
- <el-input v-model="addUserForm.email"></el-input>
- </el-form-item>
- <el-form-item :label="$t('langState')" prop="state">
- <el-select v-model="addUserForm.state">
- <el-option v-for="(item, index) in options" :key="index" :value="item.value" :label="item.label">
- </el-option>
- </el-select>
- </el-form-item>
- </el-form>
- <span slot="footer" class="dialog-footer">
- <el-button @click="addDialogVisible = false">{{ $t('langCancel') }}</el-button>
- <el-button type="primary" @click="addUser">{{ $t('langConfirm') }}</el-button>
- </span>
- </el-dialog>
- <!--淇敼鐢ㄦ埛鐨勫璇濇-->
- <el-dialog :title="$t('langEditUserTitle')" :visible.sync="editDialogVisible" width="50%">
- <!--鍐呭涓讳綋鍖哄煙-->
- <el-form :model="editUserForm" :rules="addUserRules" ref="addCategoryRef" label-width="70px">
- <el-form-item :label="$t('langUsername')" prop="username">
- <el-input v-model="editUserForm.username" disabled></el-input>
- </el-form-item>
- <el-form-item label="瑙掕壊" prop="roleId">
- <el-select filterable v-model="editUserForm.roleId" placeholder="璇烽�夋嫨">
- <el-option v-for="item in roleList" :key="item.id" :value="item.id" :label="item.name">
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item :label="$t('langEmail')" prop="email">
- <el-input v-model="editUserForm.email"></el-input>
- </el-form-item>
- <el-form-item :label="$t('langDisabled')" prop="state">
- <el-select v-model="editUserForm.state">
- <el-option v-for="(item, index) in options" :key="index" :value="item.value" :label="item.label">
- </el-option>
- </el-select>
- </el-form-item>
- </el-form>
- <span slot="footer" class="dialog-footer">
- <el-button @click="editDialogVisible = false">{{ $t('langCancel') }}</el-button>
- <el-button type="primary" @click="editUserInfo">{{ $t('langConfirm') }}</el-button>
- </span>
- </el-dialog>
- </div>
-</template>
-
-
-<script>
-import { getById, removeById, saveOrUpdate, selectPage } from "../../api/user";
-import { select } from "../../api/role";
-
-import LanguageMixin from '../../lang/LanguageMixin'
-export default {
- name: "alarm",
- mixins: [LanguageMixin],
- data () {
- return {
- activeData: null,
- queryInfo: {
- pageNum: 1,
- pageSize: 10
- },
- userList: {
- records: [],
- total: 0,
- },
- // 娣诲姞鐨勭敤鎴峰璞�
- addUserForm: {
- state: 1
- },
- // 淇敼鐨勭敤鎴峰璞�
- editUserForm: {
-
- roleId: null,
- name: null,
- roleid: null,
- },
- // 娣诲姞鍒嗙被鐨勯獙璇佽鍒�
- addUserRules: {
- roleId: null,
- username: [
- { required: true, message: '璇疯緭鍏ョ敤鎴峰悕', trigger: 'blur' },
- { min: 5, max: 15, message: '闀垮害鍦� 5 鍒� 15 涓瓧绗�', trigger: 'blur' }
- ],
- password: [
- { required: true, message: '璇疯緭鍏ュ瘑鐮�', trigger: 'blur' },
- { min: 5, max: 15, message: '闀垮害鍦� 5 鍒� 15 涓瓧绗�', trigger: 'blur' }
- ],
- email: [
- { required: true, message: '璇疯緭鍏ラ偖绠�', trigger: 'blur' },
- { type: 'email', message: '璇疯緭鍏ユ纭牸寮忕殑閭鍦板潃', trigger: 'blur' }
- ]
- },
- // 鎺у埗娣诲姞鐢ㄦ埛寮规鐨勬樉绀哄拰闅愯棌
- addDialogVisible: false,
- // 鎺у埗淇敼鐢ㄦ埛寮规鐨勬樉绀哄拰闅愯棌
- editDialogVisible: false,
- options: [
- { label: '姝e父', value: 1 },
- { label: '绂佺敤', value: 0 }
- ],
- roleList: [],
+
+ export default {
+ name: "alarm",
+
}
- },
- created () {
- this.getUserList();
- },
- methods: {
- getUserList () {
- selectPage(this.queryInfo).then(res => {
- this.userList.records = res.data.records;
- this.userList.total = res.data.total
- });
- },
-
- showAddDialog () {
- this.addDialogVisible = true;
- },
- stateChange (info) {
- saveOrUpdate(info).then(() => {
- this.$message.success("鏇存柊鐘舵�佹垚鍔�")
- });
- },
- showEditDialog (id) {
- getById({ id: id }).then(res => {
- this.editUserForm = res.data;
- this.editDialogVisible = true;
- });
- select().then(res => {
- this.roleList = res.data;
- });
- },
- removeUserById (user) {
- // 寮规璇㈤棶鐢ㄦ埛鏄惁鍒犻櫎鍒嗙被
- this.$confirm('姝ゆ搷浣滃皢姘镐箙鍒犻櫎璇ュ垎绫�, 鏄惁缁х画?', '鎻愮ず', {
- confirmButtonText: '纭畾',
- cancelButtonText: '鍙栨秷',
- type: 'warning'
- }).then(() => {
- removeById({ id: user.id }).then(() => {
- // 閲嶆柊鑾峰彇鍒嗙被鍒楄〃
- this.getUserList();
- this.$message.success("鍒犻櫎鐢ㄦ埛鎴愬姛");
- });
- }).catch(() => {
- this.$message.info('宸插彇娑堝垹闄�');
- });
- },
- handleSizeChange (newSize) {
- this.queryInfo.pageSize = newSize;
- this.getUserList()
- },
- handleCurrentChange (newPage) {
- this.queryInfo.pageNum = newPage;
- this.getUserList()
- },
- addDialogClosed () {
- this.$refs['addUserRef'].resetFields();
- },
- addUser () {
- this.$refs.addUserRef.validate(async valid => {
- if (!valid) return;
- saveOrUpdate(this.addUserForm).then(() => {
- this.$message.success("娣诲姞鐢ㄦ埛鎴愬姛");
- // 闅愯棌娣诲姞鍒嗙被瀵硅瘽妗�
- this.addDialogVisible = false;
- // 閲嶆柊鑾峰彇鍒嗙被鍒楄〃
- this.getUserList();
- });
- })
- },
- editUserInfo () {
- this.$refs.addCategoryRef.validate(async valid => {
- if (!valid) return;
-
- saveOrUpdate(this.editUserForm).then(() => {
- this.$message.success("淇敼鐢ㄦ埛鎴愬姛");
- // 闅愯棌娣诲姞鍒嗙被瀵硅瘽妗�
- this.editDialogVisible = false;
- // 閲嶆柊鑾峰彇鍒嗙被鍒楄〃
- this.getUserList();
- });
- })
- }
+
+ </script>
+
+ <style lang="less" scoped>
+ .el-table {
+ margin-top: 15px;
+ font-size: 12px;
}
-}
-</script>
-
-<style lang="less" scoped>
-.el-table {
- margin-top: 15px;
- font-size: 12px;
-}
-
-.el-pagination {
- margin-top: 15px;
-}
-
-.app .el-card {
- width: 99%;
-}
-</style>
+
+ .el-pagination {
+ margin-top: 15px;
+ }
+
+ .app .el-card {
+ width: 99%;
+ }
+ </style>
+
diff --git a/CanadaMes-ui/src/views/home/index.vue b/CanadaMes-ui/src/views/home/index.vue
index b0409cf..8e832d3 100644
--- a/CanadaMes-ui/src/views/home/index.vue
+++ b/CanadaMes-ui/src/views/home/index.vue
@@ -5,13 +5,23 @@
<el-breadcrumb-item :to="{ path: '/home' }">棣栭〉</el-breadcrumb-item>
</el-breadcrumb>
-
+ <div>mes鎺у埗椤�</div>
</div>
</template>
<script>
-
+ fetch('/devices')
+ .then(response => response.json())
+ .then(data => {
+ // 鍦ㄨ繖閲屽鐞嗚繑鍥炵殑璁惧鏁版嵁
+ console.log(data);
+ })
+ .catch(error => {
+ // 澶勭悊閿欒鎯呭喌
+ console.error('Error:', error);
+ });
+
export default {
name: "home",
diff --git a/CanadaMes-ui/src/views/user/index.vue b/CanadaMes-ui/src/views/user/index.vue
index 89edbf2..bd77f59 100644
--- a/CanadaMes-ui/src/views/user/index.vue
+++ b/CanadaMes-ui/src/views/user/index.vue
@@ -11,11 +11,11 @@
<el-row :gutter="20">
<!--鎼滅储涓庢坊鍔犲尯鍩�-->
<el-col :span="6">
- <el-input v-model="queryInfo.username" clearable @clear="getUserList">
+ <el-input placeholder="璇疯緭鍏ョ敤鎴峰悕绉�" v-model="queryInfo.username" clearable @clear="getUserList">
</el-input>
</el-col>
<el-col :span="6">
- <el-input v-model="queryInfo.email" clearable @clear="getUserList">
+ <el-input placeholder="璇疯緭鍏ラ偖绠�" v-model="queryInfo.email" clearable @clear="getUserList">
</el-input>
</el-col>
<!--鎼滅储鎸夐挳-->
@@ -76,22 +76,34 @@
width="50%"
@close="addDialogClosed">
<!--鍐呭涓讳綋鍖哄煙-->
- <el-form :model="addUserForm" :rules="addUserRules" ref="addUserRef" label-width="70px">
- <el-form-item :label="$t('langUsername')" prop="username">
- <el-input v-model="addUserForm.username"></el-input>
+ <el-form :model="addUserForm" :rules="addUserRules" ref="addUserRef" label-width="100px">
+ <el-form-item :label="$t('langUsername')" prop="username" >
+ <el-input v-model="addUserForm.username" ></el-input>
</el-form-item>
- <el-form-item :label="$t('langPassword')" prop="password">
+ <el-form-item :label="$t('langPassword')" prop="password" >
<el-input v-model="addUserForm.password" type="password"></el-input>
</el-form-item>
<el-form-item :label="$t('langEmail')" prop="email">
<el-input v-model="addUserForm.email"></el-input>
</el-form-item>
+
+
<el-form-item :label="$t('langState')" prop="state">
<el-select v-model="addUserForm.state" >
<el-option v-for="(item,index) in options"
:key="index"
:value="item.value"
:label="item.label">
+ </el-option>
+ </el-select>
+ </el-form-item>
+
+ <el-form-item label="瑙掕壊" prop="roleId">
+ <el-select filterable v-model="addUserForm.roleId" placeholder="璇烽�夋嫨">
+ <el-option v-for="item in roleList"
+ :key="item.id"
+ :value="item.id"
+ :label="item.name">
</el-option>
</el-select>
</el-form-item>
@@ -107,7 +119,7 @@
:visible.sync="editDialogVisible"
width="50%">
<!--鍐呭涓讳綋鍖哄煙-->
- <el-form :model="editUserForm" :rules="addUserRules" ref="addCategoryRef" label-width="70px">
+ <el-form :model="editUserForm" :rules="addUserRules" ref="addCategoryRef" label-width="100px">
<el-form-item :label="$t('langUsername')" prop="username">
<el-input v-model="editUserForm.username" disabled></el-input>
</el-form-item>
@@ -143,7 +155,7 @@
<script>
-import {getById, removeById, saveOrUpdate, selectPage} from "../../api/user";
+import {getById, removeById, saveOrUpdate, selectPage,test,testup,call} from "../../api/user";
import {select} from "../../api/role";
import LanguageMixin from '../../lang/LanguageMixin'
@@ -207,10 +219,28 @@
this.userList.records = res.data.records;
this.userList.total = res.data.total
});
+ test().then(res => {
+ console.log(res.data)
+ });
+ const data6 = {id:32,name:'6667'}; // 濉叆闇�瑕佷紶閫掔殑鍙傛暟
+ testup(data6).then(res => {
+ console.log(res.data);
+ });
+
+ call({
+ id: 1,
+ name: 12345
+}).then(res => {
+ console.log(res.data);
+ });
+
},
showAddDialog() {
this.addDialogVisible = true;
+ select().then(res => {
+ this.roleList = res.data;
+});
},
stateChange(info) {
saveOrUpdate(info).then(() => {
@@ -222,6 +252,8 @@
this.editUserForm = res.data;
this.editDialogVisible = true;
});
+
+
select().then(res => {
this.roleList = res.data;
});
diff --git a/CanadaMes-ui/vue.config.js b/CanadaMes-ui/vue.config.js
index 0529c8d..582ff94 100644
--- a/CanadaMes-ui/vue.config.js
+++ b/CanadaMes-ui/vue.config.js
@@ -20,8 +20,8 @@
resolve: {
extensions: ['js', 'vue'],
alias: {
- '@': resolve('src')
- }
+ '@': path.resolve(__dirname, 'src') // 纭繚鏈夎繖涓埆鍚嶉厤缃�
+ }
}
}
}
--
Gitblit v1.8.0