cloud-web-corejs 1.1.0-dev.26 → 1.1.0-dev.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.
Files changed (120) hide show
  1. package/package.json +1 -1
  2. package/src/components/Tinymce/index.vue +3 -0
  3. package/src/components/Tinymce/mce-chrome.scss +150 -0
  4. package/src/components/VabUpload/index.vue +1 -1
  5. package/src/components/VabUpload/style.scss +282 -0
  6. package/src/components/baseArea/index.vue +2 -2
  7. package/src/components/code-editor/ace-chrome.scss +17 -0
  8. package/src/components/code-editor/index.vue +3 -0
  9. package/src/components/excelImport/index.vue +1 -1
  10. package/src/components/fileLibrary/style.scss +579 -0
  11. package/src/components/hiprint/style.scss +188 -0
  12. package/src/components/jsonImport/index.vue +1 -1
  13. package/src/components/langImport/index.vue +1 -1
  14. package/src/components/mobile/buttonGroup/index.vue +1 -1
  15. package/src/components/obsUpload/index.vue +1 -1
  16. package/src/components/onlineTalk/index.vue +2 -2
  17. package/src/components/table/index.js +3 -0
  18. package/src/components/table/style.scss +1399 -0
  19. package/src/components/wf/style.scss +265 -0
  20. package/src/components/xform/docs/2026-08 xform H5 P0 /345/256/236/347/216/260/350/247/204/346/240/274.md" +1 -1
  21. package/src/components/xform/docs/2026-08 xform /347/247/273/345/212/250/347/253/257/345/270/203/345/261/200/345/257/271/351/275/220 bill_setting /346/226/271/346/241/210.md" +1 -1
  22. package/src/components/xform/form-designer/form-widget/dialog/importDialog.vue +1 -1
  23. package/src/components/xform/form-designer/form-widget/field-widget/a-link-widget.vue +1 -1
  24. package/src/components/xform/form-designer/form-widget/field-widget/a-text-widget.vue +1 -1
  25. package/src/components/xform/form-designer/form-widget/field-widget/area-select-widget.vue +1 -1
  26. package/src/components/xform/form-designer/form-widget/field-widget/autocomplete-widget.vue +1 -1
  27. package/src/components/xform/form-designer/form-widget/field-widget/baseAttachment-widget.vue +1 -1
  28. package/src/components/xform/form-designer/form-widget/field-widget/button-widget.vue +1 -1
  29. package/src/components/xform/form-designer/form-widget/field-widget/cascader-widget.vue +1 -1
  30. package/src/components/xform/form-designer/form-widget/field-widget/census-widget.vue +1 -1
  31. package/src/components/xform/form-designer/form-widget/field-widget/checkbox-widget.vue +1 -1
  32. package/src/components/xform/form-designer/form-widget/field-widget/color-widget.vue +1 -1
  33. package/src/components/xform/form-designer/form-widget/field-widget/copy_button-widget.vue +1 -1
  34. package/src/components/xform/form-designer/form-widget/field-widget/date-range-widget.vue +1 -1
  35. package/src/components/xform/form-designer/form-widget/field-widget/date-widget.vue +1 -1
  36. package/src/components/xform/form-designer/form-widget/field-widget/descriptions-widget.vue +1 -1
  37. package/src/components/xform/form-designer/form-widget/field-widget/divider-widget.vue +1 -1
  38. package/src/components/xform/form-designer/form-widget/field-widget/download-button-widget.vue +1 -1
  39. package/src/components/xform/form-designer/form-widget/field-widget/dropdown-item-widget.vue +1 -1
  40. package/src/components/xform/form-designer/form-widget/field-widget/dropdown-widget.vue +1 -1
  41. package/src/components/xform/form-designer/form-widget/field-widget/echart-bar-widget.vue +1 -1
  42. package/src/components/xform/form-designer/form-widget/field-widget/echart-category-widget.vue +1 -1
  43. package/src/components/xform/form-designer/form-widget/field-widget/echart-pie-widget.vue +1 -1
  44. package/src/components/xform/form-designer/form-widget/field-widget/file-upload-widget.vue +1 -1
  45. package/src/components/xform/form-designer/form-widget/field-widget/form-item-wrapper.vue +1 -1
  46. package/src/components/xform/form-designer/form-widget/field-widget/html-text-widget.vue +1 -1
  47. package/src/components/xform/form-designer/form-widget/field-widget/import-button-widget.vue +1 -1
  48. package/src/components/xform/form-designer/form-widget/field-widget/import2-button-widget.vue +1 -1
  49. package/src/components/xform/form-designer/form-widget/field-widget/input-batch-widget.vue +1 -1
  50. package/src/components/xform/form-designer/form-widget/field-widget/input-widget.vue +1 -1
  51. package/src/components/xform/form-designer/form-widget/field-widget/multiSearch-widget.vue +1 -1
  52. package/src/components/xform/form-designer/form-widget/field-widget/news-list-widget.vue +1 -1
  53. package/src/components/xform/form-designer/form-widget/field-widget/number-widget.vue +1 -1
  54. package/src/components/xform/form-designer/form-widget/field-widget/oplog-widget.vue +1 -1
  55. package/src/components/xform/form-designer/form-widget/field-widget/picture-upload-widget.vue +1 -1
  56. package/src/components/xform/form-designer/form-widget/field-widget/print-button-widget.vue +1 -1
  57. package/src/components/xform/form-designer/form-widget/field-widget/print-detail-button-widget.vue +1 -1
  58. package/src/components/xform/form-designer/form-widget/field-widget/project-tag-widget.vue +1 -1
  59. package/src/components/xform/form-designer/form-widget/field-widget/radio-widget.vue +1 -1
  60. package/src/components/xform/form-designer/form-widget/field-widget/rate-widget.vue +1 -1
  61. package/src/components/xform/form-designer/form-widget/field-widget/rich-editor-widget.vue +1 -1
  62. package/src/components/xform/form-designer/form-widget/field-widget/save_submit_wf_button-widget.vue +1 -1
  63. package/src/components/xform/form-designer/form-widget/field-widget/script-input-widget.vue +1 -1
  64. package/src/components/xform/form-designer/form-widget/field-widget/search_button-widget.vue +1 -1
  65. package/src/components/xform/form-designer/form-widget/field-widget/select-export-button-widget.vue +1 -1
  66. package/src/components/xform/form-designer/form-widget/field-widget/select-export-item-button-widget.vue +1 -1
  67. package/src/components/xform/form-designer/form-widget/field-widget/select-widget.vue +1 -1
  68. package/src/components/xform/form-designer/form-widget/field-widget/singerSearch-widget.vue +1 -1
  69. package/src/components/xform/form-designer/form-widget/field-widget/singleUpload-widget.vue +1 -1
  70. package/src/components/xform/form-designer/form-widget/field-widget/slider-widget.vue +1 -1
  71. package/src/components/xform/form-designer/form-widget/field-widget/static-content-wrapper.vue +1 -1
  72. package/src/components/xform/form-designer/form-widget/field-widget/static-text-widget.vue +1 -1
  73. package/src/components/xform/form-designer/form-widget/field-widget/status-widget.vue +1 -1
  74. package/src/components/xform/form-designer/form-widget/field-widget/switch-widget.vue +1 -1
  75. package/src/components/xform/form-designer/form-widget/field-widget/table-export-button-widget.vue +1 -1
  76. package/src/components/xform/form-designer/form-widget/field-widget/tempStorage-widget.vue +1 -1
  77. package/src/components/xform/form-designer/form-widget/field-widget/text-widget.vue +1 -1
  78. package/src/components/xform/form-designer/form-widget/field-widget/textarea-widget.vue +1 -1
  79. package/src/components/xform/form-designer/form-widget/field-widget/time-range-widget.vue +1 -1
  80. package/src/components/xform/form-designer/form-widget/field-widget/time-widget.vue +1 -1
  81. package/src/components/xform/form-designer/form-widget/field-widget/title-head-widget.vue +1 -1
  82. package/src/components/xform/form-designer/form-widget/field-widget/vabSearch-widget.vue +1 -1
  83. package/src/components/xform/form-designer/form-widget/field-widget/vabUpload-widget.vue +1 -1
  84. package/src/components/xform/form-designer/form-widget/field-widget/vabUpload2-widget.vue +1 -1
  85. package/src/components/xform/form-designer/form-widget/field-widget/vue-page-widget.vue +1 -1
  86. package/src/components/xform/form-designer/setting-panel/property-editor/container-data-table/data-table-editor.vue +18 -1
  87. package/src/components/xform/form-designer/setting-panel/property-editor/container-list-h5/list-h5-editor.vue +33 -20
  88. package/src/components/xform/form-designer/widget-panel/widgetsConfig.js +8 -8
  89. package/src/components/xform/form-render/container-item/data-table-mixin.js +16 -8
  90. package/src/components/xform/form-render/container-item/list-h5-item.vue +92 -309
  91. package/src/components/xform/mixins/scriptHttp.js +28 -7
  92. package/src/components/xform/styles/census.scss +288 -0
  93. package/src/components/xform/styles/containers.scss +208 -0
  94. package/src/components/xform/styles/designer.scss +904 -0
  95. package/src/components/xform/styles/detail-temp.scss +71 -0
  96. package/src/components/xform/styles/h5-designer.scss +191 -0
  97. package/src/components/xform/styles/h5.scss +5 -6
  98. package/src/components/xform/styles/skins.scss +398 -0
  99. package/src/components/xform/styles/table-layout.scss +91 -0
  100. package/src/components/xform/styles/titles.scss +255 -0
  101. package/src/components/xform/utils/util.js +20 -0
  102. package/src/index.js +2 -514
  103. package/src/layout/components/Sidebar/default.vue +3 -3
  104. package/src/layout/components/TagsView/index.vue +1 -1
  105. package/src/layout/defaultLayout.vue +2 -2
  106. package/src/store/modules/settings.js +1 -1
  107. package/src/utils/vab.js +33 -11
  108. package/src/views/bd/setting/formVersion/compareContMixin.scss +1 -1
  109. package/src/views/mobile/user/area/dialog.vue +1 -1
  110. package/src/views/mobile/user/user/dialog.vue +1 -1
  111. package/src/views/user/commMenu/index.vue +3 -1
  112. package/src/views/user/commMenu/style.scss +123 -0
  113. package/src/views/user/home/default.vue +5 -5
  114. package/src/views/user/home/default2.vue +2 -2
  115. package/src/views/user/role/edit.vue +4 -0
  116. package/src/views/user/role/role-box.scss +83 -0
  117. package/src/views/user/role/voc_edit.vue +4 -0
  118. package/src/views/user/wf/wf_obj_config/importItemDialog.vue +1 -1
  119. package/src/resources/js/base/common.js +0 -110
  120. package/src/views/user/outLink/cc_form_view.vue +0 -188
