<template>
  <div class="app-container">
    <el-tabs v-model="activeName" @tab-click="handleClick">
      <el-tab-pane label="CID配置" name="cId.config">
        <el-form :model="form40" label-width="200px">
          <el-form-item label="是否开启手机号配置" prop="enablePhoneConfig">
            <el-switch v-model="form40.enablePhoneConfig"></el-switch>
          </el-form-item>

          <template v-if="form40.enablePhoneConfig">
            <el-form-item label="生成条数" prop="generateCount">
              <el-input-number v-model="form40.generateCount" :min="1" :step="1" :precision="0" placeholder="请输入生成条数"></el-input-number>
            </el-form-item>

            <el-form-item label="开始位置" prop="startIndex">
              <el-input-number v-model="form40.startIndex" :min="1" :step="1" :precision="0" placeholder="例如: 1"></el-input-number>
              <span class="tip-text">（从第几位开始生成）</span>
            </el-form-item>

            <el-form-item label="结束位置" prop="endIndex">
              <el-input-number v-model="form40.endIndex" :min="1" :step="1" :precision="0" placeholder="例如: 11"></el-input-number>
              <span class="tip-text">（到第几位结束）</span>
            </el-form-item>
          </template>

          <el-form-item label="是否开手机号拨打次数限制" prop="enablePhoneLimitConfig">
            <el-switch v-model="form40.enablePhoneLimitConfig"></el-switch>
          </el-form-item>
          <template v-if="form40.enablePhoneLimitConfig">
            <el-form-item label="拨打次数限制" prop="startIndex">
              <el-input-number v-model="form40.numberCalls" :min="1" :step="1" :precision="0" placeholder="例如: 1"></el-input-number>
            </el-form-item>
          </template>
           <el-form-item label="DeepSeekChat模型并发数" prop="DeepSeekChatConcurrency">
            <el-input v-model="form40.concurrency" placeholder="请输入DeepSeekChat模型并发数"></el-input>
          </el-form-item>
          <el-form-item label="DeepSeekChat服务地址" prop="DeepSeekChatServerAddress">
            <el-input v-model="form40.serverAddress" placeholder="请输入DeepSeekChat服务地址"></el-input>
          </el-form-item>
          <el-form-item label="DeepSeekChat_apiKey" prop="DeepSeekChatApiKey">
           <el-input v-model="form40.apiKey" placeholder="请输入DeepSeekChat_apiKey"></el-input>
          </el-form-item>
          <el-form-item label="DeepSeekChat模型名称" prop="DeepSeekChatModelName">
            <el-input v-model="form40.modelName" placeholder="请输入DeepSeekChat模型名称"></el-input>
          </el-form-item>
          <el-form-item label="是否限制外呼网关" prop="enableGateWayLimit">
            <el-switch v-model="form40.enableGateWayLimit"></el-switch>
          </el-form-item>
          <el-form-item label="系统可见外呼网关" prop="showGatewayIds" v-if="!!form40.enableGateWayLimit">
            <!-- <el-input v-model="" placeholder="请输入DeepSeekChat模型名称"></el-input> -->
             <el-select v-model="form40.showGatewayIds" multiple filterable placeholder="请选择系统可见外呼网关">
              <el-option
                v-for="item in gatewayList"
                :key="item.id"
                :label="item.gwDesc"
                :value="item.id">
              </el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="回调ip白名单配置" prop="legalIPs">
               <el-input v-model="form40.legalIPs" style="width:800px"
               type="textarea" :autosize="{ minRows: 2, maxRows: 6}"></el-input>
          </el-form-item>
          <el-form-item label="线路呼入回调地址" prop="inboundCallbackUrl">
              <el-input v-model="form40.inboundCallbackUrl" style="width:800px"></el-input>
          </el-form-item>
          <el-form-item label="Ai外呼回调地址" prop="callbackUrl">
               <el-input v-model="form40.callbackUrl" style="width:800px"></el-input>
            </el-form-item>
          <div class="footer">
            <el-button type="primary" @click="submitForm40">提 交</el-button>
          </div>
        </el-form>
      </el-tab-pane>

      <el-tab-pane label="个微配置" name="wx.config">
        <el-form :model="form30" label-width="200px">
          <el-form-item  label="新账号判断时间" prop="newAccountTime">
            <el-input v-model="form30.newAccountTime" placeholder="请输入天" style="width: 150px">
              <template slot="append">天</template>
            </el-input>
          </el-form-item>
          <el-form-item  label="新账号每天添加数量" prop="newAccountAddNum">
            <el-input v-model="form30.newAccountAddNum" placeholder="请输入个" style="width: 150px">
              <template slot="append">个</template>
            </el-input>
          </el-form-item>
          <el-form-item  label="普通账号每天添加数量" prop="accountAddNum">
            <el-input v-model="form30.accountAddMin" placeholder="请输入个" style="width: 150px">
              <template slot="append">个</template>
            </el-input>
            <span> 到 </span>
            <el-input v-model="form30.accountAddMax" placeholder="请输入个" style="width: 150px">
              <template slot="append">个</template>
            </el-input>
          </el-form-item>
          <el-form-item  label="文字消息（条/分）" prop="accountAddNum">
            <el-input v-model="form30.txtMsgMinNum" placeholder="请输入条" style="width: 150px">
              <template slot="append">条</template>
            </el-input>
            <span> 到 </span>
            <el-input v-model="form30.txtMsgMaxNum" placeholder="请输入条" style="width: 150px">
              <template slot="append">条</template>
            </el-input>
          </el-form-item>
          <el-form-item  label="图片消息（条/分）" prop="accountAddNum">
            <el-input v-model="form30.imgMsgMinNum" placeholder="请输入条" style="width: 150px">
              <template slot="append">条</template>
            </el-input>
            <span> 到 </span>
            <el-input v-model="form30.imgMsgMaxNum" placeholder="请输入条" style="width: 150px">
              <template slot="append">条</template>
            </el-input>
          </el-form-item>
          <el-form-item  label="新号添加好友频率(条/分)" prop="accountAddNum">
            <el-input v-model="form30.newAccountAddWxMin" placeholder="请输入分" style="width: 150px">
              <template slot="append">分</template>
            </el-input>
            <span> 到 </span>
            <el-input v-model="form30.newAccountAddWxMax" placeholder="请输入分" style="width: 150px">
              <template slot="append">分</template>
            </el-input>
          </el-form-item>
          <el-form-item  label="新号消息发送频率(条/秒)" prop="accountAddNum">
            <el-input v-model="form30.newAccountSendMsgMin" placeholder="请输入秒" style="width: 150px">
              <template slot="append">秒</template>
            </el-input>
            <span> 到 </span>
            <el-input v-model="form30.newAccountSendMsgMax" placeholder="请输入秒" style="width: 150px">
              <template slot="append">秒</template>
            </el-input>
          </el-form-item>
          <el-form-item  label="添加好友频率(条/分)" prop="accountAddNum">
            <el-input v-model="form30.accountAddWxMin" placeholder="请输入分" style="width: 150px">
              <template slot="append">分</template>
            </el-input>
            <span> 到 </span>
            <el-input v-model="form30.accountAddWxMax" placeholder="请输入分" style="width: 150px">
              <template slot="append">分</template>
            </el-input>
          </el-form-item>
          <el-form-item  label="消息发送频率(条/秒)" prop="accountAddNum">
            <el-input v-model="form30.accountSendMsgMin" placeholder="请输入秒" style="width: 150px">
              <template slot="append">秒</template>
            </el-input>
            <span> 到 </span>
            <el-input v-model="form30.accountSendMsgMax" placeholder="请输入秒" style="width: 150px">
              <template slot="append">秒</template>
            </el-input>
          </el-form-item>
          <div class="footer">
            <el-button type="primary" @click="submitForm30">提 交</el-button>
          </div>
        </el-form>
      </el-tab-pane>
      <el-tab-pane label="OSS配置" name="sys.oss.cloudStorage">
        <el-form ref="form1" :model="form1" :rules="rules1" label-width="160px">
          <el-form-item label="类型" prop="type">
            <el-radio-group v-model="form1.type">
              <el-radio :label="1">七牛云</el-radio>
              <el-radio :label="2">阿里云</el-radio>
              <el-radio :label="3">腾讯云</el-radio>
              <el-radio :label="4">华为云</el-radio>
            </el-radio-group>
          </el-form-item>
          <el-form-item v-if="form1.type==1" label="七牛绑定的域名" prop="qiniuDomain">
            <el-input v-model="form1.qiniuDomain" label="请输入七牛绑定的域名"></el-input>
          </el-form-item>
          <el-form-item v-if="form1.type==1" label="七牛路径前缀" prop="qiniuPrefix">
            <el-input v-model="form1.qiniuPrefix" label="请输入七牛路径前缀"></el-input>
          </el-form-item>
          <el-form-item v-if="form1.type==1" label="七牛ACCESS_KEY" prop="qiniuAccessKey">
            <el-input v-model="form1.qiniuAccessKey" label="请输入七牛ACCESS_KEY"></el-input>
          </el-form-item>
          <el-form-item v-if="form1.type==1" label="七牛SecretKey" prop="qiniuSecretKey">
            <el-input v-model="form1.qiniuSecretKey" label="七牛SecretKey不能为空"></el-input>
          </el-form-item>
          <el-form-item v-if="form1.type==1" label="七牛空间名" prop="qiniuBucketName">
            <el-input v-model="form1.qiniuBucketName" label="七牛空间名不能为空"></el-input>
          </el-form-item>
          <el-form-item v-if="form1.type==2" label="阿里云绑定的域名" prop="aliyunDomain">
            <el-input v-model="form1.aliyunDomain" label="阿里云绑定的域名不能为空"></el-input>
          </el-form-item>
          <el-form-item v-if="form1.type==2" label="阿里云路径前缀" prop="aliyunPrefix">
            <el-input v-model="form1.aliyunPrefix" label="阿里云路径前缀不能为空"></el-input>
          </el-form-item>
          <el-form-item v-if="form1.type==2" label="阿里云EndPoint" prop="aliyunEndPoint">
            <el-input v-model="form1.aliyunEndPoint" label="阿里云EndPoint不能为空"></el-input>
          </el-form-item>
          <el-form-item v-if="form1.type==2" label="阿里云AccessKeyId" prop="aliyunAccessKeyId">
            <el-input v-model="form1.aliyunAccessKeyId" label="阿里云AccessKeyId不能为空"></el-input>
          </el-form-item>
          <el-form-item v-if="form1.type==2" label="阿里云AccessKeySecret" prop="aliyunAccessKeySecret">
            <el-input v-model="form1.aliyunAccessKeySecret" label="阿里云AccessKeySecret不能为空"></el-input>
          </el-form-item>
          <el-form-item v-if="form1.type==2" label="阿里云BucketName" prop="aliyunBucketName">
            <el-input v-model="form1.aliyunBucketName" label="阿里云BucketName不能为空"></el-input>
          </el-form-item>
          <el-form-item v-if="form1.type==3" label="腾讯云绑定的域名" prop="qcloudDomain">
            <el-input v-model="form1.qcloudDomain" label="腾讯云绑定的域名格式不正确"></el-input>
          </el-form-item>
          <el-form-item v-if="form1.type==3" label="腾讯云前缀" prop="qcloudPrefix">
            <el-input v-model="form1.qcloudPrefix" label="腾讯云前缀不能为空"></el-input>
          </el-form-item>
          <el-form-item v-if="form1.type==3" label="腾讯云SecretId" prop="qcloudSecretId">
            <el-input v-model="form1.qcloudSecretId" label="腾讯云SecretId不能为空"></el-input>
          </el-form-item>
          <el-form-item v-if="form1.type==3" label="腾讯云SecretKey" prop="qcloudSecretKey">
            <el-input v-model="form1.qcloudSecretKey" label="腾讯云SecretKey不能为空"></el-input>
          </el-form-item>
          <el-form-item v-if="form1.type==3" label="腾讯云BucketName" prop="qcloudBucketName">
            <el-input v-model="form1.qcloudBucketName" label="腾讯云BucketName不能为空"></el-input>
          </el-form-item>
          <el-form-item v-if="form1.type==3" label="所属地区" prop="qcloudRegion">
            <el-input v-model="form1.qcloudRegion" label="所属地区不能为空"></el-input>
          </el-form-item>
          <el-form-item v-if="form1.type==4" label="华为云绑定的域名" prop="huaweiDomain">
            <el-input v-model="form1.huaweiDomain" label="华为云绑定的域名格式不正确"></el-input>
          </el-form-item>
          <el-form-item v-if="form1.type==4" label="华为云Endpoint" prop="huaweiBucketName">
            <el-input v-model="form1.huaweiEndpoint" label="华为云Endpoint不能为空"></el-input>
          </el-form-item>

          <el-form-item v-if="form1.type==4" label="华为云AK" prop="huaweiAK">
            <el-input v-model="form1.huaweiAK" label="华为云AK不能为空"></el-input>
          </el-form-item>
          <el-form-item v-if="form1.type==4" label="华为云SK" prop="huaweiSK">
            <el-input v-model="form1.huaweiSK" label="华为云SK不能为空"></el-input>
          </el-form-item>
          <el-form-item v-if="form1.type==4" label="华为云BucketName" prop="huaweiBucketName">
            <el-input v-model="form1.huaweiBucketName" label="华为云BucketName不能为空"></el-input>
          </el-form-item>
          <div class="footer">
            <el-button type="primary" @click="submitForm1">提 交</el-button>
          </div>
        </el-form>
      </el-tab-pane>


      <el-tab-pane label="问诊配置" name="his.inquiryConfig">
        <el-form label-width="180px">
          <el-form-item :label="item.type==1?'图文问诊价格':'视频问诊价格'" prop="price" v-for="item in form2.prices">
            <el-input-number v-model="item.price" :precision="2" :step="0.1"></el-input-number>
          </el-form-item>
          <el-form-item label="问诊费扣款" prop="companyPrice">
            <el-input-number v-model="form2.companyPrice" :precision="2" :step="0.1"></el-input-number>
          </el-form-item>
          <el-form-item label="开药问诊费扣款" prop="companyPrescribePrice">
            <el-input-number v-model="form2.companyPrescribePrice" :precision="2" :step="0.1"></el-input-number>
          </el-form-item>
          <el-form-item label="待支付订单取消时间(分钟)" prop="unPayCancelTime">
            <el-tooltip class="item" effect="dark" content="待支付订单取消时间(分钟)" placement="top-end">
              <el-input-number v-model="form2.unPayCancelTime" :min="0"></el-input-number>
            </el-tooltip>
          </el-form-item>
          <el-form-item label="问诊未接单取消时间(分钟)" prop="unReceiveCancelTime">
            <el-tooltip class="item" effect="dark" content="问诊未接单取消时间(分钟)" placement="top-end">
              <el-input-number v-model="form2.unReceiveCancelTime" :min="0"></el-input-number>
            </el-tooltip>
          </el-form-item>
          <el-form-item label="是否自动审方" prop="doctorRegister">
            <el-switch
              v-model="form2.isAutoPrescribeAudit"
              active-color="#13ce66"
              inactive-color="#ff4949"
            >
            </el-switch>
          </el-form-item>
          <el-form-item label="会诊类型" prop="inquirySubType">
            <div>
              <el-button plain type="primary" icon="el-icon-plus" @click="addInquirySubType"
                         style="margin-bottom: 5px;"
              >添加会诊类型
              </el-button>
              <el-table border :data="form2.inquirySubType" style="width: 701px;">

                <el-table-column prop="lable" label="名称" width="300px">
                  <template slot-scope="scope">
                    <el-input v-model="scope.row.lable"></el-input>
                  </template>
                </el-table-column>
                <el-table-column prop="value" label="类型" width="300px">

                  <template slot-scope="scope">
                    <el-select v-model="scope.row.value" placeholder="类型" clearable size="small">
                      <el-option
                        v-for="dict in inquirySubTypeOptions"
                        :key="dict.dictValue"
                        :label="dict.dictLabel"
                        :value="dict.dictValue"
                      />
                    </el-select>
                  </template>
                </el-table-column>
                <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="100px"
                                 fixed="right"
                >
                  <template slot-scope="scope">
                    <el-button
                      size="mini"
                      type="text"
                      icon="el-icon-delete"
                      @click="deleteInquirySubType(scope.$index, scope.row)"
                    >删除
                    </el-button>
                  </template>
                </el-table-column>
              </el-table>
            </div>
          </el-form-item>


          <div class="footer">
            <el-button type="primary" @click="submitform2">提 交</el-button>
          </div>
        </el-form>
      </el-tab-pane>

      <el-tab-pane label="协议配置" name="his.agreementConfig">
        <el-form ref="form3" :model="form3" label-width="150px" :rules="rules4">
          <el-form-item label="医生注册协议" prop="doctorRegister">
            <editor v-model="form3.doctorRegister" :min-height="292"/>
          </el-form-item>
          <el-form-item label="医生多机构备案协议" prop="doctorFiling">
            <editor v-model="form3.doctorFiling" :min-height="292"/>
          </el-form-item>
          <el-form-item label="用户协议" prop="userRegister">
            <editor v-model="form3.userRegister" :min-height="292"/>
          </el-form-item>
          <el-form-item label="隐私协议" prop="userPrivacy">
            <editor v-model="form3.userPrivacy" :min-height="292"/>
          </el-form-item>
          <el-form-item label="健康客服协议" prop="userHealth">
            <editor v-model="form3.userHealth" :min-height="292"/>
          </el-form-item>
          <el-form-item label="会员服务协议" prop="vipService">
            <editor v-model="form3.vipService" :min-height="292"/>
          </el-form-item>
          <el-form-item label="会员自动续费协议" prop="vipAutomaticService">
            <editor v-model="form3.vipAutomaticService" :min-height="292"/>
          </el-form-item>
          <el-form-item label="用户注销协议" prop="vipAutomaticService">
            <editor v-model="form3.userRemoveService" :min-height="292"/>
          </el-form-item>
          <el-form-item label="APP用户协议" prop="appUserAgreement">
            <editor v-model="form3.appUserAgreement" :min-height="292"/>
          </el-form-item>
          <el-form-item label="APP隐私协议" prop="appPrivacyAgreement">
            <editor v-model="form3.appPrivacyAgreement" :min-height="292"/>
          </el-form-item>

          <div class="footer">
            <el-button type="primary" @click="submitForm3">提 交</el-button>
          </div>
        </el-form>
      </el-tab-pane>

      <el-tab-pane label="资质证明" name="his.certs">
        <el-form ref="form4" :model="form4" label-width="150px">
          <el-form-item label="资质证明" prop="certs">
            <Material v-model="photoArr" type="image" :num="10" :width="150" :height="150"/>
          </el-form-item>

          <div class="footer">
            <el-button type="primary" @click="submitForm4">提 交</el-button>
          </div>
        </el-form>
      </el-tab-pane>
      <el-tab-pane label="品牌介绍" name="his.brand">
        <el-form ref="form16" :model="form16" label-width="150px">
          <el-form-item label="品牌介绍" prop="brandInfo">
            <ImageUpload v-model="form16.brandInfo" type="image" :num="10" :width="150" :height="150"/>
          </el-form-item>

          <div class="footer">
            <el-button type="primary" @click="submitForm16">提 交</el-button>
          </div>
        </el-form>
      </el-tab-pane>
      <el-tab-pane label="佣金配置" name="his.brokerage" style="width: 100%;">

        <div>
          <el-table border :data="form5" style="width: 100%;">
            <el-table-column prop="type" label="类型" width="300px"/>
            <el-table-column prop="doctorMedicineBrokerage" label="医生中药佣金%" width="300px">
              <template slot-scope="scope">
                <el-input-number v-model="scope.row.doctorMedicineBrokerage" :min="0" :max="100"></el-input-number>
              </template>
            </el-table-column>
            <el-table-column prop="doctorInquiryBrokerage" label="医生服务佣金%" width="300px">
              <template slot-scope="scope">
                <el-input-number v-model="scope.row.doctorInquiryBrokerage" :min="0" :max="100"></el-input-number>
              </template>
            </el-table-column>
            <el-table-column prop="tuiMedicineBrokerage" label="推广人员中药佣金%" width="300px">
              <template slot-scope="scope">
                <el-input-number v-model="scope.row.tuiMedicineBrokerage" :min="0" :max="100"></el-input-number>
              </template>
            </el-table-column>
          </el-table>
          <div style="float: right;" class="footer">
            <el-button type="primary" @click="submitForm5">提 交</el-button>
          </div>
        </div>
      </el-tab-pane>

      <el-tab-pane label="优惠券" name="his.coupon">
        <el-form ref="form6" :model="form6" label-width="150px">
          <el-form-item label="用户注册优惠券" prop="inquiryBrokerage">
            <el-select v-model="form6.registerCoupon" multiple placeholder="请选择" style="width: 300px;">
              <el-option
                v-for="item in couponList"
                :key="item.couponId"
                :label="item.title"
                :value="item.couponId"
              ></el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="新手任务优惠券" prop="userTaskCoupon">
            <el-select v-model="form6.userTaskCoupon" placeholder="请选择" style="width: 300px;">
              <el-option
                v-for="item in couponList"
                :key="item.couponId"
                :label="item.title"
                :value="item.couponId"
              ></el-option>
            </el-select>
          </el-form-item>
          <div class="footer">
            <el-button type="primary" @click="submitForm6">提 交</el-button>
          </div>
        </el-form>
      </el-tab-pane>

      <el-tab-pane label="商城配置" name="his.store">
        <el-form ref="form1" :model="form7" label-width="180px">

          <el-form-item label="物流代收支付比例" prop="payRate">
            <el-tooltip class="item" effect="dark" content="物流代收支付比例(%)" placement="top-end">
              <el-input-number v-model="form7.payRate"></el-input-number>
            </el-tooltip>
          </el-form-item>
          <el-form-item label="货到付款加收运费(元)" prop="payPostage">
            <el-tooltip class="item" effect="dark" content="货到付款加收运费(元)" placement="top-end">
              <el-input-number v-model="form7.payPostage"></el-input-number>
            </el-tooltip>
          </el-form-item>
          <el-form-item label="待支付订单取消时间" prop="unPayTime">
            <el-tooltip class="item" effect="dark" content="待支付订单取消时间(分钟)" placement="top-end">
              <el-input-number v-model="form7.unPayTime" :min="1"></el-input-number>
            </el-tooltip>

          </el-form-item>
          <el-form-item label="公司推广佣金比例" prop="tuiMoneyRate">
            <el-tooltip class="item" effect="dark" content="公司推广佣金比例(%)" placement="top-end">
              <el-input-number v-model="form7.tuiMoneyRate" :min="1" :max="100"></el-input-number>
            </el-tooltip>
          </el-form-item>
          <el-form-item label="公司发货扣除成本比例" prop="deductMoneyRate">
            <el-tooltip class="item" effect="dark" content="公司发货扣除成本比例(%)" placement="top-end">
              <el-input-number v-model="form7.deductMoneyRate" :min="1" :max="100"></el-input-number>
            </el-tooltip>
          </el-form-item>
          <el-form-item label="申请售后有效天数" prop="storeAfterSalesDay">
            <el-tooltip class="item" effect="dark" content="确认收货后申请售后天数" placement="top-end">
              <el-input-number v-model="form7.storeAfterSalesDay" :min="0" :max="100"></el-input-number>
            </el-tooltip>
          </el-form-item>
          <el-form-item label="坐席自动回收天数" prop="storeCall">
            <el-tooltip class="item" effect="dark" content="坐席自动回收天数" placement="top-end">
              <el-input-number v-model="form7.storeCall" :min="0" :max="100"></el-input-number>
            </el-tooltip>
          </el-form-item>
          <el-form-item  label="最低阈值" prop="minimumThreshold">
            <el-tooltip class="item" effect="dark" content="最低阈值" placement="top-end">
              <el-input-number    v-model="form7.minimumThreshold"  :min="0"  ></el-input-number>
            </el-tooltip>
          </el-form-item>
          <el-form-item label="退货收货人" prop="refundConsignee">
            <el-tooltip class="item" effect="dark" content="退货收货人" placement="top-end">
              <el-input style="width:200px" v-model="form7.refundConsignee"></el-input>
            </el-tooltip>
          </el-form-item>
          <el-form-item label="退货手机号" prop="refundPhoneNumber">
            <el-tooltip class="item" effect="dark" content="退货手机号" placement="top-end">
              <el-input style="width:200px" v-model="form7.refundPhoneNumber"></el-input>
            </el-tooltip>
          </el-form-item>
          <el-form-item label="退货地址" prop="refundAddress">
            <el-tooltip class="item" effect="dark" content="退货地址" placement="top-end">
              <el-input v-model="form7.refundAddress"></el-input>
            </el-tooltip>
          </el-form-item>
          <el-form-item label="随访模板" prop="followTempId">
            <el-select v-model="form7.followTempId" placeholder="请选择模板" clearable size="small">
              <el-option
                v-for="dict in tempOptions"
                :key="dict.dictValue"
                :label="dict.dictLabel"
                :value="dict.dictValue"
              />
            </el-select>
          </el-form-item>
          <el-form-item label="基础疾病随访" prop="oneFollowTempId">
            <el-select v-model="form7.oneFollowTempId" placeholder="请选择模板" clearable size="small">
              <el-option
                v-for="dict in tempOptions"
                :key="dict.dictValue"
                :label="dict.dictLabel"
                :value="dict.dictValue"
              />
            </el-select>
          </el-form-item>
          <el-form-item label="随访频率(天)" prop="followRate">
            <el-tooltip class="item" effect="dark" content="followRate" placement="top-end">
              <el-input-number v-model="form7.followRate" :min="0" :max="1000"></el-input-number>
            </el-tooltip>
          </el-form-item>
          <el-form-item  label="是否需要根据物流信息更新订单完成状态" prop="isUpdateOrder">
            <el-switch
              v-model="form7.isUpdateOrder"
              active-color="#13ce66"
              inactive-color="#ff4949"
              :active-value=1
              :inactive-value=0
            >
            </el-switch>
          </el-form-item>
          <el-form-item  label="是否开启就诊人身份验证" prop="isIdVerification">
            <el-switch
              v-model="form7.isIdVerification"
              active-color="#13ce66"
              inactive-color="#ff4949"
              :active-value=1
              :inactive-value=0>
            </el-switch>
          </el-form-item>
          <el-form-item label="API_URL" v-if="form7.isIdVerification == 1" prop="API_URL">
            <el-input   v-model="form7.API_URL"  label="请输入API_URL"></el-input>
          </el-form-item>
          <el-form-item label="HASHCODE" v-if="form7.isIdVerification == 1" prop="HASHCODE">
            <el-input   v-model="form7.HASHCODE"  label="请输入HASHCODE"></el-input>
          </el-form-item>
          <el-form-item label="SECRET_KEY" v-if="form7.isIdVerification == 1" prop="SECRET_KEY">
            <el-input   v-model="form7.SECRET_KEY"  label="请输入SECRET_KEY"></el-input>
          </el-form-item>
          <el-form-item label="跳转商城小程序" prop="jumpStoreAppId">
            <el-input   v-model="form7.jumpStoreAppId"  label="请输入跳转商城小程序"></el-input>
          </el-form-item>
          <el-form-item label="检查库存" prop="checkStock">
            <el-radio-group v-model="form7.checkStock">
              <el-radio :label="true">开启</el-radio>
              <el-radio :label="false">关闭</el-radio>
            </el-radio-group>
            <el-tooltip class="item" effect="dark" content="开启后，创建订单时会检查商品库存，库存不足时不允许创建订单" placement="top-end">
              <i class="el-icon-question" style="margin-left: 5px; color: #909399;"></i>
            </el-tooltip>
          </el-form-item>
          <el-form-item label="销售订单模式" prop="enableCompanyOrderMode">
            <el-switch
              v-model="form7.enableCompanyOrderMode"
              active-color="#13ce66"
              inactive-color="#ff4949">
            </el-switch>
          </el-form-item>
          <el-form-item label="订单关联课程视频" prop="enableOrderCourseBinding">
            <el-switch
              v-model="form7.enableOrderCourseBinding"
              active-color="#13ce66"
              inactive-color="#ff4949">
            </el-switch>
          </el-form-item>
          <el-form-item label="订单绑定销售" prop="enableOrderSalesBinding">
            <el-switch
              v-model="form7.enableOrderSalesBinding"
              active-color="#13ce66"
              inactive-color="#ff4949">
            </el-switch>
          </el-form-item>
          <el-form-item label="运费模板校验" prop="enablePostageCheck">
            <el-switch
              v-model="form7.enablePostageCheck"
              active-color="#13ce66"
              inactive-color="#ff4949">
            </el-switch>
          </el-form-item>
          <el-form-item label="运费加入订单金额" prop="enablePostageAddToTotal">
            <el-switch
              v-model="form7.enablePostageAddToTotal"
              active-color="#13ce66"
              inactive-color="#ff4949">
            </el-switch>
          </el-form-item>
          <el-form-item label="积分订单手机号解密" prop="enableIntegralOrderPhoneDecrypt">
            <el-switch
              v-model="form7.enableIntegralOrderPhoneDecrypt"
              active-color="#13ce66"
              inactive-color="#ff4949">
            </el-switch>
          </el-form-item>
          <el-form-item label="是否开启购物积分" prop="enableShoppingPoints">
            <el-switch
              v-model="form7.enableShoppingPoints"
              active-color="#13ce66"
              inactive-color="#ff4949">
            </el-switch>
          </el-form-item>
          <el-form-item label="是否归属商城订单" prop="enableStoreOrderAttribution">
            <el-switch
              v-model="form7.enableStoreOrderAttribution"
              active-color="#13ce66"
              inactive-color="#ff4949">
            </el-switch>
          </el-form-item>
          <el-row :gutter="20">
            <el-col :span="12">
              <el-form-item label="商城首页模块一展示" prop="enableHomeModuleOneShow" label-width="180px">
                <el-switch
                  v-model="form7.enableHomeModuleOneShow"
                  active-color="#13ce66"
                  inactive-color="#ff4949">
                </el-switch>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="商城首页模块二展示" prop="enableHomeModuleTwoShow" label-width="180px">
                <el-switch
                  v-model="form7.enableHomeModuleTwoShow"
                  active-color="#13ce66"
                  inactive-color="#ff4949">
                </el-switch>
              </el-form-item>
            </el-col>
          </el-row>
          <el-form-item label="取消商城聚水潭订单校验" prop="cancelStoreJstOrderCheck">
            <el-switch
              v-model="form7.cancelStoreJstOrderCheck"
              active-color="#13ce66"
              inactive-color="#ff4949">
            </el-switch>
          </el-form-item>

          <el-form-item  label="年支付金额限制" prop="yearPayPrice">
            <el-input-number v-model="form7.yearPayPrice" :precision="2" :step="0.1"></el-input-number>
          </el-form-item>
          <el-form-item  label="达限后支付限制金额" prop="canPayPrice">
            <el-input-number v-model="form7.canPayPrice" :precision="2" :step="0.1"></el-input-number>
          </el-form-item>
          <el-form-item  label="支付金额达限提示" prop="payPriceTip">
            <el-tooltip class="item" effect="dark" content="支付金额达限提示" placement="top-end">
              <el-input    v-model="form7.payPriceTip"   ></el-input>
            </el-tooltip>
          </el-form-item>

          <div class="footer">
            <el-button type="primary" @click="submitForm7">提 交</el-button>
          </div>
        </el-form>
      </el-tab-pane>

      <el-tab-pane label="积分比例配置" name="store.integral">
        <el-form ref="form24" :model="form24" :rules="rules3" label-width="160px">
          <el-form-item label="积分抵用比例" prop="integralRatio">
            <el-tooltip class="item" effect="dark" content="1积分抵多少金额" placement="top-end">
              <el-input-number v-model="form24.integralRatio"></el-input-number>
            </el-tooltip>
          </el-form-item>
          <el-form-item label="满多少可以抵扣" prop="integralFull">
            <el-tooltip class="item" effect="dark" content="消费必须满一定额度才可使用,0代表无限制" placement="top-end">
              <el-input-number v-model="form24.integralFull"></el-input-number>
            </el-tooltip>
          </el-form-item>
          <el-form-item label="单次最大抵扣积分" prop="integralMax">
            <el-tooltip class="item" effect="dark" content="限制一次只能使用多少积分,0代表无限制" placement="top-end">
              <el-input-number v-model="form24.integralMax"></el-input-number>
            </el-tooltip>
          </el-form-item>
          <div class="footer">
            <el-button type="primary" @click="submitForm24">提 交</el-button>
          </div>
        </el-form>
      </el-tab-pane>

      <el-tab-pane label="套餐包" name="his.package">
        <el-form ref="form8" :model="form8" label-width="150px">
          <el-form-item label="物流代收定金比例(%)" prop="payRate">
            <el-tooltip class="item" effect="dark" content="公司推广佣金比例(%)" placement="top-end">
              <el-input-number v-model="form8.payRate" :min="1" :max="100"></el-input-number>
            </el-tooltip>
          </el-form-item>

          <el-form-item label="货到付款加收运费(元)" prop="payDelivery">
            <el-tooltip class="item" effect="dark" content="货到付款加收运费" placement="top-end">
              <el-input-number v-model="form8.payDelivery" :min="0" :max="1000"></el-input-number>
            </el-tooltip>
          </el-form-item>
          <el-form-item label="随访频率(天)" prop="followRate">
            <el-tooltip class="item" effect="dark" content="followRate" placement="top-end">
              <el-input-number v-model="form8.followRate" :min="0" :max="1000"></el-input-number>
            </el-tooltip>
          </el-form-item>
          <el-form-item label="全款支付赠品" prop="gift">
            <div>
              <el-button plain type="primary" icon="el-icon-plus" @click="handleAddProduct">添加商品</el-button>
            </div>
            <el-table border width="100%" style="margin-top:5px;" :data="form8.gift">
              <el-table-column label="商品图片" align="center" width="100">
                <template slot-scope="scope">
                  <el-popover
                    placement="right"
                    title=""
                    trigger="hover"
                  >
                    <img slot="reference" :src="scope.row.image" width="50">
                    <img :src="scope.row.image" style="max-width: 50px;">
                  </el-popover>
                </template>
              </el-table-column>
              <el-table-column label="商品名称" show-overflow-tooltip align="center" prop="productName"/>
              <el-table-column label="商品编号" align="center" prop="barCode"/>
              <el-table-column label="商品规格" align="center" prop="sku"/>
              <el-table-column label="店铺名称" align="center" prop="storeName"/>
              <el-table-column label="售价" align="center" prop="price"/>
            </el-table>
          </el-form-item>
          <el-form-item label="物流代收赠品" prop="gift">
            <div>
              <el-button plain type="primary" icon="el-icon-plus" @click="handleDeliveryGift">添加商品</el-button>
            </div>
            <el-table border width="100%" style="margin-top:5px;" :data="form8.deliveryGift">
              <el-table-column label="商品图片" align="center" width="100">
                <template slot-scope="scope">
                  <el-popover
                    placement="right"
                    title=""
                    trigger="hover"
                  >
                    <img slot="reference" :src="scope.row.image" width="50">
                    <img :src="scope.row.image" style="max-width: 50px;">
                  </el-popover>
                </template>
              </el-table-column>
              <el-table-column label="商品名称" show-overflow-tooltip align="center" prop="productName"/>
              <el-table-column label="商品编号" align="center" prop="barCode"/>
              <el-table-column label="商品规格" align="center" prop="sku"/>
              <el-table-column label="店铺名称" align="center" prop="storeName"/>
              <el-table-column label="售价" align="center" prop="price"/>
            </el-table>
          </el-form-item>
          <el-form-item label="赠品店铺" prop="giftStoreId">
            <el-select v-model="form8.giftStoreId" placeholder="赠品店铺" clearable size="small">
              <el-option
                v-for="dict in storeOPtions"
                :key="dict.dictValue"
                :label="dict.dictLabel"
                :value="dict.dictValue"
              />
            </el-select>
          </el-form-item>
          <el-form-item label="赠品起送金额(元)" prop="giftPrice">
            <el-tooltip class="item" effect="dark" content="赠品起送金额" placement="top-end">
              <el-input-number v-model="form8.giftPrice" :min="0" :max="10000"></el-input-number>
            </el-tooltip>
          </el-form-item>
          <div class="footer">
            <el-button type="primary" @click="submitForm8">提 交</el-button>
          </div>
        </el-form>
      </el-tab-pane>
      <el-tab-pane label="支付配置" name="his.pay">
        <el-form ref="form9" :model="form9" label-width="160px">
          <el-form-item label="支付类型" prop="type">
            <el-radio-group v-model="form9.type">
              <el-radio label="yb">易宝</el-radio>
              <el-radio label="tz">台州银行</el-radio>
              <el-radio label="wx">微信</el-radio>
              <el-radio label="hf">汇付</el-radio>
              <el-radio label="appPay">跳转app支付</el-radio>
            </el-radio-group>
          </el-form-item>
          <el-form-item label="appId" prop="appId">
            <el-input v-model="form9.appId" label="请输入appId"></el-input>
          </el-form-item>
          <el-form-item v-if="form9.type=='yb'" label="易宝商户号" prop="ybAccount">
            <el-input v-model="form9.ybAccount" label="请输入易宝商户号"></el-input>
          </el-form-item>
          <el-form-item v-if="form9.type=='yb'" label="易宝Key" prop="ybKey">
            <el-input v-model="form9.ybKey" label="请输入易宝Key"></el-input>
          </el-form-item>
          <el-form-item v-if="form9.type=='yb'" label="易宝回调地址" prop="ybNotifyUrl">
            <el-input v-model="form9.ybNotifyUrl" label="易宝回调地址"></el-input>
          </el-form-item>
          <el-form-item v-if="form9.type=='tz'" label="台州商户号" prop="tzPlatMerCstNo">
            <el-input v-model="form9.tzPlatMerCstNo" label="请输入台州商户号"></el-input>
          </el-form-item>
          <el-form-item v-if="form9.type=='tz'" label="台州appSecret" prop="tzAppSecret">
            <el-input v-model="form9.tzAppSecret" label="请输入台州appSecret"></el-input>
          </el-form-item>
          <el-form-item v-if="form9.type=='tz'" label="台州私钥" prop="tzPrivateKey">
            <el-input v-model="form9.tzPrivateKey" label="请输入台州私钥"></el-input>
          </el-form-item>
          <el-form-item v-if="form9.type=='tz'" label="台州平台公钥" prop="tzPlatformPublicKey">
            <el-input v-model="form9.tzPlatformPublicKey" label="请输入台州平台公钥"></el-input>
          </el-form-item>
          <el-form-item v-if="form9.type=='tz'" label="台州appKey" prop="tzAppKey">
            <el-input v-model="form9.tzAppKey" label="请输入台州appKey"></el-input>
          </el-form-item>
          <el-form-item v-if="form9.type=='tz'" label="台州支付回调地址" prop="tzPayDecrypt">
            <el-input v-model="form9.tzPayDecrypt" label="请输入台州支付回调地址"></el-input>
          </el-form-item>
          <el-form-item v-if="form9.type=='tz'" label="退款回调地址" prop="tzRefundDecrypt">
            <el-input v-model="form9.tzRefundDecrypt" label="请输入退款回调地址"></el-input>
          </el-form-item>
          <el-form-item v-if="form9.type=='tz'" label="分账回调地址" prop="tzOrderShareDecrypt">
            <el-input v-model="form9.tzOrderShareDecrypt" label="请输入台州分账回调地址"></el-input>
          </el-form-item>
          <el-form-item v-if="form9.type=='wx'" label="微信商户号" prop="wxMchId">
            <el-input v-model="form9.wxMchId" label="请输入微信商户号"></el-input>
          </el-form-item>
          <el-form-item v-if="form9.type=='wx'" label="微信Key" prop="wxMchKey">
            <el-input v-model="form9.wxMchKey" label="请输入微信Key"></el-input>
          </el-form-item>
          <el-form-item v-if="form9.type=='wx'" label="微信商户V3密钥" prop="wxApiV3Key">
            <el-input v-model="form9.wxApiV3Key" label="请输入商户V3密钥"></el-input>
          </el-form-item>
          <el-form-item v-if="form9.type=='wx'" label="微信回调地址（scrm）" prop="notifyUrlScrm">
            <el-input v-model="form9.notifyUrlScrm" label="请输入商城微信回调地址"></el-input>
          </el-form-item>
          <el-form-item v-if="form9.type=='wx'" label="p12证书路径" prop="keyPath">
            <el-input v-model="form9.keyPath" label="请输入p12证书文件的绝对路径"></el-input>
          </el-form-item>

          <el-form-item v-if="form9.type=='hf'" label="汇付产品号" prop="hfProductId">
            <el-input v-model="form9.hfProductId" label="汇付产品号"></el-input>
          </el-form-item>
          <el-form-item v-if="form9.type=='hf'" label="系统号" prop="hfSysId">
            <el-input v-model="form9.hfSysId" label="系统号Key"></el-input>
          </el-form-item>
          <el-form-item v-if="form9.type=='hf'" label="商户号" prop="huifuId">
            <el-input v-model="form9.huifuId" label="商户号"></el-input>
          </el-form-item>
          <el-form-item v-if="form9.type=='hf'" label="商户私钥" prop="hfRsaPrivateKey">
            <el-input v-model="form9.hfRsaPrivateKey" label="商户私钥"></el-input>
          </el-form-item>
          <el-form-item v-if="form9.type=='hf'" label="汇付公钥" prop="hfRsaPublicKey">
            <el-input v-model="form9.hfRsaPublicKey" label="汇付公钥"></el-input>
          </el-form-item>
          <el-form-item v-if="form9.type=='hf'" label="汇付支付回调地址" prop="hfPayNotifyUrl">
            <el-input v-model="form9.hfPayNotifyUrl" label="汇付支付回调地址"></el-input>
          </el-form-item>
          <el-form-item v-if="form9.type=='hf'" label="大额支付回调地址" prop="hfPayOnlineNotifyUrl">
            <el-input v-model="form9.hfPayOnlineNotifyUrl" label="汇付支付回调地址"></el-input>
          </el-form-item>
          <el-form-item v-if="form9.type=='hf'" label="汇付退款回调地址" prop="hfRefundNotifyUrl">
            <el-input v-model="form9.hfRefundNotifyUrl" label="汇付退款回调地址"></el-input>
          </el-form-item>
          <el-form-item v-if="form9.type=='hf'" label="汇付大额退款回调地址" prop="hfOnlineRefundNotifyUrl">
            <el-input v-model="form9.hfOnlineRefundNotifyUrl" label="汇付分账回调地址"></el-input>
          </el-form-item>
          <el-form-item v-if="form9.type=='appPay'" label="支付宝应用id" prop="aliAppId">
            <el-input v-model="form9.aliAppId" label="请输入支付宝应用id"></el-input>
          </el-form-item>
          <el-form-item v-if="form9.type=='appPay'" label="支付宝应用私钥" prop="aliPrivateKey">
            <el-input v-model="form9.aliPrivateKey" label="请输入支付宝应用私钥"></el-input>
          </el-form-item>
          <el-form-item v-if="form9.type=='appPay'" label="支付宝公钥" prop="aliPublicKey">
            <el-input v-model="form9.aliPublicKey" label="请输入支付宝公钥"></el-input>
          </el-form-item>
          <el-form-item v-if="form9.type=='appPay'" label="支付宝回调地址" prop="aliNotifyUrl">
            <el-input v-model="form9.aliNotifyUrl" label="请输入支付宝回调地址"></el-input>
          </el-form-item>
          <el-form-item v-if="form9.type=='appPay'" label="微信appid" prop="wxAppAppId">
            <el-input v-model="form9.wxAppAppId" label="请输入微信appid"></el-input>
          </el-form-item>
          <el-form-item v-if="form9.type=='appPay'" label="微信商户号" prop="wxAppMchId">
            <el-input v-model="form9.wxAppMchId" label="请输入微信商户号"></el-input>
          </el-form-item>
          <el-form-item v-if="form9.type=='appPay'" label="微信Key" prop="wxAppMchKey">
            <el-input v-model="form9.wxAppMchKey" label="请输入微信Key"></el-input>
          </el-form-item>
          <el-form-item v-if="form9.type=='appPay'" label="微信回调地址" prop="wxAppNotifyUrl">
            <el-input v-model="form9.wxAppNotifyUrl" label="请输入微信回调地址"></el-input>
          </el-form-item>
          <el-form-item v-if="form9.type=='appPay'" label="微信商户api证书" prop="wxAppKeyPath">
            <el-input v-model="form9.wxAppKeyPath" label="请输入微信商户api证书地址"></el-input>
          </el-form-item>
          <div class="footer">
            <el-button type="primary" @click="submitForm9">提 交</el-button>
          </div>
        </el-form>
      </el-tab-pane>
      <!--      <el-tab-pane label="APP支付配置" name="store.pay">-->
      <!--        <el-form ref="form23" :model="form23"  label-width="160px">-->
      <!--          <el-form-item label="支付类型" prop="type">-->
      <!--            <el-radio-group v-model="form23.type">-->
      <!--              <el-radio label="yb">易宝</el-radio>-->
      <!--              <el-radio label="wx">微信</el-radio>-->
      <!--              <el-radio label="hf">汇付</el-radio>-->
      <!--            </el-radio-group>-->
      <!--          </el-form-item>-->
      <!--          <el-form-item   label="appId" prop="appId">-->
      <!--            <el-input   v-model="form23.appId"  label="请输入appId"></el-input>-->
      <!--          </el-form-item>-->
      <!--          <el-form-item  v-if="form23.type=='yb'" label="易宝商户号" prop="ybAccount">-->
      <!--            <el-input   v-model="form23.ybAccount"  label="请输入易宝商户号"></el-input>-->
      <!--          </el-form-item>-->
      <!--          <el-form-item v-if="form23.type=='yb'" label="易宝Key" prop="ybKey">-->
      <!--            <el-input  v-model="form23.ybKey" label="请输入易宝Key"></el-input>-->
      <!--          </el-form-item>-->
      <!--          <el-form-item v-if="form23.type=='yb'" label="易宝回调地址" prop="ybNotifyUrl">-->
      <!--            <el-input  v-model="form23.ybNotifyUrl" label="易宝回调地址"></el-input>-->
      <!--          </el-form-item>-->

      <!--          <el-form-item  v-if="form23.type=='wx'" label="微信商户号" prop="wxMchId">-->
      <!--            <el-input   v-model="form23.wxMchId"  label="请输入微信商户号"></el-input>-->
      <!--          </el-form-item>-->
      <!--          <el-form-item v-if="form23.type=='wx'" label="微信Key" prop="wxMchKey">-->
      <!--            <el-input  v-model="form23.wxMchKey" label="请输入微信Key"></el-input>-->
      <!--          </el-form-item>-->
      <!--          <el-form-item v-if="form23.type=='wx'" label="微信商户V3密钥" prop="wxMchKey">-->
      <!--            <el-input  v-model="form23.wxApiV3Key" label="请输入商户V3密钥"></el-input>-->
      <!--          </el-form-item>-->
      <!--          <el-form-item v-if="form23.type=='wx'" label="keyPath" prop="wxMchKey">-->
      <!--            <el-input  v-model="form23.keyPath" label="请输入商户V3密钥"></el-input>-->
      <!--          </el-form-item>-->
      <!--          <el-form-item v-if="form23.type=='wx'" label="privateKeyPath" prop="wxMchKey">-->
      <!--            <el-input  v-model="form23.privateKeyPath" label="请输入商户V3密钥"></el-input>-->
      <!--          </el-form-item>-->
      <!--          <el-form-item v-if="form23.type=='wx'" label="privateCertPath" prop="wxMchKey">-->
      <!--            <el-input  v-model="form23.privateCertPath" label="请输入商户V3密钥"></el-input>-->
      <!--          </el-form-item>-->
      <!--          <el-form-item v-if="form23.type=='wx'" label="notifyUrlScrm" prop="wxMchKey">-->
      <!--            <el-input  v-model="form23.notifyUrlScrm" label="请输入商户V3密钥"></el-input>-->
      <!--          </el-form-item>-->
      <!--          <el-form-item v-if="form23.type=='wx'" label="publicKeyId" prop="wxMchKey">-->
      <!--            <el-input  v-model="form23.publicKeyId" label="请输入商户V3密钥"></el-input>-->
      <!--          </el-form-item>-->
      <!--          <el-form-item v-if="form23.type=='wx'" label="publicKeyPath" prop="wxMchKey">-->
      <!--            <el-input  v-model="form23.publicKeyPath" label="请输入商户V3密钥"></el-input>-->
      <!--          </el-form-item>-->


      <!--          <el-form-item  v-if="form23.type=='hf'" label="汇付产品号" prop="hfProductId">-->
      <!--            <el-input   v-model="form23.hfProductId"  label="汇付产品号"></el-input>-->
      <!--          </el-form-item>-->
      <!--          <el-form-item v-if="form23.type=='hf'" label="系统号" prop="hfSysId">-->
      <!--            <el-input  v-model="form23.hfSysId" label="系统号Key"></el-input>-->
      <!--          </el-form-item>-->
      <!--          <el-form-item v-if="form23.type=='hf'" label="商户号" prop="huifuId">-->
      <!--            <el-input  v-model="form23.huifuId" label="商户号"></el-input>-->
      <!--          </el-form-item>-->
      <!--          <el-form-item v-if="form23.type=='hf'" label="商户私钥" prop="hfRsaPrivateKey">-->
      <!--            <el-input  v-model="form23.hfRsaPrivateKey" label="商户私钥"></el-input>-->
      <!--          </el-form-item>-->
      <!--          <el-form-item v-if="form23.type=='hf'" label="汇付公钥" prop="hfRsaPublicKey">-->
      <!--            <el-input  v-model="form23.hfRsaPublicKey" label="汇付公钥"></el-input>-->
      <!--          </el-form-item>-->
      <!--          <el-form-item v-if="form23.type=='hf'" label="汇付支付回调地址" prop="hfPayNotifyUrl">-->
      <!--            <el-input  v-model="form23.hfPayNotifyUrl" label="汇付支付回调地址"></el-input>-->
      <!--          </el-form-item>-->
      <!--          <el-form-item v-if="form23.type=='hf'" label="大额支付回调地址" prop="hfPayOnlineNotifyUrl">-->
      <!--            <el-input  v-model="form23.hfPayOnlineNotifyUrl" label="汇付支付回调地址"></el-input>-->
      <!--          </el-form-item>-->
      <!--          <el-form-item v-if="form23.type=='hf'" label="汇付退款回调地址" prop="hfRefundNotifyUrl">-->
      <!--            <el-input  v-model="form23.hfRefundNotifyUrl" label="汇付退款回调地址"></el-input>-->
      <!--          </el-form-item>-->
      <!--          <el-form-item v-if="form23.type=='hf'" label="汇付大额退款回调地址" prop="hfOnlineRefundNotifyUrl">-->
      <!--            <el-input  v-model="form23.hfOnlineRefundNotifyUrl" label="汇付分账回调地址"></el-input>-->
      <!--          </el-form-item>-->
      <!--          <div   class="footer">-->
      <!--            <el-button type="primary" @click="submitForm23">提  交</el-button>-->
      <!--          </div>-->
      <!--        </el-form>-->
      <!--      </el-tab-pane>-->
      <el-tab-pane label="布局配置" name="his.appShow">
        <div>
          <el-table border :data="form10">
            <el-table-column prop="name" label="模块名称" width="300">
              <template slot-scope="scope">
                <el-input v-model="scope.row.name"></el-input>
              </template>
            </el-table-column>
            <el-table-column prop="sort" label="排序号" width="300">
              <template slot-scope="scope">
                <el-input-number v-model="scope.row.sort" :min="0" :max="100"></el-input-number>
              </template>
            </el-table-column>
            <el-table-column prop="isShow" label="是否展示" width="100">
              <template slot-scope="scope">
                <el-switch
                  v-model="scope.row.isShow"
                  active-color="#13ce66"
                  inactive-color="#ff4949"
                >
                </el-switch>
              </template>
            </el-table-column>
          </el-table>
          <div style="float: right;" class="footer">
            <el-button type="primary" @click="submitForm10">提 交</el-button>
          </div>
        </div>
      </el-tab-pane>
      <el-tab-pane label="积分配置" name="his.integral">
        <IntegralConfig/>
      </el-tab-pane>
      <el-tab-pane label="签到配置" name="his.sign">
        <el-table border :data="form12">
          <el-table-column prop="day" label="名称" width="300">
            <template slot-scope="scope">
              <el-input v-model="scope.row.day"></el-input>
            </template>
          </el-table-column>
          <el-table-column prop="signNum" label="获得积分" width="300">
            <template slot-scope="scope">
              <el-input-number v-model="scope.row.signNum" :min="0" :max="100"></el-input-number>
            </template>
          </el-table-column>
          <el-table-column prop="sort" label="排序" width="300">
            <template slot-scope="scope">
              <el-input-number v-model="scope.row.sort" :min="0" :max="100"></el-input-number>
            </template>
          </el-table-column>
        </el-table>
        <div style="float: right;" class="footer">
          <el-button type="primary" @click="submitForm12">提 交</el-button>
        </div>
      </el-tab-pane>
      <el-tab-pane label="短信配置" name="his.sms">

        <el-form ref="form14" :model="form14" label-width="150px">
          <el-form-item label="是否开启APP短信验证" label-width="160px">
            <el-switch
              v-model="form14.isSmsVerification"
              active-color="#13ce66"
              inactive-color="#ff4949"
              active-value="1"
              inactive-value="0"
            >
            </el-switch>
          </el-form-item>
          <el-form-item label="短信服务商" prop="type">
            <el-radio-group v-model="form14.type">
              <el-radio label="rf">重庆润芳</el-radio>
              <el-radio label="dh">重庆大汉</el-radio>
            </el-radio-group>
          </el-form-item>
          <el-form-item v-if="form14.type=='rf'" label="润芳通知账号" prop="rfAccount1">
            <el-input v-model="form14.rfAccount1" label="请输入润芳通知账号"></el-input>
          </el-form-item>
          <el-form-item v-if="form14.type=='rf'" label="润芳通知code" prop="rfCode1">
            <el-input v-model="form14.rfCode1" label="请输入润芳通知code"></el-input>
          </el-form-item>
          <el-form-item v-if="form14.type=='rf'" label="润芳通知密码" prop="rfPassword1">
            <el-input v-model="form14.rfPassword1" label="请输入润芳通知密码"></el-input>
          </el-form-item>
          <el-form-item v-if="form14.type=='rf'" label="润芳通知地址" prop="rfUrl1">
            <el-input v-model="form14.rfUrl1" label="请输入润芳通知地址"></el-input>
          </el-form-item>
          <el-form-item v-if="form14.type=='rf'" label="润芳营销账号" prop="rfAccount2">
            <el-input v-model="form14.rfAccount2" label="请输入润芳营销账号"></el-input>
          </el-form-item>
          <el-form-item v-if="form14.type=='rf'" label="润芳营销code" prop="rfCode2">
            <el-input v-model="form14.rfCode2" label="请输入润芳营销code"></el-input>
          </el-form-item>
          <el-form-item v-if="form14.type=='rf'" label="润芳通知密码" prop="rfPassword2">
            <el-input v-model="form14.rfPassword2" label="请输入润芳通知密码"></el-input>
          </el-form-item>
          <el-form-item v-if="form14.type=='rf'" label="润芳通知地址" prop="rfUrl2">
            <el-input v-model="form14.rfUrl2" label="请输入润芳营销地址"></el-input>
          </el-form-item>
          <el-form-item v-if="form14.type=='rf'" label="润芳签名" prop="rfSign">
            <el-input v-model="form14.rfSign" label="请输入润芳签名"></el-input>
          </el-form-item>

          <el-form-item v-if="form14.type=='dh'" label="大汉通知账号" prop="dhAccount1">
            <el-input v-model="form14.dhAccount1" label="请输入大汉通知账号"></el-input>
          </el-form-item>
          <el-form-item v-if="form14.type=='dh'" label="大汉通知密码" prop="dhPassword1">
            <el-input v-model="form14.dhPassword1" label="请输入大汉通知密码"></el-input>
          </el-form-item>
          <el-form-item v-if="form14.type=='dh'" label="大汉营销账号" prop="dhAccount2">
            <el-input v-model="form14.dhAccount2" label="请输入大汉营销账号"></el-input>
          </el-form-item>
          <el-form-item v-if="form14.type=='dh'" label="大汉通知密码" prop="dhPassword2">
            <el-input v-model="form14.dhPassword2" label="请输入大汉通知密码"></el-input>
          </el-form-item>
          <el-form-item v-if="form14.type=='dh'" label="大汉签名" prop="dhSign">
            <el-input v-model="form14.dhSign" label="请输入大汉签名"></el-input>
          </el-form-item>
          <div class="footer">
            <el-button type="primary" @click="submitForm14">提 交</el-button>
          </div>
        </el-form>
      </el-tab-pane>


      <el-tab-pane label="系统配置" name="his.config">
        <el-form ref="form13" :model="form13" label-width="160px">
          <el-form-item label="腾讯云sdkAppId" prop="sdkAppId">
            <el-input v-model="form13.sdkAppId" label="请输入sdkAppId"></el-input>
          </el-form-item>
          <el-form-item label="腾讯云sdkAppKey" prop="sdkAppKey">
            <el-input v-model="form13.sdkAppKey" label="请输入sdkAppKey"></el-input>
          </el-form-item>
          <el-form-item label="快递鸟Id" prop="kdnId">
            <el-input v-model="form13.kdnId" label="请输入kdnId"></el-input>
          </el-form-item>
          <el-form-item label="快递鸟Key" prop="kdnKeyId">
            <el-input v-model="form13.kdnKeyId" label="请输入kdnKeyId"></el-input>
          </el-form-item>
          <el-form-item label="快递鸟Url" prop="kdnUrl">
            <el-input v-model="form13.kdnUrl" label="请输入kdnUrl"></el-input>
          </el-form-item>
          <el-form-item label="快递鸟订阅url" prop="kdnSubscribeUrl">
            <el-input v-model="form13.kdnSubscribeUrl" label="请输入kdnSubscribeUrl"></el-input>
          </el-form-item>
          <el-form-item label="快递鸟地址url" prop="kdnAddressUrl">
            <el-input v-model="form13.kdnAddressUrl" label="请输入kdnAddressUrl"></el-input>
          </el-form-item>
          <el-form-item label="是否开启单号识别" prop="enableLogisticCodeRecognition">
            <el-switch
              v-model="form13.enableLogisticCodeRecognition"
              :active-value="true"
              :inactive-value="false"
            />
            <span style="margin-left: 8px; color: #909399; font-size: 12px;">开启后发货优先用快递鸟按运单号识别承运商，失败则仍按 OMS 承运商编码匹配</span>
          </el-form-item>
          <el-form-item label="最低定金金额" prop="shares">
            <el-input-number v-model="form13.retainer" :min="100"   label="最低定金金额"></el-input-number>
          </el-form-item>
          <el-form-item   label="比率" prop="rate">
            <el-input   v-model="form13.rate"  label="请输入比率">
              <template slot="append">%</template>
            </el-input>
          </el-form-item>
          <el-form-item label="是否开启erp">
            <el-switch
              v-model="form13.erpOpen"
              active-color="#13ce66"
              inactive-color="#ff4949"
              active-value="1"
              inactive-value="0"
            >
            </el-switch>
          </el-form-item>
          <el-form-item label="erp类型" v-if="form13.erpOpen == 1">
            <el-radio v-model="form13.erpType" label="1">管易</el-radio>
            <el-radio v-model="form13.erpType" label="2">(企业版)</el-radio>
            <el-radio v-model="form13.erpType" label="3">瀚智OMS</el-radio>
            <el-radio v-model="form13.erpType" label="4">代服管家</el-radio>
            <el-radio v-model="form13.erpType" label="5">聚水潭</el-radio>
            <el-radio v-model="form13.erpType" label="6">金博</el-radio>
            <el-radio v-model="form13.erpType" label="7">旺店通(旗舰版)</el-radio>
          </el-form-item>
          <el-form-item label="不推送erp的公司" v-if="form13.erpOpen == 1">
            <el-select filterable v-model="form13.noErpCompany" placeholder="请选公司" multiple clearable size="small"
            >
              <el-option
                v-for="item in companyOptions"
                :key="item.companyId"
                :label="item.companyName"
                :value="item.companyId"
              />
            </el-select>
          </el-form-item>
          <el-form-item label="erpAppKey" v-if="form13.erpOpen == 1 && form13.erpType == 1 " prop="erpAppKey">
            <el-input v-model="form13.erpAppKey" label="请输入erpAppKey"></el-input>
          </el-form-item>
          <el-form-item label="erpSessionKey" v-if="form13.erpOpen == 1 && form13.erpType == 1 " prop="erpSessionKey">
            <el-input v-model="form13.erpSessionKey" label="请输入erpSessionKey"></el-input>
          </el-form-item>
          <el-form-item label="erpSecret" v-if="form13.erpOpen == 1 && form13.erpType == 1 " prop="erpSecret">
            <el-input v-model="form13.erpSecret" label="请输入erpSecret"></el-input>
          </el-form-item>
          <el-form-item label="erpUrl" v-if="form13.erpOpen == 1 && form13.erpType == 1 " prop="erpUrl">
            <el-input v-model="form13.erpUrl" label="请输入erpUrl"></el-input>
          </el-form-item>
          <el-form-item label="erpShopCode" v-if="form13.erpOpen == 1 && form13.erpType == 1 " prop="erpShopCode">
            <el-input v-model="form13.erpShopCode" label="请输入erpShopCode"></el-input>
          </el-form-item>
          <el-form-item label="erpWdAppKey" v-if="form13.erpOpen == 1 && form13.erpType == 2 " prop="erpWdAppKey">
            <el-input v-model="form13.erpWdAppKey" label="请输入erpAppKey"></el-input>
          </el-form-item>
          <el-form-item label="erpWdAppsecret" v-if="form13.erpOpen == 1 && form13.erpType == 2 " prop="erpWdAppsecret">
            <el-input v-model="form13.erpWdAppsecret" label="erpWdAppsecret"></el-input>
          </el-form-item>
          <el-form-item label="erpWdSid" v-if="form13.erpOpen == 1 && form13.erpType == 2 " prop="erpWdSid">
            <el-input v-model="form13.erpWdSid" label="请输入erpWdSid"></el-input>
          </el-form-item>
          <el-form-item label="erpWdShopCode" v-if="form13.erpOpen == 1 && form13.erpType == 2 " prop="erpWdShopCode">
            <el-input v-model="form13.erpWdShopCode" label="请输入erpWdShopCode"></el-input>
          </el-form-item>
          <el-form-item label="erpWdBaseUrl" v-if="form13.erpOpen == 1 && form13.erpType == 2 " prop="erpWdBaseUrl">
            <el-input v-model="form13.erpWdBaseUrl" label="请输入erpWdBaseUrl"></el-input>
          </el-form-item>
          <el-form-item label="erpWarehouseCode" v-if="form13.erpOpen == 1 && form13.erpType == 2 "
                        prop="erpWarehouseCode"
          >
            <el-input v-model="form13.erpWarehouseCode" label="请输入erpWarehouseCode"></el-input>
          </el-form-item>
          <!-- erpHzOMSid -->
          <el-form-item label="erpHzOMSAppKey" v-if="form13.erpOpen == 1 && form13.erpType == 3 " prop="erpHzOMSAppKey">
            <el-input v-model="form13.erpHzOMSAppKey" label="请输入erpAppKey"></el-input>
          </el-form-item>
          <el-form-item label="erpHzOMSAppsecret" v-if="form13.erpOpen == 1 && form13.erpType == 3 "
                        prop="erpHzOMSAppsecret"
          >
            <el-input v-model="form13.erpHzOMSAppsecret" label="erpWdAppsecret"></el-input>
          </el-form-item>
          <el-form-item label="erpHzOMSItenantid" v-if="form13.erpOpen == 1 && form13.erpType == 3 "
                        prop="erpHzOMSItenantid"
          >
            <el-input v-model="form13.erpHzOMSItenantid" label="请输入erpHzOMSItenantid"></el-input>
          </el-form-item>
          <el-form-item label="erpHzOMTokenUrl" v-if="form13.erpOpen == 1 && form13.erpType == 3 "
                        prop="erpHzOMTokenUrl"
          >
            <el-input v-model="form13.erpHzOMTokenUrl" label="请输入erpHzOMTokenUrl"></el-input>
          </el-form-item>
          <el-form-item label="erpHzOMBaseUrl" v-if="form13.erpOpen == 1 && form13.erpType == 3 " prop="erpHzOMBaseUrl">
            <el-input v-model="form13.erpHzOMBaseUrl" label="请输入erpHzOMBaseUrl"></el-input>
          </el-form-item>

          <el-form-item label="erpJstAppKey" v-if="form13.erpOpen == 1 && form13.erpType == 5 " prop="erpJstAppKey">
            <el-input v-model="form13.erpJstAppKey" label="请输入erpJstAppKey"></el-input>
          </el-form-item>
          <el-form-item label="erpJstAppsecret" v-if="form13.erpOpen == 1 && form13.erpType == 5 "
                        prop="erpJstAppsecret"
          >
            <el-input v-model="form13.erpJstAppsecret" label="erpJstAppsecret"></el-input>
          </el-form-item>
          <el-form-item label="erpJstSid" v-if="form13.erpOpen == 1 && form13.erpType == 5 " prop="erpJstSid">
            <el-input v-model="form13.erpJstSid" label="请输入erpJstSid"></el-input>
          </el-form-item>
          <el-form-item label="erpJstShopCode" v-if="form13.erpOpen == 1 && form13.erpType == 5 " prop="erpJstShopCode">
            <el-input v-model="form13.erpJstShopCode" label="请输入erpJstShopCode"></el-input>
          </el-form-item>
          <el-form-item label="erpJstBaseUrl" v-if="form13.erpOpen == 1 && form13.erpType == 5 " prop="erpJstBaseUrl">
            <el-input v-model="form13.erpJstBaseUrl" label="请输入erpJstBaseUrl"></el-input>
          </el-form-item>
          <el-form-item label="erpJstrehouseCode" v-if="form13.erpOpen == 1 && form13.erpType == 5 "
                        prop="erpJstrehouseCode"
          >
            <el-input v-model="form13.erpJstrehouseCode" label="请输入erpJstrehouseCode"></el-input>
          </el-form-item>

          <el-form-item label="kingbosan" v-if="form13.erpOpen == 1 && form13.erpType == 6 " prop="kingbosan">
            <el-input v-model="form13.kingbosan" label="请输入账套名称(kingbosan)"></el-input>
          </el-form-item>
          <el-form-item label="kingbosSecret" v-if="form13.erpOpen == 1 && form13.erpType == 6 " prop="kingbosSecret">
            <el-input v-model="form13.kingbosSecret" label="请输入密钥(kingbosSecret)"></el-input>
          </el-form-item>
          <el-form-item label="kingbosUrl" v-if="form13.erpOpen == 1 && form13.erpType == 6 " prop="kingbosUrl">
            <el-input v-model="form13.kingbosUrl" label="请输入金博地址(kingbosUrl)"></el-input>
          </el-form-item>
          <el-form-item label="corgid" v-if="form13.erpOpen == 1 && form13.erpType == 6 " prop="corgid">
            <el-input v-model="form13.corgid" label="请输入机构编码(corgid)"></el-input>
          </el-form-item>
          <el-form-item label="cwarehouseCode" v-if="form13.erpOpen == 1 && form13.erpType == 6 " prop="cwarehouseCode">
            <el-input v-model="form13.cwarehouseCode" label="请输入仓库编码(cwarehouseCode)"></el-input>
          </el-form-item>
          <el-form-item label="cwarehouseName" v-if="form13.erpOpen == 1 && form13.erpType == 6 " prop="cwarehouseName">
            <el-input v-model="form13.cwarehouseName" label="请输入仓库名称(cwarehouseName)"></el-input>
          </el-form-item>


          <el-form-item label="appid" prop="appid">
            <el-input v-model="form13.appid" label="请输入appid"></el-input>
          </el-form-item>
          <el-form-item label="secret" prop="secret">
            <el-input v-model="form13.secret" label="请输入secret"></el-input>
          </el-form-item>
          <el-form-item label="token" prop="token">
            <el-input v-model="form13.token" label="请输入token"></el-input>
          </el-form-item>
          <el-form-item label="aesKey" prop="aesKey">
            <el-input v-model="form13.aesKey" label="请输入aesKey"></el-input>
          </el-form-item>
          <el-form-item label="msgDataFormat" prop="msgDataFormat">
            <el-input v-model="form13.msgDataFormat" label="请输入msgDataFormat"></el-input>
          </el-form-item>
          <el-form-item label="极光appKey" prop="appKey">
            <el-input v-model="form13.appKey" label="请输入appKey"></el-input>
          </el-form-item>
          <el-form-item label="极光secret" prop="masterSecret">
            <el-input v-model="form13.masterSecret" label="请输入masterSecret"></el-input>
          </el-form-item>
          <el-form-item label="极光过期时间" prop="liveTime">
            <el-input v-model="form13.liveTime" label="请输入liveTime"></el-input>
          </el-form-item>
          <el-form-item label="处方上传token" prop="prescribeToken">
            <el-input v-model="form13.prescribeToken" label="请输入masterSecret"></el-input>
          </el-form-item>
          <el-form-item label="处方上传地址" prop="prescribeUrl">
            <el-input v-model="form13.prescribeUrl" label="请输入masterSecret"></el-input>
          </el-form-item>
          <el-form-item label="二维码地址" prop="codeUrl">
            <el-input v-model="form13.codeUrl" label="请输入masterSecret"></el-input>
          </el-form-item>
          <el-form-item label="hook地址" prop="hookUrl">
            <el-input v-model="form13.hookUrl" label="请输入hook域名"></el-input>
          </el-form-item>
          <el-form-item label="舌诊appkey" prop="tongueAppKey">
            <el-input v-model="form13.tongueAppKey" label="请输入舌诊密钥"></el-input>
          </el-form-item>
          <el-form-item   label="App推送通知地址" prop="appPushUrl">
            <el-input   v-model="form13.appPushUrl"  label="请输入App推送通知地址"></el-input>
          </el-form-item>
          <div class="footer">
            <el-button type="primary" @click="submitForm13">提 交</el-button>
          </div>
        </el-form>

      </el-tab-pane>
      <el-tab-pane label="企微客服配置" name="qw:config">
        <el-form ref="form15" :model="form15" label-width="120px">
          <el-form-item label="企业CoripID">
            <el-input v-model="form15.corpId" style="width:400px"></el-input>
          </el-form-item>
          <el-form-item label="Secret">
            <el-input v-model="form15.secret" style="width:400px"></el-input>
          </el-form-item>
          <el-form-item label="Token">
            <el-input v-model="form15.token" style="width:400px"></el-input>
          </el-form-item>
          <el-form-item label="EncodingAESKey">
            <el-input v-model="form15.encodingAESKey" style="width:400px"></el-input>
          </el-form-item>
          <el-form-item label="回调地接">
            <el-input disabled v-model="form15.notifyUrl" style="width:600px"></el-input>
          </el-form-item>
          <div class="line"></div>
          <div style="float:right;margin-right:20px">
            <el-button type="primary" @click="submitForm15">提交</el-button>
          </div>
        </el-form>
      </el-tab-pane>
      <el-tab-pane label="商城配置小程序" name="store.config">
        <el-form ref="form17" :model="form17" label-width="150px">


          <el-form-item label="erpOpen" prop="erpOpen">
            <el-input v-model="form17.erpOpen" label="请输入erpOpen"></el-input>
          </el-form-item>
          <el-form-item label="未支付订单自动取消时间" prop="unPayTime">
            <el-input v-model="form17.unPayTime" label="请输入unPayTime"></el-input>
          </el-form-item>
          <el-form-item label="货到付款自定义金额" prop="payAmount">
            <el-input v-model="form17.payAmount" label="请输入payAmount"></el-input>
          </el-form-item>
          <el-form-item label="支付比例" prop="payRate">
            <el-input v-model="form17.payRate" label="请输入payRate"></el-input>
          </el-form-item>
          <el-form-item label="热门搜索" prop="hotSearch">
            <el-input v-model="form17.hotSearch" label="请输入hotSearch"></el-input>
          </el-form-item>
          <el-form-item label="服务费" prop="serviceFee">
            <el-input v-model="form17.serviceFee" label="请输入serviceFee"></el-input>
          </el-form-item>
          <el-form-item label="成本售价比例" prop="salesPriceRate">
            <el-input v-model="form17.salesPriceRate" label="请输入salesPriceRate"></el-input>
          </el-form-item>
          <el-form-item label="已完成订单售后有效天数" prop="storeAfterSalesDay">
            <el-input v-model="form17.storeAfterSalesDay" label="请输入storeAfterSalesDay"></el-input>
          </el-form-item>
          <el-form-item label="orderAttribution" prop="orderAttribution">
            <el-input v-model="form17.orderAttribution" label="请输入orderAttribution"></el-input>
          </el-form-item>
          <el-form-item label="refundAddress" prop="refundAddress">
            <el-input v-model="form17.refundAddress" label="请输入refundAddress"></el-input>
          </el-form-item>

          <el-form-item label="refundPhoneNumber" prop="refundPhoneNumber">
            <el-input v-model="form17.refundPhoneNumber" label="请输入refundPhoneNumber"></el-input>
          </el-form-item>

          <el-form-item label="refundConsignee" prop="refundConsignee">
            <el-input v-model="form17.refundConsignee" label="请输入refundConsignee"></el-input>
          </el-form-item>
          <el-form-item v label="订单改价方式" prop="createSalesOrderType">
            <el-input v-model="form17.createSalesOrderType" label="订单改价方式"></el-input>
          </el-form-item>
          <el-form-item label="订单审核开关" prop="auditSwitch">
            <el-input v-model="form17.auditSwitch" label="订单审核开关"></el-input>
          </el-form-item>
          <el-form-item label="公司制单金额最低比例" prop="createMoneyRate">
            <el-input v-model="form17.createMoneyRate" label="公司制单金额最低比例"></el-input>
          </el-form-item>
          <el-form-item label="公司佣金比例" prop="tuiMoneyRate">
            <el-input v-model="form17.tuiMoneyRate" label="公司佣金比例"></el-input>
          </el-form-item>
          <el-form-item label="汇付支付回调地址" prop="hfPayNotifyUrl">
            <el-input v-model="form17.hfPayNotifyUrl" label="汇付支付回调地址"></el-input>
          </el-form-item>
          <el-form-item label="大额支付回调地址" prop="hfPayOnlineNotifyUrl">
            <el-input v-model="form17.hfPayOnlineNotifyUrl" label="汇付支付回调地址"></el-input>
          </el-form-item>
          <el-form-item label="汇付退款回调地址" prop="hfRefundNotifyUrl">
            <el-input v-model="form17.hfRefundNotifyUrl" label="汇付退款回调地址"></el-input>
          </el-form-item>
          <el-form-item label="汇付大额退款回调地址" prop="hfOnlineRefundNotifyUrl">
            <el-input v-model="form17.hfOnlineRefundNotifyUrl" label="汇付大额退款回调地址"></el-input>
          </el-form-item>

          <el-form-item  label="下单归属" prop="orderAttribution">
            <el-tooltip class="item" effect="dark" content="销售制单下单归属" placement="top-end">
              <el-radio-group v-model="form17.orderAttribution">
                <el-radio :label="1">多销售</el-radio>
                <el-radio :label="2">单销售</el-radio>
              </el-radio-group>
            </el-tooltip>
          </el-form-item>

          <el-form-item label="是否开启微信发货" prop="isWeChatShipping">
            <el-switch
              v-model="form17.isWeChatShipping"
              active-color="#13ce66"
              inactive-color="#ff4949">
            </el-switch>
          </el-form-item>

          <div class="footer">
            <el-button type="primary" @click="submitForm17">提 交</el-button>
          </div>
        </el-form>
      </el-tab-pane>
      <el-tab-pane label="点播配置" name="course.config">
        <el-form ref="form18" :model="form18" label-width="120px">
          <el-form-item label="完课模式">
            <el-radio-group v-model="form18.completionMode">
              <el-radio label="1">百分比</el-radio>
              <el-radio label="2">分钟数</el-radio>
            </el-radio-group>
          </el-form-item>
          <el-form-item label="完课进度(分)" v-if="form18.completionMode == 2">
            <el-tooltip class="item" effect="dark" content="看多少分钟算完课" placement="top-end">
              <el-input-number v-model="form18.minutesNum" :min="1"></el-input-number>
            </el-tooltip>
          </el-form-item>
          <el-form-item label="完课进度(%)" v-if="form18.completionMode == 1">
            <el-tooltip class="item" effect="dark" content="看多少百分比算完课" placement="top-end">
              <el-input-number v-model="form18.answerRate" :min="1" :max="100"></el-input-number>
            </el-tooltip>
          </el-form-item>
          <el-form-item label="短链有效期(天)">
            <el-tooltip class="item" effect="dark" content="短链有效期(天)" placement="top-end">
              <el-input-number v-model="form18.videoLinkExpireDate" :min="1"></el-input-number>
            </el-tooltip>
          </el-form-item>
          <el-form-item label="答题允许错误次数(次)">
            <el-tooltip class="item" effect="dark" content="课程答题允许错误次数(次)" placement="top-end">
              <el-input-number v-model="form18.answerErrorCount" :min="1"></el-input-number>
            </el-tooltip>
          </el-form-item>
          <el-form-item label="看课是否校验答案">
            <el-tooltip class="item" effect="dark" content="默认为「是」：需校验答题正确性；选「否」则不做答案校验" placement="top-end">
              <el-radio-group v-model="form18.validateAnswerWhenWatch">
                <el-radio label="1">是</el-radio>
                <el-radio label="0">否</el-radio>
              </el-radio-group>
            </el-tooltip>
          </el-form-item>
          <el-form-item label="每十分钟获取积分">
            <el-tooltip class="item" effect="dark" content="每十分钟获取多少积分" placement="top-end">
              <el-input-number v-model="form18.videoIntegral" :min="1"></el-input-number>
            </el-tooltip>
          </el-form-item>
          <el-form-item label="答题获得积分">
            <el-tooltip class="item" effect="dark" content="答题获得积分" placement="top-end">
              <el-input-number v-model="form18.answerIntegral" :min="1"></el-input-number>
            </el-tooltip>
          </el-form-item>
          <el-form-item label="ipad发送延迟">
            <el-tooltip class="item" effect="dark" content="ipad发送消息延迟时间（ms）" placement="top-end">
              <el-input-number v-model="form18.delayStart" :min="100"></el-input-number>
            </el-tooltip>
          </el-form-item>
          <el-form-item label="ipad发送延迟">
            <el-tooltip class="item" effect="dark" content="ipad发送消息延迟时间（ms）" placement="top-end">
              <el-input-number v-model="form18.delayEnd" :min="100"></el-input-number>
            </el-tooltip>
          </el-form-item>
          <el-form-item label="看课默认线路" prop="defaultLine">
            <el-radio-group v-model="form18.defaultLine">
              <el-radio label="0">线路一</el-radio>
              <el-radio label="1">线路二</el-radio>
            </el-radio-group>
          </el-form-item>
          <el-form-item label="一级域名">
            <el-tooltip class="item" effect="dark" content="顶级域名" placement="top-end">
              <el-input v-model="form18.courseDomainName"></el-input>
            </el-tooltip>
          </el-form-item>
          <el-form-item label="通用看课域名">
            <el-tooltip class="item" effect="dark" content="真链域名" placement="top-end">
              <el-input v-model="form18.realLinkDomainName"></el-input>
            </el-tooltip>
          </el-form-item>
          <el-form-item label="飞书看课域名">
            <el-tooltip class="item" effect="dark" content="飞书看课域名" placement="top-end">
              <el-input v-model="form18.feishuLinkDomainName"></el-input>
            </el-tooltip>
          </el-form-item>
          <el-form-item label="新飞书看课域名">
            <el-tooltip class="item" effect="dark" content="新跳转方式使用的飞书看课域名" placement="top-end">
              <el-input v-model="form18.feishuNewLinkDomainName"></el-input>
            </el-tooltip>
          </el-form-item>
          <el-form-item label="启用飞书新跳转">
            <el-tooltip class="item" effect="dark" content="开启后获取飞书看课链接将使用新跳转方式" placement="top-end">
              <el-switch v-model="form18.enableFeishuNewLink" :active-value="true" :inactive-value="false"></el-switch>
            </el-tooltip>
          </el-form-item>

          <el-form-item label="飞书自动看课域名">
            <el-tooltip class="item" effect="dark" content="飞书自动看课域名,容易被封经常更换" placement="top-end">
              <el-input v-model="form18.feishuCourseDomain"></el-input>
            </el-tooltip>
          </el-form-item>
          <el-form-item label="飞书自动看课授权域名">
            <el-tooltip class="item" effect="dark" content="微信服务号授权域名" placement="top-end">
              <el-input v-model="form18.feishuAuthDomain"></el-input>
            </el-tooltip>
          </el-form-item>

          <el-form-item label="外网看课域名">
            <el-tooltip class="item" effect="dark" content="真链域名" placement="top-end">
              <el-input  v-model="form18.realLinkGjDomainName"     ></el-input>
            </el-tooltip>
          </el-form-item>
          <el-form-item label="网页授权域名">
            <el-tooltip class="item" effect="dark" content="公众号网页授权域名" placement="top-end">
              <el-input v-model="form18.authDomainName"></el-input>
            </el-tooltip>
          </el-form-item>
          <el-form-item label="短信推送域名">
            <el-tooltip class="item" effect="dark" content="看课短链域名" placement="top-end">
              <el-select v-model="form18.smsDomainName" placeholder="请选择看课短链域名" @change="handleSmsDomainChange">
                <el-option
                  v-for="dict in smsDomainNameOptions"
                  :key="dict.dictValue"
                  :label="dict.dictLabel"
                  :value="dict.dictValue">
                </el-option>
              </el-select>
            </el-tooltip>
          </el-form-item>
          <el-form-item label="获客链接推送域名">
            <el-tooltip class="item" effect="dark" content="获客链接推送域名" placement="top-end">
              <el-select v-model="form18.smsAcquisitionName" placeholder="请选择获客链接推送域名" @change="handleSmsDomainChange">
                <el-option
                  v-for="dict in smsDomainNameOptions"
                  :key="dict.dictValue"
                  :label="dict.dictLabel"
                  :value="dict.dictValue">
                </el-option>
              </el-select>
            </el-tooltip>
          </el-form-item>
          <el-form-item label="公众号appId">
            <el-tooltip class="item" effect="dark" content="授权公众号appId" placement="top-end">
              <el-input v-model="form18.mpAppId"></el-input>
            </el-tooltip>
          </el-form-item>

          <el-form-item label="小程序appid">
            <el-tooltip class="item" effect="dark" content="小程序appid" placement="top-end">
              <el-input v-model="form18.miniprogramAppid"></el-input>
            </el-tooltip>
          </el-form-item>
          <el-form-item label="小程序page路径">
            <el-tooltip class="item" effect="dark" content="小程序消息打开后的路径" placement="top-end">
              <el-input v-model="form18.miniprogramPage"></el-input>
            </el-tooltip>
          </el-form-item>

          <el-form-item label="奖励类型">
            <el-radio-group v-model="form18.rewardType">
              <el-radio label="1">红包</el-radio>
              <el-radio label="2">积分</el-radio>
              <el-radio label="3" v-if="!isBeiJingZhuoMei">红包+积分</el-radio>
            </el-radio-group>
          </el-form-item>

          <el-form-item label="红包金额" v-if="form18.rewardType == 1 || form18.rewardType == 3">
            <el-tooltip class="item" effect="dark" content="课程默认红包金额" placement="top-end">
              <el-input-number v-model="form18.redPackageMoney" :min="0.01"></el-input-number>
            </el-tooltip>
          </el-form-item>


          <!--   红包余额是否扣减开关      -->
          <el-form-item label="红包余额是否扣减开关">
            <el-radio-group v-model="form18.isRedPackageBalanceDeduction">
              <el-radio label="1">开</el-radio>
              <el-radio label="0">关</el-radio>
            </el-radio-group>
          </el-form-item>
          <!-- 看视频休息暂停配置开关 默认打开要暂停 0-关闭 1-打开 -->
          <el-form-item label="看课休息暂停开关（默认打开）">
            <el-radio-group v-model="form18.isOpenRestReminder">
              <el-radio label="1" >开</el-radio>
              <el-radio label="0">关</el-radio>
            </el-radio-group>
          </el-form-item>


          <el-form-item label="禁止发送时间段">
            <el-row v-for="(item, index) in form18.disabledTimeList" style="margin-top: 10px">
              <el-time-picker
                class="custom-input"
                v-model="item.startDisabledTime"
                value-format="HH:mm"
                format="HH:mm"
                placeholder="开始时间"
                style="width: 130px;height: 20px;"
              >
              </el-time-picker>
              <el-time-picker
                class="custom-input"
                v-model="item.endDisabledTime"
                value-format="HH:mm"
                format="HH:mm"
                placeholder="结束时间"
                style="width: 130px;height: 20px;margin-left: 10px"
              >
              </el-time-picker>
              <el-button type="danger" icon="el-icon-delete" circle style="margin-left: 20px"
                         @click="removeDisabledTime(index)"
              ></el-button>
            </el-row>
            <el-button @click="addDisabledTime" style="margin-top: 10px">添加时间段</el-button>
          </el-form-item>

          <el-form-item label="红包模式" v-if="form18.rewardType==1 || form18.rewardType == 3">
            <el-radio-group v-model="form18.redPacketMode">
              <el-radio label="1">总公司</el-radio>
              <el-radio label="2">分公司</el-radio>
            </el-radio-group>
          </el-form-item>

          <el-form-item label="默认客服二维码图片" prop="companyUserQRCode">
            <ImageUpload v-model="form18.companyUserQRCode" type="image" :num="10" :width="150" :height="150"
                         :limit="1"
            />
          </el-form-item>
          <el-form-item label="课程LOGO" prop="courseLogo">
            <image-upload v-model="form18.courseLogo" :limit="1"/>
          </el-form-item>

          <el-form-item label="侧边栏公共图" prop="sidebarImageUrl">
            <image-upload v-model="form18.sidebarImageUrl" :limit="1"/>
          </el-form-item>


          <el-form-item label="开启评论/弹幕" prop="openCommentStatus">
            <el-radio-group v-model="form18.openCommentStatus">
              <el-radio :label="1">开启评论</el-radio>
              <el-radio :label="2">开启弹幕</el-radio>
              <el-radio :label="3">关闭</el-radio>
            </el-radio-group>
          </el-form-item>
          <el-form-item label="评论内容脱敏" prop="enableCommentWordFilter">
            <el-switch
              v-model="form18.enableCommentWordFilter"
              active-color="#13ce66"
              inactive-color="#ff4949">
            </el-switch>
          </el-form-item>
          <el-form-item label="分类删除校验" prop="enableCategoryDeleteCheck">
            <el-switch
              v-model="form18.enableCategoryDeleteCheck"
              active-color="#13ce66"
              inactive-color="#ff4949">
            </el-switch>
          </el-form-item>
          <el-form-item label="课程列表绑定用户" prop="enableCourseUserBinding">
            <el-switch
              v-model="form18.enableCourseUserBinding"
              active-color="#13ce66"
              inactive-color="#ff4949">
            </el-switch>
          </el-form-item>
          <el-form-item label="看课展示商品" prop="enableCourseGoodsShow">
            <el-switch
              v-model="form18.enableCourseGoodsShow"
              active-color="#13ce66"
              inactive-color="#ff4949">
            </el-switch>
          </el-form-item>
          <el-form-item label="视频删除上架校验" prop="enableVideoDeleteOnShelfCheck">
            <el-switch
              v-model="form18.enableVideoDeleteOnShelfCheck"
              active-color="#13ce66"
              inactive-color="#ff4949">
            </el-switch>
          </el-form-item>
          <el-form-item label="素材删除关联课程校验" prop="enableResourceDeleteCourseCheck">
            <el-switch
              v-model="form18.enableResourceDeleteCourseCheck"
              active-color="#13ce66"
              inactive-color="#ff4949">
            </el-switch>
          </el-form-item>
          <el-form-item label="看课视频有效期校验" prop="enableVideoExpiredCheck">
            <el-switch
              v-model="form18.enableVideoExpiredCheck"
              active-color="#13ce66"
              inactive-color="#ff4949">
            </el-switch>
          </el-form-item>
          <el-form-item label="发送延时时间" prop="sendDelayTime"
                        :rules="rulesDelay"
          >
            <el-tooltip class="item" effect="dark" content="请输入延时时间，范围在1000毫秒-2000毫秒之间"
                        placement="top-end"
            >
              <el-input
                v-model.number="form18.sendDelayTime"
                type="number"
                :min="1000"
                :max="2000"
                placeholder="请输入1000-2000之间的数值"
              >
                <template slot="append">毫秒</template>
              </el-input>
            </el-tooltip>
          </el-form-item>
          <el-form-item label="是否单销售观看" prop="oneCompanyCourse" label-width="120">
            <el-switch
              v-model="form18.oneCompanyCourse"
              active-color="#13ce66"
              inactive-color="#ff4949"
            >
            </el-switch>
          </el-form-item>

          <span style="color: red;font-size: 12px;">(打开后，每家公司客户仅允许绑定一个销售，打开前请关闭 是否单销售观看 按钮)</span>
          <el-form-item label="是否允许不同公司销售观看" prop="moreCompanyCourse" label-width="120">
            <el-switch
              v-model="form18.moreCompanyCourse"
              active-color="#13ce66"
              inactive-color="#ff4949"
            >
            </el-switch>
          </el-form-item>
          <el-form-item label="是否允许用户暂停" prop="isAllowUserPause" label-width="120">
            <el-switch
              v-model="form18.isAllowUserPause"
              active-color="#13ce66"
              inactive-color="#ff4949"
            >
            </el-switch>
          </el-form-item>

          <el-form-item label="是否允许销售公司金额位负数" prop="isAllowUserPause">
            <el-switch
              v-model="form18.isNegative"
              active-color="#13ce66"
              inactive-color="#ff4949"
            >
            </el-switch>
          </el-form-item>
          <el-form-item label="可查看评论条数" v-if="false">
            <el-tooltip class="item" effect="dark" content="在评论区可以查看的历史评论条数，默认200" placement="top-end">
              <el-input-number v-model="form18.viewCommentNum" :min="1"></el-input-number>
            </el-tooltip>
          </el-form-item>

          <el-form-item label="授权方式">
            <el-tooltip class="item" effect="dark" content="小程序授权头像昵称方式（目前仅会员看课有效）"
                        placement="top-end"
            >
              <el-radio-group v-model="form18.miniAppAuthType">
                <el-radio label="1">小程序原生</el-radio>
                <el-radio label="2">跳转H5服务号</el-radio>
              </el-radio-group>
            </el-tooltip>
          </el-form-item>

          <el-form-item v-if="form18.miniAppAuthType==2" label="跳转域名">
            <el-tooltip class="item" effect="dark" content="会员看课小程序授权头像昵称，跳转H5服务号授权域名"
                        placement="top-end"
            >
              <el-input style="width: 400px" v-model="form18.userCourseAuthDomain" label="跳转域名"></el-input>
            </el-tooltip>
          </el-form-item>

          <el-form-item label="炮灰发服务号红包落地地址">
            <el-tooltip class="item" effect="dark" content="炮灰看课发红包-服务号发" placement="top-end">
              <el-input style="width: 200px" v-model="form18.userCourseH5Reward" label="服务号红包落地地址"></el-input>
            </el-tooltip>
          </el-form-item>

          <el-form-item label="是否绑定" prop="doctorRegister">
            <el-switch
              v-model="form18.isBound"
              active-color="#13ce66"
              inactive-color="#ff4949"
            >
            </el-switch>
          </el-form-item>

          <el-form-item label="是否开启部门数据限制" prop="deptLimit">
            <el-switch
              v-model="form18.deptLimit"
              active-color="#13ce66"
              inactive-color="#ff4949"
            >
            </el-switch>
          </el-form-item>

          <el-form-item label="评级开启全部" prop="isAllratingRating">
            <el-switch
              v-model="form18.isAllratingRating"
              active-color="#13ce66"
              inactive-color="#ff4949"
            >
            </el-switch>
          </el-form-item>

          <el-form-item label="是否只展示部门" prop="doctorRegister">
            <el-switch
              v-model="form18.dept"
              active-color="#13ce66"
              inactive-color="#ff4949"
            >
            </el-switch>
          </el-form-item>

          <el-form-item label="是否开启IM" prop="isOpenIM">
            <el-switch
              v-model="form18.isOpenIM"
              active-color="#13ce66"
              inactive-color="#ff4949">
            </el-switch>
          </el-form-item>
          <el-form-item label="是否开启企微二维码" prop="showQwCode">
            <el-switch
              v-model="form18.showQwCode"
              active-color="#13ce66"
              inactive-color="#ff4949">
            </el-switch>
          </el-form-item>
          <el-form-item label="侧边栏是否仅展示当天课程" prop="showQwCode">
            <el-switch
              v-model="form18.sidebarOnlyShowTodayCourse"
              active-color="#13ce66"
              inactive-color="#ff4949">
            </el-switch>
          </el-form-item>
          <el-form-item label="发课发群" prop="roomLinkAllow">
            <el-switch
              v-model="form18.roomLinkAllow"
              active-color="#ff4949"
              inactive-color="#13ce66">
            </el-switch>
          </el-form-item>
          <el-form-item label="是否开启完课倒计时" prop="completionCountdown">
            <el-switch
              v-model="form18.completionCountdown"
              active-color="#13ce66"
              inactive-color="#ff4949">
            </el-switch>
          </el-form-item>
          <el-form-item label="公告栏" prop="camelCase">
            <el-input
              type="textarea"
              v-model="form18.camelCase"
              :rows="2"
              placeholder="请输入公告"
              >
            </el-input>
          </el-form-item>

          <el-form-item label="客服电话" prop="customerNum">
            <el-input type="number" v-model="form18.customerNum" label="请输入客服电话"></el-input>
          </el-form-item>
          <div class="line"></div>
          <div style="float:right;margin-right:20px">
            <el-button type="primary" @click="submitForm18">提交</el-button>
          </div>
        </el-form>
      </el-tab-pane>
      <el-tab-pane label="点播播放源配置" name="courseMa.config">
        <el-button type="primary" @click="addCourseMaConfig" style="margin-bottom: 10px">添加配置</el-button>
        <el-table height="660" border v-loading="courseMaConfigLoading" :data="courseMaConfigList">
          <el-table-column label="名称" align="center" prop="name">
            <template slot-scope="scope">
              <el-input v-model="scope.row.name" placeholder="请输入名称" :disabled="!scope.row.editing"/>
            </template>
          </el-table-column>
          <el-table-column label="类型" align="center" prop="type">
            <template slot-scope="scope">
              <el-select
                v-model="scope.row.type"
                placeholder="请选择类型"
                :disabled="!scope.row.editing"
              >
                <el-option label="小程序" value="1"></el-option>
                <el-option label="服务号" value="2"></el-option>
                <el-option label="自定义" value="3"></el-option>
              </el-select>
            </template>
          </el-table-column>
          <el-table-column label="小程序原始ID" align="center" prop="username">
            <template slot-scope="scope" v-if="scope.row.type == 1 || scope.row.type == 3 ">
              <el-input v-model="scope.row.username" placeholder="请输入原始ID" :disabled="!scope.row.editing"/>
            </template>
          </el-table-column>
          <el-table-column label="小程序图标" align="center" prop="log">
            <template slot-scope="scope" v-if="scope.row.type == 1 || scope.row.type == 3 ">
              <el-image v-if="!scope.row.editing && scope.row.log" :src="scope.row.log"
                        :preview-src-list="[scope.row.log]"
              />
              <image-upload v-if="scope.row.editing" v-model="scope.row.log" :file-type='["png", "jpg", "jpeg"]'
                            :limit="1"
              />
            </template>
          </el-table-column>
          <el-table-column label="AppId" align="center" prop="appid">
            <template slot-scope="scope">
              <el-input v-model="scope.row.appid" placeholder="请输入AppId" :disabled="!scope.row.editing"/>
            </template>
          </el-table-column>
          <el-table-column label="Secret" align="center" prop="secret">
            <template slot-scope="scope">
              <el-input v-model="scope.row.secret" placeholder="请输入Secret" :disabled="!scope.row.editing"/>
            </template>
          </el-table-column>
          <el-table-column label="token" align="center" prop="token">
            <template slot-scope="scope">
              <el-input v-model="scope.row.token" placeholder="请输入token" :disabled="!scope.row.editing"/>
            </template>
          </el-table-column>
          <el-table-column label="aesKey" align="center" prop="aesKey">
            <template slot-scope="scope">
              <el-input v-model="scope.row.aesKey" placeholder="请输入aesKey" :disabled="!scope.row.editing"/>
            </template>
          </el-table-column>
          <el-table-column label="msgDataFormat" align="center" prop="msgDataFormat">
            <template slot-scope="scope">
              <el-input v-model="scope.row.msgDataFormat" placeholder="请输入消息格式" :disabled="!scope.row.editing"/>
            </template>
          </el-table-column>
          <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
            <template slot-scope="scope">
              <el-button
                v-if="!scope.row.editing"
                size="mini"
                type="text"
                icon="el-icon-edit"
                @click="handleEdit(scope.$index, scope.row)"
              >编辑
              </el-button>
              <el-button
                v-if="scope.row.editing"
                size="mini"
                type="text"
                icon="el-icon-check"
                @click="handleSave(scope.$index, scope.row)"
              >保存
              </el-button>
              <el-button
                size="mini"
                type="text"
                icon="el-icon-delete"
                @click="deleteCourseMaConfig(scope.$index)"
              >删除
              </el-button>
              <el-button
                size="mini"
                type="text"
                icon="el-icon-setting"
                @click="handleSwitchConfig(scope.row)"
              >是否展示销售管理
              </el-button>
            </template>
          </el-table-column>
        </el-table>
        <div class="footer">

          <el-button type="primary" @click="submitCourseMaConfig">提 交</el-button>
        </div>
      </el-tab-pane>

      <!-- 开关配置对话框 -->
      <el-dialog title="开关配置" :visible.sync="switchDialogVisible" width="500px" class="switch-dialog">
        <el-form :model="switchForm" label-width="100px">
          <el-form-item label="AppId">
            <el-input v-model="switchForm.appId" :disabled="true"></el-input>
          </el-form-item>
          <el-form-item label="开关状态">
            <el-switch
              v-model="switchForm.switchStatus"
              active-text="开启"
              inactive-text="关闭"
              active-value="001"
              inactive-value="002"
            >
            </el-switch>
          </el-form-item>
          <el-form-item label="配置信息" v-if="switchForm.configInfo">
            <el-input
              type="textarea"
              :rows="4"
              v-model="switchForm.configInfo"
              :disabled="true"
            >
            </el-input>
          </el-form-item>
        </el-form>
        <span slot="footer" class="dialog-footer">
                <el-button @click="switchDialogVisible = false">取 消</el-button>
                <el-button type="primary" @click="submitSwitchConfig">确 定</el-button>
            </span>
      </el-dialog>


      <el-tab-pane label="红包商户配置" name="redPacket.config">
        <el-form ref="form19" :model="form19" label-width="150px">
          <el-form-item label="红包接口类型" prop="isNew">
            <el-radio-group v-model="form19.isNew">
              <el-radio label="0">商家转账到零钱(旧)</el-radio>
              <el-radio label="1">商家转账(新)</el-radio>
            </el-radio-group>
          </el-form-item>
          <el-form-item label="公众号appid" prop="appId">
            <el-input v-model="form19.appId" label="请输入appId"></el-input>
          </el-form-item>
          <el-form-item label="小程序appid" prop="appId">
            <el-input v-model="form19.miniappId" label="请输入appId"></el-input>
          </el-form-item>
          <el-form-item label="商户号" prop="mchId">
            <el-input v-model="form19.mchId" label="请输入mchId"></el-input>
          </el-form-item>
          <el-form-item label="商户密钥" prop="mchKey">
            <el-input v-model="form19.mchKey" label="mchKey"></el-input>
          </el-form-item>
          <el-form-item label="p12证书路径" prop="keyPath">
            <el-input v-model="form19.keyPath" label="请输入keyPath"></el-input>
          </el-form-item>
          <el-form-item label="apiV3密钥" prop="apiV3Key">
            <el-input v-model="form19.apiV3Key" label="请输入apiV3Key"></el-input>
          </el-form-item>
          <el-form-item   label="公钥ID" prop="publicKeyId">
            <el-input v-model="form19.publicKeyId" label="请输入公钥ID"></el-input>
          </el-form-item>
          <el-form-item   label="公钥证书" prop="publicKeyPath">
            <el-input v-model="form19.publicKeyPath" label="请输入publicKeyPath"></el-input>
          </el-form-item>
          <el-form-item label="key路径" prop="privateKeyPath">
            <el-input v-model="form19.privateKeyPath" label="请输入"></el-input>
          </el-form-item>
          <el-form-item label="cert路径" prop="privateCertPath">
            <el-input v-model="form19.privateCertPath" label="请输入"></el-input>
          </el-form-item>
          <el-form-item label="回调地址" prop="notifyUrl">
            <el-input v-model="form19.notifyUrl" label="请输入"></el-input>
          </el-form-item>

          <div class="footer">
            <el-button type="primary" @click="submitForm19">提 交</el-button>
          </div>
        </el-form>
      </el-tab-pane>
      <el-tab-pane label="企微Sop客户评级配置" name="qwRating:config">
        <el-form ref="form20" :model="form20" :rules="rules20" label-width="150px">
          <el-form-item label="评级天数(天)" prop="levelDay">
            <el-tooltip class="item" effect="dark" content="最小评级天数(天)" placement="top-end">
              <el-input-number v-model="form20.levelDay" :min="4" :max="365"></el-input-number>
            </el-tooltip>
          </el-form-item>

          <el-form-item label="超过多少天的客户没看课评E级" prop="levelDay">
            <el-tooltip class="item" effect="dark" content="超过多少天的客户没看课评E级，且不生成sop执行记录了，不发了"
                        placement="top-end"
            >
              <el-input-number v-model="form20.notStudyDays" :min="4" :max="365"></el-input-number>
            </el-tooltip>
          </el-form-item>

          <!-- A级范围 -->
          <el-form-item label="A级范围(%)" prop="aLevelMin">
            <el-tooltip class="item" effect="dark" content="A级客户范围最小值(%)" placement="top-end">
              <el-input-number
                v-model="form20.aLevelMin"
                :min="0"
                :max="100"
              ></el-input-number>
            </el-tooltip>
            <span style="margin: 0 10px;">-</span>
            <span>100</span> <!-- aLevelMax 固定为 100 -->
            <span style="margin: 0 16px;">---A级推送次数限制</span>
            <el-tooltip class="item" effect="dark" content="A级客户每日发送次数限制" placement="top-end">
              <el-input-number
                v-model="form20.aLevelSend"
                :min="0"
                placeholder="发送次数"
              ></el-input-number>
            </el-tooltip>
          </el-form-item>

          <!-- B级范围 -->
          <el-form-item label="B级范围(%)" prop="bLevelMin">
            <el-tooltip class="item" effect="dark" content="B级客户范围最小值(%)" placement="top-end">
              <el-input-number
                v-model="form20.bLevelMin"
                :min="0"
                :max="100"
              ></el-input-number>
            </el-tooltip>
            <span style="margin: 0 10px;">-</span>
            <el-tooltip class="item" effect="dark" content="B级客户范围最大值(%)" placement="top-end">
              <el-input-number
                v-model="form20.bLevelMax"
                :min="0"
                :max="100"
              ></el-input-number>
            </el-tooltip>
            <span style="margin: 0 16px;">---B级推送次数限制</span>
            <el-tooltip class="item" effect="dark" content="B级客户每日发送次数限制" placement="top-end">
              <el-input-number
                v-model="form20.bLevelSend"
                :min="0"
                placeholder="发送次数"
              ></el-input-number>
            </el-tooltip>
          </el-form-item>

          <!-- C级范围 -->
          <el-form-item label="C级范围(%)" prop="cLevelMin">
            <el-tooltip class="item" effect="dark" content="C级客户范围最小值(%)" placement="top-end">
              <el-input-number
                v-model="form20.cLevelMin"
                :min="0"
                :max="100"
              ></el-input-number>
            </el-tooltip>
            <span style="margin: 0 10px;">-</span>
            <el-tooltip class="item" effect="dark" content="C级客户范围最大值(%)" placement="top-end">
              <el-input-number
                v-model="form20.cLevelMax"
                :min="0"
                :max="100"
              ></el-input-number>
            </el-tooltip>
            <span style="margin: 0 16px;">---C级推送次数限制</span>
            <el-tooltip class="item" effect="dark" content="C级客户每日发送次数限制" placement="top-end">
              <el-input-number
                v-model="form20.cLevelSend"
                :min="0"
                placeholder="发送次数"
              ></el-input-number>
            </el-tooltip>
          </el-form-item>

          <!-- D级范围 -->
          <el-form-item label="D级范围(%)" prop="dLevelMin">
            <span>0</span> <!-- dLevelMin 固定为 0 -->
            <span style="margin: 0 10px;">-</span>
            <el-tooltip class="item" effect="dark" content="D级客户范围最大值(%)" placement="top-end">
              <el-input-number
                v-model="form20.dLevelMax"
                :min="0"
                :max="100"
              ></el-input-number>
            </el-tooltip>
            <span style="margin: 0 16px;">---D级推送次数限制</span>
            <el-tooltip class="item" effect="dark" content="D级客户每日发送次数限制" placement="top-end">
              <el-input-number
                v-model="form20.dLevelSend"
                :min="0"
                placeholder="发送次数"
              ></el-input-number>
            </el-tooltip>
          </el-form-item>

          <div class="line"></div>
          <div style="float: right; margin-right: 20px">
            <el-button type="primary" @click="submitForm20">提交</el-button>
          </div>
        </el-form>
      </el-tab-pane>
      <el-tab-pane label="注册配置" name="his.login">
        <el-form ref="form22" :model="form22" label-width="150px">
          <el-form-item label="注册初始密码" prop="loginPassword">
            <el-input v-model="form22.loginPassword" label="请输入初始密码"></el-input>
          </el-form-item>
          <el-form-item label="首次登录是否修改密码">
            <el-row>
              <el-switch v-model="form22.disabled"></el-switch>
            </el-row>
          </el-form-item>
          <div class="footer">
            <el-button type="primary" @click="submitForm22">提 交</el-button>
          </div>
        </el-form>

      </el-tab-pane>
      <el-tab-pane label="企业理念" name="store.concept">
        <el-form ref="form21" :model="form21" :rules="rules21" label-width="160px">
          <el-form-item label="企业理念图片" prop="images">
            <Material v-model="images" type="image" :num="10" :width="150" :height="150"/>
          </el-form-item>
          <el-form-item label="企业理念视频" prop="videoUrl">
            <div>
              <el-upload
                ref="upload"
                class="upload-demo"
                :action="uploadUrl"
                :on-success="handleSuccess"
                :before-upload="beforeUpload"
                :limit="1"
                :accept="videoAccept"
              >
                <el-button size="small" type="primary">点击上传视频</el-button>
              </el-upload>
              <video :src="form21.videoUrl" controls style="max-width: 400px; max-height: 400px;"></video>
            </div>
          </el-form-item>
          <div class="footer">
            <el-button type="primary" @click="submitForm21">提 交</el-button>
          </div>
        </el-form>
      </el-tab-pane>

      <el-tab-pane label="公司销售角色默认生成配置" name="companymenu.config">
        <companyMenuConfig></companyMenuConfig>
      </el-tab-pane>
      <el-tab-pane label="APP设置" name="app.config">
        <el-form ref="form25" :model="form25" :rules="rules25" label-width="160px">


          <!-- 客服配置卡片 -->
          <el-card class="config-card" shadow="hover">
            <!-- 标题区域移到body内 -->
            <div class="section-title">
              <div class="title-icon">
                <i class="el-icon-service"></i>
              </div>
              <div class="title-text">
                <h3>APP客服配置</h3>
                <p class="subtitle">配置企业微信客服相关参数</p>
              </div>
            </div>

            <el-divider></el-divider>

            <el-form-item label="企微主体" prop="corpId">
              <el-select
                v-model="form25.corpId"
                clearable filterable
                placeholder="请选择企微主体"
                style="width: 320px;">
                <el-option
                  v-for="item in corpOptions"
                  :key="item.corpId"
                  :label="item.corpName"
                  :value="item.corpId"
                >
                </el-option>
              </el-select>
              <el-tooltip content="选择企业微信的主体" placement="right">
                <i class="el-icon-question help-icon"></i>
              </el-tooltip>
            </el-form-item>
            <el-form-item label="客服链接" prop="corpUrl">
              <el-input v-model="form25.corpUrl" label="请输入" style="width: 500px;"></el-input>
            </el-form-item>
          </el-card>

          <!-- APP推广卡片 -->
          <el-card class="config-card" shadow="hover">
            <div class="section-title">
              <div class="title-icon icon-promotion">
                <i class="el-icon-mobile-phone"></i>
              </div>
              <div class="title-text">
                <h3>APP推广</h3>
                <p class="subtitle">配置APP推广素材，支持图片和视频</p>
              </div>
            </div>

            <el-divider></el-divider>

            <el-form-item label="APP推广图片" prop="images">
              <Material v-model="appImages" type="image" :num="10" :width="150" :height="150"/>
            </el-form-item>
            <el-form-item label="APP推广视频" prop="videoUrl">
              <div>
                <el-upload
                  ref="upload"
                  class="upload-demo"
                  :action="uploadUrl"
                  :on-success="appHandleSuccess"
                  :before-upload="beforeUpload"
                  :limit="1"
                  :accept="videoAccept"
                >
                  <el-button size="small" type="primary">点击上传视频</el-button>
                </el-upload>
                <video :src="form25.videoUrl" controls style="max-width: 400px; max-height: 400px;"></video>
              </div>
            </el-form-item>
          </el-card>


          <!-- 游戏配置卡片 - 增强版 -->
          <el-card class="config-card" shadow="hover">
            <div class="section-title">
              <div class="title-icon icon-game">
                <i class="el-icon-s-flag"></i>
              </div>
              <div class="title-text">
                <h3>游戏配置</h3>
                <p class="subtitle">配置APP内小游戏列表及相关参数</p>
              </div>
            </div>

            <el-divider></el-divider>

            <!-- 游戏获得积分 -->
            <el-form-item label="游戏获得积分" prop="addIntegral">
              <el-input-number
                v-model="form25.addIntegral"
                :min="-999999"
                :max="999999"
                :step="1"
                :precision="0"
                controls-position="right"
                style="width: 320px;">
              </el-input-number>
              <el-tooltip content="玩一局游戏获得的积分（负数为扣减）,默认100" placement="right">
                <i class="el-icon-question help-icon"></i>
              </el-tooltip>
            </el-form-item>

            <!-- 视频获得积分 -->
            <el-form-item label="视频获得积分" prop="defaultRewardGold">
              <el-input-number
                v-model="form25.defaultRewardGold"
                :min="-999999"
                :max="999999"
                :step="1"
                :precision="0"
                controls-position="right"
                style="width: 320px;">
              </el-input-number>
              <el-tooltip content="观看视频获得的金币（负数为扣减）,默认100" placement="right">
                <i class="el-icon-question help-icon"></i>
              </el-tooltip>
            </el-form-item>

            <!-- 游戏列表区域 -->
            <el-form-item label="游戏列表" class="game-list-item">
              <div class="game-list-header">
                <el-button type="primary" size="small" @click="addGameConfig" icon="el-icon-plus">
                  新增游戏
                </el-button>
                <span class="game-list-tip">最多可添加10个游戏</span>
              </div>

              <!-- 游戏列表表格 -->
              <el-table
                :data="form25.gameList"
                border
                style="width: 100%; margin-top: 15px;"
                v-loading="gameListLoading"
              >
                <el-table-column label="序号" width="60" align="center">
                  <template slot-scope="scope">
                    <span>{{ scope.$index + 1 }}</span>
                  </template>
                </el-table-column>

                <el-table-column label="游戏图片" width="200" align="center">
                  <template slot-scope="scope">
                    <div v-if="scope.row.editing">
                      <ImageUpload
                        v-model="scope.row.image"
                        :limit="1"
                        :file-type='["png", "jpg", "jpeg"]'
                        :width="30"
                        :height="30"
                      />
                    </div>
                    <div v-else class="game-image-preview">
                      <el-image
                        v-if="scope.row.image"
                        :src="scope.row.image"
                        :preview-src-list="[scope.row.image]"
                        style="width: 50px; height: 50px; border-radius: 4px;"
                      >
                        <div slot="error" class="image-slot">
                          <i class="el-icon-picture-outline"></i>
                        </div>
                      </el-image>
                      <span v-else class="no-image">暂无图片</span>
                    </div>
                  </template>
                </el-table-column>

                <el-table-column label="游戏名称" min-width="150">
                  <template slot-scope="scope">
                    <el-input
                      v-if="scope.row.editing"
                      v-model="scope.row.name"
                      placeholder="请输入游戏名称"
                      size="small"
                    ></el-input>
                    <span v-else>{{ scope.row.name || '-' }}</span>
                  </template>
                </el-table-column>

                <el-table-column label="游戏链接" min-width="200">
                  <template slot-scope="scope">
                    <el-input
                      v-if="scope.row.editing"
                      v-model="scope.row.url"
                      placeholder="请输入游戏链接"
                      size="small"
                    ></el-input>
                    <span v-else class="game-link">{{ scope.row.url || '-' }}</span>
                  </template>
                </el-table-column>

                <el-table-column label="排序" width="100" align="center">
                  <template slot-scope="scope">
                    <el-input-number
                      v-if="scope.row.editing"
                      v-model="scope.row.sort"
                      :min="0"
                      :max="999"
                      size="small"
                      controls-position="right"
                      style="width: 80px;"
                    ></el-input-number>
                    <span v-else>{{ scope.row.sort || 0 }}</span>
                  </template>
                </el-table-column>

                <el-table-column label="状态" width="80" align="center">
                  <template slot-scope="scope">
                    <el-switch
                      v-if="scope.row.editing"
                      v-model="scope.row.status"
                      :active-value="1"
                      :inactive-value="0"
                      active-color="#13ce66"
                      inactive-color="#ff4949"
                    ></el-switch>
                    <el-tag v-else :type="scope.row.status === 1 ? 'success' : 'info'" size="small">
                      {{ scope.row.status === 1 ? '启用' : '禁用' }}
                    </el-tag>
                  </template>
                </el-table-column>

                <el-table-column label="操作" width="150" fixed="right" align="center">
                  <template slot-scope="scope">
                    <el-button
                      v-if="!scope.row.editing"
                      type="text"
                      size="small"
                      icon="el-icon-edit"
                      @click="editGame(scope.$index)"
                    >编辑</el-button>
                    <el-button
                      v-if="scope.row.editing"
                      type="text"
                      size="small"
                      icon="el-icon-check"
                      @click="saveGame(scope.$index)"
                    >保存</el-button>
                    <el-button
                      v-if="!scope.row.editing"
                      type="text"
                      size="small"
                      icon="el-icon-delete"
                      class="delete-btn"
                      @click="deleteGame(scope.$index)"
                    >删除</el-button>
                    <el-button
                      v-if="scope.row.editing"
                      type="text"
                      size="small"
                      icon="el-icon-close"
                      @click="cancelEdit(scope.$index)"
                    >取消</el-button>
                  </template>
                </el-table-column>
              </el-table>
            </el-form-item>

            <el-card class="config-card" shadow="hover">
              <div class="section-title">
                <div class="title-icon icon-promotion">
                  <i class="el-icon-bank-card"></i>
                </div>
                <div class="title-text">
                  <h3>提现配置</h3>
                  <p class="subtitle">配置APP商家转账配置</p>
                </div>
              </div>

              <el-divider></el-divider>
              <el-form-item label="是否开启提现" prop="isOpenWithdraw">
                <el-radio-group v-model="form25.isOpenWithdraw">
                  <el-radio :label="1" >开</el-radio>
                  <el-radio :label="0">关</el-radio>
                </el-radio-group>
              </el-form-item>
              <el-form-item label="兑换佣金比例" prop="withdrawRatio">
                <el-input-number
                  v-model="form25.withdrawRatio"
                  :min="100"
                  :step="1"
                  :precision="0"
                  placeholder="1元=多少积分"
                  controls-position="right"

                />
              </el-form-item>

              <el-form-item label="一次最大提现金额(元)" prop="maxApplicationAmount">
                <el-input-number
                  v-model="form25.maxApplicationAmount"
                  :min="0.10"
                  :max="999999.99"
                  :precision="2"
                  :step="0.01"
                  placeholder="最大提现金额"
                  controls-position="right"

                />
              </el-form-item>
              <el-form-item label="一天允提现次数(次)" prop="withdrawNum">
                <el-input-number
                  v-model="form25.withdrawNum"
                  :min="0"
                  :max="99"
                  :precision="0"
                  :step="1"
                  placeholder="提现次数"
                  controls-position="right"

                />
              </el-form-item>
              <el-form-item label="连续提现封控(天)" prop="limitDayNum">
                <el-input-number
                  v-model="form25.limitDayNum"
                  :min="1"
                  :max="99"
                  :precision="0"
                  :step="1"
                  placeholder="连续提现几天封控"
                  controls-position="right"

                />
              </el-form-item>
              <el-form-item label="连续提现累计金额封控(元)" prop="limitAmount">
                <el-input-number
                  v-model="form25.limitAmount"
                  :min="0.10"
                  :max="999999.99"
                  :precision="2"
                  :step="0.01"
                  placeholder="连续提现累计金额封控"
                  controls-position="right"
                />
              </el-form-item>

              <el-form-item label="红包接口类型" prop="isNew">
                <el-radio-group v-model="form25.isNew" >
                  <el-radio label="0">商家转账到零钱(旧)</el-radio>
                  <el-radio label="1">商家转账到零钱(新)</el-radio>
                </el-radio-group>
              </el-form-item>
              <el-form-item label="商户号" prop="mchId">
                <el-input v-model="form25.mchId" placeholder="请输入商户号"></el-input>
              </el-form-item>
              <el-form-item label="商户密钥" prop="mchKey">
                <el-input v-model="form25.mchKey" placeholder="请输入商户密钥" show-password></el-input>
              </el-form-item>
              <el-form-item label="p12证书路径" prop="keyPath">
                <el-input v-model="form25.keyPath" placeholder="请输入p12证书路径"></el-input>
              </el-form-item>
              <el-form-item label="apiV3密钥" prop="apiV3Key">
                <el-input v-model="form25.apiV3Key" placeholder="请输入apiV3密钥" show-password></el-input>
              </el-form-item>
              <el-form-item label="公钥ID" prop="publicKeyId">
                <el-input v-model="form25.publicKeyId" placeholder="请输入公钥ID"></el-input>
              </el-form-item>
              <el-form-item label="公钥证书路径" prop="publicKeyPath">
                <el-input v-model="form25.publicKeyPath" placeholder="请输入公钥证书路径"></el-input>
              </el-form-item>
              <el-form-item label="私钥路径" prop="privateKeyPath">
                <el-input v-model="form25.privateKeyPath" placeholder="请输入私钥路径"></el-input>
              </el-form-item>
              <el-form-item label="证书路径" prop="privateCertPath">
                <el-input v-model="form25.privateCertPath" placeholder="请输入证书路径"></el-input>
              </el-form-item>
              <el-form-item label="看课奖励回调地址" prop="notifyUrl">
                <el-input v-model="form25.notifyUrl" placeholder="请输入回调地址"></el-input>
              </el-form-item>
              <el-form-item label="提现回调地址" prop="withdrawalNotifyUrl">
                <el-input v-model="form25.withdrawalNotifyUrl" placeholder="请输入回调地址"></el-input>
              </el-form-item>
            </el-card>

          </el-card>
          <div class="footer">
            <el-button type="primary" @click="submitForm25">提 交</el-button>
          </div>
        </el-form>
      </el-tab-pane>

      <el-tab-pane label="健康指标配置" name="his.healthIndexConfig">

        <el-form ref="form26" :model="form26" label-width="200px">
          <!-- 红色提示 严格按照对应格式参数填写，指标参数只能是数字和特殊符号，数值保留一位小数，特殊符号只能有 < > ≥ ≤ ~ 不能有空格 -->
          <el-card class="box-card">
            <div slot="header" class="clearfix">
              <span style="color: red;">请严格按照对应格式参数填写，指标参数只能是数字和特殊符号，数值保留一位小数，特殊符号只能有 &lt; &gt; ≥ ≤ ~ 不能有空格</span>
            </div>
          </el-card>


          <!-- 血糖指标 -->
          <el-card class="box-card" style="margin-bottom: 20px;">
            <div slot="header" class="clearfix">
              <span>血糖指标 (mmol/L)</span>
            </div>

            <el-form-item label="空腹血糖正常值">
              <el-input v-model="form26.bloodGlucose.fasting.normal" placeholder="例如: 3.9-6.1">
                <template slot="append">mmol/L</template>
              </el-input>
            </el-form-item>

            <el-form-item label="餐后1小时血糖正常值">
              <el-input v-model="form26.bloodGlucose.post1Hour.normal" placeholder="例如: 6.7-9.0">
                <template slot="append">mmol/L</template>
              </el-input>
            </el-form-item>

            <el-form-item label="餐后2小时血糖正常值">
              <el-input v-model="form26.bloodGlucose.post2Hour.normal" placeholder="例如: ≤7.8">
                <template slot="append">mmol/L</template>
              </el-input>
            </el-form-item>

            <el-form-item label="血糖异常程度配置">
              <el-table :data="form26.bloodGlucose.severity" style="width: 100%;">
                <el-table-column prop="level" label="严重程度" width="120">
                  <template slot-scope="scope">
                    <el-tag :type="scope.row.level === 'normal' ? 'success' :
                            scope.row.level === 'mild' ? 'warning' : 'danger'"
                    >
                      {{
                        scope.row.level === 'normal' ? '正常' :
                          scope.row.level === 'mild' ? '轻微' : '严重'
                      }}
                    </el-tag>
                  </template>
                </el-table-column>
                <el-table-column prop="range" label="数值范围">
                  <template slot-scope="scope">
                    <el-input v-model="scope.row.range" placeholder="例如: <3.9 or 6.1-7.8"></el-input>
                  </template>
                </el-table-column>
                <el-table-column prop="description" label="描述">
                  <template slot-scope="scope">
                    <el-input v-model="scope.row.description" placeholder="例如: 低血糖风险"></el-input>
                  </template>
                </el-table-column>
              </el-table>
            </el-form-item>
          </el-card>

          <!-- 血压指标 -->
          <el-card class="box-card" style="margin-bottom: 20px;">
            <div slot="header" class="clearfix">
              <span>血压指标 (mmHg)</span>
            </div>


            <el-form-item label="血压异常程度配置">
              <el-table :data="form26.bloodPressure.severity" style="width: 100%;">
                <el-table-column prop="level" label="严重程度" width="120">
                  <template slot-scope="scope">
                    <el-tag :type="scope.row.level === 'normal' ? 'success' :
                            scope.row.level === 'mild' ? 'warning' : 'danger'"
                    >
                      {{
                        scope.row.level === 'normal' ? '正常' :
                          scope.row.level === 'mild' ? '轻微' : '严重'
                      }}
                    </el-tag>
                  </template>
                </el-table-column>
                <el-table-column prop="type" label="血压类型" width="120">
                  <template slot-scope="scope">
                    <span>{{ scope.row.type === 'systolic' ? '收缩压' : '舒张压' }}</span>
                  </template>
                </el-table-column>
                <el-table-column prop="range" label="数值范围">
                  <template slot-scope="scope">
                    <el-input v-model="scope.row.range" placeholder="例如: <90 or 120-139"></el-input>
                  </template>
                </el-table-column>
                <el-table-column prop="description" label="描述">
                  <template slot-scope="scope">
                    <el-input v-model="scope.row.description" placeholder="例如: 正常高值"></el-input>
                  </template>
                </el-table-column>
              </el-table>
            </el-form-item>
          </el-card>

          <el-card class="box-card">
            <div slot="header" class="clearfix">
              <span>尿酸指标 (μmol/L)</span>
            </div>

            <el-form-item label="性别分类配置">
              <el-tabs v-model="form26.uricAcid.activeGender">
                <el-tab-pane label="男性" name="male">
                  <el-table :data="form26.uricAcid.male" style="width: 100%;">
                    <el-table-column prop="level" label="风险等级" width="120">
                      <template slot-scope="scope">
                        <el-tag :type="scope.row.level === 'normal' ? 'success' :
                                scope.row.level === 'mild' ? 'warning' : 'danger'"
                        >
                          {{
                            scope.row.level === 'normal' ? '正常' :
                              scope.row.level === 'mild' ? '不良' : '高风险'
                          }}
                        </el-tag>
                      </template>
                    </el-table-column>
                    <el-table-column prop="range" label="数值范围">
                      <template slot-scope="scope">
                        <el-input v-model="scope.row.range" placeholder="例如: <420"></el-input>
                      </template>
                    </el-table-column>
                    <el-table-column prop="description" label="描述">
                      <template slot-scope="scope">
                        <el-input v-model="scope.row.description" placeholder="例如: 正常范围"></el-input>
                      </template>
                    </el-table-column>
                  </el-table>
                </el-tab-pane>

                <el-tab-pane label="女性" name="female">
                  <el-table :data="form26.uricAcid.female" style="width: 100%;">
                    <el-table-column prop="level" label="风险等级" width="120">
                      <template slot-scope="scope">
                        <el-tag :type="scope.row.level === 'normal' ? 'success' :
                                scope.row.level === 'mild' ? 'warning' : 'danger'"
                        >
                          {{
                            scope.row.level === 'normal' ? '正常' :
                              scope.row.level === 'mild' ? '不良' : '高风险'
                          }}
                        </el-tag>
                      </template>
                    </el-table-column>
                    <el-table-column prop="range" label="数值范围">
                      <template slot-scope="scope">
                        <el-input v-model="scope.row.range" placeholder="例如: <360"></el-input>
                      </template>
                    </el-table-column>
                    <el-table-column prop="description" label="描述">
                      <template slot-scope="scope">
                        <el-input v-model="scope.row.description" placeholder="例如: 正常范围"></el-input>
                      </template>
                    </el-table-column>
                  </el-table>
                </el-tab-pane>
              </el-tabs>
            </el-form-item>
          </el-card>

          <!-- Add BMI指标 card after the uric acid card -->
          <el-card class="box-card" style="margin-bottom: 20px;">
            <div slot="header" class="clearfix">
              <span>BMI指标 (kg/m²)</span>
            </div>

            <el-form-item label="BMI异常程度配置">
              <el-table :data="form26.bmi.severity" style="width: 100%;">
                <el-table-column prop="level" label="严重程度" width="120">
                  <template slot-scope="scope">
                    <el-tag :type="scope.row.level === 'normal' ? 'success' :
                            scope.row.level === 'mild' ? 'warning' : 'danger'"
                    >
                      {{
                        scope.row.level === 'normal' ? '正常' :
                          scope.row.level === 'mild' ? '偏瘦' : '偏胖'
                      }}
                    </el-tag>
                  </template>
                </el-table-column>
                <el-table-column prop="range" label="数值范围">
                  <template slot-scope="scope">
                    <el-input v-model="scope.row.range" placeholder="例如: 18.5-23.9"></el-input>
                  </template>
                </el-table-column>
                <el-table-column prop="description" label="描述">
                  <template slot-scope="scope">
                    <el-input v-model="scope.row.description" placeholder="例如: 正常范围"></el-input>
                  </template>
                </el-table-column>
              </el-table>
            </el-form-item>
          </el-card>


          <!-- 腰围指标 -->
          <el-card class="box-card" style="margin-bottom: 20px;">
            <div slot="header" class="clearfix">
              <span>腰围指标 (cm)</span>
            </div>

            <el-form-item label="性别分类配置">
              <el-tabs v-model="form26.waist.activeGender">
                <el-tab-pane label="男性" name="male">
                  <el-table :data="form26.waist.male" style="width: 100%;">
                    <el-table-column prop="level" label="风险等级" width="120">
                      <template slot-scope="scope">
                        <el-tag :type="scope.row.level === 'normal' ? 'success' :
                                scope.row.level === 'mild' ? 'warning' : 'danger'"
                        >
                          {{
                            scope.row.level === 'normal' ? '正常' :
                              scope.row.level === 'mild' ? '偏小' : '偏大'
                          }}
                        </el-tag>
                      </template>
                    </el-table-column>
                    <el-table-column prop="range" label="数值范围">
                      <template slot-scope="scope">
                        <el-input v-model="scope.row.range" placeholder="例如: <90"></el-input>
                      </template>
                    </el-table-column>
                    <el-table-column prop="description" label="描述">
                      <template slot-scope="scope">
                        <el-input v-model="scope.row.description" placeholder="例如: 正常范围"></el-input>
                      </template>
                    </el-table-column>
                  </el-table>
                </el-tab-pane>

                <el-tab-pane label="女性" name="female">
                  <el-table :data="form26.waist.female" style="width: 100%;">
                    <el-table-column prop="level" label="风险等级" width="120">
                      <template slot-scope="scope">
                        <el-tag :type="scope.row.level === 'normal' ? 'success' :
                                scope.row.level === 'mild' ? 'warning' : 'danger'"
                        >
                          {{
                            scope.row.level === 'normal' ? '正常' :
                              scope.row.level === 'mild' ? '偏小' : '偏大'
                          }}
                        </el-tag>
                      </template>
                    </el-table-column>
                    <el-table-column prop="range" label="数值范围">
                      <template slot-scope="scope">
                        <el-input v-model="scope.row.range" placeholder="例如: <80"></el-input>
                      </template>
                    </el-table-column>
                    <el-table-column prop="description" label="描述">
                      <template slot-scope="scope">
                        <el-input v-model="scope.row.description" placeholder="例如: 正常范围"></el-input>
                      </template>
                    </el-table-column>
                  </el-table>
                </el-tab-pane>
              </el-tabs>
            </el-form-item>
          </el-card>

          <el-card class="box-card" style="margin-bottom: 20px;">
            <div slot="header" class="clearfix">
              <span>臀围指标 (cm)</span>
            </div>

            <el-form-item label="性别分类配置">
              <el-tabs v-model="form26.hip.activeGender">
                <el-tab-pane label="男性" name="male">
                  <el-table :data="form26.hip.male" style="width: 100%;">
                    <el-table-column prop="level" label="风险等级" width="120">
                      <template slot-scope="scope">
                        <el-tag :type="scope.row.level === 'normal' ? 'success' :
                                scope.row.level === 'mild' ? 'warning' : 'danger'"
                        >
                          {{
                            scope.row.level === 'normal' ? '正常' :
                              scope.row.level === 'mild' ? '偏小' : '偏大'
                          }}
                        </el-tag>
                      </template>
                    </el-table-column>
                    <el-table-column prop="range" label="数值范围">
                      <template slot-scope="scope">
                        <el-input v-model="scope.row.range" placeholder="例如: 90-100"></el-input>
                      </template>
                    </el-table-column>
                    <el-table-column prop="description" label="描述">
                      <template slot-scope="scope">
                        <el-input v-model="scope.row.description" placeholder="例如: 正常范围"></el-input>
                      </template>
                    </el-table-column>
                  </el-table>
                </el-tab-pane>

                <el-tab-pane label="女性" name="female">
                  <el-table :data="form26.hip.female" style="width: 100%;">
                    <el-table-column prop="level" label="风险等级" width="120">
                      <template slot-scope="scope">
                        <el-tag :type="scope.row.level === 'normal' ? 'success' :
                                scope.row.level === 'mild' ? 'warning' : 'danger'"
                        >
                          {{
                            scope.row.level === 'normal' ? '正常' :
                              scope.row.level === 'mild' ? '偏小' : '偏大'
                          }}
                        </el-tag>
                      </template>
                    </el-table-column>
                    <el-table-column prop="range" label="数值范围">
                      <template slot-scope="scope">
                        <el-input v-model="scope.row.range" placeholder="例如: 85-95"></el-input>
                      </template>
                    </el-table-column>
                    <el-table-column prop="description" label="描述">
                      <template slot-scope="scope">
                        <el-input v-model="scope.row.description" placeholder="例如: 正常范围"></el-input>
                      </template>
                    </el-table-column>
                  </el-table>
                </el-tab-pane>
              </el-tabs>
            </el-form-item>
          </el-card>

          <div class="footer">
            <el-button type="primary" @click="submitForm26">提交</el-button>
          </div>
        </el-form>
      </el-tab-pane>

      <el-tab-pane label="三方入驻相关配置" name="medicalMall.func.switch">
        <el-form ref="form27" :model="form27" label-width="150px">
          <el-form-item label="商城店铺、商品是否审核" prop="isAudit">
            <el-switch
              v-model="form27.isAudit"
              active-color="#13ce66"
              inactive-color="#ff4949"
            >
            </el-switch>
          </el-form-item>
          <el-form-item label="商品修改不重新审核字段" prop="productColumns" v-if="form27.isAudit">
            <el-select v-model="form27.productColumns"
                       filterable
                       multiple
                       clearable
                       placeholder="请选择字段"
                       size="small"
                       style="width: 500px">
              <el-option
                v-for="column in storeProductScrmColumns"
                :key="column.colName"
                :label="column.colComment"
                :value="column.colName"
              >
              </el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="店铺修改不重新审核字段" prop="storeColumns" v-if="form27.isAudit">
            <el-select v-model="form27.storeColumns"
                       filterable
                       multiple
                       clearable
                       placeholder="请选择字段"
                       size="small"
                       style="width: 500px">
              <el-option
                v-for="column in storeScrmColumns"
                :key="column.colName"
                :label="column.colComment"
                :value="column.colName"
              >
              </el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="是否药品商城" prop="isMedicalMall">
            <el-switch
              v-model="form27.isMedicalMall"
              active-color="#13ce66"
              inactive-color="#ff4949"
            >
            </el-switch>
          </el-form-item>
          <el-form-item label="是否启用资源配置" prop="isResource">
            <el-switch
              v-model="form27.isResource"
              active-color="#13ce66"
              inactive-color="#ff4949"
            >
            </el-switch>
          </el-form-item>
          <el-form-item label="是否启用首页按照部门、公司展示按钮" prop="statics">
            <el-switch
              v-model="form27.statics"
              active-color="#13ce66"
              inactive-color="#ff4949"
            >
            </el-switch>
          </el-form-item>
          <el-form-item label="是否启用多店铺" prop="isStores">
            <el-switch
              v-model="form27.isStores"
              active-color="#13ce66"
              inactive-color="#ff4949"
            >
            </el-switch>
          </el-form-item>

          <div class="footer">
            <el-button type="primary" @click="submitForm27">提 交</el-button>
          </div>
        </el-form>
      </el-tab-pane>

      <el-tab-pane label="资质证书展示" name="his.zzzs">
        <el-form label-width="160px">
          <el-form-item  label="ICP主体备案号：" prop="icpztbah">
            <el-input v-model="form28.icpztbah" placeholder="请输入ICP主体备案号"></el-input>
          </el-form-item>
          <el-form-item  label="互联网药品信息服务备案：" prop="hlwypxxfwba">
            <el-input v-model="form28.hlwypxxfwba" placeholder="请输入互联网药品信息服务备案"></el-input>
          </el-form-item>
          <el-form-item label="药品网络交易服务第三方平台备案：" prop="ypwljyfwdsfpt">
            <el-input v-model="form28.ypwljyfwdsfpt" placeholder="请输入药品网络交易服务第三方平台备案"></el-input>
          </el-form-item>
          <el-form-item  label="医疗器械网络交易服务第三方平台备案号：" prop="ylqxwljyfwdsfptbah">
            <el-input v-model="form28.ylqxwljyfwdsfptbah" placeholder="请输入医疗器械网络交易服务第三方平台备案号"></el-input>
          </el-form-item>
          <el-form-item  label="投诉举报邮箱：" prop="jbyx">
            <el-input v-model="form28.jbyx" placeholder="请输入投诉举报邮箱"></el-input>
          </el-form-item>
          <el-form-item  label="联系电话：" prop="baxx">
            <el-input v-model="form28.baxx" placeholder="请输入联系电话"></el-input>
          </el-form-item>
          <div class="footer">
            <el-button type="primary" @click="submitForm28">提 交</el-button>
          </div>
        </el-form>
      </el-tab-pane>

      <el-tab-pane label="拼手气红包配置" name="randomRedpacket:config">
        <el-form ref="form29" :model="form29" label-width="150px">
          <el-form-item label="是否开启拼手气红包" prop="enableRandomRedpacket">

            <el-switch
              v-model="form29.enableRandomRedpacket"
              active-color="#13ce66"
              inactive-color="#ff4949">
            </el-switch>
          </el-form-item>
          <div v-if="!!form29.enableRandomRedpacket" style=" display: flex;
                  flex-direction: column;
                  margin-bottom: 50px;">

            <div v-for="(rule, index) in form29.rules" :key="index" class="form-row">

              <el-form-item
                label="金额区间"
                :prop="`rules.${index}.minAmount`"
                :rules="[
              { required: true, message: '请输入最小金额', trigger: 'blur' },
              { validator: validateMinAmount, trigger: 'blur', index: index }
            ]"
                class="form-item-amount"
              >
                <el-input
                  v-model.number="rule.minAmount"
                  type="number"
                  :min="0.01"
                  :precision="2"
                  :step="0.01"
                  placeholder="最小金额"
                  size="small"
                  class="amount-input"
                  @input="handleAmountInput(rule, 'minAmount')"
                ></el-input>
                <span class="separator">-</span>
                <el-input
                  v-model.number="rule.maxAmount"
                  type="number"
                  :min="rule.minAmount || 0.01"
                  :precision="2"
                  :step="0.01"
                  placeholder="最大金额"
                  size="small"
                  class="amount-input"
                  @input="handleAmountInput(rule, 'maxAmount')"
                ></el-input>
                <span class="suffix">元</span>
              </el-form-item>

              <el-form-item
                label="随机权重"
                :prop="`rules.${index}.weight`"
                :rules="[
                  { required: true, message: '请输入权重', trigger: 'blur' },
                  { type: 'integer', message: '权重必须为整数', trigger: 'blur' },
                ]"
                class="form-item-weight"
              >
                <el-input
                  v-model.number="rule.weight"
                  type="number"
                  :min="1"
                  placeholder="权重"
                  size="small"
                ></el-input>
              </el-form-item>
              <el-tooltip class="item" effect="dark" content="权重越高，被随机到的概率越大" placement="top">
                <i class="el-icon-question"></i>
              </el-tooltip>
              <div class="action-buttons">
                <el-button
                  icon="el-icon-plus"
                  size="mini"
                  type="text"
                  @click="addRule(index)"
                  class="add-btn"
                >
                  新增
                </el-button>
                <el-button
                  icon="el-icon-delete"
                  size="mini"
                  type="text"
                  @click="deleteRule(index)"
                  :disabled="form29.rules.length <= 1"
                  class="delete-btn"
                >
                  删除
                </el-button>
              </div>
            </div>
          </div>

          <div class="footer" style="margin-top:20px">
            <el-button type="primary" @click="submitForm29">提 交</el-button>
          </div>
        </el-form>
      </el-tab-pane>
      <el-tab-pane label="声纹复刻配置" name="vc.config">
        <el-form :model="form31" label-width="200px">
          <el-form-item label="类型" prop="type">
            <el-radio-group v-model="form31.type">
              <el-radio :label="1">本地服务器</el-radio>
              <el-radio :label="2">豆包</el-radio>
            </el-radio-group>
          </el-form-item>
          <div class="footer">
            <el-button type="primary" @click="submitForm31">提 交</el-button>
          </div>
        </el-form>
      </el-tab-pane>
      <el-tab-pane label="直播配置" name="living.config">
        <el-form ref="form32" :model="form32" label-width="150px">
          <el-form-item label="类型" prop="app">
            <el-radio-group v-model="form32.app">
              <el-radio label="live">直播</el-radio>
            </el-radio-group>
          </el-form-item>
          <el-form-item label="直播流链接" prop="domain">
            <el-input v-model="form32.domain" label="请输入domain"></el-input>
          </el-form-item>
          <el-form-item label="http" prop="http">
            <el-input v-model="form32.http" label="请输入http"></el-input>
          </el-form-item>
          <br>
          <div class="footer">
            <el-button type="primary" @click="submitForm32">提 交</el-button>
          </div>
        </el-form>
      </el-tab-pane>

      <!--   福袋配置    -->
      <el-tab-pane label="福袋配置" name="luckyBag.config">
        <!--   单个客服每周(7天)给同客户发送数量次数限制      -->
        <el-form ref="form33" :model="form33" :rules="rules33" label-width="300px">
          <el-form-item label="单个客服每周(7天)给同客户发送数量次数限制">
            <el-tooltip class="item" effect="dark" placement="top-end">
              <el-input-number
                v-model="form33.weekLimit"
                :min="0"
                :step="1"
                :precision="0"
              ></el-input-number>
            </el-tooltip>
          </el-form-item>
          <el-form-item label="福袋封面图标">
            <ImageUpload v-model="form33.miniprogramPicUrl" :file-type='["png", "jpg", "jpeg"]' :limit="1" />
          </el-form-item>
        </el-form>

        <div class="footer">
          <el-button type="primary" @click="submitForm33">提  交</el-button>
        </div>
      </el-tab-pane>

      <el-tab-pane label="IM配置" name="im.config">
        <!--   小米     -->
        <el-form ref="form34" :model="form34" :rules="rules34" label-width="300px">
          <el-form-item label="离线推送 小米系统申请channel_id">
            <el-input v-model="form34.xm_channel_id" style="width: 200px"></el-input>
          </el-form-item>
          <el-form-item label="离线推送 华为系统申请channel_id">
            <el-input v-model="form34.hw_channel_id" style="width: 200px"></el-input>
          </el-form-item>

        </el-form>

        <div class="footer">
          <el-button type="primary" @click="submitForm34">提  交</el-button>
        </div>
      </el-tab-pane>

      <el-tab-pane label="APP看课配置" name="courseAppConfig.config">
        <el-form ref="form35" :model="form35" :rules="rules35" label-width="300px">
          <el-form-item label="是否开启app看课">
            <el-radio-group v-model="form35.view_course_app">
              <el-radio :label="1">是</el-radio>
              <el-radio :label="0">否</el-radio>
            </el-radio-group>
          </el-form-item>
        </el-form>

        <div class="footer">
          <el-button type="primary" @click="submitForm35">提 交</el-button>
        </div>
      </el-tab-pane>
      <el-tab-pane label="AI打标签行业配置" name="aiTagTradeType.config">
        <el-form ref="form37" :model="form37" :rules="rules36" label-width="300px">
          <el-form-item label="行业选择" prop="tradeType">
            <el-select
              v-model="form37.tradeType"
              clearable
              filterable
              placeholder="请选择行业"
              style="width: 400px"
            >
              <el-option
                v-for="item in tradeTypeOptions"
                :key="item.dictValue"
                :label="item.dictLabel"
                :value="item.dictValue"
              />
            </el-select>
          </el-form-item>
        </el-form>

        <div class="footer">
          <el-button type="primary" @click="submitForm37">提 交</el-button>
        </div>
      </el-tab-pane>

      <el-tab-pane label="提现配置" name="his.AppRedPacket">
        <!-- 添加 ref 和 rules -->
        <el-form ref="form36" :model="form36" label-width="160px">

          <el-form-item label="红包接口类型" prop="isNew">
            <el-radio-group v-model="form36.isNew" >
              <el-radio label="0">商家转账到零钱(旧)</el-radio>
              <el-radio label="1">商家转账到零钱(新)</el-radio>
            </el-radio-group>
          </el-form-item>
          <el-form-item label="商户号" prop="mchId">
            <el-input v-model="form36.mchId" placeholder="请输入商户号"></el-input>
          </el-form-item>
          <el-form-item label="商户密钥" prop="mchKey">
            <el-input v-model="form36.mchKey" placeholder="请输入商户密钥" show-password></el-input>
          </el-form-item>
          <el-form-item label="p12证书路径" prop="keyPath">
            <el-input v-model="form36.keyPath" placeholder="请输入p12证书路径"></el-input>
          </el-form-item>
          <el-form-item label="apiV3密钥" prop="apiV3Key">
            <el-input v-model="form36.apiV3Key" placeholder="请输入apiV3密钥" show-password></el-input>
          </el-form-item>
          <el-form-item label="公钥ID" prop="publicKeyId">
            <el-input v-model="form36.publicKeyId" placeholder="请输入公钥ID"></el-input>
          </el-form-item>
          <el-form-item label="公钥证书路径" prop="publicKeyPath">
            <el-input v-model="form36.publicKeyPath" placeholder="请输入公钥证书路径"></el-input>
          </el-form-item>
          <el-form-item label="私钥路径" prop="privateKeyPath">
            <el-input v-model="form36.privateKeyPath" placeholder="请输入私钥路径"></el-input>
          </el-form-item>
          <el-form-item label="证书路径" prop="privateCertPath">
            <el-input v-model="form36.privateCertPath" placeholder="请输入证书路径"></el-input>
          </el-form-item>
          <el-form-item label="回调地址" prop="notifyUrl">
            <el-input v-model="form36.notifyUrl" placeholder="请输入回调地址"></el-input>
          </el-form-item>
          <el-form-item label="直播红包回调地址" prop="LiveNotifyUrl">
            <el-input v-model="form36.LiveNotifyUrl" placeholder="请输入直播红包回调地址"></el-input>
          </el-form-item>
          <div class="footer">
            <el-button type="primary" @click="submitForm36">提 交</el-button>
          </div>
        </el-form>
      </el-tab-pane>

      <el-tab-pane label="企微专区会话配置" name="qw.sessionConfig">
        <div v-for="(enterprise, idx) in form41" :key="idx" style="border:1px solid #DCDFE6; margin-bottom:20px; padding:15px; border-radius:8px; position:relative;">
          <div style="display:flex; justify-content:space-between; align-items:center; margin-bottom:10px;">
            <h4 style="margin:0;">企业配置 {{ idx+1 }}</h4>
            <el-button type="danger" size="small" icon="el-icon-delete" @click="removeEnterprise(idx)">删除</el-button>
          </div>

          <el-form :model="enterprise" label-width="160px">
            <el-form-item label="企业名称" prop="corpName" :rules="{ required: true, message: '企业名称不能为空', trigger: 'blur' }">
              <el-input v-model="enterprise.corpName" placeholder="请输入企业名称" style="width:400px"></el-input>
            </el-form-item>
            <el-form-item label="企业ID" prop="corpid" :rules="{ required: true, message: '企业ID不能为空', trigger: 'blur' }">
              <el-input v-model="enterprise.corpid" placeholder="请输入企业ID" style="width:400px"></el-input>
            </el-form-item>
            <el-form-item label="自建应用ID" prop="agentid">
              <el-input v-model="enterprise.agentid" placeholder="请输入自建应用ID" style="width:400px"></el-input>
            </el-form-item>
            <el-form-item label="自建应用密钥" prop="agentSecret">
              <el-input v-model="enterprise.agentSecret" placeholder="请输入自建应用密钥" style="width:400px"></el-input>
            </el-form-item>
            <el-form-item label="专区程序id" prop="programId">
              <el-input v-model="enterprise.programId" placeholder="请输入专区程序id" style="width:400px"></el-input>
            </el-form-item>
            <el-form-item label="会话密钥（私钥）" prop="privateKey" required>
              <el-input v-model="enterprise.privateKey" type="textarea" :rows="6" placeholder="-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----" style="width:600px"></el-input>
            </el-form-item>

            <!-- 能力ID配置 -->
            <el-divider content-position="left">能力ID配置</el-divider>
            <div v-for="(ability, aIdx) in enterprise.abilityIds" :key="aIdx" style="margin-bottom:10px;">
              <el-form-item
                :label="'能力标识 (Key)'"
                style="display: inline-block; width: 35%;"
              >
                <el-input v-model="ability.key" placeholder="例如：invokeSyncMsg"></el-input>
              </el-form-item>
              <el-form-item
                :label="'能力值 (Value)'"
                style="display: inline-block; width: 35%; margin-left: 2%;"
              >
                <el-input v-model="ability.value" placeholder="例如：invoke_sync_msg"></el-input>
              </el-form-item>
              <el-button type="danger" icon="el-icon-delete" circle @click="removeAbilityId(idx, aIdx)"></el-button>
            </div>
            <el-button type="primary" size="small" icon="el-icon-plus" @click="addAbilityId(idx)">添加能力ID</el-button>
          </el-form>
        </div>

        <div style="margin:15px 0;">
          <el-button type="primary" icon="el-icon-plus" @click="addEnterprise">添加企业配置</el-button>
        </div>

        <div class="footer">
          <el-button type="primary" @click="submitQwSessionConfig41">提交全部配置</el-button>
        </div>
      </el-tab-pane>

    </el-tabs>


    <el-dialog :title="product.title" v-if="product.open" :visible.sync="product.open" width="1000px" append-to-body>
      <product-attr-value-select ref="Details" @selectProduct="selectProduct"/>
    </el-dialog>
    <el-dialog :title="deliveryGift.title" v-if="deliveryGift.open" :visible.sync="deliveryGift.open" width="1000px"
               append-to-body
    >
      <productDeliveryGiftValueSelect ref="DeliveryGiftDetails" @selectDeliveryGift="selectDeliveryGift"/>
    </el-dialog>
  </div>
