xs-common-plugins 1.2.0 → 1.2.3

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 (58) hide show
  1. package/README.md +298 -290
  2. package/common.js +110 -110
  3. package/index.js +1 -1
  4. package/package.json +16 -16
  5. package/src/common/common.js +548 -548
  6. package/src/components/CheckBox_Cmp/index.vue +62 -62
  7. package/src/components/FormItem/index.vue +92 -92
  8. package/src/components/ReportCmp/index.vue +76 -76
  9. package/src/components/Search/index.scss +219 -219
  10. package/src/components/Search/index.vue +410 -406
  11. package/src/components/Search/product_option/index.scss +1 -1
  12. package/src/components/Search/product_option/index.vue +1 -8
  13. package/src/components/Search/product_option/methods.js +16 -4
  14. package/src/components/Search_filter/index.scss +104 -104
  15. package/src/components/TableItem/TableItem.vue +55 -55
  16. package/src/components/TextOVer/index.vue +55 -55
  17. package/src/components/UploadImg/index.vue +177 -177
  18. package/src/components/im/index.vue +155 -155
  19. package/src/components/im/pages/chatList/index.vue +45 -45
  20. package/src/components/im/pages/chatRoom/index.vue +159 -159
  21. package/src/components/xsSelect/index.vue +125 -125
  22. package/src/mixin/keepAlive.js +52 -0
  23. package/src/plugins/im/components/chat/index.scss +163 -163
  24. package/src/plugins/im/components/chat/index.vue +144 -144
  25. package/src/plugins/im/components/chat/methods.js +149 -149
  26. package/src/plugins/im/components/msg-image/index.vue +40 -40
  27. package/src/plugins/im/components/send-msg/index.scss +164 -164
  28. package/src/plugins/im/components/send-msg/index.vue +107 -107
  29. package/src/plugins/im/components/send-msg/methods.js +125 -125
  30. package/src/plugins/im/components/template-message/index.vue +76 -76
  31. package/src/plugins/im/components/without.vue +19 -19
  32. package/src/plugins/im/index.js +31 -31
  33. package/src/plugins/im/utils/services.js +625 -625
  34. package/src/plugins/index.js +60 -60
  35. package/src/plugins/row-col-cmp/index.js +20 -20
  36. package/src/router/permission.js +126 -126
  37. package/src/store/modules/dic.js +74 -74
  38. package/src/store/modules/oss.js +40 -40
  39. package/src/styles/index.scss +91 -91
  40. package/src/styles/table.scss +90 -90
  41. package/src/utils/api.js +54 -54
  42. package/src/utils/auth.js +38 -38
  43. package/src/utils/concat_batch_btns.js +88 -88
  44. package/src/utils/enum.js +150 -150
  45. package/src/utils/filter.js +5 -5
  46. package/src/utils/filterRules.js +55 -55
  47. package/src/utils/getMenu.js +82 -82
  48. package/src/utils/global_directive.js +10 -0
  49. package/src/utils/ossService.js +55 -55
  50. package/src/utils/prototype.js +46 -46
  51. package/src/utils/search.js +33 -33
  52. package/src/utils/signalR.js +24 -24
  53. package/src/views/callback/index.vue +35 -35
  54. package/src/views/home/index.vue +25 -25
  55. package/src/views/layout/components/AppMain.vue +21 -5
  56. package/src/views/layout/components/Navbar.vue +20 -13
  57. package/src/views/layout/components/TagsView/index.vue +130 -91
  58. package/src/views/slienceAuth/index.vue +42 -42
