后台-能力挂接-组件服务:查不到数据的时候就正常展示暂无数据就可以,没必要这样提示

This commit is contained in:
a0049873 2022-11-01 10:43:16 +08:00
parent ad6a1c14de
commit 4281bc5156
4 changed files with 88 additions and 88 deletions

View File

@ -514,7 +514,7 @@ export default {
this.total = 0
return this.$message.error(res.msg)
}
if (res.data.list.length !== 0) {
if (res.data.list.length >= 0) {
this.dataList = res.data.list
this.total = this.mixinViewModuleOptions.getDataListIsPage
? res.data.total

View File

@ -393,7 +393,7 @@ export default {
this.total = 0
return this.$message.error(res.msg)
}
if (res.data.list.length !== 0) {
if (res.data.list.length >= 0) {
this.dataList = res.data.list
this.total = this.mixinViewModuleOptions.getDataListIsPage
? res.data.total

View File

@ -249,7 +249,7 @@ export default {
this.total = 0
return this.$message.error(res.msg)
}
if (res.data.list.length !== 0) {
if (res.data.list.length >= 0) {
this.dataList = res.data.list
this.total = this.mixinViewModuleOptions.getDataListIsPage
? res.data.total

View File

@ -131,54 +131,54 @@
</template>
<script>
import mixinViewModule from "@/mixins/view-module";
import AddOrUpdate from "./canassigncase-add-or-update";
import dictionaries from "@/utils/dictionaries";
import qs from "qs";
import { type } from "os";
import mixinViewModule from '@/mixins/view-module'
import AddOrUpdate from './canassigncase-add-or-update'
import dictionaries from '@/utils/dictionaries'
import qs from 'qs'
import { type } from 'os'
export default {
mixins: [mixinViewModule],
data () {
return {
mixinViewModuleOptions: {
getDataListURL: "/resource/page",
getDataListURL: '/resource/page',
getDataListIsPage: true,
exportURL: "/ability/bsabilityai/export",
deleteURL: "/resource/delete",
deleteIsBatch: true,
exportURL: '/ability/bsabilityai/export',
deleteURL: '/resource/delete',
deleteIsBatch: true
},
disabled: false,
sceneArr: dictionaries.sceneArr,
fieldArr: dictionaries.fieldArr,
shareFormArr: dictionaries.shareFormArr,
dataForm: {
name: "",
creator: "",
name: '',
creator: '',
selectType: 0,
delFlag: 0,
type: "赋能案例",
type: '赋能案例'
},
qp: false,
};
qp: false
}
},
watch: {},
components: {
AddOrUpdate,
AddOrUpdate
},
created () {
this.dataForm.name = "";
this.dataForm.type = "赋能案例";
this.dataForm.name = ''
this.dataForm.type = '赋能案例'
},
mounted () {
window.addEventListener("resize", this.a);
this.fullScreen();
window.addEventListener('resize', this.a)
this.fullScreen()
},
methods: {
reset () {
this.$http
.get(
this.mixinViewModuleOptions.getDataListURL +
"?" +
'?' +
qs.stringify({
// order: this.order,
// orderField: this.orderField,
@ -187,56 +187,56 @@ export default {
selectType: 0,
limit: 10,
delFlag: 0,
creator: "",
type: "赋能案例",
name: "",
creator: '',
type: '赋能案例',
name: ''
})
)
.then(({ data: res }) => {
this.dataForm.name = "";
this.dataForm.name = ''
if (res.code !== 0) {
this.dataList = [];
this.total = 0;
return this.$message.error(res.msg);
this.dataList = []
this.total = 0
return this.$message.error(res.msg)
}
this.dataList = this.mixinViewModuleOptions.getDataListIsPage
? res.data.list
: res.data;
: res.data
this.total = this.mixinViewModuleOptions.getDataListIsPage
? res.data.total
: 0;
: 0
if (this.mixinViewModuleOptions.requestCallback) {
this.mixinViewModuleOptions.requestCallback(res.data);
this.mixinViewModuleOptions.requestCallback(res.data)
}
this.dataListLoading = false;
this.dataListLoading = false
})
.catch(() => {
this.dataListLoading = false;
});
this.dataListLoading = false
})
},
showDetail (val) {
this.addOrUpdateVisible = true;
this.disabled = false;
this.addOrUpdateVisible = true
this.disabled = false
this.$nextTick(() => {
this.$refs.addOrUpdate.UpdateState = false;
this.$refs.addOrUpdate.dataFormShowDetails = val;
this.$refs.addOrUpdate.init();
});
this.disabled = true;
this.$refs.addOrUpdate.UpdateState = false
this.$refs.addOrUpdate.dataFormShowDetails = val
this.$refs.addOrUpdate.init()
})
this.disabled = true
},
showDocument (val) {
console.log(val);
console.log(val)
window.open(
window.SITE_CONFIG.frontUrl + "?id=" + val.id + "&&type=" + val.type,
"_blank"
);
window.SITE_CONFIG.frontUrl + '?id=' + val.id + '&&type=' + val.type,
'_blank'
)
},
findValue (list, type) {
const found = list.find((item) => item.attrType === type);
const found = list.find((item) => item.attrType === type)
if (found) {
return found.attrValue;
return found.attrValue
} else {
return "暂无数据";
return '暂无数据'
}
},
getDataList2 (names) {
@ -244,81 +244,81 @@ export default {
this.$http
.get(
this.mixinViewModuleOptions.getDataListURL +
"?" +
'?' +
qs.stringify({
// order: this.order,
// orderField: this.orderField,
// type: '',
pageNum: 1,
pageSize: this.limit,
type: "赋能案例",
creator: "",
type: '赋能案例',
creator: '',
selectType: 0,
delFlag: 0,
name: names,
name: names
})
)
.then(({ data: res }) => {
if (res.code !== 0) {
this.dataList = [];
this.total = 0;
return this.$message.error(res.msg);
this.dataList = []
this.total = 0
return this.$message.error(res.msg)
}
if (res.data.list.length !== 0) {
this.dataList = res.data.list;
if (res.data.list.length >= 0) {
this.dataList = res.data.list
this.total = this.mixinViewModuleOptions.getDataListIsPage
? res.data.total
: 0;
: 0
if (this.mixinViewModuleOptions.requestCallback) {
this.mixinViewModuleOptions.requestCallback(res.data);
this.mixinViewModuleOptions.requestCallback(res.data)
}
this.dataListLoading = false;
this.dataListLoading = false
} else {
this.$message.error("未查询到相关信息");
this.reset();
this.$message.error('未查询到相关信息')
this.reset()
}
})
.catch(() => {
this.dataListLoading = false;
});
this.dataListLoading = false
})
} else {
this.$message.error("查询不能输入为空");
this.$message.error('查询不能输入为空')
}
},
fullScreen () {
if (window.outerHeight === screen.availHeight) {
if (window.outerWidth === screen.availWidth) {
console.log(
"全屏1",
'全屏1',
window.outerHeight,
screen.availHeight,
window.outerWidth,
screen.availWidth
);
this.qp = false;
)
this.qp = false
} else {
console.log(
"不是全屏2",
'不是全屏2',
window.outerHeight,
screen.availHeight,
window.outerWidth,
screen.availWidth
);
this.qp = true;
)
this.qp = true
}
} else {
console.log(
"不是全屏3",
'不是全屏3',
window.outerHeight,
screen.availHeight,
window.outerWidth,
screen.availWidth
);
this.qp = true;
)
this.qp = true
}
}
}
}
},
},
};
</script>
<style lang="scss" scoped>
.el-tooltip__popper {