</template>

<script>
import { getConfigByKey, updateConfigByKey, clearCache, updateIsTownOn,getGatewayList } from '@/api/system/config'
import { listStore } from '@/api/his/storeProduct'
import { js } from 'js-beautify'
import Material from '@/components/Material'
import { allList } from '@/api/his/coupon'
import { getAllFollowTempName } from '@/api/his/followTemp'
import productAttrValueSelect from '../../components/his/productGiftValueSelect.vue'
import productDeliveryGiftValueSelect from '../../components/his/productDeliveryGiftValueSelect.vue'
import { Col } from 'element-ui'
import companyMenuConfig from './companyMenuConfig'
import IntegralConfig from '@/views/system/config/integralConfig.vue'
import { getCitys } from '@/api/store/city'
import { listCompany } from '@/api/company/company'
import { getStoreProductColumns } from '@/api/hisStore/storeProduct'
import { getStoreColumns } from '@/api/hisStore/store'
import{ getSignProjectName } from '@/api/course/qw/courseWatchLog'
import { listQwCompany } from '@/api/qw/qwCompany'

export default {
  name: 'Config',
  components: {
    companyMenuConfig,
    Material, productAttrValueSelect, productDeliveryGiftValueSelect,
    IntegralConfig
  },
  data() {
    return {
      gatewayList:[],
      isBeiJingZhuoMei:false,
      corpOptions:[],
      citys: [],
      images: [],
      appImages: [],
      uploadUrl: process.env.VUE_APP_BASE_API + '/common/uploadOSS',
      videoAccept: 'video/*',
      courseMaConfigLoading: false,
      courseMaConfigList: [],
      smsDomainNameOptions:[],//看课短信推送域名
      switchDialogVisible: false,
      deptLimit: false,
      switchForm: {
        appId: '',
        switchStatus: '001'
      },
      deliveryGift: {
        open: false,
        title: '商品选择'
      },
      product: {
        open: false,
        title: '商品选择'
      },
      tempOptions: [],
      integralLogTypeOptions: [],
      companyOptions: [],
      activeName: 'sys.oss.cloudStorage',
      configId: null,
      storeOPtions: [],
      roomLinkAllow:"",
      // 表单参数
      form1: {},
      form2: {},
      form3: {},
      form4: {},
      form5: [],
      form6: {},
      form7: {},
      form8: {},
      form9: {},
      form10: [],
      form12: [],
      form13: {
        dfAccounts: [], // 初始化代付管家账户数组
        enableLogisticCodeRecognition: false
      },
      form14: {},
      form15: {},
      form16: {},
      form17: {},
      form18: {
        viewCommentNum: 200,
        roomLinkAllow:true,
        smsDomainName: '', // 初始化为空字符串或其他默认值
        smsAcquisitionName: '', // 初始化为空字符串或其他默认值
        completionCountdown: false,//是否开启点播完课倒计时
        camelCase:'',
        /** 看课是否校验答案：1-是（默认） 0-否，随 course.config JSON 保存 */
        validateAnswerWhenWatch: '1',
      },
      form19: {},
      form20: {
        levelDay: 4,
        notStudyDays: 4,
        aLevelMin: 80,
        aLevelMax: 100,
        aLevelSend: 99,
        bLevelMin: 40,
        bLevelMax: 80,
        bLevelSend: 2,
        cLevelMin: 10,
        cLevelMax: 40,
        cLevelSend: 1,
        dLevelMin: 0,
        dLevelMax: 10,
        dLevelSend: 0
      },
      form21: {},
      form22: {},
      form23: {},
      form24: {},
      form25: {},
      gameListLoading: false,
      form26: {
        bloodGlucose: {
          fasting: { normal: '' },
          post1Hour: { normal: '' },
          post2Hour: { normal: '' },
          severity: [
            { level: 'normal', range: '', description: '' },
            { level: 'mild', range: '', description: '' },
            { level: 'severe', range: '', description: '' }
          ]
        },
        bloodPressure: {
          protection: { systolic: '', diastolic: '' },
          severity: [
            { level: 'normal', type: 'systolic', range: '', description: '' },
            { level: 'mild', type: 'systolic', range: '', description: '' },
            { level: 'severe', type: 'systolic', range: '', description: '' },
            { level: 'normal', type: 'diastolic', range: '', description: '' },
            { level: 'mild', type: 'diastolic', range: '', description: '' },
            { level: 'severe', type: 'diastolic', range: '', description: '' }
          ]
        },
        uricAcid: {
          activeGender: 'male',
          male: [
            { level: 'normal', range: '', description: '' },
            { level: 'mild', range: '', description: '' },
            { level: 'severe', range: '', description: '' }
          ],
          female: [
            { level: 'normal', range: '', description: '' },
            { level: 'mild', range: '', description: '' },
            { level: 'severe', range: '', description: '' }
          ]
        },
        bmi: {
          severity: [
            { level: 'normal', range: '', description: '' },
            { level: 'mild', range: '', description: '' },
            { level: 'severe', range: '', description: '' }
          ]
        },
        waist: {
          activeGender: 'male',
          male: [
            { level: 'normal', range: '', description: '' },
            { level: 'mild', range: '', description: '' },
            { level: 'severe', range: '', description: '' }
          ],
          female: [
            { level: 'normal', range: '', description: '' },
            { level: 'mild', range: '', description: '' },
            { level: 'severe', range: '', description: '' }
          ]
        },
        hip: {
          activeGender: 'male',
          male: [
            { level: 'normal', range: '', description: '' },
            { level: 'mild', range: '', description: '' },
            { level: 'severe', range: '', description: '' }
          ],
          female: [
            { level: 'normal', range: '', description: '' },
            { level: 'mild', range: '', description: '' },
            { level: 'severe', range: '', description: '' }
          ]
        }
      },
      form27: {},
      form28: {},
      form30: {},
      form29:{
        //是否开启拼手气红包
        enableRandomRedpacket:false,
        rules: [
          {
            minAmount: 0.01,
            maxAmount: 0.01,
            weight: 100,
          },
        ],

      },
      form31:{},
      form32:{},
      form33:{},
      form34:{},
      form35:{},
      form36:{},
      form37:{
        tradeType: ''
      },
      form40: {
        enablePhoneConfig: false,
        enablePhoneLimitConfig:false,
        generateCount: 1,
        startIndex: 1,
        endIndex: 11,
        numberCalls:1,
      },
      form41: [],   //数组，每一项是一个企业配置对象
      storeProductScrmColumns:[],
      storeScrmColumns: [],
      photoArr: [],
      couponList: [],
      inquirySubTypeOptions: [],
      // 表单校验
      rules1: {},
      rules3: {},
      rules40: {
        generateCount: [
          { required: true, message: '生成条数不能为空', trigger: 'blur' },
          { type: 'number', min: 1, message: '生成条数不能小于1', trigger: 'blur' }
        ],
        startIndex: [
          { required: true, message: '开始位置不能为空', trigger: 'blur' },
          { type: 'number', min: 1, max: 11, message: '开始位置必须在1到11之间', trigger: 'blur' }
        ],
        endIndex: [
          { required: true, message: '结束位置不能为空', trigger: 'blur' },
          { type: 'number', min: 1, max: 11, message: '结束位置必须在1到11之间', trigger: 'blur' }
        ],
      },
      rules4: {
        doctorRegister: [
          { required: true, message: '请输入医生注册协议', trigger: 'blur' }
        ],
        doctorFiling: [
          { required: true, message: '请输入医生多机构备案协议', trigger: 'blur' }
        ],
        userRegister: [
          { required: true, message: '请输入用户协议', trigger: 'blur' }
        ],
        userPrivacy: [
          { required: true, message: '请输入隐私协议', trigger: 'blur' }
        ],
        userHealth: [
          { required: true, message: '请输入健康客服协议', trigger: 'blur' }
        ],
        vipService: [
          { required: true, message: '请输入会员服务协议', trigger: 'blur' }
        ]
      },
      rulesDelay: [
        {
          validator: (rule, value, callback) => {
            if (value === '' || value == null) {
              callback() // 允许为空，不校验范围
            } else if (isNaN(value)) {
              callback(new Error('请输入有效数字'))
            } else if (value < 1000 || value > 2000) {
              callback(new Error('延时时间必须在1000-2000毫秒之间'))
            } else {
              callback()
            }
          },
          trigger: 'blur'
        }
      ],
      rules20: {
        levelDay: [{ required: true, message: '请输入评级天数', trigger: 'blur' }],
        aLevelMin: [{ required: true, message: '请输入A级最小值', trigger: 'blur' }],
        bLevelMin: [{ required: true, message: '请输入B级最小值', trigger: 'blur' }],
        bLevelMax: [{ required: true, message: '请输入B级最大值', trigger: 'blur' }],
        cLevelMin: [{ required: true, message: '请输入C级最小值', trigger: 'blur' }],
        cLevelMax: [{ required: true, message: '请输入C级最大值', trigger: 'blur' }],
        dLevelMax: [{ required: true, message: '请输入D级最大值', trigger: 'blur' }]
      },
      rules21: {},
      rules25: {},
      rules26: {},
      rules33: {},
      rules34: {},
      rules35: {},
      rules36: {
        tradeType: [
          { required: true, message: '请选择行业', trigger: 'change' }
        ]
      },
      tradeTypeOptions: [],
    }
  },
  created() {
    this.getDicts("trade_type").then((response) => {
      this.tradeTypeOptions = response.data;
    });
    this.checkProjectName();
    this.getConfigByKey(this.activeName)
    listStore().then(response => {
      this.storeOPtions = response.rows
    })
    this.getDicts('sys_inquiry_sub_type').then(response => {
      this.inquirySubTypeOptions = response.data
    })
    this.getDicts('sys_integral_log_type').then(response => {
      this.integralLogTypeOptions = response.data
    })
    this.getDicts("sys_sms_domain_name_list").then((response) => {
      this.smsDomainNameOptions = response.data;
    });
    getStoreProductColumns().then( response => {
      this.storeProductScrmColumns = response.data
    })
    getStoreColumns().then( response => {
      this.storeScrmColumns = response.data
    })
  },
  watch: {
    photoArr: function(val) {
      this.form4.certs = val.join(',')
    },
    images: function(val) {
      this.form21.images = val.join(',')
    },
    appImages: function(val) {
      this.form25.images = val.join(',')
    },
    // 深度监听 rules 数组的变化，以更新总权重
    "form29.rules": {
      handler(val) {
        this.calculateTotalWeight();
        this.validateRules();
      },
      deep: true,
    },
  },
  methods: {


    handleSmsDomainChange(value) {
      // 根据选中的 value 找到对应的 dict
      const selectedDict = this.smsDomainNameOptions.find(
        item => item.dictValue === value
      );
      // 将 dictLabel 存储到 form18.smsDomain
      if (selectedDict) {
        this.form18.smsDomain = selectedDict.dictLabel;
      }
    },
    /**
     * 新增游戏配置
     */
    addGameConfig() {
      if (!this.form25.gameList) {
        this.$set(this.form25, 'gameList', [])
      }

      // 限制最多10个游戏
      if (this.form25.gameList.length >= 10) {
        this.$message.warning('最多只能添加10个游戏')
        return
      }

      // 添加新游戏配置
      this.form25.gameList.push({
        id: Date.now() + Math.random(), // 临时ID
        image: '',
        name: '',
        url: '',
        sort: this.form25.gameList.length,
        status: 1, // 默认启用
        editing: true // 新增时直接进入编辑状态
      })

      this.$forceUpdate()
    },

    /**
     * 编辑游戏
     */
    editGame(index) {
      // 如果已经有其他行在编辑，先保存或取消
      const editingIndex = this.form25.gameList.findIndex(item => item.editing)
      if (editingIndex !== -1 && editingIndex !== index) {
        this.$confirm('当前有其他游戏正在编辑，是否继续？', '提示', {
          confirmButtonText: '继续',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
          // 取消其他行的编辑状态
          this.form25.gameList[editingIndex].editing = false
          // 设置当前行为编辑状态
          this.$set(this.form25.gameList[index], 'editing', true)
        }).catch(() => {})
      } else {
        this.$set(this.form25.gameList[index], 'editing', true)
      }
    },

    /**
     * 保存游戏
     */
    saveGame(index) {
      const game = this.form25.gameList[index]

      // 验证必填项
      if (!game.name) {
        this.$message.error('请输入游戏名称')
        return
      }
      if (!game.url) {
        this.$message.error('请输入游戏链接')
        return
      }
      if (!game.image) {
        this.$message.error('请上传游戏图片')
        return
      }

      // 验证URL格式
      const urlPattern = /^(http|https):\/\/[^\s]+$/
      if (!urlPattern.test(game.url)) {
        this.$message.error('请输入正确的游戏链接（以http://或https://开头）')
        return
      }

      // 保存成功，退出编辑状态
      this.$set(this.form25.gameList[index], 'editing', false)
      this.$message.success('保存成功')
    },

    /**
     * 取消编辑
     */
    cancelEdit(index) {
      const game = this.form25.gameList[index]

      // 如果是新增但未保存（没有id），直接删除
      if (!game.id || game.id.toString().includes('.')) {
        this.form25.gameList.splice(index, 1)
      } else {
        this.$set(this.form25.gameList[index], 'editing', false)
      }
    },

    /**
     * 删除游戏
     */
    deleteGame(index) {
      this.$confirm('确定要删除这个游戏吗？', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        this.form25.gameList.splice(index, 1)
        // 重新排序
        this.form25.gameList.forEach((item, idx) => {
          item.sort = idx
        })
        this.$message.success('删除成功')
      }).catch(() => {})
    },


    // 处理开关配置
    handleSwitchConfig(row) {
      this.switchForm.appId = row.appid
      this.switchForm.switchStatus = '001' // 默认关闭状态

      // 调用接口获取开关状态
      this.getSwitchConfig(row.appid)
      this.switchDialogVisible = true
    },

    // 获取开关配置
    getSwitchConfig(appId) {
      const params = {
        appId: this.switchForm.appId
      }
      updateIsTownOn(params).then(response => {
        if (response.code === 200) {
          if (response.date) {
            this.switchForm.switchStatus = response.date
          }
        } else {
          this.$message.error('获取配置失败: ' + response.msg)
        }
      }).catch(error => {
        this.$message.error('请求失败: ' + error.message)
      })
    },

    // 提交开关配置
    submitSwitchConfig() {
      const params = {
        appId: this.switchForm.appId,
        bock: this.switchForm.switchStatus
      }
      updateIsTownOn(params).then(response => {
        if (response.code === 200) {
          this.$message.success('配置更新成功')
          this.switchDialogVisible = false
        } else {
          this.$message.error('更新失败: ' + response.msg)
        }
      })
    },


    getCompanyOptions() {
      listCompany().then(response => {
        this.companyOptions = response.rows
      })
    },

    handleSuccess(response, file) {
      // 上传成功后的回调函数
      this.myloading.close()
      this.form21.videoUrl = response.url
      this.$refs.upload.clearFiles()
    },
    appHandleSuccess(response, file) {
      // 上传成功后的回调函数
      this.myloading.close()
      this.form25.videoUrl = response.url
      this.$refs.upload.clearFiles()
    },
    beforeUpload(file) {
      // 上传前的钩子函数，可以在这里对文件进行处理
      // 返回 false 则取消上传

      // 例如限制文件大小
      const isLt2M = file.size / 1024 / 1024 < 200
      if (!isLt2M) {
        this.$message.error('上传视频文件大小不能超过 200MB!')
        return false
      }
      this.myloading = this.$loading({
        lock: true,
        text: '上传中',
        spinner: 'el-icon-loading',
        background: 'rgba(0, 0, 0, 0.7)'
      })

    },
    submitCourseMaConfig() {
      // 验证所有必填字段
      const isValid = this.courseMaConfigList.every(item => {
        return item.name && item.appid && item.secret
      })

      if (!isValid) {
        this.$message.error('请填写所有必填字段')
        return
      }

      var param = { configId: this.configId, configValue: JSON.stringify(this.courseMaConfigList) }
      updateConfigByKey(param).then(response => {
        if (response.code === 200) {
          this.msgSuccess('修改成功')
        }
      })
    },
    deleteInquirySubType(index, row) {
      this.form2.inquirySubType.splice(index, 1)
    },
    handleClick(tab, event) {
    this.getConfigByKey(tab.name)


    },
    handleAddProduct() {
      setTimeout(() => {
        this.$refs.Details.getDetails()
      }, 1)
      this.product.open = true

    },
    addInquirySubType() {

      this.form2.inquirySubType.push({ lable: '名称', value: null })
    },
    handleDeliveryGift() {
      setTimeout(() => {
        this.$refs.DeliveryGiftDetails.getDetails()
      }, 1)
      this.deliveryGift.open = true
    },

    selectProduct(row) {

      this.form8.gift = [row]
      this.product.open = false
      this.$message({
        message: '添加成功',
        type: 'success'
      })
    },

    selectDeliveryGift(row) {

      this.form8.deliveryGift = [row]
      this.deliveryGift.open = false
      this.$message({
        message: '添加成功',
        type: 'success'
      })
    },
    close() {
      this.product.open = false
    },
    getConfigByKey(key) {
      getConfigByKey(key).then(response => {
        if(!!response.data){
          this.configId = response.data.configId
          this.configKey = response.data.configKey
          if (key == 'cId.config') {
            this.form40 = JSON.parse(response.data.configValue);
          }
        }else{
          this.configId = null;
          this.configKey = key;
          if (key == 'cId.config') {
            this.form40 = { enablePhoneConfig: false, generateCount: 1 };
          } else if (key == 'aiTagTradeType.config') {
            this.form36 = { tradeType: '' };
          }
        }
        if (key == 'sys.oss.cloudStorage') {
          this.form1 = JSON.parse(response.data.configValue)
        }
        if (key == 'his.inquiryConfig') {
          this.form2 = JSON.parse(response.data.configValue)
        }
        if (key == 'his.agreementConfig') {
          this.form3 = JSON.parse(response.data.configValue)
        }
        if (key == 'his.certs') {
          this.form4 = JSON.parse(response.data.configValue)
          if (this.form4.certs != null) {
            this.photoArr = this.form4.certs.split(',')
          }
        }
        if (key == 'his.brokerage') {
          this.form5 = JSON.parse(response.data.configValue)
        }
        if (key == 'his.coupon') {
          allList().then(response => {
            this.couponList = response.data
          })
          this.form6 = JSON.parse(response.data.configValue)

        }
        if (key == 'his.store') {
          this.form7 = JSON.parse(response.data.configValue)
          getAllFollowTempName().then(response => {
            this.tempOptions = response.rows
          })
        }
        if (key == 'his.store') {
          // this.form7 =JSON.parse(response.data.configValue);
          const parsed = JSON.parse(response.data.configValue)
          if (parsed.isUpdateOrder != null) {
            parsed.isUpdateOrder = Number(parsed.isUpdateOrder)
          } else {
            parsed.isUpdateOrder = 1 // 默认值
          }
          this.form7 = parsed
        }
        if (key == 'his.package') {
          this.form8 = JSON.parse(response.data.configValue)
        }
        if (key == 'his.pay') {
          this.form9 = JSON.parse(response.data.configValue)
        }
        if (key == 'store.pay') {
          this.form23 = JSON.parse(response.data.configValue)
        }
        if (key == 'his.appShow') {
          this.form10 = JSON.parse(response.data.configValue)
        }
        if (key == 'his.integral') {
          return
        }
        if (key == 'his.sign') {
          this.form12 = JSON.parse(response.data.configValue)
        }
        if (key == 'his.config') {
          this.getCompanyOptions()
          this.form13 = JSON.parse(response.data.configValue)
          if (this.form13.enableLogisticCodeRecognition == null) {
            this.$set(this.form13, 'enableLogisticCodeRecognition', false)
          }
        }
        if (key == 'store.config') {
          this.form17 = JSON.parse(response.data.configValue)
        }
        if (key == 'his.sms') {
          this.form14 = JSON.parse(response.data.configValue)
        }
        if (key == 'qw:config') {
          this.form15 = JSON.parse(response.data.configValue)
        }
        if (key == 'qw.sessionConfig') {
          if (response.data && response.data.configValue) {
            let parsed = JSON.parse(response.data.configValue);
            // 确保是数组，如果不是，则重置为空数组（清空旧数据）
            if (!Array.isArray(parsed)) {
              parsed = [];
            }
            // 确保每个元素都有 abilityIds
            parsed.forEach(ent => {
              if (!ent.abilityIds) ent.abilityIds = [];
            });
            this.form41 = parsed;
          } else {
            // 无配置时，默认一个空企业模板
            this.form41 = [{
              corpid: '',
              corpName: '',
              agentid: '',
              agentSecret: '',
              programId: '',
              privateKey: '',
              abilityIds: []
            }];
          }
        }
        if (key == 'his.brand') {
          this.form16 = JSON.parse(response.data.configValue)
        }
        if (key == 'course.config') {
          const parsed = JSON.parse(response.data.configValue)
          if (parsed.validateAnswerWhenWatch == null || parsed.validateAnswerWhenWatch === '') {
            parsed.validateAnswerWhenWatch = '1'
          }
          this.form18 = parsed
        }
        if (key == 'redPacket.config') {
          this.form19 = JSON.parse(response.data.configValue)
        }
        if (key == 'qwRating.config') {
          this.form20 = JSON.parse(response.data.configValue)
        }
        if (key == 'courseMa.config') {
          this.courseMaConfigLoading = true
          if (response.data && response.data.configValue) {
            this.courseMaConfigList = JSON.parse(response.data.configValue).map(item => ({
              ...item,
              editing: false
            }))
          } else {
            this.courseMaConfigList = []
          }
          this.courseMaConfigLoading = false
        }
        if (key == 'his.login') {
          this.form22 = JSON.parse(response.data.configValue)
        }
        if (key === 'his.healthIndexConfig') {
          this.form26 = JSON.parse(response.data.configValue)
        } else if (key == 'store.concept') {
          this.configId = response.data.configId
          this.configKey = response.data.configKey
          this.form21 = JSON.parse(response.data.configValue)
          if (this.form21.images != null) {
            this.images = this.form21.images.split(',')
          }
        } else if (key == 'store.integral') {
          this.configId = response.data.configId
          this.configKey = response.data.configKey
          this.form24 = JSON.parse(response.data.configValue)
        } else if (key == 'app.config') {
          listQwCompany().then(response => {
            this.corpOptions = response.rows;
          });
          this.configId = response.data.configId
          this.configKey = response.data.configKey
          this.form25 = JSON.parse(response.data.configValue)
          if (this.form25.images != null) {
            this.appImages = this.form25.images.split(',')
          }
        }else if (key == 'medicalMall.func.switch') {
          this.configId = response.data.configId
          this.configKey = response.data.configKey
          this.form27 = {...this.form27, ...JSON.parse(response.data.configValue)}
        }
        if (key == 'his.zzzs') {
          this.configId = response.data.configId
          this.configKey = response.data.configKey
          this.form28 = {...this.form28, ...JSON.parse(response.data.configValue)}
        }
        if (key == 'randomRedpacket:config') {
          if(!!response.data){
            this.configId = response.data.configId
            this.configKey = response.data.configKey
            this.form29 = {...this.form29, ...JSON.parse(response.data.configValue)}
          }
        }
        if (key == 'wx.config') {
          if(!!response.data){
            this.configId = response.data.configId
            this.configKey = response.data.configKey
            this.form30 = {...this.form30, ...JSON.parse(response.data.configValue)}
          }
        }

        if(key=="luckyBag.config"){
          this.form33 =JSON.parse(response.data.configValue);
        }
        if(key=="im.config"){
          this.form34 =JSON.parse(response.data.configValue);
        }
        if(key=="courseAppConfig.config"){
          this.form35 =JSON.parse(response.data.configValue);
        }
        if (key == 'his.AppRedPacket') {
          if (response.data && response.data.configValue) {
            this.form36 = JSON.parse(response.data.configValue);
          } else {
            // 如果没有配置，使用默认值
            this.form36 = {
              isNew: '1',
              mchId: '',
              notifyUrl: '',
              LiveNotifyUrl: '',
              mchKey: '',
              keyPath: '',
              apiV3Key: '',
              serialNo: '',
              privateCertPath: '',
              privateKeyPath: '',
              publicKeyPath: ''
            };
          }
          this.configId = response.data?.configId || null;
          this.configKey = response.data?.configKey || 'his.AppRedPacket';
        }
        if(key=="aiTagTradeType.config"){
          if (response.data && response.data.configValue) {
            const parsed = JSON.parse(response.data.configValue);
            let tradeType = '';
            if (Array.isArray(parsed)) {
              tradeType = parsed[0] != null ? String(parsed[0]) : '';
            } else if (parsed && typeof parsed === 'object') {
              if (parsed.tradeType != null && parsed.tradeType !== '') {
                tradeType = String(parsed.tradeType);
              } else if (Array.isArray(parsed.tradeTypes) && parsed.tradeTypes.length) {
                tradeType = String(parsed.tradeTypes[0]);
              }
            }
            this.form37 = { tradeType };
          } else {
            this.form37 = { tradeType: '' };
          }
        }
        if(key == 'vc.config'){
          if(!!response.data){
            this.configId = response.data.configId
            this.configKey = response.data.configKey
            this.form31 = {...this.form31, ...JSON.parse(response.data.configValue)}
          }
        }
        if(key == 'living.config'){
          if(!!response.data){
            this.configId = response.data.configId
            this.configKey = response.data.configKey
            this.form32 = {...this.form32, ...JSON.parse(response.data.configValue)}
          }
        }
         if(key == "cId.config" && !!this.form40.enableGateWayLimit){
        getGatewayList().then(res=>{
          this.gatewayList = res.data;
        }).catch(res=>{
        })
      }
      })
    },
    /** 提交按钮 */
    submitForm1: function() {
      this.$refs['form1'].validate(valid => {
        if (valid) {
          var param = { configId: this.configId, configValue: JSON.stringify(this.form1) }
          updateConfigByKey(param).then(response => {
            if (response.code === 200) {
              this.msgSuccess('修改成功')
            }
          })
        }
      })
    },
    submitForm3() {
      this.$refs['form3'].validate(valid => {
        if (valid) {
          var param = { configId: this.configId, configValue: JSON.stringify(this.form3) }
          updateConfigByKey(param).then(response => {
            if (response.code === 200) {
              this.msgSuccess('修改成功')
            }
          })
        }
      })
    },
    submitForm4() {
      var param = { configId: this.configId, configValue: JSON.stringify(this.form4) }
      updateConfigByKey(param).then(response => {
        if (response.code === 200) {
          this.msgSuccess('修改成功')
        }
      })
    },
    submitForm5() {
      var param = { configId: this.configId, configValue: JSON.stringify(this.form5) }
      updateConfigByKey(param).then(response => {
        if (response.code === 200) {
          this.msgSuccess('修改成功')
        }
      })
    },
    submitForm6() {
      var param = { configId: this.configId, configValue: JSON.stringify(this.form6) }
      updateConfigByKey(param).then(response => {
        if (response.code === 200) {
          this.msgSuccess('修改成功')
        }
      })
    },
    submitForm7() {
      if (this.form7.isIdVerification  == null){
        this.form7.isIdVerification = 0;
      }
      if (this.form7.payPostage  == null){
        this.form7.payPostage = 0;
      }
      if(this.form7.isIdVerification != 1){
        this.form7.API_URL = null;
        this.form7.HASHCODE = null;
        this.form7.SECRET_KEY = null;
      } else{
        // 校验这三个参数是否为空
        if (
          !this.form7.API_URL ||
          !this.form7.HASHCODE ||
          !this.form7.SECRET_KEY
        ) {
          this.msgError("API_URL、HASHCODE 和 SECRET_KEY 为必填项");
          return; // 阻止提交
        }
      }
      var param = { configId: this.configId, configValue: JSON.stringify(this.form7) }
      updateConfigByKey(param).then(response => {
        if (response.code === 200) {
          this.msgSuccess('修改成功')
        }
      })
    },
    submitForm8() {
      var param = { configId: this.configId, configValue: JSON.stringify(this.form8) }
      updateConfigByKey(param).then(response => {
        if (response.code === 200) {
          this.msgSuccess('修改成功')
        }
      })
    },
    submitForm9() {
      var param = { configId: this.configId, configValue: JSON.stringify(this.form9) }
      updateConfigByKey(param).then(response => {
        if (response.code === 200) {
          this.msgSuccess('修改成功')
        }
      })
    },
    submitForm23() {
      var param = { configId: this.configId, configValue: JSON.stringify(this.form23) }
      updateConfigByKey(param).then(response => {
        if (response.code === 200) {
          this.msgSuccess('修改成功')
        }
      })
    },

    submitForm10() {
      var param = { configId: this.configId, configValue: JSON.stringify(this.form10) }
      updateConfigByKey(param).then(response => {
        if (response.code === 200) {
          this.msgSuccess('修改成功')
        }
      })
    },
    submitForm12() {
      var param = { configId: this.configId, configValue: JSON.stringify(this.form12) }
      updateConfigByKey(param).then(response => {
        if (response.code === 200) {
          this.msgSuccess('修改成功')
        }
      })
    },
    submitForm13() {
      const accounts = this.form13.dfAccounts

      var param = { configId: this.configId, configValue: JSON.stringify(this.form13) }
      updateConfigByKey(param).then(response => {
        if (response.code === 200) {
          this.msgSuccess('修改成功')
        }
      })
    },
    submitForm14() {
      if (!this.form14.isSmsVerification) {
        this.form14.isSmsVerification = 0;
      }
      var param = { configId: this.configId, configValue: JSON.stringify(this.form14) }
      updateConfigByKey(param).then(response => {
        if (response.code === 200) {
          this.msgSuccess('修改成功')
        }
      })
    },
    submitForm15() {
      var param = { configId: this.configId, configValue: JSON.stringify(this.form15) }
      updateConfigByKey(param).then(response => {
        if (response.code === 200) {
          this.msgSuccess('修改成功')
        }
      })
    },
    submitForm16() {
      var param = { configId: this.configId, configValue: JSON.stringify(this.form16) }
      updateConfigByKey(param).then(response => {
        if (response.code === 200) {
          this.msgSuccess('修改成功')
        }
      })
    },
    submitForm17() {
      var param = { configId: this.configId, configValue: JSON.stringify(this.form17) }
      updateConfigByKey(param).then(response => {
        if (response.code === 200) {
          this.msgSuccess('修改成功')
        }
      })
    },
    submitForm22() {
      var param = { configId: this.configId, configValue: JSON.stringify(this.form22) }
      updateConfigByKey(param).then(response => {
        if (response.code === 200) {
          this.msgSuccess('修改成功')
        }
      })
    },
    submitForm18() {
      var param = { configId: this.configId, configValue: JSON.stringify(this.form18) }
      updateConfigByKey(param).then(response => {
        if (response.code === 200) {
          this.msgSuccess('修改成功')
        }
      })
    },
    submitForm19() {
      var param = { configId: this.configId, configValue: JSON.stringify(this.form19) }
      updateConfigByKey(param).then(response => {
        if (response.code === 200) {
          this.msgSuccess('修改成功')
        }
      })
    },
    submitForm20() {

      this.$refs['form20'].validate((valid) => {
        if (valid) {
          const {
            aLevelMin,
            aLevelMax,
            bLevelMin,
            bLevelMax,
            cLevelMin,
            cLevelMax,
            dLevelMin,
            dLevelMax
          } = this.form20

          // 检查范围是否连续且总长度为100%
          const totalLength = (100 - aLevelMin) + (bLevelMax - bLevelMin) + (cLevelMax - cLevelMin) + (dLevelMax)
          if (totalLength !== 100) {
            this.$message.error('所有等级范围必须连续且总长度为100%')
            return
          }

          var param = { configId: this.configId, configValue: JSON.stringify(this.form20) }
          updateConfigByKey(param).then(response => {
            if (response.code === 200) {
              this.msgSuccess('修改成功')
            }
          })

        } else {
          this.$message.error('请检查输入')
          return false
        }
      })

    },
    submitForm25() {
      var param = { configId: this.configId, configKey: this.configKey, configValue: JSON.stringify(this.form25) }
      updateConfigByKey(param).then(response => {
        if (response.code === 200) {
          this.msgSuccess('修改成功')
        }
      })
    },
    submitForm21() {
      var param = { configId: this.configId, configKey: this.configKey, configValue: JSON.stringify(this.form21) }
      updateConfigByKey(param).then(response => {
        if (response.code === 200) {
          this.msgSuccess('修改成功')
        }
      })
    },
    submitForm26() {
      const param = {
        configId: this.configId,
        configKey: this.configKey,
        configValue: JSON.stringify(this.form26)
      }

      updateConfigByKey(param).then(response => {
        if (response.code === 200) {
          this.msgSuccess('健康指标配置保存成功')
        } else {
          this.msgError('保存失败')
        }
      })
    },
    submitForm27() {
      const param = { configId: this.configId, configKey: this.configKey, configValue: JSON.stringify(this.form27) }
      updateConfigByKey(param).then(response => {
        if (response.code === 200) {
          this.msgSuccess('修改成功')
        }
      })
    },
    submitForm28(){
      const param = { configId: this.configId, configKey: this.configKey, configValue: JSON.stringify(this.form28) }
      updateConfigByKey(param).then(response => {
        if (response.code === 200) {
          this.msgSuccess('修改成功')
        }
      })
    },
    submitForm30(){
      const param = { configId: this.configId, configKey: this.configKey, configValue: JSON.stringify(this.form30) }
      updateConfigByKey(param).then(response => {
        if (response.code === 200) {
          this.msgSuccess('修改成功')
        }
      })
    },
    submitForm31(){
      const param = { configId: this.configId, configName : "声纹复刻配置", configKey: this.configKey, configValue: JSON.stringify(this.form31) }
      updateConfigByKey(param).then(response => {
        if (response.code === 200) {
          this.msgSuccess('修改成功')
        }
      })
    },
    submitForm33(){
      var param={configId:this.configId,configValue:JSON.stringify(this.form33)}
      updateConfigByKey(param).then(response => {
        if (response.code === 200) {
          this.msgSuccess("修改成功");
        }
      });
    },
    submitForm34(){
      var param={configId:this.configId,configValue:JSON.stringify(this.form34)}
      updateConfigByKey(param).then(response => {
        if (response.code === 200) {
          this.msgSuccess("修改成功");
        }
      });
    },
    submitForm35(){
      var param={configId:this.configId,configName : "APP看课配置", configKey: this.configKey,configValue:JSON.stringify(this.form35)}
      updateConfigByKey(param).then(response => {
        if (response.code === 200) {
          this.msgSuccess("修改成功");
        }
      });
    },
    submitForm36(){
      var param={configId:this.configId,configName : "APP提现配置", configKey: this.configKey,configValue:JSON.stringify(this.form36)}
      updateConfigByKey(param).then(response => {
        if (response.code === 200) {
          this.msgSuccess("修改成功");
        }
      });
    },
    submitForm37(){
      var param={configId:this.configId,configName : "AI打标签行业配置", configKey: this.configKey,configValue:JSON.stringify(this.form37)}
      updateConfigByKey(param).then(response => {
        if (response.code === 200) {
          this.msgSuccess("修改成功");
        }
      });
    },
    submitForm32(){
      const param = { configId: this.configId, configName : "直播源配置", configKey: this.configKey, configValue: JSON.stringify(this.form32) }
      updateConfigByKey(param).then(response => {
        if (response.code === 200) {
          this.msgSuccess('修改成功')
        }
      })
    },
    submitForm40() {
      if (this.form40.enablePhoneConfig) {
        if (!this.form40.generateCount || this.form40.generateCount < 1) {
          this.msgError('生成条数不能为空且不能小于1');
          return false;
        }

        // if (!this.form40.generateCount || this.form40.generateCount > 10) {
        //   this.msgError('单个手机号生成条数不能大于10条');
        //   return false;
        // }

        if (!this.form40.startIndex || this.form40.startIndex < 1 || this.form40.startIndex > 11) {
          this.msgError('开始位置不能为空，且必须在1到11之间');
          return false;
        }

        if (!this.form40.endIndex || this.form40.endIndex < 1 || this.form40.endIndex > 11) {
          this.msgError('结束位置不能为空，且必须在1到11之间');
          return false;
        }

        if (this.form40.startIndex > this.form40.endIndex) {
          this.msgError('开始位置不能大于结束位置');
          return false;
        }

        if (this.form40.endIndex < this.form40.startIndex) {
          this.msgError('结束位置不能小于开始位置');
          return false;
        }
        if (this.form40.startIndex === this.form40.endIndex) {
          this.msgError('开始位置不能等于结束位置');
          return false;
        }

        let num = this.form40.endIndex - this.form40.startIndex
        if(num < 4){
          this.msgError('开始和结束位置不能小于4位');
          return false;
        }
      }

      if(this.form40.enablePhoneLimitConfig){
        if(this.form40.numberCalls == null || this.form40.numberCalls === 0){
          this.msgError('限制次数不能为空或者大于0！');
          return false;
        }
        if(this.form40.numberCalls > 100000){
          this.msgError('限制次数不能超过10万次！');
          return false;
        }
      }

      this.saveConfig40();
    },
    // 添加一个新企业
    addEnterprise() {
      this.form41.push({
        corpid: '',
        corpName: '',
        agentid: '',
        agentSecret: '',
        programId: '',
        privateKey: '',
        abilityIds: []
      });
    },

    // 删除指定企业
    removeEnterprise(index) {
      this.$confirm('确定删除该企业配置吗？', '提示', { type: 'warning' }).then(() => {
        this.form41.splice(index, 1);
        if (this.form41.length === 0) {
          // 如果全部删光，再给一个空的，避免界面空白
          this.addEnterprise();
        }
      }).catch(() => {});
    },

    // 为某个企业添加能力ID
    addAbilityId(entIndex) {
      this.form41[entIndex].abilityIds.push({ key: '', value: '' });
    },

    // 删除某个企业的某条能力ID
    removeAbilityId(entIndex, abilityIndex) {
      this.form41[entIndex].abilityIds.splice(abilityIndex, 1);
    },

    // 提交多企业配置
    submitQwSessionConfig41() {
      // 简单校验：至少有一个企业且企业ID和私钥不能为空
      if (this.form41.length === 0) {
        this.$message.error('请至少添加一个企业配置');
        return;
      }
      for (let i = 0; i < this.form41.length; i++) {
        const ent = this.form41[i];
        if (!ent.corpid) {
          this.$message.error(`第${i+1}个企业的企业ID不能为空`);
          return;
        }
        if (!ent.privateKey) {
          this.$message.error(`第${i+1}个企业的会话密钥不能为空`);
          return;
        }
      }
      const param = {
        configId: this.configId,
        configKey: this.configKey,
        configValue: JSON.stringify(this.form41)
      };
      updateConfigByKey(param).then(response => {
        if (response.code === 200) {
          this.msgSuccess('保存成功');
        }
      });
    },

    saveConfig40() {
      const param = {
        configId: this.configId,
        configKey: this.configKey,
        configValue: JSON.stringify(this.form40)
      };
      updateConfigByKey(param).then(response => {
        if (response.code === 200) {
          this.msgSuccess('修改成功');
        }
      });
    },
    formatColumns(){

    },
    submitForm24() {
      this.$refs['form24'].validate(valid => {
        if (valid) {
          var param = { configId: this.configId, configKey: this.configKey, configValue: JSON.stringify(this.form24) }
          updateConfigByKey(param).then(response => {
            if (response.code === 200) {
              this.msgSuccess('修改成功')
            }
          })
        }
      })
    },
    submitform2() {
      // 将对象转换为JSON字符串并保留两位小数
      var json_data = JSON.stringify(this.form2, function(key, value) {
        if (key == 'price') {
          return value.toFixed(2)
        }
        return value
      })
// 将对象转换为 JSON 字符串
      var param = { configId: this.configId, configValue: json_data }
      updateConfigByKey(param).then(response => {
        if (response.code === 200) {
          this.msgSuccess('修改成功')
        }
      })
    },
    /** 清理缓存按钮操作 */
    handleClearCache() {
      clearCache().then(response => {
        if (response.code === 200) {
          this.msgSuccess('清理成功')
        }
      })
    },
    deleteCourseMaConfig(index) {
      this.$confirm('确认删除该配置?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        this.courseMaConfigList.splice(index, 1)
        this.$message.success('删除成功')
      }).catch(() => {
      })
    },
    addCourseMaConfig() {
      this.courseMaConfigList.push({
        name: '',
        appid: '',
        secret: '',
        token: '',
        aesKey: '',
        msgDataFormat: '',
        editing: true
      })
    },
    handleEdit(index, row) {
      this.$set(this.courseMaConfigList[index], 'editing', true)
    },
    handleSave(index, row) {
      // 验证必填字段
      if (!row.name || !row.appid || !row.secret) {
        this.$message.error('请填写所有必填字段')
        return
      }
      this.$set(this.courseMaConfigList[index], 'editing', false)
    },
    addDisabledTime() {
      if (this.form18.disabledTimeList == null || this.form18.disabledTimeList == undefined) {
        this.form18.disabledTimeList = []
      }
      this.form18.disabledTimeList.push({ startDisabledTime: '', endDisabledTime: '' })
      this.$forceUpdate()
    },
    removeDisabledTime(index) {
      this.form18.disabledTimeList.splice(index, 1)
    },
    submitForm29(){
      this.$refs['form29'].validate(valid => {
        if (valid) {
          var param = { configId: this.configId, configKey: this.configKey, configValue: JSON.stringify(this.form29) }
          param.configName = "拼手气红包配置";
          updateConfigByKey(param).then(response => {
            if (response.code === 200) {
              this.msgSuccess('修改成功')
            }
          })
        }
      })
    },
    calculateTotalWeight() {
      this.totalWeight = this.form29.rules.reduce((sum, rule) => {
        return sum + (rule.weight || 0);
      }, 0);
    },

    validateRules() {
      this.form29.rules.forEach((rule) => {
        if (rule.minAmount === undefined || rule.minAmount < 0.01) {
          rule.minAmount = 0.01;
        }
        if (rule.maxAmount === undefined || rule.maxAmount < rule.minAmount) {
          rule.maxAmount = rule.minAmount;
        }
        if (rule.weight === undefined || rule.weight < 1) {
          rule.weight = 1;
        }
      });
    },

    // 自定义校验规则：确保最大金额大于最小金额
    validateMinAmount(rule, value, callback) {
      // debugger;
      // const maxAmount = this.form29.rules[].maxAmount

      const index = rule.index;
      const maxAmount = this.form29.rules[index].maxAmount;

      if (value > maxAmount) {
        callback(new Error("最小金额不能大于最大金额"));
      } else {
        callback();
      }
    },

    addRule(index) {
      // 在当前行的后面插入一个新行
      this.form29.rules.splice(index + 1, 0, {
        minAmount: 0.01,
        maxAmount: 0.01,
        weight: 100,
      });
    },

    deleteRule(index) {
      this.$confirm("确定要删除这个区间吗？", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      }).then(() => {
        this.form29.rules.splice(index, 1);
        this.$message({
          type: "success",
          message: "删除成功!",
        });
      });
    },
    // 实时过滤金额输入，只允许两位小数
    handleAmountInput(rule, field) {
      let value = rule[field];
      if (value === null || value === undefined) return;

      // 转换为字符串处理
      let str = value.toString();

      // 移除除数字和小数点外的所有字符
      str = str.replace(/[^0-9.]/g, '');

      // 只保留一个小数点
      const dotIndex = str.indexOf('.');
      if (dotIndex !== -1) {
        str = str.substring(0, dotIndex + 1) + str.substring(dotIndex + 1).replace(/\./g, '');
      }

      // 限制小数点后最多两位
      if (dotIndex !== -1 && str.length > dotIndex + 3) {
        str = str.substring(0, dotIndex + 3);
      }

      // 转换回数字并更新
      rule[field] = parseFloat(str) || 0;
    },
     checkProjectName() {
       getSignProjectName().then(r=>{
         this.isBeiJingZhuoMei = r.signProjectName === '北京卓美';
       });
    },
  },
}
</script>
<style scoped>
.footer {
  width: 100%;
  display: flex;
  margin-top: 50px;
  align-items: flex-end;
  justify-content: flex-end;
}




