seimin 3 anni fa
parent
commit
e5c76f1bb8
15 ha cambiato i file con 27068 aggiunte e 8 eliminazioni
  1. 7 0
      .browserslistrc
  2. 23 0
      .gitignore
  3. 16 8
      README.md
  4. 5 0
      babel.config.js
  5. 26502 0
      package-lock.json
  6. 32 0
      package.json
  7. 7 0
      postcss.config.js
  8. BIN
      public/favicon.ico
  9. 17 0
      public/index.html
  10. 97 0
      src/App.vue
  11. BIN
      src/assets/logo.png
  12. 88 0
      src/cube-ui.js
  13. 10 0
      src/main.js
  14. 222 0
      src/theme.styl
  15. 42 0
      vue.config.js

+ 7 - 0
.browserslistrc

@@ -0,0 +1,7 @@
1
+> 1%
2
+last 2 versions
3
+not dead
4
+
5
+not ie <= 11
6
+Android >= 4.0
7
+iOS >= 8

+ 23 - 0
.gitignore

@@ -0,0 +1,23 @@
1
+.DS_Store
2
+node_modules
3
+/dist
4
+
5
+
6
+# local env files
7
+.env.local
8
+.env.*.local
9
+
10
+# Log files
11
+npm-debug.log*
12
+yarn-debug.log*
13
+yarn-error.log*
14
+pnpm-debug.log*
15
+
16
+# Editor directories and files
17
+.idea
18
+.vscode
19
+*.suo
20
+*.ntvs*
21
+*.njsproj
22
+*.sln
23
+*.sw?

+ 16 - 8
README.md

@@ -1,11 +1,19 @@
1
-# 中南财经政法大学 ITSM
1
+# wx-index
2 2
 
3
-# ITSM3.0.2 版本升级
3
+## Project setup
4
+```
5
+npm install
6
+```
4 7
 
5
-```js
6
-pc-handle  PC运维端
7
-pc-repair  PC报修端
8
-wx-service 微信服务端
9
-wx-handle  微信运维端
10
-wx-repair  微信报修端
8
+### Compiles and hot-reloads for development
11 9
 ```
