hejianhao
2025-04-16 dab2d210ca06c1faa514c6388fbd5de1ab355360
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<template>
  <div>
    <section class="sec">
      <p class="label">导入文件:</p>
      <article>
        <div class="avatar">
          <v-u
            :url="upl"
            accept=".xls, .xlsx"
            :exp="['application']"
            @path="onPath"
            @error="onError"
            @on-before="before"
          ></v-u>
        </div>
      </article>
      <div class="ext">可上传xls,xlsx,压缩文件 <span
          class="btn"
          @click="down"
        >下载模板</span></div>
    </section>
  </div>
</template>
 
<script>
import vU from "com/upload/upload1";
export default {
  props: {},
  components: { vU },
  data() {
    return {};
  },
  watch: {},
  computed: {
    upl() {
      return this.$js.api.http + "communitypartybuilding/downloadtemplate";
    },
  },
  methods: {
    onPath() {
      demo.toast("导入成功");
      this.$nextTick(() => {
        this.$store.dispatch("setFixed", {
          event: "del",
          type: "member-import",
          time: Date.now(),
        });
        this.$store.dispatch("setPageReset", "/com_member");
      });
    },
    onError(v) {
      demo.toast(v.msg);
    },
    before() {
      // console.log(v);
    },
    down() {
      this.$api.get("communitypartybuilding/downloadtemplate", {}, (e) => {
        demo.location(e);
      });
    },
  },
  mounted() {},
};
</script>
<style lang='less' scoped>
.sec {
  flex-wrap: wrap;
  .ext {
    box-sizing: border-box;
    padding-left: 100px;
    margin-top: 10px;
    font-size: 14px;
    color: #333;
    .btn {
      margin-left: 15px;
      color: #1890ff;
      cursor: pointer;
    }
  }
}
</style>