bri-components 1.1.4 → 1.1.6

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 (55) 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/2.bri-components.min.js +1 -1
  4. package/lib/4.bri-components.min.js +1 -1
  5. package/lib/5.bri-components.min.js +1 -1
  6. package/lib/6.bri-components.min.js +1 -1
  7. package/lib/7.bri-components.min.js +1 -1
  8. package/lib/bri-components.min.js +5 -5
  9. package/package.json +1 -1
  10. package/src/components/controls/base/DshCascader/DshCascader.vue +202 -160
  11. package/src/components/controls/base/DshCascader/InfoCascader.vue +11 -9
  12. package/src/components/controls/base/DshCoordinates.vue +118 -115
  13. package/src/components/controls/base/DshSelect.vue +8 -6
  14. package/src/components/controls/base/DshSwitch.vue +45 -87
  15. package/src/components/controls/controlMixin.js +26 -6
  16. package/src/components/form/DshDefaultSearch.vue +1 -1
  17. package/src/components/form/DshForm.vue +4 -0
  18. package/src/components/list/BriTable.vue +0 -1
  19. package/src/components/other/BriSvg.vue +28 -0
  20. package/src/components/other/DshEditPanel.vue +33 -11
  21. package/src/components/other/ZLoading.vue +24 -12
  22. package/src/components/small/BriButton.vue +2 -2
  23. package/src/components/small/DshButtons.vue +28 -2
  24. package/src/components/small/DshIcons.vue +1 -1
  25. package/src/components/unit/DshFormItem.vue +2 -2
  26. package/src/index.js +6 -5
  27. package/src/styles/common/control.less +11 -7
  28. package/src/styles/components/controls/base/DshCascader.less +110 -0
  29. package/src/styles/components/controls/base/DshSwitch.less +37 -0
  30. package/src/styles/components/form/DshDefaultSearch.less +41 -9
  31. package/src/styles/components/index.less +19 -19
  32. package/src/styles/components/other/ZLoading.less +5 -7
  33. package/src/styles/components/small/BriButton.less +34 -2
  34. package/src/styles/components/small/DshDropdown.less +1 -7
  35. package/src/styles/components/unit/DshFormItem.less +1 -2
  36. package/src/components/small/DshControlDefine.vue +0 -115
  37. package/src/styles/components/controls/DshCascader.less +0 -79
  38. package/src/styles/components/small/DshControlDefine.less +0 -40
  39. /package/src/styles/components/controls/{BriInputs.less → base/BriInputs.less} +0 -0
  40. /package/src/styles/components/controls/{BriUpload.less → base/BriUpload.less} +0 -0
  41. /package/src/styles/components/controls/{DshCheckbox.less → base/DshCheckbox.less} +0 -0
  42. /package/src/styles/components/controls/{DshCoordinates.less → base/DshCoordinates.less} +0 -0
  43. /package/src/styles/components/controls/{DshDate.less → base/DshDate.less} +0 -0
  44. /package/src/styles/components/controls/{DshDaterange.less → base/DshDaterange.less} +0 -0
  45. /package/src/styles/components/controls/{DshDivider.less → base/DshDivider.less} +0 -0
  46. /package/src/styles/components/controls/{DshEditor.less → base/DshEditor.less} +0 -0
  47. /package/src/styles/components/controls/{DshInput.less → base/DshInput.less} +0 -0
  48. /package/src/styles/components/controls/{DshNumber.less → base/DshNumber.less} +0 -0
  49. /package/src/styles/components/controls/{DshNumberange.less → base/DshNumberange.less} +0 -0
  50. /package/src/styles/components/controls/{DshSelect.less → base/DshSelect.less} +0 -0
  51. /package/src/styles/components/controls/{InfoCascader.less → base/InfoCascader.less} +0 -0
  52. /package/src/styles/components/controls/{BriLabels.less → senior/BriLabels.less} +0 -0
  53. /package/src/styles/components/controls/{DshPackage.less → senior/DshPackage.less} +0 -0
  54. /package/src/styles/components/controls/{cascaderTable.less → senior/cascaderTable.less} +0 -0
  55. /package/src/styles/components/controls/{flatTable.less → senior/flatTable.less} +0 -0
