address-book-shell 0.0.1

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 (65) hide show
  1. package/.browserslistrc +3 -0
  2. package/.eslintrc.js +14 -0
  3. package/.prettierrc.js +16 -0
  4. package/README.md +20 -0
  5. package/babel.config.js +3 -0
  6. package/docs/.vuepress/components/demo-1.vue +14 -0
  7. package/docs/.vuepress/config.js +24 -0
  8. package/docs/README.md +37 -0
  9. package/docs/assets/imgs/tray.png +0 -0
  10. package/docs/page/README.md +1 -0
  11. package/docs/page/install.md +10 -0
  12. package/docs/page/register.md +11 -0
  13. package/lib/address-book-shell.common.js +5367 -0
  14. package/lib/address-book-shell.umd.js +5377 -0
  15. package/lib/address-book-shell.umd.min.js +1 -0
  16. package/lib/demo.html +8 -0
  17. package/lib/fonts/element-icons.535877f5.woff +0 -0
  18. package/lib/fonts/element-icons.732389de.ttf +0 -0
  19. package/lib/fonts/iconfont.0ebb200a.ttf +0 -0
  20. package/lib/fonts/iconfont.75f80b2a.woff2 +0 -0
  21. package/lib/fonts/iconfont.b7064d58.eot +0 -0
  22. package/lib/fonts/iconfont.f3953641.woff +0 -0
  23. package/lib/img/iconfont.0956fc20.svg +493 -0
  24. package/package.json +39 -0
  25. package/packages/address-book/filters/index.js +17 -0
  26. package/packages/address-book/index.js +6 -0
  27. package/packages/address-book/src/components/address-aside.vue +453 -0
  28. package/packages/address-book/src/components/address-content.vue +1048 -0
  29. package/packages/address-book/src/components/address-current-list.vue +137 -0
  30. package/packages/address-book/src/components/address-figure-tree.vue +106 -0
  31. package/packages/address-book/src/components/address-group-item.vue +145 -0
  32. package/packages/address-book/src/components/address-group.vue +102 -0
  33. package/packages/address-book/src/index.vue +639 -0
  34. package/packages/address-book/src/utils/util.js +109 -0
  35. package/packages/config.js +6 -0
  36. package/packages/index.js +31 -0
  37. package/public/favicon.ico +0 -0
  38. package/public/index.html +17 -0
  39. package/src/App.vue +9 -0
  40. package/src/api/address-list-api.js +89 -0
  41. package/src/api/cas-api.js +0 -0
  42. package/src/assets/icon-font/demo.css +539 -0
  43. package/src/assets/icon-font/demo_index.html +5642 -0
  44. package/src/assets/icon-font/iconfont.css +966 -0
  45. package/src/assets/icon-font/iconfont.eot +0 -0
  46. package/src/assets/icon-font/iconfont.js +1 -0
  47. package/src/assets/icon-font/iconfont.json +1668 -0
  48. package/src/assets/icon-font/iconfont.svg +493 -0
  49. package/src/assets/icon-font/iconfont.ttf +0 -0
  50. package/src/assets/icon-font/iconfont.woff +0 -0
  51. package/src/assets/icon-font/iconfont.woff2 +0 -0
  52. package/src/assets/logo.png +0 -0
  53. package/src/components/HelloWorld.vue +130 -0
  54. package/src/main.js +30 -0
  55. package/src/scss/global.scss +10 -0
  56. package/src/store/index.js +10 -0
  57. package/src/store/mutation-types.js +4 -0
  58. package/src/theme/element-ui-theme/config.json +1 -0
  59. package/src/theme/element-ui-theme/element-ui-common.scss +1394 -0
  60. package/src/theme/element-ui-theme/theme/fonts/element-icons.ttf +0 -0
  61. package/src/theme/element-ui-theme/theme/fonts/element-icons.woff +0 -0
  62. package/src/theme/element-ui-theme/theme/index.css +1 -0
  63. package/src/utils/plug_in-config.js +38 -0
  64. package/src/utils/util.js +20 -0
  65. package/vue.config.js +39 -0
