Browse Source

物业端 页面

weiximei 6 years ago
parent
commit
41bd51d732
100 changed files with 4275 additions and 0 deletions
  1. 36
    0
      CODE/smart-community/property-api/pom.xml
  2. 15
    0
      CODE/smart-community/property-api/src/main/java/com/community/huiju/common/code/ICode.java
  3. 48
    0
      CODE/smart-community/property-api/src/main/java/com/community/huiju/common/code/cache/AppkeyCache.java
  4. 23
    0
      CODE/smart-community/property-api/src/main/java/com/community/huiju/common/code/entity/CodeEntity.java
  5. 11
    0
      CODE/smart-community/property-api/src/main/java/com/community/huiju/common/code/impl/ImgCodeImpl.java
  6. 68
    0
      CODE/smart-community/property-api/src/main/java/com/community/huiju/common/code/impl/PhoneCodeImpl.java
  7. 12
    0
      VUECODE/smart-property-manage/.babelrc
  8. 14
    0
      VUECODE/smart-property-manage/.editorconfig
  9. 3
    0
      VUECODE/smart-property-manage/.eslintignore
  10. 196
    0
      VUECODE/smart-property-manage/.eslintrc.js
  11. 15
    0
      VUECODE/smart-property-manage/.gitignore
  12. 10
    0
      VUECODE/smart-property-manage/.postcssrc.js
  13. 5
    0
      VUECODE/smart-property-manage/.travis.yml
  14. 21
    0
      VUECODE/smart-property-manage/LICENSE
  15. 96
    0
      VUECODE/smart-property-manage/README-zh.md
  16. 88
    0
      VUECODE/smart-property-manage/README.md
  17. 45
    0
      VUECODE/smart-property-manage/build/build.js
  18. 64
    0
      VUECODE/smart-property-manage/build/check-versions.js
  19. BIN
      VUECODE/smart-property-manage/build/logo.png
  20. 108
    0
      VUECODE/smart-property-manage/build/utils.js
  21. 5
    0
      VUECODE/smart-property-manage/build/vue-loader.conf.js
  22. 117
    0
      VUECODE/smart-property-manage/build/webpack.base.conf.js
  23. 95
    0
      VUECODE/smart-property-manage/build/webpack.dev.conf.js
  24. 178
    0
      VUECODE/smart-property-manage/build/webpack.prod.conf.js
  25. 8
    0
      VUECODE/smart-property-manage/config/dev.env.js
  26. 86
    0
      VUECODE/smart-property-manage/config/index.js
  27. 5
    0
      VUECODE/smart-property-manage/config/prod.env.js
  28. BIN
      VUECODE/smart-property-manage/favicon.ico
  29. 14
    0
      VUECODE/smart-property-manage/index.html
  30. 94
    0
      VUECODE/smart-property-manage/package.json
  31. 11
    0
      VUECODE/smart-property-manage/src/App.vue
  32. 46
    0
      VUECODE/smart-property-manage/src/api/banner.js
  33. 48
    0
      VUECODE/smart-property-manage/src/api/community.js
  34. 17
    0
      VUECODE/smart-property-manage/src/api/index.js
  35. 38
    0
      VUECODE/smart-property-manage/src/api/login.js
  36. 9
    0
      VUECODE/smart-property-manage/src/api/table.js
  37. BIN
      VUECODE/smart-property-manage/src/assets/404_images/404.png
  38. BIN
      VUECODE/smart-property-manage/src/assets/404_images/404_cloud.png
  39. BIN
      VUECODE/smart-property-manage/src/assets/light1.png
  40. BIN
      VUECODE/smart-property-manage/src/assets/light2.png
  41. BIN
      VUECODE/smart-property-manage/src/assets/light3.png
  42. BIN
      VUECODE/smart-property-manage/src/assets/light4.png
  43. 61
    0
      VUECODE/smart-property-manage/src/components/Breadcrumb/index.vue
  44. 58
    0
      VUECODE/smart-property-manage/src/components/Hamburger/index.vue
  45. 99
    0
      VUECODE/smart-property-manage/src/components/Pagination/index.vue
  46. 43
    0
      VUECODE/smart-property-manage/src/components/SvgIcon/index.vue
  47. 105
    0
      VUECODE/smart-property-manage/src/components/Wangeditor/index.vue
  48. 108
    0
      VUECODE/smart-property-manage/src/components/chart/chart1.vue
  49. 98
    0
      VUECODE/smart-property-manage/src/components/chart/chart2.vue
  50. 101
    0
      VUECODE/smart-property-manage/src/components/chart/chart3.vue
  51. 125
    0
      VUECODE/smart-property-manage/src/components/chart/chart4.vue
  52. 107
    0
      VUECODE/smart-property-manage/src/components/chart/chart5.vue
  53. 108
    0
      VUECODE/smart-property-manage/src/components/chart/chart6.vue
  54. 92
    0
      VUECODE/smart-property-manage/src/components/chart/chart7.vue
  55. 49
    0
      VUECODE/smart-property-manage/src/directive/clipboard/clipboard.js
  56. 13
    0
      VUECODE/smart-property-manage/src/directive/clipboard/index.js
  57. 77
    0
      VUECODE/smart-property-manage/src/directive/el-dragDialog/drag.js
  58. 13
    0
      VUECODE/smart-property-manage/src/directive/el-dragDialog/index.js
  59. 13
    0
      VUECODE/smart-property-manage/src/directive/permission/index.js
  60. 23
    0
      VUECODE/smart-property-manage/src/directive/permission/permission.js
  61. 91
    0
      VUECODE/smart-property-manage/src/directive/sticky.js
  62. 13
    0
      VUECODE/smart-property-manage/src/directive/waves/index.js
  63. 26
    0
      VUECODE/smart-property-manage/src/directive/waves/waves.css
  64. 42
    0
      VUECODE/smart-property-manage/src/directive/waves/waves.js
  65. 9
    0
      VUECODE/smart-property-manage/src/icons/index.js
  66. 1
    0
      VUECODE/smart-property-manage/src/icons/svg/banner.svg
  67. 1
    0
      VUECODE/smart-property-manage/src/icons/svg/community.svg
  68. 1
    0
      VUECODE/smart-property-manage/src/icons/svg/communitydata.svg
  69. 1
    0
      VUECODE/smart-property-manage/src/icons/svg/example.svg
  70. 1
    0
      VUECODE/smart-property-manage/src/icons/svg/eye.svg
  71. 1
    0
      VUECODE/smart-property-manage/src/icons/svg/form.svg
  72. 1
    0
      VUECODE/smart-property-manage/src/icons/svg/index.svg
  73. 1
    0
      VUECODE/smart-property-manage/src/icons/svg/link.svg
  74. 1
    0
      VUECODE/smart-property-manage/src/icons/svg/nested.svg
  75. 1
    0
      VUECODE/smart-property-manage/src/icons/svg/operate.svg
  76. 1
    0
      VUECODE/smart-property-manage/src/icons/svg/password.svg
  77. 1
    0
      VUECODE/smart-property-manage/src/icons/svg/table.svg
  78. 1
    0
      VUECODE/smart-property-manage/src/icons/svg/tree.svg
  79. 1
    0
      VUECODE/smart-property-manage/src/icons/svg/user.svg
  80. 22
    0
      VUECODE/smart-property-manage/src/icons/svgo.yml
  81. 36
    0
      VUECODE/smart-property-manage/src/main.js
  82. 47
    0
      VUECODE/smart-property-manage/src/permission.js
  83. 88
    0
      VUECODE/smart-property-manage/src/router/index.js
  84. 11
    0
      VUECODE/smart-property-manage/src/store/getters.js
  85. 23
    0
      VUECODE/smart-property-manage/src/store/index.js
  86. 43
    0
      VUECODE/smart-property-manage/src/store/modules/app.js
  87. 66
    0
      VUECODE/smart-property-manage/src/store/modules/banner.js
  88. 170
    0
      VUECODE/smart-property-manage/src/store/modules/community.js
  89. 48
    0
      VUECODE/smart-property-manage/src/store/modules/trunkIndex.js
  90. 105
    0
      VUECODE/smart-property-manage/src/store/modules/user.js
  91. 29
    0
      VUECODE/smart-property-manage/src/styles/element-ui.scss
  92. 78
    0
      VUECODE/smart-property-manage/src/styles/index.scss
  93. 27
    0
      VUECODE/smart-property-manage/src/styles/mixin.scss
  94. 133
    0
      VUECODE/smart-property-manage/src/styles/sidebar.scss
  95. 46
    0
      VUECODE/smart-property-manage/src/styles/transition.scss
  96. 4
    0
      VUECODE/smart-property-manage/src/styles/variables.scss
  97. 15
    0
      VUECODE/smart-property-manage/src/utils/auth.js
  98. 74
    0
      VUECODE/smart-property-manage/src/utils/index.js
  99. 73
    0
      VUECODE/smart-property-manage/src/utils/request.js
  100. 0
    0
      VUECODE/smart-property-manage/src/utils/scrollTo.js

+ 36
- 0
CODE/smart-community/property-api/pom.xml View File

@@ -86,6 +86,42 @@
86 86
 			<scope>compile</scope>
87 87
 		</dependency>
88 88
 
89
+		<!-- https://mvnrepository.com/artifact/org.projectlombok/lombok -->
90
+		<dependency>
91
+			<groupId>org.projectlombok</groupId>
92
+			<artifactId>lombok</artifactId>
93
+			<version>1.18.2</version>
94
+			<scope>provided</scope>
95
+		</dependency>
96
+
97
+		<!-- https://mvnrepository.com/artifact/com.google.guava/guava -->
98
+		<dependency>
99
+			<groupId>com.google.guava</groupId>
100
+			<artifactId>guava</artifactId>
101
+			<version>26.0-jre</version>
102
+		</dependency>
103
+
104
+		<!-- https://mvnrepository.com/artifact/org.apache.commons/commons-lang3 -->
105
+		<dependency>
106
+			<groupId>org.apache.commons</groupId>
107
+			<artifactId>commons-lang3</artifactId>
108
+			<version>3.8.1</version>
109
+		</dependency>
110
+
111
+		<!-- https://mvnrepository.com/artifact/commons-lang/commons-lang -->
112
+		<dependency>
113
+			<groupId>commons-lang</groupId>
114
+			<artifactId>commons-lang</artifactId>
115
+			<version>2.6</version>
116
+		</dependency>
117
+
118
+		<!-- https://mvnrepository.com/artifact/com.squareup.okhttp3/okhttp -->
119
+		<dependency>
120
+			<groupId>com.squareup.okhttp3</groupId>
121
+			<artifactId>okhttp</artifactId>
122
+			<version>3.11.0</version>
123
+		</dependency>
124
+
89 125
 	</dependencies>
90 126
 
91 127
 	<dependencyManagement>

+ 15
- 0
CODE/smart-community/property-api/src/main/java/com/community/huiju/common/code/ICode.java View File

@@ -0,0 +1,15 @@
1
+package com.community.huiju.common.code;
2
+
3
+
4
+/**
5
+ * 验证码接口
6
+ * @author weiximei
7
+ */
8
+public interface ICode {
9
+
10
+    /**
11
+     * 验证码
12
+     */
13
+    boolean sendCode(String phone, String code);
14
+
15
+}

+ 48
- 0
CODE/smart-community/property-api/src/main/java/com/community/huiju/common/code/cache/AppkeyCache.java View File

@@ -0,0 +1,48 @@
1
+package com.community.huiju.common.code.cache;
2
+
3
+import com.community.commom.constant.Constant;
4
+import com.google.common.cache.CacheBuilder;
5
+import com.google.common.cache.CacheLoader;
6
+import com.google.common.cache.LoadingCache;
7
+import lombok.extern.slf4j.Slf4j;
8
+
9
+import java.util.concurrent.TimeUnit;
10
+
11
+/**
12
+ * 缓存
13
+ * @author weiximei
14
+ */
15
+@Slf4j
16
+public class AppkeyCache {
17
+
18
+    // .refreshAfterWrite(3, TimeUnit.HOURS)// 给定时间内没有被读/写访问,则回收。
19
+    static LoadingCache<String, Object> cache = CacheBuilder.newBuilder()
20
+            .expireAfterAccess(Constant.CACHE_EXPIRE, TimeUnit.HOURS)// 缓存过期时间和redis缓存时长一样
21
+            .maximumSize(Constant.CACHE_SIZE).// 设置缓存个数
22
+            build(new CacheLoader<String, Object>() {
23
+            @Override
24
+            /** 当本地缓存命没有中时,调用load方法获取结果并将结果缓存 **/
25
+            public String load(String appKey) throws Exception {
26
+                return null;
27
+            }
28
+
29
+    });
30
+
31
+    public static Object getCache(String appKey) {
32
+        Object value = null;
33
+        try {
34
+            value = cache.get(appKey);
35
+        } catch (Exception e) {
36
+            //e.printStackTrace();
37
+            value = null;
38
+        }
39
+        return value;
40
+    }
41
+
42
+    public static void setCache(String appKey,Object appValue){
43
+        log.info("缓存的key-value: {}-{}", appKey,appValue);
44
+        cache.put(appKey,appValue);
45
+    }
46
+
47
+
48
+}

+ 23
- 0
CODE/smart-community/property-api/src/main/java/com/community/huiju/common/code/entity/CodeEntity.java View File

@@ -0,0 +1,23 @@
1
+package com.community.huiju.common.code.entity;
2
+
3
+import lombok.AllArgsConstructor;
4
+import lombok.Data;
5
+import lombok.NoArgsConstructor;
6
+
7
+@Data
8
+@AllArgsConstructor
9
+@NoArgsConstructor
10
+public class CodeEntity {
11
+
12
+   private String code;
13
+
14
+   private String tel;
15
+
16
+    /**
17
+     * 参数 格式 String params = "["xxx"]"
18
+     */
19
+   private String params;
20
+
21
+
22
+
23
+}

+ 11
- 0
CODE/smart-community/property-api/src/main/java/com/community/huiju/common/code/impl/ImgCodeImpl.java View File

@@ -0,0 +1,11 @@
1
+package com.community.huiju.common.code.impl;
2
+
3
+/**
4
+ * 图片验证码
5
+ * @author weiximei
6
+ */
7
+public class ImgCodeImpl {
8
+
9
+
10
+
11
+}

+ 68
- 0
CODE/smart-community/property-api/src/main/java/com/community/huiju/common/code/impl/PhoneCodeImpl.java View File

@@ -0,0 +1,68 @@
1
+package com.community.huiju.common.code.impl;
2
+
3
+import com.community.commom.constant.Constant;
4
+import com.community.huiju.common.code.ICode;
5
+import lombok.extern.slf4j.Slf4j;
6
+import okhttp3.*;
7
+import org.springframework.stereotype.Service;
8
+
9
+import java.io.IOException;
10
+import java.util.concurrent.TimeUnit;
11
+
12
+/**
13
+ * 手机验证码
14
+ * @author weiximei
15
+ */
16
+@Service("phoneCodeImpl")
17
+@Slf4j
18
+public class PhoneCodeImpl implements ICode {
19
+
20
+    public static final MediaType JSON = MediaType.parse("application/json; charset=utf-8");
21
+
22
+
23
+    public OkHttpClient getClient() {
24
+        OkHttpClient client  = new OkHttpClient.Builder()
25
+                .connectTimeout(10, TimeUnit.SECONDS)
26
+                .writeTimeout(10,TimeUnit.SECONDS)
27
+                .readTimeout(20, TimeUnit.SECONDS)
28
+                .build();
29
+        return client;
30
+    }
31
+
32
+    @Override
33
+    public boolean sendCode(String phone, String code) {
34
+        boolean bool = false;
35
+
36
+        try {
37
+            String result = null;
38
+            OkHttpClient client = getClient();
39
+            RequestBody body = RequestBody.create(JSON, "{\"code\":\""+Constant.CODE+"\"," + "\"tel\":\""+phone+"\"," + "\"params\":[\""+code+"\"]}");
40
+            Request request = new Request.Builder()
41
+                    .url(Constant.REQUEST_URL)
42
+                    .post(body)
43
+                    .build();
44
+            Response response = client.newCall(request).execute();
45
+            if (response.isSuccessful()) {
46
+                result = response.body().string();
47
+            } else {
48
+                throw new IOException("Unexpected code " + response);
49
+            }
50
+
51
+
52
+
53
+            if ("发送成功".equals(result)) {
54
+                bool = true;
55
+                log.info("手机号 {} 验证码 {} 发送成功!",phone,code);
56
+            }else {
57
+                bool = false;
58
+                log.error("短信发送验证码失败!{}", result);
59
+            }
60
+        } catch (Exception e){
61
+            e.printStackTrace();
62
+            log.error("短信发送错误!",e);
63
+            bool = false;
64
+        }
65
+
66
+        return bool;
67
+    }
68
+}

+ 12
- 0
VUECODE/smart-property-manage/.babelrc View File

@@ -0,0 +1,12 @@
1
+{
2
+  "presets": [
3
+    ["env", {
4
+      "modules": false,
5
+      "targets": {
6
+        "browsers": ["> 1%", "last 2 versions", "not ie <= 8"]
7
+      }
8
+    }],
9
+    "stage-2"
10
+  ],
11
+  "plugins":["transform-vue-jsx", "transform-runtime"]
12
+}

+ 14
- 0
VUECODE/smart-property-manage/.editorconfig View File

@@ -0,0 +1,14 @@
1
+# http://editorconfig.org
2
+root = true
3
+
4
+[*]
5
+charset = utf-8
6
+indent_style = space
7
+indent_size = 2
8
+end_of_line = lf
9
+insert_final_newline = true
10
+trim_trailing_whitespace = true
11
+
12
+[*.md]
13
+insert_final_newline = false
14
+trim_trailing_whitespace = false

+ 3
- 0
VUECODE/smart-property-manage/.eslintignore View File

