Browse Source

添加加载中

master
song 3 years ago
parent
commit
2ec807e91b
  1. BIN
      dist.zip
  2. 64
      package-lock.json
  3. 3
      package.json
  4. 2
      src/plugins/ant-design-vue.js
  5. 12
      src/views/CompanyProfile/CompanyProfile.vue
  6. 44
      src/views/NewPages/NewPages.vue
  7. 30
      yarn.lock

BIN
dist.zip

Binary file not shown.

64
package-lock.json

@ -47,7 +47,7 @@
"stylus": "^0.54.5", "stylus": "^0.54.5",
"stylus-loader": "^3.0.2", "stylus-loader": "^3.0.2",
"svg-sprite-loader": "^5.0.0", "svg-sprite-loader": "^5.0.0",
"swiper": "^8.0.6", "swiper": "^5.4.5",
"vue-cli-plugin-ant-design": "^1.0.1", "vue-cli-plugin-ant-design": "^1.0.1",
"vue-cli-plugin-axios": "^0.0.4", "vue-cli-plugin-axios": "^0.0.4",
"vue-template-compiler": "^2.6.11" "vue-template-compiler": "^2.6.11"
@ -6256,12 +6256,12 @@
] ]
}, },
"node_modules/dom7": { "node_modules/dom7": {
"version": "4.0.4", "version": "2.1.5",
"resolved": "https://registry.npmjs.org/dom7/-/dom7-4.0.4.tgz", "resolved": "https://registry.npmjs.org/dom7/-/dom7-2.1.5.tgz",
"integrity": "sha512-DSSgBzQ4rJWQp1u6o+3FVwMNnT5bzQbMb+o31TjYYeRi05uAcpF8koxdfzeoe5ElzPmua7W7N28YJhF7iEKqIw==", "integrity": "sha512-xnhwVgyOh3eD++/XGtH+5qBwYTgCm0aW91GFgPJ3XG+jlsRLyJivnbP0QmUBFhI+Oaz9FV0s7cxgXHezwOEBYA==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"ssr-window": "^4.0.0" "ssr-window": "^2.0.0"
} }
}, },
"node_modules/domain-browser": { "node_modules/domain-browser": {
@ -13661,9 +13661,9 @@
} }
}, },
"node_modules/ssr-window": { "node_modules/ssr-window": {
"version": "4.0.2", "version": "2.0.0",
"resolved": "https://registry.npmjs.org/ssr-window/-/ssr-window-4.0.2.tgz", "resolved": "https://registry.npmjs.org/ssr-window/-/ssr-window-2.0.0.tgz",
"integrity": "sha512-ISv/Ch+ig7SOtw7G2+qkwfVASzazUnvlDTwypdLoPoySv+6MqlOV10VwPSE6EWkGjhW50lUmghPmpYZXMu/+AQ==", "integrity": "sha512-NXzN+/HPObKAx191H3zKlYomE5WrVIkoCB5IaSdvKokxTpjBdWfr0RaP+1Z5KOfDT0ZVz+2tdtiBkhsEQ9p+0A==",
"dev": true "dev": true
}, },
"node_modules/ssri": { "node_modules/ssri": {
@ -14405,27 +14405,21 @@
} }
}, },
"node_modules/swiper": { "node_modules/swiper": {
"version": "8.0.6", "version": "5.4.5",
"resolved": "https://registry.npmjs.org/swiper/-/swiper-8.0.6.tgz", "resolved": "https://registry.npmjs.org/swiper/-/swiper-5.4.5.tgz",
"integrity": "sha512-Ssyu1+FeNATF/G8e84QG+ZUNtUOAZ5vngdgxzczh0oWZPhGUVgkdv+BoePUuaCXLAFXnwVpNjgLIcGnxMdmWPA==", "integrity": "sha512-7QjA0XpdOmiMoClfaZ2lYN6ICHcMm72LXiY+NF4fQLFidigameaofvpjEEiTQuw3xm5eksG5hzkaRsjQX57vtA==",
"dev": true, "dev": true,
"funding": [
{
"type": "patreon",
"url": "https://www.patreon.com/swiperjs"
},
{
"type": "open_collective",
"url": "http://opencollective.com/swiper"
}
],
"hasInstallScript": true, "hasInstallScript": true,
"dependencies": { "dependencies": {
"dom7": "^4.0.4", "dom7": "^2.1.5",
"ssr-window": "^4.0.2" "ssr-window": "^2.0.0"
}, },
"engines": { "engines": {
"node": ">= 4.7.0" "node": ">= 4.7.0"
},
"funding": {
"type": "patreon",
"url": "https://www.patreon.com/vladimirkharlampidi"
} }
}, },
"node_modules/table": { "node_modules/table": {
@ -21847,12 +21841,12 @@
} }
}, },
"dom7": { "dom7": {
"version": "4.0.4", "version": "2.1.5",
"resolved": "https://registry.npmjs.org/dom7/-/dom7-4.0.4.tgz", "resolved": "https://registry.npmjs.org/dom7/-/dom7-2.1.5.tgz",
"integrity": "sha512-DSSgBzQ4rJWQp1u6o+3FVwMNnT5bzQbMb+o31TjYYeRi05uAcpF8koxdfzeoe5ElzPmua7W7N28YJhF7iEKqIw==", "integrity": "sha512-xnhwVgyOh3eD++/XGtH+5qBwYTgCm0aW91GFgPJ3XG+jlsRLyJivnbP0QmUBFhI+Oaz9FV0s7cxgXHezwOEBYA==",
"dev": true, "dev": true,
"requires": { "requires": {
"ssr-window": "^4.0.0" "ssr-window": "^2.0.0"
} }
}, },
"domain-browser": { "domain-browser": {
@ -27863,9 +27857,9 @@
} }
}, },
"ssr-window": { "ssr-window": {
"version": "4.0.2", "version": "2.0.0",
"resolved": "https://registry.npmjs.org/ssr-window/-/ssr-window-4.0.2.tgz", "resolved": "https://registry.npmjs.org/ssr-window/-/ssr-window-2.0.0.tgz",
"integrity": "sha512-ISv/Ch+ig7SOtw7G2+qkwfVASzazUnvlDTwypdLoPoySv+6MqlOV10VwPSE6EWkGjhW50lUmghPmpYZXMu/+AQ==", "integrity": "sha512-NXzN+/HPObKAx191H3zKlYomE5WrVIkoCB5IaSdvKokxTpjBdWfr0RaP+1Z5KOfDT0ZVz+2tdtiBkhsEQ9p+0A==",
"dev": true "dev": true
}, },
"ssri": { "ssri": {
@ -28470,13 +28464,13 @@
} }
}, },
"swiper": { "swiper": {
"version": "8.0.6", "version": "5.4.5",
"resolved": "https://registry.npmjs.org/swiper/-/swiper-8.0.6.tgz", "resolved": "https://registry.npmjs.org/swiper/-/swiper-5.4.5.tgz",
"integrity": "sha512-Ssyu1+FeNATF/G8e84QG+ZUNtUOAZ5vngdgxzczh0oWZPhGUVgkdv+BoePUuaCXLAFXnwVpNjgLIcGnxMdmWPA==", "integrity": "sha512-7QjA0XpdOmiMoClfaZ2lYN6ICHcMm72LXiY+NF4fQLFidigameaofvpjEEiTQuw3xm5eksG5hzkaRsjQX57vtA==",
"dev": true, "dev": true,
"requires": { "requires": {
"dom7": "^4.0.4", "dom7": "^2.1.5",
"ssr-window": "^4.0.2" "ssr-window": "^2.0.0"
} }
}, },
"table": { "table": {

3
package.json

@ -18,7 +18,6 @@
"quill": "^1.3.7", "quill": "^1.3.7",
"register-service-worker": "^1.7.1", "register-service-worker": "^1.7.1",
"stylus": "^0.54.8", "stylus": "^0.54.8",
"swiper": "^5.4.5",
"vue": "^2.6.11", "vue": "^2.6.11",
"vue-baidu-map": "^0.21.22", "vue-baidu-map": "^0.21.22",
"vue-dompurify-html": "^2.5.0", "vue-dompurify-html": "^2.5.0",
@ -49,7 +48,7 @@
"stylus": "^0.54.5", "stylus": "^0.54.5",
"stylus-loader": "^3.0.2", "stylus-loader": "^3.0.2",
"svg-sprite-loader": "^5.0.0", "svg-sprite-loader": "^5.0.0",
"swiper": "^8.0.6", "swiper": "^5.4.5",
"vue-cli-plugin-ant-design": "^1.0.1", "vue-cli-plugin-ant-design": "^1.0.1",
"vue-cli-plugin-axios": "^0.0.4", "vue-cli-plugin-axios": "^0.0.4",
"vue-template-compiler": "^2.6.11" "vue-template-compiler": "^2.6.11"

2
src/plugins/ant-design-vue.js

@ -44,6 +44,7 @@ import {
Skeleton, Skeleton,
AutoComplete, AutoComplete,
InputNumber, InputNumber,
Spin,
} from 'ant-design-vue'; } from 'ant-design-vue';
import { ConfigProvider } from 'ant-design-vue'; import { ConfigProvider } from 'ant-design-vue';
Vue.component(ConfigProvider.name, ConfigProvider); Vue.component(ConfigProvider.name, ConfigProvider);
@ -82,6 +83,7 @@ Vue.use(Card);
Vue.use(Skeleton); Vue.use(Skeleton);
Vue.use(AutoComplete); Vue.use(AutoComplete);
Vue.use(InputNumber); Vue.use(InputNumber);
Vue.use(Spin);
Vue.prototype.$message = message; Vue.prototype.$message = message;
Vue.prototype.$notification = notification; Vue.prototype.$notification = notification;

12
src/views/CompanyProfile/CompanyProfile.vue

@ -7,7 +7,9 @@
<div class="flex-1 flex-column"> <div class="flex-1 flex-column">
<Location :title="defaultTitle" /> <Location :title="defaultTitle" />
<div class="content-detail p-4" :style="{ 'min-height': list.children.length * 56 + 'px' }"> <div class="content-detail p-4" :style="{ 'min-height': list.children.length * 56 + 'px' }">
<RichText :rich-obj="content" /> <a-spin tip="拼命加载中..." :spinning="showLoading">
<RichText :rich-obj="content" />
</a-spin>
</div> </div>
</div> </div>
</div> </div>
@ -54,6 +56,7 @@ export default {
], ],
}, },
content: {}, content: {},
showLoading: true
}; };
}, },
watch: { watch: {
@ -77,13 +80,18 @@ export default {
...mapActions('home', ['getDetail']), ...mapActions('home', ['getDetail']),
async getData(showPage) { async getData(showPage) {
try { try {
this.showLoading = true;
const param = { const param = {
showPage, showPage,
introId: '', introId: '',
}; };
const data = await this.getDetail(param); const data = await this.getDetail(param);
this.showLoading = false;
this.content = data || {}; this.content = data || {};
} catch (error) {} } catch (error) {
this.showLoading = false;
console.error('error: ', error);
}
}, },
chanegCode(code) { chanegCode(code) {
this.code = code; this.code = code;

44
src/views/NewPages/NewPages.vue

@ -8,19 +8,25 @@
<Location :title="defaultTitle" /> <Location :title="defaultTitle" />
<div class="content-detail p-4" :style="{ 'min-height': list.children.length * 56 + 'px' }"> <div class="content-detail p-4" :style="{ 'min-height': list.children.length * 56 + 'px' }">
<template v-if="!introId"> <template v-if="!introId">
<template v-if="code !== '0204'"> <a-spin tip="拼命加载中..." :spinning="showLoading">
<ListPage :code="code" @changeYear="changeYear" :content="content" @getData="getData" /> <template v-if="code !== '0204'">
</template> <ListPage :code="code" @changeYear="changeYear" :content="content" @getData="getData" />
<template v-else> </template>
<div class="list-title mb-2">集团</div> <template v-else>
<ListPage :code="code" @changeYear="changeYear" :content="content1" @getData="getData" /> <div class="list-title mb-2">集团</div>
<div class="list-title mb-2">省公司</div> <ListPage :code="code" @changeYear="changeYear" :content="content1" @getData="getData" />
<ListPage :code="code" @changeYear="changeYear" :content="content2" @getData="getData" /> <div class="list-title mb-2">省公司</div>
<div class="list-title mb-2">公司</div> <ListPage :code="code" @changeYear="changeYear" :content="content2" @getData="getData" />
<ListPage :code="code" @changeYear="changeYear" :content="content3" @getData="getData" /> <div class="list-title mb-2">公司</div>
</template> <ListPage :code="code" @changeYear="changeYear" :content="content3" @getData="getData" />
</template>
</a-spin>
</template>
<template v-else>
<a-spin tip="拼命加载中..." :spinning="showLoading">
<RichText :rich-obj="introContent" />
</a-spin>
</template> </template>
<RichText v-else :rich-obj="introContent" />
</div> </div>
<div v-if="introContent.relations && introContent.relations.length" class="content-detail p-4"> <div v-if="introContent.relations && introContent.relations.length" class="content-detail p-4">
<Relevant :data="introContent" /> <Relevant :data="introContent" />
@ -100,6 +106,7 @@ export default {
introId: '', introId: '',
introContent: {}, introContent: {},
showType: '0', showType: '0',
showLoading: true
}; };
}, },
watch: { watch: {
@ -157,6 +164,7 @@ export default {
}, },
async getContentData(showPage) { async getContentData(showPage) {
try { try {
this.showLoading = true;
let param = { let param = {
showPage: showPage || this.code, showPage: showPage || this.code,
year: this.year, year: this.year,
@ -172,30 +180,40 @@ export default {
param.pageSize = 16; param.pageSize = 16;
if (showPage === '0201') { if (showPage === '0201') {
data1 = await this.getContentImg(param); data1 = await this.getContentImg(param);
this.showLoading = false;
this.content1 = data1; this.content1 = data1;
} else if (showPage === '0202') { } else if (showPage === '0202') {
data2 = await this.getContentImg(param); data2 = await this.getContentImg(param);
this.showLoading = false;
this.content2 = data2; this.content2 = data2;
} else if (showPage === '0203') { } else if (showPage === '0203') {
data3 = await this.getContentImg(param); data3 = await this.getContentImg(param);
this.showLoading = false;
this.content3 = data3; this.content3 = data3;
} }
} else { } else {
data = await this.getContent(param); data = await this.getContent(param);
this.showLoading = false;
this.content = data; this.content = data;
} }
} catch (error) {} } catch (error) {
this.showLoading = false;
console.error('error: ', error);
}
}, },
// //
async getIntroContent() { async getIntroContent() {
try { try {
this.showLoading = true;
const param = { const param = {
showPage: '', showPage: '',
introId: this.introId, introId: this.introId,
}; };
const data = await this.getDetail(param); const data = await this.getDetail(param);
this.showLoading = false;
this.introContent = data || {}; this.introContent = data || {};
} catch (error) { } catch (error) {
this.showLoading = false;
console.error('error: ', error); console.error('error: ', error);
} }
}, },

30
yarn.lock

@ -3598,12 +3598,12 @@
"domelementtype" "^2.0.1" "domelementtype" "^2.0.1"
"entities" "^2.0.0" "entities" "^2.0.0"
"dom7@^4.0.4": "dom7@^2.1.5":
"integrity" "sha512-DSSgBzQ4rJWQp1u6o+3FVwMNnT5bzQbMb+o31TjYYeRi05uAcpF8koxdfzeoe5ElzPmua7W7N28YJhF7iEKqIw==" "integrity" "sha512-xnhwVgyOh3eD++/XGtH+5qBwYTgCm0aW91GFgPJ3XG+jlsRLyJivnbP0QmUBFhI+Oaz9FV0s7cxgXHezwOEBYA=="
"resolved" "https://registry.npmjs.org/dom7/-/dom7-4.0.4.tgz" "resolved" "https://registry.npmjs.org/dom7/-/dom7-2.1.5.tgz"
"version" "4.0.4" "version" "2.1.5"
dependencies: dependencies:
"ssr-window" "^4.0.0" "ssr-window" "^2.0.0"
"domain-browser@^1.1.1": "domain-browser@^1.1.1":
"integrity" "sha1-PTH1AZGmdJ3RN1p/Ui6CPULlTto=" "integrity" "sha1-PTH1AZGmdJ3RN1p/Ui6CPULlTto="
@ -8572,10 +8572,10 @@
"safer-buffer" "^2.0.2" "safer-buffer" "^2.0.2"
"tweetnacl" "~0.14.0" "tweetnacl" "~0.14.0"
"ssr-window@^4.0.0", "ssr-window@^4.0.2": "ssr-window@^2.0.0":
"integrity" "sha512-ISv/Ch+ig7SOtw7G2+qkwfVASzazUnvlDTwypdLoPoySv+6MqlOV10VwPSE6EWkGjhW50lUmghPmpYZXMu/+AQ==" "integrity" "sha512-NXzN+/HPObKAx191H3zKlYomE5WrVIkoCB5IaSdvKokxTpjBdWfr0RaP+1Z5KOfDT0ZVz+2tdtiBkhsEQ9p+0A=="
"resolved" "https://registry.npmjs.org/ssr-window/-/ssr-window-4.0.2.tgz" "resolved" "https://registry.npmjs.org/ssr-window/-/ssr-window-2.0.0.tgz"
"version" "4.0.2" "version" "2.0.0"
"ssri@^6.0.1": "ssri@^6.0.1":
"integrity" "sha1-KjxBso3UW2K2Nnbst0ABJlrp7dg=" "integrity" "sha1-KjxBso3UW2K2Nnbst0ABJlrp7dg="
@ -8943,13 +8943,13 @@
"unquote" "~1.1.1" "unquote" "~1.1.1"
"util.promisify" "~1.0.0" "util.promisify" "~1.0.0"
"swiper@^8.0.6": "swiper@^5.4.5":
"integrity" "sha512-Ssyu1+FeNATF/G8e84QG+ZUNtUOAZ5vngdgxzczh0oWZPhGUVgkdv+BoePUuaCXLAFXnwVpNjgLIcGnxMdmWPA==" "integrity" "sha512-7QjA0XpdOmiMoClfaZ2lYN6ICHcMm72LXiY+NF4fQLFidigameaofvpjEEiTQuw3xm5eksG5hzkaRsjQX57vtA=="
"resolved" "https://registry.npmjs.org/swiper/-/swiper-8.0.6.tgz" "resolved" "https://registry.npmjs.org/swiper/-/swiper-5.4.5.tgz"
"version" "8.0.6" "version" "5.4.5"
dependencies: dependencies:
"dom7" "^4.0.4" "dom7" "^2.1.5"
"ssr-window" "^4.0.2" "ssr-window" "^2.0.0"
"table@^5.2.3": "table@^5.2.3":
"integrity" "sha1-EpLRlQDOP4YFOwXw6Ofko7shB54=" "integrity" "sha1-EpLRlQDOP4YFOwXw6Ofko7shB54="

Loading…
Cancel
Save