升级:1、增加界面夜间模式
2、qtask 功能交互升级
3、mysql连接管理增加心跳保活
4、其他修改
This commit is contained in:
@@ -1,24 +1,16 @@
|
||||
|
||||
#FileHandler/ConsoleHandler
|
||||
handlers = java.util.logging.ConsoleHandler
|
||||
|
||||
handlers=java.util.logging.ConsoleHandler
|
||||
############################################################
|
||||
.level = FINER
|
||||
|
||||
java.level = INFO
|
||||
javax.level = INFO
|
||||
com.sun.level = INFO
|
||||
sun.level = INFO
|
||||
jdk.level = INFO
|
||||
|
||||
|
||||
java.util.logging.FileHandler.level = FINER
|
||||
.level=FINEST
|
||||
java.level=INFO
|
||||
javax.level=INFO
|
||||
com.sun.level=INFO
|
||||
sun.level=INFO
|
||||
jdk.level=INFO
|
||||
java.util.logging.FileHandler.level=FINEST
|
||||
#10M
|
||||
java.util.logging.FileHandler.limit = 10485760
|
||||
java.util.logging.FileHandler.count = 10000
|
||||
java.util.logging.FileHandler.encoding = UTF-8
|
||||
java.util.logging.FileHandler.pattern = ${APP_HOME}/logs-%m/log-%d.log
|
||||
java.util.logging.FileHandler.unusual = ${APP_HOME}/logs-%m/log-warnerr-%u.log
|
||||
java.util.logging.FileHandler.append = true
|
||||
|
||||
java.util.logging.ConsoleHandler.level = FINER
|
||||
java.util.logging.FileHandler.limit=10485760
|
||||
java.util.logging.FileHandler.count=10000
|
||||
java.util.logging.FileHandler.encoding=UTF-8
|
||||
java.util.logging.FileHandler.pattern=${APP_HOME}/logs-%m/log-%d.log
|
||||
java.util.logging.FileHandler.append=true
|
||||
java.util.logging.ConsoleHandler.level=FINEST
|
||||
|
||||
3
pom.xml
3
pom.xml
@@ -11,6 +11,9 @@
|
||||
<!--<modules>
|
||||
<!–<module>qtask</module>–>
|
||||
</modules>-->
|
||||
<properties>
|
||||
<maven.test.skip>true</maven.test.skip>
|
||||
</properties>
|
||||
|
||||
<repositories>
|
||||
<repository>
|
||||
|
||||
@@ -1,9 +1,16 @@
|
||||
const qtask = {
|
||||
qtaskList() {
|
||||
return red.postX('_qtask/list', {})
|
||||
qtaskList({flipper={}}) {
|
||||
return red.get2('_qtask/list', {flipper})
|
||||
},
|
||||
qtaskSave({task}) {
|
||||
return red.postX('_qtask/save', {task: JSON.stringify(task)})
|
||||
qtaskSave(task) {
|
||||
if (task.qtaskid) {
|
||||
return red.post2('_qtask/update', task)
|
||||
} else {
|
||||
return red.post2('_qtask/create', task)
|
||||
}
|
||||
},
|
||||
qtaskDelete(qtaskid) {
|
||||
return red.post2("_qtask/delete", {qtaskid})
|
||||
},
|
||||
qtaskDebug({task}) {
|
||||
return red.postX('_qtask/debug', {task: JSON.stringify(task)})
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
</div>
|
||||
|
||||
<div class="col-md-12" style="padding-top: 10px;overflow:auto;">
|
||||
<table class="table table-bordered table-hover" style="width: 100%">
|
||||
<table class="table table-bordered table-hover">
|
||||
<!--<thead>
|
||||
<tr>
|
||||
<th v-for="field in cfg.cols" v-text="field.label"></th>
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12" style="padding-top: 10px;overflow:auto;">
|
||||
<table class="table table-bordered table-hover" style="width: 100%">
|
||||
<table class="table table-bordered table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th v-for="field in cfg.cols" v-text="field.label"></th>
|
||||
|
||||
@@ -5,8 +5,10 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>MetaKit</title>
|
||||
<link rel="stylesheet" href="/res/zui/css/zui.min.css">
|
||||
<link rel="stylesheet" href="/res/css/zui-theme.css">
|
||||
<!--<link rel="stylesheet" href="/res/css/zui-theme.css">-->
|
||||
<link rel="stylesheet" href="/res/css/zui-theme-x.css">
|
||||
<link rel="stylesheet" href="/res/css/red-kit.css">
|
||||
<link rel="stylesheet" href="/res/ztree/zTreeStyle.css">
|
||||
</head>
|
||||
<body id="home">
|
||||
<div class="container-fluid">
|
||||
@@ -22,40 +24,58 @@
|
||||
</li>
|
||||
|
||||
<li class="pull-right" title="刷新服务端缓存数据">
|
||||
<a @click="refresh()" href="javascript:;" style="padding: 6px 15px;border: 0;background-color: #404a53;color: #fff;">
|
||||
<a @click="refresh()" href="javascript:;" class="btn btn-default" style="padding: 6px 15px;border: 0;background-color: #404a53!important;color: #fff;">
|
||||
<i class="icon icon-repeat"></i>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li class="pull-right">
|
||||
<a @click="logout()" href="javascript:;" style="padding: 6px 15px;border: 0;background-color: #404a53;color: #fff;">
|
||||
<a @click="logout()" href="javascript:;" class="btn btn-default" style="padding: 6px 15px;border: 0;background-color: #404a53!important;color: #fff;">
|
||||
<i class="icon icon-user"></i> 退出
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li class="pull-right">
|
||||
<select v-model="sysPlat" class="form-control" style="border: 0;background-color: #404a53;color: #fff;">
|
||||
<select v-model="sysPlat" class="form-control plat-switch">
|
||||
<option v-for="item in sysPlats" :value="item" v-text="item.name"></option>
|
||||
</select>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div id="mainDiv">
|
||||
<div class="col-md-1 col-xs-1" id="left">
|
||||
<div id="mainDiv" :class="{leftMini:leftMini}">
|
||||
<div :class="['col-md-1 col-xs-1']" id="left">
|
||||
<nav class="menu" data-ride="menu">
|
||||
<ul class="nav nav-primary">
|
||||
<li class="active show nav-parent" style="width: 100%;">
|
||||
<!--<a href="javascript:;"><i class="icon icon-tasks"></i> <span v-text="pageId"></span></a>-->
|
||||
<ul class="nav">
|
||||
<ul class="nav" v-if="!leftMini">
|
||||
<!-- item in menus -->
|
||||
<li v-for="item in menus" @click="loadPage(item)" :class="{active:page.url==item.url}">
|
||||
<a href="javascript:;"><i :class="['icon', item.icon ? item.icon : 'icon-circle-blank']"></i> <span v-text="item.name"></span></a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
<ul class="nav" v-if="leftMini">
|
||||
<!-- item in menus -->
|
||||
<li v-for="item in menus" @click="loadPage(item)" :class="{active:page.url==item.url}"
|
||||
data-toggle="tooltip"
|
||||
:title="item.name">
|
||||
<a href="javascript:;"><i
|
||||
:class="['icon', item.icon ? item.icon : 'icon-circle-blank']"></i>
|
||||
<!--<span v-text="item.name"></span>-->
|
||||
</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<!--<div class="user">
|
||||
<a style="cursor: pointer">绝尘</a>
|
||||
</div>-->
|
||||
<div class="footer" @click="leftMiniSwitch()">
|
||||
<i :class="['icon', leftMini? 'icon-caret-right':'icon-caret-left']"></i>
|
||||
</div>
|
||||
</nav>
|
||||
</div>
|
||||
<div class="col-md-11 col-xs-11">
|
||||
@@ -85,6 +105,7 @@
|
||||
<script src="/api/tmp.js"></script>
|
||||
<script src="/res/zui/lib/sortable/zui.sortable.js"></script>
|
||||
<script src="/res/zui/lib/uploader/zui.uploader.min.js"></script>
|
||||
<script src="/res/ztree/jquery.ztree.all.min.js"></script>
|
||||
<script type="module">
|
||||
import { logout } from './api/user.js'
|
||||
let { refresh } = meta
|
||||
@@ -156,7 +177,8 @@
|
||||
],
|
||||
menus: {},
|
||||
page: {},
|
||||
pageId: ''
|
||||
pageId: '',
|
||||
leftMini: red.getData('leftMini') === 'Min',
|
||||
},
|
||||
watch: {
|
||||
page: function () {
|
||||
@@ -168,6 +190,12 @@
|
||||
sysPlat: function (v) {
|
||||
red.setData("sysPlat", v);
|
||||
this.loadPage();
|
||||
},
|
||||
leftMini: function () {
|
||||
this.tooltipShow()
|
||||
},
|
||||
menus: function () {
|
||||
this.tooltipShow()
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@@ -217,8 +245,23 @@
|
||||
data[k] = vs
|
||||
}
|
||||
red.setData("dictKv", data)
|
||||
red.getData()
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
leftMiniSwitch() {
|
||||
this.leftMini = !this.leftMini;
|
||||
red.setData("leftMini", this.leftMini ? 'Min' : 'Max');
|
||||
},
|
||||
tooltipShow() {
|
||||
$('[data-toggle="tooltip"]').tooltip('destroy');
|
||||
if (!this.leftMini) {
|
||||
return
|
||||
}
|
||||
setTimeout(function () {
|
||||
$('[data-toggle="tooltip"]').tooltip({placement: 'right'});
|
||||
}, 5)
|
||||
},
|
||||
},
|
||||
mounted: function () {
|
||||
this.loadDictData()
|
||||
|
||||
@@ -1,6 +1,28 @@
|
||||
|
||||
|
||||
<row class="data-list">
|
||||
<div class="col-md-12">
|
||||
<h3 class="pull-left">业务预览</h3>
|
||||
<div class="col-xs-4 pull-right">
|
||||
<div class="input-group">
|
||||
<span class="input-group-btn">
|
||||
<button class="btn btn-default" type="button">添加过滤条件</button>
|
||||
</span>
|
||||
<select class="form-control" v-model="addFilter" style="width: 130px;">
|
||||
<option v-for="f in cfg.filters" :value="f.name" v-show="!f.checked">{{f.label}}</option>
|
||||
</select>
|
||||
|
||||
<span class="input-group-btn">
|
||||
<button @click="findList()" class="btn btn-primary" type="button"> 查询</button>
|
||||
</span>
|
||||
<span class="input-group-btn" style="padding-left: 10px">
|
||||
<button @click="exportExcel" class="btn" type="button"> 导出</button>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="clearfix"></div>
|
||||
|
||||
<div class="info">
|
||||
<a @click="showInfo()" href="javascript:;"><i class="icon icon-info"></i></a>
|
||||
</div>
|
||||
@@ -24,9 +46,9 @@
|
||||
|
||||
<!-- 业务列表 -->
|
||||
<div class="col-xs-2">
|
||||
<div style="padding-left: 10px;background-color: #ccc;width: 100%"> 业务列表(Meta-Service)</div>
|
||||
<div style="padding-left: 10px;/*background-color: #ccc;*/width: 100%"> 业务列表(Meta-Service)</div>
|
||||
<ul class="nav nav-tabs nav-stacked dlist" style="height: 100%">
|
||||
<li :class="['clearfix',{'active':service==item.alias}]" v-for="item in services" >
|
||||
<li :class="[{'active':service==item.alias}]" v-for="item in services" >
|
||||
<a @click="service=item.name" :title="`${item.name}`" v-text="`${item.comment}`" href="javascript:;"></a>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -34,24 +56,7 @@
|
||||
|
||||
<!-- 预览功能 -->
|
||||
<div class="col-xs-10">
|
||||
<div class="col-xs-4 pull-right">
|
||||
<div class="input-group">
|
||||
<span class="input-group-btn">
|
||||
<button class="btn btn-default" type="button">添加过滤条件</button>
|
||||
</span>
|
||||
<select class="form-control" v-model="addFilter" style="width: 130px;">
|
||||
<option v-for="f in cfg.filters" :value="f.name" v-show="!f.checked">{{f.label}}</option>
|
||||
</select>
|
||||
|
||||
<span class="input-group-btn">
|
||||
<button @click="findList()" class="btn btn-primary" type="button"> 查询</button>
|
||||
</span>
|
||||
<span class="input-group-btn" style="padding-left: 10px">
|
||||
<button @click="exportExcel" class="btn" type="button"> 导出</button>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="clearfix"></div>
|
||||
|
||||
<!-- 过滤条件 -->
|
||||
<div class="col-lg-4 col-xs-6" v-for="(filter,index) in cfg.filters" v-if="filter.checked">
|
||||
@@ -76,7 +81,7 @@
|
||||
|
||||
<!-- 数据表格 -->
|
||||
<div class="col-xs-12" style="padding-top: 10px;overflow:auto;">
|
||||
<table class="table table-bordered table-hover" style="width: 100%">
|
||||
<table class="table table-bordered table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<!-- 'sort':field.order>0 -->
|
||||
@@ -110,6 +115,7 @@
|
||||
<img src="../res/img/none.png">
|
||||
<p>暂无数据</p>
|
||||
</div>
|
||||
<!-- 分页 -->
|
||||
<div>
|
||||
<ul class="pager pull-right" style="margin: 5px 10px">
|
||||
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
<row class="meta-link">
|
||||
<div class="col-md-12">
|
||||
<h3 v-text="cfg.title"></h3>
|
||||
</div>
|
||||
|
||||
<div class="info">
|
||||
<a @click="showInfo()" href="javascript:;"><i class="icon icon-info"></i></a>
|
||||
</div>
|
||||
@@ -24,8 +28,8 @@
|
||||
</div>
|
||||
|
||||
<div class="col-xs-4 sheet-cell">
|
||||
<div style="padding-left: 10px;background-color: #ccc;width: 100%;height: 32px;">
|
||||
实体表(Meta-Table) <input v-model="filter" placeholder="筛选实体" style="margin-top: 5px;">
|
||||
<div class="base-info">
|
||||
实体表(Meta-Table) <input v-model="filter" placeholder="关键字筛选表" class="base-input">
|
||||
</div>
|
||||
<ul class="nav nav-tabs nav-stacked tlist" style="height: 100%">
|
||||
<li :class="[{'active': aliasA == item.alias}]" v-for="item in tables" v-if="dealFilter(item)">
|
||||
@@ -35,7 +39,7 @@
|
||||
<!--<p v-show="ckTable && ckTable.length">已选择 <code v-text="ckTable.length||0"></code> 个实体待导入</p>-->
|
||||
</div>
|
||||
<div class="col-xs-8">
|
||||
<div style="padding-left: 10px;background-color: #ccc;width: 100%;height: 32px;"> 已关联的表 </div>
|
||||
<div class="base-info"> 已关联的表 </div>
|
||||
<!-- 关联表列表 -->
|
||||
<button v-for="link in linkInfos" @click="aliasB=link.alias" :class="['btn', {'btn-primary' :aliasB==link.alias}]" style="margin: 5px">
|
||||
<i class="icon icon-table"></i>
|
||||
@@ -43,9 +47,9 @@
|
||||
</button>
|
||||
|
||||
<div class="pull-right" style="margin: 5px;">
|
||||
<button @click="status=1" v-show="status==0 && aliasB" class="btn">修改关联关系</button>
|
||||
<button @click="status=0" v-show="status==1" class="btn">取消修改</button>
|
||||
<button @click="addLinkDia()" class="btn">+ 添加关联表</button>
|
||||
<button @click="status=1" v-show="status==0 && aliasB" class="btn btn-default">修改关联关系</button>
|
||||
<button @click="status=0" v-show="status==1" class="btn btn-default">取消修改</button>
|
||||
<button @click="addLinkDia()" class="btn btn-default">+ 添加关联表</button>
|
||||
<button @click="saveLink()" v-show="status==1" class="btn btn-primary" style="margin-left: 15px">保存</button>
|
||||
</div>
|
||||
<!--<div class="clearfix"></div>-->
|
||||
@@ -128,6 +132,7 @@
|
||||
let vm = new Vue({
|
||||
el: ".meta-link",
|
||||
data: {
|
||||
cfg:{title:"实体关系"},
|
||||
status: 0,
|
||||
tables: [], //所有的表数据{name,comment, alias, linkCount}
|
||||
aliasA: '', //选中的主体表别名
|
||||
|
||||
@@ -22,53 +22,88 @@
|
||||
}*/
|
||||
</style>
|
||||
<row class="meta-service">
|
||||
<div class="col-xs-12">
|
||||
<div class="info" style="padding-left: 10px">
|
||||
<a @click="showInfo()" href="javascript:;"><i class="icon icon-info"></i></a>
|
||||
</div>
|
||||
<!-- info -->
|
||||
<div class="modal fade" id="f-info">
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">关闭</span></button>
|
||||
<h4 class="modal-title">功能介绍</h4>
|
||||
<div class="col-md-12">
|
||||
<h3>业务管理</h3>
|
||||
</div>
|
||||
|
||||
<div class="info" style="padding-left: 10px">
|
||||
<a @click="showInfo()" href="javascript:;"><i class="icon icon-info"></i></a>
|
||||
</div>
|
||||
<!-- info -->
|
||||
<div class="modal fade" id="f-info">
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">关闭</span></button>
|
||||
<h4 class="modal-title">功能介绍</h4>
|
||||
</div>
|
||||
<div class="modal-body" style="text-align: left">
|
||||
<div style="text-align: left">
|
||||
<p>
|
||||
<b>如何创建一个业务?</b><br><!-- <span style="color: #f1a325;font-size: 25px">so easy</span> -->
|
||||
1、选择业务主表、填写名称、标识码<br>
|
||||
2、保存<br>
|
||||
3、业务维护(常规业务维护:列表,查询配置,导出配置,修改基本信息, 以及未开发的:详情配置,表单配置)<br>
|
||||
</p>
|
||||
<p>
|
||||
<b>选择主表的意义,关联表信息业务中如何控制?</b><br>
|
||||
业务主表选择某个表,也即当前业务主要围绕这个实体表进行;<br>
|
||||
对于关联表,只需要在MetaLink中建立关联即可,此处选择了业务主表后会自动查询所有已经关联关联的业务表,<br>
|
||||
然后便可以轻松配置 列表要展示,导出哪些字段,查询过滤条件用哪些表的哪些字段,等等。。
|
||||
</p>
|
||||
<b>MetaService概念模型</b>
|
||||
<img src="../res/img/MetaService.png">
|
||||
|
||||
|
||||
</div>
|
||||
<div class="modal-body" style="text-align: left">
|
||||
<div style="text-align: left">
|
||||
<p>
|
||||
<b>如何创建一个业务?</b><br><!-- <span style="color: #f1a325;font-size: 25px">so easy</span> -->
|
||||
1、选择业务主表、填写名称、标识码<br>
|
||||
2、保存<br>
|
||||
3、业务维护(常规业务维护:列表,查询配置,导出配置,修改基本信息, 以及未开发的:详情配置,表单配置)<br>
|
||||
</p>
|
||||
<p>
|
||||
<b>选择主表的意义,关联表信息业务中如何控制?</b><br>
|
||||
业务主表选择某个表,也即当前业务主要围绕这个实体表进行;<br>
|
||||
对于关联表,只需要在MetaLink中建立关联即可,此处选择了业务主表后会自动查询所有已经关联关联的业务表,<br>
|
||||
然后便可以轻松配置 列表要展示,导出哪些字段,查询过滤条件用哪些表的哪些字段,等等。。
|
||||
</p>
|
||||
<b>MetaService概念模型</b>
|
||||
<img src="../res/img/MetaService.png">
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<!--<p>数据存贮结构如下:</p>
|
||||
<img src="../res/img/meta_service.png">-->
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
||||
</div>
|
||||
<!--<p>数据存贮结构如下:</p>
|
||||
<img src="../res/img/meta_service.png">-->
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="input-group list-head">
|
||||
<div class="col-xs-3">
|
||||
<button @click="createService()" class="btn btn-primary" type="button"> 新建业务</button>
|
||||
<hr>
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th>业务KEY</th>
|
||||
<th>业务名称</th>
|
||||
<th>操作</th>
|
||||
</tr>
|
||||
<tr v-for="item in services" @click="service=item.name;serviceLabel=item.comment;">
|
||||
<td>{{item.name}}</td>
|
||||
<td>{{item.comment}}</td>
|
||||
<td>
|
||||
<a href="javascript:">编辑</a>
|
||||
<a href="javascript:">删除</a>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<span class="input-group-btn">
|
||||
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<!-- 实体字段信息 -->
|
||||
<!--<div class="col-xs-4" style="padding-left: 0px;">
|
||||
|
||||
</div>-->
|
||||
|
||||
<div class="col-xs-9" style="padding-left: 0px;padding-right: 0px;">
|
||||
<div class="input-group list-head pull-right">
|
||||
|
||||
<div class="pull-left"></div>
|
||||
|
||||
<!--<span class="input-group-btn">
|
||||
<button class="btn btn-default" type="button">选择业务类型</button>
|
||||
</span>
|
||||
|
||||
@@ -77,7 +112,7 @@
|
||||
<ul class="dropdown-menu">
|
||||
<li v-for="item in services" @click="service=item.name;serviceLabel=item.comment;"><a href="javascript:;" v-text="`${item.comment}`"></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>-->
|
||||
|
||||
<!--
|
||||
<option v-for="item in services" :value="item.name"> {{item.name}} [{{item.comment}}]</option>
|
||||
@@ -86,9 +121,9 @@
|
||||
</select>
|
||||
-->
|
||||
|
||||
<span class="input-group-btn pull-left" style="padding-left: 5px">
|
||||
<button @click="createService()" :class="['btn']" type="button"> 新建业务</button>
|
||||
</span>
|
||||
<!--<span class="input-group-btn pull-left" style="padding-left: 5px">
|
||||
<button @click="createService()" class="btn btn-primary" type="button"> 新建业务</button>
|
||||
</span>-->
|
||||
|
||||
|
||||
<span class="input-group-btn" style="padding-left: 20px">
|
||||
@@ -121,60 +156,55 @@
|
||||
<button @click="save()" :class="['btn',{'btn-primary':status!=0},{'disabled':status==0}]" type="button"> 保存</button>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="clearfix"></div>
|
||||
<hr>
|
||||
<div class="col-xs-4">
|
||||
<div class="base-info"> 业务相关表</div>
|
||||
<!--<ul class="nav nav-tabs nav-stacked tlist">
|
||||
<li @click="sheet=item" :class="[{active: sheet==item }]" v-for="item in sheetArr">
|
||||
<a href="javascript:;" data-target="#tab3Content1" data-toggle="tab" v-text="serviceDetail['tables'][item]['name']"></a>
|
||||
</li>
|
||||
</ul>-->
|
||||
|
||||
<div class="col-xs-6">
|
||||
<div style="padding-left: 10px;background-color: #ccc;width: 100%"> 业务相关表</div>
|
||||
<!--<ul class="nav nav-tabs nav-stacked tlist">
|
||||
<li @click="sheet=item" :class="[{active: sheet==item }]" v-for="item in sheetArr">
|
||||
<a href="javascript:;" data-target="#tab3Content1" data-toggle="tab" v-text="serviceDetail['tables'][item]['name']"></a>
|
||||
</li>
|
||||
</ul>-->
|
||||
<div class="btn-group" style="margin: 5px 0">
|
||||
<a class="btn btn-default" @click="sheet=item" v-for="item in sheetArr" v-text="dealTableName(item)"> </a>
|
||||
</div>
|
||||
|
||||
<div class="btn-group" style="margin: 5px 0">
|
||||
<a class="btn" @click="sheet=item" v-for="item in sheetArr" v-text="dealTableName(item)"> </a>
|
||||
|
||||
<div class="base-info">字段信息</div>
|
||||
<table class="table table-bordered">
|
||||
<tr>
|
||||
<td v-show="status==3 || status==4 || status==5 || status==6"><input type="checkbox"></td>
|
||||
<th v-show="status==1"></th>
|
||||
<th>数据字段</th>
|
||||
<th>注释</th>
|
||||
<!--<th>数据类型</th>
|
||||
<th>输入类型</th>
|
||||
<th>附加属性</th>
|
||||
<th>备注</th>-->
|
||||
</tr>
|
||||
<tr v-for="(item, index) in serviceDetail['tables'][sheet].items">
|
||||
<td v-show="status==3"><input type="checkbox" v-model="exportArr" :value="sheet + '$' + item.name"></td>
|
||||
<td v-show="status==4"><input type="checkbox" v-model="serviceInfo.imports" :value="sheet + '$' + item.name"></td>
|
||||
<td v-show="status==5"><input type="checkbox" v-model="showFields" :value="sheet + '$' + item.name"></td>
|
||||
<td v-show="status==6"><input type="checkbox" v-model="filterArr" :value="sheet + '$' + item.name"></td>
|
||||
<td v-show="status=='detail'"><input type="checkbox" v-model="detailArr" :value="sheet + '$' + item.name"></td>
|
||||
<td v-show="status=='edit'"><input type="checkbox" v-model="editArr" :value="sheet + '$' + item.name"></td>
|
||||
|
||||
<td v-text="item.name" style="background-color: rgb(235, 235, 228);"></td>
|
||||
<td v-text="item.label"></td>
|
||||
<!--<td v-text="item.type"></td>
|
||||
<td v-text="item.inType"></td>
|
||||
<td v-text="item.inExt"></td>
|
||||
<td v-text="item.remark"></td>-->
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
<div style="padding-left: 10px;background-color: #ccc;">字段信息</div>
|
||||
<table class="table table-bordered">
|
||||
<tr>
|
||||
<td v-show="status==3 || status==4 || status==5 || status==6"><input type="checkbox"></td>
|
||||
<th v-show="status==1"></th>
|
||||
<th>数据字段</th>
|
||||
<th>注释</th>
|
||||
<!--<th>数据类型</th>
|
||||
<th>输入类型</th>
|
||||
<th>附加属性</th>
|
||||
<th>备注</th>-->
|
||||
</tr>
|
||||
<tr v-for="(item, index) in serviceDetail['tables'][sheet].items">
|
||||
<td v-show="status==3"><input type="checkbox" v-model="exportArr" :value="sheet + '$' + item.name"></td>
|
||||
<td v-show="status==4"><input type="checkbox" v-model="serviceInfo.imports" :value="sheet + '$' + item.name"></td>
|
||||
<td v-show="status==5"><input type="checkbox" v-model="showFields" :value="sheet + '$' + item.name"></td>
|
||||
<td v-show="status==6"><input type="checkbox" v-model="filterArr" :value="sheet + '$' + item.name"></td>
|
||||
<td v-show="status=='detail'"><input type="checkbox" v-model="detailArr" :value="sheet + '$' + item.name"></td>
|
||||
<td v-show="status=='edit'"><input type="checkbox" v-model="editArr" :value="sheet + '$' + item.name"></td>
|
||||
|
||||
<td v-text="item.name" style="background-color: rgb(235, 235, 228);"></td>
|
||||
<td v-text="item.label"></td>
|
||||
<!--<td v-text="item.type"></td>
|
||||
<td v-text="item.inType"></td>
|
||||
<td v-text="item.inExt"></td>
|
||||
<td v-text="item.remark"></td>-->
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<!-- 实体字段信息 -->
|
||||
<div class="col-xs-6" style="padding-left: 0px;">
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-xs-6" style="padding-left: 0px;padding-right: 0px;">
|
||||
<div class="col-xs-8">
|
||||
<!-- shows -->
|
||||
<div id="show" v-show="status==5">
|
||||
<div style="padding-left: 10px;background-color: #ccc;"> 列表配置</div>
|
||||
<div class="base-info"> 列表配置</div>
|
||||
<table class="table table-bordered table-auto">
|
||||
<thead>
|
||||
<tr>
|
||||
@@ -213,8 +243,8 @@
|
||||
|
||||
<!-- exports -->
|
||||
<div id="export" v-show="status==3">
|
||||
<div style="padding-left: 10px;background-color: #ccc;"> 导出配置</div>
|
||||
<table class="table table-bordered table-auto" style="width: 100%">
|
||||
<div class="base-info"> 导出配置</div>
|
||||
<table class="table table-bordered table-auto">
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
@@ -274,8 +304,8 @@
|
||||
|
||||
<!-- filters -->
|
||||
<div id="filter" v-show="status==6">
|
||||
<div style="padding-left: 10px;background-color: #ccc;width: 100%"> 查询配置</div>
|
||||
<table class="table table-bordered table-auto" style="width: 100%">
|
||||
<div class="base-info"> 查询配置</div>
|
||||
<table class="table table-bordered table-auto">
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
@@ -338,7 +368,7 @@
|
||||
|
||||
<!-- details -->
|
||||
<div id="detail" v-show="status=='detail'">
|
||||
<div style="padding-left: 10px;background-color: #ccc;width: 100%"> 详情配置</div>
|
||||
<div class="base-info"> 详情配置</div>
|
||||
<table class="table table-bordered table-auto">
|
||||
<thead>
|
||||
<tr>
|
||||
@@ -372,7 +402,7 @@
|
||||
|
||||
<!-- edits -->
|
||||
<div id="edit" v-show="status=='edit'">
|
||||
<div style="padding-left: 10px;background-color: #ccc;width: 100%"> 表单配置</div>
|
||||
<div class="base-info"> 表单配置</div>
|
||||
<table class="table table-bordered table-auto">
|
||||
<thead>
|
||||
<tr>
|
||||
@@ -428,7 +458,7 @@
|
||||
|
||||
<!-- del -->
|
||||
<div id="del" v-show="status=='del'">
|
||||
<div style="padding-left: 10px;background-color: #ccc;width: 100%"> 删除策略</div>
|
||||
<div class="base-info"> 删除策略</div>
|
||||
<div class="panel-body" style="overflow:auto;">
|
||||
<form class="form-horizontal">
|
||||
<!--
|
||||
@@ -468,6 +498,7 @@
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -1112,7 +1143,7 @@
|
||||
|
||||
dictList({type:"dict"}).then(res => {
|
||||
this.dictType = res
|
||||
console.log(res)
|
||||
//console.log(res)
|
||||
})
|
||||
}
|
||||
});
|
||||
|
||||
@@ -30,6 +30,10 @@
|
||||
</style>
|
||||
<!-- 对话框HTML -->
|
||||
<div class="importDev">
|
||||
<div class="col-md-12">
|
||||
<h3>实体导入</h3>
|
||||
</div>
|
||||
|
||||
<div class="info">
|
||||
<a @click="showInfo()" href="javascript:;"><i class="icon icon-info"></i></a>
|
||||
</div>
|
||||
@@ -108,7 +112,7 @@
|
||||
<!-- excel sheets -->
|
||||
<div class="row" v-show="sheet">
|
||||
<div class="col-xs-2 sheet-cell">
|
||||
<div style="padding-left: 10px;background-color: #ccc;width: 100%"> Excel-Sheet</div>
|
||||
<div class="base-info"> Excel-Sheet</div>
|
||||
<ul class="nav nav-tabs nav-stacked tlist" style="height: 100%">
|
||||
<li class="checkbox-inline clearfix" v-for="item in sheetArr" >
|
||||
<!-- || sheetData[item]['hv']==1 -->
|
||||
@@ -123,15 +127,15 @@
|
||||
<p v-show="ck && ck.length">已选择 <code v-text="ck.length||0"></code> 个实体待导入</p>
|
||||
</div>
|
||||
<div class="col-xs-8">
|
||||
<div style="padding-left: 10px;background-color: #ccc;width: 100%"> Sheet-Detail</div>
|
||||
<div class="base-info"> Sheet-Detail</div>
|
||||
<div class="tab-content col-xs-9">
|
||||
<div class="tab-pane fade active in" id="">
|
||||
<table class="table-bordered" style="width: 100%">
|
||||
<table class="table-bordered">
|
||||
<caption class="" v-show="sheet && (sheet!='表说明' || sheet!='表名称')">
|
||||
表名称: <span v-text="metaTable.field"></span>,中文名:<span v-text="metaTable.comment"></span>
|
||||
</caption>
|
||||
<thead>
|
||||
<tr style="background-color: #f1f1f1" v-show="sheet && sheet!='表说明' && sheet!='表名称'">
|
||||
<tr v-show="sheet && sheet!='表说明' && sheet!='表名称'">
|
||||
<th>列名</th>
|
||||
<th>注释</th>
|
||||
<th>数据类型</th>
|
||||
@@ -193,10 +197,10 @@
|
||||
|
||||
<div class="clearfix"></div>
|
||||
<div class="row" v-show="tableName">
|
||||
<div class="col-xs-2 sheet-cell">
|
||||
<div style="padding-left: 10px;background-color: #ccc;width: 100%"> DB-Table</div>
|
||||
<div class="col-xs-4 sheet-cell">
|
||||
<div class="base-info"> DB-Table</div>
|
||||
<ul class="nav nav-tabs nav-stacked tlist" style="height: 90%">
|
||||
<li class="checkbox-inline clearfix" v-for="item in tableArr" >
|
||||
<li class="checkbox-inline" v-for="item in tableArr" >
|
||||
<!-- || tableData[item]['hv']==1 -->
|
||||
<input type="checkbox"
|
||||
v-model="ckTable"
|
||||
@@ -207,13 +211,20 @@
|
||||
</li>
|
||||
</ul>
|
||||
<!-- v-show="ckTable && ckTable.length" -->
|
||||
|
||||
<p >已选择 <code v-text="ckTable.length||0"></code> 个实体待导入,上面<code class="text-danger">红色</code> 部分已经导入过的数据表</p>
|
||||
|
||||
<div class="modal-footer" v-show="cate=='mysql'">
|
||||
<button @click="back()" type="button" class="btn btn-default" data-dismiss="modal">返回</button>
|
||||
<button @click="ckTable=[]" type="button" class="btn btn-default" data-dismiss="modal">取消选择</button>
|
||||
<button @click="saveTable()" type="button" class="btn btn-primary">导入</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-8">
|
||||
<div style="padding-left: 10px;background-color: #ccc;width: 100%"> Table-Detail</div>
|
||||
<div class="base-info"> Table-Detail</div>
|
||||
<div class="tab-content col-xs-9">
|
||||
<div class="tab-pane fade active in">
|
||||
<table class="table-bordered" style="width: 100%">
|
||||
<table class="table-bordered">
|
||||
<caption class="" v-show="tableName && (sheet!='表说明' || sheet!='表名称')">
|
||||
表名称: <span v-text="tableInfo.name"></span>,中文名:<span v-text="tableInfo.comment"></span>
|
||||
</caption>
|
||||
@@ -255,11 +266,6 @@
|
||||
<button @click="ck=[]" type="button" class="btn btn-default" data-dismiss="modal">取消选择</button>
|
||||
<button @click="saveTable()" type="button" class="btn btn-primary">确定</button>
|
||||
</div>
|
||||
<div class="modal-footer" v-show="cate=='mysql'">
|
||||
<button @click="ckTable=[]" type="button" class="btn btn-default" data-dismiss="modal">取消选择</button>
|
||||
<button @click="back()" type="button" class="btn btn-default" data-dismiss="modal">取消</button>
|
||||
<button @click="saveTable()" type="button" class="btn btn-primary">确定</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12" style="padding-top: 10px;overflow:auto;">
|
||||
<table class="table table-bordered table-hover" style="width: 100%">
|
||||
<table class="table table-bordered table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th v-for="field in cfg.cols" v-text="field.label"></th>
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
<row class="meta-list">
|
||||
<div class="col-md-12">
|
||||
<h3 v-text="cfg.title" class="pull-left"></h3>
|
||||
</div>
|
||||
|
||||
<div class="info">
|
||||
<a @click="showInfo()" href="javascript:;"><i class="icon icon-info"></i></a>
|
||||
</div>
|
||||
@@ -21,22 +25,40 @@
|
||||
</div>
|
||||
|
||||
<div class="col-md-12 col-xs-12">
|
||||
|
||||
<hr style="margin: 0px 5px 5px">
|
||||
</div>
|
||||
|
||||
<!-- 实体列表 -->
|
||||
<div class="col-md-4 col-xs-4">
|
||||
<div>
|
||||
实体表(Meta-Table) <input v-model="filter" placeholder="筛选实体" class="base-input">
|
||||
<button @click="loadImportPage()" class="btn btn-primary pull-right" type="button"> <i class="icon icon-signin"></i>导入实体</button>
|
||||
</div>
|
||||
<ul class="nav nav-tabs nav-stacked tlist" style="height: 100%">
|
||||
<li :class="[{'active':alias==item.alias}]" v-for="item in tables" v-if="dealFilter(item)">
|
||||
<a @click="alias=item.alias" :title="dealTableLabel(item)" data-toggle="tooltip" v-text="dealTableLabel(item)" href="javascript:;"></a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="col-md-8 col-xs-8">
|
||||
<div class="input-group list-head">
|
||||
<div class="pull-left">
|
||||
<span class="input-group-btn">
|
||||
<button @click="loadImportPage()" :class="['btn','btn-primary']" type="button"> <i class="icon icon-signin"></i>导入实体</button>
|
||||
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<span class="input-group-btn" style="padding-left: 5px">
|
||||
<button @click="status=8" :class="['btn',{'btn-primary':status==8}]" type="button"> 实体关系(MetaLink)</button>
|
||||
<button @click="status=8" :class="['btn',{'btn-primary':status==8}]" type="button"> 实体关系</button>
|
||||
</span>
|
||||
|
||||
<span class="input-group-btn" style="padding-left: 10px">
|
||||
<button @click="status=2" :class="['btn',{'btn-primary':status==2}]" type="button"> 字段编辑</button>
|
||||
</span>
|
||||
<span class="input-group-btn">
|
||||
<button @click="status=1" :class="['btn',{'btn-primary':status==1}]" type="button"> 排序</button>
|
||||
<button @click="status=1" :class="['btn',{'btn-primary':status==1}]" type="button"> 字段排序</button>
|
||||
</span>
|
||||
|
||||
<span class="input-group-btn" style="padding-left: 10px">
|
||||
@@ -47,29 +69,14 @@
|
||||
<button @click="save()" :class="['btn',{'btn-primary':status!=0},{'disabled':status==0}]" type="button"> 保存</button>
|
||||
</span>
|
||||
</div>
|
||||
<hr style="margin: 0px 5px 5px">
|
||||
</div>
|
||||
|
||||
<!-- 实体列表 -->
|
||||
<div class="col-md-4 col-xs-4">
|
||||
<div style="padding-left: 10px;background-color: #ccc;width: 100%">
|
||||
实体表(Meta-Table) <input v-model="filter" placeholder="筛选实体" style="margin-top: 5px;">
|
||||
</div>
|
||||
<ul class="nav nav-tabs nav-stacked tlist" style="height: 100%">
|
||||
<li :class="['clearfix',{'active':alias==item.alias}]" v-for="item in tables" v-if="dealFilter(item)">
|
||||
<a @click="alias=item.alias" :title="dealTableLabel(item)" data-toggle="tooltip" v-text="dealTableLabel(item)" href="javascript:;"></a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="col-md-8 col-xs-8">
|
||||
<!-- 实体属性列表 -->
|
||||
<div class="panel" v-show="status!=7 && status!=8">
|
||||
|
||||
<!-- baseInfo -->
|
||||
<div style="padding-left: 10px;background-color: #ccc;width: 100%"> 基本属性</div>
|
||||
<div class="base-info">基本属性</div>
|
||||
<!--<div class="panel-heading">基本属性配置</div>-->
|
||||
<table :class="['table','table-bordered']" style="width: 100%">
|
||||
<table :class="['table','table-bordered']">
|
||||
<tr>
|
||||
<th style="width: 100px">表名</th>
|
||||
<td><span class="label label-outline" title="表别名alias">{{row.alias}}</span> {{row.name}}</td>
|
||||
@@ -83,8 +90,8 @@
|
||||
|
||||
</table>
|
||||
|
||||
<div style="padding-left: 10px;background-color: #ccc;width: 100%"> 字段信息</div>
|
||||
<table :class="[{'table':status!=2},'table-bordered']" style="width: 100%">
|
||||
<div class="base-info"> 字段信息</div>
|
||||
<table :class="[{'table':status!=2},'table-bordered']">
|
||||
<tr style="background-color: #f1f1f1">
|
||||
<td v-show="status==3 || status==4 || status==5 || status==6"><input type="checkbox"></td>
|
||||
<th v-show="status==1"></th>
|
||||
@@ -148,7 +155,7 @@
|
||||
|
||||
<!-- baseInfo -->
|
||||
<div class="panel" v-show="status==7 ">
|
||||
<div style="padding-left: 10px;background-color: #ccc;width: 100%"> 基本属性配置</div>
|
||||
<div class="base-info"> 基本属性配置</div>
|
||||
<!--<div class="panel-heading">基本属性配置</div>-->
|
||||
<div class="panel-body" style="overflow:auto;">
|
||||
<form class="form-horizontal">
|
||||
@@ -192,7 +199,7 @@
|
||||
</div>
|
||||
|
||||
<div class="panel" v-show="status==8">
|
||||
<div style="padding-left: 10px;background-color: #ccc;width: 100%"> 实体关系</div>
|
||||
<div class="base-info"> 实体关系</div>
|
||||
|
||||
<p style="padding: 5px">整理中,【实体关系】放到此处维护</p>
|
||||
</div>
|
||||
@@ -214,6 +221,7 @@
|
||||
let vm = new Vue({
|
||||
el: ".meta-list",
|
||||
data: {
|
||||
cfg: {"title": "实体管理"},
|
||||
inTypes: ["INPUT", "SELECT_EXT", "INPUT_DT", "FMT_FUN", "FILE"],
|
||||
dataTypes: ["bigint(20)", "varchar(255)", "varchar(64)", "varchar(32)", "varchar(16)", "int(11)", "int(3)", "int(2)", "datetime"],
|
||||
filterCate: ["EQUAL", "NOTEQUAL", "LIKE", "IN"],
|
||||
|
||||
@@ -108,7 +108,7 @@
|
||||
<h4 class="modal-title">功能概览</h4>
|
||||
</div>
|
||||
<div class="modal-body" style="text-align: center">
|
||||
<table class="table-bordered" style="width: 100%">
|
||||
<table class="table-bordered">
|
||||
<tr>
|
||||
<th v-text="tableA.comment"></th>
|
||||
<th v-text="tableB.comment"></th>
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
</div>
|
||||
|
||||
<div class="col-md-5">
|
||||
<table class="table table-auto" style="width: 100%">
|
||||
<table class="table table-auto">
|
||||
<tr>
|
||||
<th>字段</th>
|
||||
<th>备注</th>
|
||||
@@ -52,7 +52,7 @@
|
||||
</table>
|
||||
</div>
|
||||
<div class="col-md-5">
|
||||
<table class="table table-auto" style="width: 100%">
|
||||
<table class="table table-auto">
|
||||
<tr>
|
||||
<th>字段</th>
|
||||
<th>备注</th>
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
<div class="col-md-12">
|
||||
<button @click="edit({})" class="btn btn-primary" type="button"> 用户金币发放 </button>
|
||||
|
||||
<!--<table class="table table-bordered table-hover" style="width: 100%">
|
||||
<!--<table class="table table-bordered table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th v-for="field in cfg.cols" v-text="field.label"></th>
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
</div>
|
||||
|
||||
<div class="col-md-12">
|
||||
<table class="table table-bordered table-hover" style="width: 100%">
|
||||
<table class="table table-bordered table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th v-for="field in cfg.cols" v-text="field.label"></th>
|
||||
@@ -111,7 +111,7 @@
|
||||
<input v-model="row.pwd" class="form-control" id="pwd" placeholder="连接密码">
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<a @click="loadCatalogs" class="btn" href="javascript:;">获取catalogs</a>
|
||||
<a @click="loadCatalogs" class="btn btn-default" href="javascript:;">获取catalogs</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
</div>
|
||||
|
||||
<div class="col-md-12">
|
||||
<table class="table table-bordered table-hover" style="width: 100%">
|
||||
<table class="table table-bordered table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th v-for="field in cfg.cols" v-text="field.label"></th>
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
|
||||
<div class="col-md-6" v-show="logs.total">
|
||||
<h3>最近使用记录 <small>共 {{logs.total}} 条记录</small></h3>
|
||||
<table class="table-bordered" style="width: 100%">
|
||||
<table class="table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>IP</th>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<div class="col-xs-6">
|
||||
<div class="input-group">
|
||||
<span class="input-group-btn">
|
||||
<a href="javascript:;" class="btn" type="button"> 选择QTask任务</a>
|
||||
<a class="btn btn-default" type="button"> 选择QTask任务</a>
|
||||
</span>
|
||||
<select class="form-control" v-model="row">
|
||||
<option v-for="item in list.rows" :value="item" v-text="`${item.name}--${item.title}`"></option>
|
||||
@@ -26,7 +26,7 @@
|
||||
<div class="form-group">
|
||||
<label for="para" class="col-sm-2 required">数据平台</label>
|
||||
<div class="col-md-6">
|
||||
<select v-model="row.dbPlatId" class="form-control">
|
||||
<select v-model="row.dbplatid" class="form-control">
|
||||
<option></option>
|
||||
<option v-for="item in dbPlats" :value="item.key" v-text="item.name"></option>
|
||||
</select>
|
||||
@@ -87,7 +87,7 @@
|
||||
catalogs: function () {
|
||||
let dbPlats = this.dbPlats;
|
||||
for (i in dbPlats) {
|
||||
if (dbPlats[i].key == this.row.dbPlatId) {
|
||||
if (dbPlats[i].key == this.row.dbplatid) {
|
||||
return dbPlats[i]["catalogs"]
|
||||
}
|
||||
}
|
||||
@@ -104,7 +104,7 @@
|
||||
dbList().then(res => {
|
||||
this.dbPlats = res.rows;
|
||||
})
|
||||
qtaskList().then(res => {
|
||||
qtaskList({}).then(res => {
|
||||
let list = res
|
||||
|
||||
if(list && list.rows.length > 0) {
|
||||
|
||||
@@ -1,9 +1,43 @@
|
||||
<style>
|
||||
.edit {
|
||||
table {
|
||||
border-collapse: collapse;
|
||||
thead {
|
||||
text-align: center;
|
||||
/*th {
|
||||
background-color: #c3deff;
|
||||
}*/
|
||||
}
|
||||
th {
|
||||
vertical-align: middle;
|
||||
}
|
||||
}
|
||||
input,textarea,select {
|
||||
border-top: 0;
|
||||
border-right: 0;
|
||||
/*border-left: 2px!important;*/
|
||||
border-bottom: 0;
|
||||
/*background-color: #DDF3F5;*/
|
||||
}
|
||||
textarea {
|
||||
width: 100%;
|
||||
}
|
||||
.tpl-debug>pre{
|
||||
background-color: #F1F1F1;
|
||||
border-top: 0;
|
||||
border-right: 0;
|
||||
border-bottom: 0;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<row class="qtask-list">
|
||||
<div class="col-md-12">
|
||||
<h3 v-text="cfg.title"></h3>
|
||||
<button @click="openDia({'x':1})" class="btn btn-primary" type="button"> 添加QTask</button>
|
||||
</div>
|
||||
|
||||
<div class="col-md-12 ">
|
||||
|
||||
<div class="col-md-4">
|
||||
<!--<div class="col-md-2" style="padding-left: 0">
|
||||
<div class="input-group">
|
||||
<span class="input-group-btn">
|
||||
@@ -16,13 +50,16 @@
|
||||
</div>
|
||||
</div>-->
|
||||
|
||||
<div class="input-group pull-right">
|
||||
<!--<div class="input-group pull-right">
|
||||
<button @click="openDia({})" class="btn btn-primary" type="button"> 添加QTask</button>
|
||||
<!--<button @click="openDia({})" class="btn btn-primary" type="button" style="margin-left: 5px"> 添加QTask</button>-->
|
||||
</div>
|
||||
<!–<button @click="openDia({})" class="btn btn-primary" type="button" style="margin-left: 5px"> 添加QTask</button>–>
|
||||
</div>-->
|
||||
</div>
|
||||
<div class="col-md-12" style="padding-top: 10px;overflow:auto;">
|
||||
<table class="table table-bordered table-hover" style="width: 100%">
|
||||
<div class="clearfix"></div>
|
||||
|
||||
<div class="col-md-5" style="padding-top: 10px;overflow:auto;">
|
||||
<ul id="treeDemo" class="ztree" style="display: none"></ul>
|
||||
<table class="table table-bordered table-hover" style="width: 100%; ">
|
||||
<thead>
|
||||
<tr>
|
||||
<th v-for="field in cfg.cols" v-text="field.label"></th>
|
||||
@@ -30,12 +67,14 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="row in list.rows">
|
||||
<tr v-for="row in list.rows" @click="openDia(row)">
|
||||
<td v-for="field in cfg.cols" v-title="row[field.col]" v-text="row[field.col]"></td>
|
||||
<td>
|
||||
<a @click="openDia(row)" href="javascript:;">编辑</a>|
|
||||
<a @click="openDia(row)" href="javascript:;">编辑</a> |
|
||||
<!--
|
||||
<a @click="row['status']=1;qsave(row);" v-show="row.status != 1" href="javascript:;">启用</a>
|
||||
<a @click="row['status']=0;qsave(row);" v-show="row.status == 1" href="javascript:;">不启用</a> |
|
||||
-->
|
||||
<a @click="row['status']=-1;comfirmDel(row);" href="javascript:;">删除</a>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -46,8 +85,116 @@
|
||||
<img src="../res/img/none.png">
|
||||
<p>暂无数据</p>
|
||||
</div>
|
||||
<!-- 分页 -->
|
||||
<div>
|
||||
<ul class="pager pull-right" style="margin: 1px 0">
|
||||
|
||||
<li class="previous">
|
||||
<a >共{{list.total}}条数据</a>
|
||||
</li>
|
||||
<li :class="['previous', {'disabled':limit.pn==1}]">
|
||||
<a @click="loadList(-- limit.pn)" href="javascript:;">«上一页</a>
|
||||
</li>
|
||||
<li :class="['next', {'disabled':limit.pn >= limit.total}]">
|
||||
<a @click="loadList(limit.pn = ++limit.pn )" href="javascript:;">»下一页</a>
|
||||
</li>
|
||||
|
||||
<li class="previous">
|
||||
<a>到第<input v-model="limit.pn" style="width: 30px;height: 20px;margin: 0">/ {{limit.total}}页</a>
|
||||
</li>
|
||||
<li class="previous">
|
||||
<a @click="loadList(limit.pn)" href="javascript:;">确定</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-7 edit">
|
||||
<table v-show="editStatus==1" class="table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="4"><h5>【任务编辑】</h5></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tr>
|
||||
<th style="width: 120px">任务名称</th>
|
||||
<td>
|
||||
<input v-model="row.title" class="form-control">
|
||||
</td>
|
||||
<th style="width: 120px">任务KEY</th>
|
||||
<td>
|
||||
<input v-model="row.name" class="form-control">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>数据平台</th>
|
||||
<td>
|
||||
<select v-model="row.dbplatid" class="form-control">
|
||||
<option v-for="item in dbPlats" :value="item.key" v-text="item.name"></option>
|
||||
</select>
|
||||
</td>
|
||||
<th>CataLog</th>
|
||||
<td>
|
||||
<select v-model="row.catalog" class="form-control">
|
||||
<option v-for="item in catalogs()" :value="item" v-text="item"></option>
|
||||
</select>
|
||||
</td>
|
||||
<!--<td colspan="3">
|
||||
<div class="col-xs-6" style="padding: 0;">
|
||||
<select v-model="row.dbplatid" class="form-control" style="background-color: #f2f4f9">
|
||||
<option></option>
|
||||
<option v-for="item in dbPlats" :value="item.key" v-text="item.name"></option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-xs-4">
|
||||
<select v-model="row.catalog" class="form-control" style="background-color: #f2f4f9">
|
||||
<option></option>
|
||||
<option v-for="item in catalogs()" :value="item" v-text="item"></option>
|
||||
</select>
|
||||
</div>
|
||||
</td>-->
|
||||
</tr>
|
||||
<tr>
|
||||
<th>执行模板</th>
|
||||
<td colspan="3" class="tpl-content">
|
||||
<textarea v-model="row.content" @change="parsePara(row)" rows="6" class="pre-scrollable form-control"></textarea>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>默认参数</th>
|
||||
<td colspan="3" class="tpl-para">
|
||||
<textarea rows="1" v-model="row.para" class="form-control"></textarea>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>备注</th>
|
||||
<td colspan="3" class="tpl-remark">
|
||||
<textarea rows="1" v-model="row.remark" class="form-control"></textarea>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="4">
|
||||
|
||||
<div class="pull-right">
|
||||
<button @click="debug()" type="button" class="btn btn-primary" style="margin-right: 20px">调试</button>
|
||||
<button @click="openDia({})" type="button" class="btn btn-default" data-dismiss="modal">取消</button>
|
||||
<button @click="reset(row.name)" type="button" class="btn btn-default" data-dismiss="modal">重置</button>
|
||||
<button @click="save()" type="button" class="btn btn-primary">保存</button>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>调试结果</th>
|
||||
<td colspan="3" class="tpl-debug"><pre class="pre-scrollable">{{debugRet}}</pre></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div v-show="editStatus!=1" style="text-align: center">
|
||||
<img src="../res/img/none.png">
|
||||
<p>暂无数据</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- modal-tpl -->
|
||||
<div class="col-md-12">
|
||||
<!-- 对话框触发按钮 -->
|
||||
@@ -70,7 +217,7 @@
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 required">任务标识码</label>
|
||||
<div class="col-md-6 col-sm-10">
|
||||
<input v-model="row.name" :readonly="row.key" class="form-control" placeholder="请输入 任务标识码">
|
||||
<input v-model="row.name" :disabled="row.qtaskid" :readonly="row.key" class="form-control" placeholder="请输入 任务标识码">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" style="margin-bottom: 0">
|
||||
@@ -87,13 +234,13 @@
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="para" class="col-sm-2 required">数据平台</label>
|
||||
<div class="col-md-6">
|
||||
<select v-model="row.dbPlatId" class="form-control">
|
||||
<div class="col-xs-6">
|
||||
<select v-model="row.dbplatid" class="form-control">
|
||||
<option></option>
|
||||
<option v-for="item in dbPlats" :value="item.key" v-text="item.name"></option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="col-xs-4">
|
||||
<select v-model="row.catalog" class="form-control">
|
||||
<option></option>
|
||||
<option v-for="item in catalogs()" :value="item" v-text="item"></option>
|
||||
@@ -126,7 +273,7 @@
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
|
||||
<button @click="save()" type="button" class="btn btn-primary">确定</button>
|
||||
<button @click="del()" type="button" class="btn btn-primary">确定</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -134,9 +281,21 @@
|
||||
</row>
|
||||
<script src="http://www.1216.top/res/layui/layui.js"></script>
|
||||
<script>
|
||||
let {qtaskList,qtaskSave} = qtask
|
||||
//let {qtaskList, qtaskSave, qtaskDelete} = qtask
|
||||
let {dbList} = plat
|
||||
|
||||
function beforeDrag(treeId, treeNodes) {
|
||||
for (var i=0,l=treeNodes.length; i<l; i++) {
|
||||
if (treeNodes[i].drag === false) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
function beforeDrop(treeId, treeNodes, targetNode, moveType) {
|
||||
return targetNode ? targetNode.drop !== false : true;
|
||||
}
|
||||
|
||||
var vm = new Vue({
|
||||
el: ".qtask-list",
|
||||
data: {
|
||||
@@ -152,56 +311,151 @@
|
||||
cates: ["find","update"]
|
||||
},
|
||||
list: {rows:[], total: 0},
|
||||
row: {},
|
||||
limit: {pn: 1, ps: 20, total: 0},
|
||||
row: {name:"",content:"", remark:"", para:"", x:""},
|
||||
_row: {name:"",content:"", remark:""},
|
||||
dbPlats: [],
|
||||
sysPlats: [{name: "工控系统"}]
|
||||
sysPlats: [{name: "工控系统"}],
|
||||
editStatus: 0,
|
||||
debugRet:"",
|
||||
|
||||
// ZTree
|
||||
setting : {
|
||||
edit: {
|
||||
enable: true,
|
||||
showRemoveBtn: false,
|
||||
showRenameBtn: false
|
||||
},
|
||||
data: {
|
||||
simpleData: {
|
||||
enable: true
|
||||
}
|
||||
},
|
||||
callback: {
|
||||
beforeDrag: beforeDrag,
|
||||
beforeDrop: beforeDrop
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
|
||||
},
|
||||
methods: {
|
||||
loadList: function () {
|
||||
qtaskList().then(res => {
|
||||
let list = res
|
||||
this.list = list
|
||||
})
|
||||
},
|
||||
openDia: function (row) {
|
||||
vm.row = row;
|
||||
$('#myModal').modal({moveable: true});
|
||||
if (this.dbPlats.length == 0) {
|
||||
row: function (row) {
|
||||
if (row.name || row.x) {
|
||||
vm.editStatus = 1
|
||||
} else {
|
||||
vm.editStatus = 0
|
||||
}
|
||||
if (this.dbPlats.length === 0) {
|
||||
dbList().then(res => {
|
||||
this.dbPlats = res.rows;
|
||||
})
|
||||
}
|
||||
this.debugRet = ""
|
||||
$(".tpl-content>textarea").attr("rows", this.countLines(row.content))
|
||||
$(".tpl-remark>textarea").attr("rows", this.countLines(row.remark, 2, 5))
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
loadList: function (pn = 1) {
|
||||
let limit = this.limit.ps
|
||||
let offset = (pn - 1) * limit
|
||||
qtask.qtaskList({flipper: {offset, limit}}).then(res => {
|
||||
this.list = res
|
||||
|
||||
let zNodes = [
|
||||
{id: 1, pId: 0, name: "qtask 任务", open: true},
|
||||
/*{id: 11, pId: 1, name: "随意拖拽 1-1"},
|
||||
{id: 12, pId: 1, name: "随意拖拽 1-2", open: true},*/
|
||||
];
|
||||
for (let i in res.rows) {
|
||||
let row = res.rows[i]
|
||||
zNodes.push({id: row.qtaskid, pId: "1", name: row.title + '-(' + row.name+')'})
|
||||
}
|
||||
|
||||
$.fn.zTree.init($("#treeDemo"), this.setting, zNodes);
|
||||
this.limit.total = Math.ceil(this.list.total / limit)
|
||||
})
|
||||
},
|
||||
openDia: function (row) {
|
||||
vm.row = red.deepClone(row);
|
||||
vm._row = red.deepClone(row);
|
||||
vm.editStatus = 1
|
||||
/*$('#myModal').modal({moveable: true});
|
||||
if (this.dbPlats.length === 0) {
|
||||
dbList().then(res => {
|
||||
this.dbPlats = res.rows;
|
||||
})
|
||||
}*/
|
||||
this.parsePara(row)
|
||||
},
|
||||
save() {
|
||||
qtaskSave({task:this.row}).then(res => {
|
||||
qtask.qtaskSave(this.row).then(res => {
|
||||
red.showOk()
|
||||
this.loadList()
|
||||
$('#myModal').modal('hide')
|
||||
this.row = {}
|
||||
red.wait(1000).then(() => {
|
||||
this.loadList()
|
||||
this.row = {}
|
||||
$('#myModal').modal('hide')
|
||||
})
|
||||
})
|
||||
},
|
||||
dealStatus: function (n) {
|
||||
var arr = {"0":"未启用", "1":"启用", "-1":"删除",}
|
||||
|
||||
return arr[n+""] || "";
|
||||
},
|
||||
comfirmDel: function (row) {
|
||||
vm.row = row;
|
||||
$('#mySmModal').modal({});
|
||||
},
|
||||
del: function () {
|
||||
qtask.qtaskDelete(this.row.qtaskid).then(res => {
|
||||
$('#mySmModal').modal('hide')
|
||||
this.loadList()
|
||||
})
|
||||
},
|
||||
abc: function () {
|
||||
$(".container-fixed").load("abc.html");
|
||||
},
|
||||
catalogs: function () {
|
||||
let dbPlats = this.dbPlats;
|
||||
for (i in dbPlats) {
|
||||
if (dbPlats[i].key == this.row.dbPlatId) {
|
||||
if (dbPlats[i].key === this.row.dbplatid) {
|
||||
return dbPlats[i]["catalogs"]
|
||||
}
|
||||
}
|
||||
},
|
||||
debug: function () {
|
||||
qtask.qtaskDebug({task: this.row}).then(res => {
|
||||
this.debugRet = "";
|
||||
this.debugRet = res;
|
||||
red.showOk("查询成功")
|
||||
})
|
||||
},
|
||||
countLines: function (text='', min=3, max=15) {
|
||||
// 计算"\n"和"\r\n"两种换行符的数量
|
||||
let line = (text.match(/\n/g) || []).length + (text.match(/\r\n/g) || []).length + 1
|
||||
if (line < 3) {
|
||||
line = min;
|
||||
}
|
||||
if (line > 15) {
|
||||
line = max;
|
||||
}
|
||||
return line; // 最后+1是因为可能末尾没有换行符,但仍然算一行
|
||||
},
|
||||
reset: function () {
|
||||
this.row = red.deepClone(vm._row)
|
||||
},
|
||||
parsePara(row) {
|
||||
let sql = row.content || ''
|
||||
let pattern = /#\((.*?)\)/g; // 创建一个正则表达式来查找 "#()" 内的任何内容
|
||||
let match;
|
||||
|
||||
let para = JSON.parse(row.para)
|
||||
let _para = {}
|
||||
while ((match = pattern.exec(sql)) !== null) {
|
||||
// console.log("提取的变量:", match[1]); // match[1] 存储的是第一个括号内捕获的内容
|
||||
_para[match[1]] = para[match[1]] || ''
|
||||
}
|
||||
|
||||
this.row.para = JSON.stringify(_para)
|
||||
}
|
||||
},
|
||||
mounted: function () {
|
||||
|
||||
@@ -10,7 +10,7 @@ body {
|
||||
|
||||
}
|
||||
#top {
|
||||
background-color: #404a53;
|
||||
background-color: #2B323BFF;
|
||||
padding: 5px 10px;
|
||||
margin: 0px;
|
||||
height: 50px;
|
||||
@@ -31,13 +31,13 @@ body {
|
||||
#top>.nav-tabs>li.active>a:hover,
|
||||
#top>.nav-tabs>li>a:hover {
|
||||
background-color: #404a53;
|
||||
color: #fff;
|
||||
/*color: #fff;*/
|
||||
border: 0;
|
||||
border-bottom: 3px solid #607d8b;
|
||||
}
|
||||
|
||||
#left {
|
||||
background-color: #404a53; /*padding-bottom: 0px; margin-bottom: 0px;*/
|
||||
background-color: #2B323BFF; /*padding-bottom: 0px; margin-bottom: 0px;*/
|
||||
}
|
||||
#main {
|
||||
margin-top: 15px;
|
||||
@@ -51,7 +51,7 @@ body {
|
||||
/*background-color: #fff;*/
|
||||
}
|
||||
#left .nav {
|
||||
background-color: #404a53;
|
||||
background-color: #2B323BFF;
|
||||
}
|
||||
|
||||
#left .menu > .nav > li > .nav > li > a {
|
||||
@@ -89,7 +89,7 @@ body {
|
||||
margin-left: -10px;
|
||||
width: 100%;
|
||||
height: 35px;
|
||||
background-color: #eee;
|
||||
/*background-color: #eee;*/
|
||||
padding: 8px;
|
||||
color: #808080;
|
||||
}
|
||||
@@ -104,9 +104,9 @@ table td,th{
|
||||
text-overflow: ellipsis;
|
||||
max-width: 173px;
|
||||
}
|
||||
th{
|
||||
/*th{
|
||||
background-color: #f1f1f1;
|
||||
}
|
||||
}*/
|
||||
|
||||
/*ddl-page*/
|
||||
.ddl .input-group {
|
||||
@@ -145,7 +145,7 @@ th{
|
||||
.table td, .table th{
|
||||
padding: 5px;
|
||||
}
|
||||
.table td {background-color: #fff;}
|
||||
/*.table td {background-color: #fff;}*/
|
||||
|
||||
/* 页面信息按钮样式 */
|
||||
#main .info {
|
||||
@@ -177,7 +177,7 @@ th{
|
||||
.tlist>li.active>a:focus,
|
||||
.tlist>li.active>a:hover,
|
||||
.tlist>li>a:hover {
|
||||
background-color: #e2effc;
|
||||
background-color: #404348;
|
||||
border-radius: 2px 0 0 2px;
|
||||
border-left: 5px solid #a5cff8;
|
||||
}
|
||||
@@ -189,4 +189,126 @@ th{
|
||||
tr.dragging {
|
||||
visibility: visible;
|
||||
opacity: .3;
|
||||
}
|
||||
}
|
||||
|
||||
#left {
|
||||
.footer {
|
||||
background-color: #3b474c;
|
||||
cursor: pointer;
|
||||
color: #ccc;
|
||||
margin: auto;
|
||||
left: -1px;
|
||||
}
|
||||
|
||||
.user {
|
||||
position: fixed;
|
||||
bottom: 35px;
|
||||
height: 35px;
|
||||
margin: auto;
|
||||
background-color: #404a53;
|
||||
color: #808080;
|
||||
}
|
||||
}
|
||||
.leftMini {
|
||||
#left {
|
||||
width: auto;
|
||||
.icon {
|
||||
font-size: 16px;
|
||||
}
|
||||
.footer {
|
||||
margin: auto;
|
||||
}
|
||||
}
|
||||
.col-md-11 {
|
||||
width: 96%!important;
|
||||
}
|
||||
}
|
||||
|
||||
.col-md-12>h3{
|
||||
margin-top: 0px;
|
||||
}
|
||||
|
||||
.base-info {
|
||||
padding-left: 10px;
|
||||
background-color: #ccc;
|
||||
width: 100%;
|
||||
}
|
||||
.base-input {
|
||||
margin-top: 5px;margin-bottom: 5px;height: 30px; border: 1px solid black;
|
||||
}
|
||||
.plat-switch {
|
||||
border: 0;
|
||||
background-color: #404a53!important;
|
||||
color: #fff;
|
||||
margin-left: -5px;
|
||||
height: 35px;
|
||||
}
|
||||
body,table,th,td,.table-bordered,textarea,.form-control,button,pre,hr,.panel,input,checkbox,
|
||||
.btn-default,.input-group-btn,.input-group,
|
||||
/*.nav-tabs>li.active>a,.nav-tabs>li:focus,*/
|
||||
.previous>a,.next>a,
|
||||
.dlist>li>a,
|
||||
.input-group-addon,
|
||||
.modal-content,.modal-header,.modal-body,.modal-footer,
|
||||
.base-info,.plat-switch,
|
||||
.tlist>li.active>a,.tlist>li>a,
|
||||
.alert-info {
|
||||
background-color: #22272e !important;
|
||||
color: #c3c5c7 !important;
|
||||
border-color: #9e9e9e50!important;
|
||||
|
||||
th {
|
||||
background-color: #3b4652 !important;
|
||||
color: #85878AFF!important;
|
||||
}
|
||||
a {
|
||||
color: #7f74c4;
|
||||
}
|
||||
.btn-primary {
|
||||
background-color: #8276c9!important;
|
||||
color: #3e3a57!important;
|
||||
}
|
||||
.btn-primary:focus, .btn-primary:hover {
|
||||
background-color: #998fd9 !important;
|
||||
}
|
||||
.btn {
|
||||
text-shadow: none;
|
||||
}
|
||||
.btn-default:focus,.btn-default:hover {
|
||||
border-color: #7f74c4!important;
|
||||
color: #7f74c4!important;
|
||||
}
|
||||
.footer {
|
||||
background-color: #404a53 !important;
|
||||
}
|
||||
a:focus,a:hover {
|
||||
color: #fff!important;
|
||||
}
|
||||
.nav-tabs.nav-stacked {
|
||||
border-right: 0;
|
||||
ul {
|
||||
li>a {
|
||||
padding: 7px 15px;
|
||||
border-radius: 0 25px 25px 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
.base-info,H3 {
|
||||
color: #85878AFF!important;
|
||||
}
|
||||
.nav-tabs.nav-stacked>li {
|
||||
margin-right: 5px;
|
||||
}
|
||||
.alert-info {
|
||||
background-color: #607d8b!important;
|
||||
}
|
||||
table {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
.plat-switch {
|
||||
border: 0;
|
||||
background-color: #404a53 !important;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
var red = {
|
||||
showMsg: function(option) {
|
||||
var defOption = {msg: "操作成功", type:"info", placement: "top"};
|
||||
var defOption = {msg: "操作成功", /*type:"success",*/ placement: "top"};
|
||||
|
||||
option = option || defOption;
|
||||
for (var k in defOption) {
|
||||
@@ -63,6 +63,66 @@ var red = {
|
||||
callback(data)
|
||||
})
|
||||
},
|
||||
get2(url, params = {}) {
|
||||
return new Promise(resolve => {
|
||||
// 创建一个包含自定义 headers 的配置对象
|
||||
const config = {
|
||||
method: 'get', // 指定请求方法为 GET
|
||||
url: url, // 指定请求的 URL
|
||||
headers: { // 设置 Header 参数
|
||||
//'Authorization': 'Bearer your-token', // 假设添加一个 Bearer 认证 token
|
||||
//'Content-Type': 'application/json', // 或者指定 Content-Type 等其他 Header
|
||||
//'Custom-Header': 'Some value' // 自定义 Header 参数
|
||||
'token': red.getData("token"),
|
||||
'plattoken': red.getPlatToken(),
|
||||
},
|
||||
params: params,
|
||||
};
|
||||
|
||||
axios.request(config).then(res => {
|
||||
// 未登录,前往登录
|
||||
if (res.data.retcode === -2) {
|
||||
location.href = "/user/login.html"
|
||||
}
|
||||
resolve(res.data.result)
|
||||
}).catch(error => {
|
||||
console.error(error); // 处理错误
|
||||
});
|
||||
})
|
||||
},
|
||||
post2(url, params = {}) {
|
||||
return new Promise(resolve => {
|
||||
// 创建一个包含自定义 headers 的配置对象
|
||||
const config = {
|
||||
method: 'post', // 指定请求方法为 GET
|
||||
url: url, // 指定请求的 URL
|
||||
data: params,
|
||||
headers: { // 设置 Header 参数
|
||||
//'Authorization': 'Bearer your-token', // 假设添加一个 Bearer 认证 token
|
||||
//'Content-Type': 'application/json', // 或者指定 Content-Type 等其他 Header
|
||||
//'Custom-Header': 'Some value' // 自定义 Header 参数
|
||||
'token': red.getData("token"),
|
||||
'plattoken': red.getPlatToken(),
|
||||
}
|
||||
};
|
||||
|
||||
axios.request(config).then(res => {
|
||||
// 未登录,前往登录
|
||||
if (res.data.retcode === -2) {
|
||||
location.href = "/user/login.html"
|
||||
}
|
||||
if (res.data.retcode !== 0) {
|
||||
//console.log(res)
|
||||
red.showError(res.data.retinfo)
|
||||
return
|
||||
}
|
||||
|
||||
resolve(res.data.result)
|
||||
}).catch(error => {
|
||||
console.error(error); // 处理错误
|
||||
});
|
||||
})
|
||||
},
|
||||
getX(url, params = {}) {
|
||||
if (!params['platToken'])
|
||||
params['platToken'] = red.getPlatToken()
|
||||
@@ -80,7 +140,7 @@ var red = {
|
||||
|
||||
resolve(data)
|
||||
}).catch(res => {
|
||||
console.log(res)
|
||||
//console.log(res)
|
||||
red.showMsg({type:"error", msg:'操作失败!'})
|
||||
})
|
||||
})
|
||||
@@ -118,19 +178,21 @@ var red = {
|
||||
})
|
||||
},
|
||||
post: function(url, params = {}, callback) {
|
||||
params['platToken'] = red.getPlatToken()
|
||||
//params['platToken'] = red.getPlatToken()
|
||||
axios.post(url, params).then(res => {
|
||||
let data = red.loginCheck(res.data)
|
||||
/*let data = red.loginCheck(res.data)
|
||||
if (data && data.code == -1) {
|
||||
red.showMsg({msg: data.message, type: "error"})
|
||||
return;
|
||||
}
|
||||
}*/
|
||||
|
||||
if (callback) {
|
||||
callback(data.code == 0 ? data.body : data)
|
||||
console.log("xx", res.data.body)
|
||||
callback(res.data.code === 0 ? res.data.body : data)
|
||||
} else {
|
||||
red.showMsg()
|
||||
}
|
||||
return res
|
||||
})
|
||||
},
|
||||
|
||||
@@ -194,6 +256,7 @@ var red = {
|
||||
location.href = "/user/login.html";
|
||||
}, 2000);
|
||||
}
|
||||
return json.data
|
||||
},
|
||||
replaceAll: function (d, s, t) {
|
||||
let reg=new RegExp(s,"g"); //创建正则RegExp对象
|
||||
@@ -206,6 +269,23 @@ var red = {
|
||||
},
|
||||
replace$: function (d) {
|
||||
return red.replaceAll(d, "[$]", ".");
|
||||
},
|
||||
wait(ms) {
|
||||
return new Promise(resolve => setTimeout(resolve, ms));
|
||||
},
|
||||
deepClone: function (obj) {
|
||||
if (obj === null) return obj;
|
||||
if (obj instanceof Date) return new Date(obj);
|
||||
if (obj instanceof RegExp) return new RegExp(obj);
|
||||
if (typeof obj !== 'object') return obj;
|
||||
|
||||
let cloneObj = new obj.constructor();
|
||||
for (let key in obj) {
|
||||
if (obj.hasOwnProperty(key)) {
|
||||
cloneObj[key] = this.deepClone(obj[key]);
|
||||
}
|
||||
}
|
||||
return cloneObj;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -123,7 +123,7 @@
|
||||
methods: {
|
||||
login({username, pwd}) {
|
||||
login({username, pwd}).then(res => {
|
||||
console.log(res)
|
||||
red.setData("token", res.sessionid);
|
||||
platList().then(res => {
|
||||
let rows = res.rows
|
||||
console.log(rows)
|
||||
@@ -133,7 +133,6 @@
|
||||
if (!this.sysPlat) {
|
||||
this.sysPlat = rows[0];
|
||||
}
|
||||
|
||||
red.setData("sysPlats", rows);
|
||||
red.setData('userName', username)
|
||||
setTimeout(function () {
|
||||
|
||||
47
src/main/java/dev/zhub/mk/qtask/QTask.java
Normal file
47
src/main/java/dev/zhub/mk/qtask/QTask.java
Normal file
@@ -0,0 +1,47 @@
|
||||
package dev.zhub.mk.qtask;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.redkale.annotation.Comment;
|
||||
import org.redkale.persistence.Column;
|
||||
import org.redkale.persistence.Entity;
|
||||
import org.redkale.persistence.Id;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Entity
|
||||
public class QTask {
|
||||
|
||||
@Id
|
||||
@Comment("[记录ID]")
|
||||
private Integer qtaskid;
|
||||
|
||||
@Comment("[查询默认参数]")
|
||||
private String para = "{}";
|
||||
|
||||
@Comment("[CATALOG]")
|
||||
private String catalog = "";
|
||||
|
||||
@Comment("[数据平台ID]")
|
||||
private String dbplatid = "";
|
||||
|
||||
@Comment("[标识名称KEY]")
|
||||
// @Column(updatable = false)
|
||||
private String name = "";
|
||||
|
||||
@Comment("[所属平台ID]")
|
||||
@Column(updatable = false)
|
||||
private String platid;
|
||||
|
||||
@Comment("[业务名称]")
|
||||
private String title = "";
|
||||
|
||||
@Comment("[SQL模板]")
|
||||
private String content;
|
||||
|
||||
@Comment("[备注]")
|
||||
private String remark = "";
|
||||
|
||||
@Comment("[状态]10正常,80删除")
|
||||
private int status = 10;
|
||||
}
|
||||
61
src/main/java/dev/zhub/mk/qtask/QTaskService.java
Normal file
61
src/main/java/dev/zhub/mk/qtask/QTaskService.java
Normal file
@@ -0,0 +1,61 @@
|
||||
package dev.zhub.mk.qtask;
|
||||
|
||||
import net.tccn.base.BaseService;
|
||||
import net.tccn.base.Utils;
|
||||
import org.redkale.convert.json.JsonConvert;
|
||||
import org.redkale.net.http.RestHeader;
|
||||
import org.redkale.net.http.RestMapping;
|
||||
import org.redkale.net.http.RestService;
|
||||
import org.redkale.service.RetResult;
|
||||
import org.redkale.source.FilterNode;
|
||||
import org.redkale.source.Flipper;
|
||||
import org.redkale.util.AnyValue;
|
||||
import org.redkale.util.Sheet;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@RestService(name = "qtask", comment = "qtask服务")
|
||||
public class QTaskService extends BaseService {
|
||||
|
||||
@Override
|
||||
public void init(AnyValue config) {
|
||||
super.init(config);
|
||||
/*List<QTask> qTasks = metaSource.queryList(QTask.class);
|
||||
for (QTask xTask : qTasks) {
|
||||
System.out.println(JsonConvert.root().convertTo(xTask));
|
||||
}*/
|
||||
}
|
||||
|
||||
@RestMapping(name = "list", comment = "qtask列表")
|
||||
public RetResult<Sheet<QTask>> list(@RestHeader(name = "platid") String platid,
|
||||
Flipper flipper, Map<String, String> params) {
|
||||
FilterNode node = FilterNode.create("platid", platid);
|
||||
Sheet<QTask> sheet = metaSource.querySheet(QTask.class, flipper, node);
|
||||
return RetResult.success(sheet);
|
||||
}
|
||||
|
||||
@RestMapping(name = "create", comment = "qtask创建")
|
||||
public RetResult create(@RestHeader(name = "platid") String platid,
|
||||
QTask bean) {
|
||||
// -- 数据检查 --
|
||||
// 1. name 不可为空、 content 不可以为空
|
||||
if (Utils.isEmpty(bean.getName())) {
|
||||
return retError("名称不能为空");
|
||||
}
|
||||
if (Utils.isEmpty(bean.getContent())) {
|
||||
return retError("内容不能为空");
|
||||
}
|
||||
|
||||
// 2. bean.name 标识名称KEY唯一性检查
|
||||
FilterNode node = FilterNode.create("name", bean.getName())
|
||||
.and("platid", platid);
|
||||
if (metaSource.exists(QTask.class, node)) {
|
||||
return retError("名称重复");
|
||||
}
|
||||
|
||||
// -- 数据保存 --
|
||||
metaSource.insert(bean);
|
||||
return render();
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,15 @@
|
||||
package net.tccn.base;
|
||||
|
||||
import org.redkale.annotation.Resource;
|
||||
import org.redkale.convert.json.JsonConvert;
|
||||
import org.redkale.service.RetResult;
|
||||
import org.redkale.service.Service;
|
||||
import org.redkale.source.CacheMemorySource;
|
||||
import org.redkale.source.DataSource;
|
||||
import org.redkale.util.Sheet;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.io.File;
|
||||
import java.util.List;
|
||||
import java.util.Properties;
|
||||
import java.util.function.Supplier;
|
||||
import java.util.logging.Logger;
|
||||
@@ -29,12 +33,33 @@ public class BaseService implements Service {
|
||||
|
||||
@Resource(name = "APP_HOME")
|
||||
protected File APP_HOME;
|
||||
|
||||
@Resource(name = "meta")
|
||||
protected DataSource metaSource;
|
||||
protected static Properties prop = new Properties();
|
||||
protected static TplKit tplKit = TplKit.use(true);
|
||||
|
||||
private static boolean tplInit = false;
|
||||
|
||||
protected final static RetResult RET_SUCCESS = RetResult.success();
|
||||
protected final static RetResult RET_EMPTY_SHEET = RetResult.success(new Sheet<>(0, List.of()));
|
||||
protected final static RetResult RET_EMPTY_LIST = RetResult.success(List.of());
|
||||
|
||||
protected RetResult retError(String info) {
|
||||
return new RetResult<>(100, info);
|
||||
}
|
||||
|
||||
protected RetResult retError(int code, String info) {
|
||||
return new RetResult<>(code, info);
|
||||
}
|
||||
|
||||
protected <T> RetResult<T> render(T obj) {
|
||||
return new RetResult<>(obj);
|
||||
}
|
||||
|
||||
protected RetResult render() {
|
||||
return RET_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
protected <T> T getT(String key, Class<T> clazz, Supplier<T> supplier) {
|
||||
Object obj = cacheSource.getAndRefresh(key, 1000 * 60 * 3, clazz);
|
||||
if (obj != null) {
|
||||
|
||||
@@ -9,6 +9,7 @@ import org.redkale.net.http.HttpServlet;
|
||||
import javax.annotation.Resource;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.Map;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
/**
|
||||
@@ -33,6 +34,15 @@ public class BaseServlet extends HttpServlet {
|
||||
if (sessionid == null) {
|
||||
sessionid = request.getSessionid(true);
|
||||
}
|
||||
if (sessionid == null) {
|
||||
Map<String, String> headers = request.getHeaders();
|
||||
for (String key : headers.keySet()) {
|
||||
if ("token".equalsIgnoreCase(key)) {
|
||||
sessionid = headers.get(key);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (sessionid != null) {
|
||||
MetaUser user = userService.current(sessionid);
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package net.tccn.base;
|
||||
|
||||
import dev.zhub.mk.qtask.QTask;
|
||||
import lombok.Getter;
|
||||
import net.tccn.base.arango.Doc;
|
||||
import net.tccn.base.dbq.jdbc.api.DbAccount;
|
||||
@@ -12,7 +13,11 @@ import net.tccn.plat.MetaPlat;
|
||||
import net.tccn.qtask.DbTask;
|
||||
import net.tccn.qtask.TaskKit;
|
||||
import net.tccn.user.MetaUser;
|
||||
import org.redkale.annotation.Resource;
|
||||
import org.redkale.convert.json.JsonConvert;
|
||||
import org.redkale.service.AbstractService;
|
||||
import org.redkale.source.DataSource;
|
||||
import org.redkale.util.AnyValue;
|
||||
import org.redkale.util.Comment;
|
||||
import org.redkale.util.TypeToken;
|
||||
|
||||
@@ -29,7 +34,7 @@ import static java.util.Arrays.asList;
|
||||
/**
|
||||
* Created by liangxianyou at 2019/1/7 13:31.
|
||||
*/
|
||||
public final class MetaKit {
|
||||
public class MetaKit extends AbstractService {
|
||||
//基础数据缓存
|
||||
@Getter
|
||||
private static List<MetaTable> metaTables;
|
||||
@@ -44,7 +49,7 @@ public final class MetaKit {
|
||||
@Getter
|
||||
private static List<MetaUser> users;
|
||||
@Getter
|
||||
private static List<DbTask> taskEntities;
|
||||
private static List<QTask> taskEntities;
|
||||
@Getter
|
||||
private static List<Dict> dicts;
|
||||
|
||||
@@ -52,6 +57,15 @@ public final class MetaKit {
|
||||
protected static String dataPath;
|
||||
private static final JsonConvert convert = JsonConvert.root();
|
||||
|
||||
@Resource(name = "meta")
|
||||
protected DataSource metaSource;
|
||||
|
||||
@Override
|
||||
public void init(AnyValue config) {
|
||||
taskEntities = metaSource.queryList(QTask.class);
|
||||
TaskKit.init();
|
||||
}
|
||||
|
||||
// -----------------------------------
|
||||
public static void init() {
|
||||
reload(MetaTable.class);
|
||||
@@ -60,9 +74,20 @@ public final class MetaKit {
|
||||
reload(DbAccount.class);
|
||||
reload(MetaPlat.class);
|
||||
reload(MetaUser.class);
|
||||
reload(DbTask.class);
|
||||
// reload(DbTask.class);
|
||||
reload(Dict.class);
|
||||
|
||||
new Thread(() -> {
|
||||
while (true) {
|
||||
try {
|
||||
reload(MetaUser.class);
|
||||
Thread.sleep(15000);
|
||||
} catch (InterruptedException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
}).start();
|
||||
|
||||
/*
|
||||
同步 本地文件配置数据到 数据库
|
||||
List<List<? extends Doc>> list = asList(metaTables, metaLinks, metaServices, dbPlats, sysPlats, users, taskEntities, dicts);
|
||||
@@ -140,8 +165,8 @@ public final class MetaKit {
|
||||
else if (MetaPlat.class == clazz) sysPlats = MetaPlat.dao.find();
|
||||
else if (MetaUser.class == clazz) users = MetaUser.dao.find();
|
||||
else if (DbTask.class == clazz) {
|
||||
taskEntities = DbTask.dao.find();
|
||||
TaskKit.init();
|
||||
// taskEntities = DbTask.dao.find();
|
||||
// TaskKit.init();
|
||||
} else if (Dict.class == clazz) {
|
||||
dicts = Dict.dao.find();
|
||||
}
|
||||
|
||||
@@ -250,7 +250,9 @@ public class Utils {
|
||||
sqlCount += " " + join;
|
||||
}
|
||||
}
|
||||
sqlCount += " WHERE " + where;
|
||||
if (!Utils.isEmpty(where)) {
|
||||
sqlCount += " WHERE " + where;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ public class ArangoSource {
|
||||
private ArangoSource() {
|
||||
MetaListenter.resourceFactory.inject(this);
|
||||
|
||||
arangoDb = new ArangoDB.Builder().host(host, port).user(user).password(password).build();
|
||||
arangoDb = new ArangoDB.Builder().host(host, port).user(user).password(password).timeout(1000*15).build();
|
||||
}
|
||||
|
||||
private ArangoSource(ArangoDB arangoDb) {
|
||||
|
||||
@@ -28,7 +28,7 @@ public class DbExecutors {
|
||||
MetaService metaService = MetaKit.getMetaService(fBean.getName(), fBean.getPlatToken());
|
||||
MetaTable mainTable = MetaKit.getMetaTableByAlias(metaService.getTable());
|
||||
DbKit dbKit = MetaKit.getDbKit(mainTable.getDbPlatId(), mainTable.getCatalog());
|
||||
//System.out.printf("----------------%n countSql:%s%n findSql:%s%n----------------%n", sqls[0], sqls[1]);
|
||||
System.out.printf("----------------%n countSql:%s%n findSql:%s%n----------------%n", sqls[0], sqls[1]);
|
||||
|
||||
CompletableFuture<Integer> countFuture = CompletableFuture.supplyAsync(() -> dbKit.findColumn(sqls[0], int.class));
|
||||
CompletableFuture<List<Map>> listFuture = CompletableFuture.supplyAsync(() -> dbKit.queryList(sqls[1], Map.class));
|
||||
|
||||
@@ -24,6 +24,49 @@ public class DbSourceMysql implements DbSource {
|
||||
private DbAccount dbAccount;
|
||||
private String catalog;
|
||||
|
||||
private static boolean ping;
|
||||
|
||||
static {
|
||||
// MYSQL PING
|
||||
synchronized (DbSourceMysql.class) {
|
||||
if (!ping) {
|
||||
new Thread(() -> {
|
||||
while (true) {
|
||||
conns.forEach((k, vs) -> {
|
||||
if (vs.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
for (int i = 0; i < counter.get(k).get(); i++) {
|
||||
Connection conn = vs.poll();
|
||||
if (conn == null) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
conn.prepareStatement("SELECT 1").executeQuery();
|
||||
vs.put(conn);
|
||||
} catch (SQLException e) {
|
||||
counter.get(k).decrementAndGet(); // 连接总数减去1
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
});
|
||||
|
||||
try {
|
||||
Thread.sleep(1000 * 60);
|
||||
} catch (InterruptedException ignored) {
|
||||
}
|
||||
}
|
||||
}).start();
|
||||
ping = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public DbSourceMysql() {
|
||||
|
||||
}
|
||||
@@ -179,21 +222,34 @@ public class DbSourceMysql implements DbSource {
|
||||
}
|
||||
|
||||
private synchronized Connection connection(int n) throws InterruptedException, SQLException {
|
||||
LinkedBlockingQueue<Connection> queue = conns.getOrDefault(accountKey, new LinkedBlockingQueue<>(15));
|
||||
LinkedBlockingQueue<Connection> queue = conns.get(accountKey);
|
||||
if (queue == null) {
|
||||
queue = new LinkedBlockingQueue<>(15);
|
||||
conns.put(accountKey, queue);
|
||||
}
|
||||
AtomicInteger num = counter.get(accountKey);
|
||||
if (num == null) {
|
||||
num = new AtomicInteger(0);
|
||||
}
|
||||
|
||||
Connection conn = null;
|
||||
AtomicInteger num = counter.getOrDefault(accountKey, new AtomicInteger(0));
|
||||
if (queue.size() == 0 && num.get() < 15) { // 创建总连接数小于15,且暂无可用连接
|
||||
conn = DriverManager.getConnection(dbAccount.getUrl(), dbAccount.getUser(), dbAccount.getPwd());
|
||||
if (queue.isEmpty() && num.get() < 15) { // 创建总连接数小于15,且暂无可用连接
|
||||
String url = dbAccount.getUrl();
|
||||
String user = dbAccount.getUser();
|
||||
String pwd = dbAccount.getPwd();
|
||||
|
||||
conn = DriverManager.getConnection(url, user, pwd);
|
||||
int x = num.incrementAndGet();
|
||||
counter.put(accountKey, num);
|
||||
System.out.println("创建新的连接:" + x);
|
||||
System.out.printf("创建新的连接[%s]:%s\n", x, url + "@" + user);
|
||||
|
||||
} else {
|
||||
conn = queue.take();
|
||||
if (!conn.isValid(5)) {
|
||||
conn = connection(++n);
|
||||
}
|
||||
}
|
||||
conns.put(accountKey, queue);
|
||||
//conns.put(accountKey, queue);
|
||||
return conn;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package net.tccn.qtask;
|
||||
|
||||
import dev.zhub.mk.qtask.QTask;
|
||||
import net.tccn.base.Kv;
|
||||
import net.tccn.base.MetaKit;
|
||||
import org.redkale.convert.json.JsonConvert;
|
||||
@@ -14,7 +15,7 @@ import java.util.Optional;
|
||||
*/
|
||||
public class TaskKit {
|
||||
static final JsonConvert convert = JsonConvert.root();
|
||||
private static List<DbTask> taskEntities;
|
||||
private static List<QTask> taskEntities;
|
||||
|
||||
static {
|
||||
init();
|
||||
@@ -25,16 +26,16 @@ public class TaskKit {
|
||||
}
|
||||
|
||||
public static Task buildTask(String name, String platToken, Kv para) {
|
||||
DbTask taskEntity = getTaskEntity(name, platToken);
|
||||
QTask taskEntity = getTaskEntity(name, platToken);
|
||||
return buildTask(taskEntity, para);
|
||||
}
|
||||
|
||||
public static Task buildTask(DbTask taskEntity, Kv para) {
|
||||
public static Task buildTask(dev.zhub.mk.qtask.QTask taskEntity, Kv para) {
|
||||
Task task = new Task();
|
||||
task.setName(taskEntity.getName());
|
||||
task.setTitle(taskEntity.getTitle());
|
||||
task.setContent(taskEntity.getContent());
|
||||
task.setDbPlatId(taskEntity.getDbPlatId());
|
||||
task.setDbPlatId(taskEntity.getDbplatid());
|
||||
task.setCatalog(taskEntity.getCatalog());
|
||||
|
||||
Kv _para = Kv.of().putAll(para);
|
||||
@@ -47,16 +48,16 @@ public class TaskKit {
|
||||
}
|
||||
}
|
||||
task.setPara(_para);
|
||||
task.setDbAccount(MetaKit.getDbPlat(taskEntity.getDbPlatId()));
|
||||
task.setDbAccount(MetaKit.getDbPlat(taskEntity.getDbplatid()));
|
||||
return task;
|
||||
}
|
||||
|
||||
public static DbTask getTaskEntity(String name, String platToken) {
|
||||
public static QTask getTaskEntity(String name, String platToken) {
|
||||
Objects.requireNonNull(name);
|
||||
Objects.requireNonNull(platToken);
|
||||
|
||||
Optional<DbTask> any = taskEntities.stream()
|
||||
.filter(x -> name.equals(x.getName()) && MetaKit.getPlatId(platToken).equals(x.getSysPlatId()))
|
||||
Optional<QTask> any = taskEntities.stream()
|
||||
.filter(x -> name.equals(x.getName()) && MetaKit.getPlatId(platToken).equals(x.getPlatid()))
|
||||
.findAny();
|
||||
return any.get();
|
||||
}
|
||||
@@ -66,7 +67,7 @@ public class TaskKit {
|
||||
return QRuner.query(task);
|
||||
}
|
||||
|
||||
public static Object taskRun(DbTask entity) {
|
||||
public static Object taskRun(QTask entity) {
|
||||
Task task = buildTask(entity, Kv.of());
|
||||
return QRuner.query(task);
|
||||
}
|
||||
|
||||
@@ -1,29 +1,68 @@
|
||||
package net.tccn.qtask;
|
||||
|
||||
import dev.zhub.mk.qtask.QTask;
|
||||
import net.tccn.base.BaseService;
|
||||
import net.tccn.base.JBean;
|
||||
import net.tccn.base.MetaKit;
|
||||
import net.tccn.base.PageBean;
|
||||
import org.redkale.net.http.RestBody;
|
||||
import org.redkale.net.http.RestHeader;
|
||||
import org.redkale.net.http.RestParam;
|
||||
import org.redkale.net.http.RestService;
|
||||
import org.redkale.service.RetResult;
|
||||
import org.redkale.source.ColumnValue;
|
||||
import org.redkale.source.FilterNode;
|
||||
import org.redkale.source.Flipper;
|
||||
import org.redkale.util.Comment;
|
||||
import org.redkale.util.Sheet;
|
||||
|
||||
@RestService(automapping = true)
|
||||
public class _QtaskService extends BaseService {
|
||||
|
||||
@Comment("qtask列表")
|
||||
public JBean list(DbTask task, Flipper flipper, @RestParam(name = "platToken") String token) {
|
||||
if (task == null) {
|
||||
public RetResult<Sheet<QTask>> list(Flipper flipper, @RestHeader(name = "plattoken") String token) {
|
||||
flipper.sort("qtaskid DESC");
|
||||
/*if (task == null) {
|
||||
task = new DbTask();
|
||||
}
|
||||
task.setSysPlatId(platId(token));
|
||||
PageBean<DbTask> page = DbTask.dao.findPage(task, flipper);
|
||||
|
||||
|
||||
return JBean.by(0, "", page);
|
||||
PageBean<DbTask> page = DbTask.dao.findPage(task, flipper);*/
|
||||
|
||||
FilterNode node = FilterNode.create("platid", platId(token)).and("status", 10);
|
||||
Sheet<QTask> sheet = metaSource.querySheet(QTask.class, flipper, node);
|
||||
return RetResult.success(sheet);
|
||||
}
|
||||
|
||||
public RetResult create(@RestHeader(name = "plattoken") String token,
|
||||
@RestBody QTask task) {
|
||||
|
||||
FilterNode node = FilterNode.create("name", task.getName()).and("platid", platId(token));
|
||||
if (metaSource.exists(QTask.class, node)) {
|
||||
return retError("qtask 标识不能重复");
|
||||
}
|
||||
task.setPlatid(platId(token));
|
||||
|
||||
metaSource.insert(task);
|
||||
return render();
|
||||
}
|
||||
|
||||
public RetResult update(@RestHeader(name = "plattoken") String token,
|
||||
@RestBody QTask task) {
|
||||
|
||||
metaSource.update(task);
|
||||
return render();
|
||||
}
|
||||
|
||||
public RetResult delete(@RestHeader(name = "plattoken") String token,
|
||||
@RestBody QTask task) {
|
||||
|
||||
metaSource.updateColumn(QTask.class, task.getQtaskid(), ColumnValue.create("status", 80));
|
||||
return render();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Comment("qtask保存")
|
||||
public JBean save(DbTask task, @RestParam(name = "platToken") String token) {
|
||||
JBean jBean = new JBean();
|
||||
@@ -60,7 +99,7 @@ public class _QtaskService extends BaseService {
|
||||
}
|
||||
|
||||
@Comment("debug调试接口")
|
||||
public JBean debug(DbTask task, @RestParam(name = "platToken") String token) {
|
||||
public JBean debug(QTask task, @RestParam(name = "platToken") String token) {
|
||||
JBean jBean = new JBean();
|
||||
|
||||
Object res = TaskKit.taskRun(task);
|
||||
|
||||
11
src/main/java/net/tccn/user/LoginBean.java
Normal file
11
src/main/java/net/tccn/user/LoginBean.java
Normal file
@@ -0,0 +1,11 @@
|
||||
package net.tccn.user;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
public class LoginBean {
|
||||
private String username;
|
||||
private String pwd;
|
||||
}
|
||||
@@ -3,6 +3,7 @@ package net.tccn.user;
|
||||
import net.tccn.base.BaseService;
|
||||
import net.tccn.base.JBean;
|
||||
import net.tccn.base.MetaKit;
|
||||
import org.redkale.net.http.RestBody;
|
||||
import org.redkale.net.http.RestMapping;
|
||||
import org.redkale.net.http.RestService;
|
||||
import org.redkale.net.http.RestSessionid;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import dev.zhub.mk.qtask.QTask;
|
||||
import net.tccn.base.*;
|
||||
import net.tccn.base.dbq.fbean.FBean;
|
||||
import net.tccn.base.dbq.jdbc.api.DbAccount;
|
||||
@@ -294,13 +295,13 @@ public class RunTest<T> {
|
||||
}
|
||||
|
||||
//@Test
|
||||
public void taskRunTest() {
|
||||
DbTask entity = DbTask.dao.findByKey("23074420");
|
||||
/*public void taskRunTest() {
|
||||
QTask entity = DbTask.dao.findByKey("23074420");
|
||||
|
||||
if (entity != null) {
|
||||
System.out.printf("------------------------%n%s%n------------------------%n", convert.convertTo(TaskKit.taskRun(entity)));
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
//@Test
|
||||
public void dataToFileTest() {
|
||||
@@ -585,7 +586,7 @@ public class RunTest<T> {
|
||||
Predicate<Dict> isCity = (s) -> !isProvice.test(s) && String.valueOf(s.getValue()).trim().endsWith("00");
|
||||
BiPredicate<Dict, Dict> belongProvice = (p, x) -> String.valueOf(x.getValue()).trim().startsWith(String.valueOf(p.getValue()).trim().substring(0, 2));
|
||||
|
||||
@Test
|
||||
//@Test
|
||||
public void dictTest() {
|
||||
MetaKit.init();
|
||||
System.out.println("-------- 1 -------");
|
||||
|
||||
Reference in New Issue
Block a user