@yoooloo42/joker 1.0.140 → 1.0.142

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/index.cjs.js CHANGED
@@ -22557,7 +22557,7 @@ return (_ctx, _cache) => {
22557
22557
 
22558
22558
  script$k.__file = "src/form/LabelBox.vue";
22559
22559
 
22560
- const _hoisted_1$e = { key: 12 };
22560
+ const _hoisted_1$f = { key: 12 };
22561
22561
  const _hoisted_2$e = { key: 0 };
22562
22562
  const _hoisted_3$7 = { key: 13 };
22563
22563
  const _hoisted_4$5 = { key: 0 };
@@ -22996,7 +22996,7 @@ return (_ctx, _cache) => {
22996
22996
  }, 8 /* PROPS */, ["modelValue", "disabled", "onChange"]))
22997
22997
  : vue.createCommentVNode("v-if", true),
22998
22998
  (vue.unref(propsItem_box).inputType === 'button-group' && vue.unref(propsItem_box).box && vue.unref(propsItem_box).box.length > 0)
22999
- ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$e, [
22999
+ ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$f, [
23000
23000
  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(propsItem_box).box, (item0, index0) => {
23001
23001
  return (vue.openBlock(), vue.createBlock(_component_el_button_group, {
23002
23002
  key: index0,
@@ -23330,7 +23330,7 @@ return (_ctx, _cache) => {
23330
23330
  script$j.__scopeId = "data-v-a94fa4ba";
23331
23331
  script$j.__file = "src/form/InputBox.vue";
23332
23332
 
23333
- const _hoisted_1$d = { key: 0 };
23333
+ const _hoisted_1$e = { key: 0 };
23334
23334
  const _hoisted_2$d = ["colspan"];
23335
23335
  const _hoisted_3$6 = { key: 0 };
23336
23336
  const _hoisted_4$4 = ["colspan"];
@@ -23438,7 +23438,7 @@ return (_ctx, _cache) => {
23438
23438
  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(item.items, (item0, index0) => {
23439
23439
  return (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: index0 }, [
23440
23440
  (item0.hdlVisible ? item0.hdlVisible({formData: vue.unref(formData_box), scopeThis: vue.unref(scopeThis_box)}) : true)
23441
- ? (vue.openBlock(), vue.createElementBlock("tr", _hoisted_1$d, [
23441
+ ? (vue.openBlock(), vue.createElementBlock("tr", _hoisted_1$e, [
23442
23442
  (!!item0.label)
23443
23443
  ? (vue.openBlock(), vue.createElementBlock("td", {
23444
23444
  key: 0,
@@ -41422,6 +41422,9 @@ return (_ctx, _cache) => {
41422
41422
 
41423
41423
  script$f.__file = "src/richtext/index.vue";
41424
41424
 
41425
+ const _hoisted_1$d = { style: {"text-align":"center"} };
41426
+
41427
+
41425
41428
  var script$e = {
41426
41429
  __name: 'PickCol',
41427
41430
  props: {
@@ -41438,34 +41441,43 @@ const tableProps_box = props.tableProps;
41438
41441
 
41439
41442
  let checkedAll = vue.ref(false); // 是否全选状态
41440
41443
  let isIndeterminate = vue.ref(false); // 不确定状态:非全选、非全空
41441
- let itemsChecked = vue.reactive([]); // 已选中条目
41444
+ let itemsChecked = vue.ref([]); // 已选中条目
41445
+ let itemsAll = vue.ref([]); // 全部条目
41442
41446
 
41443
41447
  const hdl = {
41444
41448
  // 获取键值数组
41445
- getKeys(p) {
41449
+ getItems(p) {
41446
41450
  let a = [];
41447
- p.forEach(i => {
41448
- a.push(i.fieldName);
41451
+ p.forEach((item, index) => {
41452
+ a.push(item.key);
41449
41453
  });
41450
41454
  return a
41451
41455
  },
41452
41456
  // 全选
41453
41457
  checkedAll(val) {
41454
- itemsChecked.splice(0, itemsChecked.length);
41458
+ itemsChecked.value = [];
41455
41459
  if (val) {
41456
- // 正确:重新填充数组,保持响应性
41457
- itemsChecked.push(...hdl.getKeys(tableProps_box.table.pickCol.colsInit));
41460
+ itemsChecked.value.push(...itemsAll.value);
41461
+ }
41462
+ if(itemsChecked.value.length > 0 && itemsChecked.value.length === itemsAll.value.length){
41463
+ checkedAll.value = true;
41464
+ isIndeterminate.value = false;
41465
+ }else if(itemsChecked.value.length > 0 && itemsChecked.value.length !== itemsAll.value.length){
41466
+ checkedAll.value = false;
41467
+ isIndeterminate.value = true;
41468
+ }else if(itemsChecked.value.length === 0){
41469
+ checkedAll.value = false;
41470
+ isIndeterminate.value = false;
41458
41471
  }
41459
- isIndeterminate.value = !val;
41460
41472
  },
41461
41473
  // 选中或取消某一条
41462
41474
  checkedItemsChange(val) {
41463
- if(val.length > 0 && val.length === tableProps_box.table.pickCol.colsInit.length){
41475
+ if(val.length > 0 && val.length === itemsAll.value.length){
41464
41476
  checkedAll.value = true;
41465
41477
  isIndeterminate.value = false;
41466
41478
  return
41467
41479
  }
41468
- if(val.length > 0 && val.length !== tableProps_box.table.pickCol.colsInit.length){
41480
+ if(val.length > 0 && val.length !== itemsAll.value.length){
41469
41481
  checkedAll.value = false;
41470
41482
  isIndeterminate.value = true;
41471
41483
  return
@@ -41477,9 +41489,9 @@ const hdl = {
41477
41489
  },
41478
41490
  confirm() { // 确认提交
41479
41491
  tableProps_box.table.cols = [];
41480
- itemsChecked.forEach(i => {
41481
- tableProps_box.table.cols.push(tableProps_box.table.pickCol.colsInit.find(j => {
41482
- return j.fieldName === i
41492
+ itemsChecked.value.forEach((item, index) => {
41493
+ tableProps_box.table.cols.push(tableProps_box.table.pickCol.colsInit.find((item0, index0) => {
41494
+ return item === '' + item0.key
41483
41495
  }));
41484
41496
  });
41485
41497
  tableProps_box.table.pickCol.popup.visible = false;
@@ -41491,24 +41503,33 @@ vue.watch(
41491
41503
  () => tableProps_box.table.pickCol.popup.visible,
41492
41504
  (newVal, oldVal) => {
41493
41505
  if (newVal) {
41494
- if(tableProps_box.table.cols.length > 0 && tableProps_box.table.cols.length === tableProps_box.table.pickCol.colsInit.length){
41506
+ itemsAll.value = hdl.getItems(tableProps_box.table.pickCol.colsInit);
41507
+ itemsChecked.value = hdl.getItems(tableProps_box.table.cols);
41508
+ if(itemsChecked.value.length > 0 && itemsChecked.value.length === itemsAll.value.length){
41495
41509
  checkedAll.value = true;
41496
41510
  isIndeterminate.value = false;
41497
- }else if(tableProps_box.table.cols.length > 0 && tableProps_box.table.cols.length !== tableProps_box.table.pickCol.colsInit.length){
41511
+ }else if(itemsChecked.value.length > 0 && itemsChecked.value.length !== itemsAll.value.length){
41498
41512
  checkedAll.value = false;
41499
41513
  isIndeterminate.value = true;
41500
- }else if(tableProps_box.table.cols.length === 0){
41514
+ }else if(itemsChecked.value.length === 0){
41501
41515
  checkedAll.value = false;
41502
41516
  isIndeterminate.value = false;
41503
41517
  }
41504
- itemsChecked = hdl.getKeys(tableProps_box.table.cols);
41505
41518
  }
41506
41519
  }
41507
41520
  );
41508
41521
 
41522
+ const style = {
41523
+ line: {
41524
+ height: '1px',
41525
+ 'background-color': '#bdbdbd',
41526
+ 'margin-top': '10px',
41527
+ 'margin-bottom': '10px'
41528
+ }
41529
+ };
41530
+
41509
41531
  return (_ctx, _cache) => {
41510
41532
  const _component_el_checkbox = vue.resolveComponent("el-checkbox");
41511
- const _component_el_row = vue.resolveComponent("el-row");
41512
41533
  const _component_el_checkbox_group = vue.resolveComponent("el-checkbox-group");
41513
41534
  const _component_el_button = vue.resolveComponent("el-button");
41514
41535
  const _component_el_dialog = vue.resolveComponent("el-dialog");
@@ -41525,31 +41546,33 @@ return (_ctx, _cache) => {
41525
41546
  }, {
41526
41547
  default: vue.withCtx(() => [
41527
41548
  vue.createVNode(_component_el_checkbox, {
41528
- indeterminate: vue.unref(isIndeterminate),
41529
41549
  modelValue: vue.unref(checkedAll),
41530
41550
  "onUpdate:modelValue": _cache[0] || (_cache[0] = $event => (vue.isRef(checkedAll) ? (checkedAll).value = $event : checkedAll = $event)),
41551
+ indeterminate: vue.unref(isIndeterminate),
41531
41552
  onChange: hdl.checkedAll
41532
41553
  }, {
41533
41554
  default: vue.withCtx(() => [...(_cache[3] || (_cache[3] = [
41534
41555
  vue.createTextVNode("全选", -1 /* CACHED */)
41535
41556
  ]))]),
41536
41557
  _: 1 /* STABLE */
41537
- }, 8 /* PROPS */, ["indeterminate", "modelValue", "onChange"]),
41538
- vue.createVNode(_component_el_row, { style: {"height":"1px","background-color":"#bdbdbd","margin-top":"10px","margin-bottom":"10px"} }),
41558
+ }, 8 /* PROPS */, ["modelValue", "indeterminate", "onChange"]),
41559
+ vue.createElementVNode("div", {
41560
+ style: vue.normalizeStyle(style.line)
41561
+ }, null, 4 /* STYLE */),
41539
41562
  vue.createVNode(_component_el_checkbox_group, {
41540
41563
  modelValue: vue.unref(itemsChecked),
41541
41564
  "onUpdate:modelValue": _cache[1] || (_cache[1] = $event => (vue.isRef(itemsChecked) ? (itemsChecked).value = $event : itemsChecked = $event)),
41542
41565
  onChange: hdl.checkedItemsChange
41543
41566
  }, {
41544
41567
  default: vue.withCtx(() => [
41545
- (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(tableProps_box).table.pickCol.colsInit, (item) => {
41568
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(tableProps_box).table.pickCol.colsInit, (item, index) => {
41546
41569
  return (vue.openBlock(), vue.createBlock(_component_el_checkbox, {
41547
- style: {"display":"block","margin-bottom":"10px"},
41548
- label: item ? item.fieldName : '',
41549
- key: item ? item.fieldName : ''
41570
+ label: item.key,
41571
+ key: index,
41572
+ style: {"display":"block","margin-bottom":"10px"}
41550
41573
  }, {
41551
41574
  default: vue.withCtx(() => [
41552
- vue.createTextVNode(vue.toDisplayString(item ? item.label : ''), 1 /* TEXT */)
41575
+ vue.createTextVNode(vue.toDisplayString(item.label), 1 /* TEXT */)
41553
41576
  ]),
41554
41577
  _: 2 /* DYNAMIC */
41555
41578
  }, 1032 /* PROPS, DYNAMIC_SLOTS */, ["label"]))
@@ -41557,22 +41580,21 @@ return (_ctx, _cache) => {
41557
41580
  ]),
41558
41581
  _: 1 /* STABLE */
41559
41582
  }, 8 /* PROPS */, ["modelValue", "onChange"]),
41560
- vue.createVNode(_component_el_row, { style: {"height":"1px","background-color":"#bdbdbd","margin-top":"10px","margin-bottom":"10px"} }),
41561
- vue.createVNode(_component_el_row, { style: {"text-align":"center"} }, {
41562
- default: vue.withCtx(() => [
41563
- vue.createVNode(_component_el_button, {
41564
- type: "success",
41565
- round: "",
41566
- onClick: hdl.confirm
41567
- }, {
41568
- default: vue.withCtx(() => [...(_cache[4] || (_cache[4] = [
41569
- vue.createTextVNode("确认", -1 /* CACHED */)
41570
- ]))]),
41571
- _: 1 /* STABLE */
41572
- }, 8 /* PROPS */, ["onClick"])
41573
- ]),
41574
- _: 1 /* STABLE */
41575
- })
41583
+ vue.createElementVNode("div", {
41584
+ style: vue.normalizeStyle(style.line)
41585
+ }, null, 4 /* STYLE */),
41586
+ vue.createElementVNode("div", _hoisted_1$d, [
41587
+ vue.createVNode(_component_el_button, {
41588
+ type: "success",
41589
+ round: "",
41590
+ onClick: hdl.confirm
41591
+ }, {
41592
+ default: vue.withCtx(() => [...(_cache[4] || (_cache[4] = [
41593
+ vue.createTextVNode("确认", -1 /* CACHED */)
41594
+ ]))]),
41595
+ _: 1 /* STABLE */
41596
+ }, 8 /* PROPS */, ["onClick"])
41597
+ ])
41576
41598
  ]),
41577
41599
  _: 1 /* STABLE */
41578
41600
  }, 8 /* PROPS */, ["modelValue"])
@@ -42083,6 +42105,7 @@ return (_ctx, _cache) => {
42083
42105
  layout: "total, sizes, prev, pager, next, jumper"
42084
42106
  }, null, 8 /* PROPS */, ["total", "page-size", "page-sizes", "current-page", "style", "onSizeChange", "onCurrentChange"]),
42085
42107
  vue.createCommentVNode(" 选择列 "),
42108
+ vue.createCommentVNode(" 使用该组件,必须设置每一列的唯一标识:key "),
42086
42109
  vue.createVNode(script$e, { tableProps: vue.unref(tableProps_box) }, null, 8 /* PROPS */, ["tableProps"])
42087
42110
  ]))
42088
42111
  }