bri-components 1.2.16 → 1.2.18

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bri-components",
3
- "version": "1.2.16",
3
+ "version": "1.2.18",
4
4
  "author": "dengshanghui",
5
5
  "description": "a component lib for vue project",
6
6
  "main": "src/index.js",
@@ -2,13 +2,13 @@
2
2
  <div class="InfoCascader">
3
3
  <dsh-modal
4
4
  v-model="modalVal"
5
- :propsObj="modalPropsObj"
6
5
  mode="middle"
6
+ :propsObj="modalPropsObj"
7
7
  >
8
8
  <dsh-input
9
9
  class="InfoCascader-search"
10
10
  :value="searchData"
11
- :propsObj="inputPropsObj"
11
+ :propsObj="searchPropsObj"
12
12
  ></dsh-input>
13
13
 
14
14
  <div class="InfoCascader-content">
@@ -19,6 +19,7 @@
19
19
  :data="treeData"
20
20
  ></Tree>
21
21
  </div>
22
+
22
23
  <div class="InfoCascader-content-right">
23
24
  <div class="InfoCascader-content-right-title">
24
25
  {{curName}}说明
@@ -34,7 +35,7 @@
34
35
  <div class="InfoCascader-footer">
35
36
  <dsh-buttons
36
37
  class="InfoCascader-footer-btns"
37
- :list="$getOperationList(['cancel', 'confirm'])"
38
+ :list="$getOperationList(['canCancel', 'canConfirm'])"
38
39
  @click="$dispatchEvent($event)"
39
40
  ></dsh-buttons>
40
41
  </div>
