doway-coms 1.4.37 → 1.4.39

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": "doway-coms",
3
- "version": "1.4.37",
3
+ "version": "1.4.39",
4
4
  "description": "doway组件库",
5
5
  "author": "dowaysoft",
6
6
  "main": "packages/index.js",
@@ -0,0 +1,8 @@
1
+ // 导入组件,组件必须声明 name
2
+ import BaseButton from './src/index.vue';
3
+ // 为组件提供 install 安装方法,供按需引入
4
+ BaseButton.install = function(Vue) {
5
+ Vue.component(BaseButton.name, BaseButton);
6
+ };
7
+ // 默认导出组件
8
+ export default BaseButton;
@@ -0,0 +1,241 @@
1
+ <template>
2
+ <div class="d-control-container">
3
+ <div class="d-control-label">
4
+ {{ colInfo.title
5
+ }}<span
6
+ v-if="colInfo.rules && colInfo.rules['required']"
7
+ class="d-control-label-required"
8
+ >*
9
+ </span>
10
+ </div>
11
+ <div class="d-control">
12
+ <ValidationProvider
13
+ :name="colInfo.title"
14
+ v-slot="v"
15
+ :rules="colInfo.rules"
16
+ >
17
+ <span
18
+ v-if="
19
+ currentValue !== null &&
20
+ currentValue !== '' &&
21
+ currentValue !== undefined
22
+ "
23
+ >
24
+ {{ currentValue }}&nbsp;&nbsp;&nbsp;
25
+ </span>
26
+ <Button type="primary" :size="'small'" @click="buttonClick">{{
27
+ colInfo.buttonTitle
28
+ }}</Button>
29
+ <div class="d-error-msg">
30
+ {{ v.errors[0] }}
31
+ </div>
32
+ <!-- 弹出框输入,单独保存接口 -->
33
+ <Modal
34
+ v-model="visibleModal"
35
+ :title="colInfo.buttonTitle + '--' + colInfo.title"
36
+ @ok="handleOk"
37
+ >
38
+ <!-- 文本框输入 -->
39
+ <Input
40
+ v-if="
41
+ colInfo.controlType == 'text' ||
42
+ colInfo.controlType == null ||
43
+ colInfo.controlType == undefined
44
+ "
45
+ :size="'small'"
46
+ v-model="showValue"
47
+ placeholder="请输入需保存的值"
48
+ style="width: 100%"
49
+ :class="{ 'd-error-input': v.errors.length > 0 }"
50
+ />
51
+ <!-- 文本框输入控件 -->
52
+ <BaseTextArea
53
+ v-if="colInfo.controlType === 'textarea'"
54
+ :label="colInfo.title"
55
+ v-model="currentValue"
56
+ :edit="true"
57
+ :rules="colInfo.rules"
58
+ />
59
+ <!-- 日期选择控件 -->
60
+ <BaseDate
61
+ v-if="colInfo.controlType === 'date'"
62
+ :label="colInfo.title"
63
+ v-model="currentValue"
64
+ :pastDate="colInfo.pastDate"
65
+ :rules="colInfo.rules"
66
+ :edit="true"
67
+ />
68
+ <!-- 日期时间控件 -->
69
+ <BaseDatetime
70
+ v-if="colInfo.controlType === 'datetime'"
71
+ :label="colInfo.title"
72
+ v-model="currentValue"
73
+ :pastDate="colInfo.pastDate"
74
+ :rules="colInfo.rules"
75
+ :edit="true"
76
+ />
77
+ <!-- 时间选择控件 -->
78
+ <BaseTime
79
+ v-if="colInfo.controlType === 'time'"
80
+ :label="colInfo.title"
81
+ v-model="currentValue"
82
+ :edit="true"
83
+ :rules="colInfo.rules"
84
+ />
85
+ <!-- 周数选择器 -->
86
+ <BaseDateWeek
87
+ v-if="colInfo.controlType === 'dateweek'"
88
+ :label="colInfo.title"
89
+ v-model="currentValue"
90
+ :edit="true"
91
+ :rules="colInfo.rules"
92
+ />
93
+ <!-- 数字输入 -->
94
+ <BaseNumberInput
95
+ v-if="colInfo.controlType === 'number'"
96
+ :label="colInfo.title"
97
+ v-model="currentValue"
98
+ :edit="true"
99
+ :rules="colInfo.rules"
100
+ :min="colInfo.min"
101
+ :max="colInfo.max"
102
+ :precision="colInfo.precision"
103
+ />
104
+ <BaseIntervalInput
105
+ v-if="colInfo.controlType === 'interval'"
106
+ :label="colInfo.title"
107
+ v-model="currentValue"
108
+ :edit="true"
109
+ :rules="colInfo.rules"
110
+ :displayType="colInfo.displayType"
111
+ :valueType="colInfo.valueType"
112
+ />
113
+ <!-- 单选框 -->
114
+ <BaseCheckbox
115
+ v-if="colInfo.controlType === 'checkbox'"
116
+ :label="colInfo.title"
117
+ v-model="currentValue"
118
+ :edit="true"
119
+ :rules="colInfo.rules"
120
+ />
121
+ <!-- 下拉选择器 -->
122
+ <BaseSelect
123
+ v-if="colInfo.controlType === 'select'"
124
+ :label="colInfo.title"
125
+ v-model="currentValue"
126
+ :edit="true"
127
+ :rules="colInfo.rules"
128
+ :dataSource="colInfo.dataSource"
129
+ />
130
+ <BaseSelectMulti
131
+ v-if="colInfo.controlType === 'dropmulti'"
132
+ :label="colInfo.title"
133
+ v-model="currentValue"
134
+ :edit="colInfo.edit"
135
+ :rules="colInfo.rules"
136
+ :dataSource="colInfo.dataSource"
137
+ />
138
+ <!-- 下拉表格容器 -->
139
+ <BasePulldown
140
+ v-if="colInfo.controlType === 'pulldown'"
141
+ :formRow="formRow"
142
+ :edit="true"
143
+ :defaultExpression="colInfo.defaultExpression"
144
+ :row="row"
145
+ :api="colInfo.api"
146
+ :optBtns="colInfo.optBtns"
147
+ :popupAddName="colInfo.popupAddName"
148
+ :popupAddPath="colInfo.popupAddPath"
149
+ :label="colInfo.title"
150
+ :rules="colInfo.rules"
151
+ :route="colInfo.route"
152
+ v-model="currentValue"
153
+ :field="colInfo.field"
154
+ :columns="colInfo.columns"
155
+ :pageSize="colInfo.pageSize"
156
+ :immediate="colInfo.immediate"
157
+ />
158
+ </Modal>
159
+ </ValidationProvider>
160
+ </div>
161
+ </div>
162
+ </template>
163
+ <script>
164
+ import { Modal, Input, Button } from 'ant-design-vue'
165
+ import { ValidationProvider } from 'vee-validate'
166
+ export default {
167
+ name: 'BaseButton',
168
+ components: {
169
+ ValidationProvider,
170
+ Modal,
171
+ Input,
172
+ Button,
173
+ },
174
+ data() {
175
+ return {
176
+ showValue: '',
177
+ // 弹出框是否展示
178
+ visibleModal: false
179
+ }
180
+ },
181
+ computed: {
182
+ currentValue: {
183
+ // 动态计算currentValue的值
184
+ get: function() {
185
+ return this.value // 将props中的value赋值给currentValue
186
+ },
187
+ set: function(val) {
188
+ this.$emit('input', val) // 通过$emit触发父组件
189
+ }
190
+ }
191
+ },
192
+ props: {
193
+ value: {
194
+ type: String,
195
+ default: function() {
196
+ return ''
197
+ }
198
+ },
199
+ colInfo: {
200
+ type: Object,
201
+ default: function() {
202
+ return {}
203
+ }
204
+ },
205
+ row: {
206
+ // 当前行,如果是表单的话当前行和当前页面数据集是一样的
207
+ type: Object,
208
+ default: function() {
209
+ return {}
210
+ }
211
+ },
212
+ formRow: {
213
+ // 当前页面数据集
214
+ type: Object,
215
+ default: () => {
216
+ return {}
217
+ }
218
+ }
219
+ },
220
+ created() {},
221
+ mounted() {
222
+ // 将父组件的值拿来用,确认更改前不改变外部的值
223
+ this.showValue = this.value
224
+ },
225
+ methods: {
226
+ // 弹出框显示
227
+ buttonClick() {
228
+ this.visibleModal = true
229
+ },
230
+ // 确认
231
+ handleOk() {
232
+ this.$emit('handleOk', this.showValue)
233
+ this.$nextTick(() => {
234
+ this.visibleModal = false
235
+ })
236
+ }
237
+ }
238
+ }
239
+ </script>
240
+
241
+ <style lang="scss" scoped></style>
@@ -29,7 +29,7 @@
29
29
  />
