bri-components 1.1.1 → 1.1.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 (91) 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/package.json +1 -1
  14. package/src/components/controls/base/DshCascader.vue +14 -11
  15. package/src/components/controls/base/DshCascaderMultiple.vue +13 -4
  16. package/src/components/controls/base/DshCheckbox.vue +16 -19
  17. package/src/components/controls/base/DshCoordinates.vue +15 -11
  18. package/src/components/controls/base/DshDate.vue +24 -37
  19. package/src/components/controls/base/DshDaterange.vue +3 -1
  20. package/src/components/controls/base/DshEditor.vue +73 -49
  21. package/src/components/controls/base/DshInput.vue +66 -52
  22. package/src/components/controls/base/DshNumber/BriInputNumber/BriInputNumber.vue +1 -1
  23. package/src/components/controls/base/DshNumber/DshNumber.vue +50 -48
  24. package/src/components/controls/base/DshNumberange.vue +11 -21
  25. package/src/components/controls/base/DshSelect.vue +12 -16
  26. package/src/components/controls/base/YSerialNumber.vue +10 -3
  27. package/src/components/controls/base/ZUpload/index.vue +16 -12
  28. package/src/components/controls/base/ZUpload/upload-list.vue +20 -13
  29. package/src/components/controls/base/ZUpload/uploadMixin.js +5 -1
  30. package/src/components/controls/base/textMultiple/DshTextMultiple.vue +13 -5
  31. package/src/components/controls/base/textMultiple/MultipleInput.vue +5 -5
  32. package/src/components/controls/controlMap.js +7 -5
  33. package/src/components/controls/controlMixin.js +54 -30
  34. package/src/components/controls/controlShow.vue +44 -0
  35. package/src/components/controls/{base → senior}/BriLabels.vue +55 -24
  36. package/src/components/controls/{base → senior}/DshPackage.vue +6 -25
  37. package/src/components/controls/senior/cascaderTable.vue +91 -84
  38. package/src/components/controls/senior/flatTable.vue +20 -17
  39. package/src/components/controls/{base → special}/DshBack.vue +4 -4
  40. package/src/components/controls/{base → special}/DshUndeveloped.vue +3 -1
  41. package/src/components/form/DshAdvSearchForm.vue +10 -1
  42. package/src/components/form/DshForm.vue +14 -20
  43. package/src/components/list/BriFlatTable.vue +5 -7
  44. package/src/components/list/BriTable.vue +12 -8
  45. package/src/components/list/DshBox/DshCard.vue +2 -2
  46. package/src/components/list/DshBox/DshCrossTable.vue +4 -8
  47. package/src/components/list/DshBox/DshSingleData.vue +0 -7
  48. package/src/components/list/DshCascaderTable.vue +3 -4
  49. package/src/components/list/ZTree.vue +1 -1
  50. package/src/components/other/ZLoading.vue +32 -3
  51. package/src/components/small/BriDrawer.vue +132 -0
  52. package/src/components/small/DshButtons.vue +3 -3
  53. package/src/components/small/DshControlDefine.vue +1 -1
  54. package/src/components/small/DshModal.vue +0 -110
  55. package/src/components/unit/DshFormItem.vue +42 -46
  56. package/src/components/unit/DshUnit.vue +10 -13
  57. package/src/components/unit/unitMixin.js +4 -9
  58. package/src/index.js +12 -14
  59. package/src/styles/common/box.less +29 -0
  60. package/src/styles/common/control.less +50 -12
  61. package/src/styles/components/controls/BriLabels.less +33 -17
  62. package/src/styles/components/controls/DshCascader.less +7 -3
  63. package/src/styles/components/controls/DshCheckbox.less +45 -42
  64. package/src/styles/components/controls/DshCoordinates.less +24 -27
  65. package/src/styles/components/controls/DshDate.less +1 -52
  66. package/src/styles/components/controls/DshEditor.less +51 -34
  67. package/src/styles/components/controls/DshInput.less +13 -34
  68. package/src/styles/components/controls/DshNumber.less +33 -0
  69. package/src/styles/components/controls/DshNumberange.less +8 -3
  70. package/src/styles/components/controls/DshSelect.less +78 -92
  71. package/src/styles/components/controls/ZUpload.less +1 -2
  72. package/src/styles/components/controls/cascaderTable.less +10 -24
  73. package/src/styles/components/controls/controlShow.less +3 -1
  74. package/src/styles/components/controls/flatTable.less +10 -23
  75. package/src/styles/components/form/DshAdvSearchForm.less +0 -9
  76. package/src/styles/components/form/DshDefaultSearch.less +0 -20
  77. package/src/styles/components/index.less +3 -2
  78. package/src/styles/components/other/InfoCascader.less +4 -0
  79. package/src/styles/components/other/ZLoading.less +23 -7
  80. package/src/styles/components/small/BriDrawer.less +34 -0
  81. package/src/styles/components/small/DshControlDefine.less +6 -8
  82. package/src/styles/components/small/DshDropdown.less +12 -8
  83. package/src/styles/components/small/DshModal.less +207 -0
  84. package/src/styles/components/small/DshTitle.less +1 -1
  85. package/src/styles/components/unit/DshFormItem.less +7 -3
  86. package/src/styles/plugin/iview.less +7 -3
  87. package/src/styles/reset.less +16 -2
  88. package/src/utils/table.js +5 -6
  89. package/src/components/controls/base/DshLabels.vue +0 -309
  90. package/src/components/controls/base/controlShow.vue +0 -52
  91. package/src/styles/components/controls/DshLabels.less +0 -187
