Sanmu8 hai 1 ano
pai
achega
df081999a1
Modificáronse 2 ficheiros con 290 adicións e 635 borrados
  1. 0 436
      src/views/CONTACTUS/index.vue
  2. 290 199
      src/views/OPSERVICE/index.vue

+ 0 - 436
src/views/CONTACTUS/index.vue

@@ -1,436 +0,0 @@
-<template>
-  <div class="app-container">
-    <el-form
-      :model="queryParams"
-      ref="queryForm"
-      size="small"
-      :inline="true"
-      v-show="showSearch"
-      label-width="68px"
-    >
-      <el-form-item label="文件名称" prop="serviceName">
-        <el-input v-model="queryParams.serviceName"></el-input>
-      </el-form-item>
-      <el-form-item label="服务类型" prop="serviceType">
-        <el-select
-          v-model="queryParams.serviceType"
-          placeholder="请选择服务类型"
-          clearable
-          filterable
-        >
-          <el-option
-            v-for="dict in optionList"
-            :key="dict.value"
-            :label="dict.label"
-            :value="dict.value"
-          />
-        </el-select>
-      </el-form-item>
-      <el-form-item>
-        <el-button
-          type="primary"
-          icon="el-icon-search"
-          size="mini"
-          @click="handleQuery"
-          >搜索</el-button
-        >
-        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
-          >重置</el-button
-        >
-      </el-form-item>
-    </el-form>
-
-    <el-row :gutter="10" class="mb8">
-      <el-col :span="1.5">
-        <el-button
-          type="primary"
-          plain
-          icon="el-icon-plus"
-          size="mini"
-          @click="handleAdd"
-          v-hasPermi="['business:OPSERVICE:add']"
-          >新增</el-button
-        >
-      </el-col>
-      <el-col :span="1.5">
-        <el-button
-          type="success"
-          plain
-          icon="el-icon-edit"
-          size="mini"
-          :disabled="single"
-          @click="handleUpdate"
-          v-hasPermi="['business:OPSERVICE:edit']"
-          >修改</el-button
-        >
-      </el-col>
-      <el-col :span="1.5">
-        <el-button
-          type="danger"
-          plain
-          icon="el-icon-delete"
-          size="mini"
-          :disabled="multiple"
-          @click="handleDelete"
-          v-hasPermi="['business:OPSERVICE:remove']"
-          >删除</el-button
-        >
-      </el-col>
-      <el-col :span="1.5">
-        <el-button
-          type="warning"
-          plain
-          icon="el-icon-download"
-          size="mini"
-          @click="handleExport"
-          v-hasPermi="['business:OPSERVICE:export']"
-          >导出</el-button
-        >
-      </el-col>
-      <right-toolbar
-        :showSearch.sync="showSearch"
-        @queryTable="getList"
-      ></right-toolbar>
-    </el-row>
-
-    <el-table
-      v-loading="loading"
-      :data="OPSERVICEList"
-      @selection-change="handleSelectionChange"
-    >
-      <!-- <el-table-column type="selection" width="55" align="center" /> -->
-      <el-table-column label="文件名称" align="center" prop="serviceName">
-        <template slot-scope="scope">
-          {{ scope.row.serviceName }}
-        </template>
-      </el-table-column>
-      <el-table-column label="服务类型" align="center" prop="serviceType">
-        <template slot-scope="scope">
-          {{ searchType(scope.row.serviceType) }}
-        </template>
-      </el-table-column>
-      <el-table-column label="上传时间" align="center" prop="createTime">
-        <template slot-scope="scope">
-          {{ scope.row.createTime }}
-        </template>
-      </el-table-column>
-      <el-table-column label="上传人" align="center" prop="createBy">
-        <template slot-scope="scope">
-          {{ scope.row.createBy }}
-        </template>
-      </el-table-column>
-
-      <!-- <el-table-column label="文件附件" align="center" prop="linkUrl">
-        <template slot-scope="scope">
-          {{ scope.row.linkUrl }}
-        </template>
-      </el-table-column> -->
-      <el-table-column label="下载次数" align="center" prop="download">
-        <template slot-scope="scope">
-          {{ scope.row.download?scope.row.download:'暂无下载' }}
-        </template>
-      </el-table-column>
-
-      <el-table-column
-        label="操作"
-        align="center"
-        class-name="small-padding fixed-width"
-      >
-        <template slot-scope="scope">
-          <el-button
-            size="mini"
-            type="text"
-            @click="handleUpdate(scope.row)"
-            v-hasPermi="['business:OPSERVICE:edit']"
-            >修改</el-button
-          >
-          <el-button
-            size="mini"
-            type="text"
-            @click="handleDelete(scope.row)"
-            v-hasPermi="['business:OPSERVICE:remove']"
-            >删除</el-button
-          >
-          <el-button
-            size="mini"
-            type="text"
-            @click="handleDownload(scope.row)"
-            v-hasPermi="['business:OPSERVICE:remove']"
-            >下载</el-button
-          >
-        </template>
-      </el-table-column>
-    </el-table>
-
-    <pagination
-      v-show="total > 0"
-      :total="total"
-      :page.sync="queryParams.pageNum"
-      :limit.sync="queryParams.pageSize"
-      @pagination="getList"
-    />
-
-    <!-- 添加或修改运营服务对话框 -->
-    <el-dialog :title="title" :visible.sync="open" width="70%" append-to-body>
-      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
-        <el-form-item label="文件" prop="linkUrl">
-          <el-upload
-            :http-request="httprequest"
-            :before-upload="uploadFile"
-            :limit="1"
-            class="upload-demo"
-            action="#"
-            :auto-upload="true"
-            :on-change="handleChange"
-            :file-list="fileList"
-          >
-            <el-button size="small" type="primary">点击上传</el-button>
-          </el-upload>
-        </el-form-item>
-        <el-form-item label="服务类型" prop="serviceType">
-          <el-select
-            v-model="form.serviceType"
-            placeholder="请选择服务类型"
-            filterable
-          >
-            <el-option
-              v-for="dict in optionList"
-              :key="dict.value + 'serviceType'"
-              :label="dict.label"
-              :value="dict.value"
-            ></el-option>
-          </el-select>
-        </el-form-item>
-
-        <el-form-item label="文件名称" prop="serviceName">
-          <el-input v-model="form.serviceName"></el-input>
-        </el-form-item>
-      </el-form>
-      <div slot="footer" class="dialog-footer">
-        <el-button type="primary" @click="submitForm">确 定</el-button>
-        <el-button @click="cancel">取 消</el-button>
-      </div>
-    </el-dialog>
-  </div>
-</template>
-
-<script>
-import {
-  listOPSERVICE,
-  getOPSERVICE,
-  delOPSERVICE,
-  addOPSERVICE,
-  updateOPSERVICE,
-  upload,
-  download
-} from "@/api/portal/OPSERVICE/OPSERVICE.js";
-
-export default {
-  name: "OPSERVICE",
-  data() {
-    return {
-      fileList: [],
-      //1=招商服务2培训服务
-      optionList: [
-        { label: "招商服务", value: "1" },
-        { label: "培训服务", value: "2" },
-      ],
-      // 根路径
-      baseURL: process.env.VUE_APP_BASE_API,
-      // 遮罩层
-      loading: true,
-      // 选中数组
-      ids: [],
-      // 非单个禁用
-      single: true,
-      // 非多个禁用
-      multiple: true,
-      // 显示搜索条件
-      showSearch: true,
-      // 总条数
-      total: 0,
-      // 运营服务表格数据
-      OPSERVICEList: [],
-      // 弹出层标题
-      title: "",
-      // 是否显示弹出层
-      open: false,
-      // 查询参数
-      queryParams: {
-        pageNum: 1,
-        pageSize: 10,
-        id: null,
-        createTime: null,
-        createBy: null,
-        updateTime: null,
-        updateBy: null,
-        delFlag: null,
-        deptId: null,
-        serviceName: null,
-        linkUrl: null,
-        download: null,
-        serviceType: null,
-      },
-      // 表单参数
-      form: {},
-      // 表单校验
-      rules: {
-        id: [{ required: true, message: "主键id不能为空", trigger: "blur" }],
-        delFlag: [
-          { required: true, message: "删除状态不能为空", trigger: "blur" },
-        ],
-        deptId: [
-          { required: true, message: "部门id不能为空", trigger: "blur" },
-        ],
-        serviceName: [
-          { required: true, message: "文件名称不能为空", trigger: "blur" },
-        ],
-        linkUrl: [
-          { required: true, message: "文件附件不能为空", trigger: "blur" },
-        ],
-        download: [
-          { required: true, message: "下载次数不能为空", trigger: "blur" },
-        ],
-        serviceType: [
-          { required: true, message: "服务类型不能为空", trigger: "change" },
-        ],
-      },
-    };
-  },
-  created() {
-    this.getList();
-  },
-  methods: {
-    /** 查询运营服务列表 */
-    getList() {
-      this.loading = true;
-      listOPSERVICE(this.queryParams).then((response) => {
-        this.OPSERVICEList = response.rows;
-        this.total = response.total;
-        this.loading = false;
-      });
-    },
-    handleDownload(row){
-      let data = new FormData()
-      data.append('resource',row.serviceName)
-      data.append('delete',false)
-      download(data).then(res=>{
-      })
-    },
-    httprequest() {},
-    uploadFile(file) {
-      let formData = new FormData();
-      formData.append("file", file);
-      upload(formData).then((res) => {
-        this.form.linkUrl = res.url;
-        this.$set(this.form, "serviceName", res.originalFilename);
-      });
-    },
-    handleChange(file, fileList) {
-      this.fileList = fileList.slice(-3);
-    },
-    searchType(type) {
-      let fined = this.optionList.find((item) => item.value == type);
-      if (fined.label != undefined) {
-        return fined.label;
-      } else {
-        return "未选择类型!";
-      }
-    },
-    // 取消按钮
-    cancel() {
-      this.open = false;
-      this.reset();
-    },
-    // 表单重置
-    reset() {
-      this.form = {
-        id: null,
-        delFlag: null,
-        deptId: null,
-        serviceName: null,
-        linkUrl: null,
-        download: null,
-        serviceType: null,
-      };
-      this.resetForm("form");
-    },
-    /** 搜索按钮操作 */
-    handleQuery() {
-      this.queryParams.pageNum = 1;
-      this.getList();
-    },
-    /** 重置按钮操作 */
-    resetQuery() {
-      this.resetForm("queryForm");
-      this.handleQuery();
-    },
-    // 多选框选中数据
-    handleSelectionChange(selection) {
-      this.ids = selection.map((item) => item.id);
-      this.single = selection.length !== 1;
-      this.multiple = !selection.length;
-    },
-    /** 新增按钮操作 */
-    handleAdd() {
-      this.reset();
-      this.open = true;
-      this.title = "添加运营服务";
-    },
-    /** 修改按钮操作 */
-    handleUpdate(row) {
-      this.reset();
-      const id = row.id || this.ids;
-      getOPSERVICE(id).then((response) => {
-        this.form = response.data;
-        this.open = true;
-        this.title = "修改运营服务";
-      });
-    },
-    /** 提交按钮 */
-    submitForm() {
-      this.$refs["form"].validate((valid) => {
-        if (valid) {
-          if (this.form.id != null) {
-            updateOPSERVICE(this.form).then((response) => {
-              this.$modal.msgSuccess("修改成功");
-              this.open = false;
-              this.getList();
-            });
-          } else {
-            addOPSERVICE(this.form).then((response) => {
-              this.$modal.msgSuccess("新增成功");
-              this.open = false;
-              this.getList();
-            });
-          }
-        }
-      });
-    },
-    /** 删除按钮操作 */
-    handleDelete(row) {
-      const ids = row.id || this.ids;
-      this.$modal
-        .confirm('是否确认删除运营服务编号为"' + ids + '"的数据项?')
-        .then(function () {
-          return delOPSERVICE(ids);
-        })
-        .then(() => {
-          this.getList();
-          this.$modal.msgSuccess("删除成功");
-        })
-        .catch(() => {});
-    },
-    /** 导出按钮操作 */
-    handleExport() {
-      this.download(
-        "business/OPSERVICE/export",
-        {
-          ...this.queryParams,
-        },
-        `OPSERVICE_${new Date().getTime()}.xlsx`
-      );
-    },
-  },
-};
-</script>

