lw-cdp-ui 1.0.8 → 1.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -46,7 +46,7 @@
46
46
  </template>
47
47
 
48
48
  <script>
49
- import logo from 'https://saas.lianwei.com.cn/static/images/logo.jpg';
49
+ import logo from '/images/logo.jpg';
50
50
  export default {
51
51
  name: 'layoutAside',
52
52
  props: {
@@ -59,7 +59,7 @@ export default {
59
59
  };
60
60
  },
61
61
  mounted() {
62
- let { grantedApplications } = this.$TOOL.data.get('userAuthInfo');
62
+ let { grantedApplications } = this.$tool.data.get('userAuthInfo');
63
63
  this.grantedApplications = grantedApplications
64
64
  document.addEventListener('click', this.handleDocumentClick);
65
65
  },
@@ -29,20 +29,20 @@ export default {
29
29
  async changeBusinessUnit(command) {
30
30
  this.buName = command
31
31
  let item = this.buList.find(item => item.code === command)
32
- this.$TOOL.data.set('buCode', command)
33
- this.$TOOL.data.set('tenantId', item.tenantId)
32
+ this.$tool.data.set('buCode', command)
33
+ this.$tool.data.set('tenantId', item.tenantId)
34
34
  // 检验是否初始化
35
- let initialized = await this.$API.auth.initialized.get()
36
- this.$TOOL.data.set('zoneInitialized', initialized)
35
+ let initialized = await this.$api.auth.initialized.get()
36
+ this.$tool.data.set('zoneInitialized', initialized)
37
37
  if (!initialized) {
38
38
  this.$router.push('/initialization');
39
39
  }
40
40
  }
41
41
  },
42
42
  created() {
43
- this.buList = this.$TOOL.data.get('buList')
43
+ this.buList = this.$tool.data.get('buList')
44
44
 
45
- let buCode = this.$TOOL.data.get('buCode')
45
+ let buCode = this.$tool.data.get('buCode')
46
46
  let item = this.buList.find(item => item.code === buCode)
47
47
  this.buName = item ? item.name : ''
48
48
  this.changeBusinessUnit(buCode)
@@ -32,7 +32,7 @@ export default {
32
32
  data () {
33
33
  return {
34
34
  config: {
35
- lang: this.$TOOL.data.get("APP_LANG") || this.$CONFIG.LANG,
35
+ lang: this.$tool.data.get("APP_LANG") || this.$config.LANG,
36
36
  },
37
37
  lang: [
38
38
  {
@@ -50,7 +50,7 @@ export default {
50
50
  "config.lang"(val) {
51
51
  this.$i18n.locale = val;
52
52
  this.$i18n.fallbackLocale = val;
53
- this.$TOOL.data.set("APP_LANG", val);
53
+ this.$tool.data.set("APP_LANG", val);
54
54
  },
55
55
  },
56
56
  methods: {
@@ -43,9 +43,9 @@
43
43
  layout: this.$store.state.global.layout,
44
44
  menuIsCollapse: this.$store.state.global.menuIsCollapse,
45
45
  layoutTags: this.$store.state.global.layoutTags,
46
- dark: this.$TOOL.data.get('APP_THEME'),
46
+ dark: this.$tool.data.get('APP_THEME'),
47
47
  colorList: ['#409EFF', '#009688', '#536dfe', '#ff5c93', '#c62f2f', '#fd726d'],
48
- colorPrimary: this.$TOOL.data.get('APP_COLOR') || this.$CONFIG.COLOR || '#409EFF'
48
+ colorPrimary: this.$tool.data.get('APP_COLOR') || this.$config.COLOR || '#409EFF'
49
49
  }
50
50
  },
51
51
  watch: {
@@ -60,7 +60,7 @@
60
60
  },
61
61
  dark(val){
62
62
  document.body.setAttribute('data-theme', val)
63
- this.$TOOL.data.set("APP_THEME", val);
63
+ this.$tool.data.set("APP_THEME", val);
64
64
  },
65
65
  colorPrimary(val){
66
66
  document.documentElement.style.setProperty('--el-color-primary', val);
@@ -70,7 +70,7 @@
70
70
  for (let i = 1; i <= 9; i++) {
71
71
  document.documentElement.style.setProperty(`--el-color-primary-dark-${i}`, colorTool.darken(val,i/10));
72
72
  }
73
- this.$TOOL.data.set("APP_COLOR", val);
73
+ this.$tool.data.set("APP_COLOR", val);
74
74
  }
75
75
  }
76
76
  }
@@ -4,7 +4,7 @@
4
4
  <el-drawer ref="mobileNavBox" title="移动端菜单" :size="240" v-model="nav" direction="ltr" :with-header="false" destroy-on-close>
5
5
  <el-container class="mobile-nav">
6
6
  <el-header>
7
- <div class="logo-bar"><img class="logo" src="https://saas.lianwei.com.cn/static/images/logo.jpg"><span>{{ $CONFIG.APP_NAME }}</span></div>
7
+ <div class="logo-bar"><img class="logo" src="/images/logo.jpg"><span>{{ $config.APP_NAME }}</span></div>
8
8
  </el-header>
9
9
  <el-main>
10
10
  <el-scrollbar>
@@ -102,7 +102,7 @@ export default {
102
102
  // 初始化
103
103
  init() {
104
104
  var menu = this.$router.sc_getMenu()
105
- var dashboardRoute = this.treeFind(menu, node => node.path == this.$CONFIG.DASHBOARD_URL)
105
+ var dashboardRoute = this.treeFind(menu, node => node.path == this.$config.DASHBOARD_URL)
106
106
  if (dashboardRoute) {
107
107
  dashboardRoute.fullPath = dashboardRoute.path
108
108
  this.addViewTags(dashboardRoute)
@@ -1,14 +1,5 @@
1
1
  <template>
2
2
  <div class="user-bar">
3
- <!-- <div class="panel-item hidden-sm-and-down"
4
- @click="search">
5
- <el-icon><el-icon-search /></el-icon>
6
- </div>
7
- <div class="screen panel-item hidden-sm-and-down"
8
- @click="screen">
9
- <el-icon><el-icon-full-screen /></el-icon>
10
- </div> -->
11
-
12
3
  <bu />
13
4
 
14
5
  <el-dropdown class="user panel-item"
@@ -41,35 +32,14 @@
41
32
  </el-dropdown>
42
33
  </div>
43
34
 
44
- <el-dialog v-model="searchVisible"
45
- :width="700"
46
- title="搜索"
47
- custom-class="drawerBG"
48
- center
49
- destroy-on-close>
50
- <search @success="searchVisible=false"></search>
51
- </el-dialog>
52
-
53
- <el-drawer v-model="tasksVisible"
54
- :size="450"
55
- title="任务中心"
56
- custom-class="drawerBG"
57
- destroy-on-close>
58
- <tasks></tasks>
59
- </el-drawer>
60
-
61
35
  </template>
62
36
 
63
37
  <script>
64
- import search from './search.vue'
65
- import tasks from './tasks.vue'
66
38
  import bu from './bu.vue'
67
39
 
68
40
  export default {
69
41
  components: {
70
- search,
71
- bu,
72
- tasks
42
+ bu
73
43
  },
74
44
  data() {
75
45
  return {
@@ -82,7 +52,7 @@ export default {
82
52
  }
83
53
  },
84
54
  created() {
85
- this.$store.state.user = this.$TOOL.data.get('userAuthInfo')
55
+ this.$store.state.user = this.$tool.data.get('userAuthInfo')
86
56
  },
87
57
  methods: {
88
58
  //个人信息
@@ -98,7 +68,7 @@ export default {
98
68
  type: 'info',
99
69
  }).then(() => {
100
70
  const loading = this.$loading()
101
- this.$TOOL.data.clear()
71
+ this.$tool.data.clear()
102
72
  this.$router.replace({ path: '/login' })
103
73
  setTimeout(() => {
104
74
  loading.close()
@@ -123,7 +93,7 @@ export default {
123
93
  //全屏
124
94
  screen() {
125
95
  var element = document.documentElement;
126
- this.$TOOL.screen(element)
96
+ this.$tool.screen(element)
127
97
  },
128
98
  //显示短消息
129
99
  showMsg() {
@@ -5,8 +5,8 @@
5
5
  <div class="adminui-header-left">
6
6
  <div class="logo-bar">
7
7
  <img class="logo"
8
- src="https://saas.lianwei.com.cn/static/images/logo.jpg">
9
- <span>{{ $CONFIG.APP_NAME }}</span>
8
+ src="/images/logo.jpg">
9
+ <span>{{ $config.APP_NAME }}</span>
10
10
  </div>
11
11
  <ul v-if="!ismobile"
12
12
  class="nav">
@@ -37,7 +37,7 @@
37
37
  <el-menu :default-active="active"
38
38
  router
39
39
  :collapse="menuIsCollapse"
40
- :unique-opened="$CONFIG.MENU_UNIQUE_OPENED">
40
+ :unique-opened="$config.MENU_UNIQUE_OPENED">
41
41
  <NavMenu :navMenus="nextMenu"></NavMenu>
42
42
  </el-menu>
43
43
  </el-scrollbar>
@@ -83,12 +83,12 @@
83
83
 
84
84
  <el-scrollbar>
85
85
  <div class="title-name">
86
- {{ menuIsCollapse ? $CONFIG.APP_NAME.charAt(0) : $CONFIG.APP_NAME }}
86
+ {{ menuIsCollapse ? $config.APP_NAME.charAt(0) : $config.APP_NAME }}
87
87
  </div>
88
88
  <el-menu :default-active="active"
89
89
  router
90
90
  :collapse="menuIsCollapse"
91
- :unique-opened="$CONFIG.MENU_UNIQUE_OPENED">
91
+ :unique-opened="$config.MENU_UNIQUE_OPENED">
92
92
  <NavMenu :navMenus="menu"></NavMenu>
93
93
  </el-menu>
94
94
  </el-scrollbar>
@@ -134,8 +134,8 @@
134
134
  <div class="adminui-header-left">
135
135
  <div class="logo-bar">
136
136
  <img class="logo"
137
- src="https://saas.lianwei.com.cn/static/images/logo.jpg">
138
- <span>{{ $CONFIG.APP_NAME }}</span>
137
+ src="/images/logo.jpg">
138
+ <span>{{ $config.APP_NAME }}</span>
139
139
  </div>
140
140
  </div>
141
141
  <div class="adminui-header-right">
@@ -210,7 +210,7 @@
210
210
  <el-menu :default-active="active"
211
211
  router
212
212
  :collapse="menuIsCollapse"
213
- :unique-opened="$CONFIG.MENU_UNIQUE_OPENED">
213
+ :unique-opened="$config.MENU_UNIQUE_OPENED">
214
214
  <NavMenu :navMenus="nextMenu"></NavMenu>
215
215
  </el-menu>
216
216
  </el-scrollbar>
@@ -2,13 +2,13 @@
2
2
  <div class="login_bg">
3
3
  <div class="video-container">
4
4
  <img class="mask"
5
- src="https://saas.lianwei.com.cn/static/images/video-poster.png"
5
+ src="/images/video-poster.png"
6
6
  alt="videoMask" />
7
7
  <video autoplay
8
8
  loop
9
9
  class="video"
10
10
  muted>
11
- <source src="https://saas.lianwei.com.cn/static/images/video-bg.mp4"
11
+ <source src="/images/video-bg.mp4"
12
12
  type="video/mp4" />
13
13
  </video>
14
14
  </div>
@@ -19,8 +19,8 @@
19
19
  <div class="login-form">
20
20
  <div class="login-header">
21
21
  <div class="logo">
22
- <img :alt="$CONFIG.APP_NAME"
23
- src="https://saas.lianwei.com.cn/static/images/logo2.png">
22
+ <img :alt="$config.APP_NAME"
23
+ src="/images/logo2.png">
24
24
  </div>
25
25
  </div>
26
26
  <el-form ref="loginForm"
@@ -79,6 +79,13 @@ import JSEncrypt from 'jsencrypt/bin/jsencrypt.min'
79
79
  import Lang from '../lwLayout/components/lang.vue'
80
80
  export default {
81
81
  name: 'lwLogin',
82
+ props: {
83
+ // 是否要校验初始化
84
+ isInitialized: {
85
+ type: Boolean,
86
+ default: true
87
+ },
88
+ },
82
89
  components: {
83
90
  Lang,
84
91
  },
@@ -112,11 +119,11 @@ export default {
112
119
  },
113
120
 
114
121
  created: function () {
115
- this.$TOOL.data.remove("TOKEN");
116
- this.$TOOL.data.remove("USER_INFO");
117
- this.$TOOL.data.remove("MENU");
118
- this.$TOOL.data.remove("PERMISSIONS");
119
- this.$TOOL.data.remove("grid");
122
+ this.$tool.data.remove("TOKEN");
123
+ this.$tool.data.remove("USER_INFO");
124
+ this.$tool.data.remove("MENU");
125
+ this.$tool.data.remove("PERMISSIONS");
126
+ this.$tool.data.remove("grid");
120
127
  this.$store.commit("clearViewTags");
121
128
  this.$store.commit("clearKeepLive");
122
129
  this.$store.commit("clearIframeList");
@@ -137,26 +144,26 @@ export default {
137
144
  }
138
145
 
139
146
  this.islogin = true;
140
- const publicKey = await this.$API.auth.key.get()
147
+ const publicKey = await this.$api.auth.key()
141
148
  let data = {
142
149
  username: this.encrypt(publicKey, this.ruleForm.user),
143
150
  password: this.encrypt(publicKey, this.ruleForm.password),
144
151
  };
145
152
  //获取token
146
- let token = await this.$API.auth.token.post(data);
147
- this.$TOOL.data.set("TOKEN", token);
153
+ let token = await this.$api.auth.token.post(data);
154
+ this.$tool.data.set("TOKEN", token);
148
155
 
149
156
 
150
157
  // 获取所有bu
151
- let bu = await this.$API.auth.bu.get()
152
- this.$TOOL.data.set('buList', bu)
153
- this.$TOOL.data.set('buCode', bu[0].code)
158
+ let bu = await this.$api.auth.bu()
159
+ this.$tool.data.set('buList', bu)
160
+ this.$tool.data.set('buCode', bu[0].code)
154
161
 
155
162
  // 获取用户信息
156
- let user = await this.$API.auth.user.get()
157
- this.$TOOL.data.set('tenantId', user.userAuthInfo.tenantId)
158
- this.$TOOL.data.set('userAuthInfo', user.userAuthInfo)
159
- this.$TOOL.data.set('MenuPath', user.userAuthInfo.grantedApplications)
163
+ let user = await this.$api.auth.user()
164
+ this.$tool.data.set('tenantId', user.userAuthInfo.tenantId)
165
+ this.$tool.data.set('userAuthInfo', user.userAuthInfo)
166
+ this.$tool.data.set('MenuPath', user.userAuthInfo.grantedApplications)
160
167
  this.$store.state.user = user.userAuthInfo
161
168
 
162
169
  // 获取合并菜单信息 isCombined 这参数后期要加是否要合并菜单展示 现在默认tue
@@ -184,24 +191,30 @@ export default {
184
191
  * ]
185
192
  */
186
193
  if (user.isCombined || true) {
187
- let menu = await this.$API.mock.menu.get();
188
- this.$TOOL.data.set("MENUCOMBINED", menu);
194
+ let menu = await this.$api.mock.menu();
195
+ this.$tool.data.set("MENUCOMBINED", menu);
189
196
  // 注入 用于判断子项目 是否扁平化
190
- this.$TOOL.data.set("MENUCOMBINEDNMAE", this.$CONFIG.APP_NAME);
197
+ this.$tool.data.set("MENUCOMBINEDNMAE", this.$config.APP_NAME);
191
198
  } else {
192
- this.$TOOL.data.remove("MENUCOMBINED");
193
- this.$TOOL.data.remove("MENUCOMBINEDNMAE");
199
+ this.$tool.data.remove("MENUCOMBINED");
200
+ this.$tool.data.remove("MENUCOMBINEDNMAE");
194
201
  }
195
202
 
196
203
  // 检验是否初始化
197
- let initialized = await this.$API.auth.initialized.get()
198
- this.$TOOL.data.set('zoneInitialized', initialized)
199
- if (initialized) {
200
- this.$router.push('/');
204
+
205
+ if (this.isInitialized) {
206
+ let initialized = await this.$api.auth.initialized()
207
+ this.$tool.data.set('zoneInitialized', initialized)
208
+ if (initialized) {
209
+ this.$router.push('/');
210
+ } else {
211
+ this.$router.push('/initialization');
212
+ }
201
213
  } else {
202
- this.$router.push('/initialization');
214
+ this.$router.push('/');
203
215
  }
204
216
 
217
+
205
218
  this.$message.success("登录成功");
206
219
  this.islogin = false;
207
220
  },
@@ -326,7 +326,6 @@ export default {
326
326
 
327
327
  #search-wrap {
328
328
  width: 100%;
329
- margin: 10px auto 10px auto;
330
329
  background: var(--color-bg-2);
331
330
  // position: relative;
332
331
  overflow: hidden;
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file