Skip to content

Commit

Permalink
json data
Browse files Browse the repository at this point in the history
  • Loading branch information
crudapi committed Jul 19, 2024
1 parent c9e4761 commit 8ab1ff1
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/components/CTableEdit/CTableEdit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -695,6 +695,7 @@ export default {
// (everything except "component" and "parent" props above):
columnExtProperty: item.columnExtProperty,
data: item.value,
json: this.getData(),
dataSource: this.dataSource
}).onOk((data) => {
item.value = data;
Expand Down
1 change: 1 addition & 0 deletions src/components/CTableNew/CTableNew.vue
Original file line number Diff line number Diff line change
Expand Up @@ -604,6 +604,7 @@ export default {
// (everything except "component" and "parent" props above):
columnExtProperty: item.columnExtProperty,
data: item.value,
json: this.getData(),
dataSource: this.dataSource
}).onOk((data) => {
item.value = data;
Expand Down
18 changes: 14 additions & 4 deletions src/components/CValueDialog/CValueDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
<q-dialog full-width full-height
ref="dialog" @hide="onDialogHide" persistent>
<q-card class="q-dialog-plugin" style="height: 600px;">
<q-card-actions align="center">
<q-btn color="primary" label="确定" unelevated no-caps @click="onOKClick" />
<q-btn color="negative" label="取消" unelevated no-caps @click="onCancelClick" />
</q-card-actions>
<iframe
id="extIframe"
ref="extIframe"
Expand All @@ -11,10 +15,6 @@
allowfullscreen="true" style="width: 100%;height: 100%;">
<p>您的浏览器不支持iframes,请使用chrome浏览器.</p >
</iframe>
<q-card-actions align="center">
<q-btn color="primary" label="确定" unelevated no-caps @click="onOKClick" />
<q-btn color="negative" label="取消" unelevated no-caps @click="onCancelClick" />
</q-card-actions>
</q-card>
</q-dialog>
</template>
Expand All @@ -27,6 +27,9 @@ export default {
},
data: {
required: true
},
json: {
required: false
}
},
Expand All @@ -52,6 +55,9 @@ export default {
window.crudapi.getParentValue = function() {
return that.getParentValue();
};
window.crudapi.getParentJson = function() {
return that.getParentJson();
};
this.$refs.dialog.show();
},
Expand Down Expand Up @@ -98,6 +104,10 @@ export default {
getParentValue() {
console.info("getParentValue:" + this.data);
return this.data;
},
getParentJson() {
console.info("getParentJson:" + this.json);
return this.json;
}
}
}
Expand Down
4 changes: 4 additions & 0 deletions src/pages/Setting.vue
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ export default {
const value = window.parent.crudapi.getParentValue();
console.info("window.parent.crudapi.getParentValue: " + value);
const json = window.parent.crudapi.getParentJson();
console.info("window.parent.crudapi.getParentJson: ");
console.dir(json);
},
resetAction() {
Expand Down

0 comments on commit 8ab1ff1

Please sign in to comment.