<!DOCTYPE html>
|
<html>
|
<head>
|
<meta charset="utf-8"><meta http-equiv="Expires" content="0"><meta http-equiv="Pragma" content="no-cache"><meta http-equiv="Cache-control" content="no-cache"><meta http-equiv="Cache" content="no-cache">
|
<title>页面编辑器</title>
|
<script type="text/javascript">
|
var pageVue = null;
|
function loadJsCss(callback) {
|
var jscss_urls = [];
|
window.top.initJsCss(document, jscss_urls, callback);
|
};
|
|
function initVue() {
|
vue = new BasicsVue({
|
el: "#vbody",
|
data: {
|
dataname: "",
|
row: {},
|
|
testpages: [
|
{code: "p003", name: "表单设计", url: "module/ztest/表单设计.html"},
|
{code: "p001", name: "拖拽测试", url: "module/ztest/拖拽.html"},
|
{code: "p002", name: "画线工具", url: "module/ztest/画线工具.html"},
|
{code: "p004", name: "3D", url: "module/ztest/3D.html"},
|
{code: "p005", name: "缩放", url: "module/ztest/缩放.html"},
|
{code: "p006", name: "大小", url: "module/ztest/大小.html"},
|
{code: "p009", name: "测试", url: "module/ztest/测试.html"},
|
{code: "p007", name: "模板1", url: "module/system/page/sample_new/sample_table.html"},
|
{code: "p008", name: "模板5", url: "module/system/page/sample_new/sample_form_detail.html"},
|
|
|
|
],
|
testpagesobj: {}
|
},
|
created() {
|
var me = this;
|
this.testpages.map(p=>{
|
me.testpagesobj[p.code] = p;
|
})
|
|
},
|
|
mounted() {
|
var me = this;
|
},
|
|
methods:{
|
getDataObjByDataName() {
|
var me = this;
|
//页面信息
|
var params = {
|
dataname: "sys_data_object",
|
filter: "name='" + this.dataname + "'",
|
}
|
|
Server.call("root/data/getEntitySet", params, function(result) {
|
console.log(result);
|
|
if (result && result.data.entityset && result.data.entityset.length == 1) {
|
me.row = result.data.entityset[0];
|
me.editData();
|
}
|
|
});
|
},
|
|
editData() {
|
var me = this;
|
var config = {
|
totab: false, //true: 以Tab导航的方式打开
|
width: "1200px",
|
height: "900px",
|
icon: "icon-product",
|
text: "字段详情",
|
id: "editor_form",//totab: true时需设置,用于判断是否已打开此页面
|
url: "module/system/page/page_editor/popup/editor_form.html",
|
data: me.row,
|
delta: {dataname: me.dataname},
|
sceneCode: "edit",
|
callback: function(obj, callback) {
|
if (callback) {
|
callback();
|
}
|
}
|
};
|
me.doPopupByPublic(config);
|
},
|
|
createObjectMeta() {
|
var me = this;
|
if (!this.dataname) {
|
return
|
}
|
var params = {
|
"dataName": this.dataname
|
}
|
Server.call("root/system/synchronizOneObjectMeta", params, function(result) {
|
console.log(result);
|
Root.message({
|
type: 'success',
|
message: "已生成"
|
});
|
})
|
},
|
|
openPage(val) {
|
var page = this.testpagesobj[val];
|
this.opentestpage(page);
|
},
|
opentestpage(page) {
|
var me = this;
|
|
var config = {
|
totab: false, //true: 以Tab导航的方式打开
|
width: "100vw",
|
height: "100vh",
|
icon: "icon-product",
|
text: page.name,
|
id: "test_" + page.code,//totab: true时需设置,用于判断是否已打开此页面
|
url: page.url,
|
data: {},
|
delta: {},//备案版本,
|
sceneCode: "browse",//"refuseedit",//"approval", //"add"//"browse",
|
callback: function(obj, callback) {
|
if (callback) {
|
callback();
|
}
|
}
|
};
|
me.doPopupByPublic(config);
|
},
|
|
|
}
|
});
|
};
|
|
loadJsCss(function () {
|
initVue();
|
});
|
</script>
|
</head>
|
|
<style>
|
.h_menu {
|
height: 100px;
|
overflow: auto;
|
}
|
</style>
|
|
<body style="margin: 0px;">
|
<div v-cloak id="vbody">
|
<div style="line-height: 40px; padding-left: 10px; padding-right: 10px;">
|
<el-form label-width="80px">
|
<el-form-item label="dataname:">
|
<el-input v-model="dataname" placeholder="要编辑的dataname"></el-input>
|
</el-form-item>
|
</el-form>
|
<div style="text-align: end;">
|
<el-dropdown @command="openPage">
|
<el-button type="primary">
|
更多测试页面<i class="el-icon-arrow-down el-icon--right"></i>
|
</el-button>
|
<el-dropdown-menu slot="dropdown" class="h_menu">
|
<el-dropdown-item v-for="(page, k) in testpages" :key="k" :command="page.code">{{page.name}}</el-dropdown-item>
|
</el-dropdown-menu>
|
</el-dropdown>
|
|
<el-button-group>
|
<el-button size="mini" @click="createObjectMeta">生成字段</el-button>
|
<el-button size="mini" @click="getDataObjByDataName">编辑字段</el-button>
|
</el-button-group>
|
</div>
|
|
</div>
|
</div>
|
</body>
|
</html>
|