@@ -3,10 +3,9 @@
3
3
  <Input
4
4
  class="DshTextMultiple-control"
5
5
  v-model="text"
6
- :placeholder="$showPlaceholder(canEdit, propsObj) ? `请输入${propsObj._name}` : ''"
6
+ :placeholder="selfPropsObj._placeholder"
7
7
  :type="'text'"
8
- :readonly="!canEdit"
9
- :disabled="propsObj.canEdit === false"
8
+ :disabled="!finalCanEdit"
10
9
  :clearable="true"
11
10
  :size="propsObj._size"
12
11
  />
@@ -30,7 +29,9 @@
30
29
 
31
30
  export default {
32
31
  name: "DshTextMultiple",
33
- mixins: [controlMixin],
32
+ mixins: [
33
+ controlMixin
34
+ ],
34
35
  props: {},
35
36
  data () {
36
37
  return {
@@ -51,7 +52,14 @@
51
52
  }
52
53
  };
53
54
  },
54
- computed: {},
55
+ computed: {
56
+ selfPropsObj () {
57
+ return {
58
+ ...this.propsObj,
59
+ ...this.commonDealPropsObj
60
+ };
61
+ }
62
+ },
55
63
  created () {},
56
64
  methods: {
57
65
  createTag () {
@@ -2,7 +2,7 @@
2
2
  <div class="MutipleInput">
3
3
  <Input
4
4
  v-show="status === 'edit'"
5
- v-model="curVal"
5
+ v-model="curInputVal"
6
6
  icon="ios-search"
7
7
  :placeholder="selfPropsObj._placeholder"
8
8
  @on-enter="clickConfirm"
@@ -55,7 +55,7 @@
55
55
  data () {
56
56
  return {
57
57
  status: "edit", // show
58
- curVal: "",
58
+ curInputVal: "",
59
59
  curIndex: -1
60
60
  };
61
61
  },
@@ -72,7 +72,7 @@
72
72
  },
73
73
  methods: {
74
74
  clickConfirm () {
75
- let val = this.curVal.trim();
75
+ let val = this.curInputVal.trim();
76
76
  if (val && !this.value[this.controlKey].includes(val)) {
77
77
  // 有值,且不存在于当前数组中
78
78
  if (this.curIndex < 0) {
@@ -81,12 +81,12 @@
81
81
  this.$set(this.value[this.controlKey], this.curIndex, val);
82
82
  }
83
83
  }
84
- this.curVal = "";
84
+ this.curInputVal = "";
85
85
  this.status = "show";
86
86
  this.change();
87
87
  },
88
88
  clickEdit (val, index) {
89
- this.curVal = val;
89
+ this.curInputVal = val;
90
90
  this.curIndex = index;
91
91
  this.status = "edit";
92
92
  },
@@ -33,7 +33,8 @@ const componentNameMap = {
33
33
  coordinates: "DshCoordinates",
34
34
  editor: "DshEditor",
35
35
  tag: "DshDivider",
36
- labels: "DshLabels",
36
+
37
+ labels: "BriLabels",
37
38
  package: "DshPackage",
38
39
  flatTable: "flatTable",
39
40
  cascaderTable: "cascaderTable",
@@ -62,13 +63,14 @@ const pathMap = {
62
63
  DshCoordinates: "./base/DshCoordinates.vue",
63
64
  DshEditor: "./base/DshEditor.vue",
64
65
  DshDivider: "./base/DshDivider.vue",
65
- DshLabels: "./base/DshLabels.vue",
66
- DshPackage: "./base/DshPackage.vue",
66
+
67
+ BriLabels: "./senior/BriLabels.vue",
68
+ DshPackage: "./senior/DshPackage.vue",
67
69
  flatTable: "./senior/flatTable.vue",
68
70
  cascaderTable: "./senior/cascaderTable",
69
71
 
70
- DshBack: "./base/DshBack.vue",
71
- DshUndeveloped: "./base/DshUndeveloped.vue"
72
+ DshBack: "./special/DshBack.vue",
73
+ DshUndeveloped: "./special/DshUndeveloped.vue"
72
74
  }
73
75
  };
74
76
 
@@ -1,4 +1,9 @@
1
+ import controlShow from "./controlShow.vue";
2
+
1
3
  export default {
4
+ components: {
5
+ controlShow
6
+ },
2
7
  props: {
3
8
  canEdit: {
4
9
  type: Boolean,
@@ -16,70 +21,89 @@ export default {
16
21
  return {};
17
22
  }
18
23
  },
19
- isUnit: {
20
- type: Boolean,
21
- default: false
24
+
25
+ /* 表单形式下用到的 */
26
+ // 暂时是dshDate里在用,时间对比时需要用其他时间字段
27
+ allFormList: {
28
+ type: Array,
29
+ default () {
30
+ return [];
31
+ }
32
+ },
33
+ /* 列表形式下用到的 */
34
+ parentData: {
35
+ type: Array,
36
+ default () {
37
+ return [];
38
+ }
22
39
  }
23
40
  },
24
41
  data () {
25
42
  return {};
26
43
  },
27
44
  computed: {
28
- compKey () {
29
- return this.propsObj.compKey;
30
- },
31
- appKey () {
32
- return this.propsObj.appKey;
33
- },
34
- entityKey () {
35
- return this.propsObj.entityKey;
45
+ controlKey () {
46
+ return this.propsObj._key;
36
47
  },
37
- inTable () {
38
- return !!this.propsObj.inTable;
48
+ curVal () {
49
+ return this.value[this.controlKey];
39
50
  },
40
- isShare () {
41
- return !!this.propsObj.isShare;
51
+ emptyShowVal () {
52
+ return this.isUnitShow ? "-" : "暂无内容";
42
53
  },
43
- controlKey () {
44
- return this.propsObj._key;
54
+ showText () {
55
+ return this.curVal || this.emptyShowVal;
45
56
  },
46
57
 
58
+ isUnitShow () {
59
+ return !this.canEdit && this.inTable;
60
+ },
47
61
  finalCanEdit () {
48
- return this.$canEdit(this.canEdit, this.propsObj);
62
+ return this.canEdit && (this.propsObj.canEdit == undefined ? true : this.propsObj.canEdit);
49
63
  },
50
64
  commonDealPropsObj () {
51
65
  const selectControlTypes = ["date", "switch", "select", "checkbox", "file", "region", "regions", "cascader", "cascaders", "coordinates", "users", "departments"];
52
66
  return {
53
67
  // TODO: 此处的请输入可能还有请选择之类的,待处理
54
- _placeholder: this.$showPlaceholder(this.canEdit, this.propsObj)
68
+ _placeholder: this.canEdit && this.propsObj._enterType !== "calculate"
55
69
  ? (this.propsObj._placeholder || `请${selectControlTypes.includes(this.propsObj._type) ? "选择" : "输入"}${this.propsObj._name}`)
56
- : "",
70
+ : undefined,
57
71
  _clearable: this.finalCanEdit && (this.propsObj._clearable === undefined ? true : this.propsObj._clearable)
58
72
  };
59
73
  },
60
- currentVal () {
61
- return this.value[this.controlKey];
62
- },
63
74
  commonClass () {
64
75
  return {
65
76
  "dsh-ellipsis": true,
66
77
  "control-edit": this.finalCanEdit,
67
- "control-disabled": this.$isDisabled(this.canEdit, this.propsObj),
68
- // "control-readonly": this.$isReadonly(this.canEdit, this.propsObj),
78
+ "control-disabled": !this.finalCanEdit,
69
79
  "control-show": !this.canEdit,
70
- "control-notext": !this.currentVal
80
+ "control-notext": !this.curVal
71
81
  };
72
82
  },
73
- showText () {
74
- return this.currentVal || (this.isUnit ? "-" : "暂无内容");
83
+
84
+ // 部分控件或部分条件下 才使用的属性
85
+ inTable () {
86
+ return !!this.propsObj.inTable;
87
+ },
88
+ isShare () {
89
+ return !!this.propsObj.isShare;
90
+ },
91
+ compKey () {
92
+ return this.propsObj.compKey;
93
+ },
94
+ appKey () {
95
+ return this.propsObj.appKey;
96
+ },
97
+ entityKey () {
98
+ return this.propsObj.entityKey;
75
99
  }
76
100
  },
77
101
  methods: {
78
102
  change (...params) {
79
- this.$emit("change", this.value[this.propsObj._key]);
103
+ this.$emit("change", this.curVal);
80
104
  },
81
105
  refChange (...params) {
82
- this.$emit("refChange", this.value[this.propsObj._key]);
106
+ this.$emit("refChange", this.curVal);
83
107
  }
84
108
  }
85
109
  };
@@ -0,0 +1,44 @@
1
+ <template>
2
+ <div class="controlShow">
3
+ <Ctooltip
4
+ :content="showVal"
5
+ maxWidth="200"
6
+ :transfer="true"
7
+ >
8
+ <div
9
+ v-if="!$isEmptyData(showVal)"
10
+ class="controlShow-val"
11
+ >
12
+ {{ showVal }}
13
+ </div>
14
+
15
+ <div
16
+ v-else
17
+ class="controlShow-nodata"
18
+ >
19
+ {{ emptyShowVal }}
20
+ </div>
21
+ </Ctooltip>
22
+ </div>
23
+ </template>
24
+
25
+ <script>
26
+ export default {
27
+ name: "controlShow",
28
+ props: {
29
+ showVal: String,
30
+ emptyShowVal: {
31
+ type: String,
32
+ default () {
33
+ return "-";
34
+ }
35
+ }
36
+ },
37
+ data () {
38
+ return {};
39
+ },
40
+ computed: {},
41
+ created () {},
42
+ methods: {}
43
+ };
44
+ </script>
@@ -12,12 +12,13 @@
12
12
  >
13
13
  <div
14
14
  :class="{
15
+ 'control-edit': true,
15
16
  'BriLabels-dropdown-show':true,
16
17
  'BriLabels-dropdown-show-active':listVisible
17
18
  }"
18
19
  @click="clickInput"
19
20
  >
20
- <div>
21
+ <div class="BriLabels-dropdown-show-list">
21
22
  <Tag
22
23
  v-for="item in val"
23
24
  :key="item._key"
@@ -33,6 +34,7 @@
33
34
  :type="inputIcon"
34
35
  />
35
36
  </div>
37
+
36
38
  <template #list>
37
39
  <DropdownMenu>
38
40
  <DropdownItem
@@ -51,14 +53,16 @@
51
53
  {{item.name}}
52
54
  <span class="BriLabels-dropdown-item-show-icons">
53
55
  <Icon
56
+ v-if="!item.coreLabel"
54
57
  class="BriLabels-dropdown-item-show-icons-edit"
55
58
  custom="bri bri-bianji"
56
59
  @click.stop="clickEdit(item)"
57
60
  />
58
- <Icon
61
+ <!-- 暂时不需要删除 -->
62
+ <!-- <Icon
59
63
  class="BriLabels-dropdown-item-show-icons-del"
60
64
  custom="bri bri-shanchu"
61
- />
65
+ /> -->
62
66
  </span>
63
67
  </div>
64
68
  <div
@@ -79,36 +83,55 @@
79
83
  </Input>
80
84
  </div>
81
85
  </DropdownItem>
82
- sds
86
+ <div
87
+ class="BriLabels-dropdown-btnWrap"
88
+ v-if="!selfPropsObj._onlySelect"
89
+ >
90
+ <bri-button
91
+ class="BriLabels-dropdown-add"
92
+ :propsObj="{
93
+ btnType: 'default',
94
+ icon:'md-add'
95
+ }"
96
+ @click="addLabel"
97
+ >
98
+ 添加选项
99
+ </bri-button>
100
+ </div>
83
101
  </DropdownMenu>
84
102
  </template>
85
103
  </Dropdown>
104
+
86
105
  <!-- 查看 -->
87
106
  <div
88
107
  v-else
89
108
  class="BriLabels-view"
90
109
  >
91
110
  <template v-if="val.length">
92
- <Tag
93
- v-for="tagItem in val"
94
- :key="tagItem._key"
95
- size="medium"
96
- class="BriLabels-view-tag"
111
+ <Ctooltip
112
+ placement="top"
113
+ :transfer="true"
114
+ maxWidth="200"
115
+ :content="showValStr"
97
116
  >
98
- {{ tagItem.name }}
99
- </Tag>
117
+ <div class="dsh-ellipsis">
118
+ <div
119
+ v-for="item in val"
120
+ :key="item._key"
121
+ size="medium"
122
+ class="BriLabels-view-item"
123
+ >
124
+ {{ item.name }}
125
+ </div>
126
+ </div>
127
+ </Ctooltip>
100
128
  </template>
101
129
 
102
130
  <div
103
131
  v-else
104
132
  class="BriLabels-view-nodata"
105
133
  >
106
- <template v-if="isUnit">
107
- -
108
- </template>
109
- <template v-else>
110
- 暂无内容
111
- </template>
134
+ {{ emptyShowVal }}
112
135
  </div>
113
136
  </div>
114
137
  </div>
@@ -124,7 +147,8 @@
124
147
  return {
125
148
  listData: [],
126
149
  listVisible: false,
127
- inputIcon: "ios-arrow-down"
150
+ inputIcon: "ios-arrow-down",
151
+ renderList: false
128
152
  };
129
153
  },
130
154
  computed: {
@@ -134,9 +158,6 @@
134
158
  ...this.commonDealPropsObj
135
159
  };
136
160
  },
137
- modKey () {
138
- return this.propsObj.modKey;
139
- },
140
161
  val: {
141
162
  get () {
142
163
  return this.value[this.propsObj._key] || [];
@@ -151,7 +172,6 @@
151
172
  }
152
173
  },
153
174
  created () {
154
- this.init();
155
175
  },
156
176
  methods: {
157
177
  init () {
@@ -166,8 +186,6 @@
166
186
  params: {
167
187
  search: {
168
188
  entityKey: this.entityKey, // 当前工作表关联的数据表Key
169
- modKey: this.modKey,
170
- name: this.curVal,
171
189
  fieldKey: this.selfPropsObj._key === "_default" ? this.value._key : (this.selfPropsObj.__realKey__ || this.selfPropsObj._key), // 当前字段Key
172
190
  labelType: this.selfPropsObj._labelType
173
191
  },
@@ -188,6 +206,10 @@
188
206
  },
189
207
  clickInput () {
190
208
  if (!this.finalCanEdit) return;
209
+ if (!this.renderList) {
210
+ this.init();
211
+ }
212
+ this.renderList = true;
191
213
  this.listVisible = !this.listVisible;
192
214
  if (this.listVisible) {
193
215
  this.inputIcon = "ios-arrow-up";
@@ -210,11 +232,20 @@
210
232
  e.stopPropagation();
211
233
  },
212
234
  confirmEdit (item) {
235
+ if (item.name == "") return;
213
236
  item.isEdit = false;
214
237
  this.$forceUpdate();
215
238
  },
216
239
  handleCancel (item) {
217
240
  this.val = this.val.filter(i => i._key != item._key);
241
+ },
242
+ addLabel () {
243
+ this.listData.push({
244
+ _key: this.$randomB36("Labels"),
245
+ isEdit: true,
246
+ name: "",
247
+ labelType: this.selfPropsObj._labelType
248
+ });
218
249
  }
219
250
  },
220
251
  watch: {
@@ -33,41 +33,22 @@
33
33
  v-else
34
34
  class="DshPackage-nodata"
35
35
  >
36
- <template v-if="isUnit">
37
- -
38
- </template>
39
- <template v-else>
40
- 暂无内容
41
- </template>
36
+ {{ emptyShowVal }}
42
37
  </div>
43
38
  </div>
44
39
  </div>
45
40
  </template>
41
+
46
42
  <script>
47
43
  import controlMixin from "../controlMixin.js";
48
44
 
49
45
  export default {
50
46
  name: "DshPackage",
51
- mixins: [controlMixin],
47
+ mixins: [
48
+ controlMixin
49
+ ],
52
50
  components: {},
53
- props: {
54
- canEdit: {
55
- type: Boolean,
56
- default: true
57
- },
58
- formData: {
59
- type: Object,
60
- default () {
61
- return {};
62
- }
63
- },
64
- formList: {
65
- type: Array,
66
- default () {
67
- return [];
68
- }
69
- }
70
- },
51
+ props: {},
71
52
  data () {
72
53
  return {};
73
54
  },