vue2-components-plus 1.0.19 → 1.0.21
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/dist/ComponentDemo/DirectivesDemo.vue +3 -3
- package/dist/ComponentDemo/NsTableDemo/SetupDemo.vue +14 -14
- package/dist/vue2-components-plus.css +1 -1
- package/dist/vue2-components-plus.es5.js +145 -163
- package/dist/vue2-components-plus.js +2 -2
- package/dist/vue2-components-plus.umd.cjs +1 -1
- package/package.json +2 -16
|
@@ -236,7 +236,7 @@
|
|
|
236
236
|
</div>
|
|
237
237
|
</div>
|
|
238
238
|
</template>
|
|
239
|
-
<script setup
|
|
239
|
+
<script setup>
|
|
240
240
|
import { ref, provide } from 'vue'
|
|
241
241
|
|
|
242
242
|
// v-sline 演示数据
|
|
@@ -270,7 +270,7 @@ const username = ref('')
|
|
|
270
270
|
const age = ref('')
|
|
271
271
|
const description = ref('')
|
|
272
272
|
// 自动完成搜索函数
|
|
273
|
-
function querySearch(queryString
|
|
273
|
+
function querySearch(queryString, cb) {
|
|
274
274
|
const results = queryString
|
|
275
275
|
? [
|
|
276
276
|
{ value: '测试用户1' },
|
|
@@ -313,7 +313,7 @@ function parentClick() {
|
|
|
313
313
|
eventResult.value = '父容器被点击了 - 这不应该发生,因为使用了v-event-unuse'
|
|
314
314
|
}
|
|
315
315
|
|
|
316
|
-
function childClick(event
|
|
316
|
+
function childClick(event) {
|
|
317
317
|
event.stopPropagation()
|
|
318
318
|
eventResult.value = '子容器被点击了 - v-event-use生效'
|
|
319
319
|
}
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
</div>
|
|
74
74
|
</template>
|
|
75
75
|
|
|
76
|
-
<script setup
|
|
76
|
+
<script setup>
|
|
77
77
|
import { computed, getCurrentInstance, nextTick, onMounted, ref } from 'vue'
|
|
78
78
|
import { departmentOptions, fetchDepartmentOptions, fetchStatusOptions, filterUsers, mockUsers } from './mockData'
|
|
79
79
|
|
|
@@ -298,8 +298,8 @@ const containerRef = ref()
|
|
|
298
298
|
const loading = ref(false)
|
|
299
299
|
const total = ref(0)
|
|
300
300
|
const tableData = ref([])
|
|
301
|
-
const searchParams = ref
|
|
302
|
-
const paginationMode = ref
|
|
301
|
+
const searchParams = ref({})
|
|
302
|
+
const paginationMode = ref('backend')
|
|
303
303
|
const mockUserCount = mockUsers.length
|
|
304
304
|
const externalSearchParams = { source: 'vue2-demo' }
|
|
305
305
|
const searchProps = { labelWidth: '90px' }
|
|
@@ -317,21 +317,21 @@ const mergedTableProps = computed(() => ({
|
|
|
317
317
|
stripe: true,
|
|
318
318
|
}))
|
|
319
319
|
|
|
320
|
-
function handleKeywordEnter(event
|
|
320
|
+
function handleKeywordEnter(event) {
|
|
321
321
|
if (event && event.key === 'Enter') {
|
|
322
322
|
handleSearch(containerRef.value ? containerRef.value.getSearchFormData() : {})
|
|
323
323
|
}
|
|
324
324
|
}
|
|
325
325
|
|
|
326
|
-
function getStatusType(status
|
|
326
|
+
function getStatusType(status) {
|
|
327
327
|
return status === 1 ? 'success' : 'danger'
|
|
328
328
|
}
|
|
329
329
|
|
|
330
|
-
function getStatusText(status
|
|
330
|
+
function getStatusText(status) {
|
|
331
331
|
return status === 1 ? '启用' : '禁用'
|
|
332
332
|
}
|
|
333
333
|
|
|
334
|
-
function getDepartmentText(value
|
|
334
|
+
function getDepartmentText(value) {
|
|
335
335
|
const matched = departmentOptions.find(function (item) {
|
|
336
336
|
return item.value === value
|
|
337
337
|
})
|
|
@@ -344,7 +344,7 @@ function getCurrentPagination() {
|
|
|
344
344
|
: { currentPage1: 1, pageSize1: 10 }
|
|
345
345
|
}
|
|
346
346
|
|
|
347
|
-
function paginateList(list
|
|
347
|
+
function paginateList(list, pagination) {
|
|
348
348
|
const currentPage = Number(pagination.currentPage1 || 1)
|
|
349
349
|
const pageSize = Number(pagination.pageSize1 || 10)
|
|
350
350
|
const start = (currentPage - 1) * pageSize
|
|
@@ -399,7 +399,7 @@ async function loadData() {
|
|
|
399
399
|
}
|
|
400
400
|
}
|
|
401
401
|
|
|
402
|
-
function handleSearch(params
|
|
402
|
+
function handleSearch(params) {
|
|
403
403
|
searchParams.value = Object.assign({}, params)
|
|
404
404
|
loadData()
|
|
405
405
|
}
|
|
@@ -408,7 +408,7 @@ function handleReset() {
|
|
|
408
408
|
proxy?.$message?.info('搜索条件已重置')
|
|
409
409
|
}
|
|
410
410
|
|
|
411
|
-
function handleSelectionChange(selection
|
|
411
|
+
function handleSelectionChange(selection) {
|
|
412
412
|
if (selection && selection.length) {
|
|
413
413
|
proxy?.$message?.success('当前选中 ' + selection.length + ' 行')
|
|
414
414
|
}
|
|
@@ -426,7 +426,7 @@ function getSelectedKeys() {
|
|
|
426
426
|
proxy?.$message?.success('当前选中 ID:' + (keys.length ? keys.join(', ') : '无'))
|
|
427
427
|
}
|
|
428
428
|
|
|
429
|
-
function selectRows(ids
|
|
429
|
+
function selectRows(ids) {
|
|
430
430
|
if (!containerRef.value) return
|
|
431
431
|
containerRef.value.setSelectionKeys(ids)
|
|
432
432
|
proxy?.$message?.success('已尝试选中 ID:' + ids.join(', '))
|
|
@@ -455,15 +455,15 @@ function handleAdd() {
|
|
|
455
455
|
proxy?.$message?.success('点击了新增按钮')
|
|
456
456
|
}
|
|
457
457
|
|
|
458
|
-
function handleView(row
|
|
458
|
+
function handleView(row) {
|
|
459
459
|
proxy?.$message?.info('查看:' + row.username)
|
|
460
460
|
}
|
|
461
461
|
|
|
462
|
-
function handleEdit(row
|
|
462
|
+
function handleEdit(row) {
|
|
463
463
|
proxy?.$message?.success('编辑:' + row.username)
|
|
464
464
|
}
|
|
465
465
|
|
|
466
|
-
function handleDelete(row
|
|
466
|
+
function handleDelete(row) {
|
|
467
467
|
if (row.status === 0) {
|
|
468
468
|
proxy?.$message?.warning('禁用状态用户不可删除')
|
|
469
469
|
return
|
|
@@ -1 +1 @@
|
|
|
1
|
-
html,body{margin:0;padding:0}*{box-sizing:border-box}:root{--matrix-form-title-width: 18px;--matrix-form-title-height: 18px;--matrix-form-title-gap: 8px;--matrix-form-title-color: #303133;--matrix-form-title-margin-bottom: 12px;--matrix-form-title-content-padding: 0;--matrix-form-title-icon: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAOCAYAAADJ7fe0AAAAAXNSR0IArs4c6QAAAElJREFUOE9jZMABOKv/HwVJfW9ltCbEZqSpIbgMxyaO4hJCzkb3GsxA6htCiheQ1TKS6wXqG0KuF1Bcgswh12uDKHZomuxJCR8ApFSZL0U+kogAAAAASUVORK5CYII=);--matrix-dialog-bk-color: #ffffff;--matrix-dialog-border-radius: 8px;--matrix-dialog-box-shadow: 0 12px 32px rgba(31, 35, 41, .12);--matrix-dialog-header-bg-color: #f5f7fa;--matrix-dialog-header-text-color: #303133;--matrix-dialog-header-height: 54px;--matrix-dialog-padding-top-bottom: 16px;--matrix-dialog-padding-left-right: 20px;--matrix-dialog-footer-gap: 12px}.ns-dialog-plus-modal{background-color:#00000073}.ns-dynamic-form[data-v-4efb4504]{width:100%}.ns-dynamic-form__row[data-v-4efb4504]{display:flex;flex-wrap:wrap;gap:var(--ns-form-col-gap)}.ns-dynamic-form__item[data-v-4efb4504]{display:flex;align-items:flex-start;padding:0}.ns-dynamic-form__item.has-children[data-v-4efb4504]{align-items:stretch}.ns-dynamic-form.is-vertical .ns-dynamic-form__item[data-v-4efb4504],.ns-dynamic-form__child[data-v-4efb4504]{background:var(--ns-form-background-color);border-radius:4px}.ns-dynamic-form__label[data-v-4efb4504],.ns-dynamic-form__group-label[data-v-4efb4504]{flex:none;width:var(--ns-form-label-width);min-height:var(--ns-form-item-height);line-height:var(--ns-form-item-height);padding-right:12px;color:var(--ns-form-label-color);word-break:break-all}.ns-dynamic-form__group-label[data-v-4efb4504]{width:var(--ns-form-super-label-width);color:var(--ns-form-label-color)}.ns-dynamic-form__label.has-point[data-v-4efb4504]:before{content:"*";color:#f56c6c;margin-right:4px}.ns-dynamic-form__value[data-v-4efb4504]{flex:1;min-width:0;line-height:var(--ns-form-item-height)}.ns-dynamic-form__children[data-v-4efb4504]{flex:1}.ns-dynamic-form__child[data-v-4efb4504]{display:flex;padding:6px 0}.ns-dynamic-form__form-item[data-v-4efb4504]{margin-bottom:0}.ns-dynamic-form__form-item[data-v-4efb4504] .el-form-item__content{line-height:normal}.ns-dynamic-form.is-table[data-v-4efb4504]{border:1px solid #ebeef5;border-bottom:0}.ns-dynamic-form.is-table .ns-dynamic-form__row[data-v-4efb4504]{gap:0;margin-bottom:0!important}.ns-dynamic-form.is-table .ns-dynamic-form__item[data-v-4efb4504]{padding:12px;border-right:1px solid #ebeef5;border-bottom:1px solid #ebeef5}.ns-dynamic-form.is-table .ns-dynamic-form__item[data-v-4efb4504]:last-child{border-right:0}.ns-form-title[data-v-29c80ec1]{width:100%;display:flex;flex-direction:column;margin-bottom:var(--matrix-form-title-margin-bottom)}.ns-form-title__header[data-v-29c80ec1]{display:flex;align-items:center;gap:var(--matrix-form-title-gap);margin-bottom:var(--matrix-form-title-margin-bottom);color:var(--matrix-form-title-color)}.ns-form-title__icon[data-v-29c80ec1]{display:inline-block;width:var(--matrix-form-title-width);height:var(--matrix-form-title-height);border-radius:4px;background:var(--matrix-form-title-icon) no-repeat center center / 100% auto}.ns-form-title__text[data-v-29c80ec1]{font-size:18px;font-weight:500;color:var(--matrix-form-title-color)}.ns-form-title__content[data-v-29c80ec1]{width:100%}.page-search[data-v-
|
|
1
|
+
html,body{margin:0;padding:0}*{box-sizing:border-box}:root{--matrix-form-title-width: 18px;--matrix-form-title-height: 18px;--matrix-form-title-gap: 8px;--matrix-form-title-color: #303133;--matrix-form-title-margin-bottom: 12px;--matrix-form-title-content-padding: 0;--matrix-form-title-icon: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAOCAYAAADJ7fe0AAAAAXNSR0IArs4c6QAAAElJREFUOE9jZMABOKv/HwVJfW9ltCbEZqSpIbgMxyaO4hJCzkb3GsxA6htCiheQ1TKS6wXqG0KuF1Bcgswh12uDKHZomuxJCR8ApFSZL0U+kogAAAAASUVORK5CYII=);--matrix-dialog-bk-color: #ffffff;--matrix-dialog-border-radius: 8px;--matrix-dialog-box-shadow: 0 12px 32px rgba(31, 35, 41, .12);--matrix-dialog-header-bg-color: #f5f7fa;--matrix-dialog-header-text-color: #303133;--matrix-dialog-header-height: 54px;--matrix-dialog-padding-top-bottom: 16px;--matrix-dialog-padding-left-right: 20px;--matrix-dialog-footer-gap: 12px}.ns-dialog-plus-modal{background-color:#00000073}.ns-dynamic-form[data-v-4efb4504]{width:100%}.ns-dynamic-form__row[data-v-4efb4504]{display:flex;flex-wrap:wrap;gap:var(--ns-form-col-gap)}.ns-dynamic-form__item[data-v-4efb4504]{display:flex;align-items:flex-start;padding:0}.ns-dynamic-form__item.has-children[data-v-4efb4504]{align-items:stretch}.ns-dynamic-form.is-vertical .ns-dynamic-form__item[data-v-4efb4504],.ns-dynamic-form__child[data-v-4efb4504]{background:var(--ns-form-background-color);border-radius:4px}.ns-dynamic-form__label[data-v-4efb4504],.ns-dynamic-form__group-label[data-v-4efb4504]{flex:none;width:var(--ns-form-label-width);min-height:var(--ns-form-item-height);line-height:var(--ns-form-item-height);padding-right:12px;color:var(--ns-form-label-color);word-break:break-all}.ns-dynamic-form__group-label[data-v-4efb4504]{width:var(--ns-form-super-label-width);color:var(--ns-form-label-color)}.ns-dynamic-form__label.has-point[data-v-4efb4504]:before{content:"*";color:#f56c6c;margin-right:4px}.ns-dynamic-form__value[data-v-4efb4504]{flex:1;min-width:0;line-height:var(--ns-form-item-height)}.ns-dynamic-form__children[data-v-4efb4504]{flex:1}.ns-dynamic-form__child[data-v-4efb4504]{display:flex;padding:6px 0}.ns-dynamic-form__form-item[data-v-4efb4504]{margin-bottom:0}.ns-dynamic-form__form-item[data-v-4efb4504] .el-form-item__content{line-height:normal}.ns-dynamic-form.is-table[data-v-4efb4504]{border:1px solid #ebeef5;border-bottom:0}.ns-dynamic-form.is-table .ns-dynamic-form__row[data-v-4efb4504]{gap:0;margin-bottom:0!important}.ns-dynamic-form.is-table .ns-dynamic-form__item[data-v-4efb4504]{padding:12px;border-right:1px solid #ebeef5;border-bottom:1px solid #ebeef5}.ns-dynamic-form.is-table .ns-dynamic-form__item[data-v-4efb4504]:last-child{border-right:0}.ns-form-title[data-v-29c80ec1]{width:100%;display:flex;flex-direction:column;margin-bottom:var(--matrix-form-title-margin-bottom)}.ns-form-title__header[data-v-29c80ec1]{display:flex;align-items:center;gap:var(--matrix-form-title-gap);margin-bottom:var(--matrix-form-title-margin-bottom);color:var(--matrix-form-title-color)}.ns-form-title__icon[data-v-29c80ec1]{display:inline-block;width:var(--matrix-form-title-width);height:var(--matrix-form-title-height);border-radius:4px;background:var(--matrix-form-title-icon) no-repeat center center / 100% auto}.ns-form-title__text[data-v-29c80ec1]{font-size:18px;font-weight:500;color:var(--matrix-form-title-color)}.ns-form-title__content[data-v-29c80ec1]{width:100%}.page-search[data-v-cb2d43ff]{margin-bottom:16px;padding:16px 16px 0;background:#fff;border-radius:4px}.page-search__actions[data-v-cb2d43ff]{display:flex;align-items:flex-start}.page-search__form[data-v-cb2d43ff]{width:100%}.page-search__form[data-v-cb2d43ff] .el-form-item{display:flex;align-items:center;width:100%;margin-right:0}.page-search__form[data-v-cb2d43ff] .el-form-item__label{float:none;white-space:nowrap;padding-right:12px}.page-search__form[data-v-cb2d43ff] .el-form-item__content{flex:1;min-width:0}.page-search__form[data-v-cb2d43ff] .el-form-item__content>.el-input,.page-search__form[data-v-cb2d43ff] .el-form-item__content>.el-textarea,.page-search__form[data-v-cb2d43ff] .el-form-item__content>.el-select,.page-search__form[data-v-cb2d43ff] .el-form-item__content>.el-date-editor,.page-search__form[data-v-cb2d43ff] .el-form-item__content>.el-cascader,.page-search__form[data-v-cb2d43ff] .el-form-item__content>.el-autocomplete,.page-search__form[data-v-cb2d43ff] .el-form-item__content>.el-input-number,.page-search__form[data-v-cb2d43ff] .el-form-item__content>.el-slider{width:100%}.page-table[data-v-e9b089a2]{display:flex;flex-direction:column;width:100%}.page-table__header[data-v-e9b089a2]{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px}.page-table__actions[data-v-e9b089a2]{display:flex;align-items:center;gap:8px}.page-table__pagination[data-v-e9b089a2]{display:flex;justify-content:flex-end;margin-top:16px}.page-table__empty[data-v-e9b089a2]{padding:24px 0;color:#909399;text-align:center}.page-container[data-v-400797f6]{display:flex;flex-direction:column;width:100%}.ns-dialog-plus__header[data-v-e8cb0826]{display:flex;align-items:center;justify-content:space-between;min-height:var(--matrix-dialog-header-height);cursor:default}.ns-dialog-plus__title[data-v-e8cb0826]{flex:1;font-size:16px;font-weight:600;color:var(--matrix-dialog-header-text-color)}.dialog-controls[data-v-e8cb0826]{display:flex;align-items:center;gap:8px}.dialog-icon[data-v-e8cb0826]{display:flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:6px;color:var(--matrix-dialog-header-text-color);cursor:pointer;transition:background-color .2s ease,color .2s ease}.dialog-icon[data-v-e8cb0826]:hover{background:rgba(0,0,0,.06);color:var(--matrix-color-primary, #409eff)}.dialog-close[data-v-e8cb0826]:hover{color:#f56c6c}.ns-dialog-plus__body[data-v-e8cb0826]{min-height:60px;flex:1 1 auto;min-width:0}.ns-dialog-plus__footer[data-v-e8cb0826]{display:flex;justify-content:flex-end;gap:var(--matrix-dialog-footer-gap)}[data-v-e8cb0826] .ns-dialog-plus{overflow:hidden;border-radius:var(--matrix-dialog-border-radius);box-shadow:var(--matrix-dialog-box-shadow)}[data-v-e8cb0826] .ns-dialog-plus .el-dialog__header,[data-v-e8cb0826] .ns-dialog-plus .el-dialog__footer{flex:0 0 auto}[data-v-e8cb0826] .ns-dialog-plus .el-dialog__header{padding:0 20px;background:var(--matrix-dialog-header-bg-color)}[data-v-e8cb0826] .ns-dialog-plus .el-dialog__body{padding:0;display:flex;flex:1 1 auto;min-height:0;overflow:hidden}
|