@@ -46,7 +47,10 @@
46
47
  export default {
47
48
  name: "InfoCascader",
48
49
  props: {
49
- showModal: Boolean,
50
+ showModal: {
51
+ type: Boolean,
52
+ default: false
53
+ },
50
54
 
51
55
  value: {
52
56
  type: Array,
@@ -69,32 +73,34 @@
69
73
  },
70
74
  data () {
71
75
  return {
76
+ searchData: {
77
+ search: ""
78
+ },
79
+ searchPropsObj: {
80
+ _key: "search",
81
+ _name: "关键字搜索"
82
+ },
83
+ curSelect: {},
84
+
85
+ show: true,
86
+ curName: "",
72
87
  description: "",
88
+
73
89
  operationMap: {
74
- cancel: {
90
+ canCancel: {
75
91
  name: "取消",
76
92
  type: "clickCancel",
77
93
  event: "clickCancel",
78
94
  class: "z-default"
79
95
  },
80
- confirm: {
96
+ canConfirm: {
81
97
  name: "确定",
82
98
  btnType: "primary",
83
99
  type: "clickConfirm",
84
100
  event: "clickConfirm",
85
101
  class: "z-primary"
86
102
  }
87
- },
88
- curSelect: {},
89
- curName: "",
90
- searchData: {
91
- search: ""
92
- },
93
- inputPropsObj: {
94
- _key: "search",
95
- _name: "关键字搜索"
96
- },
97
- show: true
103
+ }
98
104
  };
99
105
  },
100
106
  computed: {
@@ -124,7 +124,8 @@
124
124
  created () {},
125
125
  methods: {
126
126
  onSearch (...params) {
127
- this.$emit("search", ...params);
127
+ this.$emit("search");
128
+ this.$emit("inputChange");
128
129
  },
129
130
  // 无参数
130
131
  onFocus () {
@@ -138,12 +139,17 @@
138
139
  }
139
140
  },
140
141
  onEnter (event) {
142
+ this.$emit("enter");
141
143
  this.$emit("inputChange");
142
144
  },
143
145
  // 参数event
144
146
  onChange (event) {
145
- this.$emit("inputChange");
146
147
  this.changeStatus = true;
148
+
149
+ clearTimeout(this.timer);
150
+ this.timer = setTimeout(() => {
151
+ this.$emit("inputChange");
152
+ }, 1000);
147
153
  },
148
154
  onClear () {
149
155
  this.change();
@@ -226,10 +226,10 @@
226
226
  callback: data => {
227
227
  this.initListData = [
228
228
  ...this.initListData,
229
- ...data.list.map(item =>
229
+ ...data.list.map(dataItem =>
230
230
  ({
231
- _key: item[item._key || "_key"],
232
- name: item[item._name || "name"]
231
+ _key: dataItem[item._key || "_key"],
232
+ name: dataItem[item._name || "name"]
233
233
  })
234
234
  )
235
235
  ];
@@ -51,7 +51,6 @@
51
51
  :propsObj="modalPropsObj"
52
52
  >
53
53
  <dsh-cascader-table
54
- v-if="curVal && isEnlarge"
55
54
  useCol
56
55
  :canEdit="finalCanEdit"
57
56
  :treeColumns="treeColumns"
@@ -56,7 +56,6 @@
56
56
  :propsObj="modalPropsObj"
57
57
  >
58
58
  <bri-flat-table
59
- v-if="isEnlarge"
60
59
  :canEdit="finalCanEdit"
61
60
  :columns="columns"
62
61
  :data="curVal.list"
@@ -19,11 +19,36 @@
19
19
  :value="curValList"
20
20
  :inputIcon="inputIcon"
21
21
  :propsObj="selfPropsObj"
22
- @clickDeleteItem="clickDeleteItem"
23
- @clickClear="clickClear"
22
+ @deleteItem="clickDeleteItem"
23
+ @clear="clickClear"
24
24
  ></bri-control-input>
25
25
 
26
- <!-- 查看 -->
26
+ <!-- 表格查看 -->
27
+ <div
28
+ v-else-if="isUnitShow"
29
+ class="selectUsers-unit"
30
+ >
31
+ <template v-if="!$isEmptyData(curValList)">
32
+ <img
33
+ v-for="item in curValList"
34
+ :src="item.avatarurl || $imageSrcMap.system.boy"
35
+ :key="item._key"
36
+ class="selectUsers-unit-img"
37
+ />
38
+ <span
39
+ v-if="curValList[0]"
40
+ class="selectUsers-unit-text"
41
+ >
42
+ {{ curValList[0].name || curValList[0].realname || curValList[0].mobile }}
43
+ </span>
44
+ </template>
45
+
46
+ <template v-else>
47
+ {{ emptyShowVal }}
48
+ </template>
49
+ </div>
50
+
51
+ <!-- 弹窗查看 -->
27
52
  <div
28
53
  v-else
29
54
  :class="{
@@ -50,8 +75,8 @@
50
75
  v-if="finalCanEdit"
51
76
  class="selectUsers-modal"
52
77
  v-model="showModal"
53
- :propsObj="modalPropsObj"
54
78
  mode="custom"
79
+ :propsObj="modalPropsObj"
55
80
  @cancel="clickCancel"
56
81
  >
57
82
  <div class="selectUsers-modal-wrap">
@@ -65,7 +90,7 @@
65
90
  <dsh-input
66
91
  :value="searchData"
67
92
  :propsObj="inputPropsObj"
68
- @change="search"
93
+ @inputChange="search"
69
94
  ></dsh-input>
70
95
  </div>
71
96
 
@@ -37,8 +37,11 @@
37
37
  <bri-loading
38
38
  class="bri-table-empty"
39
39
  :value="isLoading ? 1 : data.length? 0 : 2"
40
- :noText="noDataText"
41
- />
40
+ >
41
+ <template slot="nodata">
42
+ {{ noDataText }}
43
+ </template>
44
+ </bri-loading>
42
45
  </div>
43
46
  </template>
44
47
 
@@ -73,6 +76,7 @@
73
76
  scrollWidth: "0",
74
77
  borderY: true,
75
78
  fixedHeader: true,
79
+ canClick: false,
76
80
  cellSelectionOption: {
77
81
  enable: false
78
82
  },
@@ -88,11 +92,14 @@
88
92
  return this.propsObj.state || this.state;
89
93
  },
90
94
  selfClassName () {
95
+ let className = "";
96
+ if (this.selfPropsObj.canClick) {
97
+ className += "bri-table-click ";
98
+ }
91
99
  if (this.loading || !this.data.length) {
92
- return "bri-table-onlyhead";
93
- } else {
94
- return "";
100
+ className += "bri-table-onlyhead ";
95
101
  }
102
+ return className;
96
103
  },
97
104
 
98
105
  rowStyleOption () {
@@ -19,12 +19,11 @@
19
19
  <dsh-modal
20
20
  class="BriTree-modal"
21
21
  v-model="treeFormShow"
22
- :propsObj="treeFormPropsObj"
23
22
  mode="custom"
23
+ :propsObj="treeFormPropsObj"
24
24
  >
25
25
  <div class="BriTree-modal-content">
26
26
  <dsh-form
27
- v-if="treeFormShow"
28
27
  ref="treeForm"
29
28
  :formList="treeFormList"
30
29
  :formData="treeFormData"
@@ -12,7 +12,7 @@
12
12
 
13
13
  <div
14
14
  v-else
15
- class="dsh-flex-row-center-center BriIframe-nodata"
15
+ class="BriIframe-nodata"
16
16
  >
17
17
  <img
18
18
  :src="noData"
@@ -59,25 +59,20 @@
59
59
  methods: {
60
60
  init () {
61
61
  let iframe = this.$refs.BriIframe;
62
- if (!iframe) {
63
- return;
62
+ if (iframe) {
63
+ this.loading = true;
64
+ if (iframe.attachEvent) {
65
+ iframe.attachEvent("onreadystatechange", () => {
66
+ if (iframe.readyState === "complete" || iframe.readyState == "loaded") {
67
+ this.loading = false;
68
+ }
69
+ });
70
+ } else {
71
+ iframe.addEventListener("load", () => {
72
+ this.loading = false;
73
+ }, false);
74
+ }
64
75
  }
65
- this.loading = true;
66
- if (iframe.attachEvent) {
67
- iframe.attachEvent("onreadystatechange", () => {
68
- if (iframe.readyState === "complete" || iframe.readyState == "loaded") {
69
- this.loadingEnd();
70
- }
71
- });
72
- } else {
73
- iframe.addEventListener("load", () => {
74
- this.loadingEnd();
75
- }, false);
76
- }
77
-
78
- },
79
- loadingEnd () {
80
- this.loading = false;
81
76
  },
82
77
  /**
83
78
  * 在iframe页面使用举例:
@@ -8,22 +8,24 @@
8
8
  }"
9
9
  >
10
10
  <div class="BriLoading-main">
11
- <slot>
12
- <template v-if="value === 1">
11
+ <!-- loading -->
12
+ <template v-if="value === 1">
13
+ <slot>
13
14
  <div
14
15
  class="BriLoading-main-loading"
15
16
  :style="getStyle"
16
- >
17
- </div>
17
+ ></div>
18
18
  <div
19
19
  v-if="showLoadingText"
20
20
  class="BriLoading-main-loadingText"
21
21
  >
22
22
  {{ loadText }}
23
23
  </div>
24
- </template>
25
-
26
- <template v-else-if="value === 2">
24
+ </slot>
25
+ </template>
26
+ <!-- nodata -->
27
+ <template v-else-if="value === 2">
28
+ <slot name="nodata">
27
29
  <bri-svg :src="imgSrc" />
28
30
  <div
29
31
  v-if="noText"
@@ -31,8 +33,8 @@
31
33
  >
32
34
  {{ noText }}
33
35
  </div>
34
- </template>
35
- </slot>
36
+ </slot>
37
+ </template>
36
38
  </div>
37
39
  </div>
38
40
  </template>
@@ -1,21 +1,19 @@
1
1
  <template>
2
2
  <div class="DshBtnModal">
3
3
  <dsh-buttons
4
- :list="$getOperationList(['set'])"
4
+ :list="$getOperationList(['canSet'])"
5
5
  @click="$dispatchEvent($event)"
6
6
  ></dsh-buttons>
7
7
 
8
- <div v-if="showModal">
9
- <dsh-modal
10
- v-model="showModal"
11
- :mode="selfModalPropsObj.mode"
12
- :propsObj="selfModalPropsObj"
13
- >
14
- <div style="margin: 10px 30px;">
15
- <slot></slot>
16
- </div>
17
- </dsh-modal>
18
- </div>
8
+ <dsh-modal
9
+ v-model="showModal"
10
+ :mode="selfModalPropsObj.mode"
11
+ :propsObj="selfModalPropsObj"
12
+ >
13
+ <div style="margin: 10px 30px;">
14
+ <slot></slot>
15
+ </div>
16
+ </dsh-modal>
19
17
  </div>
20
18
  </template>
21
19
 
@@ -34,9 +32,9 @@
34
32
  return {
35
33
  showModal: false,
36
34
  operationMap: {
37
- set: {
35
+ canSet: {
38
36
  name: "设置默认内容",
39
- type: "set",
37
+ type: "canSet",
40
38
  btnType: "dashed",
41
39
  size: "default",
42
40
  long: true,
@@ -139,7 +139,7 @@
139
139
  },
140
140
  computed: {
141
141
  showList () {
142
- return this.useSearch
142
+ return this.useSearch && this.searchName
143
143
  ? this.list.filter(item => (item.name || item._name).includes(this.searchName))
144
144
  : this.list;
145
145
  }
@@ -5,6 +5,22 @@
5
5
 
6
6
  &-show {}
7
7
 
8
+ &-unit {
9
+ .dsh-ellipsis();
10
+
11
+ &-img {
12
+ width: 18px;
13
+ height: 18px;
14
+ vertical-align: middle;
15
+ margin-left: -5px;
16
+ border-radius: 50%;
17
+ }
18
+
19
+ &-text {
20
+ vertical-align: middle;
21
+ }
22
+ }
23
+
8
24
  // 弹框部分
9
25
  &-modal {
10
26
  &-wrap {
@@ -9,5 +9,6 @@
9
9
  .ivu-form-item-error-tip {
10
10
  top: 90%;
11
11
  left: 15px;
12
+ font-size: 12px;
12
13
  }
13
14
  }
@@ -52,6 +52,12 @@
52
52
  max-width: calc(100% - 20px);
53
53
  }
54
54
 
55
+ &-click {
56
+ td {
57
+ cursor: pointer;
58
+ }
59
+ }
60
+
55
61
  td {
56
62
  white-space: normal !important;
57
63
  }
@@ -12,5 +12,6 @@
12
12
  &-nodata {
13
13
  width: 100%;
14
14
  height: 100%;
15
+ .dsh-flex-row-center-center();
15
16
  }
16
17
  }