保安服务单位许可和备案申请系统
lin
2024-05-07 e047fc31f6d9c571b11a8c49072a34edb30176db
src/components/attach/attach.vue
@@ -1,75 +1,41 @@
<template>
  <basic-container class="hasButTwo">
    <avue-crud
      :option="option"
      :table-loading="loading"
      :data="data"
      :page.sync="page"
      :permission="permissionList"
      :before-open="beforeOpen"
      v-model="form"
      ref="crud"
      @row-del="rowDel"
      @search-change="searchChange"
      @search-reset="searchReset"
      @selection-change="selectionChange"
      @current-change="currentChange"
      @size-change="sizeChange"
      @refresh-change="refreshChange"
      @on-load="onLoad"
    >
    <avue-crud :option="option" :table-loading="loading" :data="data" :page.sync="page" :permission="permissionList"
      :before-open="beforeOpen" v-model="form" ref="crud" @row-del="rowDel" @search-change="searchChange"
      @search-reset="searchReset" @selection-change="selectionChange" @current-change="currentChange"
      @size-change="sizeChange" @refresh-change="refreshChange" @on-load="onLoad">
      <template slot="type" slot-scope="{ row }">
        <el-tag :class="row.type != 2 ? 'red' : ''">{{
          row.type != 2 ? "未上传" : "已上传"
        }}</el-tag>
      </template>
      <template slot="downtemplate" slot-scope="{ row }">
        <el-tag
          @click="downTemplates(row.template)"
          class="hand"
          :class="row.template == '' ? 'red' : ''"
          >{{ row.template == "" ? "无模板" : "下载模板" }}</el-tag
        >
        <el-tag @click="downTemplates(row.template)" class="hand"
          :class="row.template == '' ? 'red' : ''">{{ row.template == "" ? "无模板" : "下载模板" }}</el-tag>
      </template>
      <template slot-scope="{ type, size, row }" slot="menu">
        <el-button
          icon="el-icon-upload2"
          :size="size"
          :type="type"
          @click="upData(row)"
          >上传</el-button
        >
        <el-button
          icon="el-icon-download"
          :size="size"
          :type="type"
          :disabled="row.type != 2"
          @click="dowmData(row)"
          >下载</el-button
        >
        <el-button icon="el-icon-upload2" :size="size" :type="type" @click="upData(row)">上传</el-button>
        <el-button icon="el-icon-download" :size="size" :type="type" :disabled="row.type != 2"
          @click="dowmData(row)">下载</el-button>
      </template>
    </avue-crud>
    <el-dialog
      title="附件管理"
      append-to-body
      :visible.sync="attachBox"
      width="555px"
    >
      <avue-form
        ref="form"
        :option="attachOption"
        v-model="attachForm"
        :upload-after="uploadAfter"
      >
    <el-dialog title="附件管理" append-to-body :visible.sync="attachBox" width="555px">
      <avue-form ref="form" :option="attachOption" v-model="attachForm" :upload-after="uploadAfter">
      </avue-form>
    </el-dialog>
  </basic-container>
</template>
<script>
import { getUseInfor, getTemplate, addUseInfor } from "@/api/resource/attach";
import { mapGetters } from "vuex";
  import {
    getUseInfor,
    getTemplate,
    addUseInfor
  } from "@/api/resource/attach";
  import {
    mapGetters
  } from "vuex";
export default {
  props: ["type", "opens", "enclosure", "ptype"],
@@ -91,7 +57,6 @@
      selectionList: [],
      option: {
        height: 600,
        calcHeight: 30,
        tip: false,
        align: "center",
@@ -106,8 +71,7 @@
        viewBtn: true,
        selection: true,
        dialogClickModal: false,
        column: [
          {
          column: [{
            label: "附件名称",
            prop: "originalname",
            overHidden: true
@@ -128,13 +92,14 @@
          }
        ]
      },
      data: [],
        data: [{
          file: "name"
        }],
      attachForm: {},
      attachOption: {
        submitBtn: false,
        emptyBtn: false,
        column: [
          {
          column: [{
            label: "拖拽上传",
            prop: "imgUrl5",
            type: "upload",
@@ -143,16 +108,14 @@
            propsHttp: {
              res: "data"
            },
            tip:
              "支持上传jpg/png/doc/docx/xls/xlsx文件,图片不超过500Kb,文档不超过3Mb",
            tip: "支持上传jpg/png/doc/docx/xls/xlsx文件,图片不超过500Kb,文档不超过3Mb",
            action:
              // "/api/blade-resource/oss/endpoint/put-file-attach",
              "/api/blade-resource/oss/endpoint/put-file-attach?deptid=&type=" +
              type +
              "&cardid=" +
              cardid
          }
        ]
          }]
      },
      imgSee: false,
      imgUrl: "",
@@ -420,9 +383,11 @@
  background-color: rgba($color: #ff5151, $alpha: 0.1) !important;
  color: rgba($color: #ff5151, $alpha: 1) !important;
}
.hand:hover {
  cursor: pointer;
}
// .longbut {
//   // background-color: red !important;
//   width: 125px;