10
+npm run serve
11
+```
12
+
13
+### Compiles and minifies for production
14
+```
15
+npm run build
16
+```
17
+
18
+### Customize configuration
19
+See [Configuration Reference](https://cli.vuejs.org/config/).

+ 5 - 0
babel.config.js

@@ -0,0 +1,5 @@
1
+module.exports = {
2
+  presets: [
3
+    '@vue/cli-plugin-babel/preset'
4
+  ]
5
+}

File diff suppressed because it is too large
+ 26502 - 0
package-lock.json


+ 32 - 0
package.json

@@ -0,0 +1,32 @@
1
+{
2
+  "name": "wx-index",
3
+  "version": "0.1.0",
4
+  "private": true,
5
+  "scripts": {
6
+    "build": "vue-cli-service build",
7
+    "start": "vue-cli-service serve"
8
+  },
9
+  "dependencies": {
10
+    "amfe-flexible": "^2.2.1",
11
+    "core-js": "^3.6.5",
12
+    "cube-ui": "~1.12.15",
13
+    "vue": "^2.6.11"
14
+  },
15
+  "devDependencies": {
16
+    "@vue/cli-plugin-babel": "~4.5.0",
17
+    "@vue/cli-service": "~4.5.0",
18
+    "less": "^3.0.4",
19
+    "less-loader": "^5.0.0",
20
+    "postcss-px2rem": "^0.3.0",
21
+    "stylus": "^0.54.5",
22
+    "stylus-loader": "^3.0.2",
23
+    "vue-cli-plugin-cube-ui": "~0.2.5",
24
+    "vue-template-compiler": "^2.6.11"
25
+  },
26
+  "transformModules": {
27
+    "cube-ui": {
28
+      "transform": "cube-ui/src/modules/${member}",
29
+      "kebabCase": true
30
+    }
31
+  }
32
+}

+ 7 - 0
postcss.config.js

@@ -0,0 +1,7 @@
1
+module.exports = {
2
+  plugins: {
3
+    'postcss-px2rem': {
4
+      remUnit: 37.5
5
+    }
6
+  }
7
+}

BIN
public/favicon.ico


+ 17 - 0
public/index.html

@@ -0,0 +1,17 @@
1
+<!DOCTYPE html>
2
+<html lang="">
3
+  <head>
4
+    <meta charset="utf-8">
5
+    <meta http-equiv="X-UA-Compatible" content="IE=edge">
6
+    <meta name="viewport" content="width=device-width,initial-scale=1.0">
7
+    <link rel="icon" href="<%= BASE_URL %>favicon.ico">
8
+    <title><%= htmlWebpackPlugin.options.title %></title>
9
+  </head>
10
+  <body>
11
+    <noscript>
12
+      <strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
13
+    </noscript>
14
+    <div id="app"></div>
15
+    <!-- built files will be auto injected -->
16
+  </body>
17
+</html>

+ 97 - 0
src/App.vue

@@ -0,0 +1,97 @@
1
+<template>
2
+  <div id="app">
3
+    <cube-button @click="goTo('service')">进入微信服务台</cube-button>
4
+    <cube-button @click="goTo('user')">进入微信运维端</cube-button>
5
+    <cube-button @click="goTo('req')">进入微信报修端</cube-button>
6
+  </div>
7
+</template>
8
+
9
+<script>
10
+export default {
11
+  name: "App",
12
+  data() {
13
+    return {
14
+      baseUrl: document.location.protocol + "//" + document.domain,
15
+    };
16
+  },
17
+  methods: {
18
+    // 判断角色
19
+    roleHandler(user){
20
+
21
+    },
22
+    // 跳转应用
23
+    goTo(type) {
24
+      switch (type) {
25
+        case "service":
26
+          location.href = this.baseUrl + "/serviceApp";
27
+          break;
28
+        case "user":
29
+          location.href = this.baseUrl + "/user";
30
+          break;
31
+        case "req":
32
+          location.href = this.baseUrl + "/req";
33
+          break;
34
+      }
35
+    },
36
+    // 登陆
37
+    login() {
38
+      this.$http.post("service/auth/wechatlogin", {}).then(function(res) {
39
+        if (res.data.url) {
40
+          window.location.href = res.data.url;
41
+        } else {
42
+          if (res.data.user) {
43
+            this.roleHandler(res.data.user.user);
44
+          }
45
+        }
46
+      });
47
+    },
48
+    // 获取code
49
+    getCode() {
50
+      var url = window.location.href.split("?");
51
+      if (!url[1]) {
52
+        this.login();
53
+      } else {
54
+        var code = {
55
+          code: url[1],
56
+        };
57
+        this.$http.post("service/auth/wechatlogin2", code).then(res => {
58
+          if (res.data.state == 200) {
59
+            if (res.data.user) {
60
+              this.roleHandler(res.data.user.user);
61
+            }
62
+          } else if (res.data.state == 501) {
63
+            this
64
+              .$createDialog({
65
+                type: "alert",
66
+                title: "您的账号被删除,请联系管理员",
67
+                icon: "cubeic-alert"
68
+              })
69
+              .show();
70
+          } else {
71
+            this
72
+              .$createDialog({
73
+                type: "alert",
74
+                title: res.data.remarks,
75
+                icon: "cubeic-alert"
76
+              })
77
+              .show();
78
+          }
79
+        });
80
+      }
81
+    },
82
+  },
83
+  created() {
84
+    this.getCode();
85
+  },
86
+};
87
+</script>
88
+
89
+<style lang="less">
90
+#app {
91
+  height: 100vh;
92
+  button{
93
+    background-color: #005395;
94
+    margin-bottom: 0.2rem;
95
+  }
96
+}
97
+</style>

BIN
src/assets/logo.png


+ 88 - 0
src/cube-ui.js

@@ -0,0 +1,88 @@
1
+import Vue from 'vue'
2
+
3
+// By default we import all the components.
4
+// Only reserve the components on demand and remove the rest.
5
+// Style is always required.
6
+import {
7
+  /* eslint-disable no-unused-vars */
8
+  Style,
9
+  // basic
10
+  Button,
11
+  Loading,
12
+  Tip,
13
+  Toolbar,
14
+  TabBar,
15
+  TabPanels,
16
+  // form
17
+  Checkbox,
18
+  CheckboxGroup,
19
+  Checker,
20
+  Radio,
21
+  RadioGroup,
22
+  Input,
23
+  Textarea,
24
+  Select,
25
+  Switch,
26
+  Rate,
27
+  Validator,
28
+  Upload,
29
+  Form,
30
+  // popup
31
+  Popup,
32
+  Toast,
33
+  Picker,
34
+  CascadePicker,
35
+  DatePicker,
36
+  TimePicker,
37
+  SegmentPicker,
38
+  Dialog,
39
+  ActionSheet,
40
+  Drawer,
41
+  ImagePreview,
42
+  // scroll
43
+  Scroll,
44
+  Slide,
45
+  IndexList,
46
+  Swipe,
47
+  Sticky,
48
+  ScrollNav,
49
+  ScrollNavBar
50
+} from 'cube-ui'
51
+
52
+Vue.use(Button)
53
+Vue.use(Loading)
54
+Vue.use(Tip)
55
+Vue.use(Toolbar)
56
+Vue.use(TabBar)
57
+Vue.use(TabPanels)
58
+Vue.use(Checkbox)
59
+Vue.use(CheckboxGroup)
60
+Vue.use(Checker)
61
+Vue.use(Radio)
62
+Vue.use(RadioGroup)
63
+Vue.use(Input)
64
+Vue.use(Textarea)
65
+Vue.use(Select)
66
+Vue.use(Switch)
67
+Vue.use(Rate)
68
+Vue.use(Validator)
69
+Vue.use(Upload)
70
+Vue.use(Form)
71
+Vue.use(Popup)
72
+Vue.use(Toast)
73
+Vue.use(Picker)
74
+Vue.use(CascadePicker)
75
+Vue.use(DatePicker)
76
+Vue.use(TimePicker)
77
+Vue.use(SegmentPicker)
78
+Vue.use(Dialog)
79
+Vue.use(ActionSheet)
80
+Vue.use(Drawer)
81
+Vue.use(ImagePreview)
82
+Vue.use(Scroll)
83
+Vue.use(Slide)
84
+Vue.use(IndexList)
85
+Vue.use(Swipe)
86
+Vue.use(Sticky)
87
+Vue.use(ScrollNav)
88
+Vue.use(ScrollNavBar)

+ 10 - 0
src/main.js

@@ -0,0 +1,10 @@
1
+import Vue from 'vue'
2
+import './cube-ui'
3
+import App from './App.vue'
4
+import 'amfe-flexible'
5
+
6
+Vue.config.productionTip = false
7
+
8
+new Vue({
9
+  render: h => h(App),
10
+}).$mount('#app')

+ 222 - 0
src/theme.styl

@@ -0,0 +1,222 @@
1
+@require "~cube-ui/src/common/stylus/var/color.styl"
2
+
3
+
4
+// action-sheet
5
+$action-sheet-color := $color-grey
6
+$action-sheet-active-color := $color-orange
7
+$action-sheet-bgc := $color-white
8
+$action-sheet-active-bgc := $color-light-grey-opacity
9
+$action-sheet-title-color := $color-dark-grey
10
+$action-sheet-space-bgc := $color-mask-bg
11
+/// picker style
12
+$action-sheet-picker-cancel-color := $color-light-grey
13
+$action-sheet-picker-cancel-active-color := $color-light-grey-s
14
+
15
+// bubble
16
+
17
+// button
18
+$btn-color := $color-white
19
+$btn-bgc := $color-regular-blue
20
+$btn-bdc := $color-regular-blue
21
+$btn-active-bgc := $color-blue
22
+$btn-active-bdc := $color-blue
23
+$btn-disabled-color := $color-white
24
+$btn-disabled-bgc := $color-light-grey-s
25
+$btn-disabled-bdc := $color-light-grey-s
26
+/// primary
27
+$btn-primary-color := $color-white
28
+$btn-primary-bgc := $color-orange
29
+$btn-primary-bdc := $color-orange
30
+$btn-primary-active-bgc := $color-dark-orange
31
+$btn-primary-active-bdc := $color-dark-orange
32
+/// light
33
+$btn-light-color := $color-grey
34
+$btn-light-bgc := $color-light-grey-sss
35
+$btn-light-bdc := $color-light-grey-sss
36
+$btn-light-active-bgc := $color-active-grey
37
+$btn-light-active-bdc := $color-active-grey
38
+/// outline
39
+$btn-outline-color := $color-grey
40
+$btn-outline-bgc := transparent
41
+$btn-outline-bdc := $color-grey
42
+$btn-outline-active-bgc := $color-grey-opacity
43
+$btn-outline-active-bdc := $color-grey
44
+/// outline-primary
45
+$btn-outline-primary-color := $color-orange
46
+$btn-outline-primary-bgc := transparent
47
+$btn-outline-primary-bdc := $color-orange
48
+$btn-outline-primary-active-bgc := $color-orange-opacity
49
+$btn-outline-primary-active-bdc := $color-dark-orange
50
+
51
+// toolbar
52
+$toolbar-bgc := $color-light-grey-sss
53
+$toolbar-active-bgc := $color-active-grey
54
+
55
+// checkbox
56
+$checkbox-color := $color-grey
57
+$checkbox-icon-color := $color-light-grey-s
58
+/// checked
59
+$checkbox-checked-icon-color := $color-orange
60
+$checkbox-checked-icon-bgc := $color-white
61
+/// disabled
62
+$checkbox-disabled-icon-color := $color-light-grey-ss
63
+$checkbox-disabled-icon-bgc := $color-light-grey-ss
64
+// checkbox hollow
65
+$checkbox-hollow-checked-icon-color := $color-orange
66
+$checkbox-hollow-disabled-icon-color := $color-light-grey-ss
67
+// checkbox-group
68
+$checkbox-group-bgc := $color-white
69
+$checkbox-group-horizontal-bdc := $color-light-grey-s
70
+
71
+// radio
72
+$radio-group-bgc := $color-white
73
+$radio-group-horizontal-bdc := $color-light-grey-s
74
+$radio-color := $color-grey
75
+$radio-icon-color := $color-light-grey-s
76
+/// selected
77
+$radio-selected-icon-color := $color-white
78
+$radio-selected-icon-bgc := $color-orange
79
+/// disabled
80
+$radio-disabled-icon-bgc := $color-light-grey-ss
81
+// radio hollow
82
+$radio-hollow-selected-icon-color := $color-orange
83
+$radio-hollow-disabled-icon-color := $color-light-grey-ss
84
+
85
+// dialog
86
+$dialog-color := $color-grey
87
+$dialog-bgc := $color-white
88
+$dialog-icon-color := $color-regular-blue
89
+$dialog-icon-bgc := $color-background
90
+$dialog-title-color := $color-dark-grey
91
+$dialog-close-color := $color-light-grey
92
+$dialog-btn-color := $color-light-grey
93
+$dialog-btn-bgc := $color-white
94
+$dialog-btn-active-bgc := $color-light-grey-opacity
95
+$dialog-btn-highlight-color := $color-orange
96
+$dialog-btn-highlight-active-bgc := $color-light-orange-opacity
97
+$dialog-btn-disabled-color := $color-light-grey
98
+$dialog-btn-disabled-active-bgc := transparent
99
+$dialog-btns-split-color := $color-row-line
100
+
101
+// index-list
102
+$index-list-bgc := $color-white
103
+$index-list-title-color := $color-dark-grey
104
+$index-list-anchor-color := $color-light-grey
105
+$index-list-anchor-bgc := #f7f7f7
106
+$index-list-item-color := $color-dark-grey
107
+$index-list-item-active-bgc := $color-light-grey-opacity
108
+$index-list-nav-color := $color-grey
109
+$index-list-nav-active-color := $color-orange
110
+
111
+// loading
112
+
113
+// picker
114
+$picker-bgc := $color-white
115
+$picker-title-color := $color-dark-grey
116
+$picker-subtitle-color := $color-light-grey
117
+$picker-confirm-btn-color := $color-orange
118
+$picker-confirm-btn-active-color := $color-light-orange
119
+$picker-cancel-btn-color := $color-light-grey
120
+$picker-cancel-btn-active-color := $color-light-grey-s
121
+$picker-item-color := $color-dark-grey
122
+
123
+// popup
124
+$popup-mask-bgc := rgb(37, 38, 45)
125
+$popup-mask-opacity := .4
126
+
127
+//scroll
128
+
129
+// slide
130
+$slide-dot-bgc := $color-light-grey-s
131
+$slide-dot-active-bgc := $color-orange
132
+
133
+// time-picker
134
+
135
+// tip
136
+$tip-color := $color-white
137
+$tip-bgc := $color-dark-grey-opacity
138
+
139
+// toast
140
+$toast-color := $color-light-grey-s
141
+$toast-bgc := rgba(37, 38, 45, 0.9)
142
+
143
+// upload
144
+$upload-btn-color := $color-grey
145
+$upload-btn-bgc := $color-white
146
+$upload-btn-active-bgc := $color-light-grey-opacity
147
+$upload-btn-box-shadow := 0 0 6px 2px $color-grey-opacity
148
+$upload-btn-border-color := #e5e5e5
149
+$upload-file-bgc := $color-white
150
+$upload-file-remove-color := rgba(0, 0, 0, .8)
151
+$upload-file-remove-bgc := $color-white
152
+$upload-file-state-bgc := $color-mask-bg
153
+$upload-file-success-color := $color-orange
154
+$upload-file-error-color := #f43530
155
+$upload-file-status-bgc := $color-white
156
+$upload-file-progress-color := $color-white
157
+
158
+// switch
159
+$switch-on-bgc := $color-orange
160
+$switch-off-bgc := $color-white
161
+$switch-off-border-color := #e4e4e4
162
+
163
+// input
164
+$input-color := $color-grey
165
+$input-bgc := $color-white
166
+$input-border-color := $color-row-line
167
+$input-focus-border-color := $color-orange
168
+$input-placeholder-color := $color-light-grey-s
169
+$input-clear-icon-color := $color-light-grey
170
+
171
+//textarea
172
+$textarea-color := $color-grey
173
+$textarea-bgc := $color-white
174
+$textarea-border-color := $color-row-line
175
+$textarea-focus-border-color := $color-orange
176
+$textarea-outline-color := $color-orange
177
+$textarea-placeholder-color := $color-light-grey-s
178
+$textarea-indicator-color := $color-light-grey-s
179
+
180
+// validator
181
+$validator-msg-def-color := #e64340
182
+
183
+// select
184
+$select-color := $color-grey
185
+$select-bgc := $color-white
186
+$select-disabled-color := #b8b8b8
187
+$select-disabled-bgc := $color-light-grey-opacity
188
+$select-border-color := $color-light-grey-s
189
+$select-border-active-color := $color-orange
190
+$select-icon-color := $color-light-grey
191
+$select-placeholder-color := $color-light-grey-s
192
+
193
+// swipe
194
+$swipe-btn-color := $color-white
195
+
196
+// form
197
+$form-color := $color-grey
198
+$form-bgc := $color-white
199
+$form-invalid-color := #e64340
200
+$form-group-legend-color := $color-light-grey
201
+$form-group-legend-bgc := $color-background
202
+$form-label-required-color := #e64340
203
+
204
+// drawer
205
+$drawer-color := $color-dark-grey
206
+$drawer-title-bdc := $color-light-grey-ss
207
+$drawer-title-bgc := $color-white
208
+$drawer-panel-bgc := $color-white
209
+$drawer-item-active-bgc := $color-light-grey-opacity
210
+
211
+// scroll-nav
212
+$scroll-nav-bgc := $color-white
213
+$scroll-nav-color := $color-grey
214
+$scroll-nav-active-color := $color-orange
215
+
216
+// image-preview
217
+$image-preview-counter-color := $color-white
218
+
219
+// tab-bar & tab-panel
220
+$tab-color := $color-grey
221
+$tab-active-color := $color-dark-orange
222
+$tab-slider-bgc := $color-dark-orange

+ 42 - 0
vue.config.js

@@ -0,0 +1,42 @@
1
+module.exports = {
2
+  publicPath: process.env.NODE_ENV === 'production' ? '/xxx/' : '/',
3
+  outputDir: 'dist/xxx',
4
+  productionSourceMap: false,
5
+
6
+  devServer: {
7
+    open: false, // 是否自动弹出浏览器页面
8
+    host: '0.0.0.0',
9
+    port: '8081',
10
+    https: false, // 是否使用https协议
11
+    hotOnly: false, // 是否开启热更新
12
+    proxy: {
13
+      '/service': {
14
+        target: 'http://192.168.3.105', // API服务器的地址
15
+        ws: true, // 代理websockets
16
+        changeOrigin: true, // 虚拟的站点需要更管origin
17
+        pathRewrite: {
18
+          '^/service': ''
19
+        }
20
+      }
21
+    }
22
+  },
23
+
24
+  css: {
25
+    loaderOptions: {
26
+      stylus: {
27
+        'resolve url': true,
28
+        'import': [
29
+          './src/theme'
30
+        ]
31
+      }
32
+    }
33
+  },
34
+
35
+  pluginOptions: {
36
+    'cube-ui': {
37
+      postCompile: true,
38
+      theme: true
39
+    }
40
+  }
41
+}
42
+