+ 290 - 199
src/views/OPSERVICE/index.vue

@@ -1,182 +1,240 @@
 <template>
-<!--  <div class="app-container">-->
-<!--    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">-->
-<!--      <el-form-item label="服务状态" prop="serviceType">-->
-<!--        <el-select v-model="queryParams.serviceType" placeholder="请选择服务状态" clearable filterable>-->
-<!--          <el-option-->
-<!--            v-for="dict in dict.type.${dictType}"-->
-<!--            :key="dict.value"-->
-<!--            :label="dict.label"-->
-<!--            :value="dict.value"-->
-<!--          />-->
-<!--        </el-select>-->
-<!--      </el-form-item>-->
-<!--      <el-form-item>-->
-<!--        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>-->
-<!--        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>-->
-<!--      </el-form-item>-->
-<!--    </el-form>-->
+  <div class="app-container">
+    <el-form
+      :model="queryParams"
+      ref="queryForm"
+      size="small"
+      :inline="true"
+      v-show="showSearch"
+      label-width="68px"
+    >
+      <el-form-item label="文件名称" prop="serviceName">
+        <el-input v-model="queryParams.serviceName"></el-input>
+      </el-form-item>
+      <el-form-item label="服务类型" prop="serviceType">
+        <el-select
+          v-model="queryParams.serviceType"
+          placeholder="请选择服务类型"
+          clearable
+          filterable
+        >
+          <el-option
+            v-for="dict in optionList"
+            :key="dict.value"
+            :label="dict.label"
+            :value="dict.value"
+          />
+        </el-select>
+      </el-form-item>
+      <el-form-item>
+        <el-button
+          type="primary"
+          icon="el-icon-search"
+          size="mini"
+          @click="handleQuery"
+          >搜索</el-button
+        >
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
+          >重置</el-button
+        >
+      </el-form-item>
+    </el-form>
 
