riku
2024-04-19 ce51d7719b4d908da5577751f0c840fab5d1a39e
20240419
已修改6个文件
已添加1个文件
109 ■■■■ 文件已修改
src/api/index.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components.d.ts 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/search-option/FYSearchBar.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/table/FYTable.vue 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/enum/location.js 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/fysp/scene/CompSceneImport.vue 39 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/fysp/scene/SceneInfo.vue 46 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/index.js
@@ -1,7 +1,7 @@
import axios from 'axios';
import { ElMessage } from 'element-plus';
const debug = false;
const debug = true;
let ip1 = 'http://47.100.191.150:9005/';
let ip1_file = 'http://47.100.191.150:9005/';
src/components.d.ts
@@ -26,6 +26,7 @@
    ElDatePicker: typeof import('element-plus/es')['ElDatePicker']
    ElDescriptions: typeof import('element-plus/es')['ElDescriptions']
    ElDescriptionsItem: typeof import('element-plus/es')['ElDescriptionsItem']
    ElDialog: typeof import('element-plus/es')['ElDialog']
    ElDivider: typeof import('element-plus/es')['ElDivider']
    ElDrawer: typeof import('element-plus/es')['ElDrawer']
    ElDropdown: typeof import('element-plus/es')['ElDropdown']
@@ -66,6 +67,7 @@
    ElTooltip: typeof import('element-plus/es')['ElTooltip']
    ElTransfer: typeof import('element-plus/es')['ElTransfer']
    ElTree: typeof import('element-plus/es')['ElTree']
    ElUpload: typeof import('element-plus/es')['ElUpload']
    Footer: typeof import('./components/core/Footer.vue')['default']
    FormCol: typeof import('./components/layout/FormCol.vue')['default']
    FYBgTaskCard: typeof import('./components/bg-task/FYBgTaskCard.vue')['default']
src/components/search-option/FYSearchBar.vue
@@ -3,6 +3,7 @@
    <slot name="options"></slot>
    <el-form-item>
      <el-button icon="Search" type="primary" @click="search">{{ btnText }}</el-button>
      <slot name="buttons"></slot>
    </el-form-item>
  </el-form>
</template>
src/components/table/FYTable.vue
@@ -4,6 +4,9 @@
      <template #options>
        <slot name="options"></slot>
      </template>
      <template #buttons>
        <slot name="buttons"></slot>
      </template>
    </FYSearchBar>
  </el-row>
  <el-row ref="expandRef">
src/enum/location.js
@@ -166,6 +166,22 @@
              ],
            },
            {
              label: '长宁区',
              value: ['310105', '长宁区'],
              children: [
                { label: '华阳路街道', value: ['310105001', '华阳路街道'] },
                { label: '江苏路街道', value: ['310105002', '江苏路街道'] },
                { label: '新华路街道', value: ['310105004', '新华路街道'] },
                { label: '周家桥街道', value: ['310105005', '周家桥街道'] },
                { label: '天山路街道', value: ['310105006', '天山路街道'] },
                { label: '仙霞新村街道', value: ['310105008', '仙霞新村街道'] },
                { label: '虹桥街道', value: ['310105009', '虹桥街道'] },
                { label: '程家桥街道', value: ['310105010', '程家桥街道'] },
                { label: '北新泾街道', value: ['310105011', '北新泾街道'] },
                { label: '新泾镇', value: ['310105102', '新泾镇'] },
              ],
            },
            {
              label: '宝山区',
              value: ['310113', '宝山区'],
              children: [],
src/views/fysp/scene/CompSceneImport.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,39 @@
<template>
  <el-button icon="Upload" type="success" @click="dialogVisible = true">批量导入</el-button>
  <el-dialog
    v-model="dialogVisible"
    title="场景信息批量导入"
    width="500"
    :before-close="handleClose"
  >
    <el-upload
      class="upload-demo"
      drag
      action="https://run.mocky.io/v3/9d059bf9-4660-45f2-925d-ce80ad6c4d15"
      multiple
      accept=".xlsx"
    >
      <el-icon class="el-icon--upload"><upload-filled /></el-icon>
      <div class="el-upload__text">拖动文件或<em>点击上传</em></div>
      <template #tip>
        <!-- <div class="el-upload__tip">jpg/png files with a size less than 500kb</div> -->
      </template>
    </el-upload>
    <template #footer>
      <div class="dialog-footer">
        <el-button @click="dialogVisible = false">取消</el-button>
        <el-button type="primary" @click="dialogVisible = false">确定</el-button>
      </div>
    </template>
  </el-dialog>
</template>
<script>
export default {
  data() {
    return {
      dialogVisible: false
    };
  }
};
</script>
src/views/fysp/scene/SceneInfo.vue
@@ -17,6 +17,10 @@
      ></FYOptionOnlineStatus>
    </template>
    <template #buttons>
      <CompSceneImport></CompSceneImport>
    </template>
    <template #table-column>
      <el-table-column fixed="left" prop="name" label="名称" width="400">
        <template #default="scope">
@@ -65,45 +69,47 @@
import { useLoadingStore } from '@/stores/loadingStore';
import { mapStores } from 'pinia';
import { useMessageBoxTip } from '@/composables/messageBox';
import CompSceneImport from "./CompSceneImport.vue";
export default {
  components: {
    CompSceneImport,
  },
  data() {
    return {
      formSearch: {
        _locations: {},
        scensetype: {},
        online: {},
      },
        online: {}
      }
    };
  },
  computed: {
    ...mapStores(useLoadingStore),
    ...mapStores(useLoadingStore)
  },
  methods: {
    onSearch(page, func) {
      const f = this.formSearch;
      const area = {};
      // è¡Œæ”¿åŒºåˆ’
      area.provincecode = f._locations.pCode
      area.citycode = f._locations.cCode
      area.districtcode = f._locations.dCode
      area.towncode = f._locations.tCode
      area.provincecode = f._locations.pCode;
      area.citycode = f._locations.cCode;
      area.districtcode = f._locations.dCode;
      area.towncode = f._locations.tCode;
      // åœºæ™¯ç±»åž‹
      area.scensetypeid = f.scensetype.value;
      if (area.scensetypeid == '0') area.scensetypeid = null;
      // ä¸Šä¸‹çº¿çŠ¶æ€
      area.online = f.online.value;
      return sceneApi
        .searchScene(area, page.currentPage, page.pageSize)
        .then((res) => {
          if (res.success) {
            func({
              data: res.data,
              total: res.head.totalCount,
            });
          }
        });
      return sceneApi.searchScene(area, page.currentPage, page.pageSize).then((res) => {
        if (res.success) {
          func({
            data: res.data,
            total: res.head.totalCount
          });
        }
      });
    },
    itemEdit(scope) {
      scope.row.loading1 = true;
@@ -130,10 +136,10 @@
            .finally(() => {
              scope.row.loading2 = false;
            });
        },
        }
      });
    },
  },
    }
  }
};
</script>