ocpview-plus 1.0.16 → 1.0.18
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/README.md +3 -0
- package/dist/ocpviewplus.min.esm.js +150 -10
- package/dist/ocpviewplus.min.js +3 -3
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/components/grid/editgridbase.vue +110 -0
- package/src/components/masterplate/base.vue +1 -1
- package/src/components/masterplate/editgridcard.vue +37 -3
- package/src/components/masterplate/layouttemplate.vue +9 -1
package/README.md
CHANGED
|
@@ -453,7 +453,7 @@ common.initEview = function(ViewUI2) {
|
|
|
453
453
|
common.initAnchor(ViewUI2.Anchor);
|
|
454
454
|
};
|
|
455
455
|
const name = "ocpview-plus";
|
|
456
|
-
const version$2 = "1.0.
|
|
456
|
+
const version$2 = "1.0.16";
|
|
457
457
|
const title = "ocpviewPlus";
|
|
458
458
|
const description = "A high quality Service UI components Library with Vue.js";
|
|
459
459
|
const homepage = "";
|
|
@@ -9071,6 +9071,7 @@ function _sfc_render$1t(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
9071
9071
|
]);
|
|
9072
9072
|
}
|
|
9073
9073
|
var ViewGrid = /* @__PURE__ */ _export_sfc$1(_sfc_main$1G, [["render", _sfc_render$1t]]);
|
|
9074
|
+
var editgridbase_vue_vue_type_style_index_0_lang = "";
|
|
9074
9075
|
const _sfc_main$1F = {
|
|
9075
9076
|
name: "editgridbase",
|
|
9076
9077
|
extends: _sfc_main$1I,
|
|
@@ -9113,9 +9114,19 @@ const _sfc_main$1F = {
|
|
|
9113
9114
|
name: "editRowForm",
|
|
9114
9115
|
text: "\u7F16\u8F91"
|
|
9115
9116
|
}],
|
|
9116
|
-
openChange: false
|
|
9117
|
+
openChange: false,
|
|
9118
|
+
focusIndex: null,
|
|
9119
|
+
focusKey: null
|
|
9117
9120
|
};
|
|
9118
9121
|
},
|
|
9122
|
+
computed: {
|
|
9123
|
+
colKeys() {
|
|
9124
|
+
return this.soltTableColumns.map((c10) => c10.key);
|
|
9125
|
+
}
|
|
9126
|
+
},
|
|
9127
|
+
beforeUnmount() {
|
|
9128
|
+
document.removeEventListener("keydown", this.handleKeydown);
|
|
9129
|
+
},
|
|
9119
9130
|
methods: {
|
|
9120
9131
|
customInit() {
|
|
9121
9132
|
if (this.myConfig.items && this.myConfig.items.length > 0) {
|
|
@@ -9167,6 +9178,9 @@ const _sfc_main$1F = {
|
|
|
9167
9178
|
this.customInit2();
|
|
9168
9179
|
}
|
|
9169
9180
|
this.myConfig.getGridObject = this.getGridObject;
|
|
9181
|
+
document.addEventListener("keydown", (e10) => {
|
|
9182
|
+
this.handleKeydown(e10);
|
|
9183
|
+
});
|
|
9170
9184
|
},
|
|
9171
9185
|
getGridObject() {
|
|
9172
9186
|
let that = this;
|
|
@@ -9513,6 +9527,7 @@ const _sfc_main$1F = {
|
|
|
9513
9527
|
return error;
|
|
9514
9528
|
},
|
|
9515
9529
|
EditCell(index, config2) {
|
|
9530
|
+
this.setEditGridFocus(index, config2.key);
|
|
9516
9531
|
if (this.myConfig.readOnly) {
|
|
9517
9532
|
this.cancelCellEditing();
|
|
9518
9533
|
return;
|
|
@@ -9550,6 +9565,91 @@ const _sfc_main$1F = {
|
|
|
9550
9565
|
this.setcheckInfo(index, config2.key);
|
|
9551
9566
|
}
|
|
9552
9567
|
},
|
|
9568
|
+
setEditGridFocus(rowIdx, colKey) {
|
|
9569
|
+
this.focusIndex = rowIdx;
|
|
9570
|
+
this.focusKey = colKey;
|
|
9571
|
+
this.editIndex = rowIdx;
|
|
9572
|
+
this.editKey = colKey;
|
|
9573
|
+
this.focusCell(rowIdx, colKey);
|
|
9574
|
+
},
|
|
9575
|
+
focusCell(rowIdx, colKey) {
|
|
9576
|
+
this.$nextTick(() => {
|
|
9577
|
+
const tableEl = this.$refs.table.$el;
|
|
9578
|
+
const selector = `div[cell-row="${rowIdx}"][cell-col="${colKey}"]`;
|
|
9579
|
+
let curElement = tableEl.querySelector(selector);
|
|
9580
|
+
if (curElement) {
|
|
9581
|
+
const arr = tableEl.querySelectorAll(".ivu-table-column-selected");
|
|
9582
|
+
if (arr.length != 0) {
|
|
9583
|
+
arr.forEach((el2) => {
|
|
9584
|
+
el2.classList.remove("ivu-table-column-selected");
|
|
9585
|
+
});
|
|
9586
|
+
}
|
|
9587
|
+
const cellDiv = curElement.closest("td");
|
|
9588
|
+
if (cellDiv) {
|
|
9589
|
+
cellDiv.classList.add("ivu-table-column-selected");
|
|
9590
|
+
cellDiv.scrollIntoView({ behavior: "smooth", block: "nearest" });
|
|
9591
|
+
}
|
|
9592
|
+
}
|
|
9593
|
+
});
|
|
9594
|
+
},
|
|
9595
|
+
handleKeydown(event) {
|
|
9596
|
+
if (this.focusIndex === null || this.focusKey === null)
|
|
9597
|
+
return;
|
|
9598
|
+
const colIdx = this.colKeys.findIndex((it2) => {
|
|
9599
|
+
return it2 == this.focusKey;
|
|
9600
|
+
});
|
|
9601
|
+
this.focusKey = this.colKeys[colIdx];
|
|
9602
|
+
let newRow = this.focusIndex;
|
|
9603
|
+
let newCol = colIdx;
|
|
9604
|
+
let name2 = "cell_" + this.editIndex + "_" + this.editKey;
|
|
9605
|
+
const { key } = event;
|
|
9606
|
+
if (key == "ArrowUp") {
|
|
9607
|
+
if (this.focusIndex > 0)
|
|
9608
|
+
newRow--;
|
|
9609
|
+
this.extEditStatus();
|
|
9610
|
+
}
|
|
9611
|
+
if (key == "ArrowDown") {
|
|
9612
|
+
if (this.focusIndex < this.data.length - 1)
|
|
9613
|
+
newRow++;
|
|
9614
|
+
this.extEditStatus();
|
|
9615
|
+
}
|
|
9616
|
+
if (key == "ArrowLeft") {
|
|
9617
|
+
if (colIdx > 1)
|
|
9618
|
+
newCol--;
|
|
9619
|
+
this.extEditStatus();
|
|
9620
|
+
}
|
|
9621
|
+
if (key == "ArrowRight") {
|
|
9622
|
+
if (colIdx < this.colKeys.length - 1)
|
|
9623
|
+
newCol++;
|
|
9624
|
+
this.extEditStatus();
|
|
9625
|
+
}
|
|
9626
|
+
if (key == "Enter") {
|
|
9627
|
+
if (colIdx < this.colKeys.length - 1)
|
|
9628
|
+
newCol++;
|
|
9629
|
+
}
|
|
9630
|
+
this.setEditGridFocus(newRow, this.colKeys[newCol]);
|
|
9631
|
+
if (!this.myConfig.readOnly) {
|
|
9632
|
+
if (this.$refs[name2] && this.$refs[name2].autofocus) {
|
|
9633
|
+
return true;
|
|
9634
|
+
}
|
|
9635
|
+
} else {
|
|
9636
|
+
this.handleOut();
|
|
9637
|
+
}
|
|
9638
|
+
event.preventDefault();
|
|
9639
|
+
},
|
|
9640
|
+
extEditStatus() {
|
|
9641
|
+
if (!this.myConfig.readOnly) {
|
|
9642
|
+
let name2 = "cell_" + this.editIndex + "_" + this.editKey;
|
|
9643
|
+
if (this.$refs[name2] && this.$refs[name2].setFocus) {
|
|
9644
|
+
this.$refs[name2].setFocus(false);
|
|
9645
|
+
}
|
|
9646
|
+
let self2 = this;
|
|
9647
|
+
this.$nextTick(() => {
|
|
9648
|
+
self2.editKey = "";
|
|
9649
|
+
self2.oldEditIndex = this.editIndex;
|
|
9650
|
+
});
|
|
9651
|
+
}
|
|
9652
|
+
},
|
|
9553
9653
|
setcheckInfo(index, key) {
|
|
9554
9654
|
let checkIndex = index;
|
|
9555
9655
|
let row = this.getCurRow(index);
|
|
@@ -9694,6 +9794,7 @@ const _sfc_main$1F = {
|
|
|
9694
9794
|
this.editIndex = nextKey.editIndex;
|
|
9695
9795
|
this.editKey = nextKey.editKey;
|
|
9696
9796
|
this.setcheckInfo(nextKey.editIndex, nextKey.editKey);
|
|
9797
|
+
this.setEditGridFocus(this.editIndex, this.editKey);
|
|
9697
9798
|
}
|
|
9698
9799
|
},
|
|
9699
9800
|
findNextItems(editIndex, editName) {
|
|
@@ -38575,7 +38676,7 @@ const _sfc_main$H = {
|
|
|
38575
38676
|
showAsyncImportExport: false,
|
|
38576
38677
|
showBillContPrintMode: false,
|
|
38577
38678
|
showPrintMode: false,
|
|
38578
|
-
billprintModeUrl: "/
|
|
38679
|
+
billprintModeUrl: "/widgetmodelv3/#/bill-print?modulecode={modulecode}&dataid={dataid}&mktcode={mktcode}&token={token}",
|
|
38579
38680
|
printModeUrl: "",
|
|
38580
38681
|
eventObject: ["valueChanged", "setDataBefore", "searchBefore", "cellbeginedit", "importSuccess", "addRowBefore", "indexMethod", "delRowBefore", "delRowAfter", "onSelectionChange", "formatValue", "updateCellConfig", "overrideSearchParam", "overrideData", "refurbishCheck", "onSingleChange", "onSetRowCheck", "onSelect", "onSelectCancel", "onSelectionChange", "customSummary", "customImgPath", "onDelTag", "onSearch", "onAppend", "filterData", "onAddTag", "getDictData", "setLabel", "setImportUrl", "onLinkTo", "newSaveFormBefore", "setQueryConfig", "setNodeClass", "setTreeNodeIcon", "rowClassName", "customSummaryGroup", "disabledDate"],
|
|
38581
38682
|
layoutTypeList: ["ListDetails", "ListDetailsV2", "BillListDetails"]
|
|
@@ -41565,6 +41666,7 @@ function _sfc_render$A(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
41565
41666
|
]);
|
|
41566
41667
|
}
|
|
41567
41668
|
var mBillImport = /* @__PURE__ */ _export_sfc$1(_sfc_main$D, [["render", _sfc_render$A], ["__scopeId", "data-v-28ca1387"]]);
|
|
41669
|
+
var layouttemplate_vue_vue_type_style_index_0_lang = "";
|
|
41568
41670
|
const _sfc_main$C = {
|
|
41569
41671
|
name: "BillTemplate",
|
|
41570
41672
|
extends: _sfc_main$H,
|
|
@@ -41615,7 +41717,8 @@ function _sfc_render$z(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
41615
41717
|
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => _ctx.showPrintMode = $event),
|
|
41616
41718
|
width: $options.appendixCurrentWidth,
|
|
41617
41719
|
"footer-hide": true,
|
|
41618
|
-
fullscreen: true
|
|
41720
|
+
fullscreen: true,
|
|
41721
|
+
"class-name": "print-bill-panel-modal"
|
|
41619
41722
|
}, {
|
|
41620
41723
|
default: withCtx(() => [
|
|
41621
41724
|
_ctx.printModeReset ? (openBlock(), createElementBlock("iframe", {
|
|
@@ -43968,6 +44071,41 @@ const _sfc_main$v = {
|
|
|
43968
44071
|
effectData: []
|
|
43969
44072
|
};
|
|
43970
44073
|
},
|
|
44074
|
+
computed: {
|
|
44075
|
+
tableHeight() {
|
|
44076
|
+
let currentHeight = this.currentHeight - this.extraHeight - this.outsideHeight;
|
|
44077
|
+
if (this.isFull) {
|
|
44078
|
+
currentHeight = this.clientHeight - this.$refs.table.$el.offsetTop;
|
|
44079
|
+
} else {
|
|
44080
|
+
if (!this.myConfig.dynamicHeight) {
|
|
44081
|
+
currentHeight = this.currentHeight;
|
|
44082
|
+
if (this.extraHeight) {
|
|
44083
|
+
currentHeight = currentHeight - Number(this.extraHeight);
|
|
44084
|
+
}
|
|
44085
|
+
if (this.outsideHeight) {
|
|
44086
|
+
currentHeight = currentHeight - Number(this.outsideHeight);
|
|
44087
|
+
}
|
|
44088
|
+
if (this.myConfig.showSummary) {
|
|
44089
|
+
currentHeight = currentHeight - 50;
|
|
44090
|
+
}
|
|
44091
|
+
}
|
|
44092
|
+
}
|
|
44093
|
+
return currentHeight;
|
|
44094
|
+
},
|
|
44095
|
+
tableMaxHeight() {
|
|
44096
|
+
let currentHeight = this.currentHeight - this.extraHeight - this.outsideHeight;
|
|
44097
|
+
if (this.isFull) {
|
|
44098
|
+
currentHeight = this.clientHeight - this.$refs.table.$el.offsetTop;
|
|
44099
|
+
} else {
|
|
44100
|
+
if (this.myConfig.dynamicHeight) {
|
|
44101
|
+
if (this.myConfig.showSummary) {
|
|
44102
|
+
currentHeight = currentHeight - 50;
|
|
44103
|
+
}
|
|
44104
|
+
}
|
|
44105
|
+
}
|
|
44106
|
+
return currentHeight;
|
|
44107
|
+
}
|
|
44108
|
+
},
|
|
43971
44109
|
methods: {
|
|
43972
44110
|
customInit2() {
|
|
43973
44111
|
if (this.myConfig.showTitle !== void 0) {
|
|
@@ -44096,7 +44234,7 @@ const _hoisted_2$k = {
|
|
|
44096
44234
|
};
|
|
44097
44235
|
const _hoisted_3$c = ["textContent"];
|
|
44098
44236
|
const _hoisted_4$a = { key: 0 };
|
|
44099
|
-
const _hoisted_5$8 = ["onClick"];
|
|
44237
|
+
const _hoisted_5$8 = ["onClick", "cell-row", "cell-col"];
|
|
44100
44238
|
const _hoisted_6$5 = {
|
|
44101
44239
|
key: 0,
|
|
44102
44240
|
ref: "page",
|
|
@@ -44257,8 +44395,8 @@ function _sfc_render$s(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
44257
44395
|
size: $data.myConfig.tableSize,
|
|
44258
44396
|
stripe: $data.myConfig.showStripe,
|
|
44259
44397
|
border: $data.myConfig.showBorder,
|
|
44260
|
-
height:
|
|
44261
|
-
maxHeight:
|
|
44398
|
+
height: $options.tableHeight,
|
|
44399
|
+
maxHeight: $options.tableMaxHeight,
|
|
44262
44400
|
"show-header": $data.myConfig.showHeader,
|
|
44263
44401
|
onOnSelectionChange: _ctx.OnSelectionChange,
|
|
44264
44402
|
columns: _ctx.tableColumns,
|
|
@@ -44274,7 +44412,9 @@ function _sfc_render$s(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
44274
44412
|
fn: withCtx(({ index }) => [
|
|
44275
44413
|
createElementVNode("div", {
|
|
44276
44414
|
onClick: ($event) => _ctx.EditCell(index, config2),
|
|
44277
|
-
class: normalizeClass(config2.cellClassName)
|
|
44415
|
+
class: normalizeClass(config2.cellClassName),
|
|
44416
|
+
"cell-row": index,
|
|
44417
|
+
"cell-col": config2.key
|
|
44278
44418
|
}, [
|
|
44279
44419
|
_ctx.editIndex === index && _ctx.editKey === config2.key ? (openBlock(), createBlock(_component_ControlBox, {
|
|
44280
44420
|
key: 0,
|
|
@@ -44363,7 +44503,7 @@ function _sfc_render$s(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
44363
44503
|
size: $data.myConfig.tableSize,
|
|
44364
44504
|
border: $data.myConfig.showBorder,
|
|
44365
44505
|
stripe: $data.myConfig.showStripe,
|
|
44366
|
-
maxHeight:
|
|
44506
|
+
maxHeight: $options.tableMaxHeight,
|
|
44367
44507
|
columns: _ctx.tableColumns,
|
|
44368
44508
|
data: $data.curlEffectData,
|
|
44369
44509
|
onOnColumnWidthResize: _ctx.onColumnWidthResize
|
|
@@ -44412,7 +44552,7 @@ function _sfc_render$s(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
44412
44552
|
_: 3
|
|
44413
44553
|
}, 512);
|
|
44414
44554
|
}
|
|
44415
|
-
var mEditGridCard = /* @__PURE__ */ _export_sfc$1(_sfc_main$v, [["render", _sfc_render$s], ["__scopeId", "data-v-
|
|
44555
|
+
var mEditGridCard = /* @__PURE__ */ _export_sfc$1(_sfc_main$v, [["render", _sfc_render$s], ["__scopeId", "data-v-3cf9d240"]]);
|
|
44416
44556
|
const _sfc_main$u = {
|
|
44417
44557
|
name: "mformcard",
|
|
44418
44558
|
extends: FormBox,
|