30
30
  <!-- 按钮弹出框输入控件 -->
31
31
  <!-- isButtonShow字段是额外添加字段,用于控制区分输入框控件 -->
32
- <base-button
32
+ <BaseButton
33
33
  v-if="col.isButtonShow == true"
34
34
  v-model="row[col.field]"
35
35
  :colInfo="col"
@@ -268,6 +268,7 @@ import BaseDate from "../../BaseDate/index";
268
268
  import BaseDatetime from "../../BaseDatetime/index";
269
269
  import BaseDateWeek from "../../BaseDateWeek/index";
270
270
  import BaseTextArea from "../../BaseTextArea/index";
271
+ import BaseButton from "../../BaseButton/index";
271
272
  import BaseSelect from "../../BaseSelect/index";
272
273
  import BaseSelectMulti from "../../BaseSelectMulti/index";
273
274
  import BaseTime from "../../BaseTime/index";
@@ -284,6 +285,7 @@ export default {
284
285
  BaseDatetime,
285
286
  BaseDateWeek,
286
287
  BaseTextArea,
288
+ BaseButton,
287
289
  BaseSelect,
288
290
  BaseSelectMulti,
289
291
  BaseTime,
@@ -2350,7 +2350,6 @@ export default {
2350
2350
  };
2351
2351
  let expStr = "";
2352
2352
  let filterBindingValues = loopColInfo.filters[0].data.bindingValues;
2353
- debugger
2354
2353
  //筛选条件过滤
2355
2354
  let colFilterExpression = { operator: "or", expressions: [] };
2356
2355
 
@@ -13,10 +13,8 @@
13
13
  <div class="attach" v-if="internalRow.attach.content === 'image'">
14
14
  <img
15
15
  @click="attachFileClick(internalRow.attach)"
16
- :style="{ height: height, lineHeight: height }"
16
+ :style="{ height: height, lineHeight: height, width: width }"
17
17
  style="
18
- min-width: 100px;
19
- width: 100%;
20
18
  border: 1px solid #ccc;
21
19
  border-radius: 6px;
22
20
  overflow: hidden;
@@ -41,18 +39,11 @@
41
39
  type="eye"
42
40
  @click="viewAttach(internalRow.attach)"
43
41
  />
44
- <!-- <VxeCheckbox
45
- class="attach-circle"
46
- v-model="internalRow.isDefault"
47
- @change="circleAttach(internalRow.attach, internalRow)"
48
- :disabled="formState == 'view'"
49
- ></VxeCheckbox> -->
50
42
  </div>
51
43
  <div class="attach" v-else>
52
44
  <img
53
45
  @click="attachFileClick(internalRow.attach)"
54
- class="o_image"
55
- style="width: 100%"
46
+ :style="{ height: height, lineHeight: height, width: width }"
56
47
  :data-mimetype="internalRow.attach.contentType"
57
48
  />
58
49
  <a-icon
@@ -71,12 +62,6 @@
71
62
  type="eye"
72
63
  @click="viewAttach(internalRow.attach)"
73
64
  />
74
- <!-- <VxeCheckbox
75
- class="attach-circle"
76
- v-model="internalRow.isDefault"
77
- @change="circleAttach(internalRow.attach, internalRow)"
78
- :disabled="formState == 'view'"
79
- ></VxeCheckbox> -->
80
65
  </div>
81
66
  <div
82
67
  :style="{ width: width }"
@@ -125,28 +110,11 @@
125
110
  :height="550"
126
111
  :width="800"
127
112
  destroy-on-close
128
- :fullscreen="isFullscreen || dialogViewType == 'application/pdf'"
113
+ :fullscreen="dialogViewType == 'application/pdf'"
129
114
  :z-index="999"
130
115
  >
131
- <!-- 添加普通图片全屏属性控制 -->
132
116
  <template #title>
133
- <div
134
- v-if="dialogViewType !== 'application/pdf'"
135
- style="text-align: right; margin-right: 15px; padding-top: 5px"
136
- >
137
- <!-- 全屏 -->
138
- <i
139
- v-if="!isFullscreen"
140
- style="font-size: 19px; margin-right: 10px"
141
- @click="screenClick"
142
- ></i>
143
- <!-- 取消全屏 -->
144
- <i
145
- v-else
146
- style="font-size: 19px; margin-right: 10px"
147
- @click="narrowClick"
148
- ></i>
149
- </div>
117
+ <span>{{ currentFileTitle }}</span>
150
118
  </template>
151
119
  <!-- pdf -->
152
120
  <embed
@@ -199,7 +167,7 @@ export default {
199
167
  uploadHeaders: {
200
168
  Authorization: null,
201
169
  },
202
- isFullscreen: false,
170
+ currentFileTitle: ''
203
171
  };
204
172
  },