@@ -0,0 +1,123 @@
1
+ // Common-menu dialog styles extracted from the app stylesheet.
2
+ @import "~@base/styles/variables.scss";
3
+ .set-drag ul li {
4
+ width: 94px;
5
+ height: 23px;
6
+ float: left;
7
+ margin: 6px 5px;
8
+ }
9
+
10
+ .fast-set {
11
+ margin: 0 -8px;
12
+ font-size: $fontSizeBase;
13
+ .set-tips {
14
+ text-align: right;
15
+ margin-right: 12px;
16
+ color: $red;
17
+ }
18
+ .set-box {
19
+ padding: 2px 6px;
20
+ height: 60px;
21
+ overflow: hidden;
22
+ border-bottom: solid 8px #f1f5fb;
23
+ .item {
24
+ border: solid 1px #e6ebf5;
25
+ border-radius: 2px;
26
+ display: inline-block;
27
+ margin: 8px 6px 0;
28
+ padding: 0 12px;
29
+ line-height: 26px;
30
+ cursor: all-scroll;
31
+ background: #fff;
32
+ span {
33
+ vertical-align: middle;
34
+ display: inline-block;
35
+ overflow: hidden;
36
+ }
37
+ i {
38
+ display: inline-block;
39
+ vertical-align: middle;
40
+ margin-left: 2px;
41
+ cursor: pointer;
42
+ }
43
+ &:hover {
44
+ color: $baseColor;
45
+ border-color: $baseColor;
46
+ }
47
+ }
48
+ }
49
+ .set-menu {
50
+ height: calc(100vh - 204px);
51
+ overflow: auto;
52
+ padding: 0 18px 18px;
53
+ .item {
54
+ margin-top: 16px;
55
+ position: relative;
56
+ &:before {
57
+ content: "";
58
+ position: absolute;
59
+ top: 34px;
60
+ left: 7px;
61
+ bottom: 32px;
62
+ width: 1px;
63
+ background: transparentize($baseColor, 0.92);
64
+ }
65
+ }
66
+ .m-1 {
67
+ position: relative;
68
+ font-size: 13px;
69
+ color: $baseColor;
70
+ > span {
71
+ display: inline-block;
72
+ background: transparentize($baseColor, 0.92);
73
+ padding: 8px 12px 8px 8px;
74
+ border-radius: 2px;
75
+ margin: 0 -6px 0;
76
+ i {
77
+ margin-right: 4px;
78
+ vertical-align: middle;
79
+ margin-bottom: 2px;
80
+ }
81
+ }
82
+ }
83
+ .m-2 {
84
+ width: 74px;
85
+ font-size: $fontSizeBase;
86
+ color: #212121;
87
+ }
88
+ .m-3 {
89
+ flex: 1;
90
+ border-bottom: solid 1px #eee;
91
+ padding: 0 2px 8px;
92
+ margin-bottom: 6px;
93
+ label {
94
+ display: inline-block; /*min-width: 94px;*/
95
+ color: #808080;
96
+ margin-right: 40px;
97
+ margin-bottom: 8px;
98
+ float: left;
99
+ }
100
+ }
101
+ dl {
102
+ margin-top: 10px;
103
+ padding-left: 36px;
104
+ position: relative;
105
+ display: flex;
106
+ line-height: 20px;
107
+ margin-bottom: 0;
108
+ &:before {
109
+ content: "";
110
+ background: transparentize($baseColor, 0.92);
111
+ width: 20px;
112
+ height: 1px;
113
+ display: inline-block;
114
+ position: absolute;
115
+ left: 8px;
116
+ top: 10px;
117
+ }
118
+ &:last-child .m-3 {
119
+ border-bottom: none;
120
+ }
121
+ }
122
+ }
123
+ }
@@ -355,7 +355,7 @@ export default {
355
355
  let userInfo = res.objx;
356
356
  this.headPhotoUrl = userInfo.headPhotoUrl
357
357
  ? userInfo.headPhotoUrl
358
- : (require("@/resources/images/default-header.png").default || require("@/resources/images/default-header.png"));
358
+ : (require("@base/core-resources/images/default-header.png").default || require("@base/core-resources/images/default-header.png"));
359
359
 
360
360
  this.userInfo = userInfo;
361
361
  },
