cloud-web-corejs 1.0.54-dev.630 → 1.0.54-dev.632

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.
@@ -1,27 +1,43 @@
1
1
  <template>
2
- <form-item-wrapper :designer="designer" :field="field" :rules="rules" :design-state="designState"
3
- :parent-widget="parentWidget" :parent-list="parentList" :index-of-parent-list="indexOfParentList"
4
- :sub-form-row-index="subFormRowIndex" :sub-form-col-index="subFormColIndex"
5
- :sub-form-row-id="subFormRowId">
6
- <template v-for="(item,index) in field.options.statusParam">
7
- <template v-if="fieldModel===item[valueField]">
8
- <span v-if="field.options.formScriptEnabled || field.options.commonAttributeEnabled" :key="index" >{{ getI18nLabel(item[labelField]) }}</span>
9
- <span v-else :key="index" class="list-tag" :class="item.type">{{ getI18nLabel(item[labelField]) }}</span>
2
+ <form-item-wrapper
3
+ :designer="designer"
4
+ :field="field"
5
+ :rules="rules"
6
+ :design-state="designState"
7
+ :parent-widget="parentWidget"
8
+ :parent-list="parentList"
9
+ :index-of-parent-list="indexOfParentList"
10
+ :sub-form-row-index="subFormRowIndex"
11
+ :sub-form-col-index="subFormColIndex"
12
+ :sub-form-row-id="subFormRowId"
13
+ >
14
+ <template v-for="(item, index) in field.options.statusParam">
15
+ <template v-if="fieldModel === item[valueField]">
16
+ <span
17
+ v-if="
18
+ field.options.formScriptEnabled ||
19
+ field.options.commonAttributeEnabled
20
+ "
21
+ :key="index"
22
+ >{{ getI18nLabel(item[labelField]) }}</span
23
+ >
24
+ <span v-else :key="index" class="list-tag" :class="item.type">{{
25
+ getI18nLabel(item[labelField])
26
+ }}</span>
10
27
  </template>
11
28
  </template>
12
29
  </form-item-wrapper>
13
30
  </template>
14
31
 
15
32
  <script>
16
- import emitter from '../../../../../components/xform/utils/emitter'
33
+ import emitter from "../../../../../components/xform/utils/emitter";
17
34
  import i18n from "../../../../../components/xform/utils/i18n";
18
35
  import fieldMixin from "../../../../../components/xform/form-designer/form-widget/field-widget/fieldMixin";
19
- import FormItemWrapper
20
- from "../../../../../components/xform/form-designer/form-widget/field-widget/form-item-wrapper.vue";
36
+ import FormItemWrapper from "../../../../../components/xform/form-designer/form-widget/field-widget/form-item-wrapper.vue";
21
37
 
