newsee-cli 1.0.3 → 1.0.4

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.
Files changed (82) hide show
  1. package/README.en.md +36 -36
  2. package/README.md +36 -36
  3. package/bin/init.js +1 -1
  4. package/micro_11111/.editorconfig +10 -0
  5. package/micro_11111/.eslintignore +9 -0
  6. package/micro_11111/.eslintrc.js +33 -0
  7. package/micro_11111/.postcssrc.js +21 -0
  8. package/micro_11111/.prettierignore +10 -0
  9. package/micro_11111/.prettierrc +12 -0
  10. package/micro_11111/.stylelintignore +8 -0
  11. package/micro_11111/.stylelintrc.json +303 -0
  12. package/micro_11111/README.md +3 -0
  13. package/micro_11111/babel.config.js +34 -0
  14. package/micro_11111/env.config.js +62 -0
  15. package/micro_11111/env.param.config.js +112 -0
  16. package/micro_11111/favicon.ico +0 -0
  17. package/micro_11111/index.html +28 -0
  18. package/micro_11111/jsconfig.json +25 -0
  19. package/micro_11111/package.json +60 -0
  20. package/micro_11111/src/App.vue +32 -0
  21. package/micro_11111/src/Layout/Layout.vue +28 -0
  22. package/micro_11111/src/UI/index.js +1 -0
  23. package/micro_11111/src/assets/iconfont/DIN.Alternate.Bold.ttf +0 -0
  24. package/micro_11111/src/assets/layout/empty.png +0 -0
  25. package/micro_11111/src/assets/layout/prelogin-header.png +0 -0
  26. package/micro_11111/src/assets/trigger/close.png +0 -0
  27. package/micro_11111/src/assets/trigger/company.png +0 -0
  28. package/micro_11111/src/assets/trigger/department.png +0 -0
  29. package/micro_11111/src/assets/trigger/left-arrow.png +0 -0
  30. package/micro_11111/src/assets/trigger/pwd.png +0 -0
  31. package/micro_11111/src/assets/trigger/right-arrow-gray.png +0 -0
  32. package/micro_11111/src/assets/trigger/search-gray.png +0 -0
  33. package/micro_11111/src/assets/trigger/user.png +0 -0
  34. package/micro_11111/src/assets/trigger/weixin-work.png +0 -0
  35. package/micro_11111/src/components/Selector/Selector.vue +254 -0
  36. package/micro_11111/src/components/Selector/components/abyss.vue +308 -0
  37. package/micro_11111/src/components/Selector/components/search.vue +307 -0
  38. package/micro_11111/src/config.js +20 -0
  39. package/micro_11111/src/main.js +14 -0
  40. package/micro_11111/src/mixins/base.js +57 -0
  41. package/micro_11111/src/mixins/extension/app.js +80 -0
  42. package/micro_11111/src/mixins/extension/cryptoPassWord.js +15 -0
  43. package/micro_11111/src/mixins/extension/wx-relative.js +42 -0
  44. package/micro_11111/src/mixins/index.js +5 -0
  45. package/micro_11111/src/router/index.js +12 -0
  46. package/micro_11111/src/router/routes.js +55 -0
  47. package/micro_11111/src/service/common.js +72 -0
  48. package/micro_11111/src/service/preload.js +19 -0
  49. package/micro_11111/src/service/selector.js +114 -0
  50. package/micro_11111/src/store/getters.js +10 -0
  51. package/micro_11111/src/store/index.js +18 -0
  52. package/micro_11111/src/store/modules/Account.js +27 -0
  53. package/micro_11111/src/store/modules/Base.js +38 -0
  54. package/micro_11111/src/style/index.scss +3 -0
  55. package/micro_11111/src/style/mixins/mixins.scss +11 -0
  56. package/micro_11111/src/style/public.scss +32 -0
  57. package/micro_11111/src/style/reset.scss +814 -0
  58. package/micro_11111/src/utils/core/create-basic.js +16 -0
  59. package/micro_11111/src/utils/core/create.js +13 -0
  60. package/micro_11111/src/utils/core/reprefix.js +8 -0
  61. package/micro_11111/src/utils/fetch/fetch.js +66 -0
  62. package/micro_11111/src/utils/fetch/fetchDataType.js +53 -0
  63. package/micro_11111/src/utils/index.js +0 -0
  64. package/micro_11111/src/utils/library/aes.js +834 -0
  65. package/micro_11111/src/utils/library/crypto.js +130 -0
  66. package/micro_11111/src/utils/library/date.js +62 -0
  67. package/micro_11111/src/utils/library/debounce.js +34 -0
  68. package/micro_11111/src/utils/library/event.js +45 -0
  69. package/micro_11111/src/utils/library/image.js +14 -0
  70. package/micro_11111/src/utils/library/stringcover.js +9 -0
  71. package/micro_11111/src/utils/library/urlhandle.js +14 -0
  72. package/micro_11111/src/utils/library/video.js +156 -0
  73. package/micro_11111/src/views/Home/Home.vue +23 -0
  74. package/micro_11111/src/views/Login/Login.vue +65 -0
  75. package/micro_11111/src/views/Login/LoginApp.vue +72 -0
  76. package/micro_11111/src/views/Login/LoginThirdApp.vue +77 -0
  77. package/micro_11111/src/views/Login/LoginThirdParty.vue +59 -0
  78. package/micro_11111/src/views/Prelogin/index.vue +199 -0
  79. package/micro_11111/static/loadBuffer/loadBuffer.js +19 -0
  80. package/micro_11111/static/loadBuffer/loading.gif +0 -0
  81. package/micro_11111/tag.js +19 -0
  82. package/package.json +46 -46