-<!--    <el-row :gutter="10" class="mb8">-->
-<!--      <el-col :span="1.5">-->
-<!--        <el-button-->
-<!--          type="primary"-->
-<!--          plain-->
-<!--          icon="el-icon-plus"-->
-<!--          size="mini"-->
-<!--          @click="handleAdd"-->
-<!--          v-hasPermi="['business:OPSERVICE:add']"-->
-<!--        >新增</el-button>-->
-<!--      </el-col>-->
-<!--      <el-col :span="1.5">-->
-<!--        <el-button-->
-<!--          type="success"-->
-<!--          plain-->
-<!--          icon="el-icon-edit"-->
-<!--          size="mini"-->
-<!--          :disabled="single"-->
-<!--          @click="handleUpdate"-->
-<!--          v-hasPermi="['business:OPSERVICE:edit']"-->
-<!--        >修改</el-button>-->
-<!--      </el-col>-->
-<!--      <el-col :span="1.5">-->
-<!--        <el-button-->
-<!--          type="danger"-->
-<!--          plain-->
-<!--          icon="el-icon-delete"-->
-<!--          size="mini"-->
-<!--          :disabled="multiple"-->
-<!--          @click="handleDelete"-->
-<!--          v-hasPermi="['business:OPSERVICE:remove']"-->
-<!--        >删除</el-button>-->
-<!--      </el-col>-->
-<!--      <el-col :span="1.5">-->
-<!--        <el-button-->
-<!--          type="warning"-->
-<!--          plain-->
-<!--          icon="el-icon-download"-->
-<!--          size="mini"-->
-<!--          @click="handleExport"-->
-<!--          v-hasPermi="['business:OPSERVICE:export']"-->
-<!--        >导出</el-button>-->
-<!--      </el-col>-->
-<!--      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>-->
-<!--    </el-row>-->
+    <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button
+          type="primary"
+          plain
+          icon="el-icon-plus"
+          size="mini"
+          @click="handleAdd"
+          v-hasPermi="['business:OPSERVICE:add']"
+          >新增</el-button
+        >
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="success"
+          plain
+          icon="el-icon-edit"
+          size="mini"
+          :disabled="single"
+          @click="handleUpdate"
+          v-hasPermi="['business:OPSERVICE:edit']"
+          >修改</el-button
+        >
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="danger"
+          plain
+          icon="el-icon-delete"
+          size="mini"
+          :disabled="multiple"
+          @click="handleDelete"
+          v-hasPermi="['business:OPSERVICE:remove']"
+          >删除</el-button
+        >
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          plain
+          icon="el-icon-download"
+          size="mini"
+          @click="handleExport"
+          v-hasPermi="['business:OPSERVICE:export']"
+          >导出</el-button
+        >
+      </el-col>
+      <right-toolbar
+        :showSearch.sync="showSearch"
+        @queryTable="getList"
+      ></right-toolbar>
+    </el-row>
 