@@ -3,145 +3,148 @@
3
3
  <Ctooltip
4
4
  :content="curValName"
5
5
  placement="top"
6
- :transfer="true"
7
6
  maxWidth="200"
7
+ :transfer="true"
8
8
  >
9
9
  <!-- 编辑 -->
10
- <div
11
- v-if="canEdit"
12
- :class="{
13
- ...commonClass,
14
- 'DshCoordinates-edit': true
15
- }"
16
- @click="clickOpenModal"
17
- >
18
- <div
19
- v-if="!$isEmptyData(curVal)"
20
- class="value"
21
- >
22
- <span class="value-name">
23
- {{ curValName }}
24
- </span>
25
- <Icon
26
- v-if="selfPropsObj._clearable"
27
- class="value-icon"
28
- type="md-close"
29
- @click.stop="clickDelete"
30
- />
31
- </div>
32
-
10
+ <template v-if="canEdit">
33
11
  <div
34
- v-else
35
- class="nodata"
12
+ :class="{
13
+ ...commonClass,
14
+ 'DshCoordinates-edit': true
15
+ }"
16
+ @click="clickOpenModal"
36
17
  >
37
- 点击获取当前位置
38
- <i class="nodata-icon bico-font bico-zuobiao"></i>
39
- </div>
18
+ <!-- 有值 -->
19
+ <div
20
+ v-if="!$isEmptyData(curVal)"
21
+ class="value"
22
+ >
23
+ <span class="value-name">
24
+ {{ curValName }}
25
+ </span>
26
+ <Icon
27
+ v-if="selfPropsObj._clearable"
28
+ class="value-icon"
29
+ type="md-close"
30
+ @click.stop="clickDelete"
31
+ />
32
+ </div>
40
33
 
41
- <!-- 模态框 -->
42
- <Modal
43
- class="DshCoordinates-modal"
44
- v-model="showModal"
45
- title="选择位置"
46
- :footer-hide="true"
47
- :styles="modalStyles"
48
- @on-cancel="clickCancel"
49
- >
34
+ <!-- 无值 -->
50
35
  <div
51
- slot="header"
52
- class="DshCoordinates-modal-header"
36
+ v-else
37
+ class="nodata"
38
+ >
39
+ 点击获取当前位置
40
+ <i class="nodata-icon bico-font bico-zuobiao"></i>
41
+ </div>
42
+
43
+ <!-- 模态框 -->
44
+ <Modal
45
+ class="DshCoordinates-modal"
46
+ v-model="showModal"
47
+ title="选择位置"
48
+ :footer-hide="true"
49
+ :styles="modalStyles"
50
+ @on-cancel="clickCancel"
53
51
  >
54
- <Row
55
- v-if="finalCanEdit"
56
- class="edit"
57
- type="flex"
58
- justify="center"
59
- align="bottom"
52
+ <div
53
+ slot="header"
54
+ class="DshCoordinates-modal-header"
60
55
  >
61
- <Col span="8">
62
- <div>
63
- <RadioGroup v-model="formData.kind">
64
- <Radio label="keyword">按关键字搜索</Radio>
65
- <Radio label="coordinate">按坐标搜索</Radio>
66
- </RadioGroup>
67
- </div>
68
- <Row class="dsh-margin-top5">
69
- <Col span="16">
70
- <Input
71
- v-model="formData.searchText"
72
- placeholder="请输入..."
73
- :clearable="true"
74
- @on-enter="clickSearch"
75
- />
76
- <span class="edit-message">{{ searchMessage }}</span>
56
+ <Row
57
+ v-if="finalCanEdit"
58
+ class="edit"
59
+ type="flex"
60
+ justify="center"
61
+ align="bottom"
62
+ >
63
+ <Col span="8">
64
+ <div>
65
+ <RadioGroup v-model="formData.kind">
66
+ <Radio label="keyword">按关键字搜索</Radio>
67
+ <Radio label="coordinate">按坐标搜索</Radio>
68
+ </RadioGroup>
69
+ </div>
70
+ <Row class="dsh-margin-top5">
71
+ <Col span="16">
72
+ <Input
73
+ v-model="formData.searchText"
74
+ placeholder="请输入..."
75
+ :clearable="true"
76
+ @on-enter="clickSearch"
77
+ />
78
+ <span class="edit-message">{{ searchMessage }}</span>
79
+ </Col>
80
+ <Col span="8">&nbsp;
81
+ <Button
82
+ type="primary"
83
+ @click="clickSearch"
84
+ >搜索</Button>
85
+ </Col>
86
+ </Row>
77
87
  </Col>