@@ -0,0 +1,308 @@
1
+ <template>
2
+ <popup v-model="selfShow" class="abyss">
3
+ <div class="nav-wrap">
4
+ <nav-bar
5
+ :title="isUser ? '人员选择' : '部门选择'"
6
+ :right-text="!isUser ? '确定' : ''"
7
+ @click-left="closePopup"
8
+ @click-right="onConfirm(nodeList[nodeList.length - 1])"
9
+ >
10
+ <template slot="left">
11
+ <img src="../../../assets/trigger/left-arrow.png" width="13" />
12
+ </template>
13
+ </nav-bar>
14
+ <div class="breadcrumb">
15
+ <div class="container" ref="container">
16
+ <div v-for="(item, index) in nodeList" :key="item.id">
17
+ <div @click="moveTo(index)">{{ item.name }}</div>
18
+ <img src="../../../assets/trigger/right-arrow-gray.png" width="5" />
19
+ </div>
20
+ </div>
21
+ </div>
22
+ </div>
23
+ <div class="dept-wrap">
24
+ <div v-for="item in depts" :key="item.id" @click="getDepts(item)">
25
+ <div class="left">
26
+ <img
27
+ :src="
28
+ require(`../../../assets/trigger/${item.isCompany ? 'company' : 'department'}.png`)
29
+ "
30
+ />{{ item.name }}
31
+ </div>
32
+ <img
33
+ v-if="isUser || item.isHasChild"
34
+ class="right-arrow"
35
+ src="../../../assets/trigger/right-arrow-gray.png"
36
+ />
37
+ </div>
38
+ </div>
39
+ <div class="user-wrap">
40
+ <div v-for="item in users" :key="item.id" @click="onConfirm(item)">
41
+ <div class="left">
42
+ <div class="avatar">{{ item.name.slice(-2) }}</div>
43
+ {{ item.name }}
44
+ </div>
45
+ <div class="right">{{ item.tel }}</div>
46
+ </div>
47
+ </div>
48
+ <div class="baseline">我是有底线的</div>
49
+ </popup>
50
+ </template>
51
+
52
+ <script>
53
+ import { Popup, NavBar } from 'vant';
54
+ import { mapGetters } from 'vuex';
55
+ import {
56
+ getUserDetail,
57
+ getRoot,
58
+ getChildrenDept,
59
+ getChildrenUser,
60
+ } from '../../../service/selector';
61
+
62
+ export default {
63
+ name: 'abyss',
64
+ components: { Popup, NavBar },
65
+ props: {
66
+ show: {
67
+ type: Boolean,
68
+ default: false,
69
+ },
70
+ type: {
71
+ type: String,
72
+ default: 'user',
73
+ },
74
+ isInit: {
75
+ type: Boolean,
76
+ default: true,
77
+ },
78
+ },
79
+ data() {
80
+ return {
81
+ selfShow: false,
82
+ nodeList: [],
83
+ depts: [],
84
+ users: [],
85
+ };
86
+ },
87
+ watch: {
88
+ show(val) {
89
+ this.selfShow = val;
90
+ if (val) {
91
+ if (this.isInit) {
92
+ this.getDepts(null);
93
+ } else {
94
+ getUserDetail({ userId: this.userId }).then(res => {
95
+ if (res) {
96
+ this.getDepts({
97
+ id: res.organizationId,
98
+ name: res.organizationName,
99
+ isHasChild: true,
100
+ });
101
+ }
102
+ });
103
+ }
104
+ } else {
105
+ this.depts = [];
106
+ this.users = [];
107
+ this.nodeList = [];
108
+ }
109
+ },
110
+ nodeList: {
111
+ handler(val) {
112
+ this.$nextTick(() => {
113
+ let childNodes = this.$refs.container.childNodes;
114
+ if (childNodes.length) {
115
+ let actualWidth = 0;
116
+ let devicenWidth = document.documentElement.clientWidth;
117
+ childNodes.forEach(i => {
118
+ actualWidth += i.clientWidth;
119
+ });
120
+ if (actualWidth > devicenWidth)
121
+ this.$refs.container.scrollLeft = actualWidth - devicenWidth;
122
+ }
123
+ });
124
+ },
125
+ deep: true,
126
+ },
127
+ },
128
+ computed: {
129
+ ...mapGetters(['userId']),
130
+ isUser() {
131
+ return this.type === 'user';
132
+ },
133
+ },
134
+ created() {
135
+ this.selfShow = this.show;
136
+ },
137
+ methods: {
138
+ closePopup() {
139
+ this.selfShow = false;
140
+ this.$emit('update:show', false);
141
+ },
142
+ moveTo(index) {
143
+ if (index === this.nodeList.length - 1) return;
144
+ let lastNode = this.nodeList.splice(index, this.nodeList.length - index)[0];
145
+ this.getDepts(this.nodeList.length ? lastNode : null);
146
+ },
147
+ onConfirm(obj) {
148
+ this.closePopup();
149
+ this.$emit('confirm', obj);
150
+ },
151
+ getUsers(id) {
152
+ getChildrenUser({
153
+ organizationId: id,
154
+ }).then(res => {
155
+ this.users = res.map(i => ({
156
+ id: i.userId,
157
+ name: i.userName,
158
+ tel: i.userTelephone,
159
+ superior: i.organizationName,
160
+ }));
161
+ });
162
+ },
163
+ getDepts(obj) {
164
+ if (!this.isUser && obj && !obj.isHasChild) {
165
+ this.onConfirm(obj);
166
+ return;
167
+ }
168
+ this.depts = [];
169
+ this.users = [];
170
+ if (!obj) {
171
+ getRoot({ selectAll: false }).then(res => {
172
+ let root = res.organizationVos[0];
173
+ this.nodeList.push({
174
+ id: root.organizationId,
175
+ name: root.organizationName,
176
+ isCompany: root.organizationType === 1,
177
+ isHasChild: root.isHasChild,
178
+ });
179
+ this.depts = root.childOrganizations.map(i => ({
180
+ id: i.organizationId,
181
+ name: i.organizationName,
182
+ isCompany: i.organizationType === 1,
183
+ isHasChild: i.isHasChild,
184
+ superior: root.organizationName,
185
+ }));
186
+ this.isUser && this.getUsers(root.organizationId);
187
+ });
188
+ } else {
189
+ this.nodeList.push(obj);
190
+ getChildrenDept({ id: obj.id }).then(res => {
191
+ this.depts = res.organizationVos.map(i => ({
192
+ id: i.organizationId,
193
+ name: i.organizationName,
194
+ isCompany: i.organizationType === 1,
195
+ isHasChild: i.isHasChild,
196
+ superior: this.nodeList[this.nodeList.length - 1].name,
197
+ }));
198
+ this.isUser && this.getUsers(obj.id);
199
+ });
200
+ }
201
+ },
202
+ },
203
+ };
204
+ </script>
205
+
206
+ <style lang="scss" scoped>
207
+ .abyss {
208
+ top: 0;
209
+ left: 0;
210
+ width: 100%;
211
+ height: 100%;
212
+ padding-top: 78px;
213
+ box-sizing: border-box;
214
+ transform: none;
215
+ /deep/ .van-nav-bar__right {
216
+ font-weight: bold;
217
+ font-size: 16px;
218
+ }
219
+ .right-arrow {
220
+ width: 10px;
221
+ }
222
+ .nav-wrap {
223
+ position: fixed;
224
+ top: 0;
225
+ z-index: 9;
226
+ width: 100%;
227
+ .breadcrumb {
228
+ display: flex;
229
+ height: 32px;
230
+ background: #f3f3f3;
231
+ .container {
232
+ display: flex;
233
+ overflow-x: auto;
234
+ > div {
235
+ display: flex;
236
+ align-items: center;
237
+ flex: 0 0 auto;
238
+ color: #2f7dcd;
239
+ &:first-child {
240
+ padding-left: 18px;
241
+ }
242
+ &:last-child {
243
+ padding-right: 18px;
244
+ color: #333;
245
+ img {
246
+ display: none;
247
+ }
248
+ }
249
+ img {
250
+ margin-left: 7px;
251
+ margin-right: 7px;
252
+ }
253
+ }
254
+ }
255
+ }
256
+ }
257
+ .dept-wrap,
258
+ .user-wrap {
259
+ > div {
260
+ position: relative;
261
+ display: flex;
262
+ justify-content: space-between;
263
+ align-items: center;
264
+ height: 64px;
265
+ padding: 0 16px;
266
+ border-bottom: 1px solid transparent;
267
+ &:after {
268
+ content: '';
269
+ position: absolute;
270
+ bottom: -1px;
271
+ width: calc(100% - 16px);
272
+ height: 1px;
273
+ background: #f1f1f1;
274
+ }
275
+ .left {
276
+ display: flex;
277
+ align-items: center;
278
+ font-size: 16px;
279
+ color: #333;
280
+ img,
281
+ .avatar {
282
+ width: 40px;
283
+ margin-right: 10px;
284
+ }
285
+ .avatar {
286
+ display: flex;
287
+ justify-content: center;
288
+ align-items: center;
289
+ height: 40px;
290
+ font-size: 11px;
291
+ color: #fff;
292
+ background: #4ccf89;
293
+ border-radius: 50%;
294
+ }
295
+ }
296
+ .right {
297
+ font-size: 14px;
298
+ }
299
+ }
300
+ }
301
+ .baseline {
302
+ margin: 22px 0;
303
+ font-size: 12px;
304
+ text-align: center;
305
+ color: #b8b8b8;
306
+ }
307
+ }
308
+ </style>
@@ -0,0 +1,307 @@
1
+ <template>
2
+ <popup v-model="selfShow" class="search">
3
+ <div class="nav-wrap">
4
+ <nav-bar @click-left="closePopup">
5
+ <template slot="left">
6
+ <img src="../../../assets/trigger/left-arrow.png" width="13" />
7
+ </template>
8
+ <template slot="title">
9
+ <van-search
10
+ v-model="value"
11
+ placeholder="请输入搜索关键词"
12
+ shape="round"
13
+ @input="search"
14
+ ref="searech"
15
+ >
16
+ <template slot="left-icon">
17
+ <img src="../../../assets/trigger/search-gray.png" width="15" />
18
+ </template>
19
+ </van-search>
20
+ </template>
21
+ </nav-bar>
22
+ </div>
23
+ <list
24
+ v-show="value.trim() !== ''"
25
+ class="filtered"
26
+ v-model="loading"
27
+ :finished="finished"
28
+ finished-text="没有更多了"
29
+ @load="onLoad"
30
+ >
31
+ <div v-for="item in filtered" :key="item.id" @click="onConfirm(item)">
32
+ <div v-html="addColorTag(item.name)"></div>
33
+ <span class="plus">{{ item.superior }}</span>
34
+ </div>
35
+ </list>
36
+ <div v-show="value.trim() === '' && history.length" class="history">
37
+ <div class="title">历史记录</div>
38
+ <div v-for="item in history" :key="item.id" @click="onConfirm(item)">
39
+ <p>
40
+ <span class="main">{{ item.name }}</span
41
+ ><span>{{ item.superior }}</span>
42
+ </p>
43
+ <img src="../../../assets/trigger/close.png" width="13" @click.stop="onDelete(item.id)" />
44
+ </div>
45
+ <div class="button" @click="clearHistory">清空历史记录</div>
46
+ </div>
47
+ </popup>
48
+ </template>
49
+
50
+ <script>
51
+ import { Popup, NavBar, Search, List } from 'vant';
52
+ import { addRecord, selectRecord, getUserList, getDeptList } from '../../../service/selector';
53
+
54
+ export default {
55
+ name: 'search',
56
+ components: { Popup, NavBar, 'van-search': Search, List },
57
+ props: {
58
+ show: {
59
+ type: Boolean,
60
+ default: false,
61
+ },
62
+ type: {
63
+ type: String,
64
+ default: 'user',
65
+ },
66
+ detail: Object,
67
+ },
68
+ data() {
69
+ return {
70
+ selfShow: false,
71
+ value: '',
72
+ filtered: [],
73
+ history: [],
74
+
75
+ pageSize: 10,
76
+ pageIndex: 0,
77
+ loading: false,
78
+ finished: false,
79
+
80
+ timeout: null,
81
+ };
82
+ },
83
+ computed: {
84
+ isUser() {
85
+ return this.type === 'user';
86
+ },
87
+ },
88
+ watch: {
89
+ show(val) {
90
+ this.selfShow = val;
91
+ if (val) {
92
+ this.value = '';
93
+ this.getHistory();
94
+ this.$nextTick(() => {
95
+ this.$refs.searech.querySelector('input').focus();
96
+ });
97
+ }
98
+ },
99
+ },
100
+ created() {
101
+ this.selfShow = this.show;
102
+ },
103
+ methods: {
104
+ closePopup() {
105
+ this.selfShow = false;
106
+ this.$emit('update:show', false);
107
+ this.setHistory();
108
+ },
109
+ clearHistory() {
110
+ this.history.splice(0);
111
+ },
112
+ onDelete(id) {
113
+ this.history.splice(
114
+ this.history.findIndex(i => i.id === id),
115
+ 1
116
+ );
117
+ },
118
+ onConfirm(obj) {
119
+ this.$emit('select-history', obj);
120
+ if (this.history.length) {
121
+ let sameIndex = this.history.findIndex(i => i.id === obj.id);
122
+ if (sameIndex > -1) {
123
+ this.history.splice(sameIndex, 1);
124
+ } else {
125
+ this.history.length === 5 && this.history.shift();
126
+ }
127
+ }
128
+ this.history.push(obj);
129
+ this.closePopup();
130
+ },
131
+ setHistory() {
132
+ addRecord(
133
+ { userid: this.detail.userId, enterpriseid: this.detail.enterpriseId },
134
+ { controlId: 'wx-history-' + this.type, content: JSON.stringify(this.history) }
135
+ ).then(res => {
136
+ // console.log(res);
137
+ });
138
+ },
139
+ getHistory() {
140
+ selectRecord(
141
+ { userid: this.detail.userId, enterpriseid: this.detail.enterpriseId },
142
+ { controlId: 'wx-history-' + this.type }
143
+ ).then(res => {
144
+ if (res) {
145
+ this.history = JSON.parse(res.content) || [];
146
+ }
147
+ });
148
+ },
149
+ debounce(fn, wait) {
150
+ if (this.timeout !== null) clearTimeout(this.timeout);
151
+ this.timeout = setTimeout(fn, wait);
152
+ },
153
+ search() {
154
+ this.debounce(() => {
155
+ this.filtered = [];
156
+ if (this.value.trim() === '') return;
157
+ this.pageIndex = 1;
158
+ this.loading = true;
159
+ this.finished = false;
160
+ this.getList();
161
+ }, 300);
162
+ },
163
+ onLoad() {
164
+ this.pageIndex += 1;
165
+ this.getList();
166
+ },
167
+ getList() {
168
+ let formData;
169
+ if (this.isUser) {
170
+ formData = new FormData();
171
+ formData.set('userName', this.value.trim());
172
+ formData.set('pageSize', this.pageSize);
173
+ formData.set('pageIndex', this.pageIndex);
174
+ } else {
175
+ formData = {
176
+ organizationName: this.value.trim(),
177
+ pageSize: this.pageSize,
178
+ pageIndex: this.pageIndex,
179
+ };
180
+ }
181
+ (this.isUser ? getUserList : getDeptList)(formData).then(res => {
182
+ this.loading = false;
183
+ if (res) {
184
+ if (res.isLastPage || !res.list.length) {
185
+ this.finished = true;
186
+ }
187
+ let tmp = res.list.map(i => {
188
+ if (this.isUser) {
189
+ return {
190
+ id: i.userId,
191
+ name: i.userName,
192
+ tel: i.userTelephone,
193
+ superior: i.organizationName,
194
+ };
195
+ }
196
+ return {
197
+ id: i.organizationId,
198
+ name: i.organizationName,
199
+ };
200
+ });
201
+ if (this.filtered.length) {
202
+ this.filtered = this.filtered.concat(tmp);
203
+ } else {
204
+ this.filtered = tmp;
205
+ }
206
+ } else {
207
+ this.finished = true;
208
+ }
209
+ });
210
+ },
211
+ addColorTag(str) {
212
+ return str.replace(
213
+ new RegExp(`(${this.value.trim()})`, 'ig'),
214
+ '<span style="color: #FF6000;">$1</span>'
215
+ );
216
+ },
217
+ },
218
+ };
219
+ </script>
220
+
221
+ <style lang="scss" scoped>
222
+ .search {
223
+ top: 0;
224
+ left: 0;
225
+ width: 100%;
226
+ height: 100%;
227
+ transform: none;
228
+ .nav-wrap {
229
+ position: fixed;
230
+ width: 100%;
231
+ z-index: 9;
232
+ }
233
+ /deep/ .van-nav-bar__title {
234
+ width: calc(100% - 64px);
235
+ max-width: 100%;
236
+ margin: 0 0 0 46px;
237
+ }
238
+ /deep/ .van-search {
239
+ padding: 0;
240
+ font-size: 15px;
241
+ .van-search__content {
242
+ background: #f1f1f1;
243
+ .van-field__left-icon {
244
+ display: flex;
245
+ align-items: center;
246
+ margin-right: 8px;
247
+ }
248
+ }
249
+ }
250
+ .filtered,
251
+ .history {
252
+ margin-top: 56px;
253
+ > div {
254
+ position: relative;
255
+ display: flex;
256
+ justify-content: space-between;
257
+ align-items: center;
258
+ height: 48px;
259
+ padding: 0 16px;
260
+ font-size: 16px;
261
+ color: #666;
262
+ border-bottom: 1px solid transparent;
263
+ &.title {
264
+ height: 38px;
265
+ font-size: 16px;
266
+ color: #333;
267
+ }
268
+ &.button {
269
+ justify-content: center;
270
+ height: 38px;
271
+ font-size: 16px;
272
+ }
273
+ &:not(.button):after {
274
+ content: '';
275
+ position: absolute;
276
+ bottom: -1px;
277
+ width: calc(100% - 16px);
278
+ height: 1px;
279
+ background: #f1f1f1;
280
+ }
281
+ &.title:after {
282
+ background: #d3d7dd;
283
+ }
284
+ p {
285
+ display: flex;
286
+ flex-direction: column;
287
+ justify-content: center;
288
+ span {
289
+ line-height: normal;
290
+ color: #999;
291
+ font-size: 12px;
292
+ &.main {
293
+ font-size: 16px;
294
+ color: #333;
295
+ }
296
+ }
297
+ }
298
+ .plus {
299
+ font-size: 15px;
300
+ }
301
+ }
302
+ }
303
+ .filtered {
304
+ border-top: 1px solid #f1f1f1;
305
+ }
306
+ }
307
+ </style>
@@ -0,0 +1,20 @@
1
+ import config from '../env.param.config';
2
+
3
+ export const namespace = 'ns';
4
+
5
+ export const iniView = '/prelogin';
6
+
7
+ export const env_param_config = () => {
8
+ const env = process.env.NODE_ENV;
9
+
10
+ const k = env === 'production' ? 'prod' : 'dev';
11
+
12
+ return config[k];
13
+ };
14
+
15
+ export const remUnit = env_param_config().remUnit;
16
+
17
+ export const headers = {
18
+ appId: '4ce19ca8fcd150a4',
19
+ appClientType: 'mb',
20
+ };
@@ -0,0 +1,14 @@
1
+ import Vue from 'vue';
2
+ import App from './App.vue';
3
+ import router from './router/index';
4
+ import store from './store/index';
5
+ import './UI/index';
6
+
7
+ Vue.config.productionTip = false;
8
+
9
+ new Vue({
10
+ el: '#app',
11
+ router,
12
+ store,
13
+ render: h => h(App),
14
+ });
@@ -0,0 +1,57 @@
1
+ import { dataURLtoFile } from '@/utils/library/image.js';
2
+
3
+ export default {
4
+ data() {
5
+ return {
6
+ };
7
+ },
8
+ computed: {
9
+ isApp() {
10
+ return localStorage.getItem('source') === 'app';
11
+ },
12
+ isFyapp() {
13
+ return localStorage.getItem('source') === 'fyapp';
14
+ },
15
+ isWX() {
16
+ return localStorage.getItem('source') === 'wx';
17
+ },
18
+ isIOS() {
19
+ let ua = navigator.userAgent;
20
+ return ua.indexOf('iPhone') > -1 || ua.indexOf('iOS') > -1 || ua.indexOf('iPad') > -1;
21
+ },
22
+ isWXWork(){
23
+ // 判断是否为企业微信
24
+ let ua = navigator.userAgent;
25
+ return /wxwork/i.test(ua);
26
+ }
27
+ },
28
+ methods: {
29
+ dataURLtoFile,
30
+ // 回到上一页
31
+ goBack() {
32
+ if (this.$route.query.isShortcut) {
33
+ this.$router.replace({ name: 'home' });
34
+ } else {
35
+ this.$router.go(-1);
36
+ }
37
+ },
38
+ // 错误格式化
39
+ errorFormat(error) {
40
+ // UnknownError: Error preparing Blob/File data to be stored in object store(iOS Safari)
41
+ // QuotaExceededError
42
+ // [object DOMError](iOS Safari)
43
+ const prefix = '未知错误,请联系系统管理员\n';
44
+ if (error.name === 'QuotaExceededError') {
45
+ return '离线数据存储空间不足,建议立即清理离线数据';
46
+ } else if (error.message === 'Error preparing Blob/File data to be stored in object store') {
47
+ return '图片保存失败,请联系系统管理员';
48
+ } else {
49
+ if (error.name || error.message) {
50
+ return prefix + `${error.name}: ${error.message}`;
51
+ } else {
52
+ return prefix + error;
53
+ }
54
+ }
55
+ },
56
+ },
57
+ };