|
@@ -100,12 +100,12 @@
|
|
}
|
|
}
|
|
//设置表格配置
|
|
//设置表格配置
|
|
const setTableConfig = config => {
|
|
const setTableConfig = config => {
|
|
- if(that.$refs[tableID.value]){
|
|
|
|
- that.$refs[tableID.value].setConfig(config)
|
|
|
|
|
|
+ if(proxy.$refs[tableID.value]){
|
|
|
|
+ proxy.$refs[tableID.value].setConfig(config)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
const initTable = () => {
|
|
const initTable = () => {
|
|
- if(!that.$refs[tableID.value]){
|
|
|
|
|
|
+ if(!proxy.$refs[tableID.value]){
|
|
calculateCount.value ++;
|
|
calculateCount.value ++;
|
|
if(calculateCount.value > 5){
|
|
if(calculateCount.value > 5){
|
|
return
|
|
return
|
|
@@ -118,22 +118,22 @@
|
|
let fHeight = 0;
|
|
let fHeight = 0;
|
|
let tHeight = 0;
|
|
let tHeight = 0;
|
|
let vHeight = proxy.$el.offsetHeight;
|
|
let vHeight = proxy.$el.offsetHeight;
|
|
- if(that.$refs[searchID.value] && !hideSearch.value){
|
|
|
|
- fHeight = that.$refs[searchID.value].$el.offsetHeight + 32 + 8;
|
|
|
|
|
|
+ if(proxy.$refs[searchID.value] && !hideSearch.value){
|
|
|
|
+ fHeight = proxy.$refs[searchID.value].$el.offsetHeight + 32 + 8;
|
|
}
|
|
}
|
|
- if(that.$refs[toolID.value]){
|
|
|
|
- tHeight = that.$refs[toolID.value].$el.offsetHeight + 16;
|
|
|
|
|
|
+ if(proxy.$refs[toolID.value]){
|
|
|
|
+ tHeight = proxy.$refs[toolID.value].$el.offsetHeight + 16;
|
|
}
|
|
}
|
|
if(config.value.table && vHeight > 0){
|
|
if(config.value.table && vHeight > 0){
|
|
const h = vHeight - 32 - fHeight - tHeight - 48;
|
|
const h = vHeight - 32 - fHeight - tHeight - 48;
|
|
config.value.table.attr.height = h;
|
|
config.value.table.attr.height = h;
|
|
- if(that.$refs[tableID.value]){
|
|
|
|
- that.$refs[tableID.value].recalculate();
|
|
|
|
|
|
+ if(proxy.$refs[tableID.value]){
|
|
|
|
+ proxy.$refs[tableID.value].recalculate();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
const search = () => {
|
|
const search = () => {
|
|
- that.$refs[tableID.value].setPage({pageNo:1,total:0});
|
|
|
|
|
|
+ proxy.$refs[tableID.value].setPage({pageNo:1,total:0});
|
|
emit('search');
|
|
emit('search');
|
|
}
|
|
}
|
|
const detail = row => {
|
|
const detail = row => {
|
|
@@ -141,22 +141,22 @@
|
|
if(modalConfig.value){
|
|
if(modalConfig.value){
|
|
modalShow.value = true;
|
|
modalShow.value = true;
|
|
nextTick(() => {
|
|
nextTick(() => {
|
|
- if(that.$refs[formID.value]){
|
|
|
|
- that.$refs[formID.value].setValue(row);
|
|
|
|
|
|
+ if(proxy.$refs[formID.value]){
|
|
|
|
+ proxy.$refs[formID.value].setValue(row);
|
|
}
|
|
}
|
|
})
|
|
})
|
|
}
|
|
}
|
|
}
|
|
}
|
|
const setFormValue = data => {
|
|
const setFormValue = data => {
|
|
nextTick(() => {
|
|
nextTick(() => {
|
|
- if(that.$refs[formID.value]){
|
|
|
|
- that.$refs[formID.value].setValue(data);
|
|
|
|
|
|
+ if(proxy.$refs[formID.value]){
|
|
|
|
+ proxy.$refs[formID.value].setValue(data);
|
|
}
|
|
}
|
|
})
|
|
})
|
|
}
|
|
}
|
|
//清除搜索条件
|
|
//清除搜索条件
|
|
const clearSearch = () => {
|
|
const clearSearch = () => {
|
|
- that.$refs[searchID].value.clearValue();
|
|
|
|
|
|
+ proxy.$refs[searchID].value.clearValue();
|
|
}
|
|
}
|
|
const resert = () => {
|
|
const resert = () => {
|
|
resertHandle()
|
|
resertHandle()
|
|
@@ -188,7 +188,7 @@
|
|
const modalHandle = e => {
|
|
const modalHandle = e => {
|
|
if(e == 'onReturn'){
|
|
if(e == 'onReturn'){
|
|
modalShow.value = false;
|
|
modalShow.value = false;
|
|
- that.$refs[formID.value].clearValue();
|
|
|
|
|
|
+ proxy.$refs[formID.value].clearValue();
|
|
emit('backHandle')
|
|
emit('backHandle')
|
|
}else{
|
|
}else{
|
|
emit('modalHandle',e)
|
|
emit('modalHandle',e)
|
|
@@ -196,39 +196,39 @@
|
|
}
|
|
}
|
|
const closeModal = () => {
|
|
const closeModal = () => {
|
|
modalShow.value=false;
|
|
modalShow.value=false;
|
|
- if(that.$refs[formID.value]) {
|
|
|
|
- that.$refs[formID.value].clearValue()
|
|
|
|
|
|
+ if(proxy.$refs[formID.value]) {
|
|
|
|
+ proxy.$refs[formID.value].clearValue()
|
|
}
|
|
}
|
|
}
|
|
}
|
|
const getSelectData = () => {
|
|
const getSelectData = () => {
|
|
let data=[];
|
|
let data=[];
|
|
- if(that.$refs[tableID.value]){
|
|
|
|
- data=that.$refs[tableID.value].getSelectData()
|
|
|
|
|
|
+ if(proxy.$refs[tableID.value]){
|
|
|
|
+ data=proxy.$refs[tableID.value].getSelectData()
|
|
}
|
|
}
|
|
return data;
|
|
return data;
|
|
}
|
|
}
|
|
//清除选中表格
|
|
//清除选中表格
|
|
const clearCheckboxRow = () => {
|
|
const clearCheckboxRow = () => {
|
|
- if(that.$refs[tableID.value]){
|
|
|
|
- that.$refs[tableID.value].clearCheckboxRow()
|
|
|
|
|
|
+ if(proxy.$refs[tableID.value]){
|
|
|
|
+ proxy.$refs[tableID.value].clearCheckboxRow()
|
|
}
|
|
}
|
|
}
|
|
}
|
|
//设置表格数据
|
|
//设置表格数据
|
|
const setTableValue = data => {
|
|
const setTableValue = data => {
|
|
- if(that.$refs[tableID.value]){
|
|
|
|
- that.$refs[tableID.value].setValue(data)
|
|
|
|
|
|
+ if(proxy.$refs[tableID.value]){
|
|
|
|
+ proxy.$refs[tableID.value].setValue(data)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
const getPage = () => {
|
|
const getPage = () => {
|
|
let p = {};
|
|
let p = {};
|
|
- if(that.$refs[tableID.value]){
|
|
|
|
- p=that.$refs[tableID.value].getPage()
|
|
|
|
|
|
+ if(proxy.$refs[tableID.value]){
|
|
|
|
+ p=proxy.$refs[tableID.value].getPage()
|
|
}
|
|
}
|
|
return p;
|
|
return p;
|
|
}
|
|
}
|
|
const setPage = page => {
|
|
const setPage = page => {
|
|
- if(that.$refs[tableID.value]){
|
|
|
|
- that.$refs[tableID.value].setPage(page)
|
|
|
|
|
|
+ if(proxy.$refs[tableID.value]){
|
|
|
|
+ proxy.$refs[tableID.value].setPage(page)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
//分页的变化
|
|
//分页的变化
|
|
@@ -237,19 +237,19 @@
|
|
// this.getList();
|
|
// this.getList();
|
|
}
|
|
}
|
|
const getFormValidate = callBack => {
|
|
const getFormValidate = callBack => {
|
|
- that.$refs[formID.value].validate().then(()=>{
|
|
|
|
|
|
+ proxy.$refs[formID.value].validate().then(()=>{
|
|
callBack()
|
|
callBack()
|
|
}).catch(() => {})
|
|
}).catch(() => {})
|
|
}
|
|
}
|
|
const getFormValue = () => {
|
|
const getFormValue = () => {
|
|
- if(that.$refs[formID.value]){
|
|
|
|
- return that.$refs[formID.value].getValue();
|
|
|
|
|
|
+ if(proxy.$refs[formID.value]){
|
|
|
|
+ return proxy.$refs[formID.value].getValue();
|
|
}
|
|
}
|
|
return null
|
|
return null
|
|
}
|
|
}
|
|
const initFormTool = () => {
|
|
const initFormTool = () => {
|
|
- if(that.$refs.toolForm){
|
|
|
|
- that.$refs.toolForm.initTools();
|
|
|
|
|
|
+ if(proxy.$refs.toolForm){
|
|
|
|
+ proxy.$refs.toolForm.initTools();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
const onChangeRow = row => {
|
|
const onChangeRow = row => {
|
|
@@ -263,11 +263,11 @@
|
|
const getQuery = () => {
|
|
const getQuery = () => {
|
|
let query = {};
|
|
let query = {};
|
|
let page = {};
|
|
let page = {};
|
|
- if(that.$refs[searchID.value]){
|
|
|
|
- query = that.$refs[searchID.value].getValue();
|
|
|
|
|
|
+ if(proxy.$refs[searchID.value]){
|
|
|
|
+ query = proxy.$refs[searchID.value].getValue();
|
|
}
|
|
}
|
|
- if(that.$refs[tableID.value]){
|
|
|
|
- page = that.$refs[tableID.value].getPage();
|
|
|
|
|
|
+ if(proxy.$refs[tableID.value]){
|
|
|
|
+ page = proxy.$refs[tableID.value].getPage();
|
|
}
|
|
}
|
|
query.pageNo = page.pageNo;
|
|
query.pageNo = page.pageNo;
|
|
query.pageSize = page.pageSize;
|
|
query.pageSize = page.pageSize;
|
|
@@ -275,19 +275,25 @@
|
|
}
|
|
}
|
|
//刷新
|
|
//刷新
|
|
const onRefresh = () => {
|
|
const onRefresh = () => {
|
|
- that.$refs[tableID.value].setPage({pageNo:1,total:0});
|
|
|
|
|
|
+ proxy.$refs[tableID.value].setPage({pageNo:1,total:0});
|
|
emit('onRefresh')
|
|
emit('onRefresh')
|
|
}
|
|
}
|
|
//重置
|
|
//重置
|
|
const resertHandle = () => {
|
|
const resertHandle = () => {
|
|
- that.$refs[searchID.value].clearValue({});
|
|
|
|
- that.$refs[tableID.value].setPage({pageNo:1,total:0})
|
|
|
|
|
|
+ proxy.$refs[searchID.value].clearValue({});
|
|
|
|
+ proxy.$refs[tableID.value].setPage({pageNo:1,total:0})
|
|
emit('resert')
|
|
emit('resert')
|
|
}
|
|
}
|
|
defineExpose({
|
|
defineExpose({
|
|
getConfig,setConfig,resertHandle,onRefresh,getQuery,toggleSearch,initFormTool,getFormValue,getFormValidate,setPage,getPage,setTableValue,clearCheckboxRow,getSelectData,closeModal,clearSearch,setTableConfig,initTable,setFormValue
|
|
getConfig,setConfig,resertHandle,onRefresh,getQuery,toggleSearch,initFormTool,getFormValue,getFormValidate,setPage,getPage,setTableValue,clearCheckboxRow,getSelectData,closeModal,clearSearch,setTableConfig,initTable,setFormValue
|
|
})
|
|
})
|
|
|
|
|
|
|
|
+ searchID.value = getUuid()
|
|
|
|
+ toolID.value = getUuid()
|
|
|
|
+ tableID.value = getUuid()
|
|
|
|
+ viewID.value = getUuid()
|
|
|
|
+ formID.value = getUuid()
|
|
|
|
+
|
|
if(props.propConfig){
|
|
if(props.propConfig){
|
|
setConfig(props.propConfig)
|
|
setConfig(props.propConfig)
|
|
}
|
|
}
|
|
@@ -296,11 +302,7 @@
|
|
initTable();
|
|
initTable();
|
|
}
|
|
}
|
|
})
|
|
})
|
|
- searchID.value = getUuid()
|
|
|
|
- toolID.value = getUuid()
|
|
|
|
- tableID.value = getUuid()
|
|
|
|
- viewID.value = getUuid()
|
|
|
|
- formID.value = getUuid()
|
|
|
|
|
|
+
|
|
|
|
|
|
</script>
|
|
</script>
|
|
|
|
|