22
38
  export default {
23
39
  name: "status-widget",
24
- componentName: 'FieldWidget', //必须固定为FieldWidget,用于接收父级组件的broadcast事件
40
+ componentName: "FieldWidget", //必须固定为FieldWidget,用于接收父级组件的broadcast事件
25
41
  mixins: [emitter, fieldMixin, i18n],
26
42
  props: {
27
43
  field: Object,
@@ -32,28 +48,26 @@ export default {
32
48
 
33
49
  designState: {
34
50
  type: Boolean,
35
- default: false
51
+ default: false,
36
52
  },
37
53
 
38
- subFormRowIndex: { /* 子表单组件行索引,从0开始计数 */
39
- type: Number,
40
- default: -1
54
+ subFormRowIndex: {
55
+ /* 子表单组件行索引,从0开始计数 */ type: Number,
56
+ default: -1,
41
57
  },
42
- subFormColIndex: { /* 子表单组件列索引,从0开始计数 */
43
- type: Number,
44
- default: -1
58
+ subFormColIndex: {
59
+ /* 子表单组件列索引,从0开始计数 */ type: Number,
60
+ default: -1,
45
61
  },
46
- subFormRowId: { /* 子表单组件行Id,唯一id且不可变 */
47
- type: String,
48
- default: ''
62
+ subFormRowId: {
63
+ /* 子表单组件行Id,唯一id且不可变 */ type: String,
64
+ default: "",
49
65
  },
50
-
51
66
  },
52
67
  components: {
53
- FormItemWrapper
54
-
68
+ FormItemWrapper,
55
69
  },
56
- inject: ['refList', 'globalOptionData', 'globalModel', 'getFormConfig'],
70
+ inject: ["refList", "globalOptionData", "globalModel", "getFormConfig"],
57
71
  data() {
58
72
  return {
59
73
  oldFieldValue: [], //field组件change之前的值
@@ -62,55 +76,56 @@ export default {
62
76
  isH5: false,
63
77
  option: {},
64
78
  statusParam: [],
65
- }
79
+ };
66
80
  },
67
81
  computed: {
68
- labelField(){
82
+ labelField() {
69
83
  return this.getOptionItemLabelKey();
70
84
  },
71
- valueField(){
85
+ valueField() {
72
86
  return this.getOptionItemValueKey();
73
- }
87
+ },
74
88
  },
75
89
  watch: {
76
90
  fieldModel(val) {
77
91
  this.handleChangeEvent(val);
78
- }
92
+ },
79
93
  },
80
94
  beforeCreate() {
81
95
  /* 这里不能访问方法和属性!! */
82
96
  },
83
97
 
84
98
  created() {
85
-
86
99
  /* 注意:子组件mounted在父组件created之后、父组件mounted之前触发,故子组件mounted需要用到的prop
87
100
  需要在父组件created中初始化!! */
88
101
  this.initStatusForDesign();
89
102
 
90
- this.initFieldModel()
91
- this.registerToRefList()
92
- this.initEventHandler()
93
- this.buildFieldRules()
103
+ this.initFieldModel();
104
+ this.registerToRefList();
105
+ this.initEventHandler();
106
+ this.buildFieldRules();
94
107
 
95
- this.handleOnCreated()
96
- this.initOptionItemsHandle()
108
+ this.handleOnCreated();
109
+ this.initOptionItemsHandle();
97
110
  // this.initStatusParam();
98
111
  },
99
112
 
100
113
  mounted() {
101
- this.handleOnMounted()
114
+ this.handleOnMounted();
102
115
  },
103
116
 
104
117
  beforeDestroy() {
105
- this.unregisterFromRefList()
118
+ this.unregisterFromRefList();
106
119
  },
107
120
  methods: {
108
121
  initStatusForDesign() {
109
122
  if (this.designState) {
110
123
  let value = null;
111
124
  let statusParam = this.field.options.statusParam;
125
+ let valueField = this.valueField;
112
126
  if (statusParam.length) {
113
- value = this.field.options.defaultValue ?? (statusParam[0].value ?? 0)
127
+ value =
128
+ this.field.options.defaultValue ?? statusParam[0][valueField] ?? 0;
114
129
  } else {
115
130
  value = 0;
116
131
  }
@@ -124,14 +139,18 @@ export default {
124
139
  getFieldModelLabel() {
125
140
  let label = null;
126
141
  let fieldModel = this.fieldModel;
127
- let item = this.field.options.statusParam.find(item => item.value === fieldModel)
142
+ let valueField = this.valueField;
143
+ let labelField = this.labelField;
144
+ let item = this.field.options.statusParam.find(
145
+ (item) => item[valueField] === fieldModel
146
+ );
128
147
  if (item) {
129
- label = this.getI18nLabel(item.label);
148
+ label = this.getI18nLabel(item[labelField]);
130
149
  }
131
150
  return label;
132
- }
133
- }
134
- }
151
+ },
152
+ },
153
+ };
135
154
  </script>
136
155
 
137
156
  <style lang="scss" scoped>
@@ -1,12 +1,13 @@
1
1
  <template>
2
- <div :class="{ 'has-logo': showLogo,telescopMenu:!isMenu }">
2
+ <div :class="{ 'has-logo': showLogo, telescopMenu: !isMenu }">
3
3
  <!-- <logo v-if="showLogo" :collapse="isCollapse" /> -->
4
4
 
5
5
  <div class="hamburger-box" ref="hamhurger" @click="openUserInfo">
6
6
  <!-- <hamburger :is-active="sidebar.opened" @toggleClick="toggleSideBar" /> -->
7
7
  <div>
8
8
  <p class="name">
9
- <i class="iconfont icon-ziyuan"></i><span>{{ userInfo.nickName }}</span>
9
+ <i class="iconfont icon-ziyuan"></i
10
+ ><span>{{ userInfo.nickName }}</span>
10
11
  </p>
11
12
  </div>
12
13
  </div>
@@ -57,7 +58,10 @@
57
58
  :content="$t1('获取提取码')"
58
59
  :placement="direction"
59
60
  >
60
- <i class="el-icon-setting" @click="showExtractedCodeCreateDialog = true" />
61
+ <i
62
+ class="el-icon-setting"
63
+ @click="showExtractedCodeCreateDialog = true"
64
+ />
61
65
  </el-tooltip>
62
66
  </div>
63
67
  <div class="item" v-if="isBdAdmin">
@@ -67,7 +71,10 @@
67
71
  :content="$t1('查看提取码')"
68
72
  :placement="direction"
69
73
  >
70
- <i class="el-icon-tickets" @click="showExtractedCodeQueryDialog = true" />
74
+ <i
75
+ class="el-icon-tickets"
76
+ @click="showExtractedCodeQueryDialog = true"
77
+ />
71
78
  </el-tooltip>
72
79
  </div>
73
80
 
@@ -99,7 +106,10 @@
99
106
  <i :class="getMenuClass(router2, 2)"></i
100
107
  ><span>{{ getMenuName(router2) }}</span>
101
108
  </div>
102
- <dl v-for="(router3, index3) in router2.children" :key="'router3' + index3">
109
+ <dl
110
+ v-for="(router3, index3) in router2.children"
111
+ :key="'router3' + index3"
112
+ >
103
113
  <div
104
114
  class="item"
105
115
  v-if="!router3.hidden"
@@ -125,8 +135,9 @@
125
135
  :collapse="!isMenu"
126
136
  >
127
137
  <el-scrollbar wrap-class="scrollbar-wrapper" id="menuUl">
128
- <el-submenu
138
+ <component
129
139
  v-for="menuModule in menuModules"
140
+ :is="getMenuType(menuModule)"
130
141
  :index="'' + menuModule.id"
131
142
  :key="'menuModule' + menuModule.id"
132
143
  @click.native="rourteTo(menuModule)"
@@ -135,25 +146,42 @@
135
146
  <i :class="getMenuClass(menuModule, 1)"></i>
136
147
  <span>{{ getMenuName(menuModule) }}</span>
137
148
  </template>
138
- <el-menu-item
139
- v-for="(router1, index1) in menuModule.children"
149
+ <component
150
+ v-for="(router2, index1) in menuModule.children"
151
+ :is="getMenuType(router2)"
140
152
  :key="index1"
141
- :index="'' + router1.id"
142
- :class="getMenuClass(router1, 2)"
143
- @mouseenter.native="showNav(router1, $event)"
153
+ :index="'' + router2.id"
154
+ @mouseenter.native="showNav(router2, $event)"
144
155
  @mouseleave.native="showNav()"
145
- @click="rourteTo(router1)"
156
+ @click="rourteTo(router2)"
146
157
  >
147
- {{ getMenuName(router1) }}
148
- <i class="el-icon-caret-right" v-if="router1.children.length > 0" />
149
- </el-menu-item>
150
- </el-submenu>
151
- <el-submenu @click.native="openCreateCompanyDialog" index="xx" v-if="isFormDev">
158
+ <template slot="title">
159
+ <i :class="getMenuClass(router2, 2)"></i>
160
+ <span>{{ getMenuName(router2) }}</span>
161
+ </template>
162
+ <el-menu-item
163
+ v-for="(router3, index3) in router2.children"
164
+ :key="index3"
165
+ :index="'' + router3.id"
166
+ @click="rourteTo(router3)"
167
+ >
168
+ <template slot="title">
169
+ <i :class="getMenuClass(router3, 3)"></i>
170
+ <span>{{ getMenuName(router3) }}</span>
171
+ </template>
172
+ </el-menu-item>
173
+ </component>
174
+ </component>
175
+ <el-menu-item
176
+ @click.native="openCreateCompanyDialog"
177
+ index="xx"
178
+ v-if="isFormDev"
179
+ >
152
180
  <template slot="title">
153
181
  <i :class="getMenuClass({}, 1)"></i>
154
182
  <span>新建企业</span>
155
183
  </template>
156
- </el-submenu>
184
+ </el-menu-item>
157
185
  </el-scrollbar>
158
186
  </el-menu>
159
187
  <div class="menu-btn">
@@ -270,8 +298,8 @@ export default {
270
298
  props: {
271
299
  option: Object,
272
300
  isMenu: {
273
- type: Boolean
274
- }
301
+ type: Boolean,
302
+ },
275
303
  },
276
304
  components: {
277
305
  userInfo,
@@ -373,6 +401,13 @@ export default {
373
401
  this.getBdEnv();
374
402
  },
375
403
  methods: {
404
+ getMenuType(item) {
405
+ if (item.children && item.children.length > 0) {
406
+ return "el-submenu";
407
+ } else {
408
+ return "el-menu-item";
409
+ }
410
+ },
376
411
  getBdEnv() {
377
412
  getBdFlag({
378
413
  success: (res) => {
@@ -436,7 +471,10 @@ export default {
436
471
  if (match) {
437
472
  const customReqUrl = decodeURIComponent(match[1]);
438
473
  // 移除匹配到的参数部分
439
- const newUrl = url.replace(match[0], match[0].startsWith("?") ? "?" : "");
474
+ const newUrl = url.replace(
475
+ match[0],
476
+ match[0].startsWith("?") ? "?" : ""
477
+ );
440
478
 
441
479
  return {
442
480
  custom_req_url: customReqUrl,
@@ -602,7 +640,9 @@ export default {
602
640
  // 异步树叶子节点懒加载逻辑
603
641
  loadNode(node, resolve) {
604
642
  let companyCode =
605
- node && node.data && node.data.companyCode ? node.data.companyCode || "" : "";
643
+ node && node.data && node.data.companyCode
644
+ ? node.data.companyCode || ""
645
+ : "";
606
646
  let url = !companyCode
607
647
  ? USER_PREFIX + "/user_company_info/getAllList"
608
648
  : USER_PREFIX + "/user_company_info/getChildren";
@@ -730,6 +770,7 @@ export default {
730
770
  this.showUserInfoDialog = true;
731
771
  },
732
772
  showNav(route, event) {
773
+ if (!this.isMenu) return;
733
774
  let id = route && route.id ? route.id : null;
734
775
  if (id != null) {
735
776
  if (!route.children || !route.children.length) {
@@ -742,7 +783,7 @@ export default {
742
783
  let dom = event.target;
743
784
  let domAttr = dom.getBoundingClientRect();
744
785
  // var sh1 = dom.offsetTop;
745
- var sh1 = domAttr.top;
786
+ var sh1 = domAttr.top + 10;
746
787
  let $snav = this.$refs["seconMenus" + id][0];
747
788
  let snavAttr = $snav.getBoundingClientRect();
748
789
 
@@ -755,10 +796,11 @@ export default {
755
796
  if (sh >= 0) {
756
797
  $snav.style["margin-top"] = sh1 + "px";
757
798
  } else if (sh < 0) {
758
- let bd = sh1 + sh;
799
+ let bd = sh1 + sh ;
759
800
 
760
801
  $snav.style["margin-top"] = bd + "px";
761
- $snav.querySelector(".ico-arrow").style["margin-top"] = sh1 - bd + "px";
802
+ $snav.querySelector(".ico-arrow").style["margin-top"] =
803
+ sh1 - bd + "px";
762
804
  }
763
805
  });
764
806
  } else {
@@ -848,7 +890,6 @@ export default {
848
890
  font-size: 12px;
849
891
  color: rgba(255, 255, 255, 0.65);
850
892
 
851
-
852
893
  > div {
853
894
  color: #fff;
854
895
  font-size: 13px;
@@ -916,7 +957,12 @@ export default {
916
957
  text-align: center;
917
958
 
918
959
  p {
919
- margin: 0;display: -webkit-box; overflow: hidden; text-overflow: ellipsis; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
960
+ margin: 0;
961
+ display: -webkit-box;
962
+ overflow: hidden;
963
+ text-overflow: ellipsis;
964
+ -webkit-line-clamp: 2;
965
+ -webkit-box-orient: vertical;
920
966
  }
921
967
  }
922
968
 
@@ -1053,16 +1099,66 @@ export default {
1053
1099
  &.is-opened .el-submenu__title {
1054
1100
  //background-color: rgba(27, 66, 97) !important;
1055
1101
  }
1102
+ .el-submenu .el-menu{display:none}
1056
1103
  }
1057
1104
 
1058
1105
  .el-submenu {
1106
+ &.is-opened{
1107
+ > .el-submenu__title{background-color:rgba(0, 0, 0, 0.29) !important}
1108
+ }
1059
1109
  .el-menu {
1060
1110
  background: rgba(0, 0, 0, 0.35) !important;
1061
1111
  box-shadow: 0px -5px 8px #00000014 inset;
1062
1112
  //padding:4px 0;
1113
+ .el-submenu__title{
1114
+ height: auto;
1115
+ line-height: 1.4;
1116
+ font-size: 12px;
1117
+ opacity: 0.8;
1118
+ margin: 10px 0 10px 14px;
1119
+ padding: 7px 2px 7px 33px !important;
1120
+ border-radius: 8px;
1121
+ text-align: left;
1122
+ min-width: 81px !important;
1123
+ white-space: normal;
1124
+ margin-right: 10px;
1125
+ word-break: break-word;
1126
+ i.iconfont {
1127
+ position: absolute;
1128
+ top: 50%;
1129
+ height: 20px;
1130
+ margin-top: -10px;
1131
+ line-height: 20px;
1132
+ left: 7px;
1133
+ font-size: 18px;
1134
+ }
1135
+
1136
+ [class^="el-icon-"] {
1137
+ font-size: 12px;
1138
+ color: #fff;
1139
+ position: absolute;
1140
+ right: 2px;
1141
+ top: 50%;
1142
+ margin-top: -5px;
1143
+ width: 14px;
1144
+ zoom: 0.8;
1145
+ display: none;
1146
+ }
1147
+ span{height:auto;text-align: left !important;}
1148
+ &:hover,
1149
+ &.on {
1150
+ opacity: 1;
1151
+ background-color: #fbfdfe !important;
1152
+ color: $baseColor !important;
1153
+ i.iconfont{color:$baseColor}
1154
+ .el-icon-arrow-right {
1155
+ color: $baseColor;
1156
+ }
1157
+ }
1158
+ }
1063
1159
  }
1064
1160
 
1065
- .el-menu-item {
1161
+ .el-menu-item{
1066
1162
  height: auto;
1067
1163
  line-height: 1.4;
1068
1164
  padding-left: 33px !important;
@@ -1077,7 +1173,7 @@ export default {
1077
1173
  margin-right: 10px;
1078
1174
  word-break: break-word;
1079
1175
 
1080
- &:before {
1176
+ i.iconfont {
1081
1177
  position: absolute;
1082
1178
  top: 50%;
1083
1179
  height: 20px;
@@ -1085,6 +1181,7 @@ export default {
1085
1181
  line-height: 20px;
1086
1182
  left: 7px;
1087
1183
  font-size: 18px;
1184
+ color:#D0D6DB;
1088
1185
  }
1089
1186
 
1090
1187
  [class^="el-icon-"] {
@@ -1097,6 +1194,7 @@ export default {
1097
1194
  width: 14px;
1098
1195
  zoom: 0.8;
1099
1196
  display: none;
1197
+
1100
1198
  }
1101
1199
 
1102
1200
  &:hover,
@@ -1105,7 +1203,7 @@ export default {
1105
1203
  background-color: #fbfdfe !important;
1106
1204
  color: $baseColor !important;
1107
1205
 
1108
- .el-icon-arrow-right {
1206
+ .el-icon-arrow-right,i.iconfont {
1109
1207
  color: $baseColor;
1110
1208
  }
1111
1209
  }
@@ -1429,4 +1527,51 @@ export default {
1429
1527
  // .el-submenu .el-menu {
1430
1528
  // height: auto !important;
1431
1529
  // }
1530
+ .el-menu--vertical{
1531
+ > .el-menu--popup{overflow: hidden;
1532
+ > .el-submenu,> .el-menu-item{
1533
+ .el-submenu__title{
1534
+ height: auto;
1535
+ line-height: 1.4;
1536
+ opacity: 0.8;
1537
+ margin: 10px 0 10px 14px;
1538
+ padding: 7px 2px 7px 12px !important;
1539
+ border-radius: 8px;
1540
+ text-align: left;
1541
+ min-width: 81px !important;
1542
+ white-space: normal;
1543
+ margin-right: 10px;
1544
+ word-break: break-word;
1545
+ &:hover{
1546
+ background:#FFF;
1547
+ i.iconfont{color:$baseColor}
1548
+ }
1549
+ }
1550
+ &.is-opened{
1551
+ > .el-submenu__title{background-color:#FFF !important;opacity: 1;
1552
+ span{color:$baseColor}
1553
+ i.iconfont{color:$baseColor}
1554
+ }
1555
+ }
1556
+ }
1557
+
1558
+ }
1559
+ .el-submenu,.el-menu-item {
1560
+ .el-submenu__title{
1561
+ height:36px;line-height:36px;
1562
+ .el-submenu__icon-arrow{display:none}
1563
+
1564
+ &:hover{background:#16344D;
1565
+
1566
+ }
1567
+ }
1568
+ &:hover{
1569
+ > i.iconfont{color:$baseColor}
1570
+ }
1571
+ i.iconfont{color:#FFF;margin-right:8px;}
1572
+ &.is-opened{
1573
+ .el-submenu__title{background-color:rgba(0, 0, 0, 0.29) !important}
1574
+ }
1575
+ }
1576
+ }
1432
1577
  </style>