<!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() {
|
new ListVue({
|
el: "#vbody",
|
data: {
|
dataname: "",
|
title: "表单编辑字段设置弹窗",
|
pageAttr: {
|
heightType: "popuppage"
|
},
|
delta: {},
|
orderby: "",
|
tableAttr: {
|
isborder: true
|
},
|
filterfieldClick: {},
|
tablefieldClick: {},
|
formfieldClick: {},
|
tableHeight: 0,
|
isPagination: false
|
},
|
created() {
|
this.popupParames = clone(Root.popupParames);
|
this.title = this.popupParames.title || this.popupParames.text
|
if (this.popupParames.filter) {
|
this.filterTxt = this.popupParames.filter
|
}
|
|
if (this.popupParames.dataname) {
|
this.dataname = this.popupParames.dataname;
|
}
|
if (this.popupParames.delta) {
|
this.delta = this.popupParames.delta;
|
if (this.delta.orderby) {
|
this.orderby = this.delta.orderby;
|
}
|
}
|
|
if (this.popupParames.sceneCode) {
|
if (this.popupParames.sceneCode == "add") {//新增
|
this.isedit = true;
|
}
|
if (this.popupParames.sceneCode == "browse") {//只读
|
this.isedit = false;
|
|
}
|
}
|
|
},
|
|
mounted() {
|
// this.getTableMeta();
|
//获取数据
|
this.initData();
|
this.$nextTick(() => { // 以服务的方式调用的 Loading 需要异步关闭
|
hideLoading();
|
});
|
},
|
|
methods:{
|
//关闭弹窗
|
closeDialog() {
|
this.docloseDialog(true);
|
},
|
|
//关闭前调回调
|
saveAfter() {
|
var me = this;
|
if(this.popupParames.callback) {
|
let obj = {
|
tableData: clone(this.tableData)
|
}
|
this.popupParames.callback(obj, function() {
|
me.docloseDialog();
|
});
|
}
|
else {
|
me.docloseDialog();
|
}
|
},
|
|
initData() {
|
var me = this;
|
if (this.delta.tabledata) {
|
this.tableData = clone(this.delta.tabledata);
|
}
|
if (this.delta.tablefields) {
|
this.tableFields = clone(this.delta.tablefields);
|
}
|
me.tableDataAfter();
|
// this.onQuery(function(result, callback) {//查询后的回调,用于获取字段的
|
// if (result.meta && result.meta[me.dataname] && result.meta[me.dataname].fields) {
|
// var metas = clone(result.meta[me.dataname].fields);
|
// var tableFields_ = [];
|
|
// metas.map(f=>{
|
// f.isshow = "F";
|
|
// tableFields_.push(clone(f));
|
// })
|
// if (!me.tableFields || (me.tableFields && me.tableFields.length == 0)) {
|
// me.tableFields = clone(tableFields_);
|
|
// //字段数组转字段obj,目的为了筛选时获取字段属性
|
// me.fieldsToFieldsObj();
|
|
// //设置字段事件
|
// me.tableFieldClick();
|
// }
|
|
// }
|
|
// if (callback) {
|
// callback();
|
// }
|
// });
|
},
|
|
tableFieldClick() {
|
var me = this;
|
//筛选字段事件设置
|
this.filterfieldClick = {
|
};
|
//表格字段事件设置
|
this.tablefieldClick = {
|
};
|
|
//表单字段事件设置
|
this.formfieldClick = {
|
};
|
},
|
|
|
onRowDblClick() {
|
if (this.isedit) {
|
this.saveAfter();
|
}
|
},
|
|
}
|
});
|
};
|
|
loadJsCss(function () {
|
initVue();
|
});
|
</script>
|
<style>
|
/* 在vue.js中 v-cloak 这个指令是防止页面加载时出现 vuejs 的变量名而设计的 */
|
[v-cloak] {
|
display: none !important;
|
}
|
</style>
|
|
</head>
|
|
<body style="margin: 0px;">
|
<div v-cloak id="vbody">
|
<div id="page_root">
|
<div ref="popup_body" style="padding: 0 20px;">
|
|
|
<div class="h_dialog__body">
|
<h-table
|
v-if="isRefresh && tableFields.length"
|
ref="table1"
|
:table-fields="tableFields"
|
:table-data="tableData"
|
:table-attr="tableAttr"
|
:table-height="tableHeight"
|
:table-field-click="tablefieldClick"
|
:is-highlight-row="isedit"
|
:is-show-index="false"
|
:filtersobj="filterObj"
|
:is-pagination="isPagination"
|
:is-within-edit-table-data="true"
|
|
:isshowtool="false"
|
:isfilterfield="false"
|
:istablebuttons="false"
|
:isbasicfilterfields="false"
|
:isdraggableorder="false"
|
>
|
</h-table>
|
</div>
|
|
<!-- 底部工具栏 -->
|
<div class="el-dialog__footer" style="margin-top: 0px;">
|
<el-button size="small" type="default" @click="closeDialog">取 消</el-button>
|
<el-button size="small" v-if="isedit" type="primary" @click="saveAfter">确 定</el-button>
|
</div>
|
</div>
|
</div>
|
</div>
|
|
<div id="page_loading" style="position: absolute; top:0px; width: 100vw; height: 50vh;">
|
<div class="spinner">
|
<div class="cube1"></div>
|
<div class="cube2"></div>
|
</div>
|
</div>
|
|
</body>
|
</html>
|