78
- <Col span="8">&nbsp;
79
- <Button
80
- type="primary"
81
- @click="clickSearch"
82
- >搜索</Button>
88
+
89
+ <Col span="8">
90
+ <div class="edit-text">坐标获取结果</div>
91
+ <Row class="dsh-margin-top5">
92
+ <Col span="16">
93
+ <Input
94
+ :value="curVal.name"
95
+ :readonly="true"
96
+ :clearable="true"
97
+ @on-clear="clickClear"
98
+ @click.native="clickMapFitView"
99
+ />
100
+ </Col>
101
+ <Col span="8">&nbsp;
102
+ <Button
103
+ type="primary"
104
+ @click="clickConfirm"
105
+ >确认</Button>
106
+ </Col>
107
+ </Row>
83
108
  </Col>
84
109
  </Row>
85
- </Col>
86
110
 
87
- <Col span="8">
88
- <div class="edit-text">坐标获取结果</div>
89
- <Row class="dsh-margin-top5">
90
- <Col span="16">
111
+ <Row
112
+ v-else
113
+ class="show"
114
+ >
115
+ <Col
116
+ span="6"
117
+ class="show-name"
118
+ >
119
+ 当前位置:
120
+ </Col>
121
+ <Col span="12">
91
122
  <Input
92
123
  :value="curVal.name"
93
124
  :readonly="true"
94
- :clearable="true"
95
- @on-clear="clickClear"
96
125
  @click.native="clickMapFitView"
97
126
  />
98
127
  </Col>
99
- <Col span="8">&nbsp;
100
- <Button
101
- type="primary"
102
- @click="clickConfirm"
103
- >确认</Button>
128
+ <Col span="6">
104
129
  </Col>
105
130
  </Row>
106
- </Col>
107
- </Row>
131
+ </div>
108
132
 
109
- <Row
110
- v-else
111
- class="show"
112
- >
113
- <Col
114
- span="6"
115
- class="show-name"
116
- >
117
- 当前位置:
118
- </Col>
119
- <Col span="12">
120
- <Input
121
- :value="curVal.name"
122
- :readonly="true"
123
- @click.native="clickMapFitView"
124
- />
125
- </Col>
126
- <Col span="6">
127
- </Col>
128
- </Row>
129
- </div>
133
+ <transition>
134
+ <div
135
+ v-if="showModal"
136
+ id="mapContain"
137
+ class="DshCoordinates-modal-map"
138
+ ></div>
139
+ </transition>
130
140
 
131
- <transition>
132
141
  <div
133
- v-if="showModal"
134
- id="mapContain"
135
- class="DshCoordinates-modal-map"
142
+ ref="divCoordinate"
143
+ style="display: none; position:absolute;background:#fff;padding: 5px 10px"
136
144
  ></div>
137
- </transition>
138
-
139
- <div
140
- ref="divCoordinate"
141
- style="display: none; position:absolute;background:#fff;padding: 5px 10px"
142
- ></div>
143
- </Modal>
144
- </div>
145
+ </Modal>
146
+ </div>
147
+ </template>
145
148
 
146
149
  <!-- 查看 -->
147
150
  <template v-else>
@@ -149,7 +152,7 @@
149
152
  ...commonClass,
150
153
  'DshCoordinates-show': true
151
154
  }">
152
- {{ showText }}
155
+ {{ curValName || emptyShowVal }}
153
156
  </span>
154
157
  </template>
155
158
  </Ctooltip>
@@ -203,12 +203,14 @@
203
203
  ..._customData.params
204
204
  },