.red-packet-config {
  padding: 20px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.red-packet-form {
  margin-top: 20px;
}

/* 每一行的样式 */
.form-row {
  display: flex;
  /* align-items: center;
  padding: 10px;
  border-bottom: 1px solid #ebeef5; */
  display: flex;
  /* 关键改动：添加以下两行 */
  align-items: center;    /* 垂直居中对齐 */
  justify-content: flex-start; /* 水平方向从左到右排列（默认值，可显式写出） */

  padding: 10px;
  border-bottom: 1px solid #ebeef5;
}

/* 最后一行去掉下边框 */
.form-row:last-child {
  border-bottom: none;
}

.form-item-amount {
  flex: 1;
  margin-right: 20px;
}

.form-item-weight {
  width: 220px;
  margin-right: 20px;
}

.action-buttons {
  display: flex;
  align-items: center;
}

.amount-input {
  width: 100px !important;
  text-align: center;
}

/* 金额输入框之间的连接符 */
.separator {
  margin: 0 10px;
  color: #999;
}

.suffix {
  margin-left: 10px;
  color: #999;
}

.add-btn {
  /* color: #48bb78 !important; */
}

.delete-btn {
  color: #f56c6c !important;
}

.rules-info {
  margin-top: 20px;
  padding: 15px;
  background-color: #f9f9f9;
  border-radius: 4px;
  font-size: 14px;
  color: #666;
}

.info-number {
  color: #1890ff;
  font-weight: bold;
  margin: 0 4px;
}

.action-bar {
  margin-top: 20px;
  display: flex;
  justify-content: flex-end;
}

.app-config-form {
  padding: 10px;
}

.config-card {
  margin-bottom: 24px;
  border-radius: 12px;
  border: none;
  box-shadow: 0 2px 12px 0 rgba(0,0,0,0.05);
}

.config-card ::v-deep .el-card__body {
  padding: 24px;
}

/* 章节标题样式 - 图标和文字在一起 */
.section-title {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
}

.title-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 12px;
  flex-shrink: 0;
}

