gyyg-components 0.2.8 → 0.2.9

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": "gyyg-components",
3
- "version": "0.2.8",
3
+ "version": "0.2.9",
4
4
  "private": false,
5
5
  "main": "lib/gyyg-components.umd.js",
6
6
  "scripts": {
package/src/App.vue CHANGED
@@ -13,8 +13,9 @@
13
13
  @show="show"
14
14
  ></mec-input-table>-->
15
15
  <!-- <mec-form :formData="formData" :showBtn="true" @submit="submit"></mec-form> -->
16
- <mec-search-form :formGroups="formGroups"></mec-search-form>
17
16
 
17
+ <mec-form ref="planForm" :formData="formData" :label-width="'100px'"></mec-form>
18
+ <mec-popover-button :btnInfo="btnInfo"></mec-popover-button>
18
19
  </div>
19
20
  </template>
20
21
 
@@ -23,27 +24,36 @@ export default {
23
24
  data() {
24
25
  const _this = this;
25
26
  return {
26
- formGroups: {
27
- abLifeSupport: {
28
- componentName: 'mec-radio',
29
- label: '生命支持',
30
- labelWidth: "100px",
31
- options: [
32
- {
33
- label: '是',
34
- value: true
27
+ formData:{
28
+ // 日期组件
29
+ wpaApplicationDate: {
30
+ label: '申请日期',
31
+ componentName: 'mec-date-picker',
32
+ placeholder: '请选择日期',
33
+ dateType: 'datetime',
34
+ col: 12,
35
+ valueFormat: 'yyyy-MM-dd HH:mm:ss',
36
+ value: '',
37
+ rules: [{ required: true, message: '请选择日期', trigger: 'change' }],
35
38
  },
36
- {
37
- label: '否',
38
- value: false
39
- },
40
- ],
41
- value: '',
42
- }
39
+ },
40
+ btnInfo: {
41
+ text: '操作',
42
+ type: 'primary',
43
+ disabled: false,
44
+ hasPermi: '',
45
+ options: [
46
+ { id: '1', label: '选项1', hasPermi: '' },
47
+ { id: '2', label: '选项2', hasPermi: '' },
48
+ { id: '3', label: '选项3' }
49
+ ]
43
50
  }
44
51
  };
45
52
  },
46
53
  methods: {
54
+ handleEnter() {
55
+ console.log('enter');
56
+ },
47
57
  },
48
58
  // methods: {
49
59
  // handleRowClick(row) {
@@ -187,7 +187,7 @@ export default {
187
187
  }
188
188
  </script>
189
189
 
190
- <style lang="less">
190
+ <style lang="less" scoped>
191
191
  .el-dialog__wrapper {
192
192
  overflow: hidden;
193
193
  display: flex;
@@ -1,15 +1,16 @@
1
1
  <template>
2
2
  <div class="btn-group">
3
- <div v-for="btn in btnList" :key="btn.id">
3
+ <div v-for="btn in btnList" :key="btn.id"
4
+ v-has-permi="btn.hasPermi ? [btn.hasPermi] : undefined">
4
5
  <el-button
5
6
  v-if="!btn['componentType']"
6
- v-has-permi="[btn.hasPermi]"
7
7
  :disabled="btn.disabled"
8
- :size="btn.size"
8
+ :size="btn.size || 'small'"
9
9
  :type="btn.type"
10
10
  :icon="!btn.rightIcon ? btn.icon: ''"
11
11
  :loading="btn.loading"
12
12
  @click="btnClick(btn)"
13
+ :plain="btn.plain || true"
13
14
  >{{ btn.text }}
14
15
  <i v-if="btn.rightIcon" :class="btn.icon + ' el-icon--right'"></i>
15
16
  </el-button>
@@ -20,7 +21,6 @@
20
21
  ></component>
21
22
  </div>
22
23
  </div>
23
-
24
24
  </div>
25
25
  </template>
26
26
  <script>
@@ -51,7 +51,10 @@ export default {
51
51
  flex-wrap: wrap;
52
52
  &>div {
53
53
  margin-left: 15px;
54
- margin-bottom: 15px;
54
+ margin-bottom: 10px;
55
+ &:first-child {
56
+ margin-left: 0;
57
+ }
55
58
  }
56
59
  }
57
60
  </style>
@@ -20,7 +20,7 @@
20
20
  :modal='modal'
21
21
  >
22
22
  <slot name="body" />
23
- <div v-if="footer" slot="footer" class="dialog-footer">
23
+ <div v-if="footer" slot="footer">
24
24
  <slot name="footer" />
25
25
  </div>
26
26
  </el-dialog>
@@ -129,7 +129,7 @@ export default {
129
129
  .base-dialog {
130
130
  text-align: left;
131
131
  }
132
- .el-dialog__wrapper {
132
+ /deep/.el-dialog__wrapper {
133
133
  overflow: hidden;
134
134
  display: flex;
135
135
  justify-content: center;
@@ -165,13 +165,12 @@ export default {
165
165
  flex: 1;
166
166
  overflow: auto;
167
167
  padding: 20px;
168
+ padding-bottom: 52px;
168
169
  }
169
170
 
170
171
  .el-dialog__footer {
171
- flex-shrink: 0;
172
- box-sizing: content-box;
173
- height: 32px;
174
- padding: 10px;
172
+ box-sizing: border-box;
173
+ padding: 10px 20px;
175
174
  border: none;
176
175
  background-color: #efefef;
177
176
  border-bottom-left-radius: 8px;
@@ -73,5 +73,10 @@ export default {
73
73
  },
74
74
  };
75
75
  </script>
76
- <style lang="less">
76
+ <style lang="less" scoped>
77
+ ::v-deep.el-form::after {
78
+ content: "";
79
+ display: table;
80
+ clear: both;
81
+ }
77
82
  </style>
@@ -15,6 +15,7 @@
15
15
  :autosize="autosize"
16
16
  @input="handleInput"
17
17
  @clear="clear"
18
+ @keyup.enter.native="handleEnter"
18
19
  >
19
20
  <div slot="prepend" v-if="prependText" @click="btnClick" :style="disabled ? 'cursor: not-allowed' : 'cursor: pointer'">{{ prependText }}</div>
20
21
  <div slot="append" v-if="appendText" @click="btnClick" :style="disabled ? 'cursor: not-allowed' : 'cursor: pointer'">{{ appendText }}</div>
@@ -130,15 +131,16 @@
130
131
  value = value.replace(/[^a-zA-Z\s]/g, '');
131
132
  }
132
133
  this.inputValue = value
133
- console.log(this.inputType);
134
134
  this.$emit('input', value);
135
135
  },
136
136
  clear() {
137
137
  this.$emit('clear')
138
138
  },
139
139
  btnClick() {
140
- console.log(123)
141
140
  this.$emit('btnClick')
141
+ },
142
+ handleEnter() {
143
+ this.$emit('enter')
142
144
  }
143
145
  },
144
146
  watch: {
@@ -1,7 +1,7 @@
1
1
  <template>
2
- <div class="popover-button" v-has-permi="[btnInfo.hasPermi]">
2
+ <div class="popover-button" v-has-permi="btnInfo.hasPermi ? [btnInfo.hasPermi] : undefined">
3
3
  <el-dropdown
4
- :size="btnInfo.size"
4
+ :size="btnInfo.size || 'small'"
5
5
  split-button
6
6
  :type="btnInfo.type"
7
7
  :disabled="btnInfo.disabled"
@@ -9,14 +9,16 @@
9
9
  placement="bottom-end"
10
10
  @click="clickEvent"
11
11
  @command="changeItem"
12
+ :class="dropdownClass"
12
13
  >
13
14
  {{ btnInfo.text}}
14
15
  <el-dropdown-menu slot="dropdown" class="right-arrow">
15
16
  <el-dropdown-item
16
17
  v-for="item in btnInfo.options"
17
18
  :key="item.id"
19
+ :icon="item.icon || ''"
18
20
  :command="item"
19
- v-has-permi="[item.hasPermi]"
21
+ v-has-permi="item.hasPermi ? [item.hasPermi] : undefined"
20
22
  >{{ item.label }}</el-dropdown-item>
21
23
  </el-dropdown-menu>
22
24
  </el-dropdown>
@@ -26,6 +28,14 @@
26
28
  export default {
27
29
  name: 'MecPopoverButton',
28
30
  props: ['btnInfo'],
31
+ computed: {
32
+ dropdownClass() {
33
+ if (this.btnInfo.plain === undefined) {
34
+ return 'is-plain';
35
+ }
36
+ return this.btnInfo.plain ? 'is-plain' : '';
37
+ }
38
+ },
29
39
  methods: {
30
40
  clickEvent(){
31
41
  if(this.btnInfo.trigger) {
@@ -45,4 +55,23 @@ export default {
45
55
  left: 65% !important;
46
56
  }
47
57
  }
58
+ /deep/ .el-dropdown__icon {
59
+ font-size: 11px
60
+ }
61
+ // /deep/ .el-dropdown-menu__item {
62
+ // background-color: #ecf5ff;
63
+ // color: #66b1ff;
64
+ // margin-top: 4px;
65
+ // }
66
+ /deep/ .el-dropdown.is-plain {
67
+ .el-button {
68
+ color: #409EFF;
69
+ background: #ecf5ff;
70
+ border-color: #b3d8ff;
71
+ }
72
+ .el-dropdown__caret-button::before {
73
+ background: #b3d8ff;
74
+ }
75
+ }
76
+
48
77
  </style>
@@ -20,8 +20,9 @@
20
20
  </template>
21
21
  <slot name="custom" :formGroups="formGroups"></slot>
22
22
  <el-form-item>
23
- <el-button type="primary" @click="search" style="margin-top: 5px">查询</el-button>
24
- <el-button type="info" icon="el-icon-refresh" @click="refresh" style="margin-top: 5px"></el-button>
23
+ <el-button type="primary" size="small" plain @click="search">查询</el-button>
24
+ <el-button type="primary" v-if="isSeniorBtn" size="small" plain @click="seniorSearch">高级搜索</el-button>
25
+ <el-button size="small" plain icon="el-icon-refresh" @click="refresh"></el-button>
25
26
  </el-form-item>
26
27
  </el-form>
27
28
  </div>
@@ -29,7 +30,13 @@
29
30
  <script>
30
31
  export default {
31
32
  name: 'MecSearchForm',
32
- props: ['formGroups'],
33
+ props: {
34
+ formGroups: {},
35
+ isSeniorBtn: {
36
+ type: Boolean,
37
+ default: false
38
+ }
39
+ },
33
40
  methods: {
34
41
 
35
42
  getProp(item, index) {
@@ -45,6 +52,9 @@ export default {
45
52
  },
46
53
  refresh() {
47
54
  this.$emit('refresh')
55
+ },
56
+ seniorSearch() {
57
+ this.$emit('seniorSearch')
48
58
  }
49
59
  }
50
60
  }
@@ -53,4 +63,8 @@ export default {
53
63
  /deep/ .el-form-item__content {
54
64
  width: 100%;
55
65
  }
66
+ /deep/ .el-form--inline .el-form-item {
67
+ margin-bottom: 10px;
68
+ vertical-align: middle;
69
+ }
56
70
  </style>
@@ -19,6 +19,7 @@
19
19
  :default-expand-all="defaultExpandAll"
20
20
  @row-click="rowClickHandel"
21
21
  @row-dblclick="rowDblclickHandel"
22
+ :border="border"
22
23
  >
23
24
  <!-- 多选框 -->
24
25
  <el-table-column
@@ -150,7 +151,7 @@ export default {
150
151
  required: false,
151
152
  default: () => {
152
153
  return {
153
- backgroundColor: "#fff",
154
+ backgroundColor: "#EFF3F8",
154
155
  }
155
156
  }
156
157
  },
@@ -183,7 +184,12 @@ export default {
183
184
  // 是否只选中当前行
184
185
  toggleRow: {
185
186
  default: false
187
+ },
188
+ border: {
189
+ type: Boolean,
190
+ default: true
186
191
  }
192
+
187
193
  },
188
194
  data() {
189
195
  return {
@@ -258,4 +264,7 @@ export default {
258
264
  text-align: right;
259
265
  height: 35px;
260
266
  }
267
+ /deep/ .el-table td.el-table__cell {
268
+ border-right: none;
269
+ }
261
270
  </style>
@@ -6,6 +6,7 @@
6
6
  Vue.directive('hasPermi', {
7
7
  inserted(el, binding, vnode) {
8
8
  const { value } = binding
9
+ console.log('value',value)
9
10
  const all_permission = "*:*:*";
10
11
  const permissions = localStorage.getItem('authorities').split(',')//用户拥有的权限
11
12
  if (value && value instanceof Array && value.length > 0) {
@@ -73,7 +73,6 @@ export default {
73
73
  align-items: center;
74
74
  user-select: none;
75
75
  cursor: pointer;
76
- padding: 5px;
77
76
  }
78
77
  .view-btn {
79
78
  &:hover {
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div class="default-text">
2
+ <div>
3
3
  <span class="default-text" :style="[statusStyle]"
4
4
  :class="tableData.getClass ? tableData.getClass(scope.row) : ''">{{ getText(tableData.bind) }}</span>
5
5
  </div>
@@ -27,25 +27,16 @@ export default {
27
27
  }
28
28
  </script>
29
29
  <style lang="less" scoped>
30
- .deathText {
31
- color: #909399;
32
- }
33
-
34
- .normalText {
35
- color: #67c23a;
36
- }
37
30
 
38
- .danger {
39
- color: #f56c6c;
40
- }
41
-
42
- .warning {
43
- color: #e6a23c;
44
- }
45
31
 
46
32
  .default-text {
47
33
  overflow: hidden;
48
34
  text-overflow: ellipsis;
49
35
  white-space: nowrap;
36
+ background-color: #409EFF;
37
+ color: #fff;
38
+ padding: 5px 15px;
39
+ border-radius: 20px;
40
+ font-size: 14px;
50
41
  }
51
42
  </style>