@@ -678,7 +678,7 @@ export default {
678
678
  };
679
679
  </script>
680
680
  <style lang="scss" scoped>
681
- @import "~@/styles/variables.scss";
681
+ @import "~@base/styles/variables.scss";
682
682
 
683
683
  body #app .index-home {
684
684
  margin: 3px 10px;
@@ -737,8 +737,8 @@ body #app .index-home {
737
737
  .time {
738
738
  color: #b9b9b9;
739
739
  font-size: 12px;
740
- right: 12px;
741
- background: #FFF;
740
+ right: 12px;
741
+ background: #FFF;
742
742
  padding-left: 8px;
743
743
  }
744
744
 
@@ -747,7 +747,7 @@ body #app .index-home {
747
747
  background-color: #F8FAFC;
748
748
 
749
749
  .time {
750
- color: $baseColor;
750
+ color: $baseColor;
751
751
  background-color: #F8FAFC;
752
752
  }
753
753
  }
@@ -594,7 +594,7 @@ export default {
594
594
  let userInfo = res.objx;
595
595
  this.headPhotoUrl = userInfo.headPhotoUrl
596
596
  ? userInfo.headPhotoUrl
597
- : (require("@/resources/images/default-header.png").default || require("@/resources/images/default-header.png"));
597
+ : (require("@base/core-resources/images/default-header.png").default || require("@base/core-resources/images/default-header.png"));
598
598
 
599
599
  this.userInfo = userInfo;
600
600
  },
