<!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 BasicsVue({
|
el: "#vbody",
|
// components: {
|
// vuedraggable: window.vuedraggable,//当前页面注册组件
|
// },
|
data: {
|
drag: false,
|
myArray: [
|
{ people: 'cn', id: 1, name: 'www.itxst.com' },
|
{ people: 'cn', id: 2, name: 'www.baidu.com' },
|
{ people: 'cn', id: 3, name: 'www.taobao.com' },
|
{ people: 'us', id: 4, name: 'www.google.com' }
|
]
|
},
|
created() {
|
this.popupParames = clone(Root.popupParames);
|
|
if (this.popupParames.data) {
|
this.formData = clone(this.popupParames.data);
|
}
|
},
|
|
mounted() {
|
var me = this;
|
this.initData();
|
|
this.$nextTick(() => { // 以服务的方式调用的 Loading 需要异步关闭
|
hideLoading();
|
|
//重新设置弹窗宽高
|
this.$nextTick(function(){
|
//let w_ = this.$refs.popup_body.offsetWidth + "px";
|
let w_ = "900px";
|
let h_ = this.$refs.popup_body.offsetHeight + "px";
|
Root.setPopupWH(w_, h_);
|
})
|
});
|
},
|
|
methods:{
|
closeDialog() {
|
var me = this;
|
if (me.popupParames.totab){
|
Root.tab.removeItem(Root.tab.selected);
|
Root.tab.open(me.popupParames.parentOption, false);
|
}
|
else {
|
Root.hidePopup();
|
}
|
},
|
saveAfter() {//调回调的关闭
|
var me = this;
|
if(this.popupParames.callback) {
|
let obj = {
|
//row: this.formData
|
}
|
this.popupParames.callback(obj, function() {
|
me.closeDialog();
|
});
|
}
|
else {
|
me.closeDialog();
|
}
|
},
|
|
initData() {
|
let me = this
|
//tableData
|
|
// if (this.formData.id) {
|
// filter_table = "parentid = '" + this.formData.id + "'";
|
// }
|
|
// let param_table = {
|
// isClientMode: false,
|
// dataname: this.table_dataname,
|
// filter: filter_table,
|
// }
|
|
// Server.call("root/data/getEntitySet", param_table, function(result) {
|
// if (result && result.data) {
|
// me.tableData2= result.data.entityset;
|
// }
|
// });
|
},
|
onStart() {
|
this.drag = true;
|
},
|
onEnd() {
|
this.drag = false;
|
}
|
|
|
}
|
});
|
};
|
|
loadJsCss(function () {
|
initVue();
|
});
|
</script>
|
<style>
|
/* 在vue.js中 v-cloak 这个指令是防止页面加载时出现 vuejs 的变量名而设计的 */
|
[v-cloak] {
|
display: none !important;
|
}
|
html {
|
overflow: hidden;
|
}
|
</style>
|
|
<style scoped>
|
.item {
|
padding: 6px;
|
background-color: #fdfdfd;
|
border: solid 1px #eee;
|
margin-bottom: 10px;
|
cursor: move;
|
}
|
|
.item:hover {
|
background-color: #f1f1f1;
|
cursor: move;
|
}
|
|
.chosen {
|
border: solid 2px #3089dc !important;
|
}
|
</style>
|
|
</head>
|
|
|
<body style="margin: 0px;">
|
<!-- <div v-cloak id="vbody">
|
<div>{{drag?'拖拽中':'拖拽停止'}}</div>
|
<draggable v-model="myArray" chosen-class="chosen" force-fallback="true" group="people" animation="1000" @start="onStart" @end="onEnd">
|
<transition-group>
|
<div class="item" v-for="element in myArray" :key="element.id">{{element.name}}</div>
|
</transition-group>
|
</draggable>
|
</div> -->
|
|
<div v-cloak id="vbody">
|
<div id="page_root">
|
<div ref="popup_body" style="padding: 0px 20px;">
|
<div class="el-dialog__header">
|
<div class="dialog-title">
|
<i class="iconfont icon-customermanagement"></i>
|
<span> {{title}} </span>
|
</div>
|
</div>
|
<div style="height: 550px; ">
|
<div>{{drag?'拖拽中':'拖拽停止'}}</div>
|
<draggable v-model="myArray" chosen-class="chosen" force-fallback="true" group="people" animation="1000" @start="onStart" @end="onEnd">
|
<transition-group>
|
<div class="item" v-for="element in myArray" :key="element.id">{{element.name}}</div>
|
</transition-group>
|
</draggable>
|
</div>
|
<div class="el-dialog__footer">
|
<el-button size="small" type="default" @click="closeDialog">关 闭</el-button>
|
</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>
|
</div>
|
|
</body>
|
</html>
|