提交 f19018e1 编写于 作者: ibizdev's avatar ibizdev

zhouweidong@lab.ibiz5.com 发布系统代码

上级 6d1050ea
<template> <template>
<el-select size="small" class="filter-mode" placeholder="条件逻辑" clearable v-model="curVal" @change="onChange"> <el-select size="small" class="filter-mode" placeholder="条件逻辑" v-model="curVal" @change="onChange">
<el-option <el-option
v-for="mode in filterMode" v-for="mode in filterMode"
:key="mode.value" :key="mode.value"
:label="mode.en" :label="getLabel(mode)"
:value="mode.value" :value="mode.value"
> >
</el-option> </el-option>
...@@ -43,23 +43,36 @@ export default class FilterMode extends Vue { ...@@ -43,23 +43,36 @@ export default class FilterMode extends Vue {
public filterMode: any[] = [ public filterMode: any[] = [
// { name: 'AND', value: '$and' }, // { name: 'AND', value: '$and' },
// { name: 'OR', value: '$or' }, // { name: 'OR', value: '$or' },
{ zh: '等于(=)', en: 'EQ', value: '$eq' }, { 'zh-CN': '等于(=)', 'en-US': 'EQ', value: '$eq' },
{ zh: '', en: 'NE', value: '$ne' }, { 'zh-CN': '不等于(<>)', 'en-US': 'NE', value: '$ne' },
{ zh: '', en: 'GT', value: '$gt' }, { 'zh-CN': '大于(>)', 'en-US': 'GT', value: '$gt' },
{ zh: '', en: 'GE', value: '$gte' }, { 'zh-CN': '大于等于(>=)', 'en-US': 'GE', value: '$gte' },
{ zh: '', en: 'LT', value: '$lt' }, { 'zh-CN': '小于(<)', 'en-US': 'LT', value: '$lt' },
{ zh: '', en: 'LE', value: '$lte' }, { 'zh-CN': '小于(<=)', 'en-US': 'LE', value: '$lte' },
{ zh: '', en: 'IS_NULL', value: '$null' }, { 'zh-CN': '值为空(Nil)', 'en-US': 'IS_NULL', value: '$null' },
{ zh: '', en: 'IS_NOT_NULL', value: '$notNull' }, { 'zh-CN': '值不为空(NotNil)', 'en-US': 'IS_NOT_NULL', value: '$notNull' },
{ zh: '', en: 'IN', value: '$in' }, { 'zh-CN': '值在范围中(In)', 'en-US': 'IN', value: '$in' },
{ zh: '', en: 'NOTIN', value: '$notIn' }, { 'zh-CN': '值不在范围中(NotIn)', 'en-US': 'NOTIN', value: '$notIn' },
{ zh: '', en: 'LIKE', value: '$like' }, { 'zh-CN': '文本包含(%)', 'en-US': 'LIKE', value: '$like' },
{ zh: '', en: 'LIFTLIKE', value: '$startsWith' }, { 'zh-CN': '文本左包含(%#)', 'en-US': 'LIFTLIKE', value: '$startsWith' },
{ zh: '', en: 'RIGHTLIKE', value: '$endsWith' }, { 'zh-CN': '文本右包含(#%)', 'en-US': 'RIGHTLIKE', value: '$endsWith' },
{ zh: '', en: 'EXISTS', value: '$exists' }, // { 'zh-CN': '', en: 'EXISTS', value: '$exists' },
{ zh: '', en: 'NOTEXISTS', value: '$notExists' } // { 'zh-CN': '', en: 'NOTEXISTS', value: '$notExists' }
]; ];
/**
* 获取语言文本
*
* @return {string}
* @memberof FilterMode
*/
getLabel(mode: any): string {
if(this.$i18n.locale) {
return mode[this.$i18n.locale];
}
return mode['zh-CN'];
}
/** /**
* 值改变 * 值改变
* *
......
.filter-item {
display: flex;
// margin-top: 10px;
.fa-trash-o {
color: red;
}
.filter-item-group {
width: 100px;
margin-left: 5px;
}
.filter-item-field {
width: 200px;
margin-left: 5px;
}
.filter-item-mode {
width: 200px;
margin-left: 5px;
}
.filter-item-value {
margin-left: 5px;
flex-grow: 1;
}
}
.filter-tree { .filter-tree {
.el-tree-node__content { .el-tree-node__content {
height: 40px; height: 40px;
......
<template> <template>
<el-tree class="filter-tree" :data="treeItems" :props="defaultProps" :expand-on-click-node="false" default-expand-all> <el-tree class="filter-tree" :data="treeItems" :expand-on-click-node="false" default-expand-all>
<template slot-scope="{ node, data }"> <template slot-scope="{ node, data }">
<template v-if="Object.is(data.name, '$and') || Object.is(data.name, '$or')"> <template v-if="Object.is(data.label, '$and') || Object.is(data.label, '$or')">
<div class="filter-tree-item"> <div class="filter-tree-item">
<el-select size="small" v-model="data.name"> <el-select size="small" v-model="data.label" :disabled="data.isroot">
<el-option v-for="mode in relationModes" :key="mode.value" :label="mode.zh" :value="mode.value"></el-option> <el-option v-for="mode in relationModes" :key="mode.value" :label="getLabel(mode)" :value="mode.value"></el-option>
</el-select> </el-select>
<div class="filter-tree-action"> <div class="filter-tree-action">
<i-button title="添加条件" @click="onAddItem(data)"><i class="fa fa-plus" aria-hidden="true"></i> 添加条件</i-button> <i-button title="添加条件" @click="onAddItem(data)"><i class="fa fa-plus" aria-hidden="true"></i> 添加条件</i-button>
<i-button title="添加组" @click="onAddGroup(data)"><i class="fa fa-plus" aria-hidden="true"></i> 添加组</i-button> <i-button title="添加组" @click="onAddGroup(data)"><i class="fa fa-plus" aria-hidden="true"></i> 添加组</i-button>
<i-button v-if="!data.isroot" @click="onRemoveItem(node, data)" title="删除"><i class="fa fa-trash-o" aria-hidden="true"></i></i-button>
</div> </div>
</div> </div>
</template> </template>
...@@ -47,24 +48,44 @@ import FilterMode from './filter-mode.vue'; ...@@ -47,24 +48,44 @@ import FilterMode from './filter-mode.vue';
}) })
export default class FilterTree extends Vue { export default class FilterTree extends Vue {
/**
* 数据集
*
* @type {*}
* @memberof FilterTree
*/
@Prop() datas: any; @Prop() datas: any;
/**
* 过滤项集合
*
* @type {*}
* @memberof FilterTree
*/
@Prop() fields: any; @Prop() fields: any;
protected defaultProps: any = { /**
children: 'items', * 组条件集合
label: 'name' *
}; * @type {*}
* @memberof FilterTree
*/
protected relationModes: any[] = [ protected relationModes: any[] = [
{ zh: '并且', en: 'AND', value: '$and' }, { 'zh-CN': '并且', 'en-US': 'AND', value: '$and' },
{ zh: '或', en: 'OR', value: '$or' } { 'zh-CN': '或', 'en-US': 'OR', value: '$or' }
]; ];
/**
* 树数据集合
*
* @type {*}
* @memberof FilterTree
*/
get treeItems() { get treeItems() {
let root: any = { let root: any = {
name: '$and', label: '$and',
items: this.datas isroot: true,
children: this.datas
}; };
if(this.datas.length == 0) { if(this.datas.length == 0) {
this.onAddItem(root); this.onAddItem(root);
...@@ -73,35 +94,72 @@ export default class FilterTree extends Vue { ...@@ -73,35 +94,72 @@ export default class FilterTree extends Vue {
return [root]; return [root];
} }
/**
* 获取语言文本
*
* @return {string}
* @memberof FilterTree
*/
getLabel(mode: any): string {
if(this.$i18n.locale) {
return mode[this.$i18n.locale];
}
return mode['zh-CN'];
}
/**
* 属性变化
*
* @return {*}
* @memberof FilterTree
*/
public onFieldChange(data: any) { public onFieldChange(data: any) {
if(!data.mode) { if(!data.mode) {
data.mode = '$eq'; data.mode = '$eq';
} }
} }
/**
* 添加条件
*
* @return {*}
* @memberof FilterTree
*/
public onAddItem(data: any) { public onAddItem(data: any) {
if(data && data.items) { if(data && data.children) {
data.items.push({ data.children.push({
field: null, field: null,
mode: null mode: null
}); });
} }
} }
/**
* 添加组
*
* @return {*}
* @memberof FilterTree
*/
public onAddGroup(data: any) { public onAddGroup(data: any) {
if(data && data.items) { if(data && data.children) {
data.items.push({ data.children.push({
name: '$and', label: '$and',
items: [] children: []
}) })
} }
} }
/**
* 删除条件/组
*
* @return {*}
* @memberof FilterTree
*/
public onRemoveItem(node: any, data: any) { public onRemoveItem(node: any, data: any) {
if(node && node.parent) { if(node && node.parent) {
let pData: any = node.parent.data; let pData: any = node.parent.data;
if(pData.items.indexOf(data) >= 0) { if(pData.children.indexOf(data) >= 0) {
pData.items.splice(pData.items.indexOf(data), 1) pData.children.splice(pData.children.indexOf(data), 1)
} }
} }
} }
......
<?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: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/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.6.xsd"> Tip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing</#if>. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)??
----
----
<!--输出实体[SYS_AUTHLOG]数据结构 --> FTL stack trace ("~" means nesting-related):
<changeSet author="a_A_5d9d78509" id="tab-sys_authlog-38-1"> - Failed at: ${dbinst.getUserName()} [in template "CODETEMPL_zh_CN" at line 28, column 24]
<createTable tableName="IBZAUTHLOG"> ----
<column name="LOGID" remarks="" type="VARCHAR(100)"> \ No newline at end of file
<constraints primaryKey="true" primaryKeyName="PK_SYS_AUTHLOG_LOGID"/>
</column>
<column name="USERNAME" remarks="" type="VARCHAR(100)">
</column>
<column name="PERSONNAME" remarks="" type="VARCHAR(100)">
</column>
<column name="DOMAIN" remarks="" type="VARCHAR(100)">
</column>
<column name="AUTHTIME" remarks="" type="DATETIME">
</column>
<column name="IPADDR" remarks="" type="VARCHAR(100)">
</column>
<column name="MACADDR" remarks="" type="VARCHAR(100)">
</column>
<column name="USERAGENT" remarks="" type="VARCHAR(100)">
</column>
<column name="AUTHCODE" remarks="" type="VARCHAR(15)">
</column>
</createTable>
</changeSet>
<!--输出实体[SYS_ROLE_PERMISSION]数据结构 -->
<changeSet author="a_A_5d9d78509" id="tab-sys_role_permission-93-2">
<createTable tableName="IBZROLE_PERMISSION">
<column name="SYS_ROLE_PERMISSIONID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_SYS_ROLE_PERMISSION_SYS_ROL"/>
</column>
<column name="SYS_ROLEID" remarks="" type="VARCHAR(100)">
</column>
<column name="SYS_PERMISSIONID" remarks="" type="VARCHAR(200)">
</column>
<column name="CREATEDATE" remarks="" type="DATETIME">
</column>
<column name="UPDATEDATE" remarks="" type="DATETIME">
</column>
</createTable>
</changeSet>
<!--输出实体[SYS_USER_ROLE]数据结构 -->
<changeSet author="a_A_5d9d78509" id="tab-sys_user_role-62-3">
<createTable tableName="IBZUSER_ROLE">
<column name="SYS_USER_ROLEID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_SYS_USER_ROLE_SYS_USER_ROLE"/>
</column>
<column name="SYS_ROLEID" remarks="" type="VARCHAR(100)">
</column>
<column name="SYS_USERID" remarks="" type="VARCHAR(100)">
</column>
<column name="CREATEDATE" remarks="" type="DATETIME">
</column>
<column name="UPDATEDATE" remarks="" type="DATETIME">
</column>
</createTable>
</changeSet>
<!--输出实体[SYS_ROLE]数据结构 -->
<changeSet author="a_A_5d9d78509" id="tab-sys_role-89-4">
<createTable tableName="IBZROLE">
<column name="SYS_ROLEID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_SYS_ROLE_SYS_ROLEID"/>
</column>
<column name="SYS_ROLENAME" remarks="" type="VARCHAR(200)">
</column>
<column name="MEMO" remarks="" type="VARCHAR(100)">
</column>
<column name="CREATEDATE" remarks="" type="DATETIME">
</column>
<column name="UPDATEDATE" remarks="" type="DATETIME">
</column>
</createTable>
</changeSet>
<!--输出实体[SYS_PSSYSTEM]数据结构 -->
<changeSet author="a_A_5d9d78509" id="tab-sys_pssystem-39-5">
<createTable tableName="IBZPSSYSTEM">
<column name="PSSYSTEMID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_SYS_PSSYSTEM_PSSYSTEMID"/>
</column>
<column name="PSSYSTEMNAME" remarks="" type="VARCHAR(100)">
</column>
<column name="SYSSTRUCTURE" remarks="" type="TEXT(1048576)">
</column>
<column name="APPS" remarks="" type="TEXT(1048576)">
</column>
<column name="MD5CHECK" remarks="" type="VARCHAR(100)">
</column>
<column name="SHOWORDER" remarks="" type="INT">
</column>
</createTable>
</changeSet>
<!--输出实体[SYS_PERMISSION]数据结构 -->
<changeSet author="a_A_5d9d78509" id="tab-sys_permission-219-6">
<createTable tableName="IBZPERMISSION">
<column name="SYS_PERMISSIONID" remarks="" type="VARCHAR(200)">
<constraints primaryKey="true" primaryKeyName="PK_SYS_PERMISSION_SYS_PERMISSI"/>
</column>
<column name="SYS_PERMISSIONNAME" remarks="" type="VARCHAR(200)">
</column>
<column name="PERMISSIONTYPE" remarks="" type="VARCHAR(60)">
</column>
<column name="PSSYSTEMID" remarks="" type="VARCHAR(100)">
</column>
<column name="ENABLE" remarks="" type="INT">
</column>
<column name="CREATEDATE" remarks="" type="DATETIME">
</column>
<column name="UPDATEDATE" remarks="" type="DATETIME">
</column>
</createTable>
</changeSet>
<!--输出实体[SYS_AUTHLOG]外键关系 -->
<!--输出实体[SYS_ROLE_PERMISSION]外键关系 -->
<changeSet author="a_A_5d9d78509" id="fk-sys_role_permission-93-7">
<addForeignKeyConstraint baseColumnNames="SYS_PERMISSIONID" baseTableName="IBZROLE_PERMISSION" constraintName="DER1N_SYS_ROLE_PERMISSION_SYS_" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="SYS_PERMISSIONID" referencedTableName="IBZPERMISSION" validate="true"/>
</changeSet>
<!--输出实体[SYS_USER_ROLE]外键关系 -->
<changeSet author="a_A_5d9d78509" id="fk-sys_user_role-62-9">
<addForeignKeyConstraint baseColumnNames="SYS_ROLEID" baseTableName="IBZUSER_ROLE" constraintName="DER1N_SYS_USER_ROLE_SYS_ROLE_S" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="SYS_ROLEID" referencedTableName="IBZROLE" validate="true"/>
</changeSet>
<!--输出实体[SYS_ROLE]外键关系 -->
<!--输出实体[SYS_PSSYSTEM]外键关系 -->
<!--输出实体[SYS_PERMISSION]外键关系 -->
</databaseChangeLog>
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册