基于廊坊系统为基础,国防科技大学系统演示Demo
surprise
2024-04-29 8a90585f32ff7f0ceb807581db2d7b59e9820874
src/views/userManage/templateManage.vue
@@ -1,18 +1,25 @@
<template>
  <div class="authorityManagement_box">
    <My-bread :list="[
      `${$t('dataManage.dataManage')}`,
      `${$t('dataManage.templateManage')}`,
      `数据资源管理`,
      `通用模板管理`,
    ]"></My-bread>
    <el-divider />
    <div class="searchComp subpage_Div" ref="container">
      <el-form ref="ruleForm" :model="ruleForm" :inline="true">
    <div class="searchComp subpage_Div"
         ref="container">
      <el-form ref="ruleForm"
               :model="ruleForm"
               :inline="true">
        <div class="flex_box">
          <div style="margin-right: auto">
            <el-form-item :label="$t('userManage.authorityM.name')">
              <el-input style="width:200px" size="small" v-model="ruleForm.name"
                :placeholder="$t('userManage.authorityM.nameHolder')">
                <i slot="suffix" class="el-icon-search" @click="setRefreshTable"></i>
              <el-input style="width:200px"
                        size="small"
                        v-model="ruleForm.name"
                        :placeholder="$t('userManage.authorityM.nameHolder')">
                <i slot="suffix"
                   class="el-icon-search"
                   @click="setRefreshTable"></i>
              </el-input>
            </el-form-item>
          </div>
@@ -27,16 +34,25 @@
            <!--              >{{ $t('common.iquery') }}</el-button>-->
            <!--            </el-form-item>-->
            <el-form-item>
              <el-button v-if="btnStatus.insert" @click="setTableInsert" icon="el-icon-edit" type="success"
                size="small">{{ $t('common.append') }}</el-button>
              <el-button v-if="btnStatus.insert"
                         @click="setTableInsert"
                         icon="el-icon-edit"
                         type="success"
                         size="small">{{ $t('common.append') }}</el-button>
            </el-form-item>
            <el-form-item>
              <el-button v-if="btnStatus.delete" icon="el-icon-delete" @click="delTableData" type="danger"
                size="small">{{
              <el-button v-if="btnStatus.delete"
                         icon="el-icon-delete"
                         @click="delTableData"
                         type="danger"
                         size="small">{{
      $t('common.delete') }}</el-button>
            </el-form-item>
            <el-form-item>
              <el-button icon="el-icon-refresh" @click="restRefreshTable" type="info" size="small">{{ $t('common.empty')
              <el-button icon="el-icon-refresh"
                         @click="restRefreshTable"
                         type="info"
                         size="small">{{ $t('common.empty')
                }}</el-button>
            </el-form-item>
          </div>
@@ -45,20 +61,35 @@
      </el-form>
    </div>
    <div class="dividing-line"></div>
    <div class="table_box" :style="styleVar">
      <el-table :data="tableData" style="width: 100%" border @selection-change="handleSelectionChange"
        height="calc(100% - 45px)">
        <el-table-column type="selection" width="55" />
        <el-table-column align="center" type="index" :label="$t('dataManage.styleObj.index')" width="70px" />
        <el-table-column align="center" prop="name" :label="$t('dataManage.styleObj.name')" />
        <el-table-column align="center" prop="type" :label="$t('common.fileType')">
    <div class="table_box"
         :style="styleVar">
      <el-table :data="tableData"
                style="width: 100%"
                border
                @selection-change="handleSelectionChange"
                height="calc(100% - 65px)">
        <el-table-column type="selection"
                         width="55" />
        <el-table-column align="center"
                         type="index"
                         :label="$t('dataManage.styleObj.index')"
                         width="70px" />
        <el-table-column align="center"
                         prop="name"
                         :label="$t('dataManage.styleObj.name')" />
        <el-table-column align="center"
                         prop="type"
                         :label="$t('common.fileType')">
          <template slot-scope="scope">
            <span v-if="scope.row.type == 1">World模板 </span>
            <span v-else-if="scope.row.type == 2">Excel模板</span>
            <span v-else-if="scope.row.type == 3">Zip模板</span>
          </template>
        </el-table-column>
        <el-table-column align="center" prop="code" :label="$t('common.templateType')" :formatter="codeData" />
        <el-table-column align="center"
                         prop="code"
                         :label="$t('common.templateType')"
                         :formatter="codeData" />
        <!-- <el-table-column
          align="center"
          prop="fname"
@@ -69,25 +100,43 @@
          prop="bak"
          :label="$t('common.bak')"
        /> -->
        <el-table-column align="center" prop="createName" :label="$t('dataManage.vmobj.createonuser')" />
        <el-table-column align="center" prop="createTime" :label="$t('dataManage.vmobj.createontime')"
          :formatter="formatData" />
        <el-table-column min-width="100" :label="$t('dataManage.dictionaryManageObj.operation')">
        <el-table-column align="center"
                         prop="createName"
                         :label="$t('dataManage.vmobj.createonuser')" />
        <el-table-column align="center"
                         prop="createTime"
                         :label="$t('dataManage.vmobj.createontime')"
                         :formatter="formatData" />
        <el-table-column min-width="100"
                         :label="$t('dataManage.dictionaryManageObj.operation')">
          <template slot-scope="scope">
            <el-button v-if="btnStatus.select" @click="showDetail(scope.$index, scope.row)" type="primary" plain
              size="small">{{ $t('dataManage.dictionaryManageObj.lookOver') }}</el-button>
            <el-button v-if="btnStatus.update" @click="handleEdit(scope.$index, scope.row)" type="warning" plain
              size="small">{{ $t('dataManage.dictionaryManageObj.revamp') }}</el-button>
            <el-button v-if="btnStatus.download" plain @click="handleDownload(scope.$index, scope.row)" type="info"
              size="small">{{ $t('common.download') }}</el-button>
            <el-button v-if="btnStatus.select"
                       @click="showDetail(scope.$index, scope.row)"
                       type="primary"
                       plain
                       size="small">{{ $t('dataManage.dictionaryManageObj.lookOver') }}</el-button>
            <el-button v-if="btnStatus.update"
                       @click="handleEdit(scope.$index, scope.row)"
                       type="warning"
                       plain
                       size="small">{{ $t('dataManage.dictionaryManageObj.revamp') }}</el-button>
            <el-button v-if="btnStatus.download"
                       plain
                       @click="handleDownload(scope.$index, scope.row)"
                       type="info"
                       size="small">{{ $t('common.download') }}</el-button>
          </template>
        </el-table-column>
      </el-table>
      <div style="margin-top:10px">
        <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
          :current-page="listData.pageIndex" :page-sizes="[10, 20, 50, 100]" :page-size="listData.pageSize"
          layout="total, sizes, prev, pager, next, jumper" :total="listData.count">
        <el-pagination @size-change="handleSizeChange"
                       @current-change="handleCurrentChange"
                       :current-page="listData.pageIndex"
                       :page-sizes="[10, 20, 50, 100]"
                       :page-size="listData.pageSize"
                       layout="total, sizes, prev, pager, next, jumper"
                       :total="listData.count">
        </el-pagination>
      </div>
    </div>
@@ -95,29 +144,48 @@
    <el-dialog :title="behavior == '新增'
      ? `${$t('common.append')}`
      : `${$t('common.update')}`
      " :visible.sync="dialogVisible" :before-close="handleClose">
      "
               :visible.sync="dialogVisible"
               :before-close="handleClose">
      <div style="height: 500px; overflow: auto">
        <el-form ref="form" :model="editForm" label-width="100px" label-position="top">
        <el-form ref="form"
                 :model="editForm"
                 label-width="100px"
                 label-position="top">
          <el-form-item :label="$t('dataManage.styleObj.name')">
            <el-input style="width:85%" v-model="editForm.name"
              :placeholder="$t('shuJuGuanLi.shuJuJianSuo.valuetwo') + $t('dataManage.styleObj.name')"></el-input>
            <el-input style="width:85%"
                      v-model="editForm.name"
                      :placeholder="$t('shuJuGuanLi.shuJuJianSuo.valuetwo') + $t('dataManage.styleObj.name')"></el-input>
          </el-form-item>
          <el-form-item :label="$t('common.templateType')">
            <!-- <el-input
              style="width:100%"
              v-model=" editForm.code"
            ></el-input> -->
            <el-select :popper-append-to-body="false" style="width:85%" @change="selFileCodeChange"
              v-model="editForm.code"
              :placeholder="$t('shuJuGuanLi.shuJuJianSuo.valuetree') + $t('dataManage.common.templateType')">
              <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
            <el-select :popper-append-to-body="false"
                       style="width:85%"
                       @change="selFileCodeChange"
                       v-model="editForm.code"
                       disabled
                       :placeholder="$t('shuJuGuanLi.shuJuJianSuo.valuetree') + $t('dataManage.common.templateType')">
              <el-option v-for="item in options"
                         :key="item.value"
                         :label="item.label"
                         :value="item.value">
              </el-option>
            </el-select>
          </el-form-item>
          <el-form-item :label="$t('common.fileType')">
            <el-select :popper-append-to-body="false" v-model="editForm.type" @change="selFileTypeChange"
              :placeholder="$t('shuJuGuanLi.shuJuJianSuo.valuetree') + $t('common.fileType')" style="width:85%">
              <el-option v-for="item in typeOption" :key="item.value" :label="item.label" :value="item.value">
            <el-select :popper-append-to-body="false"
                       v-model="editForm.type"
                       @change="selFileTypeChange"
                       disabled
                       :placeholder="$t('shuJuGuanLi.shuJuJianSuo.valuetree') + $t('common.fileType')"
                       style="width:85%">
              <el-option v-for="item in typeOption"
                         :key="item.value"
                         :label="item.label"
                         :value="item.value">
              </el-option>
              <!-- <el-option
                label="World模板"
@@ -137,38 +205,66 @@
          <el-form-item :label="$t('common.filePath')">
            <div class="BoxFlex">
              <div class="BoxFlexinput">
                <el-input v-model="editForm.fname" disabled autocomplete="off" style="width:100%"></el-input>
                <el-input v-model="editForm.fname"
                          disabled
                          autocomplete="off"
                          style="width:100%"></el-input>
              </div>
              <div class="BoxFlexbutton">
                <input name="file1" type="file" id="editFile" multiple="multiple" :accept="selectFileType"
                  style="display: none" @change="geteditFile(1)" />
                <el-button style="margin-left: 6px;" type="primary" size="small" :underline="false"
                  @click="geteditFile(0)">选择</el-button>
                <el-button type="primary" size="small" :underline="false" @click="geteditFile(2)">上传</el-button>
                <input name="file1"
                       type="file"
                       id="editFile"
                       multiple="multiple"
                       :accept="selectFileType"
                       style="display: none"
                       @change="geteditFile(1)" />
                <el-button style="margin-left: 6px;"
                           type="primary"
                           size="small"
                           :underline="false"
                           @click="geteditFile(0)">选择</el-button>
                <el-button type="primary"
                           size="small"
                           :underline="false"
                           @click="geteditFile(2)">上传</el-button>
              </div>
            </div>
          </el-form-item>
          <el-form-item :label="$t('common.bak')">
            <el-input style="width:85%" v-model="editForm.bak"
              :placeholder="$t('shuJuGuanLi.shuJuJianSuo.valuetwo') + $t('common.bak')"></el-input>
            <el-input style="width:85%"
                      v-model="editForm.bak"
                      :placeholder="$t('shuJuGuanLi.shuJuJianSuo.valuetwo') + $t('common.bak')"></el-input>
          </el-form-item>
        </el-form>
      </div>
      <div v-if="behavior == '新增'" slot="footer" class="dialog-footer">
        <el-button size="small" @click="closeInsertData">取 消</el-button>
        <el-button type="primary" size="small" @click="addInsertData">确 定</el-button>
      <div v-if="behavior == '新增'"
           slot="footer"
           class="dialog-footer">
        <el-button size="small"
                   @click="closeInsertData">取 消</el-button>
        <el-button type="primary"
                   size="small"
                   @click="addInsertData">确 定</el-button>
      </div>
      <div v-if="behavior != '新增'" slot="footer" class="dialog-footer">
        <el-button size="small" @click="closeEditData">取 消</el-button>
        <el-button type="primary" size="small" @click="addEditData">确 定</el-button>
      <div v-if="behavior != '新增'"
           slot="footer"
           class="dialog-footer">
        <el-button size="small"
                   @click="closeEditData">取 消</el-button>
        <el-button type="primary"
                   size="small"
                   @click="addEditData">确 定</el-button>
      </div>
    </el-dialog>
    <div class="infoBox_box" v-show="showinfoBox">
    <div class="infoBox_box"
         v-show="showinfoBox">
      <div class="infoBox subpage_Div box_div">
        <div slot="header" class="clearfix">
        <div slot="header"
             class="clearfix">
          <span>{{ $t('dataManage.styleObj.deInformation') }}</span>
          <div style="float: right; cursor: pointer" @click="closeDetial">
          <div style="float: right; cursor: pointer"
               @click="closeDetial">
            <i class="el-icon-close"></i>
          </div>
        </div>
@@ -180,10 +276,10 @@
          </p>
          <el-divider></el-divider>
          <p>
          <p>
            <label> {{ $t('common.fileType') }}:</label>
            <label class="boxlabel">{{ itemdetail.fileType }}</label>
          </p>
            <p>
              <label> {{ $t('common.fileType') }}:</label>
              <label class="boxlabel">{{ itemdetail.fileType }}</label>
            </p>
          </p>
          <el-divider></el-divider>
          <p>
@@ -225,7 +321,9 @@
      </div>
    </div>
    <iframe id="downFrame" src="" style="display: none; border: 0; padding: 0; height: 0; width: 0"></iframe>
    <iframe id="downFrame"
            src=""
            style="display: none; border: 0; padding: 0; height: 0; width: 0"></iframe>
  </div>
</template>
@@ -243,7 +341,7 @@
export default {
  name: "templateManage",
  components: { MyBread },
  data() {
  data () {
    return {
      options: [],
      itemdetail: {},
@@ -287,66 +385,66 @@
      rowGuid: null,
    };
  },
  created() {
  created () {
    this.showPermsBtn();
    this.showTableData();
  },
  beforeDestroy() {
    this.timer && clearTimeout(this.timer);
    window.removeEventListener("resize", this.onResize);
  beforeDestroy () {
    this.timer&&clearTimeout(this.timer);
    window.removeEventListener("resize",this.onResize);
  },
  mounted() {
  mounted () {
    var obj = dataStatistics.statistics.filter(res => {
      if (res.isMenu != false)
    var obj=dataStatistics.statistics.filter(res => {
      if(res.isMenu!=false)
        return res;
    })
    this.options = obj
    window.addEventListener("resize", this.onResize);
    this.options=obj
    window.addEventListener("resize",this.onResize);
    this.calHeight();
  },
  methods: {
    onResize() {
      this.timer && clearTimeout(this.timer);
      this.timer = setTimeout(() => {
    onResize () {
      this.timer&&clearTimeout(this.timer);
      this.timer=setTimeout(() => {
        this.calHeight();
      }, 500);
      },500);
    },
    calHeight() {
    calHeight () {
      this.$nextTick(() => {
        const rect = this.$refs.container.getBoundingClientRect();
        this.tableHeight = `${rect.height + 97}px`;
        this.styleVar["height"] = `calc(100% - ${rect.height + 30}px)`;
        const rect=this.$refs.container.getBoundingClientRect();
        this.tableHeight=`${rect.height+97}px`;
        this.styleVar["height"]=`calc(100% - ${rect.height+30}px)`;
        // this.styleVar["height"] = `calc(100% - ${rect.height + 97}px)`;
      });
    },
    //修改取消
    closeEditData() {
    closeEditData () {
      this.closeInsertData();
    },
    handleClose() {
    handleClose () {
      var blackTheme;
      if (this.$store.state.themeflag == true) {
        blackTheme = {
      if(this.$store.state.themeflag==true) {
        blackTheme={
          customClass: "Black_theme",
        };
      }
      this.$confirm("关闭后无法保存,是否关闭?", blackTheme)
      this.$confirm("关闭后无法保存,是否关闭?",blackTheme)
        .then((_) => {
          this.closeInsertData();
        })
        .catch((_) => { });
    },
    codeData(row, column) {
    codeData (row,column) {
      var code = row.code;
      let val = this.options.filter(res => {
        if (res.value == code) {
      var code=row.code;
      let val=this.options.filter(res => {
        if(res.value==code) {
          return res
        }
      })
      if (val.length > 0) {
      if(val.length>0) {
        return val[0].label
      } else {
        return code
@@ -354,23 +452,23 @@
    },
    //查看
    showDetail(index, row) {
      this.itemdetail = row;
    showDetail (index,row) {
      this.itemdetail=row;
      if (parseInt(row.type) == 1) {
        this.itemdetail.fileType = "World模板";
      } else if (parseInt(row.type) == 2) {
        this.itemdetail.fileType = "Excel模板";
      } else if (parseInt(row.type) == 3) {
        this.itemdetail.fileType = "Zip模板";
      if(parseInt(row.type)==1) {
        this.itemdetail.fileType="World模板";
      } else if(parseInt(row.type)==2) {
        this.itemdetail.fileType="Excel模板";
      } else if(parseInt(row.type)==3) {
        this.itemdetail.fileType="Zip模板";
      }
      var val = this.options.filter(res => {
        if (res.value == row.code) {
      var val=this.options.filter(res => {
        if(res.value==row.code) {
          return res
        }
      })
      if (val.length > 0 && val[0].label) {
        this.itemdetail.code = val[0].label;
      if(val.length>0&&val[0].label) {
        this.itemdetail.code=val[0].label;
      }
      // if (row.code.indexOf("countSizes") != -1) {
@@ -385,31 +483,31 @@
      //   this.itemdetail.code = "用户流量统计";
      // }
      this.itemdetail.cTime = this.format(row.createTime);
      if (row.updateTime) {
      this.itemdetail.cTime=this.format(row.createTime);
      if(row.updateTime) {
        this.itemdetail.uTime = this.format(row.updateTime);
        this.itemdetail.uTime=this.format(row.updateTime);
      }
      // this.itemdetail.uTime = this.format(row.updateTime);
      this.showinfoBox = true;
      this.showinfoBox=true;
    },
    //关闭查看
    closeDetial() {
      this.showinfoBox = false;
    closeDetial () {
      this.showinfoBox=false;
    },
    //下载
    handleDownload(index, row) {
      var token = getToken();
      var url =
        BASE_URL + "/report/download?token=" + token + "&guid=" + row.guid;
      $("#downFrame").attr("src", url).click();
    handleDownload (index,row) {
      var token=getToken();
      var url=
        BASE_URL+"/report/download?token="+token+"&guid="+row.guid;
      $("#downFrame").attr("src",url).click();
    },
    //修改提交
    async addEditData() {
      this.editForm.guid = this.rowGuid;
    async addEditData () {
      this.editForm.guid=this.rowGuid;
      debugger
      const data = await report_update(this.editForm);
      if (data.code != 200) {
      const data=await report_update(this.editForm);
      if(data.code!=200) {
        return this.$message.error("修改失败");
      }
      this.$message({
@@ -419,107 +517,98 @@
      this.closeInsertData();
    },
    //文件类型切换
    selFileTypeChange(val) {
      if (parseInt(val) == 1) {
        this.selectFileType = ".docx";
      } else if (parseInt(val) == 2) {
        this.selectFileType = ".xlsx";
      } else if (parseInt(val) == 3) {
        this.selectFileType = ".zip";
    selFileTypeChange (val) {
      if(parseInt(val)==1) {
        this.selectFileType=".docx";
      } else if(parseInt(val)==2) {
        this.selectFileType=".xlsx";
      } else if(parseInt(val)==3) {
        this.selectFileType=".zip";
      }
    },
    selFileCodeChange(res) {
    selFileCodeChange (res) {
      var name;
      for (var i in this.options) {
        if (this.options[i].value == res) {
          name = this.options[i].label
      for(var i in this.options) {
        if(this.options[i].value==res) {
          name=this.options[i].label
          break;
        }
      }
      console.log(name)
      if (name.indexOf('统计') > -1) {
        this.typeOption = [{
          label: "World模板",
          value: "1"
        }, {
      if(name.indexOf('统计')>-1) {
        this.typeOption=[{
          label: "Excel模板",
          value: "2"
        }]
      } else {
        this.typeOption = [{
          label: "World模板",
          value: "1"
        }, {
        this.typeOption=[{
          label: "Excel模板",
          value: "2"
        }, {
          label: "Zip模板",
          value: "3"
        }]
      }
      this.editForm.type = this.typeOption[0].value
      this.editForm.type=this.typeOption[0].value
    },
    //修改
    handleEdit(index, row) {
      this.behavior = "修改";
      this.editForm = row;
    handleEdit (index,row) {
      this.behavior="修改";
      this.editForm=row;
      if (row.name.indexOf('统计') > -1) {
        this.typeOption = [{
      if(row.name.indexOf('统计')>-1) {
        this.typeOption=[{
          label: "World模板",
          value: "1"
        }, {
        },{
          label: "Excel模板",
          value: "2"
        }]
      } else {
        this.typeOption = [{
        this.typeOption=[{
          label: "World模板",
          value: "1"
        }, {
        },{
          label: "Excel模板",
          value: "2"
        }, {
        },{
          label: "Zip模板",
          value: "3"
        }]
      }
      if (parseInt(row.type) == 1) {
        this.selectFileType = ".docx";
      } else if (parseInt(row.type) == 2) {
        this.selectFileType = ".xlsx";
      if(parseInt(row.type)==1) {
        this.selectFileType=".docx";
      } else if(parseInt(row.type)==2) {
        this.selectFileType=".xlsx";
      }
      this.rowGuid = row.guid;
      this.rowGuid=row.guid;
      this.dialogVisible = true;
      this.dialogVisible=true;
    },
    //删除
    async delTableData() {
      if (this.multipleSelection.length == 0) {
    async delTableData () {
      if(this.multipleSelection.length==0) {
        return this.$message("请选择要删除的数据");
      }
      var std = [];
      for (var i in this.multipleSelection) {
      var std=[];
      for(var i in this.multipleSelection) {
        std.push(this.multipleSelection[i].id);
      }
      this.$confirm("此操作将永久删除该模块, 是否继续?", "提示", {
      this.$confirm("此操作将永久删除该模块, 是否继续?","提示",{
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(async () => {
          const data = await report_deletes({ ids: std.toString() });
          if (data.code == 200) {
            this.InsertFormdialog = false;
          const data=await report_deletes({ ids: std.toString() });
          if(data.code==200) {
            this.InsertFormdialog=false;
            this.$message({
              message: "删除成功!",
              type: "success",
@@ -550,21 +639,21 @@
    },
    //重置查询
    restRefreshTable() {
      this.ruleForm.name = "";
    restRefreshTable () {
      this.ruleForm.name="";
      this.setRefreshTable();
    },
    //重置刷新Table
    setRefreshTable() {
      this.listData.pageIndex = 1;
      this.listData.pageSize = 10;
    setRefreshTable () {
      this.listData.pageIndex=1;
      this.listData.pageSize=10;
      this.showTableData();
    },
    //新增一条数据
    async addInsertData() {
      this.editForm.guid = this.rowGuid;
      const data = await report_insert(this.editForm);
      if (data.code != 200) {
    async addInsertData () {
      this.editForm.guid=this.rowGuid;
      const data=await report_insert(this.editForm);
      if(data.code!=200) {
        return this.$message.error("新增失败");
      }
      this.$message({
@@ -574,9 +663,9 @@
      this.closeInsertData();
    },
    //关闭新增
    closeInsertData() {
      this.dialogVisible = false;
      this.editForm = {
    closeInsertData () {
      this.dialogVisible=false;
      this.editForm={
        fname: "",
        guid: "",
        name: "",
@@ -585,45 +674,46 @@
        bak: "",
      };
      this.setRefreshTable();
      document.getElementById("editFile").value = "";
      document.getElementById("editFile").value="";
    },
    //文件上传
    async geteditFile(res) {
    async geteditFile (res) {
      if (parseInt(this.editForm.type) == 1) {
        this.selectFileType = ".docx";
      } else if (parseInt(this.editForm.type) == 2) {
        this.selectFileType = ".xlsx";
      }
      // if(parseInt(this.editForm.type)==1) {
      //   this.selectFileType=".docx";
      // } else if(parseInt(this.editForm.type)==2) {
      //   this.selectFileType=".xlsx";
      // }
      this.selectFileType=".xlsx";
      this.$nextTick(() => {
        this.setEditFile(res)
      })
    },
    async setEditFile(res) {
      if (res == 0) {
        if (this.editForm.type == "") {
    async setEditFile (res) {
      if(res==0) {
        if(this.editForm.type=="") {
          return this.$message("请选择上传文件类型");
        }
        $("#editFile").click();
      } else if (res == 1) {
        var val = document.getElementById("editFile").files;
        if (!val || !val.length) return;
        this.editForm.fname = val[0].name;
      } else if (res == 2) {
        var fs = document.getElementById("editFile");
        if (fs.files.length == 0) {
      } else if(res==1) {
        var val=document.getElementById("editFile").files;
        if(!val||!val.length) return;
        this.editForm.fname=val[0].name;
      } else if(res==2) {
        var fs=document.getElementById("editFile");
        if(fs.files.length==0) {
          return;
        }
        var formData = new FormData();
        formData.append("file", fs.files[0]);
        var val_data = await report_upload(formData);
        if (val_data.code == 200) {
          this.editForm.guid = val_data.result;
          this.rowGuid = val_data.result;
        var formData=new FormData();
        formData.append("file",fs.files[0]);
        var val_data=await report_upload(formData);
        if(val_data.code==200) {
          this.editForm.guid=val_data.result;
          this.rowGuid=val_data.result;
          this.$message({
            message: "上传成功!",
            type: "success",
@@ -637,103 +727,94 @@
      }
    },
    //格式化列表
    formatData(row, column) {
      let data = row[column.property];
      if (data == null) {
    formatData (row,column) {
      let data=row[column.property];
      if(data==null) {
        return data;
      }
      return this.format(data);
    },
    //格式化时间
    format(shijianchuo) {
    format (shijianchuo) {
      //shijianchuo是整数,否则要parseInt转换
      var time = new Date(shijianchuo);
      var y = time.getFullYear();
      var m = time.getMonth() + 1;
      var d = time.getDate();
      var h = time.getHours();
      var mm = time.getMinutes();
      var s = time.getSeconds();
      return y + "-" + this.add0(m) + "-" + this.add0(d);
      var time=new Date(shijianchuo);
      var y=time.getFullYear();
      var m=time.getMonth()+1;
      var d=time.getDate();
      var h=time.getHours();
      var mm=time.getMinutes();
      var s=time.getSeconds();
      return y+"-"+this.add0(m)+"-"+this.add0(d);
    },
    //格式化时间
    add0(m) {
      return m < 10 ? "0" + m : m;
    add0 (m) {
      return m<10? "0"+m:m;
    },
    //Table选择事件
    handleSelectionChange(val) {
      this.multipleSelection = val;
    handleSelectionChange (val) {
      this.multipleSelection=val;
    },
    editFormStart() {
      this.editForm.code = "dataTable";
    editFormStart () {
      this.editForm.code="dataTable";
      var name;
      for (var i in this.options) {
        if (this.options[i].value == this.editForm.code) {
          name = this.options[i].label
      for(var i in this.options) {
        if(this.options[i].value==this.editForm.code) {
          name=this.options[i].label
          break;
        }
      }
      if (name.indexOf('统计') > -1) {
        this.typeOption = [{
          label: "World模板",
          value: "1"
        }, {
      if(name.indexOf('统计')>-1) {
        this.typeOption=[{
          label: "Excel模板",
          value: "2"
        }]
      } else {
        this.typeOption = [{
          label: "World模板",
          value: "1"
        }, {
        this.typeOption=[{
          label: "Excel模板",
          value: "2"
        }, {
          label: "Zip模板",
          value: "3"
        }]
      }
      this.editForm.type = this.typeOption[0].value
      this.editForm.type=this.typeOption[0].value
    },
    //新增弹窗
    setTableInsert() {
    setTableInsert () {
      this.editFormStart();
      this.behavior = "新增";
      this.dialogVisible = true;
      this.behavior="新增";
      this.dialogVisible=true;
    },
    //分页切换
    handleSizeChange(val) {
      this.listData.pageSize = val;
      this.listData.pageIndex = 1;
    handleSizeChange (val) {
      this.listData.pageSize=val;
      this.listData.pageIndex=1;
      this.showTableData();
    },
    //分页切换
    handleCurrentChange(val) {
      this.listData.pageIndex = val;
    handleCurrentChange (val) {
      this.listData.pageIndex=val;
      this.showTableData();
    },
    //列表调用
    async showTableData() {
      this.listData.name = this.ruleForm.name;
      const data = await report_selectByPageAndCount(this.listData);
      if (data.code != 200) {
    async showTableData () {
      this.listData.name=this.ruleForm.name;
      const data=await report_selectByPageAndCount(this.listData);
      if(data.code!=200) {
        return this.$message.error("列表调用失败");
      }
      this.tableData = data.result;
      this.listData.count = data.count;
      this.tableData=data.result;
      this.listData.count=data.count;
    },
    //权限配置
    showPermsBtn() {
      let currentPerms = this.$store.state.currentPerms;
      let permsEntity = this.$store.state.permsEntity;
    showPermsBtn () {
      let currentPerms=this.$store.state.currentPerms;
      let permsEntity=this.$store.state.permsEntity;
      permsEntity
        .filter((item) => item.perms == currentPerms)
        .map((item) => (this.btnStatus[item.tag.substr(1)] = true));
        .filter((item) => item.perms==currentPerms)
        .map((item) => (this.btnStatus[item.tag.substr(1)]=true));
    },
  },
};
@@ -742,10 +823,11 @@
<style lang="less" scoped>
//@import url(); 引入公共css类
.authorityManagement_box {
  height: 98%;
  width: 98%;
  height: calc(97.5% - 20px);
  width: calc(99% - 20px);
  padding: 0.5%;
  background: #f4f8ff;
  margin: 10px;
  .el-input {
    width: 730px;
  }