@@ -0,0 +1,109 @@
1
+ /**
2
+ * 数组对象根据关键字去重
3
+ * @param {*} arr
4
+ * @param {*} key
5
+ * @returns
6
+ */
7
+ export const unique = (arr, key = 'fdId') => {
8
+ let uniqueArr = []
9
+ let keys = {}
10
+ for (var i = 0; i < arr.length; i++) {
11
+ if (arr[i].userid && !arr[i][key]) {
12
+ arr[i][key] = arr[i].userid
13
+ }
14
+ if (!keys[arr[i][key]]) {
15
+ uniqueArr.push(arr[i])
16
+ keys[arr[i][key]] = true
17
+ }
18
+ }
19
+ return uniqueArr
20
+ }
21
+
22
+ /**
23
+ * 深拷贝
24
+ *
25
+ * @param {object} obj
26
+ * @returns objClone
27
+ */
28
+ export const deepClone = function (obj) {
29
+ let objClone = Array.isArray(obj) ? [] : {}
30
+ if (obj && typeof obj === 'object') {
31
+ for (let key in obj) {
32
+ if (obj[key] && typeof obj[key] === 'object') {
33
+ objClone[key] = deepClone(obj[key])
34
+ } else {
35
+ objClone[key] = obj[key]
36
+ }
37
+ }
38
+ }
39
+ return objClone
40
+ }
41
+ /**
42
+ * 高亮关键字
43
+ * @param {String} val
44
+ * @param {String} keyword 需要高亮的文字
45
+ * @returns
46
+ */
47
+ export function keyWordLight(val, keyword) {
48
+ const Reg = new RegExp(keyword, 'g')
49
+ if (val) {
50
+ return val.replace(Reg, `<span style="color:red">${keyword}</span>`)
51
+ }
52
+ }
53
+
54
+ /**
55
+ * 根据对象某个属性删除
56
+ * @param {Array} arr
57
+ * @param {Object} obj
58
+ * @param {简单数据类型} key
59
+ */
60
+ export const deleteArrayItem = (arr, obj, key = 'fdId') => {
61
+ if (!arr.length || !key) return false
62
+ let i = arr.findIndex((item) => item[key] === obj[key])
63
+ if (i > -1) {
64
+ arr.splice(i, 1)
65
+ }
66
+ }
67
+
68
+ /**
69
+ * @desc 格式化日期时间
70
+ * @param {[String]} format时间日期格式
71
+ * @param {[Date|String]} date
72
+ * @return {String}
73
+ * example new Date().Format('yyyy-MM-dd hh:mm:ss') 2021-11-02 15:10:12
74
+ */
75
+ export const Format = function (fmt, time = new Date()) {
76
+ if (arguments.length === 0) {
77
+ return null
78
+ }
79
+ let date
80
+ if (typeof time === 'object') {
81
+ date = time
82
+ } else {
83
+ if (typeof time === 'string' && /^[0-9]+$/.test(time)) {
84
+ time = parseInt(time)
85
+ }
86
+ if (typeof time === 'number' && time.toString().length === 10) {
87
+ time = time * 1000
88
+ }
89
+ date = new Date(time)
90
+ }
91
+ var o = {
92
+ 'M+': date.getMonth() + 1, // 月份
93
+ 'd+': date.getDate(), // 日
94
+ 'h+': date.getHours(), // 小时
95
+ 'm+': date.getMinutes(), // 分
96
+ 's+': date.getSeconds(), // 秒
97
+ 'q+': Math.floor((date.getMonth() + 3) / 3), // 季度
98
+ S: date.getMilliseconds(), // 毫秒
99
+ }
100
+ if (/(y+)/.test(fmt))
101
+ fmt = fmt.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length))
102
+ for (var k in o)
103
+ if (new RegExp('(' + k + ')').test(fmt))
104
+ fmt = fmt.replace(
105
+ RegExp.$1,
106
+ RegExp.$1.length == 1 ? o[k] : ('00' + o[k]).substr(('' + o[k]).length)
107
+ )
108
+ return fmt
109
+ }
@@ -0,0 +1,6 @@
1
+ export default {
2
+ // incomingData: {},
3
+ microserviceRequest: () => {},
4
+ // loginUserinfo: null,
5
+ storageName: 'pro__Login_Userinfo',
6
+ }
@@ -0,0 +1,31 @@
1
+ import AddressBook from './address-book'
2
+ import { version } from '../package.json'
3
+ import incomingData from './config'
4
+ // 存储组件列表
5
+ const components = [AddressBook]
6
+
7
+ // 定义 install 方法,接收 Vue 作为参数。如果使用 use 注册插件,则所有的组件都将被注册
8
+ const install = function (Vue, data = null) {
9
+ // 判断是否安装
10
+ if (install.installed) return
11
+ install.installed = true
12
+ // 将传入的参数储存在config.js文件
13
+ Object.keys(data).forEach((key) => {
14
+ incomingData[key] = data[key]
15
+ })
16
+ // 遍历注册全局组件
17
+ components.map((component) => Vue.component(component.name, component))
18
+ }
19
+
20
+ // 判断是否是直接引入文件
21
+ if (typeof window !== 'undefined' && window.Vue) {
22
+ install(window.Vue)
23
+ }
24
+ // 按需引入
25
+ export { AddressBook }
26
+
27
+ export default {
28
+ version,
29
+ // 导出的对象必须具有 install,才能被 Vue.use() 方法安装
30
+ install,
31
+ }
Binary file
@@ -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>
package/src/App.vue ADDED
@@ -0,0 +1,9 @@
1
+ <template>
2
+ <div id="app">111</div>
3
+ </template>
4
+
5
+ <script>
6
+ export default {}
7
+ </script>
8
+
9
+ <style lang="scss"></style>
@@ -0,0 +1,89 @@
1
+ import incomingData from '../../packages/config'
2
+
3
+ // 获取地址本列表数据
4
+ export const queryList = (params = {}) => {
5
+ return incomingData.microserviceRequest({
6
+ url: '917354',
7
+ params,
8
+ })
9
+ }
10
+
11
+ // 地址本已选人员名单
12
+ export const addPeopleList = (params = {}) => {
13
+ return incomingData.microserviceRequest({
14
+ url: '917357',
15
+ params,
16
+ })
17
+ }
18
+ // 地址本数据权限接口
19
+ export const getMenuAccess = (params = {}) => {
20
+ return incomingData.microserviceRequest({
21
+ url: '917358',
22
+ params,
23
+ })
24
+ }
25
+
26
+ // 地址本导航栏查询
27
+ export const searchTree = (params = {}) => {
28
+ return incomingData.microserviceRequest({
29
+ url: '917351',
30
+ params,
31
+ })
32
+ }
33
+
34
+ // 地址本搜索
35
+ export const searchList = (params = {}) => {
36
+ return incomingData.microserviceRequest({
37
+ url: '917350',
38
+ params,
39
+ })
40
+ }
41
+
42
+ // 添加最近联系人
43
+ export const addRecentContacts = (params = {}) => {
44
+ return incomingData.microserviceRequest({
45
+ url: '917352',
46
+ params,
47
+ })
48
+ }
49
+
50
+ export const queryTree = (params = {}) => {
51
+ return incomingData.microserviceRequest({
52
+ url: '917355',
53
+ // url: '917755',
54
+ params,
55
+ // notAutoToken: true //不需要token
56
+ })
57
+ }
58
+
59
+ // 获取常用联系人
60
+ export const queryRecentContacts = (params = {}) => {
61
+ return incomingData.microserviceRequest({
62
+ url: '917353',
63
+ params,
64
+ })
65
+ }
66
+
67
+ // 我的好友列表
68
+ export const myfriendList = (params) => {
69
+ return incomingData.microserviceRequest({ url: '917774', params }) // IMmyfriendList
70
+ }
71
+
72
+ // 我的好友查询接口
73
+ export const searchMyfriendList = (params) => {
74
+ // return request.get(`${base_url}/TencentIM/Account/searchMyfriendList`, { params })
75
+ return incomingData.microserviceRequest({ url: '917776', params }) // IMsearchMyfriendList
76
+ }
77
+
78
+ // 机器人列表
79
+ export const getRobotsList = (params) => {
80
+ return incomingData.microserviceRequest({
81
+ url: '491292',
82
+ notAutoToken: true,
83
+ params,
84
+ config: {
85
+ baseUrl: process.env.VUE_APP_WFW_BASE_URL_SECOND,
86
+ },
87
+ needErrorno: true,
88
+ })
89
+ }
File without changes