-<!--    <el-table v-loading="loading" :data="OPSERVICEList" @selection-change="handleSelectionChange">-->
-<!--      <el-table-column type="selection" width="55" align="center" />-->
-<!--      <el-table-column label="主键id" align="center" prop="id">-->
-<!--        <template slot-scope="scope">-->
-<!--          <dict-tag :options="dict.type.${column.dictType}" :value="scope.row.id"/>-->
-<!--        </template>-->
-<!--      </el-table-column>-->
-<!--      <el-table-column label="上传时间" align="center" prop="createTime">-->
-<!--        <template slot-scope="scope">-->
-<!--          <dict-tag :options="dict.type.${column.dictType}" :value="scope.row.createTime"/>-->
-<!--        </template>-->
-<!--      </el-table-column>-->
-<!--      <el-table-column label="上传人" align="center" prop="createBy">-->
-<!--        <template slot-scope="scope">-->
-<!--          <dict-tag :options="dict.type.${column.dictType}" :value="scope.row.createBy"/>-->
-<!--        </template>-->
-<!--      </el-table-column>-->
-<!--      <el-table-column label="修改时间" align="center" prop="updateTime">-->
-<!--        <template slot-scope="scope">-->
-<!--          <dict-tag :options="dict.type.${column.dictType}" :value="scope.row.updateTime"/>-->
-<!--        </template>-->
-<!--      </el-table-column>-->
-<!--      <el-table-column label="修改人" align="center" prop="updateBy">-->
-<!--        <template slot-scope="scope">-->
-<!--          <dict-tag :options="dict.type.${column.dictType}" :value="scope.row.updateBy"/>-->
-<!--        </template>-->
-<!--      </el-table-column>-->
-<!--      <el-table-column label="删除状态" align="center" prop="delFlag">-->
-<!--        <template slot-scope="scope">-->
-<!--          <dict-tag :options="dict.type.${column.dictType}" :value="scope.row.delFlag"/>-->
-<!--        </template>-->
-<!--      </el-table-column>-->
-<!--      <el-table-column label="部门id" align="center" prop="deptId">-->
-<!--        <template slot-scope="scope">-->
-<!--          <dict-tag :options="dict.type.${column.dictType}" :value="scope.row.deptId"/>-->
-<!--        </template>-->
-<!--      </el-table-column>-->
-<!--      <el-table-column label="文件名称" align="center" prop="serviceName">-->
-<!--        <template slot-scope="scope">-->
-<!--          <dict-tag :options="dict.type.${column.dictType}" :value="scope.row.serviceName"/>-->
-<!--        </template>-->
-<!--      </el-table-column>-->
-<!--      <el-table-column label="文件附件" align="center" prop="linkUrl">-->
-<!--        <template slot-scope="scope">-->
-<!--          <dict-tag :options="dict.type.${column.dictType}" :value="scope.row.linkUrl"/>-->
-<!--        </template>-->
-<!--      </el-table-column>-->
-<!--      <el-table-column label="下载次数" align="center" prop="download">-->
-<!--        <template slot-scope="scope">-->
-<!--          <dict-tag :options="dict.type.${column.dictType}" :value="scope.row.download"/>-->
-<!--        </template>-->
-<!--      </el-table-column>-->
-<!--      <el-table-column label="服务状态" align="center" prop="serviceType">-->
-<!--        <template slot-scope="scope">-->
-<!--          <dict-tag :options="dict.type.${column.dictType}" :value="scope.row.serviceType"/>-->
-<!--        </template>-->
-<!--      </el-table-column>-->
-<!--      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">-->
-<!--        <template slot-scope="scope">-->
-<!--          <el-button-->
-<!--            size="mini"-->
-<!--            type="text"-->
-<!--            icon="el-icon-edit"-->
-<!--            @click="handleUpdate(scope.row)"-->
-<!--            v-hasPermi="['business:OPSERVICE:edit']"-->
-<!--          >修改</el-button>-->
-<!--          <el-button-->
-<!--            size="mini"-->
-<!--            type="text"-->
-<!--            icon="el-icon-delete"-->
-<!--            @click="handleDelete(scope.row)"-->
-<!--            v-hasPermi="['business:OPSERVICE:remove']"-->
-<!--          >删除</el-button>-->
-<!--        </template>-->
-<!--      </el-table-column>-->
-<!--    </el-table>-->
+    <el-table
+      v-loading="loading"
+      :data="OPSERVICEList"
+      @selection-change="handleSelectionChange"
+    >
+      <!-- <el-table-column type="selection" width="55" align="center" /> -->
+      <el-table-column label="文件名称" align="center" prop="serviceName">
+        <template slot-scope="scope">
+          {{ scope.row.serviceName }}
+        </template>
+      </el-table-column>
+      <el-table-column label="服务类型" align="center" prop="serviceType">
+        <template slot-scope="scope">
+          {{ searchType(scope.row.serviceType) }}
+        </template>
+      </el-table-column>
+      <el-table-column label="上传时间" align="center" prop="createTime">
+        <template slot-scope="scope">
+          {{ scope.row.createTime }}
+        </template>
+      </el-table-column>
+      <el-table-column label="上传人" align="center" prop="createBy">
+        <template slot-scope="scope">
+          {{ scope.row.createBy }}
+        </template>
+      </el-table-column>
 