package/common.js CHANGED
@@ -1,110 +1,110 @@
1
- /*
2
- * @Author: 祝玲云
3
- * @Date: 2021-05-17 16:02:43
4
- * @LastEditTime: 2021-05-27 18:25:24
5
- * @LastEditors: 自动生成公用部分代码
6
- * @Description: \xs-plugins\src\lib\api.js
7
- */
8
-
9
- const fs = require('fs')
10
- const path = require('path')
11
- let outPath = path.join(__dirname, 'src')
12
-
13
- class commonPlugins {
14
- constructor(options) {
15
- this.options = options
16
- }
17
- apply() {
18
- this.writeFile(outPath)
19
- }
20
- writeFile(inputPath, callBack) {
21
- let files = fs.readdirSync(inputPath)
22
- files.forEach(async file => {
23
- let filePath = this.formatPath(path.join(inputPath, file))
24
- let fileState = fs.statSync(filePath)
25
- let url = this.formatPath(path.join(this.options.rootPath, filePath.substr(filePath.indexOf('\/src\/'))))
26
- if (fileState.isDirectory()) { // 如果是目录 递归
27
- await this.dirExists(url)
28
- this.writeFile(filePath)
29
- } else {
30
- let str = /\.(?:scss|css|vue|js|json|md)$/
31
- if(!str.test(filePath)) { return }
32
- const data = fs.readFileSync(filePath, 'utf-8');
33
- fs.writeFile(url, data, err => {
34
- if(err) return console.log(err);
35
- })
36
- }
37
- })
38
- callBack && callBack.call();
39
- }
40
-
41
- /**
42
- * 路径是否存在,不存在则创建
43
- * @param {string} dir 路径
44
- */
45
- async dirExists(dir) {
46
- let isExists = await this.getStat(dir);
47
- //如果该路径且不是文件,返回true
48
- if (isExists && isExists.isDirectory()) {
49
- return true;
50
- } else if (isExists) { //如果该路径存在但是文件,返回false
51
- return false;
52
- }
53
- //如果该路径不存在
54
- let tempDir = path.parse(dir).dir; //拿到上级路径
55
- //递归判断,如果上级目录也不存在,则会代码会在此处继续循环执行,直到目录存在
56
- let status = await this.dirExists(tempDir);
57
- let mkdirStatus;
58
- if (status) {
59
- mkdirStatus = await this.mkdir(dir);
60
- }
61
- return mkdirStatus;
62
- }
63
-
64
- /**
65
- * 读取路径信息
66
- * @param {string} path 路径
67
- */
68
- getStat(path) {
69
- return new Promise((resolve, reject) => {
70
- fs.stat(path, (err, stats) => {
71
- if (err) {
72
- resolve(false);
73
- } else {
74
- resolve(stats);
75
- }
76
- })
77
- })
78
- }
79
- /**
80
- * 创建路径
81
- * @param {string} dir 路径
82
- */
83
- mkdir(dir) {
84
- return new Promise((resolve, reject) => {
85
- fs.mkdir(dir, err => {
86
- if (err) {
87
- resolve(false);
88
- } else {
89
- resolve(true);
90
- }
91
- })
92
- })
93
- }
94
- /**
95
- * 路径统一
96
- */
97
- formatPath(p) {
98
- if (p && typeof p === 'string') {
99
- const sep = path.sep;
100
- if (sep === '/')
101
- return p
102
- else {
103
- return p.replace(/\\/g, '/')
104
- }
105
- }
106
- return p
107
- }
108
- }
109
-
110
- module.exports = commonPlugins
1
+ /*
2
+ * @Author: 祝玲云
3
+ * @Date: 2021-05-17 16:02:43
4
+ * @LastEditTime: 2021-05-27 18:25:24
5
+ * @LastEditors: 自动生成公用部分代码
6
+ * @Description: \xs-plugins\src\lib\api.js
7
+ */
8
+
9
+ const fs = require('fs')
10
+ const path = require('path')
11
+ let outPath = path.join(__dirname, 'src')
12
+
13
+ class commonPlugins {
14
+ constructor(options) {
15
+ this.options = options
16
+ }
17
+ apply() {
18
+ this.writeFile(outPath)
19
+ }
20
+ writeFile(inputPath, callBack) {
21
+ let files = fs.readdirSync(inputPath)
22
+ files.forEach(async file => {
23
+ let filePath = this.formatPath(path.join(inputPath, file))
24
+ let fileState = fs.statSync(filePath)
25
+ let url = this.formatPath(path.join(this.options.rootPath, filePath.substr(filePath.indexOf('\/src\/'))))
26
+ if (fileState.isDirectory()) { // 如果是目录 递归
27
+ await this.dirExists(url)
28
+ this.writeFile(filePath)
29
+ } else {
30
+ let str = /\.(?:scss|css|vue|js|json|md)$/
31
+ if(!str.test(filePath)) { return }
32
+ const data = fs.readFileSync(filePath, 'utf-8');
33
+ fs.writeFile(url, data, err => {
34
+ if(err) return console.log(err);
35
+ })
36
+ }
37
+ })
38
+ callBack && callBack.call();
39
+ }
40
+
41
+ /**
42
+ * 路径是否存在,不存在则创建
43
+ * @param {string} dir 路径
44
+ */
45
+ async dirExists(dir) {
46
+ let isExists = await this.getStat(dir);
47
+ //如果该路径且不是文件,返回true
48
+ if (isExists && isExists.isDirectory()) {
49
+ return true;
50
+ } else if (isExists) { //如果该路径存在但是文件,返回false
51
+ return false;
52
+ }
53
+ //如果该路径不存在
54
+ let tempDir = path.parse(dir).dir; //拿到上级路径
55
+ //递归判断,如果上级目录也不存在,则会代码会在此处继续循环执行,直到目录存在
56
+ let status = await this.dirExists(tempDir);
57
+ let mkdirStatus;
58
+ if (status) {
59
+ mkdirStatus = await this.mkdir(dir);
60
+ }
61
+ return mkdirStatus;
62
+ }
63
+
64
+ /**
65
+ * 读取路径信息
66
+ * @param {string} path 路径
67
+ */
68
+ getStat(path) {
69
+ return new Promise((resolve, reject) => {
70
+ fs.stat(path, (err, stats) => {
71
+ if (err) {
72
+ resolve(false);
73
+ } else {
74
+ resolve(stats);
75
+ }
76
+ })
77
+ })
78
+ }
79
+ /**
80
+ * 创建路径
81
+ * @param {string} dir 路径
82
+ */
83
+ mkdir(dir) {
84
+ return new Promise((resolve, reject) => {
85
+ fs.mkdir(dir, err => {
86
+ if (err) {
87
+ resolve(false);
88
+ } else {
89
+ resolve(true);
90
+ }
91
+ })
92
+ })
93
+ }
94
+ /**
95
+ * 路径统一
96
+ */
97
+ formatPath(p) {
98
+ if (p && typeof p === 'string') {
99
+ const sep = path.sep;
100
+ if (sep === '/')
101
+ return p
102
+ else {
103
+ return p.replace(/\\/g, '/')
104
+ }
105
+ }
106
+ return p
107
+ }
108
+ }
109
+
110
+ module.exports = commonPlugins
package/index.js CHANGED
@@ -1,2 +1,2 @@
1
- const xsCommonPlugins = require('./common')
1
+ const xsCommonPlugins = require('./common')
2
2
  module.exports = xsCommonPlugins
package/package.json CHANGED
@@ -1,16 +1,16 @@
1
- {
2
- "name": "xs-common-plugins",
3
- "version": "1.2.0",
4
- "private": false,
5
- "description": "向上公共代码部分",
6
- "author": "祝玲云 <1902733517@qq.com>",
7
- "main": "index.js",
8
- "scripts": {
9
- "test": "echo \"Error: no test specified\" && exit 1"
10
- },
11
- "license": "ISC",
12
- "repository": {
13
- "type": "git",
14
- "url": "https://gitlab.365xs.cn/web/npm/xs-common-plugins.git"
15
- }
16
- }
1
+ {
2
+ "name": "xs-common-plugins",
3
+ "version": "1.2.3",
4
+ "private": false,
5
+ "description": "向上公共代码部分",
6
+ "author": "祝玲云 <1902733517@qq.com>",
7
+ "main": "index.js",
8
+ "scripts": {
9
+ "test": "echo \"Error: no test specified\" && exit 1"
10
+ },
11
+ "license": "ISC",
12
+ "repository": {
13
+ "type": "git",
14
+ "url": "https://gitlab.365xs.cn/web/npm/xs-common-plugins.git"
15
+ }
16
+ }