leisure-core 0.4.46 → 0.4.48

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.
@@ -27,6 +27,16 @@
27
27
  :width="column.width"
28
28
  :formatter="column.formatter"
29
29
  >
30
+ <template #default="scope">
31
+ <span v-if="column.type && column.type === 'url'">
32
+ <a :href="scope.row[column.prop]" target="_blank">{{
33
+ scope.row[column.prop]
34
+ }}</a>
35
+ </span>
36
+ <span v-else>
37
+ {{ scope.row[column.prop] }}
38
+ </span>
39
+ </template>
30
40
  </el-table-column>
31
41
  <el-table-column fixed="right" label="操作" align="center">
32
42
  <template slot-scope="scope">
@@ -87,6 +97,13 @@
87
97
  v-if="!item.type || item.type === 'input'"
88
98
  v-model="formPop[item.prop]"
89
99
  />
100
+ <el-input-number
101
+ v-else-if="item.type === 'number'"
102
+ v-model="formPop[item.prop]"
103
+ :min="item.min || 0"
104
+ :max="item.max || 9999999999"
105
+ label="item.label||''"
106
+ />
90
107
  <el-select
91
108
  v-else-if="item.type === 'select'"
92
109
  v-model="formPop[item.prop]"
@@ -184,7 +201,6 @@ export default {
184
201
  data() {
185
202
  return {
186
203
  formPop: {},
187
-
188
204
  searchData: {
189
205
  pageNo: 1,
190
206
  total: 1,
@@ -198,6 +214,12 @@ export default {
198
214
  this.getList();
199
215
  },
200
216
  methods: {
217
+ initFormItem() {
218
+ this.formPop = this.formColumns.reduce((acc, item) => {
219
+ acc[item.prop] = item.default;
220
+ return acc;
221
+ }, {});
222
+ },
201
223
  onClickQuery() {
202
224
  this.searchData.pageNo = 1;
203
225
  this.getList();
@@ -220,7 +242,7 @@ export default {
220
242
  this.showDialog = true;
221
243
  },
222
244
  addItem() {
223
- this.formPop = {};
245
+ this.initFormItem();
224
246
  this.showDialog = true;
225
247
  },
226
248
  saveData() {
@@ -230,6 +252,7 @@ export default {
230
252
  if (valid) {
231
253
  this.$emit("saveForm", this.formPop, () => {
232
254
  this.getList();
255
+ this.closeDialog();
233
256
  });
234
257
  } else {
235
258
  return false;
@@ -237,7 +260,7 @@ export default {
237
260
  });
238
261
  },
239
262
  closeDialog() {
240
- this.formPop = {};
263
+ this.initFormItem();
241
264
  this.showDialog = false;
242
265
  },
243
266
  getOptions(prop) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "leisure-core",
3
- "version": "0.4.46",
3
+ "version": "0.4.48",
4
4
  "description": "leisure-core是leisure-ui-core的简称,是京心数据基于vue2.0开发的一套后台系统框架与js库,包含登录,首页框架等",
5
5
  "private": false,
6
6
  "author": "北方乐逍遥(zcx7878)",