-<!--    <pagination-->
-<!--      v-show="total>0"-->
-<!--      :total="total"-->
-<!--      :page.sync="queryParams.pageNum"-->
-<!--      :limit.sync="queryParams.pageSize"-->
-<!--      @pagination="getList"-->
-<!--    />-->
+      <!-- <el-table-column label="文件附件" align="center" prop="linkUrl">
+        <template slot-scope="scope">
+          {{ scope.row.linkUrl }}
+        </template>
+      </el-table-column> -->
+      <el-table-column label="下载次数" align="center" prop="download">
+        <template slot-scope="scope">
+          {{ scope.row.download?scope.row.download:'暂无下载' }}
+        </template>
+      </el-table-column>
 
-<!--    &lt;!&ndash; 添加或修改运营服务对话框 &ndash;&gt;-->
-<!--    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>-->
-<!--      <el-form ref="form" :model="form" :rules="rules" label-width="80px">-->
-<!--        <el-form-item label="服务状态" prop="serviceType">-->
-<!--          <el-select v-model="form.serviceType" placeholder="请选择服务状态" filterable>-->
-<!--            <el-option-->
-<!--              v-for="dict in dict.type.${dictType}"-->
-<!--              :key="dict.value"-->
-<!--              :label="dict.label"-->
-<!--:value="dict.value"-->
-<!--            ></el-option>-->
-<!--          </el-select>-->
-<!--        </el-form-item>-->
-<!--      </el-form>-->
-<!--      <div slot="footer" class="dialog-footer">-->
-<!--        <el-button type="primary" @click="submitForm">确 定</el-button>-->
-<!--        <el-button @click="cancel">取 消</el-button>-->
-<!--      </div>-->
-<!--    </el-dialog>-->
-<!--  </div>-->
+      <el-table-column
+        label="操作"
+        align="center"
+        class-name="small-padding fixed-width"
+      >
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            @click="handleUpdate(scope.row)"
+            v-hasPermi="['business:OPSERVICE:edit']"
+            >修改</el-button
+          >
+          <el-button
+            size="mini"
+            type="text"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['business:OPSERVICE:remove']"
+            >删除</el-button
+          >
+          <el-button
+            size="mini"
+            type="text"
+            @click="handleDownload(scope.row)"
+            v-hasPermi="['business:OPSERVICE:remove']"
+            >下载</el-button
+          >
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <pagination
+      v-show="total > 0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+
+    <!-- 添加或修改运营服务对话框 -->
+    <el-dialog :title="title" :visible.sync="open" width="70%" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+        <el-form-item label="文件" prop="linkUrl">
+          <el-upload
+            :http-request="httprequest"
+            :before-upload="uploadFile"
+            :limit="1"
+            class="upload-demo"
+            action="#"
+            :auto-upload="true"
+            :on-change="handleChange"
+            :file-list="fileList"
+          >
+            <el-button size="small" type="primary">点击上传</el-button>
+          </el-upload>
+        </el-form-item>
+        <el-form-item label="服务类型" prop="serviceType">
+          <el-select
+            v-model="form.serviceType"
+            placeholder="请选择服务类型"
+            filterable
+          >
+            <el-option
+              v-for="dict in optionList"
+              :key="dict.value + 'serviceType'"
+              :label="dict.label"
+              :value="dict.value"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+
+        <el-form-item label="文件名称" prop="serviceName">
+          <el-input v-model="form.serviceName"></el-input>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+  </div>
 </template>
 
 <script>
