bri-components 1.1.2 → 1.1.4

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 (158) hide show
  1. package/lib/0.bri-components.min.js +1 -1
  2. package/lib/1.bri-components.min.js +1 -1
  3. package/lib/10.bri-components.min.js +1 -0
  4. package/lib/2.bri-components.min.js +1 -1
  5. package/lib/3.bri-components.min.js +1 -1
  6. package/lib/4.bri-components.min.js +1 -1
  7. package/lib/5.bri-components.min.js +1 -1
  8. package/lib/6.bri-components.min.js +1 -1
  9. package/lib/7.bri-components.min.js +1 -1
  10. package/lib/8.bri-components.min.js +1 -1
  11. package/lib/9.bri-components.min.js +1 -1
  12. package/lib/bri-components.min.js +6 -6
  13. package/lib/styles/bri-components.css +1 -1
  14. package/package.json +1 -1
  15. package/src/abolish/DshCascaders.less +11 -0
  16. package/src/{components/controls/base/DshCascaderMultiple.vue → abolish/DshCascaders.vue} +17 -27
  17. package/src/{components/list → abolish}/DshFlatTable.vue +1 -1
  18. package/src/abolish/DshTexts.less +13 -0
  19. package/src/{components/controls/base/textMultiple/DshTextMultiple.vue → abolish/DshTexts.vue} +17 -25
  20. package/src/components/controls/base/{textMultiple/MultipleInput.vue → BriInputs.vue} +18 -17
  21. package/src/components/controls/base/{ZUpload/YUploadImage.vue → BriUpload/BriUploadImage.vue} +56 -15
  22. package/src/components/controls/base/{ZUpload → BriUpload}/index.vue +24 -21
  23. package/src/components/controls/base/{ZUpload → BriUpload}/upload-list.vue +20 -13
  24. package/src/components/controls/base/{ZUpload → BriUpload}/uploadMixin.js +7 -3
  25. package/src/components/controls/base/{DshCascader.vue → DshCascader/DshCascader.vue} +33 -26
  26. package/src/components/controls/base/DshCheckbox.vue +17 -20
  27. package/src/components/controls/base/DshCoordinates.vue +119 -110
  28. package/src/components/controls/base/DshDate.vue +24 -37
  29. package/src/components/controls/base/DshDaterange.vue +3 -1
  30. package/src/components/controls/base/DshEditor.vue +73 -60
  31. package/src/components/controls/base/DshInput.vue +72 -60
  32. package/src/components/controls/base/DshNumber/BriInputNumber/BriInputNumber.vue +1 -1
  33. package/src/components/controls/base/DshNumber/DshNumber.vue +52 -48
  34. package/src/components/controls/base/DshNumberange.vue +11 -21
  35. package/src/components/controls/base/DshSelect.vue +13 -17
  36. package/src/components/controls/controlMap.js +12 -11
  37. package/src/components/controls/controlMixin.js +40 -29
  38. package/src/components/controls/controlShow.vue +44 -0
  39. package/src/components/controls/{base → senior}/BriLabels.vue +7 -12
  40. package/src/components/controls/{base → senior}/DshPackage.vue +6 -25
  41. package/src/components/controls/senior/cascaderTable.vue +52 -51
  42. package/src/components/controls/senior/flatTable.vue +20 -17
  43. package/src/components/controls/{base → special}/DshBack.vue +4 -4
  44. package/src/components/controls/{base → special}/DshUndeveloped.vue +3 -1
  45. package/src/components/form/DshAdvSearchForm.vue +10 -1
  46. package/src/components/form/DshForm.vue +10 -3
  47. package/src/components/list/BriFlatTable.vue +5 -5
  48. package/src/components/list/BriTable.vue +6 -8
  49. package/src/components/list/DshBox/DshBox.vue +7 -24
  50. package/src/components/list/DshBox/DshCard.vue +15 -74
  51. package/src/components/list/DshBox/DshCrossTable.vue +4 -8
  52. package/src/components/list/DshBox/DshList.vue +8 -136
  53. package/src/components/list/DshBox/DshPanel.vue +0 -110
  54. package/src/components/list/DshBox/DshTable.vue +1 -4
  55. package/src/components/list/DshCascaderTable.vue +1 -1
  56. package/src/components/list/ZTree.vue +0 -58
  57. package/src/components/other/ZIframe.vue +5 -0
  58. package/src/components/small/DshControlDefine.vue +6 -2
  59. package/src/components/small/DshModal.vue +0 -134
  60. package/src/components/small/DshPage.vue +1 -0
  61. package/src/components/unit/DshFormItem.vue +7 -10
  62. package/src/components/unit/DshUnit.vue +1 -11
  63. package/src/components/unit/unitMixin.js +8 -5
  64. package/src/index.js +16 -33
  65. package/src/styles/common/control.less +63 -27
  66. package/src/styles/components/controls/{MultipleInput.less → BriInputs.less} +1 -1
  67. package/src/styles/components/controls/BriLabels.less +4 -2
  68. package/src/styles/components/controls/{ZUpload.less → BriUpload.less} +5 -6
  69. package/src/styles/components/controls/DshCheckbox.less +45 -42
  70. package/src/styles/components/controls/DshCoordinates.less +66 -59
  71. package/src/styles/components/controls/DshDate.less +1 -52
  72. package/src/styles/components/controls/DshEditor.less +51 -34
  73. package/src/styles/components/controls/DshInput.less +13 -34
  74. package/src/styles/components/controls/DshNumber.less +51 -0
  75. package/src/styles/components/controls/DshNumberange.less +8 -3
  76. package/src/styles/components/controls/DshSelect.less +78 -92
  77. package/src/styles/components/{other → controls}/InfoCascader.less +4 -4
  78. package/src/styles/components/controls/cascaderTable.less +10 -24
  79. package/src/styles/components/controls/controlShow.less +3 -1
  80. package/src/styles/components/controls/flatTable.less +10 -23
  81. package/src/styles/components/form/DshAdvSearchForm.less +0 -9
  82. package/src/styles/components/form/DshDefaultSearch.less +0 -20
  83. package/src/styles/components/index.less +24 -17
  84. package/src/styles/components/list/DshBox/DshBox.less +20 -0
  85. package/src/styles/components/list/DshBox/DshCard.less +59 -0
  86. package/src/styles/components/list/DshBox/DshList.less +142 -0
  87. package/src/styles/components/list/DshBox/DshPanel.less +107 -0
  88. package/src/styles/components/list/DshBox/DshTable.less +4 -0
  89. package/src/styles/components/list/ZTree.less +52 -0
  90. package/src/styles/components/small/DshControlDefine.less +4 -7
  91. package/src/styles/components/small/DshDropdown.less +1 -0
  92. package/src/styles/components/small/DshModal.less +207 -0
  93. package/src/styles/components/unit/DshFormItem.less +2 -0
  94. package/src/styles/reset.less +14 -0
  95. package/src/styles/variables.less +1 -0
  96. package/src/utils/table.js +5 -4
  97. package/src/components/controls/base/DshLabels.vue +0 -309
  98. package/src/components/controls/base/YSerialNumber.vue +0 -36
  99. package/src/components/controls/base/controlShow.vue +0 -52
  100. package/src/components/list/easyTable/index.js +0 -23
  101. package/src/components/list/easyTable/src/directives/clickoutside.js +0 -32
  102. package/src/components/list/easyTable/src/mixins/layerAdjustment.js +0 -62
  103. package/src/components/list/easyTable/src/settings/settings.js +0 -11
  104. package/src/components/list/easyTable/src/utils/deepClone.js +0 -256
  105. package/src/components/list/easyTable/src/utils/dom.js +0 -41
  106. package/src/components/list/easyTable/src/utils/utils.js +0 -190
  107. package/src/components/list/easyTable/v-checkbox/index.js +0 -7
  108. package/src/components/list/easyTable/v-checkbox/src/checkbox.vue +0 -127
  109. package/src/components/list/easyTable/v-checkbox-group/index.js +0 -7
  110. package/src/components/list/easyTable/v-checkbox-group/src/checkbox-group.vue +0 -68
  111. package/src/components/list/easyTable/v-dropdown/index.js +0 -7
  112. package/src/components/list/easyTable/v-dropdown/src/dropdown.vue +0 -337
  113. package/src/components/list/easyTable/v-table/index.js +0 -7
  114. package/src/components/list/easyTable/v-table/src/body-cell-merge-mixin.js +0 -141
  115. package/src/components/list/easyTable/v-table/src/cell-edit-mixin.js +0 -102
  116. package/src/components/list/easyTable/v-table/src/checkbox-selection-mixin.js +0 -189
  117. package/src/components/list/easyTable/v-table/src/classes-mixin.js +0 -56
  118. package/src/components/list/easyTable/v-table/src/drag-width-mixin.js +0 -202
  119. package/src/components/list/easyTable/v-table/src/export-csv.js +0 -74
  120. package/src/components/list/easyTable/v-table/src/frozen-columns-mixin.js +0 -134
  121. package/src/components/list/easyTable/v-table/src/loading.vue +0 -49
  122. package/src/components/list/easyTable/v-table/src/scroll-bar-control-mixin.js +0 -21
  123. package/src/components/list/easyTable/v-table/src/scroll-control-mixin.js +0 -92
  124. package/src/components/list/easyTable/v-table/src/sort-control-mixin.js +0 -108
  125. package/src/components/list/easyTable/v-table/src/table-empty-mixin.js +0 -73
  126. package/src/components/list/easyTable/v-table/src/table-empty.vue +0 -66
  127. package/src/components/list/easyTable/v-table/src/table-filters-mixin.js +0 -126
  128. package/src/components/list/easyTable/v-table/src/table-footer-mixin.js +0 -122
  129. package/src/components/list/easyTable/v-table/src/table-resize-mixin.js +0 -279
  130. package/src/components/list/easyTable/v-table/src/table-row-mouse-events-mixin.js +0 -123
  131. package/src/components/list/easyTable/v-table/src/table.vue +0 -1565
  132. package/src/components/list/easyTable/v-table/src/title-cell-merge-mixin.js +0 -115
  133. package/src/components/list/evTable/EvTable.vue +0 -321
  134. package/src/components/list/evTable/EvTableMixin.js +0 -26
  135. package/src/styles/components/controls/DshLabels.less +0 -187
  136. package/src/styles/components/list/evTable.less +0 -79
  137. package/src/styles/components/list/evtable/animation.less +0 -141
  138. package/src/styles/components/list/evtable/font/fontello.eot +0 -0
  139. package/src/styles/components/list/evtable/font/fontello.svg +0 -32
  140. package/src/styles/components/list/evtable/font/fontello.ttf +0 -0
  141. package/src/styles/components/list/evtable/font/fontello.woff +0 -0
  142. package/src/styles/components/list/evtable/font/fontello.woff2 +0 -0
  143. package/src/styles/components/list/evtable/fontello.less +0 -68
  144. package/src/styles/components/list/evtable/index.less +0 -5
  145. package/src/styles/components/list/evtable/v-checkbox.less +0 -167
  146. package/src/styles/components/list/evtable/v-dropdown.less +0 -235
  147. package/src/styles/components/list/evtable/v-table.less +0 -334
  148. package/src/styles/components/list/ivu_reset.less +0 -49
  149. /package/src/{styles/components/list → abolish}/DshFlatTable.less +0 -0
  150. /package/src/components/{pages/Error → Error}/Error403.vue +0 -0
  151. /package/src/components/{pages/Error → Error}/Error404.vue +0 -0
  152. /package/src/components/{pages/Error → Error}/Error500.vue +0 -0
  153. /package/src/components/{pages/Error → Error}/error.less +0 -0
  154. /package/src/components/{pages/Error → Error}/errorBack.vue +0 -0
  155. /package/src/components/controls/base/{ZUpload → BriUpload}/upload-listItem.vue +0 -0
  156. /package/src/components/{other → controls/base/DshCascader}/InfoCascader.vue +0 -0
  157. /package/src/styles/components/list/{DshCrossTable.less → DshBox/DshCrossTable.less} +0 -0
  158. /package/src/styles/components/list/{DshSingleData.less → DshBox/DshSingleData.less} +0 -0
