Commit adc56c9e authored by 郝聪敏's avatar 郝聪敏

feature: 修改优惠券选择bug;升级业务库

parent 2081ab27
......@@ -21,6 +21,7 @@ export default class DynamicForm extends Mixins(DynamicFormMixin) {
modal: boolean = false;
selections: object[] = [];
activeName: number = 0;
isSelected: boolean = false;
get idsLength() {
return this.getLength('value');
......@@ -29,7 +30,11 @@ export default class DynamicForm extends Mixins(DynamicFormMixin) {
getTableData() {
const tableData = this.$refs?.[`qgTable${this.activeName}`]?.[0]?.tableData || [];
console.log('get tableData', tableData);
return tableData;
return this.isSelected ? tableData : [];
}
changePageNo() {
this.isSelected = false;
}
// 获取除本页之外的默认值
......@@ -47,7 +52,7 @@ export default class DynamicForm extends Mixins(DynamicFormMixin) {
filterIds = tableData.map(v => v.id);
}
const rs = defaultIds.filter(v => !filterIds.includes(v));
const rs = this.isSelected ? defaultIds.filter(v => !filterIds.includes(v)) : defaultIds;
return rs;
}
......@@ -73,7 +78,7 @@ export default class DynamicForm extends Mixins(DynamicFormMixin) {
templates = this.templates;
}
const rs = templates.filter(v => !filterIds.includes(v));
const rs = this.isSelected ? templates.filter(v => !filterIds.includes(v)) : templates;
return rs;
}
......@@ -142,6 +147,7 @@ export default class DynamicForm extends Mixins(DynamicFormMixin) {
});
return this.templates;
}
this.isSelected = true;
this.selections = selection.length ? selection : this.getDefaultSelections();
const ids = Array.from(new Set([...this.getSelectionsIds(), ...(this.getLength('templates') ? this.getTemplateIds() : this.getDefaultIds())]));
......@@ -156,9 +162,13 @@ export default class DynamicForm extends Mixins(DynamicFormMixin) {
}
ok() {
const ids = [...this.getSelectionsIds(), ...(this.getLength('templates') ? this.getTemplateIds() : this.getDefaultIds())].filter(v => v !== -1);
// if (!ids.length) { return; }
let ids = [...this.getSelectionsIds(), ...(this.getLength('templates') ? this.getTemplateIds() : this.getDefaultIds())];
// ids为空时表示未选择
if (!ids.length) { return; }
// 当前页selections为空
ids = ids.filter(v => v !== -1);
this.selections = [];
this.isSelected = false;
// console.log('commit', selections);
if (this.table.length > 1) {
this.$emit('update:templates', {});
......@@ -175,6 +185,7 @@ export default class DynamicForm extends Mixins(DynamicFormMixin) {
@Emit('update:templates')
cancel() {
this.selections = [];
this.isSelected = false;
let rs = null;
if (this.table.length > 1) {
......
......@@ -34,6 +34,7 @@
:hideAdd="true"
:height="500"
@on-selection-change="selectionChange"
@on-page-change="changePageNo"
>
</QGTable>
</div>
......
......@@ -88,6 +88,7 @@ export default {
methods: {
changePageNo(page) {
this.query(page);
this.$emit('on-page-change', page);
},
changePageSize(size) {
this.searchForm.pageSize = size;
......
......@@ -1456,9 +1456,9 @@
}
},
"@qg/citrus-ui": {
"version": "0.0.49",
"resolved": "http://npmprivate.quantgroups.com/@qg%2fcitrus-ui/-/citrus-ui-0.0.49.tgz",
"integrity": "sha512-AfQrts57c7WyofgTkABy6MVCWB5a5lyHWkV0a20AuMlSUboFuB+/4uauRSUGbIJP5voDWf/4VN7eV2Y48YLuKw==",
"version": "0.0.50",
"resolved": "http://npmprivate.quantgroups.com/@qg%2fcitrus-ui/-/citrus-ui-0.0.50.tgz",
"integrity": "sha512-rws0modT35uFdnFhkJKngXyqSk64TnZe0ou9mPSJKTW5+hC+CdMeeA+yMFCTiETi9kFx/ru8KCD9sQa5gMs4zg==",
"requires": {
"@better-scroll/core": "^2.1.1",
"@qg/cherry-ui": "^2.20.5",
......@@ -19936,9 +19936,9 @@
"integrity": "sha1-8z/pz7Urv9UgqhgyO8ZdsRCht2w="
},
"rollup": {
"version": "2.43.1",
"resolved": "http://npmprivate.quantgroups.com/rollup/-/rollup-2.43.1.tgz",
"integrity": "sha512-kvRE6VJbiv4d8m2nGeccc3qRpzOMghAhu2KeITjyZVCjneIFLPQ3zm2Wmqnl0LcUg3FvDaV0MfKnG4NCMbiSfw==",
"version": "2.44.0",
"resolved": "http://npmprivate.quantgroups.com/rollup/-/rollup-2.44.0.tgz",
"integrity": "sha512-rGSF4pLwvuaH/x4nAS+zP6UNn5YUDWf/TeEU5IoXSZKBbKRNTCI3qMnYXKZgrC0D2KzS2baiOZt1OlqhMu5rnQ==",
"requires": {
"fsevents": "~2.3.1"
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment