Fpanel.vue 4.78 KB
Newer Older
1
<template>
wangna committed
2 3 4
  <div class="eibs">
    <!-- =================左边============== -->
    <c-col :span="12" style="padding-right: 20px">
taojinrui committed
5 6 7
      <c-col :span="24">
        <el-form-item label="操作选择" prop="opetye">
          <c-select v-model="model.opetye" style="width: 100%">
wangna committed
8 9 10 11 12 13
            <el-option
              v-for="item in opetye"
              :key="item.value"
              :label="item.label"
              :value="item.value"
            ></el-option>
taojinrui committed
14 15 16
          </c-select>
        </el-form-item>
      </c-col>
wangna committed
17

taojinrui committed
18 19
      <c-col :span="24">
        <el-form-item label="本地文件路径" prop="filpth">
wangna committed
20 21 22 23 24 25
          <c-input
            v-model="model.filpth"
            style="width: 100%"
            placeholder="请输入本地文件路径"
            disabled
          ></c-input>
taojinrui committed
26 27
        </el-form-item>
      </c-col>
wangna committed
28

taojinrui committed
29 30
      <c-col :span="24">
        <el-form-item label="上传文件名" prop="newnam">
wangna committed
31 32 33 34 35
          <c-input
            v-model="model.newnam"
            style="width: 100%"
            :disabled="model.opetye !== '1'"
          ></c-input>
taojinrui committed
36 37
        </el-form-item>
      </c-col>
wangna committed
38

taojinrui committed
39
      <c-col :span="24">
wangna committed
40 41 42 43
        <el-form-item
          label="注意:上传文件若包含表头系统将无法解析"
          label-width="300px"
        ></el-form-item>
taojinrui committed
44
      </c-col>
wangna committed
45

taojinrui committed
46
      <c-col :span="24">
wangna committed
47 48 49 50 51
        <el-form-item label="删除首行上传" class="checkbox-left">
          <c-checkbox
            v-model="model.flg"
            :disabled="model.opetye !== '1'"
          ></c-checkbox>
taojinrui committed
52 53
        </el-form-item>
      </c-col>
wangna committed
54

taojinrui committed
55 56 57 58
      <c-col :span="24">
        <el-form-item label="解析文件名" prop="opefil">
          <c-input v-model="model.opefil" disabled></c-input>
        </el-form-item>
59
      </c-col>
taojinrui committed
60
    </c-col>
61

wangna committed
62
    <c-col :span="12" style="padding-left: 20px">
taojinrui committed
63
      <c-col :span="24">
wangna committed
64 65 66 67 68 69 70 71
        <el-form-item>
          <c-button
            type="primary"
            :disabled="!(this.flag && model.opetye == '1')"
            @click="onOpnfil"
            >文件预览</c-button
          >
        </el-form-item>
taojinrui committed
72
      </c-col>
wangna committed
73

taojinrui committed
74
      <c-col :span="24">
wangna committed
75 76 77 78 79 80 81
        <el-form-item>
        <c-button
          type="primary"
          :disabled="!(this.flag && model.opetye == '1')"
          @click="onUpload"
          >文件上传</c-button
        ></el-form-item>
taojinrui committed
82
      </c-col>
wangna committed
83
     
taojinrui committed
84
      <c-col :span="24">
wangna committed
85 86 87 88 89 90 91
        <el-form-item>
        <c-button
          type="primary"
          :disabled="!(this.flag && model.opetye == '2')"
          @click="onReadfil"
          >文件解析</c-button
        ></el-form-item>
92
      </c-col>
wangna committed
93
      
taojinrui committed
94
      <c-col :span="24">
wangna committed
95 96 97 98 99 100 101 102 103 104
        <el-form-item>
        <c-button
          type="primary"
          :disabled="
            !(this.flag && (model.opetye == '1' || model.opetye == '2'))
          "
          @click="onDel"
        >
          文件删除</c-button
        ></el-form-item>
taojinrui committed
105 106
      </c-col>
    </c-col>
wangna committed
107 108 109 110 111 112 113 114 115 116

    <c-col :span="24">
      <c-istream-table
        :list="model.filstm.rows || []"
        :columns="stmData.columns"
        :showButtonFlg="true"
        @chooseRowEvent="rowcli"
      >
      </c-istream-table>
    </c-col>
117 118 119
  </div>
</template>
<script>
taojinrui committed
120
import Api from "~/service/Api";
121
import commonProcess from "~/mixin/commonProcess";
taojinrui committed
122 123
import CodeTable from "~/config/CodeTable";
import Event from "~/model/Cptbat/Event";
124 125

export default {
taojinrui committed
126 127 128 129 130
  inject: ["root"],
  props: ["model", "codes"],
  mixins: [commonProcess],
  data() {
    return {
nanrui committed
131
      flag: false,
taojinrui committed
132 133 134 135 136 137
      opetye: [
        { label: "文件上传", value: "1" },
        { label: "文件解析", value: "2" },
        { label: "已解析文件", value: "3" },
      ],
      stmData: {
wangna committed
138
        columns: ['0 1 "批量文件列表" '],
taojinrui committed
139 140 141 142 143 144
        data: [],
      },
    };
  },
  methods: {
    ...Event,
taojinrui committed
145
  },
nanrui committed
146
  watch: {
taojinrui committed
147 148 149
    "model.opetye": {
      immediate: true,
      async handler(val, oldVal) {
wangna committed
150 151
        if (this.model.opetye == "1") {
          let rtnmsg = await this.executeRule("opetye");
nanrui committed
152 153
          if (rtnmsg.respCode == SUCCESS) {
            //TODO 处理数据逻辑
wangna committed
154 155
          } else {
            this.$notify.error({ title: "错误", message: "服务请求失败!" });
nanrui committed
156
          }
wangna committed
157 158
        } else if (this.model.opetye == "2") {
          let rtnmsg = await this.executeRule("opetye");
nanrui committed
159 160
          if (rtnmsg.respCode == SUCCESS) {
            //TODO 处理数据逻辑
wangna committed
161 162
          } else {
            this.$notify.error({ title: "错误", message: "服务请求失败!" });
nanrui committed
163 164
          }
        }
wangna committed
165 166
        if (this.model.opetye == "3") {
          let rtnmsg = await this.executeRule("opetye");
nanrui committed
167 168
          if (rtnmsg.respCode == SUCCESS) {
            //TODO 处理数据逻辑
wangna committed
169 170
          } else {
            this.$notify.error({ title: "错误", message: "服务请求失败!" });
nanrui committed
171
          }
taojinrui committed
172 173 174
        }
      },
    },
taojinrui committed
175
  },
wangna committed
176
  created: function () {},
taojinrui committed
177
};
178 179 180
</script>
<style>
</style>