@@ -0,0 +1,3 @@
1
+build/*.js
2
+config/*.js
3
+src/assets

+ 196
- 0
VUECODE/smart-property-manage/.eslintrc.js View File

@@ -0,0 +1,196 @@
1
+module.exports = {
2
+  root: true,
3
+  parserOptions: {
4
+    parser: 'babel-eslint',
5
+    sourceType: 'module'
6
+  },
7
+  env: {
8
+    browser: true,
9
+    node: true,
10
+    es6: true,
11
+  },
12
+  extends: ['plugin:vue/recommended', 'eslint:recommended'],
13
+
14
+  // add your custom rules here
15
+  //it is base on https://github.com/vuejs/eslint-config-vue
16
+  rules: {
17
+    "vue/max-attributes-per-line": [2, {
18
+      "singleline": 10,
19
+      "multiline": {
20
+        "max": 1,
21
+        "allowFirstLine": false
22
+      }
23
+    }],
24
+    "vue/name-property-casing": ["error", "PascalCase"],
25
+    'accessor-pairs': 2,
26
+    'arrow-spacing': [2, {
27
+      'before': true,
28
+      'after': true
29
+    }],
30
+    'block-spacing': [2, 'always'],
31
+    'brace-style': [2, '1tbs', {
32
+      'allowSingleLine': true
33
+    }],
34
+    'camelcase': [0, {
35
+      'properties': 'always'
36
+    }],
37
+    'comma-dangle': [2, 'never'],
38
+    'comma-spacing': [2, {
39
+      'before': false,
40
+      'after': true
41
+    }],
42
+    'comma-style': [2, 'last'],
43
+    'constructor-super': 2,
44
+    'curly': [2, 'multi-line'],
45
+    'dot-location': [2, 'property'],
46
+    'eol-last': 2,
47
+    'eqeqeq': [2, 'allow-null'],
48
+    'generator-star-spacing': [2, {
49
+      'before': true,
50
+      'after': true
51
+    }],
52
+    'handle-callback-err': [2, '^(err|error)$'],
53
+    'indent': [2, 2, {
54
+      'SwitchCase': 1
55
+    }],
56
+    'jsx-quotes': [2, 'prefer-single'],
57
+    'key-spacing': [2, {
58
+      'beforeColon': false,
59
+      'afterColon': true
60
+    }],
61
+    'keyword-spacing': [2, {
62
+      'before': true,
63
+      'after': true
64
+    }],
65
+    'new-cap': [2, {
66
+      'newIsCap': true,
67
+      'capIsNew': false
68
+    }],
69
+    'new-parens': 2,
70
+    'no-array-constructor': 2,
71
+    'no-caller': 2,
72
+    'no-console': 'off',
73
+    'no-class-assign': 2,
74
+    'no-cond-assign': 2,
75
+    'no-const-assign': 2,
76
+    'no-control-regex': 2,
77
+    'no-delete-var': 2,
78
+    'no-dupe-args': 2,
79
+    'no-dupe-class-members': 2,
80
+    'no-dupe-keys': 2,
81
+    'no-duplicate-case': 2,
82
+    'no-empty-character-class': 2,
83
+    'no-empty-pattern': 2,
84
+    'no-eval': 2,
85
+    'no-ex-assign': 2,
86
+    'no-extend-native': 2,
87
+    'no-extra-bind': 2,
88
+    'no-extra-boolean-cast': 2,
89
+    'no-extra-parens': [2, 'functions'],
90
+    'no-fallthrough': 2,
91
+    'no-floating-decimal': 2,
92
+    'no-func-assign': 2,
93
+    'no-implied-eval': 2,
94
+    'no-inner-declarations': [2, 'functions'],
95
+    'no-invalid-regexp': 2,
96
+    'no-irregular-whitespace': 2,
97
+    'no-iterator': 2,
98
+    'no-label-var': 2,
99
+    'no-labels': [2, {
100
+      'allowLoop': false,
101
+      'allowSwitch': false
102
+    }],
103
+    'no-lone-blocks': 2,
104
+    'no-mixed-spaces-and-tabs': 2,
105
+    'no-multi-spaces': 2,
106
+    'no-multi-str': 2,
107
+    'no-multiple-empty-lines': [2, {
108
+      'max': 1
109
+    }],
110
+    'no-native-reassign': 2,
111
+    'no-negated-in-lhs': 2,
112
+    'no-new-object': 2,
113
+    'no-new-require': 2,
114
+    'no-new-symbol': 2,
115
+    'no-new-wrappers': 2,
116
+    'no-obj-calls': 2,
117
+    'no-octal': 2,
118
+    'no-octal-escape': 2,
119
+    'no-path-concat': 2,
120
+    'no-proto': 2,
121
+    'no-redeclare': 2,
122
+    'no-regex-spaces': 2,
123
+    'no-return-assign': [2, 'except-parens'],
124
+    'no-self-assign': 2,
125
+    'no-self-compare': 2,
126
+    'no-sequences': 2,
127
+    'no-shadow-restricted-names': 2,
128
+    'no-spaced-func': 2,
129
+    'no-sparse-arrays': 2,
130
+    'no-this-before-super': 2,
131
+    'no-throw-literal': 2,
132
+    'no-trailing-spaces': 2,
133
+    'no-undef': 2,
134
+    'no-undef-init': 2,
135
+    'no-unexpected-multiline': 2,
136
+    'no-unmodified-loop-condition': 2,
137
+    'no-unneeded-ternary': [2, {
138
+      'defaultAssignment': false
139
+    }],
140
+    'no-unreachable': 2,
141
+    'no-unsafe-finally': 2,
142
+    'no-unused-vars': [2, {
143
+      'vars': 'all',
144
+      'args': 'none'
145
+    }],
146
+    'no-useless-call': 2,
147
+    'no-useless-computed-key': 2,
148
+    'no-useless-constructor': 2,
149
+    'no-useless-escape': 0,
150
+    'no-whitespace-before-property': 2,
151
+    'no-with': 2,
152
+    'one-var': [2, {
153
+      'initialized': 'never'
154
+    }],
155
+    'operator-linebreak': [2, 'after', {
156
+      'overrides': {
157
+        '?': 'before',
158
+        ':': 'before'
159
+      }
160
+    }],
161
+    'padded-blocks': [2, 'never'],
162
+    'quotes': [2, 'single', {
163
+      'avoidEscape': true,
164
+      'allowTemplateLiterals': true
165
+    }],
166
+    'semi': [2, 'never'],
167
+    'semi-spacing': [2, {
168
+      'before': false,
169
+      'after': true
170
+    }],
171
+    'space-before-blocks': [2, 'always'],
172
+    'space-before-function-paren': [2, 'never'],
173
+    'space-in-parens': [2, 'never'],
174
+    'space-infix-ops': 2,
175
+    'space-unary-ops': [2, {
176
+      'words': true,
177
+      'nonwords': false
178
+    }],
179
+    'spaced-comment': [2, 'always', {
180
+      'markers': ['global', 'globals', 'eslint', 'eslint-disable', '*package', '!', ',']
181
+    }],
182
+    'template-curly-spacing': [2, 'never'],
183
+    'use-isnan': 2,
184
+    'valid-typeof': 2,
185
+    'wrap-iife': [2, 'any'],
186
+    'yield-star-spacing': [2, 'both'],
187
+    'yoda': [2, 'never'],
188
+    'prefer-const': 2,
189
+    'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0,
190
+    'object-curly-spacing': [2, 'always', {
191
+      objectsInObjects: false
192
+    }],
193
+    'array-bracket-spacing': [2, 'never']
194
+  }
195
+}
196
+

+ 15
- 0
VUECODE/smart-property-manage/.gitignore View File

@@ -0,0 +1,15 @@
1
+.DS_Store
2
+node_modules/
3
+dist/
4
+npm-debug.log*
5
+yarn-debug.log*
6
+yarn-error.log*
7
+package-lock.json
8
+
9
+# Editor directories and files
10
+.idea
11
+.vscode
12
+*.suo
13
+*.ntvs*
14
+*.njsproj
15
+*.sln

+ 10
- 0
VUECODE/smart-property-manage/.postcssrc.js View File

@@ -0,0 +1,10 @@
1
+// https://github.com/michael-ciniawsky/postcss-load-config
2
+
3
+module.exports = {
4
+  "plugins": {
5
+    "postcss-import": {},
6
+    "postcss-url": {},
7
+    // to edit target browsers: use "browserslist" field in package.json
8
+    "autoprefixer": {}
9
+  }
10
+}

+ 5
- 0
VUECODE/smart-property-manage/.travis.yml View File

@@ -0,0 +1,5 @@
1
+language: node_js
2
+node_js: stable
3
+script: npm run test
4
+notifications:
5
+  email: false

+ 21
- 0
VUECODE/smart-property-manage/LICENSE View File

@@ -0,0 +1,21 @@
1
+MIT License
2
+
3
+Copyright (c) 2017-present PanJiaChen
4
+
5
+Permission is hereby granted, free of charge, to any person obtaining a copy
6
+of this software and associated documentation files (the "Software"), to deal
7
+in the Software without restriction, including without limitation the rights
8
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+copies of the Software, and to permit persons to whom the Software is
10
+furnished to do so, subject to the following conditions:
11
+
12
+The above copyright notice and this permission notice shall be included in all
13
+copies or substantial portions of the Software.
14
+
15
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+SOFTWARE.

+ 96
- 0
VUECODE/smart-property-manage/README-zh.md View File

@@ -0,0 +1,96 @@
1
+# vue-admin-template
2
+
3
+> 这是一个 极简的 vue admin 管理后台 它只包含了 Element UI & axios & iconfont & permission control & lint,这些搭建后台必要的东西。
4
+
5
+[线上地址](http://panjiachen.github.io/vue-admin-template)
6
+
7
+[国内访问](https://panjiachen.gitee.io/vue-admin-template)
8
+
9
+## Extra
10
+
11
+如果你想要根据用户角色来动态生成侧边栏和 router,你可以使用改分支[permission-control](https://github.com/PanJiaChen/vue-admin-template/tree/permission-control)
12
+
13
+本项目基于`webpack4`开发,若还想使用`webpack3`开发,请使用该分支[webpack3](https://github.com/PanJiaChen/vue-admin-template/tree/webpack3)
14
+
15
+如果你想使用基于 vue + typescript 的管理后台, 可以看看这个项目: [vue-typescript-admin-template](https://github.com/Armour/vue-typescript-admin-template) (鸣谢: [@Armour](https://github.com/Armour))
16
+
17
+## 相关项目
18
+
19
+[vue-element-admin](https://github.com/PanJiaChen/vue-element-admin)
20
+
21
+[electron-vue-admin](https://github.com/PanJiaChen/electron-vue-admin)
22
+
23
+[vue-typescript-admin-template](https://github.com/Armour/vue-typescript-admin-template)
24
+
25
+写了一个系列的教程配套文章,如何从零构建后一个完整的后台项目:
26
+
27
+- [手摸手,带你用 vue 撸后台 系列一(基础篇)](https://juejin.im/post/59097cd7a22b9d0065fb61d2)
28
+- [手摸手,带你用 vue 撸后台 系列二(登录权限篇)](https://juejin.im/post/591aa14f570c35006961acac)
29
+- [手摸手,带你用 vue 撸后台 系列三 (实战篇)](https://juejin.im/post/593121aa0ce4630057f70d35)
30
+- [手摸手,带你用 vue 撸后台 系列四(vueAdmin 一个极简的后台基础模板,专门针对本项目的文章,算作是一篇文档)](https://juejin.im/post/595b4d776fb9a06bbe7dba56)
31
+- [手摸手,带你封装一个 vue component](https://segmentfault.com/a/1190000009090836)
32
+
33
+## Build Setup
34
+
35
+```bash
36
+# Clone project
37
+git clone https://github.com/PanJiaChen/vue-admin-template.git
38
+
39
+# Install dependencies
40
+npm install
41
+
42
+# 建议不要用cnpm  安装有各种诡异的bug 可以通过如下操作解决npm速度慢的问题
43
+npm install --registry=https://registry.npm.taobao.org
44
+
45
+# Serve with hot reload at localhost:9528
46
+npm run dev
47
+
48
+# Build for production with minification
49
+npm run build
50
+
51
+# Build for production and view the bundle analyzer report
52
+npm run build --report
53
+```
54
+
55
+## Demo
56
+
57
+![demo](https://github.com/PanJiaChen/PanJiaChen.github.io/blob/master/images/demo.gif)
58
+
59
+### Element-Ui 使用 cdn 教程
60
+
61
+首先找到 `index.html` ([根目录下](https://github.com/PanJiaChen/vue-admin-template/blob/element-ui-cdn/index.html))
62
+
63
+引入 Element 的 css 和 js ,并且引入 vue 。因为 Element-Ui 是依赖 vue 的,所以必须在它之前引入 vue 。
64
+
65
+之后找到 [webpack.base.conf.js](https://github.com/PanJiaChen/vue-admin-template/blob/element-ui-cdn/build/webpack.base.conf.js) 加入 `externals` 让 webpack 不打包 vue 和 element
66
+
67
+```
68
+externals: {
69
+  vue: 'Vue',
70
+  'element-ui':'ELEMENT'
71
+}
72
+```
73
+
74
+之后还有一个小细节是如果你用了全局对象方式引入 vue,就不需要 手动 `Vue.use(Vuex)` ,它会自动挂载,具体见 [issue](https://github.com/vuejs/vuex/issues/731)
75
+
76
+最终你可以使用 `npm run build --report` 查看效果
77
+如图:
78
+![demo](https://panjiachen.github.io/images/element-cdn.png)
79
+
80
+**[具体代码](https://github.com/PanJiaChen/vue-admin-template/commit/746aff560932704ae821f82f10b8b2a9681d5177)**
81
+
82
+**[对应分支](https://github.com/PanJiaChen/vue-admin-template/tree/element-ui-cdn)**
83
+
84
+## Browsers support
85
+
86
+Modern browsers and Internet Explorer 10+.
87
+
88
+| [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/edge/edge_48x48.png" alt="IE / Edge" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>IE / Edge | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/firefox/firefox_48x48.png" alt="Firefox" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Firefox | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/chrome/chrome_48x48.png" alt="Chrome" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Chrome | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/safari/safari_48x48.png" alt="Safari" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Safari |
89
+| --------- | --------- | --------- | --------- |
90
+| IE10, IE11, Edge| last 2 versions| last 2 versions| last 2 versions
91
+
92
+## License
93
+
94
+[MIT](https://github.com/PanJiaChen/vue-admin-template/blob/master/LICENSE) license.
95
+
96
+Copyright (c) 2017-present PanJiaChen

+ 88
- 0
VUECODE/smart-property-manage/README.md View File

@@ -0,0 +1,88 @@
1
+# vue-admin-template
2
+
3
+> A minimal vue admin template with Element UI & axios & iconfont & permission control & lint
4
+
5
+**Live demo:** http://panjiachen.github.io/vue-admin-template
6
+
7
+[中文文档](https://github.com/PanJiaChen/vue-admin-template/blob/master/README-zh.md)
8
+
9
+## Build Setup
10
+
11
+```bash
12
+# Clone project
13
+git clone https://github.com/PanJiaChen/vue-admin-template.git
14
+
15
+# Install dependencies
16
+npm install
17
+
18
+# Serve with hot reload at localhost:9528
19
+npm run dev
20
+
21
+# Build for production with minification
22
+npm run build
23
+
24
+# Build for production and view the bundle analyzer report
25
+npm run build --report
26
+```
27
+
28
+## Demo
29
+
30
+![demo](https://github.com/PanJiaChen/PanJiaChen.github.io/blob/master/images/demo.gif)
31
+
32
+## Extra
33
+
34
+If you want router permission && generate menu by user roles , you can use this branch [permission-control](https://github.com/PanJiaChen/vue-admin-template/tree/permission-control)
35
+
36
+This project is based on `webpack4` development. If you want to use `webpack3` development, please use this branch [webpack3](https://github.com/PanJiaChen/vue-admin-template/tree/webpack3)
37
+
38
+For `typescript` version, you can use [vue-typescript-admin-template](https://github.com/Armour/vue-typescript-admin-template) (Credits: [@Armour](https://github.com/Armour))
39
+
40
+## Related Project
41
+
42
+[vue-element-admin](https://github.com/PanJiaChen/vue-element-admin)
43
+
44
+[electron-vue-admin](https://github.com/PanJiaChen/electron-vue-admin)
45
+
46
+[vue-typescript-admin-template](https://github.com/Armour/vue-typescript-admin-template)
47
+
48
+### Element-Ui using cdn tutorial
49
+
50
+First find `index.html`([root directory](https://github.com/PanJiaChen/vue-admin-template/blob/element-ui-cdn/index.html))
51
+
52
+Import css and js of `Element`, and then import vue. Because `Element` is vue-dependent, vue must be import before it.
53
+
54
+Then find [webpack.base.conf.js](https://github.com/PanJiaChen/vue-admin-template/blob/element-ui-cdn/build/webpack.base.conf.js)
55
+Add `externals` to make webpack not package vue and element.
56
+
57
+```
58
+externals: {
59
+  vue: 'Vue',
60
+  'element-ui':'ELEMENT'
61
+}
62
+```
63
+
64
+Finally there is a small detail to pay attention to that if you import vue in global, you don't need to manually `Vue.use(Vuex)`, it will be automatically mounted, see
65
+[issue](https://github.com/vuejs/vuex/issues/731)
66
+
67
+And you can use `npm run build --report` to see the effect
68
+
69
+Pictured:
70
+![demo](https://panjiachen.github.io/images/element-cdn.png)
71
+
72
+**[Detailed code](https://github.com/PanJiaChen/vue-admin-template/commit/746aff560932704ae821f82f10b8b2a9681d5177)**
73
+
74
+**[Branch](https://github.com/PanJiaChen/vue-admin-template/tree/element-ui-cdn)**
75
+
76
+## Browsers support
77
+
78
+Modern browsers and Internet Explorer 10+.
79
+
80
+| [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/edge/edge_48x48.png" alt="IE / Edge" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>IE / Edge | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/firefox/firefox_48x48.png" alt="Firefox" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Firefox | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/chrome/chrome_48x48.png" alt="Chrome" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Chrome | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/safari/safari_48x48.png" alt="Safari" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Safari |
81
+| --------- | --------- | --------- | --------- |
82
+| IE10, IE11, Edge| last 2 versions| last 2 versions| last 2 versions
83
+
84
+## License
85
+
86
+[MIT](https://github.com/PanJiaChen/vue-admin-template/blob/master/LICENSE) license.
87
+
88
+Copyright (c) 2017-present PanJiaChen

+ 45
- 0
VUECODE/smart-property-manage/build/build.js View File

@@ -0,0 +1,45 @@
1
+'use strict'
2
+require('./check-versions')()
3
+
4
+process.env.NODE_ENV = 'production'
5
+
6
+const ora = require('ora')
7
+const rm = require('rimraf')
8
+const path = require('path')
9
+const chalk = require('chalk')
10
+const webpack = require('webpack')
11
+const config = require('../config')
12
+const webpackConfig = require('./webpack.prod.conf')
13
+
14
+const spinner = ora('building for production...')
15
+spinner.start()
16
+
17
+rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => {
18
+  if (err) throw err
19
+  webpack(webpackConfig, (err, stats) => {
20
+    spinner.stop()
21
+    if (err) throw err
22
+    process.stdout.write(
23
+      stats.toString({
24
+        colors: true,
25
+        modules: false,
26
+        children: false,
27
+        chunks: false,
28
+        chunkModules: false
29
+      }) + '\n\n'
30
+    )
31
+
32
+    if (stats.hasErrors()) {
33
+      console.log(chalk.red('  Build failed with errors.\n'))
34
+      process.exit(1)
35
+    }
36
+
37
+    console.log(chalk.cyan('  Build complete.\n'))
38
+    console.log(
39
+      chalk.yellow(
40
+        '  Tip: built files are meant to be served over an HTTP server.\n' +
41
+          "  Opening index.html over file:// won't work.\n"
42
+      )
43
+    )
44
+  })
45
+})

+ 64
- 0
VUECODE/smart-property-manage/build/check-versions.js View File

@@ -0,0 +1,64 @@
1
+'use strict'
2
+const chalk = require('chalk')
3
+const semver = require('semver')
4
+const packageConfig = require('../package.json')
5
+const shell = require('shelljs')
6
+
7
+function exec(cmd) {
8
+  return require('child_process')
9
+    .execSync(cmd)
10
+    .toString()
11
+    .trim()
12
+}
13
+
14
+const versionRequirements = [
15
+  {
16
+    name: 'node',
17
+    currentVersion: semver.clean(process.version),
18
+    versionRequirement: packageConfig.engines.node
19
+  }
20
+]
21
+
22
+if (shell.which('npm')) {
23
+  versionRequirements.push({
24
+    name: 'npm',
25
+    currentVersion: exec('npm --version'),
26
+    versionRequirement: packageConfig.engines.npm
27
+  })
28
+}
29
+
30
+module.exports = function() {
31
+  const warnings = []
32
+
33
+  for (let i = 0; i < versionRequirements.length; i++) {
34
+    const mod = versionRequirements[i]
35
+
36
+    if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) {
37
+      warnings.push(
38
+        mod.name +
39
+          ': ' +
40
+          chalk.red(mod.currentVersion) +
41
+          ' should be ' +
42
+          chalk.green(mod.versionRequirement)
43
+      )
44
+    }
45
+  }
46
+
47
+  if (warnings.length) {
48
+    console.log('')
49
+    console.log(
50
+      chalk.yellow(
51
+        'To use this template, you must update following to modules:'
52
+      )
53
+    )
54
+    console.log()
55
+
56
+    for (let i = 0; i < warnings.length; i++) {
57
+      const warning = warnings[i]
58
+      console.log('  ' + warning)
59
+    }
60
+
61
+    console.log()
62
+    process.exit(1)
63
+  }
64
+}

BIN
VUECODE/smart-property-manage/build/logo.png View File


+ 108
- 0
VUECODE/smart-property-manage/build/utils.js View File

@@ -0,0 +1,108 @@
1
+'use strict'
2
+const path = require('path')
3
+const config = require('../config')
4
+const MiniCssExtractPlugin = require('mini-css-extract-plugin')
5
+const packageConfig = require('../package.json')
6
+
7
+exports.assetsPath = function(_path) {
8
+  const assetsSubDirectory =
9
+    process.env.NODE_ENV === 'production'
10
+      ? config.build.assetsSubDirectory
11
+      : config.dev.assetsSubDirectory
12
+
13
+  return path.posix.join(assetsSubDirectory, _path)
14
+}
15
+
16
+exports.cssLoaders = function(options) {
17
+  options = options || {}
18
+
19
+  const cssLoader = {
20
+    loader: 'css-loader',
21
+    options: {
22
+      sourceMap: options.sourceMap
23
+    }
24
+  }
25
+
26
+  const postcssLoader = {
27
+    loader: 'postcss-loader',
28
+    options: {
29
+      sourceMap: options.sourceMap
30
+    }
31
+  }
32
+
33
+  // generate loader string to be used with extract text plugin
34
+  function generateLoaders(loader, loaderOptions) {
35
+    const loaders = []
36
+
37
+    // Extract CSS when that option is specified
38
+    // (which is the case during production build)
39
+    if (options.extract) {
40
+      loaders.push(MiniCssExtractPlugin.loader)
41
+    } else {
42
+      loaders.push('vue-style-loader')
43
+    }
44
+
45
+    loaders.push(cssLoader)
46
+
47
+    if (options.usePostCSS) {
48
+      loaders.push(postcssLoader)
49
+    }
50
+
51
+    if (loader) {
52
+      loaders.push({
53
+        loader: loader + '-loader',
54
+        options: Object.assign({}, loaderOptions, {
55
+          sourceMap: options.sourceMap
56
+        })
57
+      })
58
+    }
59
+
60
+    return loaders
61
+  }
62
+  // https://vue-loader.vuejs.org/en/configurations/extract-css.html
63
+  return {
64
+    css: generateLoaders(),
65
+    postcss: generateLoaders(),
66
+    less: generateLoaders('less'),
67
+    sass: generateLoaders('sass', {
68
+      indentedSyntax: true
69
+    }),
70
+    scss: generateLoaders('sass'),
71
+    stylus: generateLoaders('stylus'),
72
+    styl: generateLoaders('stylus')
73
+  }
74
+}
75
+
76
+// Generate loaders for standalone style files (outside of .vue)
77
+exports.styleLoaders = function(options) {
78
+  const output = []
79
+  const loaders = exports.cssLoaders(options)
80
+
81
+  for (const extension in loaders) {
82
+    const loader = loaders[extension]
83
+    output.push({
84
+      test: new RegExp('\\.' + extension + '$'),
85
+      use: loader
86
+    })
87
+  }
88
+
89
+  return output
90
+}
91
+
92
+exports.createNotifierCallback = () => {
93
+  const notifier = require('node-notifier')
94
+
95
+  return (severity, errors) => {
96
+    if (severity !== 'error') return
97
+
98
+    const error = errors[0]
99
+    const filename = error.file && error.file.split('!').pop()
100
+
101
+    notifier.notify({
102
+      title: packageConfig.name,
103
+      message: severity + ': ' + error.name,
104
+      subtitle: filename || '',
105
+      icon: path.join(__dirname, 'logo.png')
106
+    })
107
+  }
108
+}

+ 5
- 0
VUECODE/smart-property-manage/build/vue-loader.conf.js View File

@@ -0,0 +1,5 @@
1
+'use strict'
2
+
3
+module.exports = {
4
+  //You can set the vue-loader configuration by yourself.
5
+}

+ 117
- 0
VUECODE/smart-property-manage/build/webpack.base.conf.js View File

@@ -0,0 +1,117 @@
1
+'use strict'
2
+const path = require('path')
3
+const webpack = require('webpack')
4
+const utils = require('./utils')
5
+const config = require('../config')
6
+const { VueLoaderPlugin } = require('vue-loader')
7
+const vueLoaderConfig = require('./vue-loader.conf')
8
+
9
+function resolve (dir) {
10
+  return path.join(__dirname, '..', dir)
11
+}
12
+
13
+const createLintingRule = () => ({
14
+  test: /\.(js|vue)$/,
15
+  loader: 'eslint-loader',
16
+  enforce: 'pre',
17
+  include: [resolve('src'), resolve('test')],
18
+  options: {
19
+    formatter: require('eslint-friendly-formatter'),
20
+    emitWarning: !config.dev.showEslintErrorsInOverlay
21
+  }
22
+})
23
+
24
+module.exports = {
25
+  context: path.resolve(__dirname, '../'),
26
+  entry: {
27
+    app: './src/main.js'
28
+  },
29
+  output: {
30
+    path: config.build.assetsRoot,
31
+    filename: '[name].js',
32
+    publicPath:
33
+      process.env.NODE_ENV === 'production'
34
+        ? config.build.assetsPublicPath
35
+        : config.dev.assetsPublicPath
36
+  },
37
+  resolve: {
38
+    extensions: ['.js', '.vue', '.json'],
39
+    alias: {
40
+      '@': resolve('src')
41
+    }
42
+  },
43
+  module: {
44
+    rules: [
45
+      ...(config.dev.useEslint ? [createLintingRule()] : []),
46
+      {
47
+        test: /\.vue$/,
48
+        loader: 'vue-loader',
49
+        options: vueLoaderConfig
50
+      },
51
+      {
52
+        test: /\.js$/,
53
+        loader: 'babel-loader',
54
+        include: [
55
+          resolve('src'),
56
+          resolve('test'),
57
+          resolve('node_modules/webpack-dev-server/client')
58
+        ]
59
+      },
60
+      {
61
+        test: /\.svg$/,
62
+        loader: 'svg-sprite-loader',
63
+        include: [resolve('src/icons')],
64
+        options: {
65
+          symbolId: 'icon-[name]'
66
+        }
67
+      },
68
+      {
69
+        test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
70
+        loader: 'url-loader',
71
+        exclude: [resolve('src/icons')],
72
+        options: {
73
+          limit: 10000,
74
+          name: utils.assetsPath('img/[name].[hash:7].[ext]')
75
+        }
76
+      },
77
+      {
78
+        test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/,
79
+        loader: 'url-loader',
80
+        options: {
81
+          limit: 10000,
82
+          name: utils.assetsPath('media/[name].[hash:7].[ext]')
83
+        }
84
+      },
85
+      {
86
+        test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
87
+        loader: 'url-loader',
88
+        options: {
89
+          limit: 10000,
90
+          name: utils.assetsPath('fonts/[name].[hash:7].[ext]')
91
+        }
92
+      }
93
+    ]
94
+  },
95
+  plugins: [new VueLoaderPlugin(),
96
+  new webpack.ProvidePlugin({
97
+    $: "jquery",
98
+    jQuery: "jquery",
99
+    "windows.jQuery": "jquery"
100
+  })],
101
+  node: {
102
+    // prevent webpack from injecting useless setImmediate polyfill because Vue
103
+    // source contains it (although only uses it if it's native).
104
+    setImmediate: false,
105
+    // prevent webpack from injecting mocks to Node native modules
106
+    // that does not make sense for the client
107
+    dgram: 'empty',
108
+    fs: 'empty',
109
+    net: 'empty',
110
+    tls: 'empty',
111
+    child_process: 'empty'
112
+  },
113
+  externals: {
114
+    'AMap': 'AMap',
115
+    'AMapUI': 'AMapUI'
116
+  }
117
+}

+ 95
- 0
VUECODE/smart-property-manage/build/webpack.dev.conf.js View File

@@ -0,0 +1,95 @@
1
+'use strict'
2
+const path = require('path')
3
+const utils = require('./utils')
4
+const webpack = require('webpack')
5
+const config = require('../config')
6
+const merge = require('webpack-merge')
7
+const baseWebpackConfig = require('./webpack.base.conf')
8
+const HtmlWebpackPlugin = require('html-webpack-plugin')
9
+const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin')
10
+const portfinder = require('portfinder')
11
+
12
+function resolve (dir) {
13
+  return path.join(__dirname, '..', dir)
14
+}
15
+
16
+const HOST = process.env.HOST
17
+const PORT = process.env.PORT && Number(process.env.PORT)
18
+
19
+const devWebpackConfig = merge(baseWebpackConfig, {
20
+  mode: 'development',
21
+  module: {
22
+    rules: utils.styleLoaders({
23
+      sourceMap: config.dev.cssSourceMap,
24
+      usePostCSS: true
25
+    })
26
+  },
27
+  // cheap-module-eval-source-map is faster for development
28
+  devtool: config.dev.devtool,
29
+
30
+  // these devServer options should be customized in /config/index.js
31
+  devServer: {
32
+    clientLogLevel: 'warning',
33
+    historyApiFallback: true,
34
+    hot: true,
35
+    compress: true,
36
+    host: HOST || config.dev.host,
37
+    port: PORT || config.dev.port,
38
+    open: config.dev.autoOpenBrowser,
39
+    overlay: config.dev.errorOverlay
40
+      ? { warnings: false, errors: true }
41
+      : false,
42
+    publicPath: config.dev.assetsPublicPath,
43
+    proxy: config.dev.proxyTable,
44
+    quiet: true, // necessary for FriendlyErrorsPlugin
45
+    watchOptions: {
46
+      poll: config.dev.poll
47
+    }
48
+  },
49
+  plugins: [
50
+    new webpack.DefinePlugin({
51
+      'process.env': require('../config/dev.env')
52
+    }),
53
+    new webpack.HotModuleReplacementPlugin(),
54
+    // https://github.com/ampedandwired/html-webpack-plugin
55
+    new HtmlWebpackPlugin({
56
+      filename: 'index.html',
57
+      template: 'index.html',
58
+      inject: true,
59
+      favicon: resolve('zhihui.jpg'),
60
+      title: '智慧社区物业平台'
61
+    })
62
+  ]
63
+})
64
+
65
+module.exports = new Promise((resolve, reject) => {
66
+  portfinder.basePort = process.env.PORT || config.dev.port
67
+  portfinder.getPort((err, port) => {
68
+    if (err) {
69
+      reject(err)
70
+    } else {
71
+      // publish the new Port, necessary for e2e tests
72
+      process.env.PORT = port
73
+      // add port to devServer config
74
+      devWebpackConfig.devServer.port = port
75
+
76
+      // Add FriendlyErrorsPlugin
77
+      devWebpackConfig.plugins.push(
78
+        new FriendlyErrorsPlugin({
79
+          compilationSuccessInfo: {
80
+            messages: [
81
+              `Your application is running here: http://${
82
+              devWebpackConfig.devServer.host
83
+              }:${port}`
84
+            ]
85
+          },
86
+          onErrors: config.dev.notifyOnErrors
87
+            ? utils.createNotifierCallback()
88
+            : undefined
89
+        })
90
+      )
91
+
92
+      resolve(devWebpackConfig)
93
+    }
94
+  })
95
+})

+ 178
- 0
VUECODE/smart-property-manage/build/webpack.prod.conf.js View File

@@ -0,0 +1,178 @@
1
+'use strict'
2
+const path = require('path')
3
+const utils = require('./utils')
4
+const webpack = require('webpack')
5
+const config = require('../config')
6
+const merge = require('webpack-merge')
7
+const baseWebpackConfig = require('./webpack.base.conf')
8
+const CopyWebpackPlugin = require('copy-webpack-plugin')
9
+const HtmlWebpackPlugin = require('html-webpack-plugin')
10
+const ScriptExtHtmlWebpackPlugin = require('script-ext-html-webpack-plugin')
11
+const MiniCssExtractPlugin = require('mini-css-extract-plugin')
12
+const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin')
13
+const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
14
+
15
+function resolve(dir) {
16
+  return path.join(__dirname, '..', dir)
17
+}
18
+
19
+const env = require('../config/prod.env')
20
+
21
+// For NamedChunksPlugin
22
+const seen = new Set()
23
+const nameLength = 4
24
+
25
+const webpackConfig = merge(baseWebpackConfig, {
26
+  mode: 'production',
27
+  module: {
28
+    rules: utils.styleLoaders({
29
+      sourceMap: config.build.productionSourceMap,
30
+      extract: true,
31
+      usePostCSS: true
32
+    })
33
+  },
34
+  devtool: config.build.productionSourceMap ? config.build.devtool : false,
35
+  output: {
36
+    path: config.build.assetsRoot,
37
+    filename: utils.assetsPath('js/[name].[chunkhash:8].js'),
38
+    chunkFilename: utils.assetsPath('js/[name].[chunkhash:8].js')
39
+  },
40
+  plugins: [
41
+    // http://vuejs.github.io/vue-loader/en/workflow/production.html
42
+    new webpack.DefinePlugin({
43
+      'process.env': env
44
+    }),
45
+    // extract css into its own file
46
+    new MiniCssExtractPlugin({
47
+      filename: utils.assetsPath('css/[name].[contenthash:8].css'),
48
+      chunkFilename: utils.assetsPath('css/[name].[contenthash:8].css')
49
+    }),
50
+    // generate dist index.html with correct asset hash for caching.
51
+    // you can customize output by editing /index.html
52
+    // see https://github.com/ampedandwired/html-webpack-plugin
53
+    new HtmlWebpackPlugin({
54
+      filename: config.build.index,
55
+      template: 'index.html',
56
+      inject: true,
57
+      favicon: resolve('zhihui.jpg'),
58
+      title: '智慧社区物业平台',
59
+      minify: {
60
+        removeComments: true,
61
+        collapseWhitespace: true,
62
+        removeAttributeQuotes: true
63
+        // more options:
64
+        // https://github.com/kangax/html-minifier#options-quick-reference
65
+      }
66
+      // default sort mode uses toposort which cannot handle cyclic deps
67
+      // in certain cases, and in webpack 4, chunk order in HTML doesn't
68
+      // matter anyway
69
+    }),
70
+    new ScriptExtHtmlWebpackPlugin({
71
+      //`runtime` must same as runtimeChunk name. default is `runtime`
72
+      inline: /runtime\..*\.js$/
73
+    }),
74
+    // keep chunk.id stable when chunk has no name
75
+    new webpack.NamedChunksPlugin(chunk => {
76
+      if (chunk.name) {
77
+        return chunk.name
78
+      }
79
+      const modules = Array.from(chunk.modulesIterable)
80
+      if (modules.length > 1) {
81
+        const hash = require('hash-sum')
82
+        const joinedHash = hash(modules.map(m => m.id).join('_'))
83
+        let len = nameLength
84
+        while (seen.has(joinedHash.substr(0, len))) len++
85
+        seen.add(joinedHash.substr(0, len))
86
+        return `chunk-${joinedHash.substr(0, len)}`
87
+      } else {
88
+        return modules[0].id
89
+      }
90
+    }),
91
+    // keep module.id stable when vender modules does not change
92
+    new webpack.HashedModuleIdsPlugin(),
93
+    // copy custom static assets
94
+    new CopyWebpackPlugin([
95
+      {
96
+        from: path.resolve(__dirname, '../static'),
97
+        to: config.build.assetsSubDirectory,
98
+        ignore: ['.*']
99
+      }
100
+    ])
101
+  ],
102
+  optimization: {
103
+    splitChunks: {
104
+      chunks: 'all',
105
+      cacheGroups: {
106
+        libs: {
107
+          name: 'chunk-libs',
108
+          test: /[\\/]node_modules[\\/]/,
109
+          priority: 10,
110
+          chunks: 'initial' // 只打包初始时依赖的第三方
111
+        },
112
+        elementUI: {
113
+          name: 'chunk-elementUI', // 单独将 elementUI 拆包
114
+          priority: 20, // 权重要大于 libs 和 app 不然会被打包进 libs 或者 app
115
+          test: /[\\/]node_modules[\\/]element-ui[\\/]/
116
+        }
117
+      }
118
+    },
119
+    runtimeChunk: 'single',
120
+    minimizer: [
121
+      new UglifyJsPlugin({
122
+        uglifyOptions: {
123
+          mangle: {
124
+            safari10: true
125
+          }
126
+        },
127
+        sourceMap: config.build.productionSourceMap,
128
+        cache: true,
129
+        parallel: true
130
+      }),
131
+      // Compress extracted CSS. We are using this plugin so that possible
132
+      // duplicated CSS from different components can be deduped.
133
+      new OptimizeCSSAssetsPlugin()
134
+    ]
135
+  }
136
+})
137
+
138
+if (config.build.productionGzip) {
139
+  const CompressionWebpackPlugin = require('compression-webpack-plugin')
140
+
141
+  webpackConfig.plugins.push(
142
+    new CompressionWebpackPlugin({
143
+      asset: '[path].gz[query]',
144
+      algorithm: 'gzip',
145
+      test: new RegExp(
146
+        '\\.(' + config.build.productionGzipExtensions.join('|') + ')$'
147
+      ),
148
+      threshold: 10240,
149
+      minRatio: 0.8
150
+    })
151
+  )
152
+}
153
+
154
+if (config.build.generateAnalyzerReport || config.build.bundleAnalyzerReport) {
155
+  const BundleAnalyzerPlugin = require('webpack-bundle-analyzer')
156
+    .BundleAnalyzerPlugin
157
+
158
+  if (config.build.bundleAnalyzerReport) {
159
+    webpackConfig.plugins.push(
160
+      new BundleAnalyzerPlugin({
161
+        analyzerPort: 8080,
162
+        generateStatsFile: false
163
+      })
164
+    )
165
+  }
166
+
167
+  if (config.build.generateAnalyzerReport) {
168
+    webpackConfig.plugins.push(
169
+      new BundleAnalyzerPlugin({
170
+        analyzerMode: 'static',
171
+        reportFilename: 'bundle-report.html',
172
+        openAnalyzer: false
173
+      })
174
+    )
175
+  }
176
+}
177
+
178
+module.exports = webpackConfig

+ 8
- 0
VUECODE/smart-property-manage/config/dev.env.js View File

@@ -0,0 +1,8 @@
1
+'use strict'
2
+const merge = require('webpack-merge')
3
+const prodEnv = require('./prod.env')
4
+
5
+module.exports = merge(prodEnv, {
6
+  NODE_ENV: '"development"',
7
+  BASE_API: '"http://localhost:8085/operate-api"',
8
+})

+ 86
- 0
VUECODE/smart-property-manage/config/index.js View File

@@ -0,0 +1,86 @@
1
+'use strict'
2
+// Template version: 1.2.6
3
+// see http://vuejs-templates.github.io/webpack for documentation.
4
+
5
+const path = require('path')
6
+
7
+module.exports = {
8
+  dev: {
9
+    // Paths
10
+    assetsSubDirectory: 'static',
11
+    assetsPublicPath: '/',
12
+    proxyTable: {},
13
+
14
+    // Various Dev Server settings
15
+    host: 'localhost', // can be overwritten by process.env.HOST
16
+    port: 9528, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
17
+    autoOpenBrowser: true,
18
+    errorOverlay: true,
19
+    notifyOnErrors: false,
20
+    poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions-
21
+
22
+    // Use Eslint Loader?
23
+    // If true, your code will be linted during bundling and
24
+    // linting errors and warnings will be shown in the console.
25
+    useEslint: true,
26
+    // If true, eslint errors and warnings will also be shown in the error overlay
27
+    // in the browser.
28
+    showEslintErrorsInOverlay: false,
29
+
30
+    /**
31
+     * Source Maps
32
+     */
33
+
34
+    // https://webpack.js.org/configuration/devtool/#development
35
+    devtool: 'cheap-source-map',
36
+
37
+    // CSS Sourcemaps off by default because relative paths are "buggy"
38
+    // with this option, according to the CSS-Loader README
39
+    // (https://github.com/webpack/css-loader#sourcemaps)
40
+    // In our experience, they generally work as expected,
41
+    // just be aware of this issue when enabling this option.
42
+    cssSourceMap: false
43
+  },
44
+
45
+  build: {
46
+    // Template for index.html
47
+    index: path.resolve(__dirname, '../dist/index.html'),
48
+
49
+    // Paths
50
+    assetsRoot: path.resolve(__dirname, '../dist'),
51
+    assetsSubDirectory: 'static',
52
+
53
+    /**
54
+     * You can set by youself according to actual condition
55
+     * You will need to set this if you plan to deploy your site under a sub path,
56
+     * for example GitHub pages. If you plan to deploy your site to https://foo.github.io/bar/,
57
+     * then assetsPublicPath should be set to "/bar/".
58
+     * In most cases please use '/' !!!
59
+     */
60
+    assetsPublicPath: '/',
61
+
62
+    /**
63
+     * Source Maps
64
+     */
65
+
66
+    productionSourceMap: false,
67
+    // https://webpack.js.org/configuration/devtool/#production
68
+    devtool: 'source-map',
69
+
70
+    // Gzip off by default as many popular static hosts such as
71
+    // Surge or Netlify already gzip all static assets for you.
72
+    // Before setting to `true`, make sure to:
73
+    // npm install --save-dev compression-webpack-plugin
74
+    productionGzip: false,
75
+    productionGzipExtensions: ['js', 'css'],
76
+
77
+    // Run the build command with an extra argument to
78
+    // View the bundle analyzer report after build finishes:
79
+    // `npm run build --report`
80
+    // Set to `true` or `false` to always turn it on or off
81
+    bundleAnalyzerReport: process.env.npm_config_report || false,
82
+
83
+    // `npm run build:prod --generate_report`
84
+    generateAnalyzerReport: process.env.npm_config_generate_report || false
85
+  }
86
+}

