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

modify

上级 cc909488
.app-form-json{
.btn-secondary {
color: black;
background-color: transparent;
border-color: transparent;
}
.form-control {
display: block;
height: calc(1.4em + 0.75rem + 2px);
padding: 0.375rem 0.75rem;
font-size: 13px;
font-weight: 400;
line-height: 1;
}
h3, .h3 {
font-size: 14px;
font-weight: 700;
margin-top: 5px;
}
.row{
> div {
> div{
display: flex;
}
}
}
.nav{
display: block;
> li{
border-radius: 5px;
padding: 5px;
cursor: pointer;
>
a:hover{
text-decoration: none;
}
}
.active{
background-color:#357AB3;
>
a{
color: #fff;
}
a:hover{
color: #fff;
}
}
}
.control-label{
min-width: 100px;
display: inline-block;
}
}
\ No newline at end of file
<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 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';
import "./app-form-json-da-chart.less";
JSONEditor.defaults.editors.link = JSONEditor.defaults.editors.string.extend({
getLink: function(data) {
var holder, link;
// Get mime type of the link
var mime = data.mediaType || 'application/javascript';
var type = mime.split('/')[0];
// Template to generate the link href
var href = this.jsoneditor.compileTemplate(data.href,this.template_engine);
var relTemplate = this.jsoneditor.compileTemplate(data.rel ? data.rel : data.href,this.template_engine);
// Template to generate the link's download attribute
var download = null;
if(data.download) download = data.download;
if(download && download !== true) {
download = this.jsoneditor.compileTemplate(download, this.template_engine);
}
// Image links
if(type === 'image') {
holder = this.theme.getBlockLinkHolder();
link = document.createElement('a');
link.setAttribute('target','_blank');
var image = document.createElement('img');
this.theme.createImageLink(holder,link,image);
// When a watched field changes, update the url
this.link_watchers.push(function(vars) {
var url = href(vars);
var rel = relTemplate(vars);
link.setAttribute('href',url);
link.setAttribute('title',rel || url);
image.setAttribute('src',url);
});
}
// Audio/Video links
else if(['audio','video'].indexOf(type) >=0) {
holder = this.theme.getBlockLinkHolder();
link = this.theme.getBlockLink();
link.setAttribute('target','_blank');
var media = document.createElement(type);
media.setAttribute('controls','controls');
this.theme.createMediaLink(holder,link,media);
// When a watched field changes, update the url
this.link_watchers.push(function(vars) {
var url = href(vars);
var rel = relTemplate(vars);
link.setAttribute('href',url);
link.textContent = rel || url;
media.setAttribute('src',url);
});
}
// Text links
else {
link = holder = this.theme.getBlockLink();
//holder.setAttribute('target','_blank');
holder.textContent = data.rel;
// When a watched field changes, update the url
this.link_watchers.push(function(vars) {
var url = href(vars);
var rel = relTemplate(vars);
holder.setAttribute('href',url);
holder.textContent = rel || url;
});
}
if(download && link) {
if(download === true) {
link.setAttribute('download','');
}
else {
this.link_watchers.push(function(vars) {
link.setAttribute('download',download(vars));
});
}
}
if(data.class) link.classList.add(data.class);
if(this.jsoneditor.options.no_link_holder){
holder.hidden = true;
}else{
holder.hidden = false;
}
return holder;
}
});
@Component({
components: {
}
})
export default class AppFormJsonDaChart extends AppFormJson {
public codeListService:CodeListService = new CodeListService({ $store: this.$store });
public async getSchema(): any{
let _schema = {
"title": "表头配置",
"type": "array",
"format": "tabs",
"required": ["headerName"],
"items": {
"$ref": "#/definitions/columnDefs"
},
"default":{headerName:"列名称"},
"definitions": {
"columnDefs": {
"id" : "arr_columnDefs",
"type": "object",
"title": "展现",
"headerTemplate": "{{ self.headerName }}",
"required": ["headerName","entity","field"],
"properties": {
"headerName": {
"type": "string",
"title": "列头",
"default": "列名称",
},
"width": {
"type": "integer",
"title": "宽度",
"default": "50",
},
"entity": {
"type": "string",
"title": "模型",
options: {
select2_options: {
width: 200,
value: ''
}
},
enumSource: []
},
"field":{
"type": "link",
"title": "属性",
"watch": {
"entity12": "arr_columnDefs.entity" ,
},
"links": [
{
"rel": "查看",
"href": "javascript:window.showfield('{{self}}')"// "/dstweb/index.html#/common_index/analyse_dametriceditview/srfkey={{self}}"
}
],
options: {
select2_options: {
width: 350,
value: ''
}
},
enumSource: []
},
"children": {
"type": "array",
"format": "tabs",
"required": ["headerName","entity","field"],
"title": "下级",
"items": {
"$ref": "#/definitions/columnDefs"
},
"default":{headerName:"列名称"}
}
}
}
}
};
let _eset: Array<any> = [];
try{
const res = await this.codeListService.getItems("CLModel",{},{"n_systemid_eq":"tyyw2plus"});
_eset.push(...res);
}catch(er){
}
if (_eset) {
let _items = [...[{text:"--",id:""}],..._eset];
let sourceobj={"source":_items,"title": "{{item.text}}", "value": "{{item.id}}"};
_schema.definitions.columnDefs.properties.entity.enumSource=[sourceobj];
}
let _fset = JSON.parse(JSON.stringify(this.$store.getters.getCodeList("CLMetric")));
if (_fset) {
let _items = [...[{text:"--",id:""}],..._fset.items];
let sourceobj={"source":_items,"filterText":"entity12","title": "{{item.text}}", "value": "{{item.id}}"};
_schema.definitions.columnDefs.properties.field.enumSource=[sourceobj];
}
return _schema;
}
public showfield(arg:any)
{
const data: any = {"srfkey":arg};
const view: any = {
viewname: 'dametric-edit-view',
height: 0,
width: 0,
title: '指标编辑视图',
};
this.$appmodal.openModal(view, {"dametrics":arg},{});
}
}
</script>
\ No newline at end of file
......@@ -16,6 +16,100 @@ import "bootstrap/dist/css/bootstrap.css";
import "bootstrap-vue/dist/bootstrap-vue.css";
import "../app-form-json/app-form-json.less";
JSONEditor.defaults.editors.link = JSONEditor.defaults.editors.string.extend({
getLink: function(data) {
var holder, link;
// Get mime type of the link
var mime = data.mediaType || 'application/javascript';
var type = mime.split('/')[0];
// Template to generate the link href
var href = this.jsoneditor.compileTemplate(data.href,this.template_engine);
var relTemplate = this.jsoneditor.compileTemplate(data.rel ? data.rel : data.href,this.template_engine);
// Template to generate the link's download attribute
var download = null;
if(data.download) download = data.download;
if(download && download !== true) {
download = this.jsoneditor.compileTemplate(download, this.template_engine);
}
// Image links
if(type === 'image') {
holder = this.theme.getBlockLinkHolder();
link = document.createElement('a');
link.setAttribute('target','_blank');
var image = document.createElement('img');
this.theme.createImageLink(holder,link,image);
// When a watched field changes, update the url
this.link_watchers.push(function(vars) {
var url = href(vars);
var rel = relTemplate(vars);
link.setAttribute('href',url);
link.setAttribute('title',rel || url);
image.setAttribute('src',url);
});
}
// Audio/Video links
else if(['audio','video'].indexOf(type) >=0) {
holder = this.theme.getBlockLinkHolder();
link = this.theme.getBlockLink();
link.setAttribute('target','_blank');
var media = document.createElement(type);
media.setAttribute('controls','controls');
this.theme.createMediaLink(holder,link,media);
// When a watched field changes, update the url
this.link_watchers.push(function(vars) {
var url = href(vars);
var rel = relTemplate(vars);
link.setAttribute('href',url);
link.textContent = rel || url;
media.setAttribute('src',url);
});
}
// Text links
else {
link = holder = this.theme.getBlockLink();
//holder.setAttribute('target','_blank');
holder.textContent = data.rel;
// When a watched field changes, update the url
this.link_watchers.push(function(vars) {
var url = href(vars);
var rel = relTemplate(vars);
holder.setAttribute('href',url);
holder.textContent = rel || url;
});
}
if(download && link) {
if(download === true) {
link.setAttribute('download','');
}
else {
this.link_watchers.push(function(vars) {
link.setAttribute('download',download(vars));
});
}
}
if(data.class) link.classList.add(data.class);
if(this.jsoneditor.options.no_link_holder){
holder.hidden = true;
}else{
holder.hidden = false;
}
return holder;
}
});
@Component({})
export default class AppFormJson extends Vue {
/**
......@@ -121,14 +215,14 @@ export default class AppFormJson extends Vue {
public editor: any;
public getSchema(): any{
public async getSchema(): any{
if(this.schema)
return this.schema;
else
return {};
}
public getOptions(): any{
public async getOptions(): any{
let _options={
theme: "bootstrap3",
iconlib: "fontawesome4",
......@@ -139,7 +233,7 @@ export default class AppFormJson extends Vue {
ajax: true,
};
_options["schema"]=this.getSchema();
_options["schema"]=await this.getSchema();
if (this.CurrentVal) {
_options["startval"] = JSON.parse(this.CurrentVal);
......@@ -156,7 +250,7 @@ export default class AppFormJson extends Vue {
*
* @memberof AppFormJson
*/
public renderJsoneditor() {
public async renderJsoneditor() {
var _this = this;
var element = document.getElementById("editor_holder_json");
if (this.editor) {
......@@ -164,6 +258,7 @@ export default class AppFormJson extends Vue {
}
let opt:any = await _this.getOptions();
this.editor = new JSONEditor(element, _this.getOptions());
this.editor.on("change", () => {
......
......@@ -40,6 +40,7 @@
</div>
</div>
<div class="header-right" style="display: flex;align-items: center;justify-content: space-between;">
<app-treeselect-refreshview/>
<app-header-menus />
<app-lang style='font-size: 15px;padding: 0 10px;'></app-lang>
<app-orgsector></app-orgsector>
......@@ -73,10 +74,12 @@ import { Subject,Subscription } from 'rxjs';
import { appConfig } from '@/config/appConfig';
import AppTreeselectRefreshview from "@components/app-treeselect-refreshview/app-treeselect-refreshview.vue";
@Component({
components: {
AppTreeselectRefreshview
},
})
export default class DstIndexBase extends Vue {
......
import AvueComponent from './components/avue-component/avue-component.vue'
import AppAvueCrud from './components/app-avue-crud/app-avue-crud.vue'
import AppFormJson from './components/app-form-json/app-form-json.vue'
import AppFormJsonDaChart from './components/app-form-json/app-form-json-da-chart.vue'
import AppTreeselectRefreshview from './components/app-treeselect-refreshview/app-treeselect-refreshview.vue'
export const UserComponent = {
install(v: any, opt: any) {
......@@ -8,5 +9,6 @@ export const UserComponent = {
v.component('app-avue-crud', AppAvueCrud);
v.component('app-treeselect-refreshview', AppTreeselectRefreshview);
v.component('app-form-json', AppFormJson);
v.component('app-form-json-da-chart', AppFormJsonDaChart);
}
};
\ No newline at end of file
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext" xmlns:pro="http://www.liquibase.org/xml/ns/pro" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd http://www.liquibase.org/xml/ns/pro http://www.liquibase.org/xml/ns/pro/liquibase-pro-3.8.xsd http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.8.xsd">
<changeSet author="mac (generated)" id="1606994235076-2">
<preConditions onFail="MARK_RAN" >
<not>
<columnExists tableName="IBZMODEL" columnName="SYSTEMID" />
</not>
</preConditions>
<addColumn tableName="IBZMODEL">
<column name="SYSTEMID" type="VARCHAR(100 BYTE)"/>
</addColumn>
<addColumn tableName="IBZMODEL">
<column name="MATERIALIZEDVIEW" type="VARCHAR(100 BYTE)"/>
</addColumn>
<addColumn tableName="IBZMODEL">
<column name="REFRESHTIME" type="TIMESTAMP"/>
</addColumn>
<addColumn tableName="IBZMODEL">
<column name="CREATEDATE" type="TIMESTAMP"/>
</addColumn>
<addColumn tableName="IBZMODEL">
<column name="UPDATEDATE" type="TIMESTAMP"/>
</addColumn>
<addColumn tableName="IBZENTITY">
<column name="CREATEDATE" type="TIMESTAMP"/>
</addColumn>
<addColumn tableName="IBZENTITY">
<column name="UPDATEDATE" type="TIMESTAMP"/>
</addColumn>
<addColumn tableName="IBZRELATION">
<column name="CREATEDATE" type="TIMESTAMP"/>
</addColumn>
<addColumn tableName="IBZRELATION">
<column name="UPDATEDATE" type="TIMESTAMP"/>
</addColumn>
<addColumn tableName="IBZFIELD">
<column name="CREATEDATE" type="TIMESTAMP"/>
</addColumn>
<addColumn tableName="IBZFIELD">
<column name="UPDATEDATE" type="TIMESTAMP"/>
</addColumn>
</changeSet>
</databaseChangeLog>
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext" xmlns:pro="http://www.liquibase.org/xml/ns/pro" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd http://www.liquibase.org/xml/ns/pro http://www.liquibase.org/xml/ns/pro/liquibase-pro-3.8.xsd http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.8.xsd">
<changeSet author="mac (generated)" id="1606994729330-1">
<addColumn tableName="IBZDACHART">
<column name="SYSTEMID" type="VARCHAR(100 BYTE)"/>
</addColumn>
</changeSet>
<changeSet author="mac (generated)" id="1606994729330-2">
<addColumn tableName="IBZDAREPORT">
<column name="SYSTEMID" type="VARCHAR(100 BYTE)"/>
</addColumn>
</changeSet>
<changeSet author="mac (generated)" id="1606994729330-3">
<addColumn tableName="IBZRULELOG">
<column name="SYSTEMID" type="VARCHAR(100 BYTE)"/>
</addColumn>
</changeSet>
<changeSet author="mac (generated)" id="1606994729330-4">
<addColumn tableName="IBZRULERESULT">
<column name="SYSTEMID" type="VARCHAR(100 BYTE)"/>
</addColumn>
</changeSet>
</databaseChangeLog>
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册