@@ -923,7 +923,7 @@ export default {
923
923
  };
924
924
  </script>
925
925
  <style lang="scss" scoped>
926
- @import "~@/styles/variables.scss";
926
+ @import "~@base/styles/variables.scss";
927
927
  ::v-deep .el-link {
928
928
  color: rgba(0, 0, 0, 0.65);
929
929
  .iconfont {
@@ -630,3 +630,7 @@ export default {
630
630
  },
631
631
  };
632
632
  </script>
633
+
634
+ <style lang="scss">
635
+ @import "./role-box.scss";
636
+ </style>
@@ -0,0 +1,83 @@
1
+ // Role permission box extracted from the app stylesheet.
2
+ @import "~@base/styles/variables.scss";
3
+ .role-box {
4
+ .item {
5
+ border: solid 1px $borderColor;
6
+ margin-bottom: 12px;
7
+ &.hide {
8
+ .t i {
9
+ transform: rotate(180deg);
10
+ -ms-transform: rotate(180deg);
11
+ -moz-transform: rotate(180deg);
12
+ -webkit-transform: rotate(180deg);
13
+ -o-transform: rotate(180deg);
14
+ }
15
+ .c {
16
+ display: none;
17
+ }
18
+ }
19
+ .t {
20
+ font-size: 13px;
21
+ color: #808080;
22
+ height: 36px;
23
+ line-height: 36px;
24
+ padding: 0 16px;
25
+ background: #f6faff;
26
+ font-weight: 600;
27
+ i {
28
+ display: inline-block;
29
+ float: right;
30
+ line-height: 36px;
31
+ font-size: 16px;
32
+ cursor: pointer;
33
+ -webkit-transition: all 0.2s ease-in;
34
+ -moz-transition: all 0.2s ease-in;
35
+ -o-transition: all 0.2s ease-in;
36
+ transition: all 0.2s ease-in;
37
+ }
38
+ }
39
+ .c {
40
+ > div {
41
+ border-top: solid 1px $borderColor;
42
+ color: #424242;
43
+ min-height: 45px;
44
+ }
45
+ .c-2nd {
46
+ width: 146px;
47
+ display: inline-block;
48
+ padding: 14px 0 0 16px;
49
+ font-size: $fontSizeBase;
50
+ color: #808080;
51
+ .el-checkbox__inner {
52
+ vertical-align: bottom;
53
+ }
54
+ }
55
+ .c-3rd {
56
+ display: inline-block;
57
+ width: calc(100% - 150px);
58
+ vertical-align: top;
59
+ border-left: solid 1px $borderColor;
60
+ padding: 0 24px;
61
+ .c-item {
62
+ padding: 10px 0;
63
+ border-bottom: solid 1px $borderColor;
64
+ &:last-child {
65
+ border-bottom: none;
66
+ }
67
+ .name {
68
+ width: 300px;
69
+ display: inline-block;
70
+ vertical-align: top;
71
+ }
72
+ .c-4th {
73
+ width: calc(100% - 320px);
74
+ display: inline-block;
75
+ }
76
+ }
77
+ .el-checkbox__inner {
78
+ vertical-align: bottom;
79
+ }
80
+ }
81
+ }
82
+ }
83
+ }
@@ -291,3 +291,7 @@ export default {
291
291
  },
292
292
  };