+ 5
- 0
VUECODE/smart-property-manage/config/prod.env.js View File

@@ -0,0 +1,5 @@
1
+'use strict'
2
+module.exports = {
3
+  NODE_ENV: '"production"',
4
+  BASE_API: '"http://101.132.102.231:8085/operate-api"',
5
+}

BIN
VUECODE/smart-property-manage/favicon.ico View File


+ 14
- 0
VUECODE/smart-property-manage/index.html View File

@@ -0,0 +1,14 @@
1
+<!DOCTYPE html>
2
+<html>
3
+  <head>
4
+    <meta charset="utf-8">
5
+    <meta name="viewport" content="width=device-width,initial-scale=1.0">
6
+    <title>智慧社区物业平台</title>
7
+    <script src="//webapi.amap.com/maps?v=1.4.10&key=81f5560856a88eb5b3da440f18a97845&plugin=AMap.DistrictLayer"></script>
8
+    <script src="//webapi.amap.com/ui/1.0/main.js"></script>
9
+  </head>
10
+  <body>
11
+    <div id="app"></div>
12
+    <!-- built files will be auto injected -->
13
+  </body>
14
+</html>

+ 94
- 0
VUECODE/smart-property-manage/package.json View File

@@ -0,0 +1,94 @@
1
+{
2
+  "name": "vue-admin-template",
3
+  "version": "3.8.0",
4
+  "license": "MIT",
5
+  "description": "A vue admin template with Element UI & axios & iconfont & permission control & lint",
6
+  "author": "Pan <panfree23@gmail.com>",
7
+  "scripts": {
8
+    "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js",
9
+    "start": "npm run dev",
10
+    "build": "node build/build.js",
11
+    "build:report": "npm_config_report=true npm run build",
12
+    "lint": "eslint --ext .js,.vue src",
13
+    "test": "npm run lint",
14
+    "svgo": "svgo -f src/icons/svg --config=src/icons/svgo.yml"
15
+  },
16
+  "dependencies": {
17
+    "axios": "0.18.0",
18
+    "element-ui": "2.4.6",
19
+    "file-saver": "^2.0.0-rc.4",
20
+    "js-cookie": "2.2.0",
21
+    "normalize.css": "7.0.0",
22
+    "nprogress": "0.2.0",
23
+    "vue": "2.5.17",
24
+    "vue-amap": "^0.5.8",
25
+    "vue-router": "3.0.1",
26
+    "vuex": "3.0.1",
27
+    "wangeditor": "^3.1.1",
28
+    "xlsx": "^0.14.0",
29
+    "jquery": "^2.2.3"
30
+  },
31
+  "devDependencies": {
32
+    "@antv/data-set": "^0.10.1",
33
+    "@antv/g2": "^3.4.1",
34
+    "autoprefixer": "8.5.0",
35
+    "babel-core": "6.26.0",
36
+    "babel-eslint": "8.2.6",
37
+    "babel-helper-vue-jsx-merge-props": "2.0.3",
38
+    "babel-loader": "7.1.5",
39
+    "babel-plugin-syntax-jsx": "6.18.0",
40
+    "babel-plugin-transform-runtime": "6.23.0",
41
+    "babel-plugin-transform-vue-jsx": "3.7.0",
42
+    "babel-preset-env": "1.7.0",
43
+    "babel-preset-stage-2": "6.24.1",
44
+    "chalk": "2.4.1",
45
+    "copy-webpack-plugin": "4.5.2",
46
+    "css-loader": "1.0.0",
47
+    "eslint": "4.19.1",
48
+    "eslint-friendly-formatter": "4.0.1",
49
+    "eslint-loader": "2.0.0",
50
+    "eslint-plugin-vue": "4.7.1",
51
+    "eventsource-polyfill": "0.9.6",
52
+    "file-loader": "1.1.11",
53
+    "friendly-errors-webpack-plugin": "1.7.0",
54
+    "html-webpack-plugin": "4.0.0-alpha",
55
+    "jquery": "^2.2.3",
56
+    "mini-css-extract-plugin": "0.4.1",
57
+    "node-notifier": "5.2.1",
58
+    "node-sass": "^4.7.2",
59
+    "optimize-css-assets-webpack-plugin": "5.0.0",
60
+    "ora": "3.0.0",
61
+    "path-to-regexp": "2.4.0",
62
+    "portfinder": "1.0.16",
63
+    "postcss-import": "12.0.0",
64
+    "postcss-loader": "2.1.6",
65
+    "postcss-url": "7.3.2",
66
+    "rimraf": "2.6.2",
67
+    "sass-loader": "7.0.3",
68
+    "script-ext-html-webpack-plugin": "2.0.1",
69
+    "script-loader": "^0.7.2",
70
+    "semver": "5.5.0",
71
+    "shelljs": "0.8.2",
72
+    "svg-sprite-loader": "3.8.0",
73
+    "svgo": "1.0.5",
74
+    "uglifyjs-webpack-plugin": "1.2.7",
75
+    "url-loader": "1.0.1",
76
+    "vue-loader": "15.3.0",
77
+    "vue-style-loader": "4.1.2",
78
+    "vue-template-compiler": "2.5.17",
79
+    "webpack": "4.16.5",
80
+    "webpack-bundle-analyzer": "2.13.1",
81
+    "webpack-cli": "3.1.0",
82
+    "webpack-dev-server": "3.1.5",
83
+    "webpack-merge": "4.1.4"
84
+  },
85
+  "engines": {
86
+    "node": ">= 6.0.0",
87
+    "npm": ">= 3.0.0"
88
+  },
89
+  "browserslist": [
90
+    "> 1%",
91
+    "last 2 versions",
92
+    "not ie <= 8"
93
+  ]
94
+}

+ 11
- 0
VUECODE/smart-property-manage/src/App.vue View File

@@ -0,0 +1,11 @@
1
+<template>
2
+  <div id="app">
3
+    <router-view/>
4
+  </div>
5
+</template>
6
+
7
+<script>
8
+export default {
9
+  name: 'App'
10
+}
11
+</script>

+ 46
- 0
VUECODE/smart-property-manage/src/api/banner.js View File

@@ -0,0 +1,46 @@
1
+import request from '@/utils/request'
2
+
3
+// 根据条件查询 banner
4
+export function getBanner(banner) {
5
+  return request({
6
+    url: '/banner/list',
7
+    method: 'get',
8
+    params: banner
9
+  })
10
+}
11
+
12
+// 添加banner
13
+export function addBanner(banner) {
14
+  return request({
15
+    url: '/banner',
16
+    method: 'post',
17
+    data: banner
18
+  })
19
+}
20
+
21
+// 修改 banner
22
+export function updateBanner(banner) {
23
+  return request({
24
+    url: '/banner',
25
+    method: 'put',
26
+    data: banner
27
+  })
28
+}
29
+
30
+// 删除 banner, 批量[10,25,65]
31
+export function deleteBanner(bannerId) {
32
+  return request({
33
+    url: '/banner',
34
+    method: 'delete',
35
+    data: bannerId
36
+  })
37
+}
38
+
39
+// 根据bannerId 查询 banner
40
+export function getByBannerId(bannerId) {
41
+  return request({
42
+    url: '/banner/' + bannerId,
43
+    method: 'get'
44
+  })
45
+}
46
+

+ 48
- 0
VUECODE/smart-property-manage/src/api/community.js View File