205
205
  callback: data => {
206
- this.initListData.push(...data.list.map(item => (
207
- {
208
- _key: item[_customData._key || "_key"],
209
- name: item[_customData._name || "name"]
210
- }
211
- )));
206
+ this.initListData.push(
207
+ ...data.list.map(item => (
208
+ {
209
+ _key: item[_customData._key || "_key"],
210
+ name: item[_customData._name || "name"]
211
+ }
212
+ ))
213
+ );
212
214
  }
213
215
  });
214
216
  },
@@ -1,48 +1,44 @@
1
1
  <template>
2
- <div
3
- class="DshSwitch"
4
- :style="{ textAlign: propsObj._textAlign, width: '100%' }"
5
- >
6
- <!-- 组件无clearable -->
7
- <i-switch
8
- v-if="finalCanEdit"
9
- v-model="value[propsObj._key]"
10
- :size="propsObj._size"
11
- :disabled="!finalCanEdit"
12
- @on-change="change"
13
- >
14
- <span
15
- slot="open"
16
- style="font-size: 12px;"
17
- >{{ propsObj._openText }}</span>
18
- <span slot="close">{{ propsObj._closeText }}</span>
19
- </i-switch>
20
- <!-- 查看 和 编辑下无编辑权限 -->
21
- <Ctooltip
22
- v-else
23
- placement="top"
24
- :transfer="true"
25
- maxWidth="200"
26
- :content="showVal"
27
- >
28
- <div
29
- class="DshCheckbox-value-wrapper"
30
- :style="{
31
- textAlign: propsObj._textAlign,
32
- flexGrow: 1,
33
- display: 'flex',
34
- justifyContent: getFlexLayout(propsObj._textAlign)
35
- }"
2
+ <!-- 该组件无clearable -->
3
+ <div class="DshSwitch">
4
+ <!-- 编辑 -->
5
+ <template v-if="canEdit">
6
+ <i-switch
7
+ v-model="curVal"
8
+ :disabled="!finalCanEdit"
9
+ :size="propsObj._size"
10
+ @on-change="change"
36
11
  >
37
- <span
38
- class="DshCheckbox-value control-show-color-text dsh-ellipsis"
39
- :style="{
40
- background: value[controlKey] ? '#ECF3FD' : '#FEF6EB',
41
- color: value[controlKey] ? '#3D84EE' : '#F4A135'
42
- }"
43
- >{{ showVal }}</span>
44
- </div>
45
- </Ctooltip>
12
+ <span slot="open">
13
+ {{ propsObj._openText }}
14
+ </span>
15
+ <span slot="close">
16
+ {{ propsObj._closeText }}
17
+ </span>
18
+ </i-switch>
19
+ </template>
20
+
21
+ <!-- 查看 -->
22
+ <template v-else>
23
+ <Ctooltip
24
+ :content="showText"
25
+ placement="top"
26
+ :transfer="true"
27
+ maxWidth="200"
28
+ >
29
+ <div class="DshSwitch-show">
30
+ <span
31
+ class="DshSwitch-show-name"
32
+ :style="{
33
+ background: curVal ? '#ECF3FD' : '#FEF6EB',
34
+ color: curVal ? '#3D84EE' : '#F4A135'
35
+ }"
36
+ >
37
+ {{ showText }}
38
+ </span>
39
+ </div>
40
+ </Ctooltip>
41
+ </template>
46
42
  </div>
47
43
  </template>
48
44
 
@@ -51,58 +47,20 @@
51
47
 