-import { listOPSERVICE, getOPSERVICE, delOPSERVICE, addOPSERVICE, updateOPSERVICE } from "@/api/portal/OPSERVICE/OPSERVICE";
+import {
+  listOPSERVICE,
+  getOPSERVICE,
+  delOPSERVICE,
+  addOPSERVICE,
+  updateOPSERVICE,
+  upload,
+  download
+} from "@/api/portal/OPSERVICE/OPSERVICE.js";
 
 export default {
   name: "OPSERVICE",
   data() {
     return {
+      fileList: [],
+      //1=招商服务2培训服务
+      optionList: [
+        { label: "招商服务", value: "1" },
+        { label: "培训服务", value: "2" },
+      ],
       // 根路径
       baseURL: process.env.VUE_APP_BASE_API,
       // 遮罩层
@@ -211,34 +269,32 @@ export default {
         serviceName: null,
         linkUrl: null,
         download: null,
-        serviceType: null
+        serviceType: null,
       },
       // 表单参数
       form: {},
       // 表单校验
       rules: {
-        id: [
-          { required: true, message: "主键id不能为空", trigger: "blur" }
-        ],
+        id: [{ required: true, message: "主键id不能为空", trigger: "blur" }],
         delFlag: [
-          { required: true, message: "删除状态不能为空", trigger: "blur" }
+          { required: true, message: "删除状态不能为空", trigger: "blur" },
         ],
         deptId: [
-          { required: true, message: "部门id不能为空", trigger: "blur" }
+          { required: true, message: "部门id不能为空", trigger: "blur" },
         ],
         serviceName: [
-          { required: true, message: "文件名称不能为空", trigger: "blur" }
+          { required: true, message: "文件名称不能为空", trigger: "blur" },
         ],
         linkUrl: [
-          { required: true, message: "文件附件不能为空", trigger: "blur" }
+          { required: true, message: "文件附件不能为空", trigger: "blur" },
         ],
         download: [
-          { required: true, message: "下载次数不能为空", trigger: "blur" }
+          { required: true, message: "下载次数不能为空", trigger: "blur" },
         ],
         serviceType: [
-          { required: true, message: "服务状态不能为空", trigger: "change" }
-        ]
-      }
+          { required: true, message: "服务类型不能为空", trigger: "change" },
+        ],
+      },
     };
   },
   created() {
@@ -248,12 +304,39 @@ export default {
     /** 查询运营服务列表 */
     getList() {
       this.loading = true;
-      listOPSERVICE(this.queryParams).then(response => {
+      listOPSERVICE(this.queryParams).then((response) => {
         this.OPSERVICEList = response.rows;
         this.total = response.total;
         this.loading = false;
       });
     },
+    handleDownload(row){
+      let data = new FormData()
+      data.append('resource',row.serviceName)
+      data.append('delete',false)
+      download(data).then(res=>{
+      })
+    },
+    httprequest() {},
+    uploadFile(file) {
+      let formData = new FormData();
+      formData.append("file", file);
+      upload(formData).then((res) => {
+        this.form.linkUrl = res.url;
+        this.$set(this.form, "serviceName", res.originalFilename);
+      });
+    },
+    handleChange(file, fileList) {
+      this.fileList = fileList.slice(-3);
+    },
+    searchType(type) {
+      let fined = this.optionList.find((item) => item.value == type);
+      if (fined.label != undefined) {
+        return fined.label;
+      } else {
+        return "未选择类型!";
+      }
+    },
     // 取消按钮
     cancel() {
       this.open = false;
@@ -268,7 +351,7 @@ export default {
         serviceName: null,
         linkUrl: null,
         download: null,
-        serviceType: null
+        serviceType: null,
       };
       this.resetForm("form");
     },
@@ -284,9 +367,9 @@ export default {
     },
     // 多选框选中数据
     handleSelectionChange(selection) {
-      this.ids = selection.map(item => item.id)
-      this.single = selection.length!==1
-      this.multiple = !selection.length
+      this.ids = selection.map((item) => item.id);
+      this.single = selection.length !== 1;
+      this.multiple = !selection.length;
     },
     /** 新增按钮操作 */
     handleAdd() {
@@ -297,8 +380,8 @@ export default {
     /** 修改按钮操作 */
     handleUpdate(row) {
       this.reset();
-      const id = row.id || this.ids
-      getOPSERVICE(id).then(response => {
+      const id = row.id || this.ids;
+      getOPSERVICE(id).then((response) => {
         this.form = response.data;
         this.open = true;
         this.title = "修改运营服务";
@@ -306,16 +389,16 @@ export default {
     },
     /** 提交按钮 */
     submitForm() {
-      this.$refs["form"].validate(valid => {
+      this.$refs["form"].validate((valid) => {
         if (valid) {
           if (this.form.id != null) {
-            updateOPSERVICE(this.form).then(response => {
+            updateOPSERVICE(this.form).then((response) => {
               this.$modal.msgSuccess("修改成功");
               this.open = false;
               this.getList();
             });
           } else {
-            addOPSERVICE(this.form).then(response => {
+            addOPSERVICE(this.form).then((response) => {
               this.$modal.msgSuccess("新增成功");
               this.open = false;
               this.getList();
@@ -327,19 +410,27 @@ export default {
     /** 删除按钮操作 */
     handleDelete(row) {
       const ids = row.id || this.ids;
-      this.$modal.confirm('是否确认删除运营服务编号为"' + ids + '"的数据项?').then(function() {
-        return delOPSERVICE(ids);
-      }).then(() => {
-        this.getList();
-        this.$modal.msgSuccess("删除成功");
-      }).catch(() => {});
+      this.$modal
+        .confirm('是否确认删除运营服务编号为"' + ids + '"的数据项?')
+        .then(function () {
+          return delOPSERVICE(ids);
+        })
+        .then(() => {
+          this.getList();
+          this.$modal.msgSuccess("删除成功");
+        })
+        .catch(() => {});
     },
     /** 导出按钮操作 */
     handleExport() {
-      this.download('business/OPSERVICE/export', {
-        ...this.queryParams
-      }, `OPSERVICE_${new Date().getTime()}.xlsx`)
-    }
-  }
+      this.download(
+        "business/OPSERVICE/export",
+        {
+          ...this.queryParams,
+        },
+        `OPSERVICE_${new Date().getTime()}.xlsx`
+      );
+    },
+  },
 };
 </script>