leisure-core 0.6.63 → 0.6.66
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/le-input-validate/src/main.vue +17 -0
- package/le-list/src/main.vue +75 -0
- package/le-user/src/main.vue +14 -0
- package/package.json +1 -1
|
@@ -11,11 +11,28 @@
|
|
|
11
11
|
@clear="handleClear"
|
|
12
12
|
@focus="handleFocus"
|
|
13
13
|
>
|
|
14
|
+
<!-- 显式透传 prepend 插槽 -->
|
|
15
|
+
<template v-if="$slots.prepend" #prepend>
|
|
16
|
+
<slot name="prepend" />
|
|
17
|
+
</template>
|
|
18
|
+
|
|
19
|
+
<!-- 显式透传 append 插槽 -->
|
|
20
|
+
<template v-if="$slots.append" #append>
|
|
21
|
+
<slot name="append" />
|
|
22
|
+
</template>
|
|
23
|
+
|
|
24
|
+
<!-- 显式透传 prefix 插槽 -->
|
|
25
|
+
<template v-if="$slots.prefix" #prefix>
|
|
26
|
+
<slot name="prefix" />
|
|
27
|
+
</template>
|
|
14
28
|
<template v-if="showCount" #suffix>
|
|
15
29
|
<span class="input-count" :class="{ 'is-error': isOverMaxLength }">
|
|
16
30
|
{{ valueLength }}/{{ computedMaxlength }}
|
|
17
31
|
</span>
|
|
18
32
|
</template>
|
|
33
|
+
<template v-else-if="$slots.suffix" #suffix>
|
|
34
|
+
<slot name="suffix" />
|
|
35
|
+
</template>
|
|
19
36
|
</el-input>
|
|
20
37
|
|
|
21
38
|
<div v-if="hasError && errorMessage" class="error-message">
|
package/le-list/src/main.vue
CHANGED
|
@@ -211,6 +211,10 @@ export default {
|
|
|
211
211
|
type: Boolean,
|
|
212
212
|
default: true,
|
|
213
213
|
},
|
|
214
|
+
autoOpenDetail: {
|
|
215
|
+
type: [Boolean, Object, String],
|
|
216
|
+
default: false,
|
|
217
|
+
},
|
|
214
218
|
},
|
|
215
219
|
watch: {
|
|
216
220
|
searchParam: {
|
|
@@ -231,6 +235,33 @@ export default {
|
|
|
231
235
|
},
|
|
232
236
|
immediate: false,
|
|
233
237
|
},
|
|
238
|
+
tableData: {
|
|
239
|
+
handler(newVal) {
|
|
240
|
+
if (
|
|
241
|
+
this.autoOpenDetail &&
|
|
242
|
+
!this.autoOpened &&
|
|
243
|
+
newVal &&
|
|
244
|
+
newVal.length
|
|
245
|
+
) {
|
|
246
|
+
this.$nextTick(() => {
|
|
247
|
+
this.tryAutoOpenDetail();
|
|
248
|
+
});
|
|
249
|
+
}
|
|
250
|
+
},
|
|
251
|
+
immediate: false, // 避免在 mounted 之前触发
|
|
252
|
+
deep: false,
|
|
253
|
+
},
|
|
254
|
+
autoOpenDetail: {
|
|
255
|
+
handler() {
|
|
256
|
+
this.autoOpened = false; // 重置标记,允许重新自动打开
|
|
257
|
+
if (this.tableData && this.tableData.length) {
|
|
258
|
+
this.$nextTick(() => {
|
|
259
|
+
this.tryAutoOpenDetail();
|
|
260
|
+
});
|
|
261
|
+
}
|
|
262
|
+
},
|
|
263
|
+
immediate: true,
|
|
264
|
+
},
|
|
234
265
|
},
|
|
235
266
|
data() {
|
|
236
267
|
return {
|
|
@@ -243,6 +274,8 @@ export default {
|
|
|
243
274
|
},
|
|
244
275
|
showDialog: false,
|
|
245
276
|
handleStatus: 0, //处理状态 0:详情 1:新增 2:编辑
|
|
277
|
+
|
|
278
|
+
autoOpened: false, // 防止重复打开
|
|
246
279
|
componentMap: {
|
|
247
280
|
url: {
|
|
248
281
|
component: "le-url",
|
|
@@ -346,6 +379,48 @@ export default {
|
|
|
346
379
|
this.$emit("detailCurrentRow", row);
|
|
347
380
|
this.showDialog = true;
|
|
348
381
|
},
|
|
382
|
+
openFirstDetail() {
|
|
383
|
+
if (this.tableData && this.tableData.length > 0) {
|
|
384
|
+
const firstRow = this.tableData[0];
|
|
385
|
+
this.detail(firstRow);
|
|
386
|
+
}
|
|
387
|
+
},
|
|
388
|
+
resetAutoOpenFlag() {
|
|
389
|
+
this.autoOpened = false;
|
|
390
|
+
},
|
|
391
|
+
tryAutoOpenDetail() {
|
|
392
|
+
if (this.autoOpened) return;
|
|
393
|
+
const config = this.autoOpenDetail;
|
|
394
|
+
if (!config) return;
|
|
395
|
+
|
|
396
|
+
let targetRow = null;
|
|
397
|
+
if (config === true || config === "first") {
|
|
398
|
+
if (this.tableData && this.tableData.length) {
|
|
399
|
+
targetRow = this.tableData[0];
|
|
400
|
+
} else {
|
|
401
|
+
console.warn("le-list: 表格数据为空,无法自动打开第一行详情");
|
|
402
|
+
return;
|
|
403
|
+
}
|
|
404
|
+
} else if (typeof config === "object" && config !== null) {
|
|
405
|
+
// 传入的对象即视为行数据
|
|
406
|
+
if (Object.keys(config).length) {
|
|
407
|
+
targetRow = config;
|
|
408
|
+
} else {
|
|
409
|
+
console.warn("le-list: 自动打开配置的行数据为空对象");
|
|
410
|
+
return;
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
if (targetRow) {
|
|
415
|
+
// 使用双重 nextTick 确保表格完全渲染后再打开弹窗,消除闪烁
|
|
416
|
+
this.$nextTick(() => {
|
|
417
|
+
setTimeout(() => {
|
|
418
|
+
this.detail(targetRow);
|
|
419
|
+
this.autoOpened = true;
|
|
420
|
+
}, 50); // 极短延迟,平滑过渡
|
|
421
|
+
});
|
|
422
|
+
}
|
|
423
|
+
},
|
|
349
424
|
addItem() {
|
|
350
425
|
this.handleStatus = 1;
|
|
351
426
|
this.$emit("handleStatus", this.handleStatus);
|
package/le-user/src/main.vue
CHANGED
|
@@ -19,6 +19,16 @@
|
|
|
19
19
|
<el-option label="是" value="1" key="1"></el-option>
|
|
20
20
|
</el-select>
|
|
21
21
|
</el-form-item>
|
|
22
|
+
<el-form-item label="后台用户">
|
|
23
|
+
<el-select
|
|
24
|
+
v-model="searchData.managered"
|
|
25
|
+
clearable
|
|
26
|
+
placeholder="请选择"
|
|
27
|
+
>
|
|
28
|
+
<el-option label="否" value="0" key="0"></el-option>
|
|
29
|
+
<el-option label="是" value="1" key="1"></el-option>
|
|
30
|
+
</el-select>
|
|
31
|
+
</el-form-item>
|
|
22
32
|
<el-form-item>
|
|
23
33
|
<el-button type="primary" @click="list">查询</el-button>
|
|
24
34
|
<el-button type="primary" @click="addUser">新建</el-button>
|
|
@@ -211,6 +221,7 @@ export default {
|
|
|
211
221
|
dataValue: [],
|
|
212
222
|
pageNo: 1,
|
|
213
223
|
total: 1,
|
|
224
|
+
managered: "",
|
|
214
225
|
},
|
|
215
226
|
userTypelsShow: true,
|
|
216
227
|
showYhj: false,
|
|
@@ -363,6 +374,9 @@ export default {
|
|
|
363
374
|
if (this.searchData.membered && this.searchData.membered.length > 0) {
|
|
364
375
|
params.membered = this.searchData.membered;
|
|
365
376
|
}
|
|
377
|
+
if (this.searchData.managered && this.searchData.managered.length > 0) {
|
|
378
|
+
params.managered = this.searchData.managered;
|
|
379
|
+
}
|
|
366
380
|
if (this.searchData.id && this.searchData.id.length > 0) {
|
|
367
381
|
params.id = this.searchData.id;
|
|
368
382
|
}
|