@@ -0,0 +1,48 @@
1
+import request from '@/utils/request'
2
+
3
+export function fetchList(query) {
4
+  return request({
5
+    url: '/communitys',
6
+    method: 'get',
7
+    params: query
8
+  })
9
+}
10
+
11
+export function createCommunity(data) {
12
+  return request({
13
+    url: '/community/add',
14
+    method: 'post',
15
+    data
16
+  })
17
+}
18
+
19
+export function updateCommunity(data) {
20
+  return request({
21
+    url: '/community/update',
22
+    method: 'post',
23
+    data
24
+  })
25
+}
26
+
27
+export function fetchProvinceList() {
28
+  return request({
29
+    url: '/common/province',
30
+    method: 'get'
31
+  })
32
+}
33
+
34
+export function fetchCityList(query) {
35
+  return request({
36
+    url: '/common/city',
37
+    method: 'get',
38
+    params: { provinceId: query }
39
+  })
40
+}
41
+
42
+export function fetchDistrictList(query) {
43
+  return request({
44
+    url: '/common/district',
45
+    method: 'get',
46
+    params: { cityId: query }
47
+  })
48
+}

+ 17
- 0
VUECODE/smart-property-manage/src/api/index.js View File

@@ -0,0 +1,17 @@
1
+import request from '@/utils/request'
2
+
3
+// 硬件数据统计
4
+export function getHardData () {
5
+  return request({
6
+    url: '/mq/open',
7
+    method: 'get'
8
+  })
9
+}
10
+
11
+// 注册用户统计
12
+export function getSignUser () {
13
+  return request({
14
+    url: '/user/count',
15
+    method: 'get'
16
+  })
17
+}

+ 38
- 0
VUECODE/smart-property-manage/src/api/login.js View File

@@ -0,0 +1,38 @@
1
+import request from '@/utils/request'
2
+
3
+export function login(username, password) {
4
+  const config = {
5
+    url: '/user/login',
6
+    method: 'post',
7
+    data: {
8
+      'loginName': username,
9
+      'code': password
10
+    }
11
+  }
12
+
13
+  return request(config)
14
+}
15
+
16
+export function getInfo() {
17
+  return request({
18
+    url: '/user/info',
19
+    method: 'get'
20
+    // params: { token }
21
+  })
22
+}
23
+
24
+export function logout() {
25
+  return request({
26
+    url: '/user/logout',
27
+    method: 'post'
28
+  })
29
+}
30
+
31
+// 发送验证码
32
+export function sendCode(phone) {
33
+  return request({
34
+    url: '/code/sendCode',
35
+    method: 'post',
36
+    params: { phone }
37
+  })
38
+}

+ 9
- 0
VUECODE/smart-property-manage/src/api/table.js View File

@@ -0,0 +1,9 @@
1
+import request from '@/utils/request'
2
+
3
+export function getList(params) {
4
+  return request({
5
+    url: '/banner/list',
6
+    method: 'get',
7
+    params
8
+  })
9
+}

BIN
VUECODE/smart-property-manage/src/assets/404_images/404.png View File


BIN
VUECODE/smart-property-manage/src/assets/404_images/404_cloud.png View File


BIN
VUECODE/smart-property-manage/src/assets/light1.png View File


BIN
VUECODE/smart-property-manage/src/assets/light2.png View File


BIN
VUECODE/smart-property-manage/src/assets/light3.png View File


BIN
VUECODE/smart-property-manage/src/assets/light4.png View File


+ 61
- 0
VUECODE/smart-property-manage/src/components/Breadcrumb/index.vue View File

@@ -0,0 +1,61 @@
1
+<template>
2
+  <el-breadcrumb class="app-breadcrumb" separator="/">
3
+    <transition-group name="breadcrumb">
4
+      <el-breadcrumb-item v-for="(item,index) in levelList" v-if="item.meta.title" :key="item.path">
5
+        <span v-if="item.redirect==='noredirect'||index==levelList.length-1" class="no-redirect">{{ item.meta.title }}</span>
6
+        <router-link v-else :to="item.redirect||item.path">{{ item.meta.title }}</router-link>
7
+      </el-breadcrumb-item>
8
+    </transition-group>
9
+  </el-breadcrumb>
10
+</template>
11
+
12
+<script>
13
+import pathToRegexp from 'path-to-regexp'
14
+
15
+export default {
16
+  data() {
17
+    return {
18
+      levelList: null
19
+    }
20
+  },
21
+  watch: {
22
+    $route() {
23
+      this.getBreadcrumb()
24
+    }
25
+  },
26
+  created() {
27
+    this.getBreadcrumb()
28
+  },
29
+  methods: {
30
+    getBreadcrumb() {
31
+      const { params } = this.$route
32
+      let matched = this.$route.matched.filter(item => {
33
+        if (item.name) {
34
+          // To solve this problem https://github.com/PanJiaChen/vue-element-admin/issues/561
35
+          var toPath = pathToRegexp.compile(item.path)
36
+          item.path = toPath(params)
37
+          return true
38
+        }
39
+      })
40
+      const first = matched[0]
41
+      if (first && first.name !== 'dashboard') {
42
+        matched = [{ path: '/dashboard', meta: { title: 'Dashboard' }}].concat(matched)
43
+      }
44
+      this.levelList = matched
45
+    }
46
+  }
47
+}
48
+</script>
49
+
50
+<style rel="stylesheet/scss" lang="scss" scoped>
51
+  .app-breadcrumb.el-breadcrumb {
52
+    display: inline-block;
53
+    font-size: 14px;
54
+    line-height: 50px;
55
+    margin-left: 10px;
56
+    .no-redirect {
57
+      color: #97a8be;
58
+      cursor: text;
59
+    }
60
+  }
61
+</style>

+ 58
- 0
VUECODE/smart-property-manage/src/components/Hamburger/index.vue View File

@@ -0,0 +1,58 @@
1
+<template>
2
+  <div>
3
+    <svg
4
+      :class="{'is-active':isActive}"
5
+      t="1492500959545"
6
+      class="hamburger"
7
+      style=""
8
+      viewBox="0 0 1024 1024"
9
+      version="1.1"
10
+      xmlns="http://www.w3.org/2000/svg"
11
+      p-id="1691"
12
+      xmlns:xlink="http://www.w3.org/1999/xlink"
13
+      width="64"
14
+      height="64"
15
+      @click="toggleClick">
16
+      <path
17
+        d="M966.8023 568.849776 57.196677 568.849776c-31.397081 0-56.850799-25.452695-56.850799-56.850799l0 0c0-31.397081 25.452695-56.849776 56.850799-56.849776l909.605623 0c31.397081 0 56.849776 25.452695 56.849776 56.849776l0 0C1023.653099 543.397081 998.200404 568.849776 966.8023 568.849776z"
18
+        p-id="1692" />
19
+      <path
20
+        d="M966.8023 881.527125 57.196677 881.527125c-31.397081 0-56.850799-25.452695-56.850799-56.849776l0 0c0-31.397081 25.452695-56.849776 56.850799-56.849776l909.605623 0c31.397081 0 56.849776 25.452695 56.849776 56.849776l0 0C1023.653099 856.07443 998.200404 881.527125 966.8023 881.527125z"
21
+        p-id="1693" />
22
+      <path
23
+        d="M966.8023 256.17345 57.196677 256.17345c-31.397081 0-56.850799-25.452695-56.850799-56.849776l0 0c0-31.397081 25.452695-56.850799 56.850799-56.850799l909.605623 0c31.397081 0 56.849776 25.452695 56.849776 56.850799l0 0C1023.653099 230.720755 998.200404 256.17345 966.8023 256.17345z"
24
+        p-id="1694" />
25
+    </svg>
26
+  </div>
27
+</template>
28
+
29
+<script>
30
+export default {
31
+  name: 'Hamburger',
32
+  props: {
33
+    isActive: {
34
+      type: Boolean,
35
+      default: false
36
+    },
37
+    toggleClick: {
38
+      type: Function,
39
+      default: null
40
+    }
41
+  }
42
+}
43
+</script>
44
+
45
+<style scoped>
46
+.hamburger {
47
+	display: inline-block;
48
+	cursor: pointer;
49
+	width: 20px;
50
+	height: 20px;
51
+	transform: rotate(90deg);
52
+	transition: .38s;
53
+	transform-origin: 50% 50%;
54
+}
55
+.hamburger.is-active {
56
+	transform: rotate(0deg);
57
+}
58
+</style>

+ 99
- 0
VUECODE/smart-property-manage/src/components/Pagination/index.vue View File

@@ -0,0 +1,99 @@
1
+<template>
2
+  <div :class="{'hidden':hidden}" class="pagination-container">
3
+    <el-pagination
4
+      :background="background"
5
+      :current-page.sync="currentPage"
6
+      :page-size.sync="pageSize"
7
+      :layout="layout"
8
+      :total="total"
9
+      v-bind="$attrs"
10
+      @size-change="handleSizeChange"
11
+      @current-change="handleCurrentChange"/>
12
+  </div>
13
+</template>
14
+
15
+<script>
16
+import { scrollTo } from '@/utils/scrollTo'
17
+
18
+export default {
19
+  name: 'Pagination',
20
+  props: {
21
+    total: {
22
+      required: true,
23
+      type: Number
24
+    },
25
+    page: {
26
+      type: Number,
27
+      default: 1
28
+    },
29
+    limit: {
30
+      type: Number,
31
+      default: 20
32
+    },
33
+    pageSizes: {
34
+      type: Array,
35
+      default() {
36
+        return [10, 20, 30, 50]
37
+      }
38
+    },
39
+    layout: {
40
+      type: String,
41
+      default: 'total, sizes, prev, pager, next, jumper'
42
+    },
43
+    background: {
44
+      type: Boolean,
45
+      default: true
46
+    },
47
+    autoScroll: {
48
+      type: Boolean,
49
+      default: true
50
+    },
51
+    hidden: {
52
+      type: Boolean,
53
+      default: false
54
+    }
55
+  },
56
+  computed: {
57
+    currentPage: {
58
+      get() {
59
+        return this.page
60
+      },
61
+      set(val) {
62
+        this.$emit('update:page', val)
63
+      }
64
+    },
65
+    pageSize: {
66
+      get() {
67
+        return this.limit
68
+      },
69
+      set(val) {
70
+        this.$emit('update:limit', val)
71
+      }
72
+    }
73
+  },
74
+  methods: {
75
+    handleSizeChange(val) {
76
+      this.$emit('pagination', { page: this.currentPage, limit: val })
77
+      if (this.autoScroll) {
78
+        scrollTo(0, 800)
79
+      }
80
+    },
81
+    handleCurrentChange(val) {
82
+      this.$emit('pagination', { page: val, limit: this.pageSize })
83
+      if (this.autoScroll) {
84
+        scrollTo(0, 800)
85
+      }
86
+    }
87
+  }
88
+}
89
+</script>
90
+
91
+<style scoped>
92
+.pagination-container {
93
+  background: #fff;
94
+  padding: 32px 16px;
95
+}
96
+.pagination-container.hidden {
97
+  display: none;
98
+}
99
+</style>

+ 43
- 0
VUECODE/smart-property-manage/src/components/SvgIcon/index.vue View File

@@ -0,0 +1,43 @@
1
+<template>
2
+  <svg :class="svgClass" aria-hidden="true">
3
+    <use :xlink:href="iconName"/>
4
+  </svg>
5
+</template>
6
+
7
+<script>
8
+export default {
9
+  name: 'SvgIcon',
10
+  props: {
11
+    iconClass: {
12
+      type: String,
13
+      required: true
14
+    },
15
+    className: {
16
+      type: String,
17
+      default: ''
18
+    }
19
+  },
20
+  computed: {
21
+    iconName() {
22
+      return `#icon-${this.iconClass}`
23
+    },
24
+    svgClass() {
25
+      if (this.className) {
26
+        return 'svg-icon ' + this.className
27
+      } else {
28
+        return 'svg-icon'
29
+      }
30
+    }
31
+  }
32
+}
33
+</script>
34
+
35
+<style scoped>
36
+.svg-icon {
37
+  width: 1em;
38
+  height: 1em;
39
+  vertical-align: -0.15em;
40
+  fill: currentColor;
41
+  overflow: hidden;
42
+}
43
+</style>

+ 105
- 0
VUECODE/smart-property-manage/src/components/Wangeditor/index.vue View File

@@ -0,0 +1,105 @@
1
+<template>
2
+  <div id="wangeditor">
3
+    <div ref="editorElem" style="text-align:left" />
4
+  </div>
5
+</template>
6
+
7
+<script>
8
+import E from 'wangeditor'
9
+import { mapGetters } from 'vuex'
10
+export default {
11
+  name: 'EditorElem',
12
+  props: ['content'], // 接收父组件的方法
13
+  data() {
14
+    return {
15
+      editorContent: this.content, // 内容
16
+      editorObject: ''
17
+    }
18
+  },
19
+  computed: {
20
+    ...mapGetters([
21
+      'token'
22
+    ])
23
+  },
24
+  mounted() {
25
+    this.editorObject = new E(this.$refs.editorElem) // 创建富文本实例
26
+    var editor = this.editorObject
27
+    editor.customConfig.onchange = (html) => {
28
+      this.editorContent = html
29
+      this.childWangeditorValue() // 把这个html通过catchData的方法传入父组件
30
+      // this.catchData(html) // 把这个html通过catchData的方法传入父组件
31
+    }
32
+    editor.customConfig.uploadImgServer = process.env.BASE_API + '/uploadimage'
33
+    editor.customConfig.uploadFileName = 'uploadFiles'
34
+    editor.customConfig.uploadImgHeaders = {
35
+      'Accept': '*/*',
36
+      'Authorization': 'Bearer ' + this.token // 头部token
37
+    }
38
+    editor.customConfig.menus = [ // 菜单配置
39
+      'head',
40
+      'list', // 列表
41
+      'justify', // 对齐方式
42
+      'bold',
43
+      'fontSize', // 字号
44
+      'italic',
45
+      'underline',
46
+      'image', // 插入图片
47
+      'foreColor', // 文字颜色
48
+      'undo', // 撤销
49
+      'redo' // 重复
50
+    ]
51
+    // 下面是最重要的的方法
52
+    editor.customConfig.uploadImgHooks = {
53
+      before: function(xhr, editor, files) {
54
+        // 图片上传之前触发
55
+        // xhr 是 XMLHttpRequst 对象,editor 是编辑器对象,files是选择的图片文件
56
+        // 如果返回的结果是 {prevent: true, msg: 'xxxx'} 则表示用户放弃上传
57
+        // return {
58
+        //     prevent: true,
59
+        //     msg: '放弃上传'
60
+        // }
61
+      },
62
+      success: function(xhr, editor, result) {
63
+        // 图片上传并返回结果,图片插入成功之后触发
64
+        // xhr 是 XMLHttpRequst 对象,editor 是编辑器对象,result 是服务器端返回的结果
65
+        this.imgUrl = Object.values(result.data).toString()
66
+      },
67
+      fail: function(xhr, editor, result) {
68
+        // 图片上传并返回结果,但图片插入错误时触发
69
+        // xhr 是 XMLHttpRequst 对象,editor 是编辑器对象,result 是服务器端返回的结果
70
+      },
71
+      error: function(xhr, editor) {
72
+        // 图片上传出错时触发
73
+        // xhr 是 XMLHttpRequst 对象,editor 是编辑器对象
74
+      },
75
+      timeout: function(xhr, editor) {
76
+        // 图片上传超时时触发
77
+        // xhr 是 XMLHttpRequst 对象,editor 是编辑器对象
78
+      },
79
+      // 如果服务器端返回的不是 {errno:0, data: [...]} 这种格式,可使用该配置
80
+      // (但是,服务器端返回的必须是一个 JSON 格式字符串!!!否则会报错)
81
+      customInsert: function(insertImg, result, editor) {
82
+        // 图片上传并返回结果,自定义插入图片的事件(而不是编辑器自动插入图片!!!)
83
+        // insertImg 是插入图片的函数,editor 是编辑器对象,result 是服务器端返回的结果
84
+        // 举例:假如上传图片成功后,服务器端返回的是 {url:'....'} 这种格式,即可这样插入图片:
85
+        const url = Object.values(result.data)// result.data就是服务器返回的图片名字和链接
86
+        JSON.stringify(url)// 在这里转成JSON格式
87
+        insertImg(url)
88
+        // result 必须是一个 JSON 格式字符串!!!否则报错
89
+      }
90
+    }
91
+    editor.create()
92
+    editor.txt.html(this.editorContent)
93
+  },
94
+  methods: {
95
+    childWangeditorValue() {
96
+      console.log('富文本组件的值:', this.editorContent)
97
+      this.$emit('wangeditorEvent', this.editorContent)
98
+    },
99
+    setWangeditorValue(value) { // 父组件调用此方法传入参数
100
+      this.editorObject.txt.html(value)
101
+    }
102
+  }
103
+}
104
+
105
+</script>

+ 108
- 0
VUECODE/smart-property-manage/src/components/chart/chart1.vue View File

@@ -0,0 +1,108 @@
1
+<template>
2
+  <div id="node1">
3
+  </div>
4
+</template>
5
+
6
+<script>
7
+import G2 from '@antv/g2'
8
+import DataSet from '@antv/data-set'
9
+import $ from 'jquery'
10
+
11
+export default {
12
+  mounted () {
13
+    this.rander()
14
+  },
15
+  methods: {
16
+    rander () {
17
+      var data = [{
18
+        type: '未解决',
19
+        percent: 0.3
20
+      }, {
21
+        type: '已解决',
22
+        percent: 0.7
23
+      },]
24
+      var sum = 200
25
+      var ds = new DataSet()
26
+      var dv = ds.createView().source(data)
27
+      dv.transform({
28
+        type: 'map',
29
+        callback: function callback (row) {
30
+          row.value = parseInt(sum * row.percent)
31
+          return row
32
+        }
33
+      })
34
+      var chart = new G2.Chart({
35
+        container: 'node1',
36
+        forceFit: true,
37
+        height: 282,
38
+        // height: window.innerHeight / 3 - 50,
39
+        padding: [30, 'auto', 'auto', 'auto']
40
+      })
41
+      chart.source(dv)
42
+      chart.tooltip(false)
43
+      // chart.legend({
44
+      //   position: 'right-center',
45
+      //   offsetX: -100
46
+      // })
47
+      chart.coord('theta', {
48
+        radius: 0.75,
49
+        innerRadius: 0.6
50
+      })
51
+      chart.intervalStack().position('percent').color('type', ['#53F9FF', '#1A1E22']).opacity(1).label('percent', {
52
+        offset: -18,
53
+        textStyle: {
54
+          fill: 'white',
55
+          fontSize: 12,
56
+          shadowBlur: 2,
57
+          shadowColor: 'rgba(0, 0, 0, .45)'
58
+        },
59
+        rotate: 0,
60
+        autoRotate: false,
61
+        formatter: function formatter (text, item) {
62
+          return String(parseInt(item.point.percent * 100)) + '%'
63
+        }
64
+      })
65
+      chart.guide().html({
66
+        position: ['50%', '50%'],
67
+        html: '<div class="g2-guide-html"><p class="title">总计</p><p class="value">200</p></div>'
68
+      })
69
+      chart.guide().html({
70
+        position: ['50%', '-10%'],
71
+        html: '<div class="g2-guide-title"><p class="title">昨日工单解决情况200单</p></div>'
72
+      })
73
+      chart.on('interval:mouseenter', function (ev) {
74
+        var data = ev.data._origin
75
+        $(".g2-guide-html").css('opacity', 1)
76
+        $(".g2-guide-html .title").text(data.type)
77
+        $(".g2-guide-html .value").text(data.value)
78
+      })
79
+
80
+      chart.on('interval:mouseleave', function () {
81
+        $(".g2-guide-html .title").text('总计')
82
+        $(".g2-guide-html .value").text(200)
83
+      })
84
+      chart.render()
85
+    }
86
+  }
87
+}
88
+</script>
89
+
90
+<style lang="scss">
91
+#node1 {
92
+  .g2-guide-html {
93
+    color: #a4b6c5;
94
+    .title {
95
+      text-align: "ceter";
96
+    }
97
+    .value {
98
+      text-align: center;
99
+    }
100
+  }
101
+  .g2-guide-title {
102
+    color: #a4b6c5;
103
+    .title {
104
+      font-size: 16px;
105
+    }
106
+  }
107
+}
108
+</style>

+ 98
- 0
VUECODE/smart-property-manage/src/components/chart/chart2.vue View File

@@ -0,0 +1,98 @@
1
+<template>
2
+  <div id="node2"></div>
3
+</template>
4
+
5
+<script>
6
+import G2 from '@antv/g2'
7
+import DataSet from '@antv/data-set'
8
+
9
+export default {
10
+  mounted () {
11
+    this.rander()
12
+  },
13
+  methods: {
14
+    rander () {
15
+      var data = [{
16
+        item: '报修单一',
17
+        count: 40,
18
+        percent: 0.4
19
+      }, {
20
+        item: '报修单二',
21
+        count: 21,
22
+        percent: 0.21
23
+      }, {
24
+        item: '报修单三',
25
+        count: 17,
26
+        percent: 0.17
27
+      }, {
28
+        item: '报修单四',
29
+        count: 13,
30
+        percent: 0.13
31
+      }]
32
+      var chart = new G2.Chart({
33
+        container: 'node2',
34
+        forceFit: true,
35
+        height: 282,
36
+        padding: [40, 'auto', 'auto', 'auto']
37
+      })
38
+      chart.source(data, {
39
+        percent: {
40
+          formatter: function formatter (val) {
41
+            val = val * 100 + '%'
42
+            return val
43
+          }
44
+        }
45
+      })
46
+      chart.coord('theta', {
47
+        radius: 0.75
48
+      })
49
+      chart.guide().html({
50
+        position: ['50%', '-15%'],
51
+        html: '<div class="chart2-title"><p class="title">今日新增工单</p></div>'
52
+      })
53
+      chart.tooltip({
54
+        showTitle: false,
55
+        itemTpl: '<li><span style="background-color:{color}" class="g2-tooltip-marker"></span>{name}: {value}</li>'
56
+      })
57
+      chart.intervalStack().position('percent').color('item', function (val) {
58
+        if (val === '报修单一') {
59
+          return '#53F9FF'
60
+        } else if (val === '报修单二') {
61
+          return '#83BB41'
62
+        } else if (val === '报修单三') {
63
+          return '#FFC400'
64
+        } else if (val === '报修单四') {
65
+          return '#454D54'
66
+        }
67
+      }).label('percent', {
68
+        formatter: function formatter (val, item) {
69
+          return item._origin.item + ': ' + val
70
+        },
71
+        textStyle: {
72
+          fill: '#a4b6c5', // 文本的颜色
73
+          fontSize: '12', // 文本大小
74
+        }
75
+      }).tooltip('item*percent', function (item, percent) {
76
+        percent = percent * 100 + '%'
77
+        return {
78
+          name: item,
79
+          value: percent
80
+        }
81
+      }).style({
82
+        lineWidth: 1,
83
+        stroke: '#fff'
84
+      })
85
+      chart.render()
86
+    }
87
+  }
88
+}
89
+</script>
90
+
91
+<style lang="scss">
92
+.chart2-title {
93
+  .title {
94
+    font-size: 16px;
95
+    color: #a4b6c5;
96
+  }
97
+}
98
+</style>