.title-icon i {
  color: #fff;
  font-size: 20px;
}

.icon-promotion {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.title-text h3 {
  margin: 0;
  font-size: 18px;
  color: #303133;
  font-weight: 600;
  line-height: 1.4;
}

.subtitle {
  margin: 4px 0 0 0;
  font-size: 13px;
  color: #909399;
  line-height: 1.4;
}

/* 分割线 */
.el-divider {
  margin: 20px 0;
  background-color: #ebeef5;
}

/* 表单项 */
.app-config-form ::v-deep .el-form-item {
  margin-bottom: 24px;
}

.app-config-form ::v-deep .el-form-item:last-child {
  margin-bottom: 0;
}

.help-icon {
  margin-left: 8px;
  color: #c0c4cc;
  cursor: help;
  font-size: 16px;
  transition: color 0.3s;
}

.help-icon:hover {
  color: #409EFF;
}

/* 上传区域 */
.upload-wrapper {
  display: flex;
  flex-direction: column;
}

.upload-tip {
  margin-top: 8px;
  color: #909399;
  font-size: 12px;
}

/* 视频上传 */
.video-upload-wrapper {
  width: 100%;
  max-width: 400px;
}

.video-uploader ::v-deep .el-upload {
  width: 100%;
}

.video-uploader ::v-deep .el-upload-dragger {
  width: 100%;
  height: 160px;
  background: #fafafa;
  border: 2px dashed #dcdfe6;
  border-radius: 8px;
}

.video-uploader ::v-deep .el-upload-dragger:hover {
  border-color: #409EFF;
}

.preview-video {
  width: 100%;
  max-width: 400px;
  max-height: 250px;
  border-radius: 8px;
  background: #000;
}

.video-preview {
  position: relative;
  display: inline-block;
}

.video-actions {
  position: absolute;
  top: 10px;
  right: 10px;
  opacity: 0;
  transition: opacity 0.3s;
}

.video-preview:hover .video-actions {
  opacity: 1;
}

/* 底部按钮 */
.form-footer {
  margin-top: 32px;
  padding-left: 160px;
}

.form-footer .el-button {
  min-width: 100px;
  padding: 12px 24px;
  border-radius: 6px;
}

/* 响应式 */
@media screen and (max-width: 768px) {
  .section-title {
    margin-bottom: 16px;
  }

  .form-footer {
    padding-left: 0;
    text-align: center;
  }

  .config-card ::v-deep .el-card__body {
    padding: 16px;
  }
}


/* 游戏列表样式 */
.game-list-item {
  margin-top: 20px;
}

.game-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.game-list-tip {
  font-size: 12px;
  color: #909399;
}

.game-image-preview {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 50px;
}

.no-image {
  font-size: 12px;
  color: #909399;
}

.game-link {
  display: inline-block;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #409EFF;
  cursor: pointer;
}

.delete-btn {
  color: #f56c6c !important;
}

.delete-btn:hover {
  color: #f78989 !important;
}

/* 表格样式优化 */
::v-deep .el-table .cell {
  padding-left: 8px;
  padding-right: 8px;
}

::v-deep .el-table th {
  background-color: #f5f7fa;
  color: #606266;
}

::v-deep .el-table--border {
  border-radius: 8px;
  overflow: hidden;
}

/* 图片上传组件样式调整 */
::v-deep .image-upload {
  width: 60px;
  height: 60px;
}

::v-deep .image-upload .el-upload--picture-card {
  width: 60px;
  height: 60px;
  line-height: 64px;
}
</style>
