vue仿odata通用增删改查
程序员文章站
2024-03-19 20:35:34
...
1 | 列表 | |
listApiEntity |
this.params.entityName = "FinanceRateCondtion"; //必填,表名称 inputFields.xxx = xxx; //查询, 如greaterThanEqualTo,lessThanEqualTo,notEqual 等等.不写这个值则默认为等于 |
|
2 | 新建 | |
createApiEntity | var inputFields = {}; inputFields["baseId"]= "10000"; //主键,可以不填,不填则后台自动产生 inputFields["baseTypeId"]= xxxx; //非主键字段, ...... this.dataInfo.inputFields = inputFields; this.dataInfo.entityName = "FinanceRateCondtion"; //表名称 this.saveDataInfo(state,this.$api.createApiEntity,this.dataInfo , "list"); //返回的数据中的outputFields 包含了所有字段,按需使用 |
|
3 | 修改 | |
updateApiEntity | var inputFields = {}; inputFields["baseId"]= "10000"; //主键 inputFields["baseTypeId"]= xxxx; //非主键字段, ...... this.dataInfo.inputFields = inputFields; this.dataInfo.entityName = "FinanceRateCondtion"; //表名称 this.updateDataInfo(state,this.$api.updateApiEntity,this.dataInfo , "list"); //返回的数据中的outputFields 包含了所有字段,按需使用 |
|
4 | 删除 | |
deleteApiEntity | var inputFields = {}; inputFields["baseId"]= "10000"; //主键 this.dataInfo.inputFields = inputFields; this.dataInfo.entityName = "FinanceRateCondtion"; //表名称 axios.post(this.$api.deleteApiEntity,this.dataInfo).then(res => { this.loading = false; }).catch(err => { this.loading = false; }); |
|
5 | 根据主键查询一条数据 | |
getApiEntity | var inputFields = {}; inputFields["baseId"]= "10001"; //主键 this.dataInfo.inputFields = inputFields; this.dataInfo.entityName = "FinanceRateCondtion"; axios.post(this.$api.getApiEntity,this.dataInfo).then(res => { this.loading = false; this.inputFields = res.body.outputFields; }).catch(err => { this.loading = false; }); |
上一篇: minilang开发日志书写规范 博客分类: ofbiz
下一篇: ActiveRecord 查询优化 博客分类: Ruby ActiveRecordRubyOracle应用服务器Rails
推荐阅读