+ 101
- 0
VUECODE/smart-property-manage/src/components/chart/chart3.vue View File

@@ -0,0 +1,101 @@
1
+<template>
2
+  <div id="node3">
3
+    <div class="title">今日所有小区智能硬件数据统计</div>
4
+    <div class="table">
5
+      <div
6
+        v-for="(item,index) in arr"
7
+        :key="index"
8
+        @mouseover="item.active = true"
9
+        @mouseout="item.active=false"
10
+        :class="{active:item.active}"
11
+      >
12
+        <div>{{item.text}}</div>
13
+        <div>{{item.num}}</div>
14
+      </div>
15
+    </div>
16
+  </div>
17
+</template>
18
+
19
+<script>
20
+import { mapState, mapActions } from 'vuex'
21
+
22
+export default {
23
+  computed: {
24
+    ...mapState('trunkIndex', {
25
+      hardData: item => item.trunkIndex.hardData
26
+    })
27
+  },
28
+  data () {
29
+    return {
30
+      arr: [
31
+        { text: '小区门禁开启', num: '13400次', active: false },
32
+        { text: '单元门开启', num: '12788次', active: false },
33
+        { text: '车辆进入数量', num: '5664辆', active: false },
34
+        { text: '咖啡厅销量', num: '3994次', active: false },
35
+        { text: '智慧食堂销量', num: '5664人次', active: false },
36
+        { text: '健身房健身', num: '1255人次', active: false },
37
+      ]
38
+    }
39
+  },
40
+  created () {
41
+    this.GetHardData().then(() => {
42
+      console.log(this.hardData)
43
+      this.hardData.forEach(item => {
44
+        if (item.message === '小区开门次数') {
45
+          this.arr[0].num = item.count + '次'
46
+        } else if (item.message === '单元门开门次数') {
47
+          this.arr[1].num = item.count + '次'
48
+        }
49
+      });
50
+      this.arr = JSON.parse(JSON.stringify(this.arr))
51
+    })
52
+  },
53
+  methods: {
54
+    ...mapActions('trunkIndex', [
55
+      'GetHardData'
56
+    ]),
57
+  }
58
+}
59
+</script>
60
+
61
+<style lang="scss" scoped>
62
+#node3 {
63
+  position: relative;
64
+  .title {
65
+    text-align: center;
66
+    padding: 3% 0 30px 0;
67
+    color: #a4b6c5;
68
+  }
69
+  .table {
70
+    display: flex;
71
+    flex-flow: row wrap;
72
+    border: 1px solid #a4b6c5;
73
+    width: 302px;
74
+    margin: 0 auto;
75
+    > div {
76
+      width: 100px;
77
+      height: 100px;
78
+      border: 1px solid #a4b6c5;
79
+      display: flex;
80
+      flex-flow: column nowrap;
81
+      justify-content: center;
82
+      align-items: center;
83
+      &:hover {
84
+        cursor: pointer;
85
+      }
86
+      div {
87
+        color: #a4b6c5;
88
+        margin: 5px;
89
+        font-size: 13px;
90
+      }
91
+    }
92
+    .active {
93
+      outline: 2px solid #53f9ff;
94
+      z-index: 1;
95
+      div {
96
+        color: #53f9ff;
97
+      }
98
+    }
99
+  }
100
+}
101
+</style>

+ 125
- 0
VUECODE/smart-property-manage/src/components/chart/chart4.vue View File

@@ -0,0 +1,125 @@
1
+<template>
2
+  <div id="node4">
3
+    <div class="top-title">已合作社区分布图</div>
4
+    <el-amap
5
+      ref="map"
6
+      vid="amapDemo"
7
+      :center="mapCenter"
8
+      :zoom="7"
9
+      class="amap-demo"
10
+      :mapStyle="setMapStyle"
11
+    >
12
+      <el-amap-marker
13
+        v-for="(item,index) in markers"
14
+        :key="index"
15
+        :position="item.position"
16
+        :icon="item.icon"
17
+        :title="item.title"
18
+        :offset="item.offset"
19
+        :content="item.content"
20
+      ></el-amap-marker>
21
+    </el-amap>
22
+  </div>
23
+</template>
24
+
25
+<script>
26
+// import G2 from '@antv/g2'
27
+// import DataSet from '@antv/data-set'
28
+import $ from 'jquery'
29
+// import AMapUI from 'AMapUI'
30
+import light1 from '@/assets/light1.png'
31
+import light2 from '@/assets/light2.png'
32
+import light3 from '@/assets/light3.png'
33
+import light4 from '@/assets/light4.png'
34
+export default {
35
+  data () {
36
+    return {
37
+      light1,
38
+      light2,
39
+      light3,
40
+      light4,
41
+      markers: [{
42
+        position: [118.633516, 32.069878],
43
+        title: '悦见山',
44
+        offset: [-60, -60],
45
+        content: `<div class='point'>
46
+        <img src='${light1}'>
47
+        <span>悦见山</span>
48
+        </div>`
49
+      }, {
50
+        position: [117.161777, 34.154014],
51
+        title: '致享城',
52
+        offset: [-60, -60],
53
+        content: `<div class='point'>
54
+        <img src='${light2}'>
55
+        <span>致享城</span>
56
+        </div>`
57
+      }, {
58
+        position: [118.753086, 31.972501],
59
+        title: '智慧社区',
60
+        offset: [-60, -60],
61
+        content: `<div class='point'>
62
+        <img src='${light3}'>
63
+        <span>智慧社区</span>
64
+        </div>`
65
+      }, {
66
+        position: [120.064082, 30.343891],
67
+        title: '云谷天境',
68
+        offset: [-60, -60],
69
+        content: `<div class='point'>
70
+        <img src='${light4}'>
71
+        <span>云谷天境</span>
72
+        </div>`
73
+      }],
74
+      mapCenter: [118.753086, 31.972501],
75
+      setMapStyle: 'amap://styles/blue'
76
+    }
77
+  },
78
+  mounted () {
79
+    setInterval(() => {
80
+      this.rander()
81
+    }, 1600)
82
+  },
83
+  methods: {
84
+    rander () {
85
+      $('.point img').animate({ opacity: 0 }, 800).animate({ opacity: 1 }, 800)
86
+    }
87
+  }
88
+}
89
+</script>
90
+
91
+<style lang="scss">
92
+#node4{
93
+  border-radius: 5px;
94
+}
95
+.top-title{
96
+  width: 100%;
97
+  position: absolute;
98
+  top: 0;
99
+  left: 0;
100
+  text-align: center;
101
+  margin-top: 30px;
102
+  z-index: 20;
103
+  color: #A6B9C8;
104
+  font-size: 18px;
105
+}
106
+.point{
107
+  position: relative;
108
+  width: 120px;
109
+  height: 120px;
110
+  img{
111
+    position: absolute;
112
+    top: 50%;
113
+    left: 50%;
114
+    transform: translate(-50%,-50%);
115
+  }
116
+  span{
117
+    position: absolute;
118
+    top: 80%;
119
+    left: 50%;
120
+    transform: translate(-50%,-50%);
121
+    font-size: 12px;
122
+    color: white;
123
+  }
124
+}
125
+</style>

+ 107
- 0
VUECODE/smart-property-manage/src/components/chart/chart5.vue View File

@@ -0,0 +1,107 @@
1
+<template>
2
+  <div id="node5"></div>
3
+</template>
4
+
5
+<script>
6
+import G2 from '@antv/g2'
7
+import DataSet from '@antv/data-set'
8
+import { mapState, mapActions } from 'vuex'
9
+
10
+export default {
11
+  computed: {
12
+    ...mapState('trunkIndex', {
13
+      signUser: item => item.trunkIndex.signUser
14
+    })
15
+  },
16
+  mounted () {
17
+    this.GetSignUser().then(() => {
18
+      this.rander()
19
+    })
20
+  },
21
+  methods: {
22
+    ...mapActions('trunkIndex', [
23
+      'GetSignUser'
24
+    ]),
25
+    rander () {
26
+      console.log(this.signUser)
27
+      var data = this.signUser
28
+      var chart = new G2.Chart({
29
+        container: 'node5',
30
+        forceFit: true,
31
+        height: 282,
32
+        padding: [80, 20, 30, 40]
33
+      });
34
+      chart.source(data);
35
+      console.log(chart)
36
+      chart.axis('count', {
37
+        line: {
38
+          lineWidth: 1, // 设置线的宽度
39
+          stroke: '#a4b6c5', // 设置线的颜色
40
+        },
41
+        grid: null,
42
+        label: {
43
+          textStyle: {
44
+            textAlign: 'end', // 文本对齐方向,可取值为: start middle end
45
+            fill: '#a4b6c5', // 文本的颜色
46
+            fontSize: '12', // 文本大小
47
+            textBaseline: 'middle' // 文本基准线,可取 top middle bottom,默认为middle
48
+          }
49
+        }
50
+      });
51
+      chart.axis('message', {
52
+        line: {
53
+          lineWidth: 1, // 设置线的宽度
54
+          stroke: '#a4b6c5', // 设置线的颜色
55
+        },
56
+        grid: null,
57
+        label: {
58
+          textStyle: {
59
+            fill: '#a4b6c5', // 文本的颜色
60
+            fontSize: '12', // 文本大小
61
+          }
62
+        }
63
+      });
64
+      chart.scale('', {
65
+        tickInterval: 200
66
+      });
67
+      chart.guide().html({
68
+        position: ['5%', '-25%'],
69
+        html: '<div class="chart5-title"><p class="title">注册用户统计</p></div>'
70
+      })
71
+      chart.guide().html({
72
+        position: ['90%', '-15%'],
73
+        html: `<div class="chart-right-btn"><span>18/11/27</span>&nbsp;<i class='el-icon-date'></i></div>`
74
+      })
75
+
76
+      chart.interval().position('message*count').color('message', function (val) {
77
+        if (val === '业主总数' || val === '家属总数') {
78
+          return '#53F9FF';
79
+        }
80
+        return '#FF5367';
81
+      });
82
+      chart.render();
83
+    }
84
+  }
85
+}
86
+</script>
87
+
88
+<style lang="scss">
89
+.chart5-title {
90
+  .title {
91
+    font-size: 13px;
92
+    color: #a4b6c5;
93
+  }
94
+}
95
+.chart-right-btn{
96
+  padding: 0px 8px;
97
+  display: flex;
98
+  border: 1px solid #a4b6c5;
99
+  border-radius: 9px;
100
+  justify-content: center;
101
+  align-items: center;
102
+  span,i{
103
+    font-size: 10px;
104
+    color: #a4b6c5;
105
+  }
106
+}
107
+</style>

+ 108
- 0
VUECODE/smart-property-manage/src/components/chart/chart6.vue View File

@@ -0,0 +1,108 @@
1
+<template>
2
+  <div id="node6"></div>
3
+</template>
4
+
5
+<script>
6
+import G2 from '@antv/g2'
7
+import DataSet from '@antv/data-set'
8
+export default {
9
+  mounted () {
10
+    this.rander()
11
+  },
12
+  methods: {
13
+    rander () {
14
+      var data = [{
15
+        "year": "11.17",
16
+        "ACME": 300,
17
+      }, {
18
+        "year": "11.18",
19
+        "ACME": 280,
20
+      }, {
21
+        "year": "11.19",
22
+        "ACME": 320,
23
+      }, {
24
+        "year": "11.20",
25
+        "ACME": 250,
26
+      }, {
27
+        "year": "11.21",
28
+        "ACME": 310,
29
+      }, {
30
+        "year": "11.22",
31
+        "ACME": 323,
32
+      }, {
33
+        "year": "11.23",
34
+        "ACME": 350,
35
+      }];
36
+      var dv = new DataSet.View().source(data);
37
+      dv.transform({
38
+        type: 'fold',
39
+        fields: ['ACME'],
40
+        key: 'type',
41
+        value: 'value'
42
+      });
43
+      var chart = new G2.Chart({
44
+        container: 'node6',
45
+        forceFit: true,
46
+        height: 282,
47
+        padding: [80, 20, 30, 40]
48
+      });
49
+      chart.source(dv, {
50
+        value: {
51
+          alias: 'The Share Price in Dollars',
52
+          formatter: function formatter (val) {
53
+            return val;
54
+          }
55
+        },
56
+        year: {
57
+          range: [0, 1]
58
+        }
59
+      });
60
+      chart.axis('value', {
61
+        line: {
62
+          lineWidth: 1, // 设置线的宽度
63
+          stroke: '#a4b6c5', // 设置线的颜色
64
+        },
65
+        grid: null,
66
+        label: {
67
+          textStyle: {
68
+            textAlign: 'end', // 文本对齐方向,可取值为: start middle end
69
+            fill: '#a4b6c5', // 文本的颜色
70
+            fontSize: '12', // 文本大小
71
+            textBaseline: 'middle' // 文本基准线,可取 top middle bottom,默认为middle
72
+          }
73
+        }
74
+      });
75
+      chart.axis('year', {
76
+        line: {
77
+          lineWidth: 1, // 设置线的宽度
78
+          stroke: '#a4b6c5', // 设置线的颜色
79
+        },
80
+        grid: null,
81
+        label: {
82
+          textStyle: {
83
+            fill: '#a4b6c5', // 文本的颜色
84
+            fontSize: '12', // 文本大小
85
+          }
86
+        }
87
+      });
88
+      chart.tooltip({
89
+        crosshairs: true
90
+      });
91
+      chart.guide().html({
92
+        position: ['90%', '-15%'],
93
+        html: `<div class="chart-right-btn"><span>日活跃量</span>&nbsp;<i class='el-icon-arrow-down'></i></div>`
94
+      })
95
+      chart.area().position('year*value').color('type', function (val) { return '#53F9FF' }).shape('smooth');
96
+      chart.line().position('year*value').color('type', function (val) { return '#53F9FF' }).size(2).shape('smooth');
97
+      chart.guide().html({
98
+        position: ['5%', '-25%'],
99
+        html: '<div class="chart5-title"><p class="title">上线活跃用户</p></div>'
100
+      })
101
+      chart.render();
102
+    }
103
+  }
104
+}
105
+</script>
106
+
107
+<style lang="scss">
108
+</style>

+ 92
- 0
VUECODE/smart-property-manage/src/components/chart/chart7.vue View File

@@ -0,0 +1,92 @@
1
+<template>
2
+  <div id="node7"></div>
3
+</template>
4
+
5
+<script>
6
+import G2 from '@antv/g2'
7
+import DataSet from '@antv/data-set'
8
+
9
+export default {
10
+  mounted () {
11
+    this.rander()
12
+  },
13
+  methods: {
14
+    rander () {
15
+      var data = [{
16
+        type: '公告',
17
+        sales: 500
18
+      }, {
19
+        type: '活动',
20
+        sales: 400
21
+      }, {
22
+        type: '帖子',
23
+        sales: 1000
24
+      }];
25
+      var chart = new G2.Chart({
26
+        container: 'node7',
27
+        forceFit: true,
28
+        height: 282,
29
+        padding: [80, 20, 30, 40]
30
+      });
31
+      chart.source(data);
32
+      chart.scale('', {
33
+        tickInterval: 200
34
+      });
35
+      chart.guide().html({
36
+        position: ['5%', '-25%'],
37
+        html: '<div class="chart7-title"><p class="title">内容运营统计</p></div>'
38
+      })
39
+      chart.guide().html({
40
+        position: ['90%', '-15%'],
41
+        html: `<div class="chart-right-btn"><span>发布数量</span>&nbsp;<i class='el-icon-arrow-down'></i></div>`
42
+      })
43
+      chart.axis('sales', {
44
+        line: {
45
+          lineWidth: 1, // 设置线的宽度
46
+          stroke: '#a4b6c5', // 设置线的颜色
47
+        },
48
+        grid: null,
49
+        label: {
50
+          textStyle: {
51
+            textAlign: 'end', // 文本对齐方向,可取值为: start middle end
52
+            fill: '#a4b6c5', // 文本的颜色
53
+            fontSize: '12', // 文本大小
54
+            textBaseline: 'middle' // 文本基准线,可取 top middle bottom,默认为middle
55
+          }
56
+        }
57
+      });
58
+      chart.axis('type', {
59
+        line: {
60
+          lineWidth: 1, // 设置线的宽度
61
+          stroke: '#a4b6c5', // 设置线的颜色
62
+        },
63
+        grid: null,
64
+        label: {
65
+          textStyle: {
66
+            fill: '#a4b6c5', // 文本的颜色
67
+            fontSize: '12', // 文本大小
68
+          }
69
+        }
70
+      });
71
+      chart.interval().position('type*sales').color('type', function (val) {
72
+        if (val === '公告') {
73
+          return '#53F9FF';
74
+        } else if (val === '活动') {
75
+          return '#FF5367';
76
+        }
77
+        return '#3F688D';
78
+      });
79
+      chart.render();
80
+    }
81
+  }
82
+}
83
+</script>
84
+
85
+<style lang="scss">
86
+.chart7-title {
87
+  .title {
88
+    font-size: 13px;
89
+    color: #a4b6c5;
90
+  }
91
+}
92
+</style>

+ 49
- 0
VUECODE/smart-property-manage/src/directive/clipboard/clipboard.js View File

@@ -0,0 +1,49 @@
1
+// Inspired by https://github.com/Inndy/vue-clipboard2
2
+const Clipboard = require('clipboard')
3
+if (!Clipboard) {
4
+  throw new Error('you should npm install `clipboard` --save at first ')
5
+}
6
+
7
+export default {
8
+  bind(el, binding) {
9
+    if (binding.arg === 'success') {
10
+      el._v_clipboard_success = binding.value
11
+    } else if (binding.arg === 'error') {
12
+      el._v_clipboard_error = binding.value
13
+    } else {
14
+      const clipboard = new Clipboard(el, {
15
+        text() { return binding.value },
16
+        action() { return binding.arg === 'cut' ? 'cut' : 'copy' }
17
+      })
18
+      clipboard.on('success', e => {
19
+        const callback = el._v_clipboard_success
20
+        callback && callback(e) // eslint-disable-line
21
+      })
22
+      clipboard.on('error', e => {
23
+        const callback = el._v_clipboard_error
24
+        callback && callback(e) // eslint-disable-line
25
+      })
26
+      el._v_clipboard = clipboard
27
+    }
28
+  },
29
+  update(el, binding) {
30
+    if (binding.arg === 'success') {
31
+      el._v_clipboard_success = binding.value
32
+    } else if (binding.arg === 'error') {
33
+      el._v_clipboard_error = binding.value
34
+    } else {
35
+      el._v_clipboard.text = function() { return binding.value }
36
+      el._v_clipboard.action = function() { return binding.arg === 'cut' ? 'cut' : 'copy' }
37
+    }
38
+  },
39
+  unbind(el, binding) {
40
+    if (binding.arg === 'success') {
41
+      delete el._v_clipboard_success
42
+    } else if (binding.arg === 'error') {
43
+      delete el._v_clipboard_error
44
+    } else {
45
+      el._v_clipboard.destroy()
46
+      delete el._v_clipboard
47
+    }
48
+  }
49
+}

+ 13
- 0
VUECODE/smart-property-manage/src/directive/clipboard/index.js View File

@@ -0,0 +1,13 @@
1
+import Clipboard from './clipboard'
2
+
3
+const install = function(Vue) {
4
+  Vue.directive('Clipboard', Clipboard)
5
+}
6
+
7
+if (window.Vue) {
8
+  window.clipboard = Clipboard
9
+  Vue.use(install); // eslint-disable-line
10
+}
11
+
12
+Clipboard.install = install
13
+export default Clipboard

+ 77
- 0
VUECODE/smart-property-manage/src/directive/el-dragDialog/drag.js View File

@@ -0,0 +1,77 @@
1
+export default{
2
+  bind(el, binding, vnode) {
3
+    const dialogHeaderEl = el.querySelector('.el-dialog__header')
4
+    const dragDom = el.querySelector('.el-dialog')
5
+    dialogHeaderEl.style.cssText += ';cursor:move;'
6
+    dragDom.style.cssText += ';top:0px;'
7
+
8
+    // 获取原有属性 ie dom元素.currentStyle 火狐谷歌 window.getComputedStyle(dom元素, null);
9
+    const getStyle = (function() {
10
+      if (window.document.currentStyle) {
11
+        return (dom, attr) => dom.currentStyle[attr]
12
+      } else {
13
+        return (dom, attr) => getComputedStyle(dom, false)[attr]
14
+      }
15
+    })()
16
+
17
+    dialogHeaderEl.onmousedown = (e) => {
18
+      // 鼠标按下,计算当前元素距离可视区的距离
19
+      const disX = e.clientX - dialogHeaderEl.offsetLeft
20
+      const disY = e.clientY - dialogHeaderEl.offsetTop
21
+
22
+      const dragDomWidth = dragDom.offsetWidth
23
+      const dragDomHeight = dragDom.offsetHeight
24
+
25
+      const screenWidth = document.body.clientWidth
26
+      const screenHeight = document.body.clientHeight
27
+
28
+      const minDragDomLeft = dragDom.offsetLeft
29
+      const maxDragDomLeft = screenWidth - dragDom.offsetLeft - dragDomWidth
30
+
31
+      const minDragDomTop = dragDom.offsetTop
32
+      const maxDragDomTop = screenHeight - dragDom.offsetTop - dragDomHeight
33
+
34
+      // 获取到的值带px 正则匹配替换
35
+      let styL = getStyle(dragDom, 'left')
36
+      let styT = getStyle(dragDom, 'top')
37
+
38
+      if (styL.includes('%')) {
39
+        styL = +document.body.clientWidth * (+styL.replace(/\%/g, '') / 100)
40
+        styT = +document.body.clientHeight * (+styT.replace(/\%/g, '') / 100)
41
+      } else {
42
+        styL = +styL.replace(/\px/g, '')
43
+        styT = +styT.replace(/\px/g, '')
44
+      }
45
+
46
+      document.onmousemove = function(e) {
47
+        // 通过事件委托,计算移动的距离
48
+        let left = e.clientX - disX
49
+        let top = e.clientY - disY
50
+
51
+        // 边界处理
52
+        if (-(left) > minDragDomLeft) {
53
+          left = -minDragDomLeft
54
+        } else if (left > maxDragDomLeft) {
55
+          left = maxDragDomLeft
56
+        }
57
+
58
+        if (-(top) > minDragDomTop) {
59
+          top = -minDragDomTop
60
+        } else if (top > maxDragDomTop) {
61
+          top = maxDragDomTop
62
+        }
63
+
64
+        // 移动当前元素
65
+        dragDom.style.cssText += `;left:${left + styL}px;top:${top + styT}px;`
66
+
67
+        // emit onDrag event
68
+        vnode.child.$emit('dragDialog')
69
+      }
70
+
71
+      document.onmouseup = function(e) {
72
+        document.onmousemove = null
73
+        document.onmouseup = null
74
+      }
75
+    }
76
+  }
77
+}

