Browse Source

banner管理等页面

chenyue 4 years ago
parent
commit
e983cc1bb4

+ 1 - 1
_web/.env

@ -2,4 +2,4 @@ NODE_ENV=production
VUE_APP_PREVIEW=true
VUE_APP_API_BASE_URL=http://127.0.0.1:82
VUE_APP_IMG_UPLOAD_URL=http://120.41.253.95:3000
imgServer=http://www.xmtyw.cn/
VUE_APP_IMG_SERVICE_URL=http://www.xmtyw.cn/

+ 2 - 2
_web/.env.development

@ -1,5 +1,5 @@
NODE_ENV=development
VUE_APP_PREVIEW=true
VUE_APP_API_BASE_URL=http://172.26.0.30:8080/
VUE_APP_API_BASE_URL=http://172.26.0.30:8080
VUE_APP_IMG_UPLOAD_URL=http://120.41.253.95:3000
imgServer=http://172.26.0.110:8888/
VUE_APP_IMG_SERVICE_URL=http://172.26.0.110:8888/

+ 24 - 15
_web/src/api/homeApi.js

@ -1,4 +1,5 @@
import { axios } from '@/utils/request'
import Qs from 'qs'
const homeApi = {
  // 查看banner(列表)
@ -14,15 +15,15 @@ const homeApi = {
    return axios({
      url: '/zjxl/banner/addBanner',
      method: 'post',
      data: data
      data: Qs.stringify(data)
    })
  },
  // 更新banner
  updateBanner (data) {
    return axios({
      url: '/zjxl/banner/updateBanner',
      url: '/zjxl/banner/updataBanner',
      method: 'post',
      data: data
      data: Qs.stringify(data)
    })
  },
  // 修改banner上下线状态
@ -30,7 +31,7 @@ const homeApi = {
    return axios({
      url: '/zjxl/banner/updateIsLine',
      method: 'post',
      data: data
      data: Qs.stringify(data)
    })
  },
  // 删除banner
@ -38,7 +39,7 @@ const homeApi = {
    return axios({
      url: '/zjxl/banner/deleteBannerById',
      method: 'post',
      data: data
      data: Qs.stringify(data)
    })
  },
  // 添加公司案例
@ -46,7 +47,7 @@ const homeApi = {
    return axios({
      url: '/zjxl/CompanyCase/addCompanyCase',
      method: 'post',
      data: data
      data: Qs.stringify(data)
    })
  },
  // 更新公司案例
@ -54,7 +55,7 @@ const homeApi = {
    return axios({
      url: '/zjxl/CompanyCase/updateCompanyCase',
      method: 'post',
      data: data
      data: Qs.stringify(data)
    })
  },
  // 查看公司案例(列表)
@ -70,7 +71,7 @@ const homeApi = {
    return axios({
      url: '/zjxl/CompanyCase/updateIsLine',
      method: 'post',
      data: data
      data: Qs.stringify(data)
    })
  },
  // 删除公司案例
@ -78,7 +79,7 @@ const homeApi = {
    return axios({
      url: '/zjxl/CompanyCase/deleteCompanyCase',
      method: 'post',
      data: data
      data: Qs.stringify(data)
    })
  },
  // 添加合作伙伴
@ -86,7 +87,7 @@ const homeApi = {
    return axios({
      url: '/zjxl/partner/addPartenr',
      method: 'post',
      data: data
      data: Qs.stringify(data)
    })
  },
  // 查看合作伙伴(列表)
@ -102,7 +103,7 @@ const homeApi = {
    return axios({
      url: '/zjxl/partner/updatePartner',
      method: 'post',
      data: data
      data: Qs.stringify(data)
    })
  },
  // 修改合作伙伴上下线状态
@ -110,7 +111,7 @@ const homeApi = {
    return axios({
      url: '/zjxl/partner/updateIsLine',
      method: 'post',
      data: data
      data: Qs.stringify(data)
    })
  },
  // 删除合作伙伴
@ -118,10 +119,10 @@ const homeApi = {
    return axios({
      url: '/zjxl/partner/deletePartner',
      method: 'post',
      data: data
      data: Qs.stringify(data)
    })
  },
  // 获取文章列表
  // 获取文章列表(分页)
  findArticleContentById (parameter) {
    return axios({
      url: '/zjxl/zjxlArticleContent/findArticleContentById',
@ -129,13 +130,21 @@ const homeApi = {
      params: parameter
    })
  },
  // 获取文章列表(不分页)
  findArticleAll (parameter) {
    return axios({
      url: '/zjxl/zjxlArticleContent/findArticleAll',
      method: 'get',
      params: parameter
    })
  },
  // 文件上传
  fileUpload (data, token) {
    return axios({
      url: '/zjxl/banner/file',
      method: 'post',
      headers: {
        'Authorization': token
        // 'Authorization': token
      },
      data: data
    })

+ 56 - 29
_web/src/components/upLoad.vue

@ -2,15 +2,16 @@
  <div>
    <div class="flex flex-wrap">
      <a-upload
        class="flex f_wrap"
        :action="UploadUrl()"
        list-type="picture-card"
        :file-list="fileList"
        @preview="handlePreview"
        :before-upload="beforeUpload"
        @change="handleChange"
        :headers="headers"
        :customRequest="fileUpload"
        :remove="handleFileRemove"
      >
        <div v-if="fileList.length < fileListLength">
        <div v-if="fileList.length < fileListLength" >
          <a-icon type="plus" />
        </div>
      </a-upload>
@ -18,23 +19,18 @@
        {{ remarkTxt }}
      </div>
    </div>
    <a-modal :visible="previewVisible" :footer="null" @cancel="handleCancel">
    <a-modal :visible="previewVisible" :footer="null" @cancel="handleCancel" title="预览">
      <img alt="example" style="width: 100%" :src="previewImage" />
    </a-modal>
  </div>
</template>
<script>
// import homeApi from '@/api/homeApi'
import homeApi from '@/api/homeApi'
import { setImgUrl } from '@/utils/img'
import { setTimeout } from 'timers'
const _ = require('lodash')
function getBase64 (file) {
  return new Promise((resolve, reject) => {
    const reader = new FileReader()
    reader.readAsDataURL(file)
    reader.onload = () => resolve(reader.result)
    reader.onerror = error => reject(error)
  })
}
export default {
  props: {
    remarkTxt: {
@ -61,8 +57,15 @@ export default {
    initData (imglist) {
      if (imglist && imglist.length) {
        this.fileList = imglist.map((item, index) => {
          return { url: setImgUrl(item) }
          return {
            uid: '-' + (index + 1),
            name: 'image.png',
            status: 'done',
            url: setImgUrl(item)
          }
        })
      } else {
        this.fileList = []
      }
    },
    UploadUrl () {
@ -70,27 +73,45 @@ export default {
         process.env.VUE_APP_API_BASE_URL + '/zjxl/banner/file'
      )
    },
    fileUpload (file) {
      const formData = new FormData()
      formData.append('file', file.file)
      homeApi.fileUpload(formData).then(res => {
        if (res.status === 10000) {
          var length = this.fileList.length
          const citem = {
            uid: '-' + (length + 1),
            name: res.result.fileName,
            status: 'done',
            uri: res.result.fullUri,
            url: res.result.fullUrl
          }
          this.fileList.push(citem)
          this.$emit('uploadSuccess', { fileList: this.fileList })
        } else {
          this.$message.error(res.message)
        }
      })
    },
    handleChange ({ file, fileList }) {
      // this.handleAvatarSuccess (file)
      this.fileList = fileList
      // this.$emit('uploadSuccess', { fileList: this.fileList })
      setTimeout(() => {
        this.fileList = []
        fileList.forEach((item) => {
          if (item.response.status === 10000) {
            const citem = item.response.result
            citem.url = citem.fullUrl
            this.fileList.push(citem)
          } else {
            this.$message.error(item.message)
          }
        })
        this.$emit('uploadSuccess', { fileList: this.fileList })
      }, 3000)
    },
    async handlePreview (file) {
      if (!file.url && !file.preview) {
        file.preview = await getBase64(file.originFileObj)
      }
      this.previewImage = file.url || file.preview
      this.previewVisible = true
    },
    handleAvatarSuccess (res) {
      if (res.status === 200) {
        var imageUrl = process.env.imgServer + res.data
        this.currentImage = imageUrl
        this.$emit('imageUrlGet', res.data)
      } else {
        this.$message.error(res.msg)
      }
    },
    beforeUpload (file) {
      var $uptypes = ['image/jpg', 'image/png', 'image/jpeg']
      const isJPG = $uptypes.indexOf(file.type) > -1
@ -106,6 +127,12 @@ export default {
    },
    handleCancel () {
      this.previewVisible = false
    },
    handleFileRemove (file) {
      const hasIndex = _.indexOf(this.fileList, file)
      if (hasIndex > -1) {
        this.fileList.splice(hasIndex, 1)
      }
    }
  }
}

+ 1 - 1
_web/src/utils/img.js

@ -1,6 +1,6 @@
const imgUrlDomain = process.env.imgServer
const imgUploadUrl = process.env.VUE_APP_IMG_UPLOAD_URL
const imgUrlDomain = process.env.VUE_APP_IMG_SERVICE_URL
// 头像图片路径通配
export function setImgUrl (str) {

+ 51 - 32
_web/src/views/homeManager/addBannerForm.vue

@ -19,15 +19,15 @@
          />
        </a-form-item>
        <a-form-item label="跳转方式" :labelCol="labelCol" :wrapperCol="wrapperCol" :required="true">
          <a-radio-group name="bannerType" v-decorator="['bannerType', { initialValue: 1 }]">
            <a-radio :value="1">无</a-radio>
            <a-radio :value="2">站内文章</a-radio>
            <a-radio :value="3">外部链接</a-radio>
          <a-radio-group name="bannerType" v-decorator="['bannerType', { initialValue: 0 }]" @change="changeType">
            <a-radio :value="0">无</a-radio>
            <a-radio :value="1">站内文章</a-radio>
            <a-radio :value="2">外部链接</a-radio>
          </a-radio-group>
        </a-form-item>
        <a-form-item
          :required="true"
          v-if="bannerType==2"
          v-show="bannerType==1"
          label="选择文章"
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
@ -36,18 +36,18 @@
          <a-select
            style="width: 100%"
            placeholder="请选择文章"
            v-decorator="['bannerTypeUrl', {rules: [{ required: true, message: '请选择文章!' }]}]"
            v-decorator="['bannerTypeUrl', {rules: [{validator: checkUrl}]}]"
          >
            <a-select-option
              v-for="(item,index) in actionClassData"
              :key="index"
              :value="item"
            >{{ item }}</a-select-option>
              :value="item.articleContentId"
            >{{ item.articleContentTitle }}</a-select-option>
          </a-select>
        </a-form-item>
        <a-form-item
          :required="true"
          v-if="bannerType==3"
          v-show="bannerType==2"
          label="跳转链接Url"
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
@ -123,7 +123,7 @@ export default {
      visible: false,
      confirmLoading: false,
      actionClassData: [],
      bannerType: 3,
      bannerType: 0,
      formLoading: false,
      form: this.$form.createForm(this),
      remarkTxt: '请上传1920×712规格图像'
@ -135,20 +135,23 @@ export default {
    // 初始化方法
    add (record) {
      this.visible = true
      // this.formLoading = true
      // this.getActionClass()
      this.$nextTick(() => {
        this.$refs.upLoadRef.initData()
      })
      this.formLoading = true
      this.getActionClass()
    },
    /**
     * 获取选择器下拉框数据
     */
    getActionClass () {
      homeApi.findArticleContentById().then(res => {
      homeApi.findArticleAll().then(res => {
        this.formLoading = false
        if (res.success) {
        if (res.status === 200) {
          this.actionClassData = res.data
        } else {
          this.$message.error('获取选择器下拉框数据')
          this.$message.error('获取文章列表数据失败')
        }
      })
    },
@ -161,7 +164,6 @@ export default {
      validateFields((errors, values) => {
        if (!errors) {
          values.bannerSort = parseInt(values.bannerSort)
          values.bannerImage = 'group1/M00/00/4C/rBoAbl-iDrOAdZTxAAk_Z73wLB8030.jpg'
          homeApi.addBanner(values)
            .then(res => {
              if (res.status === 200) {
@ -187,33 +189,50 @@ export default {
      this.visible = false
    },
    changeType (val) {
      this.bannerType = this.form.getFieldValue('bannerType')
      this.$nextTick(() => {
        this.bannerType = this.form.getFieldValue('bannerType')
        this.form.resetFields('bannerTypeUrl')
        if (this.bannerType === 2) {
          this.form.setFieldsValue({ 'bannerTypeUrl': 'http://' })
        } else {
          this.form.setFieldsValue({ 'bannerTypeUrl': '' })
        }
      })
    },
    uploadSuccess (avg) {
      if (avg.fileList[0]) {
        this.form.setFieldsValue({ 'bannerImage': avg.fileList[0].name })
        this.form.resetFields('bannerImage')
        this.form.setFieldsValue({ 'bannerImage': avg.fileList[0].uri })
      }
    },
    checkimageUrl (rule, value, callback) {
      callback()
      // return false
      // if (value && value.length > 0) {
      //   callback()
      //   return
      // }
      // var text = '请上传图片'
      // callback(text)
      if (value && value.length > 0) {
        callback()
        return
      }
      var text = '请上传图片'
      callback(text)
    },
    checkUrl (rule, value, callback) {
      var text = '请输入跳转链接!'
      if (!value) {
        callback(text)
      } else if (checkUrl(value)) {
        callback()
      if (this.bannerType === 1) {
        text = '请选择文章!'
        if (!value) {
          callback(text)
        } else {
          callback()
        }
      } else if (this.bannerType === 2) {
        if (!value) {
          callback(text)
        } else if (checkUrl(value)) {
          callback()
        } else {
          text = '请输入正确的url地址'
          callback(text)
        }
      } else {
        text = '请输入正确的url地址'
        callback(text)
        callback()
      }
    },
    checkSortIndex (rule, value, callback) {

+ 32 - 23
_web/src/views/homeManager/addCompanyCaseForm.vue

@ -24,9 +24,9 @@
          :wrapperCol="wrapperCol"
          has-feedback
        >
          <a-textarea :rows="4" :maxLength="30" placeholder="请输入描述" v-decorator="['companyDescribe']">
            <div slot="suffix">ddd</div>
          <a-textarea :rows="4" :maxLength="30" placeholder="请输入描述" @input="companyDescribeInput" v-decorator="['companyDescribe', {rules: [{required: true, message: '请输入描述!'}]}]">
          </a-textarea>
          <div class="companyDescribeCount">({{ companyDescribe.length }}/30)</div>
        </a-form-item>
        <a-form-item
          :required="true"
@ -43,8 +43,8 @@
            <a-select-option
              v-for="(item,index) in actionClassData"
              :key="index"
              :value="item"
            >{{ item }}</a-select-option>
              :value="item.articleContentId"
            >{{ item.articleContentTitle }}</a-select-option>
          </a-select>
        </a-form-item>
        <a-form-item
@ -133,7 +133,7 @@ export default {
      visible: false,
      confirmLoading: false,
      actionClassData: [],
      bannerType: 3,
      companyDescribe: '',
      formLoading: false,
      form: this.$form.createForm(this),
      remarkTxt: '请上传320×400规格图像'
@ -145,24 +145,28 @@ export default {
    // 初始化方法
    add (record) {
      this.visible = true
      // this.formLoading = true
      // this.getActionClass()
      this.formLoading = true
      this.getActionClass()
    },
    /**
     * 获取选择器下拉框数据
     */
    getActionClass () {
      homeApi.findArticleContentById().then(res => {
      homeApi.findArticleAll().then((res) => {
        this.formLoading = false
        if (res.success) {
        if (res.status === 200) {
          this.actionClassData = res.data
        } else {
          this.$message.error('获取选择器下拉框数据')
          this.$message.error('获取文章列表数据失败')
        }
      })
    },
    companyDescribeInput () {
      this.$nextTick(() => {
        this.companyDescribe = this.form.getFieldValue('companyDescribe')
      })
    },
    handleSubmit () {
      const {
        form: { validateFields }
@ -171,8 +175,7 @@ export default {
      validateFields((errors, values) => {
        if (!errors) {
          values.companySort = parseInt(values.companySort)
          values.companyDefaultImg = 'group1/M00/00/4C/rBoAbl-iDrOAdZTxAAk_Z73wLB8030.jpg'
          values.companyExchangeImg = 'group1/M00/00/4C/rBoAbl-iDrOAdZTxAAk_Z73wLB8030.jpg'
          values.companyJumpUrl = values.companyAssociatedCase
          homeApi.addCompanyCase(values)
            .then(res => {
              if (res.status === 200) {
@ -199,25 +202,23 @@ export default {
    },
    uploadSuccessDefault (avg) {
      if (avg.fileList[0]) {
        this.form.setFieldsValue({ 'companyDefaultImg': avg.fileList[0].name })
        this.form.resetFields('companyDefaultImg')
        this.form.setFieldsValue({ 'companyDefaultImg': avg.fileList[0].uri })
      }
    },
    uploadSuccessExchange (avg) {
      if (avg.fileList[0]) {
        this.form.setFieldsValue({ 'companyExchangeImg': avg.fileList[0].name })
        this.form.resetFields('companyExchangeImg')
        this.form.setFieldsValue({ 'companyExchangeImg': avg.fileList[0].uri })
      }
    },
    checkimageUrl (rule, value, callback) {
      callback()
      // return false
      // if (value && value.length > 0) {
      //   callback()
      //   return
      // }
      // var text = '请上传图片'
      // callback(text)
      if (value && value.length > 0) {
        callback()
        return
      }
      var text = '请上传图片'
      callback(text)
    },
    checkSortIndex (rule, value, callback) {
      var text = '请输入排序号!'
@ -233,3 +234,11 @@ export default {
  }
}
</script>
<style lang="less">
  .companyDescribeCount{
    position: absolute;
    right: 30px;
    bottom: -10px;
    color: #999;
  }
</style>

+ 7 - 10
_web/src/views/homeManager/addPartnerForm.vue

@ -102,7 +102,6 @@ export default {
      validateFields((errors, values) => {
        if (!errors) {
          values.partnerSort = parseInt(values.partnerSort)
          values.partnerImg = 'group1/M00/00/4C/rBoAbl-iDrOAdZTxAAk_Z73wLB8030.jpg'
          homeApi.addPartenr(values)
            .then(res => {
              if (res.status === 200) {
@ -129,19 +128,17 @@ export default {
    },
    uploadSuccess (avg) {
      if (avg.fileList[0]) {
        this.form.setFieldsValue({ 'partnerImg': avg.fileList[0].name })
        this.form.resetFields('partnerImg')
        this.form.setFieldsValue({ 'partnerImg': avg.fileList[0].uri })
      }
    },
    checkimageUrl (rule, value, callback) {
      callback()
      // return false
      // if (value && value.length > 0) {
      //   callback()
      //   return
      // }
      // var text = '请上传图片'
      // callback(text)
      if (value && value.length > 0) {
        callback()
        return
      }
      var text = '请上传图片'
      callback(text)
    },
    checkSortIndex (rule, value, callback) {
      var text = '请输入排序号!'

+ 62 - 36
_web/src/views/homeManager/editBannerForm.vue

@ -1,6 +1,6 @@
<template>
  <a-modal
    title="编辑定时任务"
    title="编辑banner"
    :width="900"
    :visible="visible"
    :confirmLoading="confirmLoading"
@ -12,7 +12,7 @@
        <a-form-item
          style="display: none;"
        >
          <a-input v-decorator="['id']" />
          <a-input v-decorator="['bannerId']" />
        </a-form-item>
        <a-form-item label="名称" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
          <a-input
@ -21,15 +21,15 @@
          />
        </a-form-item>
        <a-form-item label="跳转方式" :labelCol="labelCol" :wrapperCol="wrapperCol" :required="true">
          <a-radio-group name="bannerType" v-decorator="['bannerType', { initialValue: 1 }]">
            <a-radio :value="1">无</a-radio>
            <a-radio :value="2">站内文章</a-radio>
            <a-radio :value="3">外部链接</a-radio>
          <a-radio-group name="bannerType" v-decorator="['bannerType']" @change="changeType">
            <a-radio :value="0">无</a-radio>
            <a-radio :value="1">站内文章</a-radio>
            <a-radio :value="2">外部链接</a-radio>
          </a-radio-group>
        </a-form-item>
        <a-form-item
          :required="true"
          v-if="bannerType==2"
          v-show="bannerType==1"
          label="选择文章"
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
@ -38,18 +38,18 @@
          <a-select
            style="width: 100%"
            placeholder="请选择文章"
            v-decorator="['bannerTypeUrl', {rules: [{ required: true, message: '请选择文章!' }]}]"
            v-decorator="['bannerTypeUrl', {rules: [{validator: checkUrl}]}]"
          >
            <a-select-option
              v-for="(item,index) in actionClassData"
              :key="index"
              :value="item"
            >{{ item }}</a-select-option>
              :value="item.articleContentId"
            >{{ item.articleContentTitle }}</a-select-option>
          </a-select>
        </a-form-item>
        <a-form-item
          :required="true"
          v-if="bannerType==3"
          v-show="bannerType==2"
          label="跳转链接Url"
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
@ -95,7 +95,7 @@
          />
        </a-form-item>
        <a-form-item label="是否上线" :labelCol="labelCol" :wrapperCol="wrapperCol" :required="true">
          <a-radio-group name="bannerIsLine" v-decorator="['bannerIsLine',{ initialValue: 1 }]">
          <a-radio-group name="bannerIsLine" v-decorator="['bannerIsLine']">
            <a-radio :value="1">上线</a-radio>
            <a-radio :value="0">下线</a-radio>
          </a-radio-group>
@ -127,7 +127,7 @@ import { checkUrl } from '@/utils/util'
        actionClassData: [],
        formLoading: false,
        form: this.$form.createForm(this),
        bannerType: 3,
        bannerType: 0,
        remarkTxt: '请上传1920×712规格图像'
      }
    },
@ -136,11 +136,14 @@ import { checkUrl } from '@/utils/util'
      edit (record) {
        this.visible = true
        this.formLoading = true
        // this.getActionClass()
        this.getActionClass()
        setTimeout(() => {
          if (record.bannerType === 1) {
            record.bannerTypeUrl = JSON.parse(record.bannerTypeUrl).articleContentId
          }
          this.form.setFieldsValue(
            {
              id: record.id,
              bannerId: record.bannerId,
              bannerName: record.bannerName,
              bannerImage: record.bannerImage,
              bannerIsLine: record.bannerIsLine,
@ -150,19 +153,21 @@ import { checkUrl } from '@/utils/util'
            }
          )
          this.bannerType = record.bannerType
          this.$refs.upLoadRef.initData([record.bannerImage])
          this.$nextTick(() => {
            this.$refs.upLoadRef.initData([record.bannerImage])
          })
        }, 100)
      },
      /**
       * 获取选择器下拉框数据
       */
      getActionClass () {
        homeApi.findArticleContentById().then((res) => {
        homeApi.findArticleAll().then((res) => {
          this.formLoading = false
          if (res.success) {
          if (res.status === 200) {
            this.actionClassData = res.data
          } else {
            this.$message.error('获取选择器下拉框数据')
            this.$message.error('获取文章列表数据失败')
          }
        })
      },
@ -171,8 +176,12 @@ import { checkUrl } from '@/utils/util'
        this.confirmLoading = true
        validateFields((errors, values) => {
          if (!errors) {
            values.bannerSort = parseInt(values.bannerSort)
            if (!values.bannerTypeUrl) {
              values.bannerTypeUrl = ''
            }
            homeApi.updateBanner(values).then((res) => {
              if (res.success) {
              if (res.status === 200) {
                this.$message.success('编辑成功')
                this.visible = false
                this.confirmLoading = false
@ -194,33 +203,50 @@ import { checkUrl } from '@/utils/util'
        this.visible = false
      },
      changeType (val) {
        this.bannerType = this.form.getFieldValue('bannerType')
        this.$nextTick(() => {
          this.bannerType = this.form.getFieldValue('bannerType')
          this.form.resetFields('bannerTypeUrl')
          if (this.bannerType === 2) {
            this.form.setFieldsValue({ 'bannerTypeUrl': 'http://' })
          } else {
            this.form.setFieldsValue({ 'bannerTypeUrl': '' })
          }
        })
      },
      uploadSuccess (avg) {
        if (avg.fileList[0]) {
          this.form.setFieldsValue({ 'bannerImage': avg.fileList[0].url })
          this.form.resetFields('bannerImage')
          this.form.setFieldsValue({ 'bannerImage': avg.fileList[0].uri })
        }
      },
      checkimageUrl (rule, value, callback) {
        callback()
        // return false
        // if (value && value.length > 0) {
        //   callback()
        //   return
        // }
        // var text = '请上传图片'
        // callback(text)
        if (value && value.length > 0) {
          callback()
          return
        }
        var text = '请上传图片'
        callback(text)
      },
      checkUrl (rule, value, callback) {
        var text = '请输入跳转链接!'
        if (!value) {
          callback(text)
        } else if (checkUrl(value)) {
          callback()
        if (this.bannerType === 1) {
          text = '请选择文章!'
          if (!value) {
            callback(text)
          } else {
            callback()
          }
        } else if (this.bannerType === 2) {
          if (!value) {
            callback(text)
          } else if (checkUrl(value)) {
            callback()
          } else {
            text = '请输入正确的url地址'
            callback(text)
          }
        } else {
          text = '请输入正确的url地址'
          callback(text)
          callback()
        }
      },
      checkSortIndex (rule, value, callback) {

+ 270 - 0
_web/src/views/homeManager/editCompanyCaseForm.vue

@ -0,0 +1,270 @@
<template>
  <a-modal
    title="编辑公司案例"
    :width="900"
    :visible="visible"
    :confirmLoading="confirmLoading"
    ok-text="保存"
    cancel-text="关闭"
    @ok="handleSubmit"
    @cancel="handleCancel"
    :maskClosable="false"
  >
    <a-spin :spinning="formLoading">
      <a-form :form="form">
        <a-form-item
          style="display: none;"
        >
          <a-input v-decorator="['companyId']" />
        </a-form-item>
        <a-form-item label="标题名称" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
          <a-input
            placeholder="请输入标题名称"
            v-decorator="['companyName', {rules: [{required: true, message: '请输入标题名称!'}]}]"
          />
        </a-form-item>
        <a-form-item
          label="描述"
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          has-feedback
        >
          <a-textarea :rows="4" :maxLength="30" placeholder="请输入描述" @input="companyDescribeInput" v-decorator="['companyDescribe', {rules: [{required: true, message: '请输入描述!'}]}]">
          </a-textarea>
          <div class="companyDescribeCount">({{ companyDescribe.length }}/30)</div>
        </a-form-item>
        <a-form-item
          :required="true"
          label="关联案例"
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          has-feedback
        >
          <a-select
            style="width: 100%"
            placeholder="请选择产品"
            v-decorator="['companyAssociatedCase', {rules: [{ required: true, message: '请选择产品!' }]}]"
          >
            <a-select-option
              v-for="(item,index) in actionClassData"
              :key="index"
              :value="item.articleContentId"
            >{{ item.articleContentTitle }}</a-select-option>
          </a-select>
        </a-form-item>
        <a-form-item
          label="默认图片"
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          has-feedback
          :required="true"
        >
          <div>
            <upload-component
              ref="upLoadDefaultRef"
              :remarkTxt="remarkTxt"
              @uploadSuccess="uploadSuccessDefault"
              v-decorator="[
                'companyDefaultImg',
                {
                  trigger: 'change',
                  rules: [{ validator: checkimageUrl }]
                },
              ]"
            ></upload-component>
          </div>
        </a-form-item>
        <a-form-item
          label="交互图像"
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          has-feedback
          :required="true"
        >
          <div>
            <upload-component
              ref="upLoadExchangeRef"
              :remarkTxt="remarkTxt"
              @uploadSuccess="uploadSuccessExchange"
              v-decorator="[
                'companyExchangeImg',
                {
                  trigger: 'change',
                  rules: [{ validator: checkimageUrl }]
                },
              ]"
            ></upload-component>
          </div>
        </a-form-item>
        <a-form-item
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          label="排序"
          :hasFeedback="true"
          :required="true"
        >
          <a-input
            placeholder="请输入排序号"
            v-decorator="['companySort', {rules: [{validator: checkSortIndex}]}]"
          />
        </a-form-item>
        <a-form-item label="是否上线" :labelCol="labelCol" :wrapperCol="wrapperCol" :required="true">
          <a-radio-group name="companyIsLine" v-decorator="['companyIsLine',{ initialValue: 1 }]">
            <a-radio :value="1">上线</a-radio>
            <a-radio :value="0">下线</a-radio>
          </a-radio-group>
        </a-form-item>
      </a-form>
    </a-spin>
  </a-modal>
</template>
<script>
import homeApi from '@/api/homeApi'
import uploadComponent from '@/components/upLoad'
export default {
  components: { uploadComponent },
  data () {
    return {
      labelCol: {
        xs: { span: 24 },
        sm: { span: 5 }
      },
      wrapperCol: {
        xs: { span: 24 },
        sm: { span: 15 }
      },
      visible: false,
      confirmLoading: false,
      actionClassData: [],
      companyDescribe: '',
      formLoading: false,
      form: this.$form.createForm(this),
      remarkTxt: '请上传320×400规格图像'
    }
  },
  mounted () {
  },
  methods: {
    // 初始化方法
    edit (record) {
      this.visible = true
      this.formLoading = true
      this.getActionClass()
      setTimeout(() => {
        record.companyAssociatedCase = JSON.parse(record.companyAssociatedCase).articleContentId
        this.form.setFieldsValue(
          {
            companyId: record.companyId,
            companyName: record.companyName,
            companyAssociatedCase: record.companyAssociatedCase,
            companyJumpUrl: record.companyJumpUrl,
            companyDefaultImg: record.companyDefaultImg,
            companyExchangeImg: record.companyExchangeImg,
            companyDescribe: record.companyDescribe,
            companyIsLine: record.companyIsLine,
            companySort: record.companySort
          }
        )
        this.$nextTick(() => {
          this.companyDescribeInput()
          this.$refs.upLoadDefaultRef.initData([record.companyDefaultImg])
          this.$refs.upLoadExchangeRef.initData([record.companyExchangeImg])
        })
      }, 100)
    },
    /**
     * 获取选择器下拉框数据
     */
    getActionClass () {
      homeApi.findArticleAll().then((res) => {
        this.formLoading = false
        if (res.status === 200) {
          this.actionClassData = res.data
        } else {
          this.$message.error('获取文章列表数据失败')
        }
      })
    },
    companyDescribeInput () {
      this.$nextTick(() => {
        this.companyDescribe = this.form.getFieldValue('companyDescribe')
      })
    },
    handleSubmit () {
      const {
        form: { validateFields }
      } = this
      this.confirmLoading = true
      validateFields((errors, values) => {
        if (!errors) {
          values.companySort = parseInt(values.companySort)
          values.companyJumpUrl = values.companyAssociatedCase
          homeApi.updateCompanyCase(values)
            .then(res => {
              if (res.status === 200) {
                this.$message.success('编辑成功')
                this.visible = false
                this.confirmLoading = false
                this.$emit('ok', values)
                this.form.resetFields()
              } else {
                this.$message.error('编辑失败:' + res.message)
              }
            })
            .finally(res => {
              this.confirmLoading = false
            })
        } else {
          this.confirmLoading = false
        }
      })
    },
    handleCancel () {
      this.form.resetFields()
      this.visible = false
    },
    uploadSuccessDefault (avg) {
      if (avg.fileList[0]) {
        this.form.resetFields('companyDefaultImg')
        this.form.setFieldsValue({ 'companyDefaultImg': avg.fileList[0].uri })
      }
    },
    uploadSuccessExchange (avg) {
      if (avg.fileList[0]) {
        this.form.resetFields('companyExchangeImg')
        this.form.setFieldsValue({ 'companyExchangeImg': avg.fileList[0].uri })
      }
    },
    checkimageUrl (rule, value, callback) {
      if (value && value.length > 0) {
        callback()
        return
      }
      var text = '请上传图片'
      callback(text)
    },
    checkSortIndex (rule, value, callback) {
      var text = '请输入排序号!'
      if (!value) {
        callback(text)
      } else if (/(^[1-9]\d*$)/.test(value)) {
        callback()
      } else {
        text = '请输入数字'
        callback(text)
      }
    }
  }
}
</script>
<style lang="less">
  .companyDescribeCount{
    position: absolute;
    right: 30px;
    bottom: -10px;
    color: #999;
  }
</style>

+ 175 - 0
_web/src/views/homeManager/editPartnerForm.vue

@ -0,0 +1,175 @@
<template>
  <a-modal
    title="编辑合作伙伴"
    :width="900"
    :visible="visible"
    :confirmLoading="confirmLoading"
    ok-text="保存"
    cancel-text="关闭"
    @ok="handleSubmit"
    @cancel="handleCancel"
    :maskClosable="false"
  >
    <a-spin :spinning="formLoading">
      <a-form :form="form">
        <a-form-item
          style="display: none;"
        >
          <a-input v-decorator="['partnerId']" />
        </a-form-item>
        <a-form-item label="标题名称" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
          <a-input
            placeholder="请输入标题名称"
            v-decorator="['partnerName', {rules: [{required: true, message: '请输入标题名称!'}]}]"
          />
        </a-form-item>
        <a-form-item
          label="默认图片"
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          has-feedback
          :required="true"
        >
          <div>
            <upload-component
              ref="upLoadRef"
              :remarkTxt="remarkTxt"
              @uploadSuccess="uploadSuccess"
              v-decorator="[
                'partnerImg',
                {
                  trigger: 'change',
                  rules: [{ validator: checkimageUrl }]
                },
              ]"
            ></upload-component>
          </div>
        </a-form-item>
        <a-form-item
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          label="排序"
          :hasFeedback="true"
          :required="true"
        >
          <a-input
            placeholder="请输入排序号"
            v-decorator="['partnerSort', {rules: [{validator: checkSortIndex}]}]"
          />
        </a-form-item>
        <a-form-item label="是否上线" :labelCol="labelCol" :wrapperCol="wrapperCol" :required="true">
          <a-radio-group name="partnerIsLine" v-decorator="['partnerIsLine',{ initialValue: 1 }]">
            <a-radio :value="1">上线</a-radio>
            <a-radio :value="0">下线</a-radio>
          </a-radio-group>
        </a-form-item>
      </a-form>
    </a-spin>
  </a-modal>
</template>
<script>
import homeApi from '@/api/homeApi'
import uploadComponent from '@/components/upLoad'
export default {
  components: { uploadComponent },
  data () {
    return {
      labelCol: {
        xs: { span: 24 },
        sm: { span: 5 }
      },
      wrapperCol: {
        xs: { span: 24 },
        sm: { span: 15 }
      },
      visible: false,
      confirmLoading: false,
      formLoading: false,
      form: this.$form.createForm(this),
      remarkTxt: '请上传174×54规格图像'
    }
  },
  mounted () {
  },
  methods: {
    // 初始化方法
    edit (record) {
      this.visible = true
      // this.formLoading = true
      setTimeout(() => {
        this.form.setFieldsValue(
          {
            partnerId: record.partnerId,
            partnerName: record.partnerName,
            partnerImg: record.partnerImg,
            partnerIsLine: record.partnerIsLine,
            partnerSort: record.partnerSort
          }
        )
        this.$nextTick(() => {
          this.$refs.upLoadRef.initData([record.partnerImg])
        })
      }, 100)
    },
    handleSubmit () {
      const {
        form: { validateFields }
      } = this
      this.confirmLoading = true
      validateFields((errors, values) => {
        if (!errors) {
          values.partnerSort = parseInt(values.partnerSort)
          homeApi.updatePartner(values)
            .then(res => {
              if (res.status === 200) {
                this.$message.success('编辑成功')
                this.visible = false
                this.confirmLoading = false
                this.$emit('ok', values)
                this.form.resetFields()
              } else {
                this.$message.error('编辑失败:' + res.message)
              }
            })
            .finally(res => {
              this.confirmLoading = false
            })
        } else {
          this.confirmLoading = false
        }
      })
    },
    handleCancel () {
      this.form.resetFields()
      this.visible = false
    },
    uploadSuccess (avg) {
      if (avg.fileList[0]) {
        this.form.resetFields('partnerImg')
        this.form.setFieldsValue({ 'partnerImg': avg.fileList[0].uri })
      }
    },
    checkimageUrl (rule, value, callback) {
      if (value && value.length > 0) {
        callback()
        return
      }
      var text = '请上传图片'
      callback(text)
    },
    checkSortIndex (rule, value, callback) {
      var text = '请输入排序号!'
      if (!value) {
        callback(text)
      } else if (/(^[1-9]\d*$)/.test(value)) {
        callback()
      } else {
        text = '请输入数字'
        callback(text)
      }
    }
  }
}
</script>

+ 24 - 14
_web/src/views/homeManager/indexBanner.vue

@ -21,13 +21,13 @@
      :columns="columns"
      :data="loadData"
      :alert="true"
      :rowKey="(record) => record.id"
      :rowKey="(record) => record.bannerId"
    >
      <span slot="bannerName" slot-scope="text">
        <ellipsis :length="30" tooltip>{{ text }}</ellipsis>
      </span>
      <span slot="bannerImage" slot-scope="src">
        <img :src="src | getImgUrl" width="60" height="45" @click="showPreviewImg(src)"/>
        <img :src="src | getImgUrl" width="60" height="45" @click="showPreviewImg(src)" style="cursor: pointer;"/>
      </span>
      <span slot="bannerType" slot-scope="text">
        {{ typeFilter(text) }}
@ -46,7 +46,7 @@
    </s-table>
    <add-form ref="addForm" @ok="handleOk" />
    <edit-form ref="editForm" @ok="handleOk" />
    <a-modal :visible="previewVisible" :footer="null" @cancel="handleCancel">
    <a-modal :visible="previewVisible" :footer="null" @cancel="handleCancel" title="预览">
      <img alt="example" style="width: 100%" :src="previewImage" />
    </a-modal>
  </a-card>
@ -57,6 +57,8 @@
  import { setImgUrl } from '@/utils/img'
  import addForm from './addBannerForm'
  import editForm from './editBannerForm'
  const _ = require('lodash')
  // import { sysDictTypeDropDown } from '@/api/modular/system/dictManage'
  export default {
    name: 'BannerIndex',
@ -84,7 +86,8 @@
          {
            title: '名称',
            dataIndex: 'bannerName',
            scopedSlots: { customRender: 'bannerName' }
            scopedSlots: { customRender: 'bannerName' },
            width: '260px'
          },
          {
            title: '图片',
@ -102,8 +105,8 @@
          },
          {
            title: '跳转链接',
            dataIndex: 'bannerTypeUrl',
            scopedSlots: { customRender: 'bannerTypeUrl' }
            dataIndex: 'bannerTypeUrlShow',
            scopedSlots: { customRender: 'bannerTypeUrlShow' }
          },
          {
            title: '排序',
@ -115,13 +118,21 @@
        // 加载数据方法 必须为 Promise 对象
        loadData: parameter => {
          return homeApi.findBannerById(Object.assign(parameter, this.queryParam)).then((res) => {
            return res.data
            var data = res.data
            _.each(data.rows, (item, index) => {
              if (item.bannerType === 1) {
                item.bannerTypeUrlShow = JSON.parse(item.bannerTypeUrl).articleContentTitle || JSON.parse(item.bannerTypeUrl).articleContentClassify
              } else {
                item.bannerTypeUrlShow = item.bannerTypeUrl
              }
            })
            return data
          })
        },
        selectedRowKeys: [],
        selectedRows: [],
        statusDictTypeDropDown: [{ code: 0, name: '下线' }, { code: 1, name: '上线' }],
        typeDictTypeDropDown: [{ code: 1, name: '无' }, { code: 2, name: '站内文章' }, { code: 3, name: '外部链接' }],
        typeDictTypeDropDown: [{ code: 0, name: '无' }, { code: 1, name: '站内文章' }, { code: 2, name: '外部链接' }],
        previewVisible: false,
        previewImage: ''
      }
@ -130,7 +141,7 @@
      if (this.hasPerm('bannerIndex:edit') || this.hasPerm('bannerIndex:delete') || hasPerm('bannerIndex:start') || hasPerm('bannerIndex:stop')) {
        this.columns.push({
          title: '操作',
          width: '150px',
          width: '300px',
          dataIndex: 'action',
          align: 'center',
          scopedSlots: { customRender: 'action' }
@ -145,7 +156,6 @@
    methods: {
      statusFilter (status) {
        const values = this.statusDictTypeDropDown.filter(item => item.code === status)
        debugger
        if (values.length > 0) {
          return values[0].name
        } else {
@ -170,7 +180,7 @@
              if (res.data) {
                this.$message.success('下线成功')
                this.$refs.table.refresh()
              }else{
              } else {
                this.$message.error('下线失败')
              }
            } else {
@ -183,7 +193,7 @@
              if (res.data) {
                this.$message.success('上线成功')
                this.$refs.table.refresh()
              }else{
              } else {
                this.$message.error('上线失败')
              }
            } else {
@ -198,11 +208,11 @@
            if (res.data) {
              this.$message.success('删除成功')
              this.$refs.table.refresh()
            }else{
            } else {
              this.$message.error('删除失败')
            }
          } else {
            this.$message.error('删除失败:' + res.message)
            this.$message.error('删除失败')
          }
        }).catch((err) => {
          this.$message.error('删除错误:' + err.message)

+ 47 - 28
_web/src/views/homeManager/indexCompanyCase.vue

@ -21,30 +21,31 @@
      :columns="columns"
      :data="loadData"
      :alert="true"
      :rowKey="(record) => record.id"
      :rowKey="(record) => record.companyId"
    >
      <span slot="companyName" slot-scope="text">
        <ellipsis :length="10" tooltip>{{ text }}</ellipsis>
        <ellipsis :length="30" tooltip>{{ text }}</ellipsis>
      </span>
      <span slot="companyDescribe" slot-scope="text">
        <ellipsis :length="10" tooltip>{{ text }}</ellipsis>
        <ellipsis :length="50" tooltip>{{ text }}</ellipsis>
      </span>
      <span slot="companyDefaultImg" slot-scope="src">
        <img :src="src | getImgUrl" width="60" height="45" @click="showPreviewImg(src)"/>
        <img :src="src | getImgUrl" width="60" height="45" @click="showPreviewImg(src)" style="cursor: pointer;"/>
      </span>
      <span slot="companyExchangeImg" slot-scope="src">
        <img :src="src | getImgUrl" width="60" height="45" @click="showPreviewImg(src)"/>
        <img :src="src | getImgUrl" width="60" height="45" @click="showPreviewImg(src)" style="cursor: pointer;"/>
      </span>
      <span slot="companyAssociatedCase" slot-scope="text">
        <ellipsis :length="10" tooltip>{{ text }}</ellipsis>
        <ellipsis :length="20" tooltip>{{ text }}</ellipsis>
      </span>
      <span slot="companyJumpUrl" slot-scope="text">
        <ellipsis :length="10" tooltip>{{ text }}</ellipsis>
        <ellipsis :length="80" tooltip>{{ text }}</ellipsis>
      </span>
      <span slot="action" slot-scope="text, record">
        <a-popconfirm placement="top" :title="record.companyIsLine===1? '是否确认下线该条目?':'是否确认上线该条目?'" @confirm="() => editjobStatusStatus(record.companyIsLine,record)">
          <a>{{ statusFilter(record.companyIsLine) }}</a>
        </a-popconfirm>
        <a-divider type="vertical"/>
        <a v-if="hasPerm('companyCaseIndex:edit')" @click="$refs.editForm.edit(record)">编辑</a>
        <a-divider type="vertical" v-if="hasPerm('companyCaseIndex:edit') && hasPerm('companyCaseIndex:delete')"/>
        <a-popconfirm v-if="hasPerm('companyCaseIndex:delete')" placement="topRight" title="是否确认删除该条目?" @confirm="() => companyCaseIndexDelete(record)">
@ -54,7 +55,7 @@
    </s-table>
    <add-form ref="addForm" @ok="handleOk" />
    <edit-form ref="editForm" @ok="handleOk" />
    <a-modal :visible="previewVisible" :footer="null" @cancel="handleCancel">
    <a-modal :visible="previewVisible" :footer="null" @cancel="handleCancel" title="预览">
      <img alt="example" style="width: 100%" :src="previewImage" />
    </a-modal>
  </a-card>
@ -64,8 +65,10 @@
  import homeApi from '@/api/homeApi'
  import { setImgUrl } from '@/utils/img'
  import addForm from './addCompanyCaseForm'
  import editForm from './editBannerForm'
  // import { sysDictTypeDropDown } from '@/api/modular/system/dictManage'
  import editForm from './editCompanyCaseForm'
  const _ = require('lodash')
  export default {
    name: 'CompanyCaseIndex',
    components: {
@ -115,8 +118,8 @@
          },
          {
            title: '关联案例',
            dataIndex: 'companyAssociatedCase',
            scopedSlots: { customRender: 'companyAssociatedCase' }
            dataIndex: 'companyAssociatedCaseShow',
            scopedSlots: { customRender: 'companyAssociatedCaseShow' }
          },
          {
            title: '跳转链接',
@ -133,7 +136,11 @@
        // 加载数据方法 必须为 Promise 对象
        loadData: parameter => {
          return homeApi.findCompanyCaseById(Object.assign(parameter, this.queryParam)).then((res) => {
            return res.data
            var data = res.data
            _.each(data.rows, (item, index) => {
                item.companyAssociatedCaseShow = JSON.parse(item.companyAssociatedCase).articleContentTitle || JSON.parse(item.companyAssociatedCase).articleContentClassify
            })
            return data
          })
        },
        selectedRowKeys: [],
@ -162,9 +169,9 @@
      statusFilter (status) {
        const values = this.statusDictTypeDropDown.filter(item => item.code === status)
        if (values.length > 0) {
          return values[0].value
          return values[0].name
        } else {
          return 'ddd'
          return '上线'
        }
      },
      /**
@ -172,19 +179,27 @@
       */
      editjobStatusStatus (code, record) {
        if (code === 1) {
          homeApi.updateIsLineCompanyCase({ id: record.id, isLine: false }).then(res => {
            if (res.success) {
              this.$message.success('下线成功')
              this.$refs.table.refresh()
          homeApi.updateIsLineCompanyCase({ id: record.companyId, isLine: 0 }).then(res => {
            if (res.status === 200) {
              if (res.data) {
                this.$message.success('下线成功')
                this.$refs.table.refresh()
              } else {
                this.$message.error('下线失败')
              }
            } else {
              this.$message.error('下线失败:' + res.message)
            }
          })
        } else if (code === 2) {
          homeApi.updateIsLineCompanyCase({ id: record.id, isLine: true }).then(res => {
            if (res.success) {
              this.$message.success('上线成功')
              this.$refs.table.refresh()
        } else {
          homeApi.updateIsLineCompanyCase({ id: record.companyId, isLine: 1 }).then(res => {
            if (res.status === 200) {
              if (res.data) {
                this.$message.success('上线成功')
                this.$refs.table.refresh()
              } else {
                this.$message.error('上线失败')
              }
            } else {
              this.$message.error('上线失败:' + res.message)
            }
@ -192,10 +207,14 @@
        }
      },
      companyCaseIndexDelete (record) {
        homeApi.deleteCompanyCase({ id: record.id }).then((res) => {
          if (res.success) {
            this.$message.success('删除成功')
            this.$refs.table.refresh()
        homeApi.deleteCompanyCase({ id: record.companyId }).then((res) => {
          if (res.status === 200) {
            if (res.data) {
              this.$message.success('删除成功')
              this.$refs.table.refresh()
            } else {
              this.$message.error('删除失败')
            }
          } else {
            this.$message.error('删除失败:' + res.message)
          }

+ 33 - 21
_web/src/views/homeManager/indexPartner.vue

@ -21,13 +21,13 @@
      :columns="columns"
      :data="loadData"
      :alert="true"
      :rowKey="(record) => record.id"
      :rowKey="(record) => record.partnerId"
    >
      <span slot="partnerName" slot-scope="text">
        <ellipsis :length="30" tooltip>{{ text }}</ellipsis>
      </span>
      <span slot="partnerImage" slot-scope="src">
        <img :src="src | getImgUrl" width="60" height="45" @click="showPreviewImg(src)"/>
      <span slot="partnerImg" slot-scope="src">
        <img :src="src | getImgUrl" width="60" height="45" @click="showPreviewImg(src)" style="cursor: pointer;"/>
      </span>
      <span slot="action" slot-scope="text, record">
        <a-popconfirm placement="top" :title="record.partnerIsLine===1? '是否确认下线该条目?':'是否确认上线该条目?'" @confirm="() => editjobStatusStatus(record.partnerIsLine,record)">
@ -43,7 +43,7 @@
    </s-table>
    <add-form ref="addForm" @ok="handleOk" />
    <edit-form ref="editForm" @ok="handleOk" />
    <a-modal :visible="previewVisible" :footer="null" @cancel="handleCancel">
    <a-modal :visible="previewVisible" :footer="null" @cancel="handleCancel" title="预览">
      <img alt="example" style="width: 100%" :src="previewImage" />
    </a-modal>
  </a-card>
@ -53,8 +53,8 @@
  import homeApi from '@/api/homeApi'
  import { setImgUrl } from '@/utils/img'
  import addForm from './addPartnerForm'
  import editForm from './editBannerForm'
  // import { sysDictTypeDropDown } from '@/api/modular/system/dictManage'
  import editForm from './editPartnerForm'
  export default {
    name: 'PartnerIndex',
    components: {
@ -85,8 +85,8 @@
          },
          {
            title: '图片',
            dataIndex: 'partnerImage',
            scopedSlots: { customRender: 'partnerImage' },
            dataIndex: 'partnerImg',
            scopedSlots: { customRender: 'partnerImg' },
            align: 'center'
          },
          {
@ -127,7 +127,7 @@
      statusFilter (status) {
        const values = this.statusDictTypeDropDown.filter(item => item.code === status)
        if (values.length > 0) {
          return values[0].value
          return values[0].name
        } else {
          return '上线'
        }
@ -137,19 +137,27 @@
       */
      editjobStatusStatus (code, record) {
        if (code === 1) {
          homeApi.updateIsLinePartner({ id: record.id, isLine: false }).then(res => {
            if (res.success) {
              this.$message.success('下线成功')
              this.$refs.table.refresh()
          homeApi.updateIsLinePartner({ id: record.partnerId, isLine: false }).then(res => {
            if (res.status === 200) {
              if (res.data) {
                this.$message.success('下线成功')
                this.$refs.table.refresh()
              } else {
                this.$message.error('下线失败')
              }
            } else {
              this.$message.error('下线失败:' + res.message)
            }
          })
        } else if (code === 2) {
          homeApi.updateIsLinePartner({ id: record.id, isLine: true }).then(res => {
            if (res.success) {
              this.$message.success('上线成功')
              this.$refs.table.refresh()
          homeApi.updateIsLinePartner({ id: record.partnerId, isLine: true }).then(res => {
            if (res.status === 200) {
              if (res.data) {
                this.$message.success('上线成功')
                this.$refs.table.refresh()
              } else {
                this.$message.error('上线失败')
              }
            } else {
              this.$message.error('上线失败:' + res.message)
            }
@ -157,10 +165,14 @@
        }
      },
      partnerIndexDelete (record) {
        homeApi.deletePartner({ id: record.id }).then((res) => {
          if (res.success) {
            this.$message.success('删除成功')
            this.$refs.table.refresh()
        homeApi.deletePartner({ id: record.partnerId }).then((res) => {
          if (res.status === 200) {
            if (res.data) {
              this.$message.success('删除成功')
              this.$refs.table.refresh()
            } else {
              this.$message.error('删除失败')
            }
          } else {
            this.$message.error('删除失败:' + res.message)
          }