.
This commit is contained in:
9
root/api/tmp.js
Normal file
9
root/api/tmp.js
Normal file
@@ -0,0 +1,9 @@
|
||||
const tmp = {
|
||||
saveData({bean}) {
|
||||
return red.postX('http://oss-v09x.woaihaoyouxi.com/article/batch_import', {bean:JSON.stringify(bean)})
|
||||
},
|
||||
|
||||
search({keyword}) {
|
||||
return red.postX('http://oss-v09x.woaihaoyouxi.com/game/search', {keyword})
|
||||
}
|
||||
}
|
||||
176
root/content/create.html
Normal file
176
root/content/create.html
Normal file
@@ -0,0 +1,176 @@
|
||||
<row class="content-create">
|
||||
<div class="modal-body" style="text-align: left">
|
||||
<form class="form-horizontal">
|
||||
<div class="form-group">
|
||||
<label for="queryId" class="col-sm-1 required">内容类型</label>
|
||||
<div class="col-md-2 col-sm-11">
|
||||
<select class="form-control" v-model="row.type">
|
||||
<option value="1">微动态</option>
|
||||
<option value="2">游戏说</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="form-group" v-show="row.type == 2">
|
||||
<label for="queryId" class="col-sm-1 required">游戏说标题</label>
|
||||
<div class="col-md-6 col-sm-5">
|
||||
<input v-model="row.name" class="form-control" id="queryId" placeholder="请输入 游戏说标题">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" v-show="row.type == 2">
|
||||
<label for="queryId" class="col-sm-1 required">关联的游戏ID</label>
|
||||
<div class="col-md-6 col-sm-5">
|
||||
<input v-model="row.gameids" class="form-control" id="gameids" placeholder="请输入 关联的游戏ID">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group" v-show="row.type == 2">
|
||||
<label for="editor" class="col-md-1">游戏说内容</label>
|
||||
<div class="col-md-11">
|
||||
<div id="editor">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group" v-show="row.type == 1">
|
||||
<label for="editor" class="col-md-1">微动态内容</label>
|
||||
<div class="col-md-11">
|
||||
<textarea v-model="row.content" class="form-control layui-code" rows="10" id="content" placeholder="请输入 微动态内容" > </textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<div class="col-md-11">
|
||||
<div id='myUploader' class="uploader"><!--data-ride="uploader"-->
|
||||
<div class="uploader-message text-center">
|
||||
<div class="content"></div>
|
||||
<button type="button" class="close">×</button>
|
||||
</div>
|
||||
<div class="uploader-files file-list file-list-grid"></div>
|
||||
<div>
|
||||
<hr class="divider">
|
||||
<div class="uploader-status pull-right text-muted"></div>
|
||||
<button type="button" class="btn btn-link uploader-btn-browse" v-show="row.type == 1"><i class="icon icon-plus"></i> 选择微动态图片</button>
|
||||
<button type="button" class="btn btn-link uploader-btn-browse" v-show="row.type == 2"><i class="icon icon-plus"></i> 选择封面</button>
|
||||
<button type="button" class="btn btn-link uploader-btn-start"><i class="icon icon-cloud-upload"></i> 上传图片 </button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
<button @click="saveTable()" type="button" class="btn btn-primary">确定</button>
|
||||
</div>
|
||||
</row>
|
||||
|
||||
<link href="/res/zui/lib/uploader/zui.uploader.min.css" rel="stylesheet">
|
||||
<script src="/res/zui/lib/uploader/zui.uploader.min.js"></script>
|
||||
|
||||
<script src="/res/wangEditor/wangEditor.min.js"></script>
|
||||
<script>
|
||||
let {saveData} = tmp
|
||||
let vm = new Vue({
|
||||
el: ".content-create",
|
||||
data: {
|
||||
row: {
|
||||
type:2,
|
||||
files: [],
|
||||
cover: ""
|
||||
},
|
||||
vediter : {}
|
||||
|
||||
},
|
||||
watch: {
|
||||
|
||||
},
|
||||
methods: {
|
||||
saveTable() {
|
||||
let html = this.vediter.txt.html()
|
||||
if(vm.row['type'] == 2) {
|
||||
this.row['content'] = html
|
||||
}
|
||||
saveData({bean: this.row}).then(res => {
|
||||
if (res.retcode == 0) {
|
||||
red.showOk("保存成功");
|
||||
setTimeout(function () {
|
||||
location.reload();
|
||||
}, 600)
|
||||
|
||||
} else {
|
||||
red.showError(res.retinfo);
|
||||
}
|
||||
})
|
||||
},
|
||||
buildEditer(key){
|
||||
let E = window.wangEditor
|
||||
let editor = new E('#editor')
|
||||
editor.customConfig.uploadImgServer = '/upload/editor?cate=editor'
|
||||
|
||||
let cache_key = key+"_" + $("input[name='contentid']").val()
|
||||
let html = localStorage.getItem(cache_key)
|
||||
|
||||
editor.customConfig.onblur = function (html) {
|
||||
localStorage.setItem(cache_key, html)
|
||||
}
|
||||
|
||||
editor.create()
|
||||
|
||||
//if (html) editor.txt.html(html)//缓存的内容
|
||||
|
||||
return editor
|
||||
}
|
||||
},
|
||||
mounted: function () {
|
||||
this.vediter = this.buildEditer("11");
|
||||
$('#myUploader').uploader({
|
||||
url: '/upload/x',
|
||||
responseHandler: function (res, f) {
|
||||
let file = JSON.parse(res.response)["body"][0];
|
||||
let filepath = file["filePath"]
|
||||
console.log(file)
|
||||
if (vm.row['type'] == 2) {
|
||||
vm.row['cover'] = filepath
|
||||
} else {
|
||||
vm.row.files.push(filepath)
|
||||
}
|
||||
},
|
||||
lang: 'zh_cn'
|
||||
/*filters: {
|
||||
mime_types: [
|
||||
{title: 'Excel文件', extensions: ''},
|
||||
],
|
||||
prevent_duplicates: true
|
||||
}*/
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
/*function buildEditer(key){
|
||||
let E = window.wangEditor
|
||||
let editor = new E('#editor')
|
||||
editor.customConfig.uploadImgServer = '/upload/img'
|
||||
|
||||
let cache_key = key+"_" + $("input[name='contentid']").val()
|
||||
let html = localStorage.getItem(cache_key)
|
||||
|
||||
editor.customConfig.onblur = function (html) {
|
||||
localStorage.setItem(cache_key, html)
|
||||
}
|
||||
|
||||
editor.create()
|
||||
|
||||
if (html) editor.txt.html(html)//缓存的内容
|
||||
|
||||
return editor
|
||||
}*/
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
163
root/content/funs.html
Normal file
163
root/content/funs.html
Normal file
@@ -0,0 +1,163 @@
|
||||
<row class="funs">
|
||||
<div class="col-md-12">
|
||||
<h3 >平台功能</h3>
|
||||
</div>
|
||||
|
||||
<div class="col-md-12" style="padding-top: 10px;overflow:auto;">
|
||||
<table class="table table-bordered table-hover" style="width: 100%">
|
||||
<!--<thead>
|
||||
<tr>
|
||||
<th v-for="field in cfg.cols" v-text="field.label"></th>
|
||||
<th>操作</th>
|
||||
</tr>
|
||||
</thead>-->
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>用户</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>文章</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>游戏</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>全文检索</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>IM</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>通知</td>
|
||||
</tr>
|
||||
|
||||
<!--<tr v-for="row in list.rows">
|
||||
<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="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>-->
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<div v-show="!row || list.rows == 0" style="text-align: center">
|
||||
<img src="../res/img/none.png">
|
||||
<p>暂无数据</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- modal-tpl -->
|
||||
<!--<div class="col-md-12">
|
||||
<!– 对话框触发按钮 –>
|
||||
<!– 对话框HTML –>
|
||||
<div class="modal fade" id="myModal">
|
||||
<div class="modal-dialog">
|
||||
<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">QTask编辑</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form class="form-horizontal">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 required">任务名称</label>
|
||||
<div class="col-md-6 col-sm-10">
|
||||
<input v-model="row.title" class="form-control" placeholder="请输入 业务名称">
|
||||
</div>
|
||||
</div>
|
||||
<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="请输入 任务标识码">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" style="margin-bottom: 0">
|
||||
<label class="col-md-2 required">执行内容</label>
|
||||
<div class="col-md-10">
|
||||
<textarea v-model="row.content" class="form-control layui-code" rows="5" placeholder="请输入 SQL (支持jfinal-enjoy模板语法)" > </textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="para" class="col-sm-2">默认查询参数</label>
|
||||
<div class="col-sm-10">
|
||||
<input v-model="row.para" class="form-control" id="para" placeholder="请输入 默认查询参数格式: {k:v}">
|
||||
</div>
|
||||
</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">
|
||||
<option></option>
|
||||
<option v-for="item in dbPlats" :value="item.key" v-text="item.name"></option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<select v-model="row.catalog" class="form-control">
|
||||
<option></option>
|
||||
<option v-for="item in catalogs()" :value="item" v-text="item"></option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="para" class="col-sm-2">备注(注释)</label>
|
||||
<div class="col-sm-10">
|
||||
<input v-model="row.remark" class="form-control" id="remark" placeholder="请输入 备注">
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</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>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!– 小对话框 –>
|
||||
<!–<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#mySmModal">小对话框</button>–>
|
||||
<div class="modal fade" id="mySmModal">
|
||||
<div class="modal-dialog modal-sm">
|
||||
<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-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
|
||||
<button @click="save()" type="button" class="btn btn-primary">确定</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>-->
|
||||
</row>
|
||||
<script>
|
||||
let {search} = tmp
|
||||
let vm = new Vue({
|
||||
el: ".funs",
|
||||
data: {
|
||||
cfg:{},
|
||||
keyword: "",
|
||||
list: {rows:[], total: 0},
|
||||
row: {},
|
||||
},
|
||||
watch: {
|
||||
|
||||
},
|
||||
methods: {
|
||||
search() {
|
||||
if (!this.keyword) {
|
||||
red.showError("输入有效关键字查询")
|
||||
}
|
||||
search({keyword: this.keyword}).then(rs => {
|
||||
this.list = {rows: rs, total: rs.length}
|
||||
})
|
||||
}
|
||||
},
|
||||
mounted: function () {
|
||||
// this.loadList();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
162
root/content/list.html
Normal file
162
root/content/list.html
Normal file
@@ -0,0 +1,162 @@
|
||||
<row class="content-list">
|
||||
<div class="col-md-12">
|
||||
<h3 v-text="cfg.title"></h3>
|
||||
</div>
|
||||
|
||||
<div class="col-md-12 ">
|
||||
<!--<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="search({})" class="btn btn-primary" type="button"> 查询</button>
|
||||
<!--<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%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th v-for="field in cfg.cols" v-text="field.label"></th>
|
||||
<th>操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="row in list.rows">
|
||||
<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="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>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<div v-show="!row || list.rows == 0" style="text-align: center">
|
||||
<img src="../res/img/none.png">
|
||||
<p>暂无数据</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- modal-tpl -->
|
||||
<!--<div class="col-md-12">
|
||||
<!– 对话框触发按钮 –>
|
||||
<!– 对话框HTML –>
|
||||
<div class="modal fade" id="myModal">
|
||||
<div class="modal-dialog">
|
||||
<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">QTask编辑</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form class="form-horizontal">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 required">任务名称</label>
|
||||
<div class="col-md-6 col-sm-10">
|
||||
<input v-model="row.title" class="form-control" placeholder="请输入 业务名称">
|
||||
</div>
|
||||
</div>
|
||||
<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="请输入 任务标识码">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" style="margin-bottom: 0">
|
||||
<label class="col-md-2 required">执行内容</label>
|
||||
<div class="col-md-10">
|
||||
<textarea v-model="row.content" class="form-control layui-code" rows="5" placeholder="请输入 SQL (支持jfinal-enjoy模板语法)" > </textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="para" class="col-sm-2">默认查询参数</label>
|
||||
<div class="col-sm-10">
|
||||
<input v-model="row.para" class="form-control" id="para" placeholder="请输入 默认查询参数格式: {k:v}">
|
||||
</div>
|
||||
</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">
|
||||
<option></option>
|
||||
<option v-for="item in dbPlats" :value="item.key" v-text="item.name"></option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<select v-model="row.catalog" class="form-control">
|
||||
<option></option>
|
||||
<option v-for="item in catalogs()" :value="item" v-text="item"></option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="para" class="col-sm-2">备注(注释)</label>
|
||||
<div class="col-sm-10">
|
||||
<input v-model="row.remark" class="form-control" id="remark" placeholder="请输入 备注">
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</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>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!– 小对话框 –>
|
||||
<!–<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#mySmModal">小对话框</button>–>
|
||||
<div class="modal fade" id="mySmModal">
|
||||
<div class="modal-dialog modal-sm">
|
||||
<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-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
|
||||
<button @click="save()" type="button" class="btn btn-primary">确定</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>-->
|
||||
</row>
|
||||
<script src="http://www.1216.top/res/layui/layui.js"></script>
|
||||
<script>
|
||||
let {search} = tmp
|
||||
let vm = new Vue({
|
||||
el: ".qtask-list",
|
||||
data: {
|
||||
keyword: "",
|
||||
list: {rows:[], total: 0},
|
||||
row: {},
|
||||
},
|
||||
watch: {
|
||||
|
||||
},
|
||||
methods: {
|
||||
search() {
|
||||
if (!this.keyword) {
|
||||
red.showError("输入有效关键字查询")
|
||||
}
|
||||
search({keyword: this.keyword}).then(rs => {
|
||||
this.list = {rows: rs, total: rs.length}
|
||||
})
|
||||
}
|
||||
},
|
||||
mounted: function () {
|
||||
// this.loadList();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
@@ -82,13 +82,14 @@
|
||||
<script src="/api/db.js"></script>
|
||||
<script src="/api/table.js"></script>
|
||||
<script src="/api/dict.js"></script>
|
||||
<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 type="module">
|
||||
import { logout } from './api/user.js'
|
||||
let { refresh } = meta
|
||||
let { platList } = plat
|
||||
var vm = new Vue({
|
||||
let vm = new Vue({
|
||||
el: ".container-fluid",
|
||||
data: {
|
||||
sysPlat: red.getData('sysPlat'),
|
||||
@@ -97,12 +98,15 @@
|
||||
/*{name: "DDL", url: "/qtask/ddl.html"},*/
|
||||
{name: "元服务", url: "/meta", nodes: [
|
||||
/*{url:"/metadata/metatable/list.html", name:"TableList"},*/
|
||||
{url:"/metadata/metatable/metaTable.html", name:"实体管理", icon: "icon-table"},
|
||||
{url:"/metadata/metatable/metaTable.html", name:"实体管理", icon: "icon-cubes"},
|
||||
/*{url:"/metadata/metatable/import.html", name:"导入实体"},*/
|
||||
{url:"/metadata/metaLink.html", name:"实体关系"},
|
||||
{url:"/metadata/metaService.html", name:"业务管理", icon:"icon-usecase"},
|
||||
{url:"/metadata/dataList.html", name:"业务预览", icon:"icon-bug"},
|
||||
{url:"/metadata/dict.html", name:"字典管理", icon:"icon-usecase"},
|
||||
{url:"/metadata/metaLink.html", name:"实体关系", icon:"icon-branch"},
|
||||
{url:"/metadata/metaService.html", name:"业务管理", icon: "icon-sliders"},
|
||||
{url:"/metadata/dataList.html", name:"业务预览", icon:"icon-window-alt"},
|
||||
/*{url:"/metadata/dict.html", name:"字典管理", icon:"icon-usecase"},*/
|
||||
{url:"/content/create.html", name:"内容管理", icon:"icon-edit-sign"},
|
||||
/*{url:"/content/list.html", name:"游戏查询", icon:"icon-usecase"},
|
||||
{url:"/content/funs.html", name:"平台功能", icon:"icon-usecase"},*/
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -111,11 +115,11 @@
|
||||
{url:"/qtask/debug.html", name:"QTask-Debug", icon:"icon-bug"},
|
||||
]
|
||||
},
|
||||
{
|
||||
/*{
|
||||
name: "其他服务", url: "/plat/db.html", nodes: [
|
||||
{url:"/plat/db.html", name:"文件服务", icon: "icon-database"},
|
||||
]
|
||||
},
|
||||
},*/
|
||||
{
|
||||
name: "业务平台", url: "/qtask", nodes: [
|
||||
{url:"/plat/index.html", name:"业务平台", icon:"icon-server"},
|
||||
@@ -172,7 +176,14 @@
|
||||
this.pageId = item.name;
|
||||
},
|
||||
refresh() {
|
||||
refresh().then(res => red.showOk())
|
||||
refresh().then(res => {
|
||||
platList().then(res => { // 刷新平台列表缓存
|
||||
let rows = res.rows
|
||||
this.sysPlats = rows;
|
||||
red.setData("sysPlats", rows);
|
||||
})
|
||||
red.showOk()
|
||||
})
|
||||
},
|
||||
logout() {
|
||||
logout()
|
||||
@@ -184,7 +195,7 @@
|
||||
this.pageId = red.getData("pageId", this.page['mame'])
|
||||
//绑定事件
|
||||
$('.menu .nav').on('click', 'li:not(.nav-parent) > a', function() {
|
||||
var $this = $(this);
|
||||
let $this = $(this);
|
||||
$('.menu .nav .active').removeClass('active');
|
||||
$this.closest('li').addClass('active');
|
||||
$this.closest('.nav-parent').addClass('active');
|
||||
@@ -195,7 +206,7 @@
|
||||
|
||||
//监听浏览器窗口大小变化
|
||||
function autoLeftHeight() {
|
||||
var h = document.documentElement.clientHeight || document.body.clientHeight;
|
||||
let h = document.documentElement.clientHeight || document.body.clientHeight;
|
||||
$("#left").attr("style", "height:" + (h - 50) + "px");
|
||||
$("#main").attr("style", "height:" + (h - 90) + "px; overflow: auto;");
|
||||
$(".sheet-cell").attr("style", "height:" + (h - 265) + "px;margin-bottom:20px;");
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
<div style="padding-left: 10px;background-color: #ccc;width: 100%"> 业务列表(Meta-Service)</div>
|
||||
<ul class="nav nav-tabs nav-stacked tlist" style="height: 100%">
|
||||
<li :class="['clearfix',{'active':service==item.alias}]" v-for="item in services" >
|
||||
<a @click="service=item.name" :title="`${item.name}`" v-text="`${item.name} [${item.comment}]`" href="javascript:;"></a>
|
||||
<a @click="service=item.name" :title="`${item.name}`" v-text="`【${item.comment}】`" href="javascript:;"></a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
@@ -55,9 +55,9 @@
|
||||
|
||||
<!-- 过滤条件 -->
|
||||
<div class="col-lg-4 col-md-6" v-for="(filter,index) in cfg.filters" v-if="filter.checked">
|
||||
<div class="input-group item">
|
||||
<span class="input-group-addon" style="width: 130px;">{{filter.label}}</span>
|
||||
<select class="form-control" v-model="filter['type']" style="width: 100px">
|
||||
<div class="input-group item" style="padding-top: 3px">
|
||||
<span class="input-group-addon" style="max-width: 130px;">{{filter.label}}</span>
|
||||
<select class="form-control" v-model="filter['type']" style="width: 95px;">
|
||||
<option v-for="(t, i) in filter.filterType" :value="t.name" v-text="t.remark"></option>
|
||||
</select>
|
||||
<span class="input-group-addon fix-border fix-padding"></span>
|
||||
@@ -236,7 +236,7 @@
|
||||
|
||||
let {getServiceList, getCfg, getDataList, exportData, dataDel, dataSave} = meta
|
||||
let {showOk} = red
|
||||
var vm = new Vue({
|
||||
let vm = new Vue({
|
||||
el:".data-list",
|
||||
data: {
|
||||
cfg: {
|
||||
@@ -252,7 +252,7 @@
|
||||
addFilter: "",
|
||||
para: {},
|
||||
list: {rows: [], total: 0},
|
||||
limit: {pn: 1, ps: 10, total: 0},
|
||||
limit: {pn: 1, ps: 20, total: 0},
|
||||
order: {col: "id", desc: 1},
|
||||
pk: "",
|
||||
detailData: {}
|
||||
@@ -268,7 +268,7 @@
|
||||
},
|
||||
service() {
|
||||
this.loadCfg();
|
||||
this.limit = {pn: 1, ps: 10, total: 0};
|
||||
this.limit = {pn: 1, ps: 20, total: 0};
|
||||
this.order = {col:"", desc:1};
|
||||
this.findList();
|
||||
},
|
||||
@@ -301,7 +301,7 @@
|
||||
},
|
||||
loadCfg() {
|
||||
getCfg({name: this.service}).then(res => {
|
||||
res['type'] = res.filters[0]['name']
|
||||
// res['type'] = res.filters[0]['name']
|
||||
|
||||
for (i in res["filters"]) {
|
||||
res["filters"][i]['type'] = res["filters"][i]['filterType'][0]['name']
|
||||
@@ -311,59 +311,28 @@
|
||||
},
|
||||
dealFieldFmt(bean, colFmt) { //处理字典数据 及 自定义函数处理数据
|
||||
|
||||
let v = ""
|
||||
|
||||
let v = bean[colFmt["col"]]
|
||||
if (colFmt.inType == "DICT") {
|
||||
// 取字典值返回
|
||||
v = bean[colFmt["col"]]
|
||||
}
|
||||
else if (colFmt.inType == "INPUT_DAY") {
|
||||
|
||||
v = bean[colFmt["col"]]
|
||||
}
|
||||
else if (colFmt.inType == "INPUT_TIME") {
|
||||
|
||||
v = bean[colFmt["col"]]
|
||||
// 时间戳格式化
|
||||
return red.timeFmt(new Date(v))
|
||||
}
|
||||
else if (colFmt.inType == "INPUT_FUNC") {
|
||||
|
||||
v = bean[colFmt["col"]]
|
||||
}
|
||||
else if (colFmt.inType == "FILE" && v) {
|
||||
return '<a href="{0}" target="_blank">查看</a>'.format(v)
|
||||
}
|
||||
else {
|
||||
v = bean[colFmt["col"]]
|
||||
}
|
||||
|
||||
if (colFmt.inType && colFmt.inType != "INPUT") {
|
||||
v += " -> "+colFmt.inType
|
||||
}
|
||||
|
||||
return v
|
||||
|
||||
/*if (colFmt["fmt"]) {
|
||||
let fmt = colFmt["fmt"]
|
||||
let cate = ""
|
||||
if (fmt.indexOf("|") > 0) {
|
||||
cate = fmt.split("|")[0]
|
||||
fmt = fmt.split("|")[1]
|
||||
}
|
||||
|
||||
if (cate == "Dict") {
|
||||
//console.log(`Dict:${fmt}-${bean[colFmt["col"]]}`)
|
||||
}
|
||||
else {
|
||||
//console.log(`func:${fmt}-${bean[colFmt["col"]]}`)
|
||||
|
||||
let evl = `${fmt}(${JSON.stringify(bean)},'${bean[colFmt["col"]]}')`
|
||||
//console.log("evl", evl)
|
||||
return (new Function("","return "+ evl))()
|
||||
}
|
||||
|
||||
return bean[colFmt["col"]];
|
||||
|
||||
} else {
|
||||
//console.log(`k-v:${colFmt["col"]}-${bean[colFmt["col"]]}`)
|
||||
return bean[colFmt["col"]]
|
||||
}*/
|
||||
},
|
||||
dealField(bean, field) {
|
||||
let str = "";
|
||||
@@ -438,12 +407,12 @@
|
||||
let orders = [];
|
||||
//截取真实字段名,(考虑如果多表关联情况,是否需要加入真实字段名)
|
||||
if (vm.order.col) {
|
||||
var end = vm.order.col.indexOf("\|");
|
||||
let end = vm.order.col.indexOf("\|");
|
||||
if (end < 0) {
|
||||
end = vm.order.col.indexOf("=")
|
||||
}
|
||||
|
||||
var col = vm.order.col;
|
||||
let col = vm.order.col;
|
||||
if (end > 0) {
|
||||
col = vm.order.col.substring(0, end);
|
||||
}
|
||||
@@ -497,4 +466,4 @@
|
||||
this.serviceList();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</script>
|
||||
|
||||
@@ -527,7 +527,7 @@
|
||||
EQUAL:"等于", NOTEQUAL:"不等于", IN: "包含", NOTIN:"不包含", LIKE: "模糊查询", RANGE: "范围"
|
||||
},
|
||||
findTypes: ["INPUT", "DICT", "CHECKBOX", "RADIO", "DAY", "TIME"],
|
||||
inTypes: ["INPUT", "DICT", "INPUT_DAY", "INPUT_TIME", "FUNC", "QTASK", "HIDDEN"],
|
||||
inTypes: ["INPUT", "DICT", "INPUT_DAY", "INPUT_TIME", "FUNC", "QTASK", "HIDDEN", "FILE"],
|
||||
ckTypes: [{label:"必填", name: "NOTNULL"},{label:"IP", name: "IP"},{label:"IPv4", name: "IPv4"},{label:"电话号码", name: "phone"}],
|
||||
dataTypes: ["bigint(20)", "varchar(255)", "varchar(64)", "varchar(32)", "varchar(16)", "int(11)", "int(3)", "int(2)", "datetime"],
|
||||
filterCate: ["EQUAL", "NOTEQUAL", "LIKE", "IN"],
|
||||
@@ -1102,4 +1102,4 @@
|
||||
}
|
||||
});
|
||||
|
||||
</script>
|
||||
</script>
|
||||
|
||||
@@ -60,45 +60,50 @@
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<!-- 实体表信息 -->
|
||||
<div class="col-md-10" v-show="status!=7 && status!=8">
|
||||
<div style="padding-left: 10px;background-color: #ccc;width: 100%"> 实体字段信息</div>
|
||||
<table :class="[{'table':status!=2},'table-bordered']" style="width: 100%">
|
||||
<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>
|
||||
<th>字段名</th>
|
||||
<th>中文名</th>
|
||||
<th>数据类型</th>
|
||||
<!--
|
||||
<th>输入类型</th>
|
||||
<th>附加属性</th>
|
||||
-->
|
||||
<th>主键</th>
|
||||
</tr>
|
||||
<tr v-for="(item, index) in meta.items" class="item">
|
||||
<td v-show="status==1" class="icon icon-move"></td>
|
||||
<td v-show="status!=2" v-text="item.name" style="background-color: rgb(235, 235, 228);"></td>
|
||||
<td v-show="status!=2" v-text="item.label"></td>
|
||||
<td v-show="status!=2" v-text="item.type"></td>
|
||||
<!--
|
||||
<td v-show="status!=2" v-text="item.inType"></td>
|
||||
<td v-show="status!=2" v-text="item.inExt"></td>
|
||||
-->
|
||||
<td v-show="status!=2">
|
||||
<i v-if="item.pk" class="icon icon-check"></i>
|
||||
</td>
|
||||
<div class="col-md-10">
|
||||
<!-- 实体属性列表 -->
|
||||
<div class="panel" v-show="status!=7 && status!=8">
|
||||
<div style="padding-left: 10px;background-color: #ccc;width: 100%"> 实体字段信息</div>
|
||||
<table :class="[{'table':status!=2},'table-bordered']" style="width: 100%">
|
||||
<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>
|
||||
<th>字段名</th>
|
||||
<th>中文名</th>
|
||||
<th>数据类型</th>
|
||||
<!--
|
||||
<th>输入类型</th>
|
||||
<th>附加属性</th>
|
||||
-->
|
||||
<th>非空</th>
|
||||
<th>主键</th>
|
||||
</tr>
|
||||
<tr v-for="(item, index) in meta.items" class="item">
|
||||
<td v-show="status==1" class="icon icon-move"></td>
|
||||
<td v-show="status!=2" v-text="item.name" style="background-color: rgb(235, 235, 228);"></td>
|
||||
<td v-show="status!=2" v-text="item.label"></td>
|
||||
<td v-show="status!=2" v-text="item.type"></td>
|
||||
<!--
|
||||
<td v-show="status!=2" v-text="item.inType"></td>
|
||||
<td v-show="status!=2" v-text="item.inExt"></td>
|
||||
-->
|
||||
<td v-show="status!=2">
|
||||
<i v-if="item.notNull" class="icon icon-check"></i>
|
||||
</td>
|
||||
<td v-show="status!=2">
|
||||
<i v-if="item.pk" class="icon icon-check"></i>
|
||||
</td>
|
||||
|
||||
<td v-show="status==2">
|
||||
<input type="hidden" name="item" :value="JSON.stringify(item)">
|
||||
<input v-model="item" type="hidden">
|
||||
<input :value="item.name" disabled class="form-control">
|
||||
<input v-model="item.name" type="hidden">
|
||||
<input name="name" type="hidden" :value="item.name">
|
||||
</td>
|
||||
<td v-show="status==2"><input v-model="item.label" class="form-control"></td>
|
||||
<td v-show="status==2"><input v-model="item.type" class="form-control"></td>
|
||||
<!--
|
||||
<td v-show="status==2">
|
||||
<input type="hidden" name="item" :value="JSON.stringify(item)">
|
||||
<input v-model="item" type="hidden">
|
||||
<input :value="item.name" disabled class="form-control">
|
||||
<input v-model="item.name" type="hidden">
|
||||
<input name="name" type="hidden" :value="item.name">
|
||||
</td>
|
||||
<td v-show="status==2"><input v-model="item.label" class="form-control"></td>
|
||||
<td v-show="status==2"><input v-model="item.type" class="form-control"></td>
|
||||
<!--
|
||||
<td v-show="status==2">
|
||||
<select v-model="item.inType" class="form-control" style="width: 130px">
|
||||
<option></option>
|
||||
@@ -107,16 +112,19 @@
|
||||
</td>
|
||||
<td v-show="status==2"><input v-model="item.inExt" class="form-control"></td>
|
||||
-->
|
||||
<td v-show="status==2" style="text-align: center">
|
||||
<label>
|
||||
<input v-model="item.pk" type="checkbox">
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="col-md-10">
|
||||
<td v-show="status==2" style="text-align: center">
|
||||
<label>
|
||||
<input v-model="item.notNull" type="checkbox">
|
||||
</label>
|
||||
</td>
|
||||
<td v-show="status==2" style="text-align: center">
|
||||
<label>
|
||||
<input v-model="item.pk" type="checkbox">
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<!-- baseInfo -->
|
||||
<div class="panel" v-show="status==7 ">
|
||||
@@ -166,6 +174,12 @@
|
||||
|
||||
<p style="padding: 5px">整理中,【实体关系】放到此处维护</p>
|
||||
</div>
|
||||
|
||||
<textarea class="form-control layui-code" v-model="upsql" rows="10" id="content" placeholder="/* 没有提交要执行的查询 */" />
|
||||
</div>
|
||||
|
||||
<div class="col-md-10">
|
||||
|
||||
</div>
|
||||
|
||||
</row>
|
||||
@@ -175,10 +189,10 @@
|
||||
let {showOk} = red
|
||||
let {dbList} = plat
|
||||
|
||||
var vm = new Vue({
|
||||
let vm = new Vue({
|
||||
el: ".meta-list",
|
||||
data: {
|
||||
inTypes: ["INPUT", "SELECT_EXT", "INPUT_DT", "FMT_FUN"],
|
||||
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"],
|
||||
tables: [],//所有的业务类型,【测试用】
|
||||
@@ -199,6 +213,8 @@
|
||||
dbPlats:[],
|
||||
row: {key: "", platId: "", dbPlatId:"", catalog: "", name:"", comment:"", alias: ""},
|
||||
filter: {db: "", catalog: "", name: ""},//tableList 过滤条件
|
||||
|
||||
upsql: "", // 需要执行的 sql语句
|
||||
},
|
||||
watch: {
|
||||
metaTable(v) {
|
||||
@@ -207,6 +223,7 @@
|
||||
},
|
||||
status: function (v) {
|
||||
this.setMove(v)
|
||||
this.upsql = ''
|
||||
},
|
||||
alias: function () {
|
||||
this.loadDetail();
|
||||
@@ -217,7 +234,7 @@
|
||||
let itemOv = this.oldItems || [];
|
||||
if (itemOv.length == 0) return;
|
||||
|
||||
let attr = ["label", "name", "pk", "type", "inType","inExt"];
|
||||
let attr = ["label", "name", "pk", "type", "inType","inExt", 'notNull'];
|
||||
let itemEdit = [];
|
||||
a:for (let i = 0; i < itemOv.length; i++) {
|
||||
for (let j = 0; j < attr.length; j++) {
|
||||
@@ -243,6 +260,33 @@
|
||||
//vm.table = v[0]["name"];
|
||||
}
|
||||
},
|
||||
|
||||
// 基础信息变更 sql
|
||||
row: {
|
||||
handler: function (row) {
|
||||
//console.log(vm.metaTable.name, " -> ",v.name)
|
||||
vm.upsql = ''
|
||||
if (vm.metaTable.name != row.name) {
|
||||
vm.upsql += 'RENAME TABLE `{0}`.`{1}` TO `{2}`.`{3}`;\n'.format(vm.metaTable.catalog, vm.metaTable.name, vm.metaTable.catalog, row.name)
|
||||
}
|
||||
if (vm.metaTable.comment != row.comment) {
|
||||
vm.upsql += 'ALTER TABLE `{0}`.`{1}` COMMENT=\'{2}\';\n'.format(vm.metaTable.catalog, vm.metaTable.name, row.comment)
|
||||
}
|
||||
},
|
||||
deep: true
|
||||
},
|
||||
|
||||
// 属性表更 sql
|
||||
itemEdit: {
|
||||
handler: function (items) {
|
||||
// vm.upsql = 'ALTER TABLE `{0}`.`{1}'.format()
|
||||
/*`
|
||||
CHANGE `rankcate` `rankcate` VARCHAR(64) CHARSET utf8 COLLATE utf8_general_ci DEFAULT '' NOT NULL COMMENT '[排行类型]',
|
||||
CHANGE `remark` `remark1` VARCHAR(128) CHARSET utf8 COLLATE utf8_general_ci DEFAULT '' NOT NULL COMMENT '[说明]';*/
|
||||
|
||||
},
|
||||
deep: true
|
||||
},
|
||||
meta: function (v) {
|
||||
this.row = {key:v.key, dbPlatId: v.dbPlatId, catalog: v.catalog, name:v.name, comment:v.comment, alias: v.alias};
|
||||
let oldItems = v['items'] || []
|
||||
@@ -253,6 +297,7 @@
|
||||
methods: {
|
||||
loadDetail() {
|
||||
tableInfo({alias: this.alias}).then(res => {
|
||||
this.metaTable = res
|
||||
let row = res;
|
||||
vm.meta = row;
|
||||
let oldItems = [];
|
||||
@@ -422,14 +467,22 @@
|
||||
},
|
||||
showInfo() {
|
||||
$('#f-info').modal({moveable: true})
|
||||
}
|
||||
},
|
||||
buildSql() {
|
||||
|
||||
}
|
||||
},
|
||||
mounted: function (){
|
||||
dbList().then(res => {
|
||||
this.dbPlats = res.rows;
|
||||
})
|
||||
this.tableList();
|
||||
|
||||
/*setTimeout(function () {
|
||||
layui.use('code', function(){ //加载code模块
|
||||
layui.code({title:"",about: false, height: "500"}); //引用code方法
|
||||
});
|
||||
}, 300)*/
|
||||
}
|
||||
});
|
||||
</script>
|
||||
@@ -67,7 +67,7 @@
|
||||
let {qtaskList, qtaskDebug} = qtask
|
||||
let {dbList} = plat
|
||||
|
||||
var vm = new Vue({
|
||||
let vm = new Vue({
|
||||
el: ".qtask-debug",
|
||||
data: {
|
||||
row: {},
|
||||
|
||||
@@ -44,10 +44,10 @@ body {
|
||||
}
|
||||
#left.col-md-1 {
|
||||
padding: 0 2px;
|
||||
width: 10.63333333%;
|
||||
width: 10.64%;
|
||||
}
|
||||
#mainDiv .col-md-11 {
|
||||
width: 89.36666667%;
|
||||
width: 89.36%;
|
||||
/*background-color: #fff;*/
|
||||
}
|
||||
#left .nav {
|
||||
@@ -102,7 +102,7 @@ table td,th{
|
||||
white-space:nowrap;
|
||||
overflow:hidden;
|
||||
text-overflow: ellipsis;
|
||||
max-width: 200px;
|
||||
max-width: 173px;
|
||||
}
|
||||
th{
|
||||
background-color: #f1f1f1;
|
||||
|
||||
@@ -40,12 +40,12 @@ var red = {
|
||||
},
|
||||
getPlatToken: function() {
|
||||
let plat = red.getData("sysPlat");
|
||||
if (!plat) {
|
||||
/*if (!plat) {
|
||||
red.showMsg({type:'error', placement: 'center', msg: '登陆过期,请前往登陆'});
|
||||
setTimeout(function () {
|
||||
location.href = "/user/login.html";
|
||||
}, 2000);
|
||||
}
|
||||
}*/
|
||||
return plat["token"];
|
||||
},
|
||||
getJSON: function (url, params = {}, callback) {
|
||||
@@ -211,4 +211,4 @@ var red = {
|
||||
|
||||
String.prototype.replaceAll=function(s,t){
|
||||
return red.replaceAll(this, s, t);
|
||||
}
|
||||
}
|
||||
|
||||
BIN
root/res/wangEditor/fonts/w-e-icon.woff
Normal file
BIN
root/res/wangEditor/fonts/w-e-icon.woff
Normal file
Binary file not shown.
411
root/res/wangEditor/wangEditor.css
Normal file
411
root/res/wangEditor/wangEditor.css
Normal file
File diff suppressed because one or more lines are too long
4674
root/res/wangEditor/wangEditor.js
Normal file
4674
root/res/wangEditor/wangEditor.js
Normal file
File diff suppressed because one or more lines are too long
1
root/res/wangEditor/wangEditor.min.css
vendored
Normal file
1
root/res/wangEditor/wangEditor.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
4
root/res/wangEditor/wangEditor.min.js
vendored
Normal file
4
root/res/wangEditor/wangEditor.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
root/res/wangEditor/wangEditor.min.js.map
Normal file
1
root/res/wangEditor/wangEditor.min.js.map
Normal file
File diff suppressed because one or more lines are too long
@@ -107,9 +107,9 @@
|
||||
<script src="../res/libs/vue.min.js"></script>
|
||||
<script type="module">
|
||||
import { login } from '../api/user.js'
|
||||
let { platList } = plat;
|
||||
let { platList } = plat
|
||||
|
||||
var vm = new Vue({
|
||||
let vm = new Vue({
|
||||
el: ".login",
|
||||
data: {
|
||||
row:{},
|
||||
|
||||
Reference in New Issue
Block a user