+ 13
- 0
VUECODE/smart-property-manage/src/directive/el-dragDialog/index.js View File

@@ -0,0 +1,13 @@
1
+import drag from './drag'
2
+
3
+const install = function(Vue) {
4
+  Vue.directive('el-drag-dialog', drag)
5
+}
6
+
7
+if (window.Vue) {
8
+  window['el-drag-dialog'] = drag
9
+  Vue.use(install); // eslint-disable-line
10
+}
11
+
12
+drag.install = install
13
+export default drag

+ 13
- 0
VUECODE/smart-property-manage/src/directive/permission/index.js View File

@@ -0,0 +1,13 @@
1
+import permission from './permission'
2
+
3
+const install = function(Vue) {
4
+  Vue.directive('permission', permission)
5
+}
6
+
7
+if (window.Vue) {
8
+  window['permission'] = permission
9
+  Vue.use(install); // eslint-disable-line
10
+}
11
+
12
+permission.install = install
13
+export default permission

+ 23
- 0
VUECODE/smart-property-manage/src/directive/permission/permission.js View File

@@ -0,0 +1,23 @@
1
+
2
+import store from '@/store'
3
+
4
+export default{
5
+  inserted(el, binding, vnode) {
6
+    const { value } = binding
7
+    const roles = store.getters && store.getters.roles
8
+
9
+    if (value && value instanceof Array && value.length > 0) {
10
+      const permissionRoles = value
11
+
12
+      const hasPermission = roles.some(role => {
13
+        return permissionRoles.includes(role)
14
+      })
15
+
16
+      if (!hasPermission) {
17
+        el.parentNode && el.parentNode.removeChild(el)
18
+      }
19
+    } else {
20
+      throw new Error(`need roles! Like v-permission="['admin','editor']"`)
21
+    }
22
+  }
23
+}

+ 91
- 0
VUECODE/smart-property-manage/src/directive/sticky.js View File

@@ -0,0 +1,91 @@
1
+const vueSticky = {}
2
+let listenAction
3
+vueSticky.install = Vue => {
4
+  Vue.directive('sticky', {
5
+    inserted(el, binding) {
6
+      const params = binding.value || {}
7
+      const stickyTop = params.stickyTop || 0
8
+      const zIndex = params.zIndex || 1000
9
+      const elStyle = el.style
10
+
11
+      elStyle.position = '-webkit-sticky'
12
+      elStyle.position = 'sticky'
13
+      // if the browser support css sticky(Currently Safari, Firefox and Chrome Canary)
14
+      // if (~elStyle.position.indexOf('sticky')) {
15
+      //     elStyle.top = `${stickyTop}px`;
16
+      //     elStyle.zIndex = zIndex;
17
+      //     return
18
+      // }
19
+      const elHeight = el.getBoundingClientRect().height
20
+      const elWidth = el.getBoundingClientRect().width
21
+      elStyle.cssText = `top: ${stickyTop}px; z-index: ${zIndex}`
22
+
23
+      const parentElm = el.parentNode || document.documentElement
24
+      const placeholder = document.createElement('div')
25
+      placeholder.style.display = 'none'
26
+      placeholder.style.width = `${elWidth}px`
27
+      placeholder.style.height = `${elHeight}px`
28
+      parentElm.insertBefore(placeholder, el)
29
+
30
+      let active = false
31
+
32
+      const getScroll = (target, top) => {
33
+        const prop = top ? 'pageYOffset' : 'pageXOffset'
34
+        const method = top ? 'scrollTop' : 'scrollLeft'
35
+        let ret = target[prop]
36
+        if (typeof ret !== 'number') {
37
+          ret = window.document.documentElement[method]
38
+        }
39
+        return ret
40
+      }
41
+
42
+      const sticky = () => {
43
+        if (active) {
44
+          return
45
+        }
46
+        if (!elStyle.height) {
47
+          elStyle.height = `${el.offsetHeight}px`
48
+        }
49
+
50
+        elStyle.position = 'fixed'
51
+        elStyle.width = `${elWidth}px`
52
+        placeholder.style.display = 'inline-block'
53
+        active = true
54
+      }
55
+
56
+      const reset = () => {
57
+        if (!active) {
58
+          return
59
+        }
60
+
61
+        elStyle.position = ''
62
+        placeholder.style.display = 'none'
63
+        active = false
64
+      }
65
+
66
+      const check = () => {
67
+        const scrollTop = getScroll(window, true)
68
+        const offsetTop = el.getBoundingClientRect().top
69
+        if (offsetTop < stickyTop) {
70
+          sticky()
71
+        } else {
72
+          if (scrollTop < elHeight + stickyTop) {
73
+            reset()
74
+          }
75
+        }
76
+      }
77
+      listenAction = () => {
78
+        check()
79
+      }
80
+
81
+      window.addEventListener('scroll', listenAction)
82
+    },
83
+
84
+    unbind() {
85
+      window.removeEventListener('scroll', listenAction)
86
+    }
87
+  })
88
+}
89
+
90
+export default vueSticky
91
+

+ 13
- 0
VUECODE/smart-property-manage/src/directive/waves/index.js View File

@@ -0,0 +1,13 @@
1
+import waves from './waves'
2
+
3
+const install = function(Vue) {
4
+  Vue.directive('waves', waves)
5
+}
6
+
7
+if (window.Vue) {
8
+  window.waves = waves
9
+  Vue.use(install); // eslint-disable-line
10
+}
11
+
12
+waves.install = install
13
+export default waves

+ 26
- 0
VUECODE/smart-property-manage/src/directive/waves/waves.css View File

@@ -0,0 +1,26 @@
1
+.waves-ripple {
2
+    position: absolute;
3
+    border-radius: 100%;
4
+    background-color: rgba(0, 0, 0, 0.15);
5
+    background-clip: padding-box;
6
+    pointer-events: none;
7
+    -webkit-user-select: none;
8
+    -moz-user-select: none;
9
+    -ms-user-select: none;
10
+    user-select: none;
11
+    -webkit-transform: scale(0);
12
+    -ms-transform: scale(0);
13
+    transform: scale(0);
14
+    opacity: 1;
15
+}
16
+
17
+.waves-ripple.z-active {
18
+    opacity: 0;
19
+    -webkit-transform: scale(2);
20
+    -ms-transform: scale(2);
21
+    transform: scale(2);
22
+    -webkit-transition: opacity 1.2s ease-out, -webkit-transform 0.6s ease-out;
23
+    transition: opacity 1.2s ease-out, -webkit-transform 0.6s ease-out;
24
+    transition: opacity 1.2s ease-out, transform 0.6s ease-out;
25
+    transition: opacity 1.2s ease-out, transform 0.6s ease-out, -webkit-transform 0.6s ease-out;
26
+}

+ 42
- 0
VUECODE/smart-property-manage/src/directive/waves/waves.js View File

@@ -0,0 +1,42 @@
1
+import './waves.css'
2
+
3
+export default{
4
+  bind(el, binding) {
5
+    el.addEventListener('click', e => {
6
+      const customOpts = Object.assign({}, binding.value)
7
+      const opts = Object.assign({
8
+        ele: el, // 波纹作用元素
9
+        type: 'hit', // hit 点击位置扩散 center中心点扩展
10
+        color: 'rgba(0, 0, 0, 0.15)' // 波纹颜色
11
+      }, customOpts)
12
+      const target = opts.ele
13
+      if (target) {
14
+        target.style.position = 'relative'
15
+        target.style.overflow = 'hidden'
16
+        const rect = target.getBoundingClientRect()
17
+        let ripple = target.querySelector('.waves-ripple')
18
+        if (!ripple) {
19
+          ripple = document.createElement('span')
20
+          ripple.className = 'waves-ripple'
21
+          ripple.style.height = ripple.style.width = Math.max(rect.width, rect.height) + 'px'
22
+          target.appendChild(ripple)
23
+        } else {
24
+          ripple.className = 'waves-ripple'
25
+        }
26
+        switch (opts.type) {
27
+          case 'center':
28
+            ripple.style.top = (rect.height / 2 - ripple.offsetHeight / 2) + 'px'
29
+            ripple.style.left = (rect.width / 2 - ripple.offsetWidth / 2) + 'px'
30
+            break
31
+          default:
32
+            ripple.style.top = (e.pageY - rect.top - ripple.offsetHeight / 2 - document.documentElement.scrollTop || document.body.scrollTop) + 'px'
33
+            ripple.style.left = (e.pageX - rect.left - ripple.offsetWidth / 2 - document.documentElement.scrollLeft || document.body.scrollLeft) + 'px'
34
+        }
35
+        ripple.style.backgroundColor = opts.color
36
+        ripple.className = 'waves-ripple z-active'
37
+        return false
38
+      }
39
+    }, false)
40
+  }
41
+}
42
+

+ 9
- 0
VUECODE/smart-property-manage/src/icons/index.js View File

@@ -0,0 +1,9 @@
1
+import Vue from 'vue'
2
+import SvgIcon from '@/components/SvgIcon' // svg组件
3
+
4
+// register globally
5
+Vue.component('svg-icon', SvgIcon)
6
+
7
+const requireAll = requireContext => requireContext.keys().map(requireContext)
8
+const req = require.context('./svg', false, /\.svg$/)
9
+requireAll(req)

+ 1
- 0
VUECODE/smart-property-manage/src/icons/svg/banner.svg View File

@@ -0,0 +1 @@
1
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1543202545074" class="icon" style="" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4972" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M895.461997 64.288189 128.54005 64.288189c-35.296901 0-63.908542 28.612665-63.908542 63.908542l0 638.941134c0 35.294854 28.611641 63.910589 63.908542 63.910589l766.91683 0c35.293831 0 63.910589-28.615735 63.910589-63.910589L959.367469 128.197754C959.367469 92.900853 930.750711 64.288189 895.461997 64.288189L895.461997 64.288189zM895.461997 767.137865l-248.417813-262.040065L524.378423 611.632161 340.300988 441.194374 156.237879 611.632161l-27.697829 31.635511 0-515.070942 766.91683 0L895.461997 767.137865 895.461997 767.137865 895.461997 767.137865zM732.900597 388.742768c54.035684 0 97.879238-43.922349 97.879238-98.031711 0-54.151317-43.844577-98.048083-97.879238-98.048083-54.05922 0-97.883331 43.896766-97.883331 98.048083C635.017266 344.825536 678.841378 388.742768 732.900597 388.742768L732.900597 388.742768zM732.900597 388.742768" p-id="4973"></path><path d="M927.628604 959.710788 96.36935 959.710788c-17.454534 0-31.737842-14.280238-31.737842-31.739888l0 0c0-17.455557 14.283308-31.732725 31.737842-31.732725l831.259254 0c17.454534 0 31.738865 14.277168 31.738865 31.732725l0 0C959.367469 945.43055 945.083138 959.710788 927.628604 959.710788L927.628604 959.710788zM927.628604 959.710788" p-id="4974"></path></svg>

+ 1
- 0
VUECODE/smart-property-manage/src/icons/svg/community.svg View File

@@ -0,0 +1 @@
1
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1543202441123" class="icon" style="" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3897" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M874.7 382.5H805L525.8 103.2c-7.6-7.6-19.9-7.6-27.5 0L219 382.5h-69.7c-28.6 0-51.8 23.2-51.8 51.8v440.4c0 28.6 23.2 51.8 51.8 51.8h725.4c28.6 0 51.8-23.2 51.8-51.8V434.3c0-28.6-23.2-51.8-51.8-51.8zM512 144.4l238.1 238.1H274l238-238.1zM260 822.9c-21.5 0-38.9-17.4-38.9-38.9s17.4-38.9 38.9-38.9 38.9 17.4 38.9 38.9-17.4 38.9-38.9 38.9z m0-129.6c-21.5 0-38.9-17.4-38.9-38.9s17.4-38.9 38.9-38.9 38.9 17.4 38.9 38.9-17.4 38.9-38.9 38.9z m0-129.5c-21.5 0-38.9-17.4-38.9-38.9S238.5 486 260 486s38.9 17.4 38.9 38.9-17.4 38.9-38.9 38.9z m542.9 239.6H388.4c-10.7 0-19.4-8.7-19.4-19.4s8.7-19.4 19.4-19.4h414.5c10.7 0 19.4 8.7 19.4 19.4s-8.7 19.4-19.4 19.4z m0-129.5H388.4c-10.7 0-19.4-8.7-19.4-19.4s8.7-19.4 19.4-19.4h414.5c10.7 0 19.4 8.7 19.4 19.4s-8.7 19.4-19.4 19.4z m0-129.5H388.4c-10.7 0-19.4-8.7-19.4-19.4s8.7-19.4 19.4-19.4h414.5c10.7 0 19.4 8.7 19.4 19.4s-8.7 19.4-19.4 19.4z" p-id="3898"></path></svg>

+ 1
- 0
VUECODE/smart-property-manage/src/icons/svg/communitydata.svg View File

@@ -0,0 +1 @@
1
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1543202407856" class="icon" style="" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3299" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M791.5 831H249l0.1-358.3H92.8L518.4 96.6l413.4 376.1H791.4l0.1 358.3zM299 781h442.4l-0.1-358.3h61.1l-284.6-259-293 259H299V781z" fill="#000000" p-id="3300"></path><path d="M519.3 726.9c-4.4 0-8.9-1.2-12.8-3.6-1.6-0.9-38.9-23.4-76.7-56-54.4-46.8-82-90.5-82-129.9 0-64.1 52.1-116.2 116.2-116.2 19.6 0 38.5 4.8 55.4 14 16.9-9.2 35.7-14 55.4-14 64.1 0 116.2 52.1 116.2 116.2 0 39.9-27.6 83.8-82 130.4-37.9 32.4-75.3 54.6-76.8 55.6-4.1 2.3-8.5 3.5-12.9 3.5z m-55.4-255.6c-36.5 0-66.2 29.7-66.2 66.2 0 23.4 22.8 55.9 64.1 91.6 21.9 18.9 44.1 34.4 57.6 43.3 13.4-8.8 35.6-24.1 57.5-42.9 41.3-35.5 64-68.1 64-92 0-36.5-29.7-66.2-66.2-66.2-14.7 0-28.6 4.7-40.2 13.6-9 6.9-21.4 6.9-30.4 0-11.6-8.9-25.5-13.6-40.2-13.6z" fill="#000000" p-id="3301"></path></svg>

+ 1
- 0
VUECODE/smart-property-manage/src/icons/svg/example.svg View File

@@ -0,0 +1 @@
1
+<svg width="128" height="128" xmlns="http://www.w3.org/2000/svg"><path d="M96.258 57.462h31.421C124.794 27.323 100.426 2.956 70.287.07v31.422a32.856 32.856 0 0 1 25.971 25.97zm-38.796-25.97V.07C27.323 2.956 2.956 27.323.07 57.462h31.422a32.856 32.856 0 0 1 25.97-25.97zm12.825 64.766v31.421c30.46-2.885 54.507-27.253 57.713-57.712H96.579c-2.886 13.466-13.146 23.726-26.292 26.291zM31.492 70.287H.07c2.886 30.46 27.253 54.507 57.713 57.713V96.579c-13.466-2.886-23.726-13.146-26.291-26.292z"/></svg>

+ 1
- 0
VUECODE/smart-property-manage/src/icons/svg/eye.svg View File

@@ -0,0 +1 @@
1
+<svg width="128" height="64" xmlns="http://www.w3.org/2000/svg"><path d="M127.072 7.994c1.37-2.208.914-5.152-.914-6.87-2.056-1.717-4.797-1.226-6.396.982-.229.245-25.586 32.382-55.74 32.382-29.24 0-55.74-32.382-55.968-32.627-1.6-1.963-4.57-2.208-6.397-.49C-.17 3.086-.399 6.275 1.2 8.238c.457.736 5.94 7.36 14.62 14.72L4.17 35.96c-1.828 1.963-1.6 5.152.228 6.87.457.98 1.6 1.471 2.742 1.471s2.284-.49 3.198-1.472l12.564-13.983c5.94 4.416 13.021 8.587 20.788 11.53l-4.797 17.418c-.685 2.699.686 5.397 3.198 6.133h1.37c2.057 0 3.884-1.472 4.341-3.68L52.6 42.83c3.655.736 7.538 1.227 11.422 1.227 3.883 0 7.767-.49 11.422-1.227l4.797 17.173c.457 2.208 2.513 3.68 4.34 3.68.457 0 .914 0 1.143-.246 2.513-.736 3.883-3.434 3.198-6.133l-4.797-17.172c7.767-2.944 14.848-7.114 20.788-11.53l12.336 13.738c.913.981 2.056 1.472 3.198 1.472s2.284-.49 3.198-1.472c1.828-1.963 1.828-4.906.228-6.87l-11.65-13.001c9.366-7.36 14.849-14.474 14.849-14.474z"/></svg>

+ 1
- 0
VUECODE/smart-property-manage/src/icons/svg/form.svg View File

@@ -0,0 +1 @@
1
+<svg width="128" height="128" xmlns="http://www.w3.org/2000/svg"><path d="M84.068 23.784c-1.02 0-1.877-.32-2.572-.96a8.588 8.588 0 0 1-1.738-2.237 11.524 11.524 0 0 1-1.042-2.621c-.232-.895-.348-1.641-.348-2.238V0h.278c.834 0 1.622.085 2.363.256.742.17 1.645.575 2.711 1.214 1.066.64 2.363 1.535 3.892 2.686 1.53 1.15 3.453 2.664 5.77 4.54 2.502 2.045 4.494 3.771 5.977 5.178 1.483 1.406 2.618 2.6 3.406 3.58.787.98 1.274 1.812 1.46 2.494.185.682.277 1.278.277 1.79v2.046H84.068zM127.3 84.01c.278.682.464 1.535.556 2.558.093 1.023-.37 2.003-1.39 2.94-.463.427-.88.832-1.25 1.215-.372.384-.696.704-.974.96a6.69 6.69 0 0 1-.973.767l-11.816-10.741a44.331 44.331 0 0 0 1.877-1.535 31.028 31.028 0 0 1 1.737-1.406c1.112-.938 2.317-1.343 3.615-1.215 1.297.128 2.363.405 3.197.83.927.427 1.923 1.173 2.989 2.239 1.065 1.065 1.876 2.195 2.432 3.388zM78.23 95.902c2.038 0 3.752-.511 5.143-1.534l-26.969 25.83H18.037c-1.761 0-3.684-.47-5.77-1.407a24.549 24.549 0 0 1-5.838-3.709 21.373 21.373 0 0 1-4.518-5.306c-1.204-2.003-1.807-4.07-1.807-6.202V16.495c0-1.79.44-3.665 1.32-5.626A18.41 18.41 0 0 1 5.04 5.562a21.798 21.798 0 0 1 5.213-3.964C12.198.533 14.237 0 16.37 0h53.24v15.984c0 1.62.278 3.367.834 5.242a16.704 16.704 0 0 0 2.572 5.179c1.159 1.577 2.665 2.898 4.518 3.964 1.853 1.066 4.078 1.598 6.673 1.598h20.295v42.325L85.458 92.45c1.02-1.364 1.529-2.856 1.529-4.476 0-2.216-.857-4.113-2.572-5.69-1.714-1.577-3.776-2.366-6.186-2.366H26.1c-2.409 0-4.448.789-6.116 2.366-1.668 1.577-2.502 3.474-2.502 5.69 0 2.217.834 4.092 2.502 5.626 1.668 1.535 3.707 2.302 6.117 2.302h52.13zM26.1 47.951c-2.41 0-4.449.789-6.117 2.366-1.668 1.577-2.502 3.473-2.502 5.69 0 2.216.834 4.092 2.502 5.626 1.668 1.534 3.707 2.302 6.117 2.302h52.13c2.409 0 4.47-.768 6.185-2.302 1.715-1.534 2.572-3.41 2.572-5.626 0-2.217-.857-4.113-2.572-5.69-1.714-1.577-3.776-2.366-6.186-2.366H26.1zm52.407 64.063l1.807-1.663 3.476-3.196a479.75 479.75 0 0 0 4.587-4.284 500.757 500.757 0 0 1 5.004-4.667c3.985-3.666 8.48-7.758 13.485-12.276l11.677 10.741-13.485 12.404-5.004 4.603-4.587 4.22a179.46 179.46 0 0 0-3.267 3.068c-.88.853-1.367 1.322-1.46 1.407-.463.341-.973.703-1.529 1.087-.556.383-1.112.703-1.668.959-.556.256-1.413.575-2.572.959a83.5 83.5 0 0 1-3.545 1.087 72.2 72.2 0 0 1-3.475.895c-1.112.256-1.946.426-2.502.511-1.112.17-1.854.043-2.224-.383-.371-.426-.464-1.151-.278-2.174.092-.511.278-1.279.556-2.302.278-1.023.602-2.067.973-3.132l1.042-3.005c.325-.938.58-1.577.765-1.918a10.157 10.157 0 0 1 2.224-2.941z"/></svg>

+ 1
- 0
VUECODE/smart-property-manage/src/icons/svg/index.svg View File

@@ -0,0 +1 @@
1
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1543202883234" class="icon" style="" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="10581" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M816.4 545.1l0 337.4c0 28.7-23.2 51.9-51.9 51.9L609.2 934.4 609.2 673.9c0-14.3-11.6-25.9-25.9-25.9L427.6 648c-14.3 0-25.9 11.6-25.9 25.9l0 260.4L246.3 934.3c-28.7 0-51.9-23.2-51.9-51.9L194.4 545.1 142 545.1l0 389.1c0 28.7 16.7 51.9 45.4 51.9l221.1 0 0-0.8 45.1 0L453.6 686.9l103 0 0.8 298.3 45.1 0 0 0.8 221.1 0c28.7 0 45.4-23.2 45.4-51.9L869 545.1 816.4 545.1zM505.4 63.8c-6.9 0-13.8 2.5-18.6 7.6L41.7 531.7c-10 10.3-9.7 26.7 0.6 36.7 5 4.9 11.5 7.3 18 7.3 6.8 0 13.6-2.6 18.7-7.9l426.4-441.1 426.4 441.1c5.1 5.3 11.9 7.9 18.6 7.9 6.5 0 13-2.4 18-7.3 10.3-10 10.6-26.4 0.6-36.7L524.1 71.3C519.2 66.3 512.3 63.8 505.4 63.8L505.4 63.8z" p-id="10582"></path></svg>

