This commit is contained in:
2022-11-03 10:58:48 +08:00
parent b78a482d3b
commit b704abcece
23 changed files with 1192 additions and 62 deletions

154
root/oth/file.html Normal file
View File

@@ -0,0 +1,154 @@
<row class="oth">
<!-- head -->
<div class="col-md-11">
<h3 v-text="cfg.title"></h3>
</div>
<div class="col-md-1">
<div class="input-group pull-right" style="padding-top: 10px">
<a>HAO</a>
</div>
</div>
<div class="col-xs-2 sheet-cell">
<div style="padding-left: 10px;background-color: #ccc;width: 100%"> 实体表(Meta-Table)</div>
<!-- 创建一个空的树,需要包含 .tree CLASS -->
<ul class="tree tree-lines tree-folders" id="myTree" data-ride="tree"></ul>
</div>
<div class="col-md-10">
<!--<button @click="edit({})" class="btn btn-primary" type="button"> 用户金币发放 </button>-->
<textarea class="form-control layui-code" rows="10" id="content" placeholder="/* 没有提交要执行的查询 */" v-text="content">
</textarea>
<hr>
<form method="post" action="https://up-z2.qiniup.com" enctype="multipart/form-data">
<input name="token" v-model="token">
<input name="file" type="file"/>
<input type="submit" value="[上传文件]"/>
</form>
</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>