52
48
  export default {
53
49
  name: "DshSwitch",
54
- mixins: [controlMixin],
50
+ mixins: [
51
+ controlMixin
52
+ ],
55
53
  data () {
56
54
  return {};
57
55
  },
58
56
  computed: {
59
- showVal () {
57
+ showText () {
60
58
  return this.value[this.controlKey]
61
59
  ? this.propsObj._openText
62
60
  : this.propsObj._closeText;
63
61
  }
64
62
  },
65
- created () {
66
- },
67
- methods: {
68
- getFlexLayout (align) {
69
- let map = {
70
- left: "flex-start",
71
- center: "center",
72
- right: "flex-end"
73
- };
74
- if (align) {
75
- return map[align];
76
- } else {
77
- return "flex-start";
78
- }
79
- }
80
- }
63
+ created () {},
64
+ methods: {}
81
65
  };
82
66
  </script>
83
-
84
- <style lang="less" scoped>
85
- .DshSwitch {
86
-
87
- }
88
- </style>
89
- <style lang="less">
90
- .DshSwitch {
91
- .ivu-switch {
92
- width: 50px;
93
- }
94
- .ivu-switch-checked:after {
95
- left: 29px;
96
- }
97
- .ivu-switch-inner {
98
- color: #fff;
99
- font-size: 12px;
100
- position: absolute;
101
- left: auto;
102
- right: 4px;
103
- }
104
- .ivu-switch-checked .ivu-switch-inner {
105
- left: 3px;
106
- }
107
- }
108
- </style>
@@ -45,14 +45,34 @@ export default {
45
45
  controlKey () {
46
46
  return this.propsObj._key;
47
47
  },
48
- curVal () {
49
- return this.value[this.controlKey];
48
+ // 值为不是[]类型用的
49
+ curVal: {
50
+ get () {
51
+ return this.value[this.controlKey];
52
+ },
53
+ set (val) {
54
+ this.value[this.controlKey] = val;
55
+ }
56
+ },
57
+ // 值为[]类型用的
58
+ curValList: {
59
+ get () {
60
+ return this.value[this.controlKey] || [];
61
+ },
62
+ set (val) {
63
+ this.value[this.controlKey] = val;
64
+ this.change();
65
+ }
50
66
  },
51
67
  emptyShowVal () {
52
- return this.isUnitShow ? "--" : "暂无内容";
68
+ return this.canEdit
69
+ ? this.commonDealPropsObj._placeholder
70
+ : this.isUnitShow
71
+ ? "--"
72
+ : "暂无内容";
53
73
  },
54
74
  showText () {
55
- return this.curVal || this.emptyShowVal;
75
+ return this.$isEmptyData(this.curVal) ? this.curVal : this.emptyShowVal;
56
76
  },
57
77
 
58
78
  isUnitShow () {
@@ -101,10 +121,10 @@ export default {
101
121
  },
102
122
  methods: {
103
123
  change (...params) {
104
- this.$emit("change", this.curVal);
124
+ this.$emit("change", this.value[this.controlKey]);
105
125
  },
106
126
  refChange (...params) {
107
- this.$emit("refChange", this.curVal);
127
+ this.$emit("refChange", this.value[this.controlKey]);
108
128
  }
109
129
  }
110
130
  };
@@ -53,7 +53,7 @@
53
53
  v-if="canUseFold"
54
54
  class="DshDefaultSearch-fold"
55
55
  >
56
- <div class="DshDefaultSearch-fold-zhanwei"></div>
56
+ <!-- <div class="DshDefaultSearch-fold-zhanwei"></div> -->
57
57
  <Icon
58
58
  :class="[
59
59
  'DshDefaultSearch-fold-icon',
@@ -325,6 +325,10 @@
325
325
  &-item-FormItem {
326
326
  margin-bottom: 0px!important;
327
327
  }
328
+
329
+ .ivu-form-item-content {
330
+ line-height: normal;
331
+ }
328
332
  .ivu-form-item-error-tip {
329
333
  top: 90%;
330
334
  left: 15px;
@@ -136,7 +136,6 @@
136
136
  // 全选配置项
137
137
  checkboxOption () {
138
138
  return {
139
- selectedRowKeys: [],
140
139
  // 行选择改变事件
141
140
  selectedRowChange: ({ row, isSelected, selectedRowKeys }) => {
142
141
  this.$emit(
@@ -0,0 +1,28 @@
1
+ <template>
2
+ <svg class="bri" aria-hidden="true">
3
+ <use :href="href"></use>
4
+ </svg>
5
+ </template>
6
+
7
+ <script>
8
+
9
+ export default {
10
+ name: "imgscg",
11
+ components: {},
12
+ props: {
13
+ src: String
14
+ },
15
+ computed: {
16
+ // 这是一种全新的使用方式,应该说这才是未来的主流,也是平台目前推荐的用法
17
+ // 浏览器渲染 SVG 的性能一般,还不如 png。
18
+ href () {
19
+ return `#bri-${this.src}`;
20
+ }
21
+ },
22
+ data () {
23
+ return {};
24
+ },
25
+ created () {},
26
+ methods: {}
27
+ };
28
+ </script>
@@ -1,8 +1,18 @@
1
1
  <template>
2
2
  <div class="DshEditPanel">
3
- <Form class="DshEditPanel-form" :model="value" :label-width="80" label-position="left">
3
+ <Form
4
+ class="DshEditPanel-form"
5
+ :model="value"
6
+ :label-width="80"
7
+ label-position="left"
8
+ >
4
9
  <FormItem label="应用名称">
5
- <Input v-model="value.name" placeholder="请输入应用名称" autofocus @on-blur="onBlur(value)" />
10
+ <Input
11
+ v-model="value.name"
12
+ placeholder="请输入应用名称"
13
+ autofocus
14
+ @on-blur="onBlur(value)"
15
+ />
6
16
  </FormItem>
7
17
 
8
18
  <FormItem label="主题颜色">
@@ -13,7 +23,12 @@
13
23
  class="DshEditPanel-colors-item"
14
24
  @click="$dispatchEvent(operationMap.updateColor, colorItem.color, colorKey, value)"
15
25
  >
16
- <div class="DshEditPanel-colors-item-content" :style="{ backgroundColor: colorItem.color }"></div>
26
+ <div
27
+ class="DshEditPanel-colors-item-content"
28
+ :style="{
29
+ backgroundColor: colorItem.color
30
+ }"
31
+ ></div>
17
32
  <Icon
18
33
  v-if="colorItem.color === value.color"
19
34
  class="DshEditPanel-colors-item-icon"
@@ -36,7 +51,12 @@
36
51
  }"
37
52
  @click="$dispatchEvent(operationMap.updateIcon, iconItem, iconIndex, value)"
38
53
  >
39
- <div class="DshEditPanel-icons-item-content" :style="{backgroundImage: 'url('+ $appData.themeColors[value.color].bgUrl +')'}">
54
+ <div
55
+ class="DshEditPanel-icons-item-content"
56
+ :style="{
57
+ backgroundImage: `url(${$appData.themeColors[value.color].bgUrl})`
58
+ }"
59
+ >
40
60
  <Icon :custom="'bico-font ' + iconItem"></Icon>
41
61
  </div>
42
62
  </div>
@@ -47,7 +67,7 @@
47
67
  <!-- 操作按钮 -->
48
68
  <dsh-buttons
49
69
  class="bri-footer"
50
- :list="$getOperationList(['cancel', 'confirm'])"
70
+ :list="$getOperationList(['canCancel', 'canConfirm'])"
51
71
  @click="$dispatchEvent($event)"
52
72
  ></dsh-buttons>
53
73
  </div>
@@ -55,8 +75,8 @@
55
75
 
56
76
  <script>
57
77
  export default {
58
- components: {},
59
78
  name: "DshEditPanel",
79
+ components: {},
60
80
  props: {
61
81
  value: {
62
82
  type: Object,
@@ -78,14 +98,14 @@
78
98
  type: "updateIcon",
79
99
  event: "clickUpdateIcon"
80
100
  },
81
- cancel: {
101
+ canCancel: {
82
102
  name: "取消",
83
- type: "cancel",
103
+ type: "canCancel",
84
104
  event: "clickCancel"
85
105
  },
86
- confirm: {
106
+ canConfirm: {
87
107
  name: "确定",
88
- type: "confirm",
108
+ type: "canConfirm",
89
109
  btnType: "primary",
90
110
  event: "clickConfirm"
91
111
  }
@@ -107,7 +127,9 @@
107
127
  },
108
128
 
109
129
  onBlur (value) {
110
- value.name || (value.name = value.oldName || "未命名");
130
+ if (!value.name) {
131
+ value.name = value.oldName || "未命名";
132
+ }
111
133
  },
112
134
  // 点击修改应用主题色
113
135
  clickUpdateColor (item, colorItem, colorKey, appObj) {