@@ -0,0 +1,207 @@
1
+ .DshModal {
2
+ &-header {
3
+ width: 100%;
4
+ height: 100%;
5
+ }
6
+ &-close {
7
+ padding: 2px;
8
+ position: absolute;
9
+ top: 10px;
10
+ right: 10px;
11
+ cursor: pointer;
12
+ }
13
+
14
+ &-default,
15
+ &-middle,
16
+ &-large,
17
+ &-small {
18
+ .ivu-modal-wrap {
19
+ .ivu-modal {
20
+ margin: auto;
21
+ position: absolute;
22
+ top: 0px;
23
+ bottom: 0px;
24
+ left: 0px;
25
+ right: 0px;
26
+ .ivu-modal-content {
27
+ width: 100%;
28
+ height: 100%;
29
+ display: flex;
30
+ flex-direction: column;
31
+ .ivu-modal-close {}
32
+
33
+ .ivu-modal-header {
34
+ width: 100%;
35
+ height: 44px;
36
+ padding: 10px 40px 10px 16px;
37
+ }
38
+ .ivu-modal-body {
39
+ width: 100%;
40
+ flex: 1;
41
+ min-height: 200px;
42
+ padding: 0px;
43
+ overflow: auto;
44
+ }
45
+ .ivu-modal-footer {
46
+ width: 100%;
47
+ height: 50px;
48
+ }
49
+ }
50
+ }
51
+ }
52
+ }
53
+
54
+ &-default {
55
+ .ivu-modal-wrap {
56
+ .ivu-modal {
57
+ width: 750px !important;
58
+ height: 550px !important;
59
+ max-height: 100%;
60
+ max-width: 100%;
61
+ }
62
+ }
63
+ }
64
+ &-small {
65
+ .ivu-modal-wrap {
66
+ .ivu-modal {
67
+ // width: 500px !important;
68
+ height: 400px !important;
69
+ max-height: 100%;
70
+ max-width: 100%;
71
+ .ivu-modal-content{
72
+ .DshModal-close {
73
+ top: 20px;
74
+ right: 24px;
75
+ color: rgba(0,0,0,0.6);
76
+ font-size: 16px!important;
77
+ }
78
+
79
+ .ivu-modal-header {
80
+ width: 100%;
81
+ height: 44px;
82
+ padding: 20px 24px 0px 24px;
83
+ border-bottom: none;
84
+ &-inner {
85
+ color: rgba(0,0,0,0.9);
86
+ font-size: 16px;
87
+ font-weight: 500;
88
+ line-height: 24px;
89
+ height: 24px;
90
+ }
91
+ }
92
+ .ivu-modal-body {
93
+ padding: 16px 24px 20px;
94
+ }
95
+ }
96
+ }
97
+ }
98
+ }
99
+ &-middle {
100
+ .ivu-modal-wrap {
101
+ .ivu-modal {
102
+ width: 1000px !important;
103
+ height: 800px !important;
104
+ max-height: 100%;
105
+ max-width: 100%;
106
+ }
107
+ }
108
+ }
109
+ &-large {
110
+ .ivu-modal-wrap {
111
+ .ivu-modal {
112
+ width: 80% !important;
113
+ height: 90% !important;
114
+ min-width: 1000px !important;
115
+ max-height: 100%;
116
+ max-width: 100%;
117
+ }
118
+ }
119
+ }
120
+ &-auto {
121
+ .ivu-modal-wrap {
122
+ display: flex;
123
+ align-items: center;
124
+ justify-content: center;
125
+ .ivu-modal {
126
+ top: 0px;
127
+ max-height: 100%;
128
+ }
129
+ }
130
+ }
131
+ }
132
+
133
+ .bri-modal-flex {
134
+ display: flex;
135
+ align-items: center;
136
+ justify-content: center;
137
+
138
+ .ivu-modal {
139
+ top: 0px
140
+ }
141
+
142
+ .ivu-modal-content {
143
+ height: 100%;
144
+ display: flex;
145
+ flex-direction: column;
146
+ }
147
+
148
+ .ivu-modal-body {
149
+ flex: 1;
150
+ overflow: auto;
151
+ padding: 0px;
152
+ }
153
+ }
154
+
155
+ // 默认模态框brimodal
156
+ .bri-modal {
157
+ .ivu-modal-header {
158
+ padding: 14px 36px;
159
+
160
+ .ivu-modal-header-inner {
161
+ color: @titleColor;
162
+ font-size: @titleSize;
163
+ font-weight: bold;
164
+ }
165
+ }
166
+
167
+ .ivu-modal-body {
168
+ padding: 16px;
169
+ }
170
+
171
+ .ivu-modal-footer {
172
+ display: flex;
173
+ justify-content: space-between;
174
+ padding: 20px;
175
+
176
+ button {
177
+ width: 48%;
178
+ height: 44px;
179
+ line-height: 44px;
180
+ }
181
+ }
182
+
183
+ &-content {
184
+ padding: 20px 0;
185
+ }
186
+
187
+ &-footer {
188
+ display: flex;
189
+ justify-content: space-between;
190
+ padding: 20px 0;
191
+
192
+ button {
193
+ flex: 1;
194
+ margin: 0 10px;
195
+ height: 44px;
196
+ line-height: 44px;
197
+
198
+ &:first-child {
199
+ margin-left: 0;
200
+ }
201
+
202
+ &:last-child {
203
+ margin-right: 0;
204
+ }
205
+ }
206
+ }
207
+ }
@@ -42,6 +42,8 @@
42
42
 
