123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146 |
- <template>
- <view class="rf-category informationData">
- <navbar-search
- :list="search.searchList"
- @selectedItem="getSelectedItem">
- </navbar-search>
- <u-tabs
- :list="tabs.tabsList"
- :is-scroll="false"
- bar-width="140"
- :current="tabs.current"
- @change="tabsChange">
- </u-tabs>
- <view class="viewContent">
- <indicatorDataQuery
- v-if="tabs.current===0"
- :searchItem="search.searchItem"
- @reset="ResetParent"
- ></indicatorDataQuery>
- <indicatorDataRankings
- v-if="tabs.current===1"
- :searchItem="search.searchItem"
- @reset="ResetParent"
- ></indicatorDataRankings>
- <dataExportTool
- v-if="tabs.current===2"
- @reset="ResetParent"
- ></dataExportTool>
- </view>
- <u-toast ref="uToast" />
- </view>
- </template>
- <script>
- import navbarSearch from "./dom/navbarSearch1";
- import indicatorDataQuery from "./dom/indicatorDataQuery";
- import indicatorDataRankings from "./dom/indicatorDataRankings";
- import dataExportTool from "./dom/dataExportTool";
- let _self;
- export default {
- name:'informationData',
- components:{
- navbarSearch,
- indicatorDataQuery,
- indicatorDataRankings,
- dataExportTool
- },
- data(){
- return {
- /**
- * 搜索栏
- */
- search:{
- searchList: [],
- searchItem: {},
- },
- /**
- * 标签栏
- */
- tabs:{
- tabsList:[
- {
- name: this.$i18n.locale == 'zh' ? '指标数据查询' : 'Data Query'
- }, {
- name: this.$i18n.locale == 'zh' ? '指标数据排行' : 'Data Ranking'
- }, {
- name: this.$i18n.locale == 'zh' ? '数据导出工具' : 'Export Tool'
- }
- ],
- current:0
- },
- }
- },
- onLoad(option) {
- _self = this;
- if([0,1,2].includes(Number(option.current))){
- this.tabs.current = Number(option.current)
- }
- this.init()
- },
- methods:{
- async init() {
- await this.getServerData()
- },
- i18n(data) {
- return this.$t('common.' + data);
- },
- /**
- * 搜索栏
- */
- async getServerData() {
- const res = await this.$myRequest({
- url: '/op/geiIntegratedDataMenus/getMenu',
- data: {}
- });
- this.setNodeId(res.data,'child')
- this.search.searchList = res.data;
- },
- setNodeId(data,childrenName='children',id=''){
- data.forEach((item,index)=>{
- let nodeId = id?`${id}_${index}`:`${index}`;
- this.$set(item,'nodeId',nodeId)
- if(item[childrenName] && item[childrenName].length > 0){
- this.setNodeId(item[childrenName],childrenName,nodeId)
- }
- })
- },
- getSelectedItem(e) {
- this.search.searchItem = e
- },
- /**
- * 标签栏
- */
- tabsChange(index) {
- this.tabs.current = index;
- },
- ResetParent(e){
- console.log(e)
- uni.redirectTo({
- url: '/pages/information/InformationData/InformationData?current='+ e
- });
- }
- }
- }
- </script>
- <style scoped lang="scss">
- uni-page-body {
- padding-top: 0;
- }
- page {
- background: #fff;
- width: 750upx;
- overflow-x: hidden;
- height: 100%;
- overflow: hidden;
- }
- .informationData{
- height: 100%;
- .viewContent{
- height: calc(100% - 88upx)
- }
- }
- </style>
|