优化:1、meta 业务配置页面,其他界面改善

2、元数据记录到内存缺少id的处理
     3、设置platid为不可修改字段
This commit is contained in:
2024-04-03 11:42:49 +08:00
parent c5ea3cb944
commit 3bbf78f51c
13 changed files with 297 additions and 198 deletions

View File

@@ -128,7 +128,7 @@
</li> </li>
<li class="previous"> <li class="previous">
<a style="border-bottom: 0;border-right: 0;border-top: 0;">到第<input v-model="limit.pn" style="width: 30px;height: 21px;">/ {{limit.total}}页</a> <a style="border-bottom: 0;border-right: 0;border-top: 0;">到第<input v-model="limit.pn" style="width: 40px;height: 21px;">/ {{limit.total}}页</a>
</li> </li>
<li class="previous"> <li class="previous">
<a @click="findList(limit.pn)" href="javascript:;">确定</a> <a @click="findList(limit.pn)" href="javascript:;">确定</a>
@@ -257,7 +257,7 @@
para: {}, para: {},
list: {rows: [], total: 0}, list: {rows: [], total: 0},
limit: {pn: 1, ps: 20, total: 0}, limit: {pn: 1, ps: 20, total: 0},
order: {col: "id", desc: 1}, order: {col: "", desc: 1},
pk: "", pk: "",
detailData: {} detailData: {}
}, },
@@ -271,10 +271,11 @@
}) })
}, },
service() { service() {
this.loadCfg(); this.loadCfg(function () {
this.limit = {pn: 1, ps: 20, total: 0}; this.limit = {pn: 1, ps: 20, total: 0};
this.order = {col:"", desc:1}; this.order = {col:"", desc:1};
this.findList(); vm.findList();
});
}, },
list () { list () {
let limit = this.limit; let limit = this.limit;
@@ -303,7 +304,7 @@
vm.service = json[0].name; vm.service = json[0].name;
}); });
}, },
loadCfg() { loadCfg(back) {
getCfg({name: this.service}).then(res => { getCfg({name: this.service}).then(res => {
// res['type'] = res.filters[0]['name'] // res['type'] = res.filters[0]['name']
@@ -314,6 +315,23 @@
res.details = res.shows res.details = res.shows
} }
this.cfg = res this.cfg = res
// 设置默认查询值
let fbean = red.getData(`FBean-${this.service}`,{});
if (fbean['filters']) {
for (let i in fbean['filters']) {
this.cfg.filters.forEach(function (f) {
if (f.name === fbean['filters'][i]['col']) {
f.value = fbean['filters'][i]['value']
f.type = fbean['filters'][i]['type'];
f.checked = f.checked || fbean['filters'][i]['checked']
}
})
}
}
if (back) {
back();
}
}); });
}, },
dealFieldFmt(bean, colFmt) { //处理字典数据 及 自定义函数处理数据 dealFieldFmt(bean, colFmt) { //处理字典数据 及 自定义函数处理数据
@@ -432,6 +450,7 @@
limit: this.limit, limit: this.limit,
}; };
red.setData(`FBean-${this.service}`, fbean)
return fbean return fbean
}, },
detail() { detail() {

View File

@@ -22,87 +22,12 @@
}*/ }*/
</style> </style>
<row class="meta-service"> <row class="meta-service">
<div class="col-md-12"> <div class="col-md-12 pull-left" style="margin-bottom: 5px">
<h3>业务管理</h3> <h3>业务管理</h3>
</div> <div class="input-group pull-right">
<div class="pull-left">
<div class="info" style="padding-left: 10px"> <button @click="createService({})" class="btn btn-primary" type="button"> 新建业务</button>
<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>
<!--<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>
<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 @click="createService(item)" href="javascript:">编辑</a>
<!--<a href="javascript:">删除</a>-->
</td>
</tr>
</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"> <!--<span class="input-group-btn">
<button class="btn btn-default" type="button">选择业务类型</button> <button class="btn btn-default" type="button">选择业务类型</button>
</span> </span>
@@ -156,8 +81,115 @@
<button @click="save()" :class="['btn',{'btn-primary':status!=0},{'disabled':status==0}]" type="button"> 保存</button> <button @click="save()" :class="['btn',{'btn-primary':status!=0},{'disabled':status==0}]" type="button"> 保存</button>
</span> </span>
</div> </div>
<div class="clearfix"></div>
<hr> <!--<div class="pull-leftx">
<div class="btn-group">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
<i class="icon icon-filter"></i> 过滤 <span class="caret"></span>
</button>
<ul class="dropdown-menu dropdown-menu-table">
<table class="table">
<tr>
<td>
<a href="javascript:;">
<input type="checkbox" checked>
<label>业务名称</label>
</a>
</td>
<td>
<a href="javascript:;">
<input type="checkbox" checked>
<label>标识码</label>
</a>
</td>
<td>
<a href="javascript:;">
<input type="checkbox" checked>
<label>状态</label>
</a>
</td>
</tr>
</table>
</ul>
</div>
</div>-->
</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>
<!--<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="col-xs-3">
<div class="base-info"> 业务列表</div>
<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>
<i class="icon icon-ok" v-if="item.name==service" style="color: #7f74c4"></i>
{{item.name}}
</td>
<td>{{item.comment}}</td>
<td>
<a @click="createService(item)" href="javascript:">编辑</a>
<!--<a href="javascript:">删除</a>-->
</td>
</tr>
</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="col-xs-4"> <div class="col-xs-4">
<div class="base-info"> 业务相关表</div> <div class="base-info"> 业务相关表</div>
<!--<ul class="nav nav-tabs nav-stacked tlist"> <!--<ul class="nav nav-tabs nav-stacked tlist">
@@ -166,11 +198,15 @@
</li> </li>
</ul>--> </ul>-->
<div class="btn-group" style="margin: 5px 0"> <!--<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> <a class="btn btn-default" @click="sheet=item" v-for="item in sheetArr" v-text="dealTableName(item)"> </a>
</div>-->
<!-- 业务相关表使用 radios 做选择 -->
<div v-for="item in sheetArr" @click="sheet=item" style="cursor:pointer; padding: 0 3px">
<input type="radio" :name="item" :value="item" v-model="sheet">
<a v-text="dealTableName(item)" style="text-decoration: none"></a>
</div> </div>
<div class="base-info">字段信息</div> <div class="base-info">字段信息</div>
<table class="table table-bordered"> <table class="table table-bordered">
<tr> <tr>
@@ -216,26 +252,25 @@
</tr> </tr>
</thead> </thead>
<tr v-for="(item, index) in serviceInfo.shows"> <tr v-for="(item, index) in serviceInfo.shows">
<td class="icon icon-move"> <td :class="['icon','icon-move',{'color-x': colorX(item)}]">
<input type="hidden" name="item" :value="JSON.stringify(item)"> <input type="hidden" name="item" :value="JSON.stringify(item)">
</td> </td>
<td v-text="dealCol(item.col)" style="background-color: rgb(235, 235, 228);"></td> <td v-text="dealCol(item.col)"></td>
<td style="padding: 1px;"><input v-model="item.label" class="form-control" style="width: 130px;padding: 0px"></td> <td><input v-model="item.label" class="form-control" ></td>
<td style="padding: 1px;"> <td>
<select v-model="item.inType" class="form-control" style="width: 130px"> <select v-model="item.inType" class="form-control" >
<option v-for="x in inTypes" :value="x">{{x}}</option> <option v-for="x in inTypes" :value="x">{{x}}</option>
</select> </select>
</td> </td>
<td style="padding: 1px;" title="格式化类型为funs或qtask的时候需要填写附加参数"> <td title="格式化类型为funs或qtask的时候需要填写附加参数">
<input v-show="item.inType == 'FUNC' || item.inType == 'QTASK' || item.inType == 'INPUT_FUNC'" v-model="item.inExt" class="form-control" style="width: 130px;padding: 0px"> <input v-show="item.inType == 'FUNC' || item.inType == 'QTASK' || item.inType == 'INPUT_FUNC'" v-model="item.inExt" class="form-control">
<input disabled v-show="item.inType != 'FUNC' && item.inType != 'INPUT_FUNC' && item.inType != 'QTASK' && item.inType != 'DICT'" v-model="item.inExt" class="form-control" style="width: 130px;padding: 0px"> <input disabled v-show="item.inType != 'FUNC' && item.inType != 'INPUT_FUNC' && item.inType != 'QTASK' && item.inType != 'DICT'" v-model="item.inExt" class="form-control">
<select v-show="item.inType == 'DICT'" v-model="item.inExt" class="form-control" style="width: 130px"> <select v-show="item.inType == 'DICT'" v-model="item.inExt" class="form-control">
<option></option>
<option v-for="x in dictType" :value="x.value">{{x.label}}</option> <option v-for="x in dictType" :value="x.value">{{x.label}}</option>
</select> </select>
</td> </td>
<!-- <!--
<td style="padding: 1px;"><input v-model="item.fmt" class="form-control" style="width: 130px;padding: 0px"></td> <td><input v-model="item.fmt" class="form-control" style="width: 130px;padding: 0px"></td>
--> -->
</tr> </tr>
</table> </table>
@@ -255,17 +290,17 @@
</tr> </tr>
</thead> </thead>
<tr v-for="item in serviceInfo.exports"> <tr v-for="item in serviceInfo.exports">
<td class="icon icon-move"> <td :class="['icon','icon-move',{'color-x': colorX(item)}]">
<input type="hidden" name="item" :value="JSON.stringify(item)"> <input type="hidden" name="item" :value="JSON.stringify(item)">
</td> </td>
<td v-text="dealCol(item.col)" style="background-color: rgb(235, 235, 228);"></td> <td v-text="dealCol(item.col)" style="background-color: rgb(235, 235, 228);"></td>
<td style="padding: 1px;"><input v-model="item.label" class="form-control" style="padding: 0px"></td> <td><input v-model="item.label" class="form-control" style="padding: 0px"></td>
<td style="padding: 1px;"> <td>
<select v-model="item.inType" class="form-control" style="width: 130px"> <select v-model="item.inType" class="form-control" style="width: 130px">
<option v-for="x in exportFmtTypes" :value="x">{{x}}</option> <option v-for="x in exportFmtTypes" :value="x">{{x}}</option>
</select> </select>
</td> </td>
<td style="padding: 1px;" title="格式化类型为funs或qtask的时候需要填写附加参数"> <td title="格式化类型为funs或qtask的时候需要填写附加参数">
<input v-show="item.inType == 'FUNC' || item.inType == 'QTASK' || item.inType == 'DICT'" v-model="item.inExt" class="form-control" style="width: 130px;padding: 0px"> <input v-show="item.inType == 'FUNC' || item.inType == 'QTASK' || item.inType == 'DICT'" v-model="item.inExt" class="form-control" style="width: 130px;padding: 0px">
<input disabled v-show="item.inType != 'FUNC' && item.inType != 'QTASK' && item.inType != 'DICT'" v-model="item.inExt" class="form-control" style="width: 130px;padding: 0px"> <input disabled v-show="item.inType != 'FUNC' && item.inType != 'QTASK' && item.inType != 'DICT'" v-model="item.inExt" class="form-control" style="width: 130px;padding: 0px">
</td> </td>
@@ -310,31 +345,29 @@
<tr> <tr>
<th></th> <th></th>
<th style="width: 30px">数据字段</th> <th style="width: 30px">数据字段</th>
<th style="width: 30px">展示名称</th> <th>展示名称</th>
<th style="width: 30px">默认</th> <th style="width: 30px">默认</th>
<th>组件配置</th> <th>组件配置</th>
<th>附加参数</th> <th>附加参数</th>
</tr> </tr>
</thead> </thead>
<tr v-for="item in serviceInfo.filters"> <tr v-for="item in serviceInfo.filters">
<td class="icon icon-move"> <td :class="['icon','icon-move',{'color-x': colorX(item)}]">
<input type="hidden" name="item" :value="JSON.stringify(item)"> <input type="hidden" name="item" :value="JSON.stringify(item)">
</td> </td>
<td v-text="dealCol(item.name)" style="background-color: rgb(235, 235, 228);"></td> <td v-text="dealCol(item.name)"></td>
<td style="padding: 1px;"><input v-model="item.label" class="form-control" style="width: 130px;padding: 0px"></td> <td><input v-model="item.label" class="form-control"></td>
<td style="padding: 1px;text-align: center;"> <td style="text-align: center">
<label> <input type="checkbox" v-model="item.checked" value="1">
<input type="checkbox" v-model="item.checked" value="1">
</label>
</td> </td>
<td style="padding: 1px;overflow: inherit;"> <td style="overflow: inherit;">
<select v-model="item.inType" class="form-control"> <select v-model="item.inType" class="form-control">
<option v-for="x in findTypes" :value="x">{{x}}</option> <option v-for="x in findTypes" :value="x">{{x}}</option>
</select> </select>
</td> </td>
<td style="padding: 1px;"> <td>
<input v-show="item.inType == 'DICT' || item.inType == 'CHECKBOX' || item.inType == 'REDIO'" v-model="item.inExt" class="form-control" style="width: 130px;padding: 0px"> <input v-show="item.inType == 'DICT' || item.inType == 'CHECKBOX' || item.inType == 'REDIO'" v-model="item.inExt" class="form-control">
<input disabled v-show="!(item.inType == 'DICT' || item.inType == 'CHECKBOX' || item.inType == 'REDIO')" v-model="item.inExt" class="form-control" style="width: 130px;padding: 0px"> <input disabled v-show="!(item.inType == 'DICT' || item.inType == 'CHECKBOX' || item.inType == 'REDIO')" v-model="item.inExt" class="form-control">
</td> </td>
<!-- <!--
<td style="padding: 1px;overflow: inherit;"> <td style="padding: 1px;overflow: inherit;">
@@ -381,19 +414,19 @@
</thead> </thead>
<tbody> <tbody>
<tr v-for="(item, index) in serviceInfo.details"> <tr v-for="(item, index) in serviceInfo.details">
<td class="icon icon-move"> <td :class="['icon','icon-move',{'color-x': colorX(item)}]">
<input type="hidden" name="item" :value="JSON.stringify(item)"> <input type="hidden" name="item" :value="JSON.stringify(item)">
</td> </td>
<td v-text="dealCol(item.col)" style="background-color: rgb(235, 235, 228);"></td> <td v-text="dealCol(item.col)"></td>
<td style="padding: 1px;"><input v-model="item.label" class="form-control" style="width: 130px;padding: 0px"></td> <td><input v-model="item.label" class="form-control"></td>
<td style="padding: 1px;"> <td>
<select v-model="item.inType" class="form-control" style="width: 130px"> <select v-model="item.inType" class="form-control">
<option v-for="x in inTypes" :value="x">{{x}}</option> <option v-for="x in inTypes" :value="x">{{x}}</option>
</select> </select>
</td> </td>
<td style="padding: 1px;" title="格式化类型为funs或qtask的时候需要填写附加参数"> <td title="格式化类型为funs或qtask的时候需要填写附加参数">
<input v-show="item.inType == 'FUNC' || item.inType == 'QTASK' || item.inType == 'DICT'" v-model="item.inExt" class="form-control" style="width: 130px;padding: 0px"> <input v-show="item.inType == 'FUNC' || item.inType == 'QTASK' || item.inType == 'DICT'" v-model="item.inExt" class="form-control">
<input disabled v-show="item.inType != 'FUNC' && item.inType != 'QTASK' && item.inType != 'DICT'" v-model="item.inExt" class="form-control" style="width: 130px;padding: 0px"> <input disabled v-show="item.inType != 'FUNC' && item.inType != 'QTASK' && item.inType != 'DICT'" v-model="item.inExt" class="form-control">
</td> </td>
</tr> </tr>
</tbody> </tbody>
@@ -416,19 +449,19 @@
</thead> </thead>
<tbody> <tbody>
<tr v-for="(item, index) in serviceInfo.edits"> <tr v-for="(item, index) in serviceInfo.edits">
<td class="icon icon-move"> <td :class="['icon','icon-move',{'color-x': colorX(item)}]">
<input type="hidden" name="item" :value="JSON.stringify(item)"> <input type="hidden" name="item" :value="JSON.stringify(item)">
</td> </td>
<td v-text="dealCol(item.col)" style="background-color: rgb(235, 235, 228);"></td> <td v-text="dealCol(item.col)"></td>
<td style="padding: 1px;"><input v-model="item.label" class="form-control" style="width: 100px;padding: 0px"></td> <td><input v-model="item.label" class="form-control"></td>
<td style="padding: 1px;"> <td>
<select v-model="item.inType" class="form-control" style="width: 130px"> <select v-model="item.inType" class="form-control">
<option v-for="x in inTypes" :value="x">{{x}}</option> <option v-for="x in inTypes" :value="x">{{x}}</option>
</select> </select>
</td> </td>
<td style="padding: 1px;" title="格式化类型为funs或qtask的时候需要填写附加参数"> <td title="格式化类型为funs或qtask的时候需要填写附加参数">
<input v-show="item.inType == 'FUNC' || item.inType == 'QTASK' || item.inType == 'DICT'" v-model="item.inExt" class="form-control" style="width: 130px;padding: 0px"> <input v-show="item.inType == 'FUNC' || item.inType == 'QTASK' || item.inType == 'DICT'" v-model="item.inExt" class="form-control">
<input disabled v-show="item.inType != 'FUNC' && item.inType != 'QTASK' && item.inType != 'DICT'" v-model="item.inExt" class="form-control" style="width: 130px;padding: 0px"> <input disabled v-show="item.inType != 'FUNC' && item.inType != 'QTASK' && item.inType != 'DICT'" v-model="item.inExt" class="form-control">
</td> </td>
<td style="padding: 1px;overflow: inherit;"> <td style="padding: 1px;overflow: inherit;">
<div class="dropdown dropdown-hover"> <div class="dropdown dropdown-hover">
@@ -1134,6 +1167,20 @@
dealTableName(item) { dealTableName(item) {
let table = this.serviceDetail['tables'][item] let table = this.serviceDetail['tables'][item]
return `[${table.alias}] ${table.tablename} (${table.comment})` return `[${table.alias}] ${table.tablename} (${table.comment})`
},
colorX(item) {
// {col :"rl$transaction_price"} 截取出 rl
if (item.col) {
let col = item.col.split("$")[0]
return col === this.sheet
}
if (item.name) {
let col = item.name.split("$")[0]
return col === this.sheet
}
return false
} }
}, },