+ 1
- 0
VUECODE/smart-property-manage/src/icons/svg/link.svg View File

@@ -0,0 +1 @@
1
+<svg width="128" height="128" xmlns="http://www.w3.org/2000/svg"><g><path d="M115.625 127.937H.063V12.375h57.781v12.374H12.438v90.813h90.813V70.156h12.374z"/><path d="M116.426 2.821l8.753 8.753-56.734 56.734-8.753-8.745z"/><path d="M127.893 37.982h-12.375V12.375H88.706V0h39.187z"/></g></svg>

+ 1
- 0
VUECODE/smart-property-manage/src/icons/svg/nested.svg View File

@@ -0,0 +1 @@
1
+<svg width="128" height="128" xmlns="http://www.w3.org/2000/svg"><path d="M.002 9.2c0 5.044 3.58 9.133 7.998 9.133 4.417 0 7.997-4.089 7.997-9.133 0-5.043-3.58-9.132-7.997-9.132S.002 4.157.002 9.2zM31.997.066h95.981V18.33H31.997V.066zm0 45.669c0 5.044 3.58 9.132 7.998 9.132 4.417 0 7.997-4.088 7.997-9.132 0-3.263-1.524-6.278-3.998-7.91-2.475-1.63-5.524-1.63-7.998 0-2.475 1.632-4 4.647-4 7.91zM63.992 36.6h63.986v18.265H63.992V36.6zm-31.995 82.2c0 5.043 3.58 9.132 7.998 9.132 4.417 0 7.997-4.089 7.997-9.132 0-5.044-3.58-9.133-7.997-9.133s-7.998 4.089-7.998 9.133zm31.995-9.131h63.986v18.265H63.992V109.67zm0-27.404c0 5.044 3.58 9.133 7.998 9.133 4.417 0 7.997-4.089 7.997-9.133 0-3.263-1.524-6.277-3.998-7.909-2.475-1.631-5.524-1.631-7.998 0-2.475 1.632-4 4.646-4 7.91zm31.995-9.13h31.991V91.4H95.987V73.135z"/></svg>

+ 1
- 0
VUECODE/smart-property-manage/src/icons/svg/operate.svg View File

@@ -0,0 +1 @@
1
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1543202499761" class="icon" style="" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4706" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M362.8 197.04a318.72 318.72 0 0 1 345.52 30.64 96 96 0 1 0 38.4-51.68 384 384 0 0 0-419.92-32.64l1.36 1.2a157.52 157.52 0 0 1 34.64 52.48zM192 480a317.52 317.52 0 0 1 26.96-128h6.08A96 96 0 1 0 160 326.48a384 384 0 0 0 200.88 506.64 160.64 160.64 0 0 1 14.48-64A320 320 0 0 1 192 480z m631.2-74.4a320 320 0 0 1-224.88 382.48 96 96 0 1 0 8.56 64 384 384 0 0 0 276.64-469.44 158.96 158.96 0 0 1-60.32 22.96z" p-id="4707"></path></svg>

+ 1
- 0
VUECODE/smart-property-manage/src/icons/svg/password.svg View File

@@ -0,0 +1 @@
1
+<svg width="128" height="128" xmlns="http://www.w3.org/2000/svg"><path d="M108.8 44.322H89.6v-5.36c0-9.04-3.308-24.163-25.6-24.163-23.145 0-25.6 16.881-25.6 24.162v5.361H19.2v-5.36C19.2 15.281 36.798 0 64 0c27.202 0 44.8 15.281 44.8 38.961v5.361zm-32 39.356c0-5.44-5.763-9.832-12.8-9.832-7.037 0-12.8 4.392-12.8 9.832 0 3.682 2.567 6.808 6.407 8.477v11.205c0 2.718 2.875 4.962 6.4 4.962 3.524 0 6.4-2.244 6.4-4.962V92.155c3.833-1.669 6.393-4.795 6.393-8.477zM128 64v49.201c0 8.158-8.645 14.799-19.2 14.799H19.2C8.651 128 0 121.359 0 113.201V64c0-8.153 8.645-14.799 19.2-14.799h89.6c10.555 0 19.2 6.646 19.2 14.799z"/></svg>

+ 1
- 0
VUECODE/smart-property-manage/src/icons/svg/table.svg View File

@@ -0,0 +1 @@
1
+<svg width="128" height="128" xmlns="http://www.w3.org/2000/svg"><g><path d="M.006.064h127.988v31.104H.006V.064zm0 38.016h38.396v41.472H.006V38.08zm0 48.384h38.396v41.472H.006V86.464zM44.802 38.08h38.396v41.472H44.802V38.08zm0 48.384h38.396v41.472H44.802V86.464zM89.598 38.08h38.396v41.472H89.598zm0 48.384h38.396v41.472H89.598z"/><path d="M.006.064h127.988v31.104H.006V.064zm0 38.016h38.396v41.472H.006V38.08zm0 48.384h38.396v41.472H.006V86.464zM44.802 38.08h38.396v41.472H44.802V38.08zm0 48.384h38.396v41.472H44.802V86.464zM89.598 38.08h38.396v41.472H89.598zm0 48.384h38.396v41.472H89.598z"/></g></svg>

+ 1
- 0
VUECODE/smart-property-manage/src/icons/svg/tree.svg View File

@@ -0,0 +1 @@
1
+<svg width="128" height="128" xmlns="http://www.w3.org/2000/svg"><path d="M126.713 90.023c.858.985 1.287 2.134 1.287 3.447v29.553c0 1.423-.429 2.6-1.287 3.53-.858.93-1.907 1.395-3.146 1.395H97.824c-1.145 0-2.146-.465-3.004-1.395-.858-.93-1.287-2.107-1.287-3.53V93.47c0-.875.19-1.696.572-2.462.382-.766.906-1.368 1.573-1.806a3.84 3.84 0 0 1 2.146-.657h9.725V69.007a3.84 3.84 0 0 0-.43-1.806 3.569 3.569 0 0 0-1.143-1.313 2.714 2.714 0 0 0-1.573-.492h-36.47v23.149h9.725c1.144 0 2.145.492 3.004 1.478.858.985 1.287 2.134 1.287 3.447v29.553c0 .876-.191 1.696-.573 2.463-.38.766-.905 1.368-1.573 1.806a3.84 3.84 0 0 1-2.145.656H51.915a3.84 3.84 0 0 1-2.145-.656c-.668-.438-1.216-1.04-1.645-1.806a4.96 4.96 0 0 1-.644-2.463V93.47c0-1.313.43-2.462 1.288-3.447.858-.986 1.907-1.478 3.146-1.478h9.582v-23.15h-37.9c-.953 0-1.74.356-2.359 1.068-.62.711-.93 1.56-.93 2.544v19.538h9.726c1.239 0 2.264.492 3.074 1.478.81.985 1.216 2.134 1.216 3.447v29.553c0 1.423-.405 2.6-1.216 3.53-.81.93-1.835 1.395-3.074 1.395H4.29c-.476 0-.93-.082-1.358-.246a4.1 4.1 0 0 1-1.144-.657 4.658 4.658 0 0 1-.93-1.067 5.186 5.186 0 0 1-.643-1.395 5.566 5.566 0 0 1-.215-1.56V93.47c0-.437.048-.875.143-1.313a3.95 3.95 0 0 1 .429-1.15c.19-.328.429-.656.715-.984.286-.329.572-.602.858-.821.286-.22.62-.383 1.001-.493.382-.11.763-.164 1.144-.164h9.726V61.619c0-.985.31-1.833.93-2.544.619-.712 1.358-1.068 2.216-1.068h44.335V39.62h-9.582c-1.24 0-2.288-.492-3.146-1.477a5.09 5.09 0 0 1-1.287-3.448V5.14c0-1.423.429-2.627 1.287-3.612.858-.985 1.907-1.477 3.146-1.477h25.743c.763 0 1.478.246 2.145.739a5.17 5.17 0 0 1 1.573 1.888c.382.766.573 1.587.573 2.462v29.553c0 1.313-.43 2.463-1.287 3.448-.859.985-1.86 1.477-3.004 1.477h-9.725v18.389h42.762c.954 0 1.74.355 2.36 1.067.62.711.93 1.56.93 2.545v26.925h9.582c1.239 0 2.288.492 3.146 1.478z"/></svg>

+ 1
- 0
VUECODE/smart-property-manage/src/icons/svg/user.svg View File

@@ -0,0 +1 @@
1
+<svg width="130" height="130" xmlns="http://www.w3.org/2000/svg"><path d="M63.444 64.996c20.633 0 37.359-14.308 37.359-31.953 0-17.649-16.726-31.952-37.359-31.952-20.631 0-37.36 14.303-37.358 31.952 0 17.645 16.727 31.953 37.359 31.953zM80.57 75.65H49.434c-26.652 0-48.26 18.477-48.26 41.27v2.664c0 9.316 21.608 9.325 48.26 9.325H80.57c26.649 0 48.256-.344 48.256-9.325v-2.663c0-22.794-21.605-41.271-48.256-41.271z" stroke="#979797"/></svg>

+ 22
- 0
VUECODE/smart-property-manage/src/icons/svgo.yml View File

@@ -0,0 +1,22 @@
1
+# replace default config
2
+
3
+# multipass: true
4
+# full: true
5
+
6
+plugins:
7
+
8
+  # - name
9
+  #
10
+  # or:
11
+  # - name: false
12
+  # - name: true
13
+  #
14
+  # or:
15
+  # - name:
16
+  #     param1: 1
17
+  #     param2: 2
18
+
19
+- removeAttrs:
20
+    attrs:
21
+      - 'fill'
22
+      - 'fill-rule'

+ 36
- 0
VUECODE/smart-property-manage/src/main.js View File

@@ -0,0 +1,36 @@
1
+import Vue from 'vue'
2
+
3
+import 'normalize.css/normalize.css' // A modern alternative to CSS resets
4
+
5
+import ElementUI from 'element-ui'
6
+import 'element-ui/lib/theme-chalk/index.css'
7
+
8
+import '@/styles/index.scss' // global css
9
+
10
+import App from './App'
11
+import router from './router'
12
+import store from './store'
13
+
14
+import '@/icons' // icon
15
+import '@/permission' // permission control
16
+
17
+import VueAMap from 'vue-amap'
18
+
19
+// Vue.use(ElementUI, { locale })
20
+Vue.use(ElementUI)
21
+Vue.use(VueAMap)
22
+
23
+Vue.config.productionTip = false
24
+
25
+VueAMap.initAMapApiLoader({
26
+  key: 'f0d1d4f82432504003ebf46e5e36ff03',
27
+  plugin: ['AMap.Autocomplete', 'AMap.PlaceSearch', 'AMap.Scale', 'AMap.OverView', 'AMap.ToolBar', 'AMap.MapType', 'AMap.PolyEditor', 'AMap.CircleEditor', 'AMap.DistrictLayer'],
28
+  // 默认高德 sdk 版本为 1.4.10
29
+  v: '1.4.10'
30
+})
31
+new Vue({
32
+  el: '#app',
33
+  router,
34
+  store,
35
+  render: h => h(App)
36
+})

+ 47
- 0
VUECODE/smart-property-manage/src/permission.js View File

@@ -0,0 +1,47 @@
1
+import router from './router'
2
+import store from './store'
3
+import NProgress from 'nprogress' // Progress 进度条
4
+import 'nprogress/nprogress.css'// Progress 进度条样式
5
+import { Message } from 'element-ui'
6
+import { getToken } from '@/utils/auth' // 验权
7
+
8
+const whiteList = ['/login'] // 不重定向白名单
9
+router.beforeEach((to, from, next) => {
10
+  NProgress.start()
11
+  console.log("路径: ", to.path)
12
+  // if (getToken()) {
13
+  //   if (to.path === '/login') {
14
+  //     next({ path: '/' })
15
+  //     NProgress.done() // if current page is dashboard will not trigger	afterEach hook, so manually handle it
16
+  //   }else {
17
+  //     if (store.getters.roles.length === 0) {
18
+  //       store.dispatch('GetInfo').then(res => { // 拉取用户信息
19
+  //         next()
20
+  //       }).catch((err) => {
21
+  //         store.dispatch('FedLogOut').then(() => {
22
+  //           Message.error(err || 'Verification failed, please login again')
23
+  //           next({ path: '/' })
24
+  //         })
25
+  //       })
26
+  //     } else {
27
+  //       next()
28
+  //     }
29
+  //   }
30
+  // } else {
31
+  //   // if (to.path === '/') {
32
+  //   //   next(`/login?redirect=${to.path}`)
33
+  //   //   NProgress.done()
34
+  //   // }
35
+  //   if (whiteList.indexOf(to.path) !== -1) {
36
+  //     next()
37
+  //   } else {
38
+  //     next(`/login?redirect=${to.path}`) // 否则全部重定向到登录页
39
+  //     NProgress.done()
40
+  //   }
41
+  // }
42
+  next()
43
+})
44
+
45
+router.afterEach(() => {
46
+  NProgress.done() // 结束Progress
47
+})

+ 88
- 0
VUECODE/smart-property-manage/src/router/index.js View File

@@ -0,0 +1,88 @@
1
+import Vue from 'vue'
2
+import Router from 'vue-router'
3
+
4
+// in development-env not use lazy-loading, because lazy-loading too many pages will cause webpack hot update too slow. so only in production use lazy-loading;
5
+// detail: https://panjiachen.github.io/vue-element-admin-site/#/lazy-loading
6
+
7
+Vue.use(Router)
8
+
9
+/* Layout */
10
+import Layout from '../views/layout/Layout'
11
+
12
+/**
13
+* hidden: true                   if `hidden:true` will not show in the sidebar(default is false)
14
+* alwaysShow: true               if set true, will always show the root menu, whatever its child routes length
15
+*                                if not set alwaysShow, only more than one route under the children
16
+*                                it will becomes nested mode, otherwise not show the root menu
17
+* redirect: noredirect           if `redirect:noredirect` will no redirect in the breadcrumb
18
+* name:'router-name'             the name is used by <keep-alive> (must set!!!)
19
+* meta : {
20
+    title: 'title'               the name show in submenu and breadcrumb (recommend set)
21
+    icon: 'svg-name'             the icon show in the sidebar,
22
+  }
23
+**/
24
+export const constantRouterMap = [
25
+  { path: '/login', component: () => import('@/views/login/index'), hidden: true },
26
+  { path: '/404', component: () => import('@/views/404'), hidden: true },
27
+  {
28
+    path: '/dashboard',
29
+    component: Layout,
30
+    redirect: '/dashboard',
31
+    name: 'Dashboard',
32
+    hidden: true,
33
+    children: [{
34
+      path: 'dashboard',
35
+      component: () => import('@/views/dashboard/index')
36
+    }]
37
+  },
38
+
39
+  {
40
+    path: '/',
41
+    component: Layout,
42
+    redirect: '/index',
43
+    children: [
44
+      {
45
+        path: '',
46
+        component: () => import('@/views/index/index'),
47
+        name: 'index',
48
+        meta: { title: '首页', icon: 'index' }
49
+      }
50
+    ]
51
+  },
52
+  {
53
+    path: '/building',
54
+    component: Layout,
55
+    redirect: '/building/index',
56
+    alwaysShow: true,
57
+    meta: { title: '业主/楼栋', icon: 'zip' },
58
+    children: [
59
+      {
60
+        path: '/building/index',
61
+        component: () => import('@/views/building/index'),
62
+        name: 'building-index',
63
+        meta: { title: '楼栋业主资料库', icon: 'building' }
64
+      },
65
+      {
66
+        path: '/owner/index',
67
+        component: () => import('@/views/owner/index'),
68
+        name: 'owner-index',
69
+        meta: { title: '已认证业主', icon: 'building' }
70
+      },
71
+      // {
72
+      //   path: '/banner/infoBanner',
73
+      //   component: () => import('@/views/banner/infoBanner/index'),
74
+      //   name: 'banner-info',
75
+      //   hidden: true,
76
+      //   meta: { title: '查看banner', icon: 'table' }
77
+      // }
78
+    ]
79
+  },
80
+
81
+  { path: '*', redirect: '/404', hidden: true }
82
+]
83
+
84
+export default new Router({
85
+  // mode: 'history', //后端支持可开
86
+  scrollBehavior: () => ({ y: 0 }),
87
+  routes: constantRouterMap
88
+})

+ 11
- 0
VUECODE/smart-property-manage/src/store/getters.js View File

@@ -0,0 +1,11 @@
1
+const getters = {
2
+  sidebar: state => state.app.sidebar,
3
+  device: state => state.app.device,
4
+  token: state => state.user.token,
5
+  avatar: state => state.user.avatar,
6
+  name: state => state.user.name,
7
+  roles: state => state.user.roles,
8
+  userData: state => state.user.userData,
9
+  trunkIndex: state => state.trunkIndex.trunkIndex,
10
+}
11
+export default getters

+ 23
- 0
VUECODE/smart-property-manage/src/store/index.js View File

@@ -0,0 +1,23 @@
1
+import Vue from 'vue'
2
+import Vuex from 'vuex'
3
+import app from './modules/app'
4
+import user from './modules/user'
5
+import banner from './modules/banner'
6
+import community from './modules/community'
7
+import trunkIndex from './modules/trunkIndex'
8
+import getters from './getters'
9
+
10
+Vue.use(Vuex)
11
+
12
+const store = new Vuex.Store({
13
+  modules: {
14
+    app,
15
+    user,
16
+    community,
17
+    banner,
18
+    trunkIndex
19
+  },
20
+  getters
21
+})
22
+
23
+export default store

+ 43
- 0
VUECODE/smart-property-manage/src/store/modules/app.js View File

@@ -0,0 +1,43 @@
1
+import Cookies from 'js-cookie'
2
+
3
+const app = {
4
+  state: {
5
+    sidebar: {
6
+      opened: !+Cookies.get('sidebarStatus'),
7
+      withoutAnimation: false
8
+    },
9
+    device: 'desktop'
10
+  },
11
+  mutations: {
12
+    TOGGLE_SIDEBAR: state => {
13
+      if (state.sidebar.opened) {
14
+        Cookies.set('sidebarStatus', 1)
15
+      } else {
16
+        Cookies.set('sidebarStatus', 0)
17
+      }
18
+      state.sidebar.opened = !state.sidebar.opened
19
+      state.sidebar.withoutAnimation = false
20
+    },
21
+    CLOSE_SIDEBAR: (state, withoutAnimation) => {
22
+      Cookies.set('sidebarStatus', 1)
23
+      state.sidebar.opened = false
24
+      state.sidebar.withoutAnimation = withoutAnimation
25
+    },
26
+    TOGGLE_DEVICE: (state, device) => {
27
+      state.device = device
28
+    }
29
+  },
30
+  actions: {
31
+    ToggleSideBar: ({ commit }) => {
32
+      commit('TOGGLE_SIDEBAR')
33
+    },
34
+    CloseSideBar({ commit }, { withoutAnimation }) {
35
+      commit('CLOSE_SIDEBAR', withoutAnimation)
36
+    },
37
+    ToggleDevice({ commit }, device) {
38
+      commit('TOGGLE_DEVICE', device)
39
+    }
40
+  }
41
+}
42
+
43
+export default app

+ 66
- 0
VUECODE/smart-property-manage/src/store/modules/banner.js View File

@@ -0,0 +1,66 @@
1
+import { getBanner, addBanner, updateBanner, deleteBanner, getByBannerId } from '@/api/banner'
2
+
3
+const banner = {
4
+  actions: {
5
+
6
+    // 根据条件查询 banner
7
+    GetBanner({ commit }, listQuery) {
8
+      return new Promise((resolve, reject) => {
9
+        getBanner(listQuery).then(response => {
10
+          const data = response.data
11
+          resolve(data)
12
+        }).catch(error => {
13
+          reject(error)
14
+        })
15
+        resolve
16
+      })
17
+    },
18
+
19
+    // 添加 banner
20
+    AddBanner({ commit }, banner) {
21
+      return new Promise((resolve, reject) => {
22
+        addBanner(banner).then(response => {
23
+          resolve(response)
24
+        }).catch(error => {
25
+          reject(error)
26
+        })
27
+      })
28
+    },
29
+
30
+    // 修改 banner
31
+    UpdateBanner({ commit }, banner) {
32
+      return new Promise((resolve, reject) => {
33
+        updateBanner(banner).then(response => {
34
+          resolve(response)
35
+        }).catch(error => {
36
+          reject(error)
37
+        })
38
+      })
39
+    },
40
+
41
+    // 删除 banner
42
+    DeleteBanner({ commit }, bannerId) {
43
+      return new Promise((resolve, reject) => {
44
+        deleteBanner(bannerId).then(response => {
45
+          resolve(response)
46
+        }).catch(error => {
47
+          reject(error)
48
+        })
49
+      })
50
+    },
51
+
52
+    // 根据bannerId查询 banner
53
+    GetByBannerId({ commit }, bannerId) {
54
+      return new Promise((resolve, reject) => {
55
+        getByBannerId(bannerId).then(response => {
56
+          const data = response.data
57
+          resolve(data)
58
+        }).catch(error => {
59
+          reject(error)
60
+        })
61
+      })
62
+    }
63
+  }
64
+}
65
+
66
+export default banner

+ 170
- 0
VUECODE/smart-property-manage/src/store/modules/community.js View File

