This commit is contained in:
2024-03-21 18:39:49 +08:00
parent 59585e6369
commit 8cc55c2c4b
3 changed files with 308 additions and 0 deletions

198
root/oth/ddlCompare.html Normal file
View File

@@ -0,0 +1,198 @@
<row class="oth">
<!-- head -->
<!--<div class="col-md-2">
&lt;!&ndash;<h3 v-text="cfg.title"></h3>&ndash;&gt;
</div>-->
<div class="col-xs-2 sheet-cell">
数据源A
<select></select>
<select></select>
<br>
数据源B
<select></select>
<select></select>
<div style="padding-left: 10px;background-color: #ccc;width: 100%"> 实体表(Meta-Table)</div>
<!-- 创建一个空的树,需要包含 .tree CLASS -->
<ul class="tree tree-lines tree-angles" id="myTree" data-ride="tree"></ul>
</div>
<div class="col-md-10">
<div class="input-group pull-right" style="padding-top: 10px">
<a>HAO</a>
</div>
</div>
<div class="col-md-5">
<table class="table table-auto" style="width: 100%">
<tr>
<th>字段</th>
<th>备注</th>
<th>数据类型</th>
<th>默认值</th>
<th>可空</th>
</tr>
<tr>
<td>file_download_num</td>
<td>下载次数</td>
<td>int(11)</td>
<td>0</td>
<td>YES</td>
</tr>
<tr>
<td>xx</td>
<td>xx</td>
<td>xx</td>
<td>xx</td>
<td>xx</td>
</tr>
</table>
</div>
<div class="col-md-5">
<table class="table table-auto" style="width: 100%">
<tr>
<th>字段</th>
<th>备注</th>
<th>数据类型</th>
<th>默认值</th>
<th>可空</th>
</tr>
<tr>
<td>file_download_num</td>
<td>下载次数</td>
<td>int(11)</td>
<td>0</td>
<td>YES</td>
</tr>
<tr>
<td>xx</td>
<td>xx</td>
<td>xx</td>
<td>xx</td>
<td>xx</td>
</tr>
</table>
</div>
<!-- edit.modal -->
<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">金币发放 - [编辑]</h4>
</div>
<div class="modal-body">
<form class="form-horizontal">
<div class="form-group">
<label for="queryId" class="col-md-2 required">选择用户</label>
<div class="col-md-8">
<input v-model="row.name" class="form-control" id="queryId" placeholder="请输入 平台名称">
</div>
</div>
<div class="form-group">
<label for="token" class="col-md-2 required">平台 Token</label>
<div class="col-md-8 col-sm-10">
<input v-model="row.token" class="form-control" id="token" placeholder="请输入 Token">
</div>
</div>
<div class="form-group">
<label for="remark" class="col-md-2">备注</label>
<div class="col-md-8 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(row)" type="button" class="btn btn-primary">确定</button>
</div>
</div>
</div>
</div>
</row>
<script>
var myTreeData = [{"title":"ck","path":"","children":[{"title":"ck.go","path":"D:/wk/_own/go-demo/_hello/ck","children":null},{"title":"ck_test.go","path":"D:/wk/_own/go-demo/_hello/ck","children":null}]},{"title":"cmd","path":"","children":[{"title":"cmd_demo.go","path":"D:/wk/_own/go-demo/_hello/cmd","children":null},{"title":"pack.bat","path":"D:/wk/_own/go-demo/_hello/cmd","children":null},{"title":"pack_linux.bat","path":"D:/wk/_own/go-demo/_hello/cmd","children":null},{"title":"upx.exe","path":"D:/wk/_own/go-demo/_hello/cmd","children":null}]},{"title":"dev-kit","path":"","children":[{"title":"dev_kit.go","path":"D:/wk/_own/go-demo/_hello/dev-kit","children":null}]},{"title":"file-io","path":"","children":[{"title":"file_kit.go","path":"D:/wk/_own/go-demo/_hello/file-io","children":null},{"title":"file_kit_test.go","path":"D:/wk/_own/go-demo/_hello/file-io","children":null},{"title":"file_read_test.go","path":"D:/wk/_own/go-demo/_hello/file-io","children":null},{"title":"file_write_test.go","path":"D:/wk/_own/go-demo/_hello/file-io","children":null},{"title":"pub.txt","path":"D:/wk/_own/go-demo/_hello/file-io","children":null},{"title":"test.txt","path":"D:/wk/_own/go-demo/_hello/file-io","children":null},{"title":"test1.txt","path":"D:/wk/_own/go-demo/_hello/file-io","children":null},{"title":"test2.txt","path":"D:/wk/_own/go-demo/_hello/file-io","children":null}]},{"title":"goroutine","path":"","children":[{"title":"gotoutine_test.go","path":"D:/wk/_own/go-demo/_hello/goroutine","children":null},{"title":"pool_test.go","path":"D:/wk/_own/go-demo/_hello/goroutine","children":null}]},{"title":"interface","path":"","children":[{"title":"interface_test.go","path":"D:/wk/_own/go-demo/_hello/interface","children":null}]},{"title":"net","path":"","children":[{"title":"net-x","path":"","children":[{"title":"UserController.go","path":"D:/wk/_own/go-demo/_hello/net/net-x","children":null},{"title":"a.go","path":"D:/wk/_own/go-demo/_hello/net/net-x","children":null}]},{"title":"net-demo.go","path":"D:/wk/_own/go-demo/_hello/net","children":null},{"title":"net_x.go","path":"D:/wk/_own/go-demo/_hello/net","children":null}]},{"title":"pulsar","path":"","children":[{"title":"pulsar_test.go","path":"D:/wk/_own/go-demo/_hello/pulsar","children":null}]},{"title":"struct","path":"","children":[{"title":"struct-demo.go","path":"D:/wk/_own/go-demo/_hello/struct","children":null}]},{"title":"timer","path":"","children":[{"title":"timer_test.go","path":"D:/wk/_own/go-demo/_hello/timer","children":null}]},{"title":"hello_test.go","path":"D:/wk/_own/go-demo/_hello","children":null}]
let { platList, platSave } = plat
let { filetoken } = tmp
var vm = new Vue({
el: ".oth",
data: {
cfg: {
title: "业务平台 管理",
cols: [
{col: "name", label: "业务名称"},
{col: "token", label: "Token"},
{col: "remark", label: "说明"},
{col: "status", label: "状态", fmt: function (v) {
return {"0":"未启用", "1":"启用", "-1":"删除"}[v] || "";
}},
],
filters: []
},
list: {rows:[], total: 0},
row: {},
content:"",
token: "x"
},
watch: {
},
methods: {
findList () {
platList().then(res => {
vm.list = res
})
},
update: function (kv, row) {
red.post("/meta/save", {
_id: row._id,
doc: JSON.stringify(kv)
}, function (json) {
red.showMsg();
red.putAll(row, kv);
vm.findList();
});
},
edit: function (row) {
vm.row = row;
console.log(this.row);
$('#myModal').modal({moveable: true});
},
save: function (row) {
platSave({plat: row}).then(() => {
red.showMsg({msg: "操作成功"})
$('#myModal').modal('hide')
})
}
},
mounted: function () {
this.findList();
$('#myTree').tree({
data: myTreeData
,itemCreator: function($li, item) {
$li.append($('<a/>', {href: item.url, click: ()=>{
console.log(item.title)
vm.content = item.title
}}).text(item.title));
// return false; // 如果要忽略当前节点,可以通过返回 false 来实现
}
});
filetoken().then(res => {
this.token = res[0]
console.log(this.token)
})
}
});
</script>