View File

@@ -3,7 +3,7 @@
<h3 v-text="cfg.title"></h3> <h3 v-text="cfg.title"></h3>
</div> </div>
<div class="col-md-12"> <div class="col-md-12">
<div class="input-group list-head pull-left"> <div class="input-group pull-left">
<span class="input-group-btn"> <span class="input-group-btn">
<button class="btn btn-default" type="button">数据平台</button> <button class="btn btn-default" type="button">数据平台</button>
</span> </span>

View File

@@ -43,7 +43,7 @@
</div> </div>
<div class="col-md-8 col-xs-8"> <div class="col-md-8 col-xs-8">
<div class="input-group list-head"> <div class="input-group" style="padding-bottom: 10px">
<div class="pull-left"> <div class="pull-left">
<span class="input-group-btn"> <span class="input-group-btn">

View File

@@ -12,13 +12,13 @@
vertical-align: middle; vertical-align: middle;
} }
} }
input,textarea,select { /*input,textarea,select {
border-top: 0; border-top: 0;
border-right: 0; border-right: 0;
/*border-left: 2px!important;*/ !*border-left: 2px!important;*!
border-bottom: 0; border-bottom: 0;
/*background-color: #DDF3F5;*/ !*background-color: #DDF3F5;*!
} }*/
textarea { textarea {
width: 100%; width: 100%;
} }
@@ -31,33 +31,13 @@
} }
</style> </style>
<row class="qtask-list"> <row class="qtask-list">
<div class="col-md-12"> <div class="col-md-12" style="margin-bottom: 10px">
<h3 v-text="cfg.title"></h3> <h3 v-text="cfg.title"></h3>
<button @click="openDia({'x':1})" class="btn btn-primary" type="button"> 添加QTask</button> <button @click="openDia({'x':1})" class="btn btn-primary" type="button"> 添加QTask</button>
</div> </div>
<div class="col-md-4"> <div class="col-md-5" style="">
<!--<div class="col-md-2" style="padding-left: 0">
<div class="input-group">
<span class="input-group-btn">
<button class="btn btn-default" type="button">选择业务平台</button>
</span>
<select class="form-control">
<option>sdfa</option>
<option>sadf</option>
</select>
</div>
</div>-->
<!--<div class="input-group pull-right">
<button @click="openDia({})" class="btn btn-primary" type="button"> 添加QTask</button>
&lt;!&ndash;<button @click="openDia({})" class="btn btn-primary" type="button" style="margin-left: 5px"> 添加QTask</button>&ndash;&gt;
</div>-->
</div>
<div class="clearfix"></div>
<div class="col-md-5" style="padding-top: 10px;overflow:auto;">
<ul id="treeDemo" class="ztree" style="display: none"></ul> <ul id="treeDemo" class="ztree" style="display: none"></ul>
<table class="table table-bordered table-hover" style="width: 100%; "> <table class="table table-bordered table-hover" style="width: 100%; ">
<thead> <thead>
@@ -108,11 +88,17 @@
</div> </div>
</div> </div>
<div class="col-md-7 edit"> <div class="col-md-7 edit" style="padding-top: 0px;">
<table v-show="editStatus==1" class="table table-bordered"> <table v-show="editStatus==1" class="table table-bordered">
<thead> <thead>
<tr> <tr>
<th colspan="4"><h5>【任务编辑】</h5></th> <th colspan="4">
<h5 class="pull-left">【任务编辑】</h5>
<!--全屏打开按钮-->
<!--<a @click="fullScreen()" href="javascript:" class="pull-right" style="margin: 5px; font-size: 18px">
<i class="icon icon-fullscreen"></i>
</a>-->
</th>
</tr> </tr>
</thead> </thead>
<tr> <tr>
@@ -201,7 +187,7 @@
<!-- 对话框触发按钮 --> <!-- 对话框触发按钮 -->
<!-- 对话框HTML --> <!-- 对话框HTML -->
<div class="modal fade" id="myModal"> <div class="modal fade" id="myModal">
<div class="modal-dialog"> <div class="modal-dialog modal-lg">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">关闭</span></button> <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">关闭</span></button>
@@ -236,9 +222,9 @@
<div class="form-group"> <div class="form-group">
<label for="para" class="col-sm-2 required">数据平台</label> <label for="para" class="col-sm-2 required">数据平台</label>
<div class="col-xs-6"> <div class="col-xs-6">
<select v-model="row.dbplatid" class="form-control"> <select v-model="row.dbid" class="form-control">
<option></option> <option></option>
<option v-for="item in dbPlats" :value="item.key" v-text="item.name"></option> <option v-for="item in dbPlats" :value="item.dbid" v-text="item.dbname"></option>
</select> </select>
</div> </div>
<div class="col-xs-4"> <div class="col-xs-4">
@@ -304,6 +290,7 @@
cfg: { cfg: {
title: "QTask 管理", title: "QTask 管理",
cols: [ cols: [
{col: "qtaskid", label: "#",},
{col: "name", label: "任务标识码",}, {col: "name", label: "任务标识码",},
{col: "title", label: "任务名称",}, {col: "title", label: "任务名称",},
{col: "remark", label: "备注",}, {col: "remark", label: "备注",},
@@ -356,12 +343,17 @@
} }
}, },
methods: { methods: {
loadList: function (pn = 1) { loadList: function (pn = 1, x = '') {
let limit = this.limit.ps let limit = this.limit.ps
let offset = (pn - 1) * limit let offset = (pn - 1) * limit
qtask.qtaskList({flipper: {offset, limit}}).then(res => { qtask.qtaskList({flipper: {offset, limit}}).then(res => {
this.list = res this.list = res
// 如果页面初次打开,则默认打开第一条记录
if (x === 'OPEN' && res.rows.length > 0) {
vm.openDia(res.rows[0])
}
let zNodes = [ let zNodes = [
{id: 1, pId: 0, name: "qtask 任务", open: true}, {id: 1, pId: 0, name: "qtask 任务", open: true},
/*{id: 11, pId: 1, name: "随意拖拽 1-1"}, /*{id: 11, pId: 1, name: "随意拖拽 1-1"},
@@ -376,7 +368,7 @@
this.limit.total = Math.ceil(this.list.total / limit) this.limit.total = Math.ceil(this.list.total / limit)
}) })
}, },
openDia: function (row) { openDia(row) {
vm.row = red.deepClone(row); vm.row = red.deepClone(row);
vm._row = red.deepClone(row); vm._row = red.deepClone(row);
vm.editStatus = 1 vm.editStatus = 1
@@ -388,13 +380,16 @@
}*/ }*/
this.parsePara(row) this.parsePara(row)
}, },
fullScreen(row) {
$('#myModal').modal({moveable: true})
},
save() { save() {
qtask.qtaskSave(this.row).then(res => { qtask.qtaskSave(this.row).then(res => {
red.showOk() red.showOk()
red.wait(1000).then(() => { red.wait(1000).then(() => {
this.loadList() this.loadList()
this.row = {} // this.row = {}
$('#myModal').modal('hide') // $('#myModal').modal('hide')
}) })
}) })
}, },
@@ -460,7 +455,7 @@
} }
}, },
mounted: function () { mounted: function () {
this.loadList(); this.loadList(1, 'OPEN');
setTimeout(function () { setTimeout(function () {
layui.use('code', function(){ //加载code模块 layui.use('code', function(){ //加载code模块

View File

@@ -94,9 +94,9 @@ body {
color: #808080; color: #808080;
} }
.list-head { /*.list-head {
padding-bottom: 10px; padding-bottom: 10px;
} }*/
table td,th{ table td,th{
white-space:nowrap; white-space:nowrap;
@@ -246,6 +246,26 @@ tr.dragging {
ul.pager { ul.pager {
margin: -15px 0 11px 10px; margin: -15px 0 11px 10px;
} }
.meta-service {
#show,#edit,#filter,#export,#detail {
td {
input,select {
margin: -4px;
/*width: auto;*/
}
input[type="checkbox"] {
margin: 5px;
}
}
}
.icon-move {
text-align: center;
width: 35px;
}
.color-x {
color: #7771b9!important;
}
}
body,table,th,td,.table-bordered,textarea,.form-control,button,pre,hr,.panel,input,checkbox, body,table,th,td,.table-bordered,textarea,.form-control,button,pre,hr,.panel,input,checkbox,
@@ -310,6 +330,7 @@ body,table,th,td,.table-bordered,textarea,.form-control,button,pre,hr,.panel,inp
table { table {
width: 100%; width: 100%;
} }
} }
.plat-switch { .plat-switch {
border: 0; border: 0;

View File

@@ -11,10 +11,11 @@ import net.tccn.plat.MPlat;
import net.tccn.qtask.TaskKit; import net.tccn.qtask.TaskKit;
import net.tccn.user.MUser; import net.tccn.user.MUser;
import org.redkale.annotation.Resource; import org.redkale.annotation.Resource;
import org.redkale.convert.json.JsonConvert;
import org.redkale.service.AbstractService; import org.redkale.service.AbstractService;
import org.redkale.source.DataJdbcSource; import org.redkale.source.DataJdbcSource;
import org.redkale.source.DataSource; import org.redkale.source.DataSource;
import org.redkale.source.FilterNode;
import org.redkale.source.Flipper;
import org.redkale.util.AnyValue; import org.redkale.util.AnyValue;
import org.redkale.util.Comment; import org.redkale.util.Comment;
@@ -48,9 +49,11 @@ public class MetaKit extends AbstractService {
@Getter @Getter
private static List<Dict> dicts; private static List<Dict> dicts;
protected static String dcate = "db"; @Resource(name = "property.dataCate")
protected static String dataPath; protected String dcate = "db";
private static final JsonConvert convert = JsonConvert.root(); @Resource(name = "property.dataPath")
protected String dataPath;
// private static final JsonConvert convert = JsonConvert.root();
@Resource(name = "meta") @Resource(name = "meta")
protected DataSource metaSource; protected DataSource metaSource;
@@ -124,7 +127,7 @@ public class MetaKit extends AbstractService {
} }
// ----------------------------------- // -----------------------------------
public static void init() { /*public static void init() {
// reload(MetaTable.class); // reload(MetaTable.class);
// reload(MLink.class); // reload(MLink.class);
// reload(MetaService.class); // reload(MetaService.class);
@@ -134,16 +137,15 @@ public class MetaKit extends AbstractService {
// reload(DbTask.class); // reload(DbTask.class);
// reload(Dict.class); // reload(Dict.class);
/* // 同步 本地文件配置数据到 数据库
同步 本地文件配置数据到 数据库
List<List<? extends Doc>> list = asList(metaTables, metaLinks, metaServices, dbPlats, sysPlats, users, taskEntities, dicts); List<List<? extends Doc>> list = asList(metaTables, metaLinks, metaServices, dbPlats, sysPlats, users, taskEntities, dicts);
for (List<? extends Doc> docs : list) { for (List<? extends Doc> docs : list) {
for (Doc doc : docs) { for (Doc doc : docs) {
doc.save(); doc.save();
} }
}*/ }
} }*/
/*public static <T extends Doc> void reload(Class<T> clazz) { /*public static <T extends Doc> void reload(Class<T> clazz) {
reload(clazz, null); reload(clazz, null);
@@ -665,7 +667,10 @@ public class MetaKit extends AbstractService {
public void save(MTable table) { public void save(MTable table) {
if (table.getTableid() == null || table.getTableid() == 0) { if (table.getTableid() == null || table.getTableid() == 0) {
metaSource.insert(table); metaSource.insert(table);
mTables.add(table); // 查询回来带id的记录
FilterNode node = FilterNode.create("alias", table.getAlias()); // alias 唯一
MTable _table = metaSource.find(MTable.class, node);
mTables.add(_table);
} else { } else {
metaSource.update(table); metaSource.update(table);
@@ -687,7 +692,10 @@ public class MetaKit extends AbstractService {
public void save(MService mservice) { public void save(MService mservice) {
if (mservice.getServid() == 0) { if (mservice.getServid() == 0) {
metaSource.insert(mservice); metaSource.insert(mservice);
metaServices.add(mservice); // 查询回来带id的记录
FilterNode node = FilterNode.create("name", mservice.getName()).and("platid", mservice.getPlatid());
MService _mservice = metaSource.find(MService.class, node);
metaServices.add(_mservice);
} else { } else {
metaSource.update(mservice); metaSource.update(mservice);
@@ -708,7 +716,9 @@ public class MetaKit extends AbstractService {
public void save(MLink link) { public void save(MLink link) {
if (link.getLinkid() == 0) { if (link.getLinkid() == 0) {
metaSource.insert(link); metaSource.insert(link);
metaLinks.add(link); // 查询回来带id的记录 (暂未考虑多人并发操作)
List<MLink> _links = metaSource.queryList(MLink.class, new Flipper("linkid DESC"));
metaLinks.add(_links.get(0));
} else { } else {
metaSource.update(link); metaSource.update(link);

View File

@@ -1,10 +1,10 @@
package net.tccn.base; package net.tccn.base;
import org.redkale.annotation.Resource;
import org.redkale.boot.Application; import org.redkale.boot.Application;
import org.redkale.boot.ApplicationListener; import org.redkale.boot.ApplicationListener;
import org.redkale.util.ResourceFactory; import org.redkale.util.ResourceFactory;
import javax.annotation.Resource;
import java.io.File; import java.io.File;
import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletableFuture;
@@ -13,12 +13,12 @@ import java.util.concurrent.CompletableFuture;
*/ */
public class MetaListenter implements ApplicationListener { public class MetaListenter implements ApplicationListener {
@Resource(name = "property.dataCate") /*@Resource(name = "property.dataCate")
private String dcate; private String dcate;
@Resource(name = "property.dataPath")
private String dataPath;*/
@Resource(name = "property.tplPath") @Resource(name = "property.tplPath")
private String tplPath; private String tplPath;
@Resource(name = "property.dataPath")
private String dataPath;
public static ResourceFactory resourceFactory; public static ResourceFactory resourceFactory;
@@ -29,9 +29,8 @@ public class MetaListenter implements ApplicationListener {
resourceFactory = rf; resourceFactory = rf;
rf.inject(this); rf.inject(this);
MetaKit.dcate = dcate; /*MetaKit.dcate = dcate;
MetaKit.dataPath = dataPath; MetaKit.dataPath = dataPath;*/
MetaKit.init();
TplKit.use(true).addTpl(new File(FileKit.rootPath(), tplPath)); TplKit.use(true).addTpl(new File(FileKit.rootPath(), tplPath));
}); });
} }

View File

@@ -27,13 +27,13 @@ public class MService extends BaseEntity {
@Column(length = 64, comment = "[业务标识]") @Column(length = 64, comment = "[业务标识]")
private String name; private String name;
@Column(length = 15, comment = "[主体表别名]") @Column(updatable = false, length = 15, comment = "[主体表别名]")
private String tablealias; private String tablealias;
@Column(length = 64, comment = "[业务中文名]") @Column(length = 64, comment = "[业务中文名]")
private String comment; private String comment;
@Column(comment = "[平台id]") @Column(updatable = false, comment = "[平台id]")
private Integer platid; private Integer platid;
@Column(comment = "[SHOWS]") @Column(comment = "[SHOWS]")

View File

@@ -43,7 +43,7 @@ public class MTable extends BaseEntity {
@Column(comment = "[状态]0 默认, 9删除'") @Column(comment = "[状态]0 默认, 9删除'")
private int status; private int status;
@Column(comment = "[所属系统平台]") @Column(updatable = false,comment = "[所属系统平台]")
private Integer platid; private Integer platid;
@Column(comment = "[所属数据平台]") @Column(comment = "[所属数据平台]")

View File

@@ -307,7 +307,7 @@ public class MetadataService extends BaseService { //arango
@RestMapping(name = "refresh", comment = "刷新服务端缓存数据") @RestMapping(name = "refresh", comment = "刷新服务端缓存数据")
public JBean refresh() { public JBean refresh() {
JBean jBean = new JBean(); JBean jBean = new JBean();
MetaKit.init(); metaKit.init(null);
return jBean; return jBean;
} }

View File

@@ -3,6 +3,7 @@ package net.tccn.qtask;
import dev.zhub.mk.qtask.QTask; import dev.zhub.mk.qtask.QTask;
import net.tccn.base.BaseService; import net.tccn.base.BaseService;
import net.tccn.base.JBean; import net.tccn.base.JBean;
import net.tccn.base.Utils;
import org.redkale.net.http.RestBody; import org.redkale.net.http.RestBody;
import org.redkale.net.http.RestHeader; import org.redkale.net.http.RestHeader;
import org.redkale.net.http.RestParam; import org.redkale.net.http.RestParam;
@@ -36,9 +37,16 @@ public class _QtaskService extends BaseService {
public RetResult create(@RestHeader(name = "plattoken") String token, public RetResult create(@RestHeader(name = "plattoken") String token,
@RestBody QTask task) { @RestBody QTask task) {
if (Utils.isEmpty(task.getName())) {
return retError("任务KEY 不能为空");
}
if (Utils.isEmpty(task.getTitle())) {
return retError("任务名称 不能为空");
}
FilterNode node = FilterNode.create("name", task.getName()).and("platid", platId(token)); FilterNode node = FilterNode.create("name", task.getName()).and("platid", platId(token));
if (metaSource.exists(QTask.class, node)) { if (metaSource.exists(QTask.class, node)) {
return retError("qtask 标识不能重复"); return retError("任务KEY 不能重复");
} }
task.setPlatid(platId(token)); task.setPlatid(platId(token));

View File

@@ -585,7 +585,7 @@ public class RunTest<T> {
//@Test //@Test
public void dictTest() { public void dictTest() {
MetaKit.init(); // MetaKit.init();
System.out.println("-------- 1 -------"); System.out.println("-------- 1 -------");
DictKit dictKit = DictKit.use("ipsm_v4"); DictKit dictKit = DictKit.use("ipsm_v4");
System.out.println(dictKit.getDictLabel("useSubclass", "3")); System.out.println(dictKit.getDictLabel("useSubclass", "3"));