43
43
  &-name {
44
44
  font-size: @textSize;
45
+ .dsh-ellipsis();
46
+
45
47
  &-edit {
46
48
  color: @textColor;
47
49
  }
@@ -60,6 +60,20 @@ li {
60
60
  }
61
61
  }
62
62
 
63
+ .bri-scrollbar3 {
64
+ overflow: auto;
65
+ &::-webkit-scrollbar {
66
+ width: 6px;
67
+ height: 6px;
68
+ }
69
+
70
+ &:-webkit-scrollbar-thumb {
71
+ border-radius: 3px;
72
+ background: rgba(51, 51, 51, .1);
73
+ background-clip: border-box;
74
+ }
75
+ }
76
+
63
77
  .dsh-scrollbar3::-webkit-scrollbar {
64
78
  height: 3px;
65
79
  width: 3px;
@@ -11,6 +11,7 @@
11
11
 
12
12
  // 背景色
13
13
  @bgColor : #F5F5F5;
14
+ @hoverBg : #F0F0F0;
14
15
  @white : #FFF;
15
16
  @black : #000;
16
17
 
@@ -1,6 +1,7 @@
1
1
  /* -------------------- 表格 -------------- */
2
2
  // 转化表单字段属性 to 表格参数, 是否需要过滤tag
3
3
  const transformToColumns = function (form) {
4
+ let headerFilter = this.listPropsObj && this.listPropsObj.headerFilter;
4
5
  return form
5
6
  .filter(col => col._type !== "tag")
6
7
  .map(col => {
@@ -12,7 +13,7 @@ const transformToColumns = function (form) {
12
13
  key: col._key,
13
14
  align: col._align || typeData.align,
14
15
  width: col._width || typeData.width,
15
- sortBy: col._sortBy || typeData.sortBy,
16
+ sortBy: headerFilter ? col._sortBy || typeData.sortBy : undefined,
16
17
 
17
18
  ...(
18
19
  col._type
@@ -36,7 +37,7 @@ const transformToColumns = function (form) {
36
37
  renderBodyCell: ({ row, column, rowIndex }, h) => {
37
38
  return h("dsh-unit", {
38
39
  props: {
39
- isUnit: true,
40
+ canEdit: false,
40
41
  rowIndex: rowIndex,
41
42
  formData: row,
42
43
  formItem: col
@@ -49,7 +50,7 @@ const transformToColumns = function (form) {
49
50
  ...(
50
51
  ["select", "checkbox"].includes(col._type)
51
52
  ? {
52
- filter: {
53
+ filter: headerFilter ? {
53
54
  isMultiple: true,
54
55
  maxHeight: 300,
55
56
  filterList: col._data.map(item => ({
@@ -78,7 +79,7 @@ const transformToColumns = function (form) {
78
79
  };
79
80
  this.filterReset && this.filterReset(conditionItem);
80
81
  }
81
- }
82
+ } : null
82
83
  }
83
84
  : {}
84
85
  ),
@@ -1,309 +0,0 @@
1
- <!-- 动态标签 -->
2
- <template>
3
- <div
4
- ref="dshLabelsRef"
5
- class="DshLabels"
6
- >
7
- <!-- 编辑 -->
8
- <template v-if="canEdit">
9
- <!-- 编辑区 -->
10
- <Input
11
- v-show="status === 'edit'"
12
- v-model="curVal"
13
- ref="dshLabelsInput"
14
- class="DshLabels-input"
15
- type="text"
16
- :icon="selfPropsObj._inputIcon"
17
- :placeholder="selfPropsObj._placeholder"
18
- :disabled="!finalCanEdit"
19
- @on-enter="onClick"
20
- @on-click="onClick"
21
- @on-change="onChange"
22
- @on-focus="onChange"
23
- ></Input>
24
-
25
- <!-- 查看区 -->
26
- <div
27
- v-show="status === 'show'"
28
- :class="{
29
- 'DshLabels-show':true,
30
- 'DshLabels-showReadOnly':!finalCanEdit
31
- }"
32
- @click="clickAdd"
33
- >
34
- <div
35
- class="DshLabels-show-content"
36
- @click="clickAdd"
37
- >
38
- <span
39
- v-for="labelItem in val"
40
- :key="labelItem._key"
41
- class="DshLabels-show-content-item"
42
- >
43
- <span
44
- class="DshLabels-show-content-item-content"
45
- :title="labelItem.name"
46
- @click.stop="clickEdit(labelItem)"
47
- >
48
- {{ labelItem.name }}
49
- </span>
50
- <Icon
51
- class="DshLabels-show-content-item-del"
52
- type="ios-close"
53
- size="20"
54
- @click.stop="clickDelete(labelItem)"
55
- />
56
- </span>
57
- </div>
58
- <div
59
- v-if="canEdit"
60
- class="DshLabels-show-add"
61
- >
62
- <Icon
63
- type="md-create"
64
- @click="clickAdd"
65
- />
66
- </div>
67
-
68
- </div>
69
-
70
- <!-- 数据选择区:接口依据用户输入返回数据 -->
71
- <div
72
- v-if="ShowTagList"
73
- ref="searchResultRef"
74
- class="DshLabels-searchResult"
75
- :style="{
76
- width: getStyle()
77
- }"
78
- >
79
- <Icon
80
- type="md-close"
81
- class="DshLabels-searchResult-close"
82
- @click="closeTagList"
83
- />
84
- <ul
85
- v-if="list&&list.length>0"
86
- class="DshLabels-searchResult-list"
87
- >
88
- <li
89
- v-for="item in list"
90
- :key="item._id"
91
- :class="{'selected':item.selected}"
92
- @click="clickTag(item)"
93
- >{{ item.name }}
94
- </li>
95
- </ul>
96
- <div
97
- v-else
98
- class="DshLabels-searchResult-nodata"
99
- >
100
- 无匹配数据
101
- </div>
102
- </div>
103
- </template>
104
-
105
- <!-- 查看 -->
106
- <div
107
- v-else
108
- :class="{'DshLabels-view':true,
109
- 'DshLabels-view-readonly': $isReadonly(canEdit, selfPropsObj),
110
- 'DshLabels-view-disabled': $isDisabled(canEdit, selfPropsObj),
111
- }"
112
- >
113
- <template v-if="val.length">
114
- <Tag
115
- v-for="tagItem in val"
116
- :key="tagItem._key"
117
- size="medium"
118
- class="DshLabels-view-tag"
119
- >
120
- {{ tagItem.name }}
121
- </Tag>
122
- </template>
123
-
124
- <div
125
- v-else
126
- class="DshLabels-view-nodata"
127
- >
128
- <template v-if="isUnit">
129
- -
130
- </template>
131
- <template v-else>
132
- 暂无内容
133
- </template>
134
- </div>
135
- </div>
136
- </div>
137
- </template>
138
-
139
- <script>
140
- import controlMixin from "../controlMixin.js";
141
-
142
- export default {
143
- name: "DshLabels",
144
- mixins: [controlMixin],
145
-
146
- data () {
147
- return {
148
- status: "", // edit/show
149
- curVal: "",
150
- curKey: "", // 当前正在修改label的_key
151
- ShowTagList: false,
152
- list: []
153
- };
154
- },
155
- computed: {
156
- selfPropsObj () {
157
- return {
158
- ...this.propsObj,
159
- ...this.commonDealPropsObj,
160
- _inputIcon: !this.propsObj._onlySelect ? "md-add" : ""
161
- };
162
- },
163
- modKey () {
164
- return this.propsObj.modKey;
165
- },
166
- val: {
167
- get () {
168
- return this.value[this.propsObj._key] || [];
169
- },
170
- set (val) {
171
- this.value[this.propsObj._key] = val;
172
- }
173
- }
174
- },
175
- created () {
176
- this.init();
177
- },
178
- methods: {
179
- init () {
180
- this.status = this.canEdit && !this.val.length
181
- ? "edit"
182
- : "show";
183
-
184
- },
185
- // 确认输入
186
- onClick () {
187
- if (this.finalCanEdit && !this.selfPropsObj._onlySelect) {
188
- if (this.curVal.trim().length > 0) {
189
- this.status = "show";
190
- let labelItem = {_key: "", name: ""};
191
- labelItem._key = this.curKey || this.$randomB36("Labels");
192
- labelItem.name = this.curVal.trim();
193
- labelItem.labelType = this.selfPropsObj._labelType;
194
- this.val = this.val.concat([labelItem]);
195
- this.ShowTagList = false;
196
- this.change();
197
- } else {
198
- this.status = "show";
199
- this.ShowTagList = false;
200
- }
201
- }
202
- },
203
- onChange () {
204
- this.getListData();
205
- },
206
- getListData () {
207
- this.$https({
208
- url: {
209
- module: "sheet",
210
- name: "memberAll"
211
- },
212
- params: {
213
- search: {
214
- entityKey: this.entityKey, // 当前工作表关联的数据表Key
215
- modKey: this.modKey,
216
- name: this.curVal,
217
- fieldKey: this.selfPropsObj._key === "_default" ? this.value._key : (this.selfPropsObj.__realKey__ || this.selfPropsObj._key), // 当前字段Key
218
- labelType: this.selfPropsObj._labelType
219
- },
220
- pagination: {
221
- page: 1,
222
- pagesize: 999
223
- }
224
- },
225
- callback: data => {
226
- // 当前已选择的标签
227
- let keysArr = this.val.map(item => item._key);
228
- if (data.list.length > 0) {
229
- this.list = data.list.map(item => ({
230
- ...item,
231
- selected: !!keysArr.includes(item._key)
232
- }));
233
- } else {
234
- this.list = [];
235
- }
236
- this.ShowTagList = true;
237
- // this.ShowTagList = !this.ShowTagList;
238
- }
239
- });
240
- },
241
- clickTag (item) {
242
- if (this.finalCanEdit) {
243
- this.status = "show";
244
- let keysArr = this.val.map(i => i._key);
245
- if (!keysArr.includes(item._key)) {
246
- this.val = this.val.concat(this.list.filter(listItem => listItem._key == item._key));
247
- this.ShowTagList = false;
248
- this.change();
249
- } else {
250
- this.ShowTagList = false;
251
- this.status = "show";
252
- this.curVal = "";
253
- }
254
- }
255
- },
256
- clickEdit (labelItem) {
257
- if (this.finalCanEdit) {
258
- this.status = "edit";
259
- this.curVal = labelItem.name;
260
- this.curKey = labelItem._key;
261
- this.val = this.val.filter(i => i._key != labelItem._key);
262
- }
263
- },
264
- // 切换为输入框编辑模式
265
- clickAdd () {
266
- if (this.finalCanEdit) {
267
- this.status = "edit";
268
- this.curVal = "";
269
- this.$nextTick(() => {
270
- this.$refs.dshLabelsInput.focus({
271
- cursor: "start"
272
- });
273
- });
274
-
275
- this.$debounce(this.getListData(), 100);
276
- }
277
- },
278
- clickDelete (labelItem) {
279
- if (this.finalCanEdit) {
280
- this.val = this.val.filter(i => i._key != labelItem._key);
281
-
282
- if (!this.val.length) {
283
- this.curVal = "";
284
- this.status = "edit";
285
- this.change();
286
- }
287
- this.change();
288
- }
289
- },
290
- closeTagList () {
291
- this.ShowTagList = false;
292
- this.status = "show";
293
- },
294
- getStyle () {
295
- this.$nextTick(() => {
296
- this.$refs.searchResultRef.style.width = `${this.$refs.dshLabelsRef.offsetWidth}px`;
297
- this.$refs.searchResultRef.style.top = `${this.$refs.dshLabelsRef.getBoundingClientRect().top + 34}px`;
298
- });
299
- }
300
- },
301
- watch: {
302
- value (newVal, oldVal) {
303
- if (newVal !== oldVal) {
304
- this.init();
305
- }
306
- }
307
- }
308
- };
309
- </script>
@@ -1,36 +0,0 @@
1
- <template>
2
- <div class="YSerialNumber">
3
- <dsh-input
4
- :value="value"
5
- :propsObj="propsObj"
6
- :canEdit="false"
7
- ></dsh-input>
8
- </div>
9
- </template>
10
-
11
- <script>
12
- import controlMixin from "../controlMixin.js";
13
-
14
- export default {
15
- name: "YSerialNumber",
16
- mixins: [controlMixin],
17
- props: {},
18
- data () {
19
- return {};
20
- },
21
- computed: {},
22
- created () {},
23
- methods: {}
24
- };
25
- </script>
26
-
27
- <style lang="less" scoped>
28
- .YSerialNumber {
29
- width: 100%;
30
- }
31
- </style>
32
- <style lang="less">
33
- .YSerialNumber {
34
-
35
- }
36
- </style>
@@ -1,52 +0,0 @@
1
- <template>
2
- <div class="controlShow">
3
- <Ctooltip
4
- :transfer="true"
5
- maxWidth="200"
6
- :content="showVal"
7
- >
8
- <div
9
- v-if="$isFormItemHasData(showVal)"
10
- class="dsh-ellipsis controlShow-val"
11
- >
12
- {{ showVal }}
13
- </div>
14
- <div
15
- v-else
16
- class="controlShow-nodata dsh-ellipsis"
17
- >
18
- {{noDataText}}
19
- </div>
20
- </Ctooltip>
21
- </div>
22
- </template>
23
-
24
- <script>
25
-
26
- export default {
27
- name: "controlShow",
28
- props: {
29
- showVal: String,
30
- propsObj: {
31
- type: Object,
32
- default: () => {
33
- return {};
34
- }
35
- },
36
- isUnit: Boolean
37
- },
38
- data () {
39
- return {
40
- };
41
- },
42
- computed: {
43
- noDataText () {
44
- return this.isUnit ? "-" : "暂无内容";
45
- }
46
- },
47
- created () {
48
- },
49
- methods: {
50
- }
51
- };
52
- </script>