@@ -0,0 +1,170 @@
1
+import { fetchList, createCommunity, updateCommunity, fetchProvinceList, fetchCityList, fetchDistrictList } from '@/api/community'
2
+
3
+const community = {
4
+  namespaced: true,
5
+  state: {
6
+    total: '',
7
+    list: [],
8
+    detail: {
9
+      longitude: '',
10
+      latitude: ''
11
+    },
12
+    provinceList: [],
13
+    cityList: [],
14
+    districtList: [],
15
+    editCityList: [],
16
+    editDistrictList: []
17
+  },
18
+
19
+  mutations: {
20
+    SET_LIST: (state, list) => {
21
+      state.list = list
22
+    },
23
+    Insert_LIST: (state, detail) => {
24
+      state.list = [detail, ...list]
25
+    },
26
+    UpdateList: (state, detail) => {
27
+      state.list = state.list.map(item => {
28
+        if (item.id === detail.id) {
29
+          return detail
30
+        }
31
+        return item
32
+      })
33
+    },
34
+    SET_TOTAL: (state, total) => {
35
+      state.total = total
36
+    },
37
+    setDetail: (state, item) => {
38
+      state.detail = item
39
+    },
40
+    SET_PROVINCE_LIST: (state, provinceList) => {
41
+      state.provinceList = provinceList
42
+    },
43
+    SET_CITY_LIST: (state, cityList) => {
44
+      state.cityList = cityList
45
+    },
46
+    SET_DISTRICT_LIST: (state, districtList) => {
47
+      state.districtList = districtList
48
+    },
49
+    SET_EDIT_CITY_LIST: (state, editCityList) => {
50
+      state.editCityList = editCityList
51
+    },
52
+    SET_EDIT_DISTRICT_LIST: (state, editDistrictList) => {
53
+      state.editDistrictList = editDistrictList
54
+    },
55
+    resetDetail: (state) => {
56
+      state.detail = {
57
+        ...{
58
+          id: undefined,
59
+          importance: 1,
60
+          remark: '',
61
+          timestamp: new Date(),
62
+          title: '',
63
+          status: 'published',
64
+          type: '',
65
+          longitude: '',
66
+          latitude: ''
67
+        }
68
+      }
69
+    }
70
+  },
71
+
72
+  actions: {
73
+    // fetchList,获取社区列表
74
+    FetchCommunityList({ commit }, listQuery) {
75
+      return new Promise((resolve, reject) => {
76
+        fetchList(listQuery).then(response => {
77
+          const data = response.data
78
+          commit('SET_LIST', data.items)
79
+          commit('SET_TOTAL', data.total)
80
+          resolve()
81
+        }).catch(error => {
82
+          reject(error)
83
+        })
84
+      })
85
+    },
86
+
87
+    CreateCommunity({ commit }, datail) {
88
+      return new Promise((resolve, reject) => {
89
+        createCommunity(datail).then(response => {
90
+          resolve(response)
91
+        }).catch(error => {
92
+          reject(error)
93
+        })
94
+      })
95
+    },
96
+
97
+    UpdateCommunity({ commit }, datail) {
98
+      return new Promise((resolve, reject) => {
99
+        updateCommunity(datail).then(response => {
100
+          resolve(response)
101
+        }).catch(error => {
102
+          reject(error)
103
+        })
104
+      })
105
+    },
106
+
107
+    FetchProvinceList({ commit }) {
108
+      return new Promise((resolve, reject) => {
109
+        fetchProvinceList().then(response => {
110
+          const data = response.data
111
+          commit('SET_PROVINCE_LIST', data)
112
+          resolve()
113
+        }).catch(error => {
114
+          reject(error)
115
+        })
116
+      })
117
+    },
118
+
119
+    FetchCityList({ commit }, provinceId) {
120
+      return new Promise((resolve, reject) => {
121
+        fetchCityList(provinceId).then(response => {
122
+          const data = response.data
123
+          commit('SET_CITY_LIST', data)
124
+          resolve(response)
125
+        }).catch(error => {
126
+          reject(error)
127
+        })
128
+      })
129
+    },
130
+
131
+    FetchDistrictList({ commit }, cityId) {
132
+      return new Promise((resolve, reject) => {
133
+        fetchDistrictList(cityId).then(response => {
134
+          const data = response.data
135
+          commit('SET_DISTRICT_LIST', data)
136
+          resolve(response)
137
+        }).catch(error => {
138
+          reject(error)
139
+        })
140
+      })
141
+    },
142
+
143
+    FetchEditCityList({ commit }, provinceId) {
144
+      return new Promise((resolve, reject) => {
145
+        fetchCityList(provinceId).then(response => {
146
+          const data = response.data
147
+          commit('SET_EDIT_CITY_LIST', data)
148
+          resolve()
149
+        }).catch(error => {
150
+          reject(error)
151
+        })
152
+      })
153
+    },
154
+
155
+    FetchEditDistrictList({ commit }, cityId) {
156
+      return new Promise((resolve, reject) => {
157
+        fetchDistrictList(cityId).then(response => {
158
+          const data = response.data
159
+          commit('SET_EDIT_DISTRICT_LIST', data)
160
+          resolve()
161
+        }).catch(error => {
162
+          reject(error)
163
+        })
164
+      })
165
+    }
166
+
167
+  }
168
+}
169
+
170
+export default community

+ 48
- 0
VUECODE/smart-property-manage/src/store/modules/trunkIndex.js View File

@@ -0,0 +1,48 @@
1
+import { getHardData, getSignUser } from '@/api/index'
2
+
3
+const trunkIndex = {
4
+  namespaced: true,
5
+  state: {
6
+    trunkIndex: {
7
+      hardData: null,
8
+      signUser: null
9
+    }
10
+  },
11
+  mutations: {
12
+    upDateHardData: (state, data) => {
13
+      state.trunkIndex.hardData = data
14
+    },
15
+    upDateSignUser: (state, data) => {
16
+      state.trunkIndex.signUser = data
17
+    }
18
+  },
19
+  actions: {
20
+    // 硬件数据统计
21
+    GetHardData ({ commit }) {
22
+      return new Promise((resolve, reject) => {
23
+        getHardData().then(response => {
24
+          const data = response.data
25
+          commit('upDateHardData', data)
26
+          resolve()
27
+        }).catch(error => {
28
+          reject(error)
29
+        })
30
+      })
31
+    },
32
+
33
+    // 注册用户统计
34
+    GetSignUser ({ commit }) {
35
+      return new Promise((resolve, reject) => {
36
+        getSignUser().then(response => {
37
+          const data = response.data
38
+          commit('upDateSignUser', data)
39
+          resolve(data)
40
+        }).catch(error => {
41
+          reject(error)
42
+        })
43
+      })
44
+    }
45
+  }
46
+}
47
+
48
+export default trunkIndex

+ 105
- 0
VUECODE/smart-property-manage/src/store/modules/user.js View File

@@ -0,0 +1,105 @@
1
+import { login, logout, getInfo, sendCode } from '@/api/login'
2
+import { getToken, setToken, removeToken } from '@/utils/auth'
3
+
4
+const user = {
5
+  state: {
6
+    token: getToken(),
7
+    name: '',
8
+    avatar: '',
9
+    roles: [],
10
+    userData: []
11
+  },
12
+
13
+  mutations: {
14
+    SET_TOKEN: (state, token) => {
15
+      state.token = token
16
+    },
17
+    SET_NAME: (state, name) => {
18
+      state.name = name
19
+    },
20
+    SET_AVATAR: (state, avatar) => {
21
+      state.avatar = avatar
22
+    },
23
+    SET_ROLES: (state, roles) => {
24
+      state.roles = roles
25
+    },
26
+    SET_USER_DATA: (state, userData) => {
27
+      state.userData = userData
28
+    }
29
+  },
30
+
31
+  actions: {
32
+    // 登录
33
+    Login({ commit }, userInfo) {
34
+      const username = userInfo.username.trim()
35
+      return new Promise((resolve, reject) => {
36
+        login(username, userInfo.password).then(response => {
37
+          const data = response.data
38
+          setToken(data.token)
39
+          commit('SET_TOKEN', data.token)
40
+          resolve(response)
41
+        }).catch(error => {
42
+          reject(error)
43
+        })
44
+      })
45
+    },
46
+
47
+    // 获取用户信息
48
+    GetInfo({ commit, state }) {
49
+      return new Promise((resolve, reject) => {
50
+        getInfo().then(response => {
51
+          const data = response.data
52
+          if (data.roles && data.roles.length > 0) { // 验证返回的roles是否是一个非空数组
53
+            commit('SET_ROLES', data.roles)
54
+          } else {
55
+            reject('getInfo: roles must be a non-null array !')
56
+          }
57
+          commit('SET_NAME', data.userName)
58
+          commit('SET_AVATAR', data.loginName)
59
+          commit('SET_USER_DATA', data)
60
+          resolve(response)
61
+        }).catch(error => {
62
+          reject(error)
63
+        })
64
+      })
65
+    },
66
+
67
+    // 发送验证码
68
+    SendCode({ commit, state }, userName) {
69
+      return new Promise((resolve, reject) => {
70
+        sendCode(userName).then(response => {
71
+          //const data = response.message
72
+          // resolve(data)
73
+          resolve(response)
74
+        }).catch(error => {
75
+          reject(error)
76
+        })
77
+      })
78
+    },
79
+
80
+    // 登出
81
+    LogOut({ commit, state }) {
82
+      return new Promise((resolve, reject) => {
83
+        logout(state.token).then(() => {
84
+          commit('SET_TOKEN', '')
85
+          commit('SET_ROLES', [])
86
+          removeToken()
87
+          resolve()
88
+        }).catch(error => {
89
+          reject(error)
90
+        })
91
+      })
92
+    },
93
+
94
+    // 前端 登出
95
+    FedLogOut({ commit }) {
96
+      return new Promise(resolve => {
97
+        commit('SET_TOKEN', '')
98
+        removeToken()
99
+        resolve()
100
+      })
101
+    }
102
+  }
103
+}
104
+
105
+export default user

+ 29
- 0
VUECODE/smart-property-manage/src/styles/element-ui.scss View File

@@ -0,0 +1,29 @@
1
+ //to reset element-ui default css
2
+.el-upload {
3
+  input[type="file"] {
4
+    display: none !important;
5
+  }
6
+}
7
+
8
+.el-upload__input {
9
+  display: none;
10
+}
11
+
12
+//暂时性解决diolag 问题 https://github.com/ElemeFE/element/issues/2461
13
+.el-dialog {
14
+  transform: none;
15
+  left: 0;
16
+  position: relative;
17
+  margin: 0 auto;
18
+}
19
+
20
+//element ui upload
21
+.upload-container {
22
+  .el-upload {
23
+    width: 100%;
24
+    .el-upload-dragger {
25
+      width: 100%;
26
+      height: 200px;
27
+    }
28
+  }
29
+}

+ 78
- 0
VUECODE/smart-property-manage/src/styles/index.scss View File

@@ -0,0 +1,78 @@
1
+@import './variables.scss';
2
+@import './mixin.scss';
3
+@import './transition.scss';
4
+@import './element-ui.scss';
5
+@import './sidebar.scss';
6
+
7
+body {
8
+  height: 100%;
9
+  -moz-osx-font-smoothing: grayscale;
10
+  -webkit-font-smoothing: antialiased;
11
+  text-rendering: optimizeLegibility;
12
+  font-family: Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB, Microsoft YaHei, Arial, sans-serif;
13
+}
14
+
15
+label {
16
+  font-weight: 700;
17
+}
18
+
19
+html {
20
+  height: 100%;
21
+  box-sizing: border-box;
22
+}
23
+
24
+#app{
25
+  height: 100%;
26
+}
27
+
28
+*,
29
+*:before,
30
+*:after {
31
+  box-sizing: inherit;
32
+}
33
+
34
+a,
35
+a:focus,
36
+a:hover {
37
+  cursor: pointer;
38
+  color: inherit;
39
+  outline: none;
40
+  text-decoration: none;
41
+}
42
+
43
+div:focus{
44
+  outline: none;
45
+ }
46
+
47
+a:focus,
48
+a:active {
49
+  outline: none;
50
+}
51
+
52
+a,
53
+a:focus,
54
+a:hover {
55
+  cursor: pointer;
56
+  color: inherit;
57
+  text-decoration: none;
58
+}
59
+
60
+.clearfix {
61
+  &:after {
62
+    visibility: hidden;
63
+    display: block;
64
+    font-size: 0;
65
+    content: " ";
66
+    clear: both;
67
+    height: 0;
68
+  }
69
+}
70
+
71
+//main-container全局样式
72
+.app-main{
73
+  min-height: 100%
74
+}
75
+
76
+.app-container {
77
+  padding: 20px;
78
+}

+ 27
- 0
VUECODE/smart-property-manage/src/styles/mixin.scss View File

@@ -0,0 +1,27 @@
1
+@mixin clearfix {
2
+  &:after {
3
+    content: "";
4
+    display: table;
5
+    clear: both;
6
+  }
7
+}
8
+
9
+@mixin scrollBar {
10
+  &::-webkit-scrollbar-track-piece {
11
+    background: #d3dce6;
12
+  }
13
+  &::-webkit-scrollbar {
14
+    width: 6px;
15
+  }
16
+  &::-webkit-scrollbar-thumb {
17
+    background: #99a9bf;
18
+    border-radius: 20px;
19
+  }
20
+}
21
+
22
+@mixin relative {
23
+  position: relative;
24
+  width: 100%;
25
+  height: 100%;
26
+}
27
+

+ 133
- 0
VUECODE/smart-property-manage/src/styles/sidebar.scss View File

@@ -0,0 +1,133 @@
1
+#app {
2
+  // 主体区域
3
+  .main-container {
4
+    min-height: 100%;
5
+    transition: margin-left .28s;
6
+    margin-left: 180px;
7
+    position: relative;
8
+  }
9
+  // 侧边栏
10
+  .sidebar-container {
11
+    transition: width 0.28s;
12
+    width: 180px !important;
13
+    height: 100%;
14
+    position: fixed;
15
+    font-size: 0px;
16
+    top: 0;
17
+    bottom: 0;
18
+    left: 0;
19
+    z-index: 1001;
20
+    overflow: hidden;
21
+    //reset element-ui css
22
+    .horizontal-collapse-transition {
23
+      transition: 0s width ease-in-out, 0s padding-left ease-in-out, 0s padding-right ease-in-out;
24
+    }
25
+    .el-scrollbar__bar.is-vertical{
26
+      right: 0px;
27
+    }
28
+    .scrollbar-wrapper {
29
+      overflow-x: hidden!important;
30
+      .el-scrollbar__view {
31
+        height: 100%;
32
+      }
33
+    }
34
+    .is-horizontal {
35
+      display: none;
36
+    }
37
+    a {
38
+      display: inline-block;
39
+      width: 100%;
40
+      overflow: hidden;
41
+    }
42
+    .svg-icon {
43
+      margin-right: 16px;
44
+    }
45
+    .el-menu {
46
+      border: none;
47
+      height: 100%;
48
+      width: 100% !important;
49
+    }
50
+    .is-active > .el-submenu__title{
51
+      color: #f4f4f5!important;
52
+    }
53
+  }
54
+  .hideSidebar {
55
+    .sidebar-container {
56
+      width: 36px !important;
57
+    }
58
+    .main-container {
59
+      margin-left: 36px;
60
+    }
61
+    .submenu-title-noDropdown {
62
+      padding-left: 10px !important;
63
+      position: relative;
64
+      .el-tooltip {
65
+        padding: 0 10px !important;
66
+      }
67
+    }
68
+    .el-submenu {
69
+      overflow: hidden;
70
+      &>.el-submenu__title {
71
+        padding-left: 10px !important;
72
+        .el-submenu__icon-arrow {
73
+          display: none;
74
+        }
75
+      }
76
+    }
77
+    .el-menu--collapse {
78
+      .el-submenu {
79
+        &>.el-submenu__title {
80
+          &>span {
81
+            height: 0;
82
+            width: 0;
83
+            overflow: hidden;
84
+            visibility: hidden;
85
+            display: inline-block;
86
+          }
87
+        }
88
+      }
89
+    }
90
+  }
91
+  .sidebar-container .nest-menu .el-submenu>.el-submenu__title,
92
+  .sidebar-container .el-submenu .el-menu-item {
93
+    min-width: 180px !important;
94
+    background-color: $subMenuBg !important;
95
+    &:hover {
96
+      background-color: $menuHover !important;
97
+    }
98
+  }
99
+  .el-menu--collapse .el-menu .el-submenu {
100
+    min-width: 180px !important;
101
+  }
102
+
103
+  //适配移动端
104
+  .mobile {
105
+    .main-container {
106
+      margin-left: 0px;
107
+    }
108
+    .sidebar-container {
109
+      transition: transform .28s;
110
+      width: 180px !important;
111
+    }
112
+    &.hideSidebar {
113
+      .sidebar-container {
114
+        transition-duration: 0.3s;
115
+        transform: translate3d(-180px, 0, 0);
116
+      }
117
+    }
118
+  }
119
+  .withoutAnimation {
120
+    .main-container,
121
+    .sidebar-container {
122
+      transition: none;
123
+    }
124
+  }
125
+}
126
+
127
+.el-menu--vertical{
128
+  & >.el-menu{
129
+    .svg-icon{
130
+      margin-right: 16px;
131
+    }
132
+  }
133
+}

+ 46
- 0
VUECODE/smart-property-manage/src/styles/transition.scss View File

@@ -0,0 +1,46 @@
1
+//globl transition css
2
+
3
+/*fade*/
4
+.fade-enter-active,
5
+.fade-leave-active {
6
+  transition: opacity 0.28s;
7
+}
8
+
9
+.fade-enter,
10
+.fade-leave-active {
11
+  opacity: 0;
12
+}
13
+
14
+/*fade-transform*/
15
+.fade-transform-leave-active,
16
+.fade-transform-enter-active {
17
+  transition: all .5s;
18
+}
19
+.fade-transform-enter {
20
+  opacity: 0;
21
+  transform: translateX(-30px);
22
+}
23
+.fade-transform-leave-to {
24
+  opacity: 0;
25
+  transform: translateX(30px);
26
+}
27
+
28
+/*fade*/
29
+.breadcrumb-enter-active,
30
+.breadcrumb-leave-active {
31
+  transition: all .5s;
32
+}
33
+
34
+.breadcrumb-enter,
35
+.breadcrumb-leave-active {
36
+  opacity: 0;
37
+  transform: translateX(20px);
38
+}
39
+
40
+.breadcrumb-move {
41
+  transition: all .5s;
42
+}
43
+
44
+.breadcrumb-leave-active {
45
+  position: absolute;
46
+}

+ 4
- 0
VUECODE/smart-property-manage/src/styles/variables.scss View File

@@ -0,0 +1,4 @@
1
+//sidebar
2
+$menuBg:#304156;
3
+$subMenuBg:#1f2d3d;
4
+$menuHover:#001528;

+ 15
- 0
VUECODE/smart-property-manage/src/utils/auth.js View File

@@ -0,0 +1,15 @@
1
+import Cookies from 'js-cookie'
2
+
3
+const TokenKey = 'X-Auth-Token'
4
+
5
+export function getToken() {
6
+  return Cookies.get(TokenKey)
7
+}
8
+
9
+export function setToken(token) {
10
+  return Cookies.set(TokenKey, token, { expires: 7 })
11
+}
12
+
13
+export function removeToken() {
14
+  return Cookies.remove(TokenKey)
15
+}

+ 74
- 0
VUECODE/smart-property-manage/src/utils/index.js View File

@@ -0,0 +1,74 @@
1
+/**
2
+ * Created by jiachenpan on 16/11/18.
3
+ */
4
+
5
+export function parseTime(time, cFormat) {
6
+  if (arguments.length === 0) {
7
+    return null
8
+  }
9
+  const format = cFormat || '{y}-{m}-{d} {h}:{i}:{s}'
10
+  let date
11
+  if (typeof time === 'object') {
12
+    date = time
13
+  } else {
14
+    if (('' + time).length === 10) time = parseInt(time) * 1000
15
+    date = new Date(time)
16
+  }
17
+  const formatObj = {
18
+    y: date.getFullYear(),
19
+    m: date.getMonth() + 1,
20
+    d: date.getDate(),
21
+    h: date.getHours(),
22
+    i: date.getMinutes(),
23
+    s: date.getSeconds(),
24
+    a: date.getDay()
25
+  }
26
+  const time_str = format.replace(/{(y|m|d|h|i|s|a)+}/g, (result, key) => {
27
+    let value = formatObj[key]
28
+    // Note: getDay() returns 0 on Sunday
29
+    if (key === 'a') { return ['日', '一', '二', '三', '四', '五', '六'][value ] }
30
+    if (result.length > 0 && value < 10) {
31
+      value = '0' + value
32
+    }
33
+    return value || 0
34
+  })
35
+  return time_str
36
+}
37
+
38
+export function formatTime(time, option) {
39
+  time = +time * 1000
40
+  const d = new Date(time)
41
+  const now = Date.now()
42
+
43
+  const diff = (now - d) / 1000
44
+
45
+  if (diff < 30) {
46
+    return '刚刚'
47
+  } else if (diff < 3600) {
48
+    // less 1 hour
49
+    return Math.ceil(diff / 60) + '分钟前'
50
+  } else if (diff < 3600 * 24) {
51
+    return Math.ceil(diff / 3600) + '小时前'
52
+  } else if (diff < 3600 * 24 * 2) {
53
+    return '1天前'
54
+  }
55
+  if (option) {
56
+    return parseTime(time, option)
57
+  } else {
58
+    return (
59
+      d.getMonth() +
60
+      1 +
61
+      '月' +
62
+      d.getDate() +
63
+      '日' +
64
+      d.getHours() +
65
+      '时' +
66
+      d.getMinutes() +
67
+      '分'
68
+    )
69
+  }
70
+}
71
+
72
+export function isExternal(path) {
73
+  return /^(https?:|mailto:|tel:)/.test(path)
74
+}

+ 73
- 0
VUECODE/smart-property-manage/src/utils/request.js View File

@@ -0,0 +1,73 @@
1
+import axios from 'axios'
2
+import { Message, MessageBox } from 'element-ui'
3
+import store from '../store'
4
+import { getToken } from '@/utils/auth'
5
+
6
+// 创建axios实例
7
+const service = axios.create({
8
+  baseURL: process.env.BASE_API, // api 的 base_url
9
+  timeout: 10000 // 请求超时时间
10
+})
11
+
12
+// request拦截器
13
+service.interceptors.request.use(
14
+  config => {
15
+    if (store.getters.token) {
16
+      config.headers['X-Auth-Token'] = getToken() // 让每个请求携带自定义token 请根据实际情况自行修改
17
+    }
18
+    return config
19
+  },
20
+  error => {
21
+    // Do something with request error
22
+    console.log(error) // for debug
23
+    Promise.reject(error)
24
+  }
25
+)
26
+
27
+// response 拦截器
28
+service.interceptors.response.use(
29
+  response => {
30
+    /**
31
+     * code为非0是抛错
32
+     */
33
+    const res = response.data
34
+    if (res.code !== '0') {
35
+      Message({
36
+        message: res.message,
37
+        type: 'error',
38
+        duration: 5 * 1000
39
+      })
40
+
41
+      // 802:Token 身份凭证不存在; 50012:其他客户端登录了;  803:Token 过期了;
42
+      if (res.code === 802 || res.code === 50012 || res.code === 803) {
43
+        MessageBox.confirm(
44
+          '你已被登出,可以取消继续留在该页面,或者重新登录',
45
+          '确定登出',
46
+          {
47
+            confirmButtonText: '重新登录',
48
+            cancelButtonText: '取消',
49
+            type: 'warning'
50
+          }
51
+        ).then(() => {
52
+          store.dispatch('FedLogOut').then(() => {
53
+            location.reload() // 为了重新实例化vue-router对象 避免bug
54
+          })
55
+        })
56
+      }
57
+      return Promise.reject('error')
58
+    } else {
59
+      return response.data
60
+    }
61
+  },
62
+  error => {
63
+    console.log('err' + error) // for debug
64
+    Message({
65
+      message: error.message,
66
+      type: 'error',
67
+      duration: 5 * 1000
68
+    })
69
+    return Promise.reject(error)
70
+  }
71
+)
72
+
73
+export default service

+ 0
- 0
VUECODE/smart-property-manage/src/utils/scrollTo.js View File


Some files were not shown because too many files changed in this diff