293
293
  </script>
294
+
295
+ <style lang="scss">
296
+ @import "./role-box.scss";
297
+ </style>
@@ -20,7 +20,7 @@
20
20
  </div>
21
21
  </el-upload>
22
22
  <div class="upload-finish" v-if="fileRaw">
23
- <img :src="$assetUrl(require('@/resources' + '/images/ico-txt.svg'))" class="ico"/>
23
+ <img :src="$assetUrl(require('@base/core-resources' + '/images/ico-txt.svg'))" class="ico"/>
24
24
  <p class="name">{{ fileRaw.name }}</p>
25
25
  <!-- <p>2022-1-17</p> -->
26
26
  <el-tooltip :enterable="false" class="item" effect="dark"
@@ -1,110 +0,0 @@
1
- /**version-1.0*/
2
- (function(w) {
3
- w.commonDataUtil = {
4
- toHump: function(name) {
5
- return name.replace(/\_(\w)/g, function(all, letter) {
6
- return letter.toUpperCase();
7
- });
8
- },
9
- toLine: function(name) {
10
- return name.replace(/([A-Z])/g, '_$1').toLowerCase();
11
- },
12
- toHumpKey: function(data) {
13
- if (!data) return data;
14
- var nMap = {};
15
- for (const key in data) {
16
- const value = data[key] ?? null;
17
- const nKey = commonDataUtil.toHump(key);
18
- nMap[nKey] = value;
19
- }
20
- return nMap;
21
- },
22
- handleForm: function(data, option) {
23
- let ignore_fields = ["_X_ROW_CHILD", "_X_ROW_KEY"];
24
- let ignore_key = "_$ignore_field_";
25
- let toDo = function(data) {
26
- if (!Array.isArray(data) && Object.prototype.toString.call(data) !==
27
- '[object Object]') {
28
- return data;
29
- }
30
- let formData = JSON.parse(JSON.stringify(data || {}));
31
- let newFormData = {};
32
- let keys = Object.keys(formData);
33
- for (let i = 0; i < keys.length; i++) {
34
- let key = keys[i];
35
- let value = formData[key] ?? null;
36
- if (ignore_fields.includes(key) || key.indexOf(ignore_key) == 0) {
37
- delete formData[key];
38
- continue;
39
- }
40
- if (option && option.ignore_fields && option.ignore_fields.includes(key)) {
41
- delete formData[key];
42
- continue;
43
- }
44
- if (value != null) {
45
- if (Array.isArray(value)) {
46
- value.forEach(function(item, index) {
47
- if (Array.isArray(item) || Object.prototype.toString.call(
48
- item) ===
49
- '[object Object]') {
50
- value[index] = toDo(item);
51
- }
52
- });
53
- formData[key] = value;
54
- } else if (Object.prototype.toString.call(value) === '[object Object]') {
55
- formData[key] = toDo(value);
56
- } else {
57
- if (key == 'id' && value.toString().indexOf('row_') == 0) {
58
- formData[key] = null;
59
- }
60
- }
61
- }
62
- }
63
- return formData;
64
- }
65
- return toDo(data);
66
- },
67
- handleForm2: function(data, field) {
68
- const formData = {};
69
- var tKey = field ? field + '.' : '';
70
- for (const key in data) {
71
- const rKey = tKey + commonDataUtil.toHump(key);
72
- let value = data[key] ?? null;
73
- if (value != null) {
74
- if (Array.isArray(value)) {
75
- value.forEach(function(item, index) {
76
- const mKey = rKey + '[' + index + ']';
77
- Object.assign(formData, commonDataUtil.handleForm2(item, mKey));
78
- });
79
- } else if (Object.prototype.toString.call(value) === '[object Object]') {
80
- Object.assign(formData, commonDataUtil.handleForm2(value, rKey));
81
- } else {
82
- if (key == 'id' && value.toString().indexOf('row_') == 0) {
83
- value = null;
84
- } else {
85
- formData[rKey] = value;
86
- }
87
- }
88
- }
89
- }
90
- return formData;
91
- }
92
- };
93
-
94
- w.$getVueByUid = function(uid) {
95
- let loop = function(parent) {
96
- if (parent._uid == uid) {
97
- return parent;
98
- } else {
99
- let $children = parent.$children;
100
- for (let i = 0; i < $children.length; i++) {
101
- let tTarget = loop($children[i]);
102
- if (tTarget) {
103
- return tTarget;
104
- }
105
- }
106
- }
107
- };
108
- return loop($vueRoot);
109
- };
110
- })(window);
@@ -1,188 +0,0 @@
1
- <template>
2
- <div
3
- class="cc-entry"
4
- v-loading="loading"
5
- :element-loading-text="loadingText"
6
- element-loading-background="rgba(255, 255, 255, 0.9)"
7
- >
8
- <div class="cc-entry__box" v-if="errMsg">
9
- <el-alert :title="errMsg" type="error" :closable="false" show-icon />
10
- <div class="cc-entry__footer">
11
- <el-button type="primary" size="small" @click="start">重试</el-button>
12
- </div>
13
- </div>
14
- </div>
15
- </template>
16
-
17
- <script>
18
- /**
19
- * 呼叫中心(CC)业务专用外链入口。
20
- *
21
- * 背景:业务系统(呼叫中心)只会带 appid / appkey / account / callNo 四个参数跳过来,
22
- * 拿不到 form_outLinkView 所需的 tp(用户身份密文)。本页在 form_outLinkView 之前加一层:
23
- * 1. 取四个参数
24
- * 2. 调后台接口换取 tp
25
- * 3. replace 到 /form_outLinkView,formCode 写死、dataId 固定 0
26
- *
27
- * 入口地址示例:
28
- * https://csmuat.chinamacro.com/#/cc_form_outLinkView
29
- * ?appid=6789B4BBAF71D4F9D79E0912856E04E
30
- * &appkey=坐席id
31
- * &account=坐席帐号
32
- * &callNo=来电手机
33
- *
34
- * 最终跳转:
35
- * #/form_outLinkView?url=/user/form/view/edit&formCode=xxx&dataId=0&tp=xxx&callNo=xxx...
36
- */
37
-
38
- /* ------------------------------------------------------------------ *
39
- * 业务定制配置:换业务页面只改这里
40
- * ------------------------------------------------------------------ */
41
- const CC_CONFIG = {
42
- // 固定的表单视图路由,form_outLinkView 的 url 参数
43
- formUrl: "/user/form/view/edit",
44
- // 写死的表单编码(按实际业务表单调整)
45
- formCode: "patentApply_edit",
46
- // 写死的单据 ID,新建为 0
47
- dataId: "0",
48
- };
49
-
50
- /** 透传给业务表单的参数(form_outLinkView 会 v-bind 到目标组件上) */
51
- const PASS_THROUGH = ["callNo", "account", "agentId"];
52
-
53
- export default {
54
- name: "ccFormOutLinkView",
55
- data() {
56
- return {
57
- loading: false,
58
- loadingText: "正在获取身份信息…",
59
- errMsg: "",
60
- };
61
- },
62
- created() {
63
- this.start();
64
- },
65
- methods: {
66
- /** 大小写不敏感地取 query,业务系统对参数大小写不一定稳定 */
67
- pickQuery(...names) {
68
- let query = this.$route.query || {};
69
- let keys = Object.keys(query);
70
- for (let name of names) {
71
- let key = keys.find((k) => k.toLowerCase() === name.toLowerCase());
72
- if (
73
- key &&
74
- query[key] !== "" &&
75
- query[key] !== undefined &&
76
- query[key] !== null
77
- ) {
78
- return query[key];
79
- }
80
- }
81
- return "";
82
- },
83
- resolveParams() {
84
- return {
85
- appid: this.pickQuery("appid"),
86
- appkey: this.pickQuery("appkey"),
87
- account: this.pickQuery("account"),
88
- callNo: this.pickQuery("callNo"),
89
- };
90
- },
91
- start() {
92
- this.errMsg = "";
93
- let params = this.resolveParams();
94
- let missing = ["appkey", "account"].filter((key) => !params[key]);
95
- if (missing.length) {
96
- this.errMsg =
97
- "缺少必要参数:" + missing.join("、") + ",请检查呼叫中心跳转链接";
98
- return;
99
- }
100
- this.getToken(params);
101
- },
102
- getToken(params) {
103
- this.loading = true;
104
- this.$http({
105
- url: USER_PREFIX + "/auth/login",
106
- method: "post",
107
- data: {
108
- custom: "true",
109
- loginFlag: 1,
110
- appkey: params.appkey,
111
- account: params.account,
112
- },
113
- // 无 token 场景,且自行接管提示与遮罩
114
- useToken: false,
115
- isLoading: false,
116
- failMsg: false,
117
- errorMsg: false,
118
- success: (res) => {
119
- let token = res.objx;
120
- if (!token) {
121
- this.loading = false;
122
- this.errMsg = "身份信息(token)获取失败:接口未返回 token";
123
- return;
124
- }
125
- this.redirect(params, token);
126
- },
127
- fail: (res) => {
128
- this.loading = false;
129
- this.errMsg =
130
- "身份信息(token)获取失败:" +
131
- ((res && (res.content || res.msg)) || "接口返回异常");
132
- },
133
- error: (err) => {
134
- this.loading = false;
135
- this.errMsg =
136
- "身份信息(token)获取失败:" + ((err && err.message) || "网络异常");
137
- },
138
- });
139
- },
140
- redirect(params, token) {
141
- this.loadingText = "正在打开单据…";
142
- let query = {
143
- url: CC_CONFIG.formUrl,
144
- formCode: CC_CONFIG.formCode,
145
- dataId: CC_CONFIG.dataId,
146
- access_token: token,
147
- };
148
- // 来电号码等业务参数透传给表单,供表单脚本取用
149
- let source = { ...params, agentId: params.appkey };
150
- PASS_THROUGH.forEach((key) => {
151
- if (source[key]) {
152
- query[key] = source[key];
153
- }
154
- });
155
- let i18nLang = this.pickQuery("i18nLang");
156
- if (i18nLang) {
157
- query.i18nLang = i18nLang;
158
- }
159
- // replace:不在历史里留下本入口页,避免回退时重复换取 tp
160
- // 注:vue-router 3.0.2 的 replace 不返回 Promise,不能链 .then/.catch
161
- this.$router.replace({
162
- path: "/form_outLinkView",
163
- query: query,
164
- });
165
- },
166
- },
167
- };
168
- </script>
169
-
170
- <style lang="scss" scoped>
171
- .cc-entry {
172
- display: flex;
173
- align-items: center;
174
- justify-content: center;
175
- width: 100%;
176
- height: 100vh;
177
- }
178
-
179
- .cc-entry__box {
180
- width: 420px;
181
- max-width: 80%;
182
- }
183
-
184
- .cc-entry__footer {
185
- margin-top: 12px;
186
- text-align: center;
187
- }
188
- </style>