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

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 this.total = 0
return this.$message.error(res.msg) return this.$message.error(res.msg)
} }
if (res.data.list.length !== 0) { if (res.data.list.length >= 0) {
this.dataList = res.data.list this.dataList = res.data.list
this.total = this.mixinViewModuleOptions.getDataListIsPage this.total = this.mixinViewModuleOptions.getDataListIsPage
? res.data.total ? res.data.total

View File

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

View File

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

View File

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