205
173
  props: {
@@ -457,20 +425,11 @@ export default {
457
425
  this.dialogViewType = attachFile.contentType;
458
426
  this.dialogVisible = true;
459
427
  }
428
+ this.currentFileTitle = attachFile.name
460
429
  },
461
430
  closePdf() {
462
431
  this.isShowPdf = false;
463
432
  },
464
- // 放大
465
- screenClick() {
466
- this.isFullscreen = true;
467
- },
468
- // 局部展示
469
- narrowClick() {
470
- this.isFullscreen = false;
471
- },
472
- // 单选改变事件
473
- // change
474
433
  },
475
434
  };
476
435
  </script>
package/packages/index.js CHANGED
@@ -20,6 +20,7 @@ import BasePrintPreview from './BasePrintPreview/index';
20
20
  import BaseGantt from "./BaseGantt/index";
21
21
  import BaseKanbanEmpty from "./BaseKanbanEmpty/index";
22
22
  import BaseSearch from "./BaseSearch/index";
23
+ import BaseButton from "./BaseButton/index";
23
24
 
24
25
  import store from './utils/store'
25
26
  import request from './utils/request'
@@ -31,7 +32,7 @@ const components = [
31
32
  BaseTextArea, BaseSelect, BaseSelectMulti, BaseTime, BasePagination,
32
33
  BaseNumberInput, BaseTool, BaseToolStatus, BasePulldown, BaseIntervalInput,
33
34
  BaseForm, BasePictureCard, BaseGrid, BasePrintPreview, BaseGantt,
34
- BaseKanbanEmpty, BaseSearch
35
+ BaseKanbanEmpty, BaseSearch, BaseButton
35
36
  ];
36
37
  // 定义 install 方法,接收 Vue 作为参数。如果使用 use 注册插件,则所有的组件都将被注册
37
38
 
@@ -156,6 +157,7 @@ export {
156
157
  BaseGantt,
157
158
  BaseKanbanEmpty,
158
159
  BaseSearch,
160
+ BaseButton,
159
161
  store,
160
162
  request,
161
163
  }