@focus-teach/ui 1.0.27 → 1.0.28

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.
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@focus-teach/ui",
3
- "packageName": "ui",
3
+ "packageName": "@focus-teach/ui",
4
4
  "buildName": "@focus-teach/ui",
5
- "version": "1.0.27",
5
+ "version": "1.0.28",
6
6
  "private": false,
7
7
  "main": "lib/ui.umd.min.js",
8
8
  "scripts": {
@@ -14,9 +14,14 @@
14
14
  "lib": "vue-cli-service build --target lib packages/index.js"
15
15
  },
16
16
  "dependencies": {
17
+ "@babel/core": "^7.0.0",
18
+ "@babel/plugin-proposal-optional-chaining": "^7.0.0",
19
+ "@babel/preset-env": "^7.0.0",
17
20
  "axios": "^0.21.1",
21
+ "babel-loader": "^8.0.0",
18
22
  "core-js": "^3.6.5",
19
23
  "element-ui": "^2.15.1",
24
+ "lodash": "^4.17.21",
20
25
  "qs": "^6.10.1",
21
26
  "sass": "^1.26.5",
22
27
  "sass-loader": "^10.1.1",
package/utils/common.js CHANGED
@@ -7,7 +7,7 @@ function getFileTypeSuffix(fileName) {
7
7
  return "";
8
8
  }
9
9
  }
10
- export function getIcon(fileName,host) {
10
+ export function getIcon(fileName, host) {
11
11
  var suffix = getFileTypeSuffix(fileName);
12
12
  switch (suffix) {
13
13
  case CONSTANTS.PPT:
@@ -87,29 +87,29 @@ export function decodeEntities(value) {
87
87
 
88
88
  export function formatDate(date, fmt) {
89
89
  if (/(y+)/.test(fmt)) {
90
- fmt = fmt.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length))
90
+ fmt = fmt.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length))
91
91
  }
92
92
  let o = {
93
- 'M+': date.getMonth() + 1,
94
- 'd+': date.getDate(),
95
- 'h+': date.getHours(),
96
- 'm+': date.getMinutes(),
97
- 's+': date.getSeconds()
93
+ 'M+': date.getMonth() + 1,
94
+ 'd+': date.getDate(),
95
+ 'h+': date.getHours(),
96
+ 'm+': date.getMinutes(),
97
+ 's+': date.getSeconds()
98
98
  }
99
99
  for (let k in o) {
100
- if (new RegExp(`(${k})`).test(fmt)) {
101
- let str = o[k] + ''
102
- fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? str : padLeftZero(str))
103
- }
100
+ if (new RegExp(`(${k})`).test(fmt)) {
101
+ let str = o[k] + ''
102
+ fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? str : padLeftZero(str))
103
+ }
104
104
  }
105
105
  return fmt
106
- }
107
- function padLeftZero(str) {
106
+ }
107
+ function padLeftZero(str) {
108
108
  return ('00' + str).substr(str.length)
109
- }
109
+ }
110
110
 
111
- export function getFirstNumber(itemNumber,type) {
112
- itemNumber = itemNumber|| '';
111
+ export function getFirstNumber(itemNumber, type) {
112
+ // itemNumber = typeof itemNumber == 'number' ? itemNumber.toString() : '';
113
113
  if (type == 'exam') {
114
114
  let match = itemNumber.match(/^\D*(\d+)-\d+$/);
115
115
  let itemNumberStr = match ? match[1] : itemNumber;
@@ -122,10 +122,37 @@ export function formatDate(date, fmt) {
122
122
  let match = itemNumber.match(/(\d+)(?:-(\d+))?/);
123
123
  let num1 = match[1];
124
124
  let num2 = match[2];
125
- console.log(resultmatchchineseNum,num1,num2)
126
- return resultmatchchineseNum?num1==num2?resultmatchchineseNum+num1:itemNumber:num1==num2?num1:itemNumber
125
+ console.log(resultmatchchineseNum, num1, num2)
126
+ return resultmatchchineseNum ? num1 == num2 ? resultmatchchineseNum + num1 : itemNumber : num1 == num2 ? num1 : itemNumber
127
127
  }
128
128
  }
129
+
130
+ export function toUpper(lower) {//小写数字转大写数字
131
+ // if (typeof lower !== 'number') return lower
132
+ // let upper = []
133
+ // let upperMap = ['零', '一', '二', '三', '四', '五', '六', '七', '八', '九', '十']
134
+ // let unit = ['十', '百', '千', '万']
135
+ // let charList = String(lower).split('');
136
+ // charList?.map(item => {
137
+ // upper.push(upperMap[item])
138
+ // })
139
+ // if (charList.length === 2) {//对十位数字处理
140
+ // if (lower == 10) return '十'
141
+ // if (lower < 20) {
142
+ // upper[0] = unit[0]
143
+ // } else if (lower < 100) {//添加十
144
+ // upper.splice(1, 0, unit[0])
145
+ // }
146
+ // if (charList[1] == 0) upper.splice(2)
147
+ // }
148
+ // if (charList.length === 3) {//对百位数字处理
149
+ // upper.splice(1, 0, unit[1])
150
+ // if (charList[1] == 0 && charList[2] == 0) upper.splice(2)
151
+ // if (charList[1] != 0) upper.splice(3, 0, unit[0])
152
+ // if (upper[upper.length - 1] == '零') upper.pop()
153
+ // }
154
+ // return upper.join('')
155
+ }
129
156
  //获取知识点叶子节点
130
157
  export function getKlLeafNode(tree){
131
158
  var result = [];
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @file 事件总线
3
+ * @author focusteach(focusteach@focusteach.com)
4
+ */
5
+
6
+ import Vue from 'vue';
7
+
8
+ // 全局事件总线
9
+ export default new Vue();
Binary file
Binary file
Binary file
@@ -1 +0,0 @@
1
- <svg id="图层_4" data-name="图层 4" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><defs><style>.cls-1{fill:#89ade2;}.cls-2{fill:none;}.cls-3{fill:#c4d6f1;}.cls-4{fill:#fff;}</style></defs><title>icloud_txt</title><path class="cls-1" d="M16,1H5A2,2,0,0,0,3,3V21a2,2,0,0,0,2,2H19a2,2,0,0,0,2-2V6Z"/><rect class="cls-2" width="24" height="24"/><path class="cls-3" d="M16,1V4a2,2,0,0,0,2,2h3Z"/><path class="cls-4" d="M7,9h5a1,1,0,0,0,0-2H7A1,1,0,0,0,7,9Z"/><path class="cls-4" d="M7,13H17a1,1,0,0,0,0-2H7a1,1,0,0,0,0,2Z"/><path class="cls-4" d="M17,15H7a1,1,0,0,0,0,2H17a1,1,0,0,0,0-2Z"/></svg>