bri-components 1.1.4 → 1.1.5

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.
@@ -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>
@@ -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
  };
@@ -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) {
@@ -9,13 +9,20 @@
9
9
  >
10
10
  <div class="ZLoading-main">
11
11
  <slot>
12
- <div class="ZLoading-main-content">
12
+ <template v-if="value === 1">
13
13
  <div class="ZLoading-main-loading" :style="getStyle">
14
14
  </div>
15
15
  <div v-if="showLoadingText" class="ZLoading-main-loadingText">
16
- 加载中...
16
+ {{ loadText }}
17
17
  </div>
18
- </div>
18
+ </template>
19
+
20
+ <template v-else-if="value==2">
21
+ <BriSvg :src="imgSrc" />
22
+ <div v-if="noText" class="ZLoading-main-noText">
23
+ {{ noText }}
24
+ </div>
25
+ </template>
19
26
  </slot>
20
27
  </div>
21
28
  </div>
@@ -41,27 +48,32 @@
41
48
  loadImg: {
42
49
  type: String
43
50
  },
44
- kongImg: {
51
+ noImg: {
45
52
  type: String
46
53
  },
47
54
  mode: {
48
55
  type: String,
49
56
  default: "large" // small middle
50
57
  },
51
- showLoadingText: Boolean
58
+ showLoadingText: {
59
+ type: Boolean,
60
+ default: false
61
+ },
62
+ loadText: {
63
+ type: String,
64
+ default: "加载中..."
65
+ },
66
+ noText: {
67
+ type: String,
68
+ default: "暂无数据"
69
+ }
52
70
  },
53
71
  data () {
54
72
  return {};
55
73
  },
56
74
  computed: {
57
75
  imgSrc () {
58
- if (this.value == 1) {
59
- return this.loadImg || this.$imageSrcMap.loading;
60
- } else if (this.value == 2) {
61
- return this.kongImg || this.$imageSrcMap.kongdata;
62
- } else {
63
- return undefined;
64
- }
76
+ return this.noImg || "zanwushuju";
65
77
  },
66
78
  getStyle () {
67
79
  let styleMap = {
package/src/index.js CHANGED
@@ -63,7 +63,6 @@ import DshTabs from "./components/small/DshTabs.vue";
63
63
  import DshSteps from "./components/small/DshSteps.vue";
64
64
  import Ctooltip from "./components/small/Ctooltip.vue";
65
65
  import DshPage from "./components/small/DshPage.vue";
66
- import DshControlDefine from "./components/small/DshControlDefine.vue";
67
66
  import DshFileShow from "./components/small/DshFileShow.vue";
68
67
  import BriButton from "./components/small/BriButton.vue";
69
68
  import BriTree from "./components/small/BriTree.vue";
@@ -92,6 +91,7 @@ import DshBack from "./components/controls/special/DshBack.vue";
92
91
  import DshUndeveloped from "./components/controls/special/DshUndeveloped.vue";
93
92
  // other
94
93
  import ZIframe from "./components/other/ZIframe.vue";
94
+ import BriSvg from "./components/other/BriSvg.vue";
95
95
 
96
96
  // !!!!!!挂载全局的组件,不是别写在这
97
97
  const map = {
@@ -147,10 +147,11 @@ const map = {
147
147
  DshSteps,
148
148
  Ctooltip,
149
149
  DshPage,
150
- DshControlDefine,
151
150
  DshFileShow,
152
151
  BriButton,
153
- BriTree
152
+ BriTree,
153
+
154
+ BriSvg
154
155
  };
155
156
  const install = function (Vue, opts = {}) {
156
157
  ViewUI.LoadingBar.config({
@@ -235,7 +236,6 @@ export {
235
236
  DshSteps,
236
237
  Ctooltip,
237
238
  DshPage,
238
- DshControlDefine,
239
239
  DshFileShow,
240
240
  BriButton,
241
241
  BriTree,
@@ -260,5 +260,6 @@ export {
260
260
  DshBack,
261
261
  DshUndeveloped,
262
262
 
263
- ZIframe
263
+ ZIframe,
264
+ BriSvg
264
265
  };