提交 b518aad0 编写于 作者: sq3536's avatar sq3536

配置完成

上级 df1c3172
...@@ -23,7 +23,7 @@ export default class AppFormJsonDaReport extends AppFormJson { ...@@ -23,7 +23,7 @@ export default class AppFormJsonDaReport extends AppFormJson {
let _schema = { let _schema = {
"title": "图表配置", "title": "图表配置",
"type": "array", "type": "array",
"format": "tabs", "format": "table",
"required": ["headerName"], "required": ["headerName"],
"items": { "items": {
"$ref": "#/definitions/columnDefs" "$ref": "#/definitions/columnDefs"
...@@ -41,11 +41,16 @@ export default class AppFormJsonDaReport extends AppFormJson { ...@@ -41,11 +41,16 @@ export default class AppFormJsonDaReport extends AppFormJson {
"type": "string", "type": "string",
"title": "指标自定义名称", "title": "指标自定义名称",
"default": "指标名称", "default": "指标名称",
options: {
grid_columns: 4,
input_width: 250
},
}, },
"entity": { "entity": {
"type": "string", "type": "string",
"title": "模型", "title": "模型",
options: { options: {
grid_columns: 4,
select2_options: { select2_options: {
width: 200, width: 200,
value: '' value: ''
...@@ -66,6 +71,7 @@ export default class AppFormJsonDaReport extends AppFormJson { ...@@ -66,6 +71,7 @@ export default class AppFormJsonDaReport extends AppFormJson {
} }
], ],
options: { options: {
grid_columns: 4,
select2_options: { select2_options: {
width: 350, width: 350,
value: '' value: ''
......
...@@ -34,6 +34,7 @@ export default class AppFormJsonDaChart extends AppFormJson { ...@@ -34,6 +34,7 @@ export default class AppFormJsonDaChart extends AppFormJson {
"id" : "arr_columnDefs", "id" : "arr_columnDefs",
"type": "object", "type": "object",
"title": "展现", "title": "展现",
"format": "grid",
"headerTemplate": "{{ self.headerName }}", "headerTemplate": "{{ self.headerName }}",
"required": ["headerName","entity","field"], "required": ["headerName","entity","field"],
"properties": { "properties": {
...@@ -41,18 +42,27 @@ export default class AppFormJsonDaChart extends AppFormJson { ...@@ -41,18 +42,27 @@ export default class AppFormJsonDaChart extends AppFormJson {
"type": "string", "type": "string",
"title": "列头", "title": "列头",
"default": "列名称", "default": "列名称",
options: {
grid_columns: 3,
input_width: 250
},
}, },
"width": { "width": {
"type": "integer", "type": "integer",
"title": "宽度", "title": "宽度",
"default": "50", "default": "50",
options: {
grid_columns: 3,
input_width: 50
},
}, },
"entity": { "entity": {
"type": "string", "type": "string",
"title": "模型", "title": "模型",
options: { options: {
grid_columns: 3,
select2_options: { select2_options: {
width: 200, width: 250,
value: '' value: ''
} }
}, },
...@@ -71,8 +81,9 @@ export default class AppFormJsonDaChart extends AppFormJson { ...@@ -71,8 +81,9 @@ export default class AppFormJsonDaChart extends AppFormJson {
} }
], ],
options: { options: {
grid_columns: 3,
select2_options: { select2_options: {
width: 350, width: 250,
value: '' value: ''
} }
}, },
......
<template>
<div class="app-form-json">
<div :id="id" :innerHTML="id"></div>
</div>
</template>
<script lang='tsx'>
import { Component, Vue, Prop, Model, Watch } from "vue-property-decorator";
import { VNode, CreateElement } from "vue";
import { interval, Subject, Subscription } from "rxjs";
import { Http, Util } from "@/utils";
import JSONEditor from "@json-editor/json-editor";
import BootstrapVue from "bootstrap-vue";
import "bootstrap/dist/css/bootstrap.css";
import "bootstrap-vue/dist/bootstrap-vue.css";
import CodeListService from "@/codelist/codelist-service";
import AppFormJson from "./app-form-json.vue";
@Component({
components: {},
})
export default class AppFormJsonDim extends AppFormJson {
public codeListService: CodeListService = new CodeListService({
$store: this.$store,
});
public async getSchema(): Promise<any> {
let _schema = {
title: "维度",
type: "array",
format: "table",
required: ["field", "dict", "recursive"],
default: [
{
field: "",
dict: "",
recursive: 0,
},
],
items: {
id: "arr_dim",
title: "维度",
type: "object",
format: "grid",
properties: {
id: {
grid_columns: 6,
type: "string",
title: "标识",
template: "{{field}}",
watch: {
field: "arr_dim.field",
},
options: {
hidden: true,
input_width: 200,
},
propertyOrder: 8,
},
buildid: {
grid_columns: 6,
type: "string",
title: "Build",
options: {
hidden: true,
},
enumSource: [
{
source: [{ id: this.data.buildid, text: this.data.buildname }],
title: "{{item.text}}",
value: "{{item.id}}",
},
],
propertyOrder: 9,
},
modelid: {
grid_columns: 6,
type: "string",
title: "模型",
options: {
hidden: true,
},
enumSource: [
{
source: [{ id: this.data.modelid, text: this.data.modelname }],
title: "{{item.text}}",
value: "{{item.id}}",
},
],
propertyOrder: 3,
},
name: {
type: "selectnew",
title: "实体",
watch: {
modelid: "arr_dim.modelid",
},
enumSource: [
{
source: [...[{ label: "--", id: "" }]],
p0: "modelid",
url: "/dst/datamodels/${p0}/propertys",
title: "{{item.label}}",
value: "{{item.id}}",
},
],
options: {
select2_options: {
width: 350,
value: "",
},
},
propertyOrder: 4,
},
field: {
type: "selectnew",
title: "维度属性",
watch: {
modelid: "arr_dim.modelid",
entity: "arr_dim.name",
},
enumSource: [
{
source: [...[{ label: "--", id: "" }]],
p0: "modelid",
p1: "entity",
url: "/dst/datamodels/${p0}/propertys/${p1}/fields",
title: "{{item.label}}",
value: "{{item.id}}",
},
],
links: [
{
rel: "查看",
href: "/dstweb/app/codelist/dst/fielddict/{{self}}",
},
],
options: {
select2_options: {
width: 250,
value: "",
},
},
propertyOrder: 5,
},
dict: {
title: "数据字典",
type: "string",
options: {
grid_columns: 4,
},
propertyOrder: 6,
},
recursive: {
title: "逐层核算",
type: "number",
enumSource: [
{
source: [
{ id: 1, label: "是" },
{ id: 0, label: "否" },
],
title: "{{item.label}}",
value: "{{item.id}}",
},
],
options: {
grid_columns: 4,
},
propertyOrder: 7,
},
},
},
};
return _schema;
}
/**
* 编辑器生成
*
* @memberof AppFormJson
*/
public async renderJsoneditor() {
var _this = this;
var element = document.getElementById(_this.id);
if (this.editor) {
this.editor.destroy();
}
let opt: any = await _this.getOptions();
this.editor = new JSONEditor(element, opt);
this.editor.on("change", () => {
let value = _this.editor.getValue();
_this.CurrentVal = value;
});
}
public async getOptions(): Promise<any> {
let _options = {
theme: "bootstrap3",
iconlib: "fontawesome4",
disable_edit_json: true,
display_required_only: true,
disable_collapse: true,
disable_array_delete_last_row: true,
ajax: true,
};
_options["schema"] = await this.getSchema();
if (this.CurrentVal) {
_options["startval"] = this.CurrentVal;
}
if (this.options) {
return Object.assign({}, _options, this.options);
}
return _options;
}
}
</script>
\ No newline at end of file
...@@ -2,135 +2,380 @@ ...@@ -2,135 +2,380 @@
import { Component, Vue, Prop, Model, Watch } from "vue-property-decorator"; import { Component, Vue, Prop, Model, Watch } from "vue-property-decorator";
import { VNode, CreateElement } from "vue"; import { VNode, CreateElement } from "vue";
import { interval, Subject, Subscription } from "rxjs"; import { interval, Subject, Subscription } from "rxjs";
import { Http,Util } from '@/utils'; import { Http, Util } from "@/utils";
import JSONEditor from "@json-editor/json-editor"; import JSONEditor from "@json-editor/json-editor";
import BootstrapVue from "bootstrap-vue"; import BootstrapVue from "bootstrap-vue";
import "bootstrap/dist/css/bootstrap.css"; import "bootstrap/dist/css/bootstrap.css";
import "bootstrap-vue/dist/bootstrap-vue.css"; import "bootstrap-vue/dist/bootstrap-vue.css";
import CodeListService from "@/codelist/codelist-service"; import CodeListService from "@/codelist/codelist-service";
import AppFormJson from './app-form-json.vue'; import AppFormJson from "./app-form-json.vue";
@Component({ @Component({
components: { components: {},
}
}) })
export default class AppFormJsonFieldSet extends AppFormJson { export default class AppFormJsonFieldSet extends AppFormJson {
public codeListService:CodeListService = new CodeListService({ $store: this.$store }); public codeListService: CodeListService = new CodeListService({
$store: this.$store,
});
public async getSchema(): Promise<any>{ public async getSchema(): Promise<any> {
let _schema = { let _schema = {
"title": "表头配置", title: "指标",
"type": "array", type: "object",
"format": "tabs", format: "grid",
"required": ["headerName"], id: "arr_columnDefs",
"items": { $ref: "#/definitions/fieldDefs",
"$ref": "#/definitions/columnDefs" definitions: {
}, fieldDefs: {
"default":{headerName:"列名称"}, type: "object",
"definitions": { title: "指标",
"columnDefs": { required: [
"id" : "arr_columnDefs", "metricentity",
"type": "object", "metricfield",
"title": "展现", "timeentity",
"headerTemplate": "{{ self.headerName }}", "timefield",
"required": ["headerName","entity","field"], "domainsentity",
"properties": { "domainsfield",
"headerName": { "modelid",
"type": "string", ],
"title": "列头", properties: {
"default": "列名称", modelid: {
}, type: "string",
"width": { title: "模型",
"type": "integer",
"title": "宽度",
"default": "50",
},
"entity": {
"type": "string",
"title": "模型",
options: { options: {
grid_columns: 12,
hidden: true,
select2_options: { select2_options: {
width: 200, width: 350,
value: '' },
} },
enumSource: [
{
source: [
{ id: this.data.modelid, text: this.data.modelname },
],
title: "{{item.text}}",
value: "{{item.id}}",
}, },
enumSource: [] ],
propertyOrder: 21,
}, },
"field":{ metricentity: {
"type": "selectnew", type: "selectnew",
"title": "属性", title: "指标实体",
"watch": { watch: {
"entity12": "arr_columnDefs.entity" , modelid: "arr_columnDefs.modelid",
}, },
"links": [ enumSource: [
{ {
"rel": "查看", source: [...[{ label: "--", id: "" }]],
"href": "javascript:window.showdetail('dametric-edit-view',{'dametric':'{{self}}'})" p0: "modelid",
} url: "/dst/datamodels/${p0}/propertys",
title: "{{item.label}}",
value: "{{item.id}}",
},
], ],
options: { options: {
grid_columns: 6,
select2_options: { select2_options: {
width: 350, //width: 350,
value: '' value: "",
}
}, },
"enumSource":[{"source":[...[{metric_name:"--",metric_id:""}]],
"p0":"entity12" ,"url":'/dabuilds/${p0}/dametrics/fetchdefault',
"title": "{{item.metric_name}}", "value": "{{item.metric_id}}"}]
}, },
"children": { propertyOrder: 4,
"type": "array",
"format": "tabs",
"required": ["headerName","entity","field"],
"title": "下级",
"items": {
"$ref": "#/definitions/columnDefs"
}, },
"default":{headerName:"列名称"} metricfield: {
} type: "selectnew",
} title: "指标属性",
} watch: {
} modelid: "arr_columnDefs.modelid",
}; entity: "arr_columnDefs.metricentity",
},
enumSource: [
{
source: [...[{ label: "--", id: "" }]],
p0: "modelid",
p1: "entity",
url: "/dst/datamodels/${p0}/propertys/${p1}/fields",
title: "{{item.label}}",
value: "{{item.id}}",
},
],
let _eset: Array<any> = []; options: {
try{ grid_columns: 6,
select2_options: {
//width: 250,
value: "",
},
},
propertyOrder: 5,
},
let cond={}; timeentity: {
const localdata = window.localStorage.getItem('localdata'); type: "selectnew",
if(localdata) cond={"n_systemid_eq":localdata["dstsystemid"]}; title: "时间实体",
const res = await this.codeListService.getItems("CLModel",{},cond); watch: {
_eset.push(...res); modelid: "arr_columnDefs.modelid",
}catch(er){} },
enumSource: [
{
source: [...[{ label: "--", id: "" }]],
p0: "modelid",
url: "/dst/datamodels/${p0}/propertys",
title: "{{item.label}}",
value: "{{item.id}}",
},
],
options: {
grid_columns: 6,
select2_options: {
//width: 350,
value: "",
},
},
propertyOrder: 6,
},
timefield: {
type: "selectnew",
title: "时间属性",
watch: {
modelid: "arr_columnDefs.modelid",
entity: "arr_columnDefs.timeentity",
},
enumSource: [
{
source: [...[{ label: "--", id: "" }]],
p0: "modelid",
p1: "entity",
url: "/dst/datamodels/${p0}/propertys/${p1}/fields",
title: "{{item.label}}",
value: "{{item.id}}",
},
],
if (_eset) { options: {
let _items = [...[{text:"--",id:""}],..._eset]; grid_columns: 6,
let sourceobj={"source":_items,"title": "{{item.text}}", "value": "{{item.id}}"}; select2_options: {
_schema.definitions.columnDefs.properties.entity.enumSource=[sourceobj]; //width: 250,
} value: "",
},
},
propertyOrder: 7,
},
domainsentity: {
type: "selectnew",
title: "分区实体",
watch: {
modelid: "arr_columnDefs.modelid",
},
enumSource: [
{
source: [...[{ label: "--", id: "" }]],
p0: "modelid",
url: "/dst/datamodels/${p0}/propertys",
title: "{{item.label}}",
value: "{{item.id}}",
},
],
options: {
grid_columns: 6,
select2_options: {
//width: 350,
value: "",
},
},
propertyOrder: 8,
},
domainsfield: {
type: "selectnew",
title: "分区属性",
watch: {
modelid: "arr_columnDefs.modelid",
entity: "arr_columnDefs.domainsentity",
},
enumSource: [
{
source: [...[{ label: "--", id: "" }]],
p0: "modelid",
p1: "entity",
url: "/dst/datamodels/${p0}/propertys/${p1}/fields",
title: "{{item.label}}",
value: "{{item.id}}",
},
],
options: {
grid_columns: 6,
select2_options: {
//width: 250,
value: "",
},
},
propertyOrder: 9,
},
keyvalueentity: {
type: "selectnew",
title: "标示实体",
watch: {
modelid: "arr_columnDefs.modelid",
},
enumSource: [
{
source: [...[{ label: "--", id: "" }]],
p0: "modelid",
url: "/dst/datamodels/${p0}/propertys",
title: "{{item.label}}",
value: "{{item.id}}",
},
],
options: {
select2_options: {
//width: 350,
value: "",
},
},
propertyOrder: 10,
},
keyvaluefield: {
type: "selectnew",
title: "标示属性",
watch: {
modelid: "arr_columnDefs.modelid",
entity: "arr_columnDefs.keyvalueentity",
},
enumSource: [
{
source: [...[{ label: "--", id: "" }]],
p0: "modelid",
p1: "entity",
url: "/dst/datamodels/${p0}/propertys/${p1}/fields",
title: "{{item.label}}",
value: "{{item.id}}",
},
],
options: {
grid_columns: 6,
select2_options: {
// width: 250,
value: "",
},
},
propertyOrder: 11,
},
ext1entity: {
type: "selectnew",
title: "附加实体1",
watch: {
modelid: "arr_columnDefs.modelid",
},
enumSource: [
{
source: [...[{ label: "--", id: "" }]],
p0: "modelid",
url: "/dst/datamodels/${p0}/propertys",
title: "{{item.label}}",
value: "{{item.id}}",
},
],
options: {
grid_columns: 6,
select2_options: {
// width: 350,
value: "",
},
},
propertyOrder: 12,
},
ext1field: {
type: "selectnew",
title: "附加属性1",
watch: {
modelid: "arr_columnDefs.modelid",
entity: "arr_columnDefs.ext1entity",
},
enumSource: [
{
source: [...[{ label: "--", id: "" }]],
p0: "modelid",
p1: "entity",
url: "/dst/datamodels/${p0}/propertys/${p1}/fields",
title: "{{item.label}}",
value: "{{item.id}}",
},
],
// let _fset: Array<any> = []; options: {
grid_columns: 6,
select2_options: {
//width: 250,
value: "",
},
},
propertyOrder: 13,
},
// try{ ext2entity: {
// const res = await this.codeListService.getItems("CLMetric"); type: "selectnew",
// _fset.push(...res); title: "附加实体2",
// }catch(er){ watch: {
modelid: "arr_columnDefs.modelid",
},
enumSource: [
{
source: [...[{ label: "--", id: "" }]],
p0: "modelid",
url: "/dst/datamodels/${p0}/propertys",
title: "{{item.label}}",
value: "{{item.id}}",
},
],
options: {
grid_columns: 6,
select2_options: {
//width: 350,
value: "",
},
},
propertyOrder: 14,
},
ext2field: {
type: "selectnew",
title: "附加属性2",
watch: {
modelid: "arr_columnDefs.modelid",
entity: "arr_columnDefs.ext2entity",
},
enumSource: [
{
source: [...[{ label: "--", id: "" }]],
p0: "modelid",
p1: "entity",
url: "/dst/datamodels/${p0}/propertys/${p1}/fields",
title: "{{item.label}}",
value: "{{item.id}}",
},
],
// } options: {
grid_columns: 6,
select2_options: {
//width: 250,
value: "",
},
},
propertyOrder: 15,
},
},
},
},
};
// if (_fset) {
// let _items = [...[{text:"--",id:""}],..._fset];
// let sourceobj={"source":_items,"filterText":"entity12","title": "{{item.text}}", "value": "{{item.id}}"};
// _schema.definitions.columnDefs.properties.field.enumSource=[sourceobj];
// }
return _schema; return _schema;
} }
} }
</script> </script>
\ No newline at end of file
...@@ -2,300 +2,360 @@ ...@@ -2,300 +2,360 @@
import { Component, Vue, Prop, Model, Watch } from "vue-property-decorator"; import { Component, Vue, Prop, Model, Watch } from "vue-property-decorator";
import { VNode, CreateElement } from "vue"; import { VNode, CreateElement } from "vue";
import { interval, Subject, Subscription } from "rxjs"; import { interval, Subject, Subscription } from "rxjs";
import { Http,Util } from '@/utils'; import { Http, Util } from "@/utils";
import JSONEditor from "@json-editor/json-editor"; import JSONEditor from "@json-editor/json-editor";
import BootstrapVue from "bootstrap-vue"; import BootstrapVue from "bootstrap-vue";
import "bootstrap/dist/css/bootstrap.css"; import "bootstrap/dist/css/bootstrap.css";
import "bootstrap-vue/dist/bootstrap-vue.css"; import "bootstrap-vue/dist/bootstrap-vue.css";
import CodeListService from "@/codelist/codelist-service"; import CodeListService from "@/codelist/codelist-service";
import AppFormJson from './app-form-json.vue'; import AppFormJson from "./app-form-json.vue";
@Component({ @Component({
components: { components: {},
}
}) })
export default class AppFormJsonLogic extends AppFormJson { export default class AppFormJsonLogic extends AppFormJson {
public codeListService:CodeListService = new CodeListService({ $store: this.$store }); public codeListService: CodeListService = new CodeListService({
$store: this.$store,
});
public async getSchema(): Promise<any>{ public async getSchema(): Promise<any> {
let _field ={ window["showdetail"]=this.showdetail;
"type": "object", let _field = {
"title": "值项", type: "object",
"grid_columns": 12, title: "值项",
"headerTemplate": "{{ self.fieldname }} - {{ self.fieldcond }} - {{ self.condvalue }}", grid_columns: 12,
"required": ["entityname","fieldname","fieldcond","condvalue"], headerTemplate:
"properties": { "{{ self.fieldname }} - {{ self.fieldcond }} - {{ self.condvalue }}",
"entityname": { required: ["entityname", "fieldname", "fieldcond", "condvalue"],
"type": "selectnew", properties: {
"title": "实体", entityname: {
"watch": { type: "selectnew",
"modelid": "root.rootmodelid" title: "实体",
}, watch: {
"enumSource":[{"source":[...[{label:"--",id:""}]], modelid: "root.rootmodelid",
"p0":"modelid" ,"url":'/dst/datamodels/${p0}/propertys', },
"title": "{{item.label}}", "value": "{{item.id}}"}], enumSource: [
{
source: [...[{ label: "--", id: "" }]],
p0: "modelid",
url: "/dst/datamodels/${p0}/propertys",
title: "{{item.label}}",
value: "{{item.id}}",
},
],
options: { options: {
select2_options: { select2_options: {
width: 250, width: 300,
value: '' value: "",
} },
} },
}, },
"fieldname": { fieldname: {
"type": "selectnew", type: "selectnew",
"title": "属性", title: "属性",
"watch": { watch: {
"modelid": "root.rootmodelid" , modelid: "root.rootmodelid",
"entity": "arr_field.entityname" , entity: "arr_field.entityname",
}, },
"enumSource":[{"source":[...[{label:"--",id:""}]], enumSource: [
"p0":"modelid" ,"p1":"entity" ,"url":'/dst/datamodels/${p0}/propertys/${p1}/fields',
"title": "{{item.label}}", "value": "{{item.id}}"}],
"links": [
{ {
"rel": "查看", source: [...[{ label: "--", id: "" }]],
"href": "/dstweb/app/codelist/dst/fielddict/{{self}}" p0: "modelid",
} p1: "entity",
url: "/dst/datamodels/${p0}/propertys/${p1}/fields",
title: "{{item.label}}",
value: "{{item.id}}",
},
],
links: [
{
rel: "查看",
"href": "javascript:window.showdetail('DICT',{'field':'{{self}}'})"
},
], ],
options: { options: {
select2_options: { select2_options: {
width: 300, width: 250,
value: '' value: "",
} },
} },
}, },
"fieldcond": { fieldcond: {
"type": "string", type: "string",
"title": "判断", title: "判断",
"enumSource":[], enumSource: [],
options: { options: {
select2_options: { select2_options: {
width: 100, width: 100,
value: '' value: "",
}
}
}, },
"condvalue": {
"title": "值",
"type": "string"
}, },
"condref": {
"title": "辅助字典",
"type": "string",
"watch": {
"sourceitem": "arr_field.fieldname"
}, },
"enumSource":[{"source":[...[{text:"--",value:""}]], "filter3":"sourceitem" , "title": "{{item.text}}", "value": "{{item.value}}"}], condvalue: {
options: { title: "值",
select2_options: { type: "string",
width: 300, },
value: '' condref: {
} title: "辅助字典",
} type: "string",
}
} options: {
hidden:true
},
},
},
}; };
let _releationfield = JSON.parse(JSON.stringify(_field)); let _releationfield = JSON.parse(JSON.stringify(_field));
_releationfield.properties.entityname.watch={ _releationfield.properties.entityname.watch = {
"modelid": "root.rootmodelid" , modelid: "root.rootmodelid",
"submodel": "arr_releation.releationentity" , submodel: "arr_releation.releationentity",
}; };
_releationfield.properties.entityname.enumSource = [{"source":[...[{label:"--",id:""}]], _releationfield.properties.entityname.enumSource = [
"p0":"modelid" ,"p1":"submodel" ,"url":'/dst/datamodels/${p0}/name/${p1}/propertys', {
"title": "{{item.label}}", "value": "{{item.id}}"}]; source: [...[{ label: "--", id: "" }]],
_releationfield.properties.fieldname.watch={ p0: "modelid",
"modelid": "root.rootmodelid" , p1: "submodel",
"submodel": "arr_releation.releationentity" , url: "/dst/datamodels/${p0}/name/${p1}/propertys",
"entity": "arr_field.entityname" , title: "{{item.label}}",
value: "{{item.id}}",
},
];
_releationfield.properties.fieldname.watch = {
modelid: "root.rootmodelid",
submodel: "arr_releation.releationentity",
entity: "arr_field.entityname",
}; };
_releationfield.properties.fieldname.enumSource = [{"source":[...[{label:"--",id:""}]], _releationfield.properties.fieldname.enumSource = [
"p0":"modelid" ,"p1":"submodel", "p2":"entity" ,"url":'/dst/datamodels/${p0}/name/${p1}/propertys/${p2}/fields', {
"title": "{{item.label}}", "value": "{{item.id}}"}]; source: [...[{ label: "--", id: "" }]],
p0: "modelid",
p1: "submodel",
p2: "entity",
url: "/dst/datamodels/${p0}/name/${p1}/propertys/${p2}/fields",
title: "{{item.label}}",
value: "{{item.id}}",
},
];
let _group = { let _group = {
"type": "object", type: "object",
"title": "组逻辑", title: "组逻辑",
"headerTemplate": "{{ self.groupcond }}", headerTemplate: "{{ self.groupcond }}",
"required": ["groupcond"], required: ["groupcond"],
"properties": { properties: {
"groupcond": { groupcond: {
"grid_columns": 12, grid_columns: 12,
"type": "string", type: "string",
"title": "AND/OR", title: "AND/OR",
"default": "AND", default: "AND",
"enumSource": [{"source":[{"id":"AND"},{"id":"OR"}],"title": "{{item.id}}", "value": "{{item.id}}"}], enumSource: [
{
source: [{ id: "AND" }, { id: "OR" }],
title: "{{item.id}}",
value: "{{item.id}}",
},
],
options: { options: {
select2_options: { select2_options: {
width: 120, width: 120,
value: '', value: "",
placeholder: "请选择", placeholder: "请选择",
}
}
}, },
"group": {
"type": "array",
"required": ["groupcond"],
"title": "组",
"items": {
"$ref": "#/definitions/group"
}
}, },
"field": { },
"grid_columns": 12, group: {
"type": "array", type: "array",
"format": "table", required: ["groupcond"],
"title": "值项", title: "组",
"items": { items: {
"id":"arr_field", $ref: "#/definitions/group",
"$ref": "#/definitions/field" },
} },
} field: {
} grid_columns: 12,
type: "array",
format: "table",
title: "值项",
items: {
id: "arr_field",
$ref: "#/definitions/field",
},
},
},
}; };
let _releationgroup = JSON.parse(JSON.stringify(_group)); let _releationgroup = JSON.parse(JSON.stringify(_group));
_releationgroup.properties.field.items.$ref="#/definitions/releationfield"; _releationgroup.properties.field.items.$ref =
_releationgroup.properties.group.items.$ref="#/definitions/releationgroup"; "#/definitions/releationfield";
_releationgroup.required = ["groupcond","field"]; _releationgroup.properties.group.items.$ref =
"#/definitions/releationgroup";
_releationgroup.required = ["groupcond", "field"];
let _schema = { let _schema = {
"title": "逻辑规则", title: "逻辑规则",
"type": "object", type: "object",
"$ref": "#/definitions/root", $ref: "#/definitions/root",
"definitions": { definitions: {
root: {
"root": { type: "object",
"type": "object", title: "逻辑",
"title": "逻辑", headerTemplate: "{{ self.groupcond }}",
"headerTemplate": "{{ self.groupcond }}", required: ["groupcond", "rootmodelid"],
"required": ["groupcond","rootmodelid"], properties: {
"properties": { rootmodelid: {
"rootmodelid": { grid_columns: 6,
"grid_columns": 6, type: "string",
"type": "string", title: "模型",
"title": "模型", enumSource: [
"enumSource": [{"source":[{"id":this.data.modelid,"text":this.data.modelname}],"title": "{{item.text}}", "value": "{{item.id}}"}] {
}, source: [
"groupcond": { { id: this.data.modelid, text: this.data.modelname },
"grid_columns": 6, ],
"type": "string", title: "{{item.text}}",
"title": "AND", value: "{{item.id}}",
"default": "AND",
"enumSource": [{"source":[{"id":"AND"}],"title": "{{item.id}}", "value": "{{item.id}}"}]
},
"field": {
"grid_columns": 12,
"type": "array",
"format": "table",
"title": "值项",
"items": {
"id":"arr_field",
"$ref": "#/definitions/field"
}
}, },
"group": { ],
"type": "array", options: {
"required": ["groupcond","field"], hidden: true,
"title": "组逻辑",
"format": "tabs",
"items": {
"$ref": "#/definitions/group"
}
}, },
"releation": {
"type": "array",
"required": ["releationcond"],
"title": "子数据逻辑",
"format": "tabs",
"items": {
"id":"arr_releation",
"$ref": "#/definitions/releation"
}
}
}
}, },
"releation": { groupcond: {
"type": "object", grid_columns: 6,
"title": "子数据逻辑", type: "string",
"headerTemplate": "{{ self.releationcond }}-{{ self.releationentity }}", title: "AND",
"required": ["releationcond","releationentity","group"], default: "AND",
"properties": { enumSource: [
"releationcond": { {
"grid_columns": 6, source: [{ id: "AND" }],
"type": "string", title: "{{item.id}}",
"title": "存在/不存在", value: "{{item.id}}",
"default": "exists", },
"enumSource": [{"source":[{"id":"exists"},{"id":"not exists"}],"title": "{{item.id}}", "value": "{{item.id}}"}], ],
options: {
hidden: true,
},
},
field: {
grid_columns: 12,
type: "array",
format: "table",
title: "值项",
items: {
id: "arr_field",
$ref: "#/definitions/field",
},
},
group: {
type: "array",
required: ["groupcond", "field"],
title: "组逻辑",
format: "tabs",
items: {
$ref: "#/definitions/group",
},
},
releation: {
type: "array",
required: ["releationcond"],
title: "子数据逻辑",
format: "tabs",
items: {
id: "arr_releation",
$ref: "#/definitions/releation",
},
},
},
},
releation: {
type: "object",
title: "子数据逻辑",
format: "grid",
headerTemplate: "{{ self.releationcond }}-{{ self.releationentity }}",
required: ["releationcond", "releationentity", "group"],
properties: {
releationcond: {
grid_columns: 3,
type: "string",
title: "存在/不存在",
default: "exists",
enumSource: [
{
source: [{ id: "exists" }, { id: "not exists" }],
title: "{{item.id}}",
value: "{{item.id}}",
},
],
options: { options: {
grid_columns: 3,
select2_options: { select2_options: {
width: 120, width: 120,
value: '', value: "",
placeholder: "请选择", placeholder: "请选择",
}
}
}, },
"releationentity": {
"grid_columns": 6,
"type": "selectnew",
"title": "子数据实体",
"watch": {
"modelid": "root.rootmodelid" ,
}, },
"enumSource":[{"source":[...[{label:"--",id:""}]], },
"p0":"modelid" ,"url":'/dst/datamodels/${p0}/submodels', releationentity: {
"title": "{{item.label}}", "value": "{{item.id}}"}], grid_columns: 3,
type: "selectnew",
title: "子数据实体",
watch: {
modelid: "root.rootmodelid",
},
enumSource: [
{
source: [...[{ label: "--", id: "" }]],
p0: "modelid",
url: "/dst/datamodels/${p0}/submodels",
title: "{{item.label}}",
value: "{{item.id}}",
},
],
options: { options: {
grid_columns: 3,
select2_options: { select2_options: {
width: 200, width: 250,
value: '', value: "",
placeholder: "请选择", placeholder: "请选择",
}
}
}, },
"group": {
"type": "array",
"required": ["groupcond"],
"title": "组逻辑",
"items": {
"$ref": "#/definitions/releationgroup"
}
}
}
}, },
"group": _group, },
"releationgroup": _releationgroup, group: {
"field":_field, type: "array",
"releationfield":_releationfield required: ["groupcond","field"],
title: "组逻辑",
items: {
} $ref: "#/definitions/releationgroup",
},
},
},
},
group: _group,
releationgroup: _releationgroup,
field: _field,
releationfield: _releationfield,
},
}; };
let _fcond = JSON.parse(JSON.stringify(this.$store.getters.getCodeList("OPCond"))); let _fcond = JSON.parse(
JSON.stringify(this.$store.getters.getCodeList("OPCond"))
);
if (_fcond) { if (_fcond) {
let _items = [..._fcond.items]; let _items = [..._fcond.items];
let sourceobj={"source":_items,"title": "{{item.text}}", "value": "{{item.id}}"}; let sourceobj = {
_schema.definitions.field.properties.fieldcond.enumSource=[sourceobj]; source: _items,
_schema.definitions.releationfield.properties.fieldcond.enumSource=[sourceobj]; title: "{{item.text}}",
value: "{{item.id}}",
};
_schema.definitions.field.properties.fieldcond.enumSource = [sourceobj];
_schema.definitions.releationfield.properties.fieldcond.enumSource = [
sourceobj,
];
} }
// let _fset: Array<any> = []; // let _fset: Array<any> = [];
// try{ // try{
...@@ -313,5 +373,35 @@ export default class AppFormJsonLogic extends AppFormJson { ...@@ -313,5 +373,35 @@ export default class AppFormJsonLogic extends AppFormJson {
return _schema; return _schema;
} }
public showdetail(path:any,arg:any)
{
if(path === 'DICT')
{
let fieldname:any = arg.field;
this.$http.get("/dst/datamodels/"+this.data.modelid+"/"+fieldname+"/dict").then((response: any) => {
if(response.data)
{
let newitem : Array<any>=[];
response.data.forEach((item:any) =>{
if(item.pvalue)
newitem.push({id:item.id,label:item.text,parent:item.pvalue})
else
newitem.push({id:item.id,label:item.text})
})
this.$alert('<div style="height:500px;width:100%;overflow:auto;background:#EEEEEE;"><pre>'+JSON.stringify(newitem,null,4)+'<PRE></div>', '字典', {
dangerouslyUseHTMLString: true
});
}
}).catch((response: any) => {
});
}
else
{
super.showdetail(path,arg);
}
}
} }
</script> </script>
\ No newline at end of file
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<div class="app-form-json"> <div class="app-form-json">
<div :id='id' :innerHTML="id"></div> <div :id='id' :innerHTML="id"></div>
<el-input type="hidden" :rows="2" placeholder="请输入内容" v-model="CurrentVal"> <el-input type="textarea" :rows="10" placeholder="请输入内容" v-model="CurrentVal">
</el-input> </el-input>
</div> </div>
</template> </template>
...@@ -497,7 +497,19 @@ export default class AppFormJson extends Vue { ...@@ -497,7 +497,19 @@ export default class AppFormJson extends Vue {
if (Object.is($event.type, "load")) { if (Object.is($event.type, "load")) {
this.renderJsoneditor(); this.renderJsoneditor();
} }
if (Object.is($event.type, 'save')) {
this.renderJsoneditor();
}
// 表单项更新
if (Object.is($event.type, 'updateformitem')) {
if (!$event.data) {
return;
}
this.renderJsoneditor();
}
}); });
window["showdetail"]=this.showdetail; window["showdetail"]=this.showdetail;
} }
......
...@@ -40,7 +40,6 @@ export default class AppTreeselectRefreshview extends Vue { ...@@ -40,7 +40,6 @@ export default class AppTreeselectRefreshview extends Vue {
public props: any = { public props: any = {
value: "id", // ID字段名 value: "id", // ID字段名
label: "label", // 显示名称 label: "label", // 显示名称
children: "apps", // 子级字段名
}; };
/** /**
...@@ -117,14 +116,18 @@ export default class AppTreeselectRefreshview extends Vue { ...@@ -117,14 +116,18 @@ export default class AppTreeselectRefreshview extends Vue {
let tempData: any = []; let tempData: any = [];
data.forEach((item: any) => { data.forEach((item: any) => {
let tempItem: any = item; let tempItem: any = item;
if (tempItem.apps && tempItem.apps.length>0) {
tempItem.id = tempItem.apps[0].id;
tempItem.appname=tempItem.apps[0].label;
if (tempItem.pssystemid) { if (tempItem.pssystemid) {
tempItem.id = tempItem.pssystemid;
tempItem.systemId = tempItem.pssystemid; tempItem.systemId = tempItem.pssystemid;
} }
if (tempItem.pssystemname) { if (tempItem.pssystemname) {
tempItem.label = tempItem.pssystemname; tempItem.label = tempItem.pssystemname;
} }
tempData.push(tempItem); tempData.push(tempItem);
}
}); });
// 给树赋值 // 给树赋值
...@@ -132,12 +135,7 @@ export default class AppTreeselectRefreshview extends Vue { ...@@ -132,12 +135,7 @@ export default class AppTreeselectRefreshview extends Vue {
// 下拉树 // 下拉树
let tree: any = this.$refs.selectTree; let tree: any = this.$refs.selectTree;
// 第一个叶子节点 // 第一个叶子节点
let firstNode: any = {}; let firstNode: any = tempData[0];
if (tempData[0].apps) {
firstNode = tempData[0].apps;
} else {
firstNode = tempData[0];
}
// 从local中拿刷新前选中值 // 从local中拿刷新前选中值
if (localStorage.getItem("localdata")) { if (localStorage.getItem("localdata")) {
...@@ -145,16 +143,20 @@ export default class AppTreeselectRefreshview extends Vue { ...@@ -145,16 +143,20 @@ export default class AppTreeselectRefreshview extends Vue {
localStorage.getItem("localdata") as string localStorage.getItem("localdata") as string
); );
this.valueId = localdata.dstappid; this.valueId = localdata.dstappid;
this.valueTitle = localdata.title;
this.defaultExpandedKey.push(localdata.dstappid); this.defaultExpandedKey.push(localdata.dstappid);
tempData.forEach((item: any) => {
if(item.id===this.valueId)
this.valueTitle = item.label;
});
// 设置下拉树选中值 // 设置下拉树选中值
tree.setCurrentKey(localdata.dstappid); tree.setCurrentKey(localdata.dstappid);
} else { } else {
// 设置下拉框默认值 // 设置下拉框默认值
this.valueId = firstNode[0].id; this.valueId = firstNode[0].id;
this.valueTitle =
firstNode[0].systemId + "-" + firstNode[0].label;
this.defaultExpandedKey.push(firstNode[0].id); this.defaultExpandedKey.push(firstNode[0].id);
this.valueTitle = firstNode[0].label;
// 设置下拉树选中值 // 设置下拉树选中值
tree.setCurrentKey(firstNode[0].id); tree.setCurrentKey(firstNode[0].id);
} }
...@@ -188,10 +190,7 @@ export default class AppTreeselectRefreshview extends Vue { ...@@ -188,10 +190,7 @@ export default class AppTreeselectRefreshview extends Vue {
* @memberof AppTreeselectRefreshview * @memberof AppTreeselectRefreshview
*/ */
public handleNodeClick(node: any) { public handleNodeClick(node: any) {
// 父级节点不进行处理
if (node.apps) {
return;
}
// 从local中拿刷新前选中值 // 从local中拿刷新前选中值
if (localStorage.getItem("localdata")) { if (localStorage.getItem("localdata")) {
const localdata: any = JSON.parse( const localdata: any = JSON.parse(
...@@ -204,12 +203,12 @@ export default class AppTreeselectRefreshview extends Vue { ...@@ -204,12 +203,12 @@ export default class AppTreeselectRefreshview extends Vue {
// 重新赋值 // 重新赋值
this.valueId = node[this.props.value]; this.valueId = node[this.props.value];
const dstsystemid: any = node.systemId; const dstsystemid: any = node.systemId;
this.valueTitle = dstsystemid + "-" + node[this.props.label]; this.valueTitle = node[this.props.label];
// 添加本地应用数据 // 添加本地应用数据
const localdata: any = { const localdata: any = {
dstsystemid: dstsystemid, dstsystemid: dstsystemid,
dstappid: this.valueId, dstappid: this.valueId,
title: this.valueTitle, title: dstsystemid + "-" + node.appname,
}; };
this.$store.commit("addLocalData", localdata); this.$store.commit("addLocalData", localdata);
// 调用App.vue的加载行为 // 调用App.vue的加载行为
......
...@@ -5,6 +5,7 @@ import AppFormJsonDaChart from './components/app-form-json/app-form-json-da-cha ...@@ -5,6 +5,7 @@ import AppFormJsonDaChart from './components/app-form-json/app-form-json-da-cha
import AppFormJsonDaReport from './components/app-form-json/app-form-json-da-report.vue' import AppFormJsonDaReport from './components/app-form-json/app-form-json-da-report.vue'
import AppFormJsonLogic from './components/app-form-json/app-form-json-logic.vue' import AppFormJsonLogic from './components/app-form-json/app-form-json-logic.vue'
import AppFormJsonFieldSet from './components/app-form-json/app-form-json-field-set.vue' import AppFormJsonFieldSet from './components/app-form-json/app-form-json-field-set.vue'
import AppFormJsonDim from './components/app-form-json/app-form-json-dim.vue'
import AppTreeselectRefreshview from './components/app-treeselect-refreshview/app-treeselect-refreshview.vue' import AppTreeselectRefreshview from './components/app-treeselect-refreshview/app-treeselect-refreshview.vue'
import 'jquery/dist/jquery.min.js' import 'jquery/dist/jquery.min.js'
import $ from 'jquery' import $ from 'jquery'
...@@ -20,5 +21,6 @@ export const UserComponent = { ...@@ -20,5 +21,6 @@ export const UserComponent = {
v.component('app-form-json-da-report', AppFormJsonDaReport); v.component('app-form-json-da-report', AppFormJsonDaReport);
v.component('app-form-json-logic', AppFormJsonLogic); v.component('app-form-json-logic', AppFormJsonLogic);
v.component('app-form-json-field-set', AppFormJsonFieldSet); v.component('app-form-json-field-set', AppFormJsonFieldSet);
v.component('app-form-json-dim', AppFormJsonDim);
} }
}; };
\ No newline at end of file
...@@ -2,11 +2,15 @@ package cn.ibizlab.api.rest.extensions; ...@@ -2,11 +2,15 @@ package cn.ibizlab.api.rest.extensions;
import cn.ibizlab.core.dict.extensions.vo.Option; import cn.ibizlab.core.dict.extensions.vo.Option;
import cn.ibizlab.core.lite.domain.DstSystem; import cn.ibizlab.core.lite.domain.DstSystem;
import cn.ibizlab.core.lite.domain.MetaField;
import cn.ibizlab.core.lite.extensions.domain.*; import cn.ibizlab.core.lite.extensions.domain.*;
import cn.ibizlab.core.lite.extensions.model.DataModel; import cn.ibizlab.core.lite.extensions.model.DataModel;
import cn.ibizlab.core.lite.extensions.model.Property; import cn.ibizlab.core.lite.extensions.model.Property;
import cn.ibizlab.core.lite.extensions.service.DbEntityService; import cn.ibizlab.core.lite.extensions.service.DbEntityService;
import cn.ibizlab.core.lite.extensions.service.LiteModelService; import cn.ibizlab.core.lite.extensions.service.LiteModelService;
import cn.ibizlab.util.client.IBZDictFeignClient;
import cn.ibizlab.util.dict.CodeItem;
import cn.ibizlab.util.dict.CodeList;
import cn.ibizlab.util.errors.BadRequestAlertException; import cn.ibizlab.util.errors.BadRequestAlertException;
import cn.ibizlab.util.helper.DataObject; import cn.ibizlab.util.helper.DataObject;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
...@@ -90,6 +94,36 @@ public class DstCoreResource { ...@@ -90,6 +94,36 @@ public class DstCoreResource {
return ResponseEntity.ok(list); return ResponseEntity.ok(list);
} }
@Autowired
private IBZDictFeignClient dictFeignClient;
@RequestMapping(method = RequestMethod.GET, value = {"/dst/datamodels/{modelid}/{propertyname}.{fieldname}/dict"})
public ResponseEntity<List<CodeItem>> getDataModelFieldDict(@PathVariable(name="modelid",required = false) String modelid,
@PathVariable(name="propertyname",required = false) String propertyname,
@PathVariable(name="fieldname",required = false) String fieldname)
{
List<CodeItem> list = new ArrayList<>();
Property property=liteModelService.getDataModel(modelid).findObjectProperty(propertyname,"ALL");
if(property!=null)
{
MetaField field=property.getEntityModel().getField(fieldname).getField();
if(field!=null)
{
String dict = field.getDict();
if(!StringUtils.isEmpty(dict))
{
CodeList codeList=dictFeignClient.getCodeList(dict);
if(codeList!=null)
list=codeList.getOptions();
}
}
}
return ResponseEntity.ok(list);
}
@RequestMapping(method = RequestMethod.GET, value = "/dst/{system}/entitys") @RequestMapping(method = RequestMethod.GET, value = "/dst/{system}/entitys")
public ResponseEntity<List<EntityModel>> getEntityModel(@PathVariable("system") String system) { public ResponseEntity<List<EntityModel>> getEntityModel(@PathVariable("system") String system) {
return ResponseEntity.status(HttpStatus.OK).body(liteModelService.getEntityModel(system)); return ResponseEntity.status(HttpStatus.OK).body(liteModelService.getEntityModel(system));
......
package cn.ibizlab.util.client; package cn.ibizlab.util.client;
import cn.ibizlab.util.dict.CodeItem;
import cn.ibizlab.util.dict.CodeList;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.PathVariable;
import java.util.List;
@Component @Component
public class IBZDictFallback implements IBZDictFeignClient { public class IBZDictFallback implements IBZDictFeignClient {
...@@ -10,4 +15,9 @@ public class IBZDictFallback implements IBZDictFeignClient { ...@@ -10,4 +15,9 @@ public class IBZDictFallback implements IBZDictFeignClient {
public Boolean syncRuntimeDict(JSONArray catalogs) { public Boolean syncRuntimeDict(JSONArray catalogs) {
return null; return null;
} }
@Override
public CodeList getCodeList(@PathVariable("code") String code) {
return null;
}
} }
package cn.ibizlab.util.client; package cn.ibizlab.util.client;
import cn.ibizlab.util.dict.CodeItem;
import cn.ibizlab.util.dict.CodeList;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import org.springframework.cloud.openfeign.FeignClient; import org.springframework.cloud.openfeign.FeignClient;
...@@ -16,4 +18,9 @@ public interface IBZDictFeignClient ...@@ -16,4 +18,9 @@ public interface IBZDictFeignClient
{ {
@RequestMapping(method = RequestMethod.POST, value = "/dictionarys/catalogs/sync") @RequestMapping(method = RequestMethod.POST, value = "/dictionarys/catalogs/sync")
Boolean syncRuntimeDict(@RequestBody JSONArray catalogs); Boolean syncRuntimeDict(@RequestBody JSONArray catalogs);
@RequestMapping(method = RequestMethod.GET, value = "/dictionarys/codelist/{code}")
CodeList getCodeList(@PathVariable("code") String code);
} }
package cn.ibizlab.util.dict;
import cn.ibizlab.util.annotation.DEField;
import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.experimental.Accessors;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
public class Catalog
{
private String code;
private String name;
@JSONField(name = "items")
@JsonProperty("items")
private List<Option> options = new ArrayList<>();
}
package cn.ibizlab.util.dict;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.experimental.Accessors;
import java.util.List;
import java.util.Map;
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
public class CodeItem
{
private String id;
private Object value;
private String label;
@JsonIgnore
@JSONField(serialize = false)
private List<CodeItem> children;
private String iconClass;
private String filter;
private Boolean disabled;
@JSONField(name = "pvalue")
@JsonProperty("pvalue")
private String parent;
private Map<String,Object> extension;
@JSONField(name = "text")
@JsonProperty("text")
public String getText()
{
return label;
}
}
package cn.ibizlab.util.dict;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.experimental.Accessors;
import java.util.ArrayList;
import java.util.List;
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
public class CodeList
{
@JSONField(name = "srfkey")
@JsonProperty("srfkey")
private String code;
private String name;
@JSONField(name = "emptytext")
@JsonProperty("emptytext")
public String getEmptytext()
{
return "";
}
@JSONField(name = "items")
@JsonProperty("items")
private List<CodeItem> options = new ArrayList<>();
}
package cn.ibizlab.util.dict;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.experimental.Accessors;
import java.util.List;
import java.util.Map;
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
public class Option
{
private String id;
private Object value;
private String label;
private List<Option> children;
private String iconClass;
private String filter;
private Boolean disabled;
@JsonIgnore
@JSONField(serialize = false)
private String parent;
private Map<String,Object> extension;
}
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册